Skip to content

docs: add the canon — routable architecture docs, a requirements register, and a drift report - #2

Merged
adbarc92 merged 4 commits into
mainfrom
docs/canon
Jul 25, 2026
Merged

docs: add the canon — routable architecture docs, a requirements register, and a drift report#2
adbarc92 merged 4 commits into
mainfrom
docs/canon

Conversation

@adbarc92

@adbarc92 adbarc92 commented Jul 25, 2026

Copy link
Copy Markdown
Owner

Adds docs/canon/ — 21 files stamped at 7420d69 giving reqdrive a routable
documentation 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

Layer Files What it does
Spine architecture.md, index.json path-glob routing table from any file to the doc that governs it; the machine-readable form for agent context
Modules modules/*.md (9) one per path partition — public surface with file:line anchors, invariants, requirement coverage
Conventions conventions/*.md (4) the cross-cutting rules no single module owns
Requirements requirements/register.md, requirements/drift-report.md 602 requirements from 5 canonical sources; where the code contradicts them
Claims claims-audit.md what the project says about itself, graded against the above

Requirements 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.json scores as
complete (every jq in verify_collect ends || 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 testCommand
reads 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.md rests on it.

Also worth flagging: run.json.pr_url holds a two-line string rather than a URL
(one missing >&2 at lib/pr-create.sh:95), the PR body's "Stories completed"
line has no .passes filter and contradicts its own verification table, and a
glob in riskTiers silently matches nothing while validate reports PASSED.

Nine canon-vs-canon conflicts are recorded in the register — including the test
count, where CLAUDE.md says 152 and 157 and the measured figure is 202.

Commits

Four, ordered so each commit's internal links resolve:

  1. docs(canon) — requirements register and drift report
  2. docs(canon) — claims audit
  3. docs(canon) — module and convention docs
  4. docs(canon) — index and architecture spine

Verification

No CI job reads docs/; all six gates run against bin/, lib/, install.sh
and tests/, none of which this branch touches, so this branch cannot move any
gate. 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 one
worth doing first.

adbarc92 added 4 commits July 25, 2026 08:57
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.
@adbarc92
adbarc92 merged commit 5c21a6e into main Jul 25, 2026
5 of 6 checks passed
@adbarc92
adbarc92 deleted the docs/canon branch July 25, 2026 17:21
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