test(docs): C-80 — scan ADRs and CICs; three stale paths found and fixed - #223
Merged
Conversation
ADRs and CICs were exempt from the deleted-symbol scan. That exemption is right in principle -- an ADR legitimately records superseded designs, and a scan that fires on history gets deleted (ADR-014 s3) -- and far too wide in practice: it is how a CIC came to name a collaborator its class had never called, in six places, for weeks. The design was chosen by measurement, not argument - A path-resolution check over ADRs would have fired 29 times. Inspecting them showed most were correct history, other repos' files, or paths inside URLs. Built the measurement first, then did NOT build the check. - The curated deleted-symbol list was the narrower instrument: 22 hits over ADRs, ZERO over CICs. Fourteen of the 22 were in ADR-011 alone. Three of the hits were real: ADR-013 still cited unfao/historical.py, unfao/wire/ and unfao/wire/source_selection.py, all moved to contract/ by #153. Three genuine defects among five markable ones is the ratio that justified turning the scan on. Two escapes, both declared rather than inferred Line-scoped `legacy-ok` for an isolated mention; a new file-level `legacy-ok-file` for a document whose SUBJECT is a retirement. ADR-011 earned it -- it IS the decision to remove the runtime mapper, so its subject appears fourteen times, correctly. A second guard pins the exemption set to that one document, so a third shows up in a diff. A check nothing else could have made test_a_cic_does_not_name_a_collaborator_its_class_never_calls asserts that a class a CIC names is actually referenced by the class it documents -- the GaulLookupEnricher failure, which no path check and no symbol list would have caught at the time, because the class existed and every path resolved. Exception types are excluded: a collaborator is something the class reaches for, an exception something that passes through, and the first draft flagged three the manager legitimately propagates. The mutation campaign found a miss in the PREVIOUS change Reintroducing the exact GaulLookupEnricher sentence did NOT fail. The collaborator check only sees classes that still exist, and C-75 had deleted that one. The real gap was that the deletion never extended the deleted-symbol list -- which that list's own comment demands in as many words: "A deletion PR that does not extend this regex has not finished." Extended here; the reintroduction now fails. Four further historical mentions written yesterday were flagged by the extension and marked. Four guards, all mutation-proven: stale path in an ADR, the file-level escape used on a live document, a CIC with no declared subject, and the reintroduced collaborator. 356 passed / 40 xfailed / 0 failed. ruff clean. Register 83/11/72. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
B5. ADRs and CICs were exempt from the deleted-symbol scan. Right in principle — an ADR legitimately records superseded designs, and a scan that fires on history gets deleted (ADR-014 §3) — and far too wide in practice. It is how a CIC came to name a collaborator its class had never called, in six places, for weeks.
The design was chosen by measurement, not argument
I built the measurement first and then declined to build the check it argued against. That is the cry-wolf outcome this entry predicted, confirmed before writing code rather than after shipping it.
Three of the hits were real
ADR-013 still cited
unfao/historical.py,unfao/wire/andunfao/wire/source_selection.py— all moved tocontract/by #153. Fixed. Three genuine defects hiding among five markable ones is the ratio that justified turning the scan on.Two escapes, both declared rather than inferred
Line-scoped
legacy-okfor an isolated historical mention; a new file-level<!-- legacy-ok-file: … -->for a document whose subject is a retirement. ADR-011 earned it — it is the decision to remove the runtime mapper, so its subject appears fourteen times, correctly. Marking fourteen lines would be noise pretending to be rigour.A second guard pins the file-level exemption set to that one document, so a third shows up in a diff rather than becoming a quiet way to silence the check.
A check nothing else could have made
test_a_cic_does_not_name_a_collaborator_its_class_never_callsasserts that a class a CIC names is actually referenced by the class it documents. That is theGaulLookupEnricherfailure — which no path check and no symbol list would have caught at the time, because the class existed and every path resolved.Exception types are excluded, and the distinction is the point: a collaborator is something the class reaches for; an exception is something that passes through it. The first draft flagged
CoverageError,LaunchConfigErrorandSourceSelectionError, all of which the manager legitimately propagates.The mutation campaign found a miss in the previous change
Reintroducing the exact
GaulLookupEnrichersentence did not fail. The collaborator check only sees classes that still exist, and C-75 had deleted that one.The real gap: the deletion never extended the deleted-symbol list — which that list's own comment demands in as many words:
Extended here; the reintroduction now fails. Four further historical mentions written yesterday were flagged by the extension and marked.
Verification
Four guards, all mutation-proven: a stale path reappearing in an ADR, the file-level escape used on a live document, a CIC with no declared subject, and the reintroduced collaborator.
Register 83 / 11 open / 72 resolved.