D0-R: repair ADR numbering and enforce reference integrity - #43
Merged
Conversation
`CONTRIBUTING.md` makes `docs/architecture/decision-log/` the canonical location
for architectural decisions, so a reference resolving to no file — or to two —
is a provenance defect rather than a typo.
ADR-004 has been double-assigned for a year. `ROADMAP.md` recorded it ("worth a
rename/renumber pass"), the 2026-07-19 review re-found it as finding M6, and
neither caused the fix. Twenty-two references across thirteen files cited a
number owned by two accepted documents.
It survived because the codebase had already routed around it: the embedding ADR
states that reviewers should cite it by section ("can be cited as `ADR-004
§3.5`"), so twelve citations carried a §-marker that disambiguated what the
number could not.
Dispositions, all twenty-two resolved individually — none ambiguous:
14 → ADR-010 8 §-marked code/test citations, the ADR's own heading and
3 self-citation examples, embedding_contract.md, README.md
3 stay the privacy ADR's heading, and ADR-005 / ADR-008, which
already cite it by full filename
3 rewritten ROADMAP.md, which documented the defect and is now obsolete
2 preserved docs/reviews/, historical findings left as written
The review's "renumber to ADR-009+" recommendation is deliberately not honoured:
009 is claimed by twenty-two live citations in the generation-runtime layer, so
the embedding contract takes 010. A numeric gap is legal — ADR numbers are
identifiers, not a contiguity guarantee — and the checker asserts that.
The gate ships with the repair, not after it, because it would otherwise
red-light the branch introducing it. Two modes: `hard` fails on normative roots
(Sources/, Tests/, Scripts/, docs/architecture/); `advisory` reports historical
prose without failing. Without that split, excluding `docs/reviews/` and
requiring failure because of its ADR-009+ recommendation is a contradiction.
hard / unmodified FAIL 1 error (duplicate), and only that
hard / repaired PASS 0 warnings
advisory / unmodified PASS 2 warnings
all / unmodified FAIL 1 error + 1 warning
all / repaired PASS 1 warning (historical, preserved)
python3 Tests/eval/test_adr_references.py 16 tests, OK
python3 Scripts/check_adr_references.py PASS
swift build OK
deterministic suites 287 executed, 3 skipped, 0 failures
git diff --check clean
Two traps found by executing the repair rather than reasoning about it, both now
pinned as tests: a §-marked sed pass leaves a markdown link naming the old
*filename*; and a resolution note announcing "ADR-009 is reserved…" fails the
very gate it announces, since that ADR does not exist yet. The ROADMAP wording
names the reserved number without emitting a canonical token.
Stdlib-only, run as a direct `python3` step in the existing macOS job: `main`
has no Python job, so a `Tests/eval/*.py` file would otherwise execute nowhere.
Tests run before the checker — a gate whose only evidence is that it never
complained is not a gate.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
`main` moved to 622f640 (README rewrite) after this branch cut from d0f3867, leaving #43 non-mergeable. Merged rather than rebased so 1088fd9 stays exactly as reviewed and the update is one transparent commit. The only conflict was the root README, resolved by accepting current `main` wholesale. That rewrite deleted the embedding-ADR link entirely, so D0-R's edit to it is no longer needed: README.md now has no net diff against main and leaves the effective PR diff. Dispositions therefore drop from 14/3/3/2 to 13/3/3/2. The reduction is real — one fewer reference exists to repoint — and no replacement citation was manufactured to preserve the old count.
aurascoper
marked this pull request as ready for review
July 28, 2026 17:58
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.
Updated onto current
mainmainmoved to622f640(README rewrite) after this branch cut fromd0f3867,leaving the PR non-mergeable. Merged rather than rebased, so
1088fd9remainsan ancestor exactly as reviewed and the update is one transparent commit.
The only conflict was the root
README.md, resolved by accepting currentmainwholesale. That rewrite deleted the embedding-ADR link entirely, soD0-R's edit to it is no longer needed:
README.mdnow has no net diff againstmainand has left the effective PR diff — 12 files → 11.Dispositions drop 14 / 3 / 3 / 2 → 13 / 3 / 3 / 2. The reduction is real:
one fewer reference exists to repoint. No replacement citation was manufactured
to preserve the old count.
Re-verified against the post-merge tree — checker, its 16 tests, the full
fixture matrix,
swift build, and the deterministic Swift selection all pass.Why
CONTRIBUTING.mdmakesdocs/architecture/decision-log/canonical, so an ADR reference resolving to no file — or to two — is a provenance defect, not a typo.ADR-004 has been double-assigned for a year.
ROADMAP.mdrecorded it, the 2026-07-19 review re-found it as finding M6, and neither caused the fix. It survived because the codebase routed around it: the embedding ADR tells reviewers to cite it by section, so 12 citations carried a§-marker that disambiguated what the number could not.Dispositions — all 21 references, none ambiguous
embedding_contract.mdADR-005andADR-008, which already cite by full filenameROADMAP.md— it documented the defect and is now obsoletedocs/reviews/historical findings, left as writtenThe review's "renumber to ADR-009+" is deliberately not honoured: 009 is claimed by 22 live citations in the generation-runtime layer, so the embedding contract takes 010. Numeric gaps are legal and the checker asserts it.
The gate ships with the repair
Otherwise it red-lights the branch introducing it. Two modes —
hardfails on normative roots (Sources/,Tests/,Scripts/,docs/architecture/);advisoryreports historical prose without failing. Without that split, excludingdocs/reviews/and requiring failure because of itsADR-009+line is a contradiction.Stdlib-only, run as a direct
python3step in the existing macOS job —mainhas no Python job, so aTests/eval/*.pyfile would otherwise execute nowhere. Tests run before the checker: a gate whose only evidence is that it never complained is not a gate.Two traps found by executing the repair
Both now pinned as tests. A §-marked sed pass leaves a markdown link naming the old filename. And a resolution note announcing "ADR-009 is reserved…" fails the very gate it announces, since that ADR does not exist yet — the ROADMAP wording names the reserved number without emitting a canonical token.
Base note
Branched from
origin/main, not the PR #32 merge commit. That merge carried 22 dangling ADR-009 citations onto staging; they resolve to the runtime-semantics ADR that A0 reconstructs, so the hard gate cannot pass there until lane A lands. Onmainthe only defect is the duplicate. The gate then blocks lane A from landing those citations without their document — which was the intent.Not in scope: Mirror observability, event timestamp/build identity, the Ollama
promptProfile: customcleanup, sustained mode-fidelity work.