fix(gaps): the board header counted five rows that had already closed - #142
Merged
Conversation
The header said 174 done / 18 pending over a table holding 179 DONE and 13 PENDING. The table was right: at 97916eb the two agreed exactly, and between 2026-08-01 and 2026-08-04 `CP-02`, `CP-04`, `CP-06`, `CP-14` and `GAP-020` moved PENDING → DONE without the header following. Each of the five was checked before trusting it rather than assumed: all five carry a current `Status: DONE` in their catalog entry, and `GAP-020`'s is dated 2026-08-02 with its reasoning, sitting under an explicit `Status (superado): PENDING` — the shape this repository already uses for a reopened item that closed again. `Gap registry coherence` passed over all of it, and could not have done otherwise: it contrasts board ↔ catalog ↔ registry and never reads the header. So the number nobody cross-checked is the one that drifted, which is the same story the guard's own docstring tells about `Status` lines. The guard now compares the declared header against the actual row counts: the total and every status bucket. An unreadable `**Progress:**` line is a failure, not a pass — a header this scan cannot find is exactly the one that can lie unchallenged. Watched failing before the header was corrected, and again on fixtures: 174/18 against a table of 179/13 → 2 problems, exit 1 pending off by one → 1 problem, exit 1 total off by one → 1 problem, exit 1 The return annotation is plain: `tuple[...] | None` needs Python 3.10 and this laptop runs 3.9, so the first version raised TypeError on import. CI has 3.12 and would never have shown it — a guard that dies being imported watches nothing, and it would have died on someone's machine, not here. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
CI caught what I should have. `check-gap-registry.py` ships
`check-gap-registry.test.py`, and adding the counter contrast broke four
of its nine tests: the fixture writes a synthetic board with no
`**Progress:**` line, and the new check reports a missing header rather
than tolerating it.
The fix is the fixture, not the guard. Relaxing the check so a headerless
board passes would disarm exactly what it watches — so `_repo` now emits a
header derived from the rows it just wrote, and takes a `progreso`
override for the tests that want to declare false numbers.
Three tests added for the contrast itself, each run against the guard
with the new call REMOVED and seen to fail there:
· a header declaring fewer DONE than the table holds — the real defect,
the five rows that closed between 2026-08-01 and 2026-08-04;
· a wrong total, which drifts on its own: a row added without touching
the header changes no status, only the denominator;
· a board with no header at all, because illegible is not correct.
Twelve pass now; nine passed before and four of those were passing over a
board shape the guard would reject in reality.
Co-Authored-By: Claude Opus 5 <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.
The header said
174 done / 18 pendingover a table holding 179 DONE and 13 PENDING.Which one was lying
The table. At
97916ebthe two agreed exactly; between 2026-08-01 and 2026-08-04 five rows movedPENDING → DONEwithout the header following:CP-02·CP-04·CP-06·CP-14·GAP-020Each was checked before being trusted, not assumed: all five carry a current
Status: DONEin their catalog entry.GAP-020's is dated 2026-08-02 with its reasoning, sitting under an explicitStatus (superado): PENDING— the shape this repo already uses for a reopened item that closed again.Why the guard let it through
Gap registry coherencepassed over all of it, and could not have done otherwise: it contrasts board ↔ catalog ↔ registry and never reads the header. The number nobody cross-checked is the one that drifted — the same story its own docstring tells aboutStatuslines.The guard now compares the declared header against the actual row counts: the total and every status bucket. An unreadable
**Progress:**line is a failure, not a pass — a header this scan cannot find is exactly the one that can lie unchallenged.Watched failing
Run against the stale header before correcting it, then on fixtures:
174/18against a table of179/13pendingoff by onetotaloff by oneRegistro coherente: 204 fichas / 204 filasOne note on the annotation
The return annotation is plain rather than
tuple[...] | None: that syntax needs Python 3.10 and this laptop runs 3.9, so the first version raisedTypeErroron import. CI has 3.12 and would never have shown it — a guard that dies being imported watches nothing, and it would have died on someone's machine instead of here.🤖 Generated with Claude Code