fix(re): the capture checker counted its own selftest fixture as a citation #37
Reference in New Issue
Block a user
Delete Branch "fix/capture-citations-selfscan"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
⚠️ Based on
fix/capture-citations(#33) — one commit on top. Merge #33 first.check-capture-citationsfails on a clean checkout of its own branchSEARCHincludestools, so the scan reads this file — andselftest()'s plantedfixture is a literal capture path. The checker cited its own test data, pointing at a
file that cannot exist by construction. Nobody changed anything; it is red out of the box
and stays red.
That matters because of what the check is for. Phase 4 built it as the missing gate on
docs/re/. A gate that is red before anyone touches the repo teaches people to ignoreit — and this page's own Phase 0 already names that failure once.
The fix
SELF = ":!tools/re/check-capture-citations", applied to both greps. Excluding only thisone file keeps every other tool in scope — which matters, because
named_bare()existsprecisely to catch
screen_match.pyopening captures by bare filename. A real citationbelongs in a page or in a tool that opens the capture, never in the checker.
The guard, and proof it can fail
Added
own fixtures not countedto the selftest. This file already documents survivingexactly this class of bug — the ERE that matched nothing while five ticks stayed green —
so the guard was verified by breaking it rather than by assuming:
own fixtures not counted🔴 FAILED, rc=2After the fix
That is also the first independent confirmation of Phase 4's "212 captures, all cited" —
until now the number came from the page, and the tool that should agree with it exited 1.
📌 Found by running the checks rather than reading them, which is what
CONSOLIDATION.mdasks for: "Run them again rather than trusting the results recordedhere." The selftest itself passes and always did — it was the real run that was broken,
and only running both showed it.
🤖 Generated with Claude Code
`check-capture-citations` exits 1 on a clean checkout of this branch, and would have kept doing so for ever: 🔴 cited but NOT committed: 1 docs/re/captures/no-such-file-anywhere.png `SEARCH` includes `tools`, so the scan reads this file -- and `selftest()`'s planted fixture is a literal capture path. The checker cited its own test data, to a file that will never exist by construction. A gate that is red before anyone changes anything teaches people to ignore it, which is the opposite of what Phase 4 built it for. Excluding only this one file (`SELF`) keeps every other tool in scope. A real citation belongs in a page, or in a tool that opens the capture -- never in the checker itself. Added a selftest case for it, because this is exactly the class of bug the rest of this file already documents surviving: the ERE that matched nothing while five ticks stayed green. Verified the guard can fail, rather than assuming it: exclusion neutralised -> "own fixtures not counted 🔴 FAILED", selftest rc=2, real check rc=1 reproducing the bug exclusion restored -> selftest ok (7 cases), check rc=0 After the fix, on this branch: captures committed : 212 cited by a page or a tool : 212 cited by nothing : 0 🔴 cited but NOT committed: 0 rc=0 which is also the first independent confirmation of Phase 4's "212 captures, all cited" -- the checker now agrees with the page. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>