Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,19 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
skill frontmatter, read-only guarantees for `ask`/`wiki-scout`, that every
bundled path a skill references exists, and that `parity-watch` pins the same
SHA as `PARITY.md`.
- **Generated doctrine (drift-locked to the real prompt).**
`scripts/build-disciplines.mjs` (dev/CI only — never run by users) derives
`references/disciplines.md` and `references/wiki-format.md` from the vendored
OpenWiki system prompt (`vendor/openwiki/src/agent/prompt.ts`) via a documented
tool-vocabulary translation (DeepAgents virtual filesystem → Claude Code
`Read`/`Grep`/`Glob`/`Write`/`Edit`/`Bash`, the `task` tool → `Task` +
`wiki-scout`, `/openwiki/…` → `openwiki/…`); OpenWiki's out-of-scope CLI-flag
section is dropped. `tests/build-disciplines.test.ts` drift-locks the committed
docs to a fresh regenerate, so an upstream prompt change fails CI until
re-derived — replacing the former manual "prompt review" parity check. The
reverse-engineered output-format literals (`## Source map`, the `Git evidence:`
7-char-hash bullet, the no-frontmatter and quickstart-heading rules) are carried
as a labelled generator constant, since they come from OpenWiki's rendered
output rather than its prompt. `references/state-schema.md` stays hand-authored
(it documents wijzer-only serialization facts) but its field set is now locked
to the vendored `UpdateMetadata` type by the same test.
7 changes: 6 additions & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,12 @@ Deterministic bookkeeping lives in **`scripts/`** (dependency-free bash: git +
coreutils); each script emits one JSON object on stdout (exit 0 = ran, 2 =
precondition missing). Model judgment lives in **`skills/`** (`/wijzer:init`,
`:update`, `:ask`) and **`agents/`** (`wiki-scout`, read-only fan-out). Shared
doctrine is in **`references/`**. The format side of parity is gated
doctrine is in **`references/`** — and `disciplines.md` + `wiki-format.md` are
**generated**, not hand-written: `scripts/build-disciplines.mjs` (dev/CI-only
Node, the one exception to the dependency-free-bash rule; never run by users)
derives them from the vendored OpenWiki prompt via a documented tool-vocabulary
translation, drift-locked by `tests/build-disciplines.test.ts`. Edit the
generator and re-run it, never the generated files. The format side of parity is gated
deterministically too: init/update finish by running `scripts/check-format.sh`
over `openwiki/` and must fix reported problems before recording state. The scripts are unit-tested against real temp
git repos in **`tests/`** (Vitest); `tests/noop.test.ts` is a case-for-case port
Expand Down
19 changes: 13 additions & 6 deletions PARITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ living record of what that means and how it is verified.
| surgical edits: ≤1–2 pages when <5 files changed | `references/disciplines.md` + `scripts/diff-summary.sh` | Phase-3 scenario |
| SHA-256 snapshot; write state only if content changed | `scripts/snapshot.sh` (`dir:`/`file:` frames match real byte-for-byte) + update-skill gate | `tests/snapshot.test.ts` (envelope) + `tests/parity-crossvalidate.test.ts` (digest equals real) |
| init: inventory → `_plan.md` → generate → delete plan → state | `scripts/inventory.sh` + init skill | golden run |
| run/subagent/planning/git disciplines (`src/agent/prompt.ts`) | `references/disciplines.md` + `agents/wiki-scout.md` | prompt review (this doc) |
| run/subagent/planning/git disciplines (`src/agent/prompt.ts`) | `references/disciplines.md` + `references/wiki-format.md` (both **generated** from the vendored `prompt.ts` by `scripts/build-disciplines.mjs`) + `agents/wiki-scout.md` | `tests/build-disciplines.test.ts` — drift-locked: the committed docs must equal a fresh regenerate, so an upstream prompt change fails CI until re-derived |
| idempotent AGENTS.md/CLAUDE.md block | `scripts/inject-pointer.sh` | `tests/inject.test.ts` |
| GH Action: cron 8am → update → PR `openwiki/update` | `examples/github-action.yml` (via anthropics/claude-code-action, subscription OAuth) | Phase-4 live run |

Expand All @@ -56,15 +56,22 @@ living record of what that means and how it is verified.
`PROVENANCE.md`); the diff of that directory *is* the upstream change to
review (`test/update-noop.test.ts`, `src/agent/utils.ts`, `src/agent/prompt.ts`,
`src/constants.ts`, `src/agent/types.ts`).
2. Run `npm test` — must be green on macOS + Linux. `tests/parity-crossvalidate.test.ts`
executes wijzer's bash against the newly-vendored real functions, and the
vendored `test/update-noop.test.ts` runs verbatim. Any divergence is either a
2. Re-derive the prompt-driven doctrine: `node scripts/build-disciplines.mjs`.
If `prompt.ts` changed, this rewrites `references/disciplines.md` and
`references/wiki-format.md`; review the diff (it *is* the discipline change),
extend the translation table in the script if OpenWiki introduced new
virtual-filesystem vocabulary (the residual-vocab guard fails loudly on
anything untranslated), and commit the regenerated docs.
3. Run `npm test` — must be green on macOS + Linux. `tests/parity-crossvalidate.test.ts`
executes wijzer's bash against the newly-vendored real functions, the vendored
`test/update-noop.test.ts` runs verbatim, and `tests/build-disciplines.test.ts`
fails until the derived docs above are re-committed. Any divergence is either a
new intended distribution-method delta (document it inline) or a bash bug to
fix. No hand-porting of test cases is required — the spec test *is* the vendored
test.
3. If the wiki format or a prompt discipline changed, run a golden `init` and
4. If the wiki format or a prompt discipline changed, run a golden `init` and
diff the structure against the new upstream `openwiki/`.
4. Bump the **Upstream validated against** SHA above (it must match
5. Bump the **Upstream validated against** SHA above (it must match
`vendor/openwiki/PROVENANCE.md`, enforced by `tests/vendor-openwiki.test.ts`)
and note the change in `CHANGELOG.md`.

Expand Down
Loading
Loading