diff --git a/.github/workflows/parity-watch.yml b/.github/workflows/parity-watch.yml index 7224fef..29e33b8 100644 --- a/.github/workflows/parity-watch.yml +++ b/.github/workflows/parity-watch.yml @@ -18,11 +18,15 @@ env: UPSTREAM: langchain-ai/openwiki # Keep this in sync with "Upstream validated against" in PARITY.md. PINNED_SHA: 23428de0cc0b1b6d3e5d09be413e92a5d6ee451f - # The files whose change means the spec changed. Ports of these drive parity: - # test/update-noop.test.ts -> tests/noop.test.ts - # src/agent/utils.ts -> scripts/check-noop.sh - # src/agent/prompt.ts -> references/disciplines.md, agents/wiki-scout.md - SPEC_FILES: "test/update-noop.test.ts src/agent/utils.ts src/agent/prompt.ts" + # The spec-bearing files wijzer vendors at the pinned SHA into vendor/openwiki/. + # A change to any of them means the spec moved; each is verified against real + # vendored code, not a hand-port: + # test/update-noop.test.ts -> run verbatim from vendor/ + tests/parity-crossvalidate.test.ts + # src/agent/utils.ts -> scripts/check-noop.sh + snapshot.sh (cross-validated vs the real functions) + # src/agent/prompt.ts -> references/disciplines.md + wiki-format.md (generated) + agents/wiki-scout.md + # src/constants.ts -> OPEN_WIKI_DIR / UPDATE_METADATA_PATH used across scripts + generator + # src/agent/types.ts -> references/state-schema.md field set (locked to UpdateMetadata) + SPEC_FILES: "test/update-noop.test.ts src/agent/utils.ts src/agent/prompt.ts src/constants.ts src/agent/types.ts" # The reference wiki folder that defines the output format. REFERENCE_DIR: "openwiki" ISSUE_TITLE: "parity-watch: upstream OpenWiki spec changed" @@ -91,7 +95,9 @@ jobs: echo "### Next steps" echo "" echo "Run the re-validation procedure in [PARITY.md](../blob/main/PARITY.md):" - echo "port any changed no-op cases, re-diff the wiki format if it moved," + echo "re-vendor at the new SHA (\`scripts/vendor-openwiki.sh --sha \`)," + echo "re-derive the generated docs (\`node scripts/build-disciplines.mjs\`)," + echo "run \`npm test\` (the vendored \`update-noop.test.ts\` + cross-validation re-prove parity)," echo "then bump the pin (this file's \`PINNED_SHA\` and PARITY.md) and note it in CHANGELOG.md." echo "PARITY_EOF" } >> "$GITHUB_OUTPUT" diff --git a/CHANGELOG.md b/CHANGELOG.md index 11375e7..88ef876 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -76,3 +76,17 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). literals are exempt from vocabulary translation and the residual-vocab guard). This reverses P2C's inject-pointer.sh adaptation. - `agents/wiki-scout.md` is aligned to the generated subagent discipline. +- **P2E — parity reconciliation.** Squared the docs and tests with the vendored- + real-code reality: `PARITY.md`'s verification column now cites the actual + verifiers (`tests/parity-crossvalidate.test.ts`, the verbatim vendored + `update-noop.test.ts`, `tests/build-disciplines.test.ts` drift-lock, + `tests/check-format.test.ts`) instead of aspirational "Phase N" runs. + `.github/workflows/parity-watch.yml` now watches the full vendored spec set + (adds `src/constants.ts` + `src/agent/types.ts`), drops the stale + `tests/noop.test.ts` mapping, and drives the re-vendor → regenerate → `npm test` + flow on a SHA bump. Trimmed the two parity-*restatement* assertions from + `tests/plugin-structure.test.ts` (per the parity-first principle: the ≤8-page + and <5-files→1–2-pages numbers are pinned in `tests/build-disciplines.test.ts` + against drift-locked docs, and `## Source map` / `Git evidence:` are enforced in + `tests/check-format.test.ts`). `README.md` now states Node is a dev/CI-only + dependency — the plugin needs no `node` at user runtime. diff --git a/CLAUDE.md b/CLAUDE.md index 1076c3d..b8f7196 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -59,3 +59,14 @@ state file stays `openwiki/.last-update.json` with the exact split (`shasum` vs `sha256sum`) is bridged in `scripts/lib/json.sh`. - When OpenWiki drifts, follow the re-validation procedure in PARITY.md and bump the pinned SHA — never silently claim parity. + +## OpenWiki + +This repository has documentation located in the /openwiki directory. + +Start here: +- [OpenWiki quickstart](openwiki/quickstart.md) + +OpenWiki includes repository overview, architecture notes, workflows, domain concepts, operations, integrations, testing guidance, and source maps. + +When working in this repository, read the OpenWiki quickstart first, then follow its links to the relevant architecture, workflow, domain, operation, and testing notes. diff --git a/PARITY.md b/PARITY.md index cc6d594..49385b2 100644 --- a/PARITY.md +++ b/PARITY.md @@ -24,19 +24,19 @@ living record of what that means and how it is verified. | OpenWiki behavior (upstream) | wijzer mechanism | Verified by | |---|---|---| -| `openwiki --init [msg]` | `/wijzer:init [msg]` skill | golden run (Phase 2) vs their committed `openwiki/` | -| `openwiki --update [msg]` | `/wijzer:update [msg]` skill | `tests/parity-crossvalidate.test.ts` + Phase-3 scenarios | -| chat mode (Q&A, no writes) | `/wijzer:ask` skill | manual: assert zero wiki writes | -| `--print` non-interactive | `claude -p "/wijzer:update"` | headless recipe (Phase 4) | -| plain-MD pages, no frontmatter, source-map at page end, ≤8 pages on init | `references/wiki-format.md` + `scripts/check-format.sh` gate in init/update | `tests/check-format.test.ts` + golden run vs upstream `openwiki/` | +| `openwiki --init [msg]` | `/wijzer:init [msg]` skill | golden `/wijzer:init` run + `scripts/check-format.sh` gate (`tests/check-format.test.ts`) | +| `openwiki --update [msg]` | `/wijzer:update [msg]` skill | `tests/parity-crossvalidate.test.ts` (no-op/snapshot vs the real functions) + golden update run | +| chat mode (Q&A, no writes) | `/wijzer:ask` skill | `tests/plugin-structure.test.ts` (ask is structurally read-only) | +| `--print` non-interactive | `claude -p "/wijzer:update"` | `examples/headless.md` recipe | +| plain-MD pages, no frontmatter, source-map at page end, ≤8 pages on init | `references/wiki-format.md` + `scripts/check-format.sh` gate in init/update | `tests/check-format.test.ts` (format-gate enforcement) + golden-run conformance | | `.last-update.json` = {updatedAt, command, gitHead?, model} | `scripts/write-state.sh` | `tests/state.test.ts` (CLI contract) + `tests/parity-crossvalidate.test.ts` (real-function interchange) | | no-op: (no msg AND HEAD==state) OR only `openwiki/` changed; force when dirty | `scripts/check-noop.sh` (ports `getUpdateNoopStatus` + `shouldCheckUpdateNoop`) | `tests/parity-crossvalidate.test.ts` runs bash vs the vendored real functions; `vendor/openwiki/test/update-noop.test.ts` runs verbatim against the vendored source | -| git evidence (`git status`/`log `/`diff`) → surgical edits: ≤1–2 pages when <5 files changed | `references/disciplines.md` (git discipline) — **prompt-driven**: the update skill runs the same commands and the same `gitHead` → `updatedAt` → recent-history fallback as OpenWiki's `createGitSummary`, reading the baseline from `openwiki/.last-update.json` | Phase-3 scenario | +| git evidence (`git status`/`log `/`diff`) → surgical edits: ≤1–2 pages when <5 files changed | `references/disciplines.md` (git discipline) — **prompt-driven**: the update skill runs the same commands and the same `gitHead` → `updatedAt` → recent-history fallback as OpenWiki's `createGitSummary`, reading the baseline from `openwiki/.last-update.json` | git discipline drift-locked in `tests/build-disciplines.test.ts`; commands mirror `createGitSummary` (`vendor/openwiki/src/agent/utils.ts`) | | 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: discover → `_plan.md` → generate → delete plan → state | **prompt-driven** discovery (run discipline) + init skill; no bash inventory step (OpenWiki has none) | golden run | | 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 | | exact `## OpenWiki` block in AGENTS.md/CLAUDE.md | **prompt-driven**: the agent writes OpenWiki's verbatim `## OpenWiki` section (preserved byte-for-byte in `references/disciplines.md`) — no bash injector | `tests/build-disciplines.test.ts` (block derived verbatim) | -| GH Action: cron 8am → update → PR `openwiki/update` | `examples/github-action.yml` (via anthropics/claude-code-action, subscription OAuth) | Phase-4 live run | +| GH Action: cron 8am → update → PR `openwiki/update` | `examples/github-action.yml` (via anthropics/claude-code-action, subscription OAuth) | manual live run | ## Watch items diff --git a/README.md b/README.md index fa92a58..7e607fe 100644 --- a/README.md +++ b/README.md @@ -66,15 +66,30 @@ verified, and [`CONTRIBUTING`](#contributing) below to hack on it. - Claude Code with an active Claude subscription. - `git` and a POSIX shell. On Windows, use Git Bash or WSL. +- **No Node.js at runtime.** The plugin is skills + dependency-free bash; nothing + it runs for you needs `node`. Node is a **development/CI-only** dependency — + it's used to run the Vitest suite and to regenerate `references/disciplines.md` + and `references/wiki-format.md` from the vendored OpenWiki prompt (the committed + output ships in the plugin, so you never run the generator). ## Contributing +Node is needed here (dev/CI only), not by end users: + ``` npm install -npm test # runs the deterministic script suite against temp git repos +npm test # Vitest: scripts vs temp git repos + the vendored OpenWiki parity tests npm run lint # shellcheck ``` +When OpenWiki evolves, re-derive the generated doctrine and re-prove parity: + +``` +scripts/vendor-openwiki.sh --sha # re-vendor the spec at a new SHA +node scripts/build-disciplines.mjs # regenerate the reference docs +npm test # cross-validation re-proves parity +``` + Contributions welcome — especially parity fixes when OpenWiki evolves (see the re-validation procedure in [PARITY.md](PARITY.md)). diff --git a/openwiki/.last-update.json b/openwiki/.last-update.json new file mode 100644 index 0000000..74d006a --- /dev/null +++ b/openwiki/.last-update.json @@ -0,0 +1,6 @@ +{ + "updatedAt": "2026-07-08T16:28:46Z", + "command": "init", + "gitHead": "1510ee58ab76769a1f0091b7cd78347b64625d54", + "model": "claude-opus-4-8" +} diff --git a/openwiki/architecture/overview.md b/openwiki/architecture/overview.md new file mode 100644 index 0000000..0200e25 --- /dev/null +++ b/openwiki/architecture/overview.md @@ -0,0 +1,72 @@ +# Architecture overview + +wijzer separates **deterministic bookkeeping** from **model judgment**. Anything +with exact semantics that must match OpenWiki byte-for-byte is a dependency-free +bash script; anything requiring understanding of a codebase is prompt-driven and +done by the model. This page maps the directories and the scripts. + +## The split + +- **`scripts/`** — dependency-free bash (git + coreutils). Each script owns one + piece of exact-semantics bookkeeping and prints a single JSON object on stdout + (exit 0 = ran, 2 = precondition missing, e.g. not a git repo). +- **`skills/` + `agents/`** — model judgment. The skills drive discovery, git + inspection, page authoring, and the pointer block; they *call* the scripts for + bookkeeping but never re-implement it. +- **`references/`** — the doctrine the skills obey. `disciplines.md` and + `wiki-format.md` are **generated** from the vendored OpenWiki prompt (see + [Parity](../parity/overview.md)); `state-schema.md` is hand-written. +- **`vendor/openwiki/`** — the pinned upstream OpenWiki source used as the parity + oracle (executed directly by the tests). + +## The bookkeeping scripts + +Four scripts carry exact OpenWiki semantics and are cross-validated against the +vendored real functions: + +- **`check-noop.sh`** — decides whether a `/wijzer:update` run is a no-op (ports + OpenWiki's `getUpdateNoopStatus` + `shouldCheckUpdateNoop`). Emits `noop`, + `reason`, `gitHead`, `stateGitHead`, `dirty`, `commitsSince`. A non-empty user + message short-circuits to force a run. +- **`snapshot.sh`** — a SHA-256 content snapshot of `openwiki/` (excluding the + state file), so the update skill can tell whether its edits changed anything + and skip churn. Mirrors `createOpenWikiContentSnapshot` byte-for-byte. +- **`write-state.sh`** — writes `openwiki/.last-update.json` (`{updatedAt, + command, gitHead?, model}`), the interchangeable run-metadata file. Validates + the model id and falls back to the `claude-code` literal. +- **`check-format.sh`** — the format-parity gate: verifies a generated wiki obeys + `references/wiki-format.md` (no YAML frontmatter, `## Source map` shape, the + `Git evidence:` bullet, quickstart linking headings) before state is recorded. + +`scripts/lib/json.sh` provides shared JSON-string escaping and bridges the +macOS/Linux `shasum` vs `sha256sum` split. `scripts/vendor-openwiki.sh` re-vendors +the upstream source at a pinned SHA; `scripts/build-disciplines.mjs` is the +dev/CI-only doc generator (the one exception to the dependency-free-bash rule). + +## Conventions + +- Bash: `set -euo pipefail`; guard `grep` pipelines that may legitimately match + nothing with `|| true`; prefer `awk 'NR<=n'` over `head -n` inside pipelines to + avoid SIGPIPE aborts. Keep scripts portable (macOS bash 3.2 + GNU). +- Every `scripts/.sh` has a co-located `tests/.test.ts` exercising it + against a real temp git repo (behavioral, not implementation). + +## Tests + +The suite (Vitest) runs the scripts against real temporary git repos and runs the +vendored OpenWiki code directly as the parity oracle. Notable files: +`tests/parity-crossvalidate.test.ts` (bash vs the real functions), +`tests/vendor-openwiki.test.ts` (vendor drift-lock + the verbatim upstream +`update-noop.test.ts`), `tests/build-disciplines.test.ts` (generated-doc +drift-lock + guard error paths), and `tests/check-format.test.ts`, +`tests/snapshot.test.ts`, `tests/state.test.ts`, `tests/plugin-structure.test.ts`. + +## Source map + +- `scripts/check-noop.sh` +- `scripts/snapshot.sh` +- `scripts/write-state.sh` +- `scripts/check-format.sh` +- `scripts/lib/json.sh` +- `CLAUDE.md` +- Git evidence: commits `8536c2a`, `511f237` diff --git a/openwiki/parity/overview.md b/openwiki/parity/overview.md new file mode 100644 index 0000000..9e1dc3f --- /dev/null +++ b/openwiki/parity/overview.md @@ -0,0 +1,64 @@ +# Parity model + +wijzer's whole reason to exist is running OpenWiki's documentation behavior on a +Claude subscription instead of a metered API. That only matters if the output is +**interchangeable** with OpenWiki's. This page explains how wijzer achieves parity +and, crucially, how it *proves* parity against real upstream code rather than +assuming it. The living contract is [PARITY.md](../../PARITY.md). + +## What parity covers + +Interchangeable: the `openwiki/` layout and Markdown page format, the +`openwiki/.last-update.json` state schema, the update no-op / churn-prevention +algorithm, and the AGENTS.md/CLAUDE.md pointer block. Out of scope: OpenWiki's +provider/credential machinery (wijzer's runtime is Claude Code), its CLI flag +surface, and byte-identical page prose. + +## Vendored source as the oracle + +wijzer cannot run the OpenWiki *agent* (that needs an API key — the whole reason +wijzer exists). It doesn't need to: OpenWiki's deterministic bookkeeping is pure +git + filesystem logic with no LLM in the loop. `scripts/vendor-openwiki.sh` +freezes that source at a pinned SHA into `vendor/openwiki/` (with a blob-SHA +manifest and `PROVENANCE.md`), and the tests **execute it directly**: + +- `tests/parity-crossvalidate.test.ts` runs wijzer's bash and the vendored real + functions over the same temp repos and asserts they agree. +- `vendor/openwiki/test/update-noop.test.ts` runs **verbatim** against the + vendored source — the upstream spec test is the parity spec, no hand-porting. +- `tests/vendor-openwiki.test.ts` locks every vendored file to its manifest blob + SHA, so any drift is loud. + +## Generated doctrine + +The run / subagent / planning / git disciplines and the wiki output format are +not hand-written — they are **derived from the vendored prompt**. +`scripts/build-disciplines.mjs` (dev/CI-only Node) text-parses +`vendor/openwiki/src/agent/prompt.ts`, applies a documented tool-vocabulary +translation (OpenWiki's DeepAgents virtual filesystem → Claude Code +`Read`/`Grep`/`Glob`/`Write`/`Edit`/`Bash`, the `task` tool → `Task` + +`wiki-scout`), and writes `references/disciplines.md` + `references/wiki-format.md`. +The exact `## OpenWiki` pointer block is preserved verbatim (fenced blocks are +exempt from translation). `tests/build-disciplines.test.ts` drift-locks the +committed docs to a fresh regenerate, so an upstream prompt change fails CI until +a human re-derives and reviews. + +## Watching upstream + re-validation + +`.github/workflows/parity-watch.yml` compares the vendored spec files against +upstream `main` weekly and opens a tracking issue on drift. The response is the +re-validation procedure in [PARITY.md](../../PARITY.md): re-vendor at the new SHA, +regenerate the docs, run `npm test` (cross-validation re-proves parity), then bump +the pin and note it in the changelog. wijzer never claims parity it hasn't +re-proven. + +## Source map + +- `PARITY.md` +- `scripts/vendor-openwiki.sh` +- `scripts/build-disciplines.mjs` +- `vendor/openwiki/PROVENANCE.md` +- `tests/parity-crossvalidate.test.ts` +- `tests/vendor-openwiki.test.ts` +- `.github/workflows/parity-watch.yml` +- Git evidence: commits `f1cc4ff`, `2ff0c3a`, `f34a82d` diff --git a/openwiki/quickstart.md b/openwiki/quickstart.md new file mode 100644 index 0000000..e7ceced --- /dev/null +++ b/openwiki/quickstart.md @@ -0,0 +1,74 @@ +# wijzer + +wijzer is a **Claude Code plugin** that generates and maintains an +OpenWiki-format agent wiki for a repository, refreshed from git history — powered +by the user's Claude subscription, with no API keys. It targets **format and +behavior parity** with [langchain-ai/openwiki](https://github.com/langchain-ai/openwiki) +so a repository's `openwiki/` folder is interchangeable between the two tools. + +This wiki was generated by wijzer against its own repository — it is both the +project's documentation and a live dogfood of the `/wijzer:init` skill. + +## What this repository does + +wijzer ships three user-invoked skills — `/wijzer:init`, `/wijzer:update`, +`/wijzer:ask` — plus the deterministic scripts and generated doctrine they rely +on. When you run `/wijzer:init` in a repo, the model discovers the codebase and +writes a navigable wiki under `openwiki/`; `/wijzer:update` refreshes it +surgically from what changed since the last run; `/wijzer:ask` answers questions +from the wiki without modifying it. Because the runtime is Claude Code, the work +is billed to your subscription and needs no provider credentials. + +The core design idea: **split deterministic bookkeeping from model judgment.** +Exact-semantics git/filesystem logic lives in dependency-free bash scripts that +must match OpenWiki byte-for-byte; everything requiring understanding of the code +is prompt-driven, done by the model following disciplines that are *generated* +from OpenWiki's own prompt. + +## Start here + +- [Architecture](architecture/overview.md) — the deterministic-vs-model split, + the directory layout, the four bookkeeping scripts, and the test suite. +- [Parity](parity/overview.md) — how wijzer proves it matches OpenWiki: vendored + source at a pinned SHA, generated doctrine, cross-validation, and drift-locks. +- [Skills](skills/overview.md) — the prompt-driven `init` / `update` / `ask` + skills and the read-only `wiki-scout` subagent. + +## Documentation map + +- Architecture → [architecture/overview.md](architecture/overview.md) +- Parity model → [parity/overview.md](parity/overview.md) +- Skills & agent → [skills/overview.md](skills/overview.md) + +## Key source files + +- `.claude-plugin/plugin.json`, `.claude-plugin/marketplace.json` — plugin manifest. +- `skills/{init,update,ask}/SKILL.md` — the three user-invoked skills. +- `agents/wiki-scout.md` — the read-only discovery subagent. +- `references/disciplines.md`, `references/wiki-format.md` — **generated** doctrine + (from the vendored OpenWiki prompt); `references/state-schema.md` — hand-written. +- `scripts/*.sh` — the deterministic bookkeeping (`check-noop`, `snapshot`, + `write-state`, `check-format`) plus `vendor-openwiki.sh`; `build-disciplines.mjs` + is the dev/CI-only doc generator. +- `vendor/openwiki/` — the pinned OpenWiki source wijzer validates against. +- `PARITY.md` — the living parity contract; `CLAUDE.md` — project instructions. + +## Notes for future agents + +- **Never run `node` for users.** The plugin is skills + dependency-free bash. + Node is dev/CI-only (Vitest + regenerating the reference docs). +- **`references/disciplines.md` and `references/wiki-format.md` are generated** — + edit `scripts/build-disciplines.mjs` and re-run it, never the files directly. + They are drift-locked to the vendored prompt by `tests/build-disciplines.test.ts`. +- **The `openwiki/` dir name and `openwiki/.last-update.json` schema are load- + bearing** for OpenWiki interchange — do not rename them. +- When OpenWiki changes upstream, follow the re-validation procedure in + [PARITY.md](../PARITY.md) rather than silently claiming parity. + +## Source map + +- `README.md` +- `CLAUDE.md` +- `PARITY.md` +- `package.json` +- `.claude-plugin/plugin.json` diff --git a/openwiki/skills/overview.md b/openwiki/skills/overview.md new file mode 100644 index 0000000..e7113b5 --- /dev/null +++ b/openwiki/skills/overview.md @@ -0,0 +1,52 @@ +# Skills & agent + +wijzer exposes three user-invoked skills and one read-only subagent. All are +**prompt-driven**: they follow the generated disciplines +([disciplines.md](../../references/disciplines.md)) and call the deterministic +scripts only for exact-semantics bookkeeping. None re-implements git or format +logic the scripts already own. + +## `/wijzer:init [focus]` + +Generates a fresh wiki from scratch. The model discovers the repo the cheap way +(run discipline — tree, manifests, entrypoints, a representative file per domain; +never reading everything), optionally fans out `wiki-scout` subagents, writes a +temporary `openwiki/_plan.md`, then authors `quickstart.md` first and the linked +section pages (≤8 on init). It finishes by running `check-format.sh` (fixing any +reported problems), writing the exact `## OpenWiki` pointer into the top-level +`AGENTS.md` / `CLAUDE.md`, and recording state with `write-state.sh`. Discovery +and the pointer are done by the model; there is no bash inventory or injector +step (OpenWiki has neither). See `skills/init/SKILL.md`. + +## `/wijzer:update [--dry-run] [instruction]` + +Refreshes the wiki surgically from what changed. It starts with a `check-noop.sh` +preflight (stop cleanly when nothing meaningful changed), then scopes git +inspection from `openwiki/.last-update.json` using OpenWiki's exact `gitHead` → +`updatedAt` → recent-history fallback (mirroring `createGitSummary`). A +before/after `snapshot.sh` digest prevents churn — if edits net no content change, +state is left untouched so scheduled runs don't open empty PRs. `--dry-run` +reports what would change and writes nothing. See `skills/update/SKILL.md`. + +## `/wijzer:ask ` + +Answers a question from the generated wiki and never modifies it — structurally +read-only (its `allowed-tools` grant only `Read`/`Grep`/`Glob`). It starts at +`openwiki/quickstart.md`, follows the relevant links, and cites the pages and +source maps it drew on. See `skills/ask/SKILL.md`. + +## `wiki-scout` subagent + +The concrete form of the subagent discipline: a read-only discovery scout the +init/update skills fan out (1–2 by default, 3–4 only for small/independent +domains) with one narrow brief. It inspects and summarizes — source paths, git +evidence, open questions — and never writes; the main agent synthesizes every +page. See `agents/wiki-scout.md`. + +## Source map + +- `skills/init/SKILL.md` +- `skills/update/SKILL.md` +- `skills/ask/SKILL.md` +- `agents/wiki-scout.md` +- `references/disciplines.md` diff --git a/tests/plugin-structure.test.ts b/tests/plugin-structure.test.ts index dfa295e..b788987 100644 --- a/tests/plugin-structure.test.ts +++ b/tests/plugin-structure.test.ts @@ -187,20 +187,14 @@ describe("reference doctrine", () => { } }); - test("wiki-format.md encodes the parity-load-bearing literals", async () => { - const md = await read("references", "wiki-format.md"); - expect(md).toContain("openwiki/quickstart.md"); - expect(md).toContain("## Source map"); - expect(md).toContain("Git evidence: commits"); - expect(md).toMatch(/at most\s+\*?\*?8/); // ≤8 pages init ceiling - }); - - test("disciplines.md keeps the surgical-edit budget numbers", async () => { - const md = await read("references", "disciplines.md"); - // "fewer than ~5 changed files → at most 1–2 pages" - expect(md).toMatch(/\b5\b/); - expect(md).toMatch(/1[–-]2/); - }); + // Parity-first (wj-1s6): we do NOT re-assert that wijzer's own docs restate the + // OpenWiki spec values here — that would test wijzer's restatement, not parity. + // The spec values are guarded where they are actually derived/enforced: + // - the ≤8-page ceiling and the <5-files→1–2-pages budget: pinned in + // tests/build-disciplines.test.ts ("parity numbers survive derivation"), + // against docs drift-locked to the vendored prompt.ts; + // - the `## Source map` heading and `Git evidence: commits` bullet: enforced + // and tested in tests/check-format.test.ts (the format gate). }); describe("integration surface", () => {