Skip to content

fix(gaps): the board header counted five rows that had already closed - #142

Merged
beyondnetPeru merged 2 commits into
developfrom
fix/board-counters-and-guard
Aug 4, 2026
Merged

fix(gaps): the board header counted five rows that had already closed#142
beyondnetPeru merged 2 commits into
developfrom
fix/board-counters-and-guard

Conversation

@beyondnetPeru

Copy link
Copy Markdown
Contributor

The header said 174 done / 18 pending over a table holding 179 DONE and 13 PENDING.

Which one was lying

The table. At 97916eb the two agreed exactly; between 2026-08-01 and 2026-08-04 five rows moved PENDING → DONE without the header following:

CP-02 · CP-04 · CP-06 · CP-14 · GAP-020

Each was checked before being trusted, not assumed: all five carry a current Status: DONE in their catalog entry. GAP-020's is dated 2026-08-02 with its reasoning, sitting under an explicit Status (superado): PENDING — the shape this repo already uses for a reopened item that closed again.

Why the guard let it through

Gap registry coherence passed 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 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

Run against the stale header before correcting it, then on fixtures:

Condition Result
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
Corrected header Registro coherente: 204 fichas / 204 filas

One 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 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 instead of here.

🤖 Generated with Claude Code

beyondnetPeru and others added 2 commits August 4, 2026 13:05
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>
@beyondnetPeru
beyondnetPeru merged commit 189aa7a into develop Aug 4, 2026
6 checks passed
@beyondnetPeru
beyondnetPeru deleted the fix/board-counters-and-guard branch August 4, 2026 18:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant