Skip to content

P2C: derive disciplines/wiki-format docs from vendored prompt (wj-cuz)#6

Merged
gpxl merged 2 commits into
mainfrom
claude/p2c-generate-disciplines
Jul 8, 2026
Merged

P2C: derive disciplines/wiki-format docs from vendored prompt (wj-cuz)#6
gpxl merged 2 commits into
mainfrom
claude/p2c-generate-disciplines

Conversation

@gpxl

@gpxl gpxl commented Jul 8, 2026

Copy link
Copy Markdown
Owner

Summary

  • Adds scripts/build-disciplines.mjs, a dev/CI-only Node generator (no deps)
    that 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, and the Root-instruction section is adapted to delegate
    to inject-pointer.sh. Reverse-engineered output-format literals (## Source map, the Git evidence: 7-char-hash bullet, 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.
  • tests/build-disciplines.test.ts drift-locks the committed docs: it
    regenerates and diffs against what's checked in, so an upstream prompt
    change fails CI until re-derived. It also guards residual untranslated
    vocabulary, the parity SHA pin, and the state-schema field set against the
    vendored UpdateMetadata type. This replaces the former manual "prompt
    review" parity check with an executable one.
  • PARITY.md, CHANGELOG.md, and CLAUDE.md are updated to document the
    drift-lock mechanism and point future edits at the generator, never at the
    generated reference files directly.

Quality

  • Two independent reviews passed this change: the code-quality agent (90
    tests green, shellcheck clean — two non-blocking Q5/Q8 test-quality
    warnings tracked as a separate follow-up, not blocking) and an independent
    Fable-5 review for correctness and intent.
  • Error-path tests for the generator's own guards (residual-vocab trip,
    SHA-pin mismatch) are deferred to a follow-up — not covered in this PR.

Merge policy

Per this repo's Agent Config, pr_merge_strategy is squash + delete
branch
. Not merging here — leaving that to CI/review per project policy.

Test plan

  • npm test — 90/90 passing
  • npm run lint — shellcheck clean
  • Code-quality agent: PASS
  • Independent Fable-5 correctness/intent review: PASS
  • Manual verification

🤖 Generated with Claude Code

gpxl and others added 2 commits July 8, 2026 15:38
Add scripts/build-disciplines.mjs, a dev/CI-only Node generator (the
one dependency-free-bash exception, never run by users) that 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 to Claude Code Read/Grep/Glob/Write/Edit/Bash, the task
tool to Task + wiki-scout, /openwiki/... to openwiki/.... OpenWiki's
out-of-scope CLI-flag section is dropped, and the Root-instruction
section is adapted to delegate to inject-pointer.sh. Reverse-engineered
output-format literals (## Source map, the Git evidence: 7-char-hash
bullet, 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.

tests/build-disciplines.test.ts drift-locks the committed docs to a
fresh regenerate (so an upstream prompt change fails CI until
re-derived), and separately guards residual untranslated vocabulary,
the parity SHA pin, and the state-schema field set against the
vendored UpdateMetadata type. This replaces the former manual
"prompt review" parity check with an executable one.

Error-path tests for the generator's own guards (residual-vocab
trip, SHA-pin mismatch) are deferred to a follow-up.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…cuz)

Update PARITY.md's discipline row to point at the new drift-locked
generator instead of manual "prompt review", and extend the
re-validation procedure with the regenerate step. Note the change in
CHANGELOG.md and add an architecture pointer in CLAUDE.md so future
edits target the generator, never the generated reference files
directly.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@gpxl
gpxl merged commit 2ff0c3a into main Jul 8, 2026
4 checks passed
@gpxl
gpxl deleted the claude/p2c-generate-disciplines branch July 8, 2026 13:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant