docs: add the canon — routable architecture docs, a requirements register, and a drift report - #2
Merged
Conversation
Extracts 602 requirements from the five canonical sources (BEHAVIOR-SPEC, the P0-P7 design doc, README, CLAUDE.md, INTEGRATION.md) and records where the code contradicts them. register.md indexes coverage per module and records the nine canon-vs-canon conflicts, the 21 intent-met requirements where the spec named a weaker mechanism than the code shipped, and the 10 that source cannot verify. drift-report.md carries the 48 drifted requirements plus 8 confirmed defects no requirement covers, each with an adversarial verifier verdict and a suggested reconciliation. The 3 refuted candidates are kept at the bottom so they are not re-raised. Most consequential entry is DES-002: the fail-closed draft gate is fail-open four ways, reproduced end to end. Documentation only - no code changed.
Audits what reqdrive claims about itself - in its one-line summary and in the README - against the evidence in the drift report and module docs. Supported: requirements-to-PR end to end, PRD generation, story-by-story implementation, the risk-tier prefix semantics, and the command and config tables. Supported with caveat: "deterministically" (story selection really is a pure jq function of prd.json, but the agent writes prd.json) and the validation checklist (verified rendering end to end, but it degrades silently). Overstated: "reviewed" (off by default, same model as the implementer, runs after PR creation) and "working" (rests on DES-002). Unsupported: the path-traversal scanning three docs promise, the Windows support nothing verifies, and the 152/157 test counts - measured 202. Closes with fair phrasing that keeps everything the code earns.
Nine module docs partitioning the repo by path glob - cli, pipeline, evidence, pr, config, safety, test-harness, ci-and-install, and the inert skills-and-archive peer - each carrying its public surface with file:line anchors, its invariants, and a requirement-coverage table linking every drifted requirement to its drift-report entry. Four convention docs cover the cross-cutting rules that no single module owns: shell modes and the sourcing model, the JSON-for-machine-state / Markdown-for-agent-context artifact contract, where the sanitization boundary actually is and where it is not, and the one-story-per-assertion plus whole-file-freeze testing model. Anchors are line-stamped at 7420d69.
architecture.md is the entry point: a path-pattern routing table from any file to the doc that governs it, a system overview tracing the requirement to PR lifecycle through its real anchors, and an explicit coverage and freshness statement recording what was read rather than inferred. index.json is the machine-readable form of the same map - module globs, responsibilities and requirement counts, the convention topics, the three requirements docs, and the six unbuilt roadmap features - so an agent can route to the right doc without parsing prose. Completes docs/canon. Requirements are canon throughout: where the code contradicts them the requirement is recorded as intended and the divergence goes in the drift report.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
docs/canon/— 21 files stamped at7420d69giving reqdrive a routabledocumentation layer and, more importantly, a written record of where the code
and its requirements disagree.
Documentation only. No code changed, no behavior changed.
What is here
architecture.md,index.jsonmodules/*.md(9)file:lineanchors, invariants, requirement coverageconventions/*.md(4)requirements/register.md,requirements/drift-report.mdclaims-audit.mdRequirements are treated as canon throughout: where code contradicts a
requirement, the requirement is recorded as intended and the divergence goes in
the drift report. Documenting drift changed no code.
What the audit found
602 requirements · 517 satisfied · 48 drifted · 8 defects no requirement
covers · 0 real gaps (the 6 unimplemented reqs are all Tier-3 roadmap).
Every drift entry carries an adversarial verifier verdict; 3 candidate findings
were refuted during verification and are recorded so they are not re-raised.
The most consequential finding is DES-002: the fail-closed draft-PR gate is
fail-open four ways. The gate shape is right, but three of its inputs can
report success without success occurring — an unreadable
prd.jsonscores ascomplete (every jq in
verify_collectends|| echo "0", so "cannot count"reads as "zero remaining"), an empty story list scores as complete, agent
story-deletion scores as complete, and a blank or commented-out
testCommandreads as a pass. Two independent verifiers reproduced non-draft PRs with real
incomplete work using the repo's own pipeline harness. This matters because the
L2/L3 readiness claim in
docs/STATUS.mdrests on it.Also worth flagging:
run.json.pr_urlholds a two-line string rather than a URL(one missing
>&2atlib/pr-create.sh:95), the PR body's "Stories completed"line has no
.passesfilter and contradicts its own verification table, and aglob in
riskTierssilently matches nothing whilevalidatereports PASSED.Nine canon-vs-canon conflicts are recorded in the register — including the test
count, where
CLAUDE.mdsays 152 and 157 and the measured figure is 202.Commits
Four, ordered so each commit's internal links resolve:
docs(canon)— requirements register and drift reportdocs(canon)— claims auditdocs(canon)— module and convention docsdocs(canon)— index and architecture spineVerification
No CI job reads
docs/; all six gates run againstbin/,lib/,install.shand
tests/, none of which this branch touches, so this branch cannot move anygate. The suite is running against this commit; the result is posted as a comment
below.
Follow-ups this does not do
The drift report is a record, not a fix. The fix list is ordered by severity at
the top of
drift-report.md; DES-002 is four bounded changes and is the oneworth doing first.