Problem (validated recurrence)
R-15 gate status is maintained by hand in three places that have to agree:
docs/native/R15-SECURE-STORAGE-CONTRACT.md header status line (§0);
- the contract's §21 closing status sentence;
docs/native/CORE-MIGRATION-LEDGER.md row 10, both its R15_GATE* tokens and its prose.
Reviewers caught contradictions between them in four consecutive PRs: #917 (cubic), #928 (cubic), #929 (Codex + cubic) and #930 (CodeRabbit + cubic). A typical case: the ledger said "Gates 3–7 not admitted" next to "Gate 3 slice 3A implemented". Every instance cost a correction wave. Learning record: #780 (comment of 2026-10-01).
Root cause
There is no single machine-readable source of gate status, and nothing deterministic compares the three statements. Agreement depends on reviewers noticing.
Scope
- One canonical, machine-readable R-15 gate status block in the binding contract (one token per gate:
NOT_ADMITTED, PARTIAL, IMPLEMENTED_HEADLESS, …).
- A pure
scanR15GateStatusTruth in scripts/check-doc-metrics.mjs (the existing docs:check, which already runs in CI and ci:prepush) that fails when:
- the ledger's
R15_GATE* tokens differ from the contract block (missing, extra or different values);
- current, non-historical prose in the contract header, §21 or ledger row 10 calls a gate range "not admitted" or "unadmitted" while the block marks a gate in that range as partial or implemented.
- Unit tests in
tests/unit/checkDocMetrics.test.ts for agreement, token mismatch, a missing gate, the range contradiction, and historical sections being ignored.
- Bring the docs to the canonical state in the same PR.
Non-goals
Acceptance
pnpm docs:check fails on each seeded contradiction and passes on the reconciled docs.
- Unit tests cover every failure mode.
- The guard runs through the existing
docs:check CI path, so no workflow change is needed.
- Exact-head review/CI converges, followed by resulting-main proof.
Owners
Problem (validated recurrence)
R-15 gate status is maintained by hand in three places that have to agree:
docs/native/R15-SECURE-STORAGE-CONTRACT.mdheader status line (§0);docs/native/CORE-MIGRATION-LEDGER.mdrow 10, both itsR15_GATE*tokens and its prose.Reviewers caught contradictions between them in four consecutive PRs: #917 (cubic), #928 (cubic), #929 (Codex + cubic) and #930 (CodeRabbit + cubic). A typical case: the ledger said "Gates 3–7 not admitted" next to "Gate 3 slice 3A implemented". Every instance cost a correction wave. Learning record: #780 (comment of 2026-10-01).
Root cause
There is no single machine-readable source of gate status, and nothing deterministic compares the three statements. Agreement depends on reviewers noticing.
Scope
NOT_ADMITTED,PARTIAL,IMPLEMENTED_HEADLESS, …).scanR15GateStatusTruthinscripts/check-doc-metrics.mjs(the existingdocs:check, which already runs in CI andci:prepush) that fails when:R15_GATE*tokens differ from the contract block (missing, extra or different values);tests/unit/checkDocMetrics.test.tsfor agreement, token mismatch, a missing gate, the range contradiction, and historical sections being ignored.Non-goals
Acceptance
pnpm docs:checkfails on each seeded contradiction and passes on the reconciled docs.docs:checkCI path, so no workflow change is needed.Owners