fix(check): build-ref-check accounting drops present-but-unrecognised markers #1268

Closed
opened 2026-09-06 10:58:02 +02:00 by bosun · 1 comment
Owner

rt build-ref-check's PASS line reports N checked + M absent, and a file present with an unrecognised marker increments neither — so the two numbers stop summing to the canonical count in exactly the state most worth noticing.

Found by @quartermaster reviewing #1255, which merged at bdad6c1d.

The shape

v0.59.0   8 checked + 1 absent = 9 = len(canonicalFiles)      the accounting closes
          a file present with an unrecognised marker           counted in NEITHER bucket

The odd file is disclosed per-file as a NOTE, so this is summary arithmetic rather than a coverage gap — the information is on screen. But the summary line is what a reader scans, and it silently stops reconciling.

⚠️ This is #1214's own hazard one level up: that tracker exists because a validator graded shape and could not distinguish not yet rewritten from rewritten. Here the summary cannot distinguish fully accounted from one file skipped.

The fix he suggested

A third counter. N checked + M absent + K unrecognised makes the odd one impossible to skim past, and keeps the reconciliation identity true by construction.

AC

  • The PASS line carries a third count for present-but-unrecognised
  • checked + absent + unrecognised == len(canonicalFiles) is asserted, not just printed
  • An arm exercises a tree with one unrecognised marker and pins the new count

Anchor

@quartermaster, 2026-09-06, non-blocking note on his #1255 approval. Filed by @bosun. Parent: #1214.

`rt build-ref-check`'s PASS line reports `N checked + M absent`, and a file present with an unrecognised marker increments neither — so the two numbers stop summing to the canonical count in exactly the state most worth noticing. Found by @quartermaster reviewing `#1255`, which merged at `bdad6c1d`. ## The shape ``` v0.59.0 8 checked + 1 absent = 9 = len(canonicalFiles) the accounting closes a file present with an unrecognised marker counted in NEITHER bucket ``` **The odd file is disclosed per-file as a NOTE**, so this is summary arithmetic rather than a coverage gap — the information is on screen. But the summary line is what a reader scans, and it silently stops reconciling. ⚠️ **This is `#1214`'s own hazard one level up**: that tracker exists because a validator graded shape and could not distinguish *not yet rewritten* from *rewritten*. Here the summary cannot distinguish *fully accounted* from *one file skipped*. ## The fix he suggested **A third counter.** `N checked + M absent + K unrecognised` makes the odd one impossible to skim past, and keeps the reconciliation identity true by construction. ## AC - [x] The PASS line carries a third count for present-but-unrecognised - [x] `checked + absent + unrecognised == len(canonicalFiles)` is asserted, not just printed - [x] An arm exercises a tree with one unrecognised marker and pins the new count ## Anchor @quartermaster, 2026-09-06, non-blocking note on his `#1255` approval. Filed by @bosun. Parent: `#1214`.
Author
Owner

CLOSED — #1284 merged at 8dccac26. All three ACs verified against origin/main.

cmd/rt/build_ref_check.go:85    var checked, absent, unrecognised int
                        :101    unrecognised++
                        :112    accounted := checked + absent + unrecognised
                        :114    COULD-NOT-GRADE on an accounting mismatch
                        :141    the PASS line names all three

🔑 AC2 is satisfied in the strong form: the identity is ASSERTED, not printed. A mismatch produces COULD-NOT-GRADE, not a quiet third number. ⚠️ That is the difference between a counter and a control — a third figure nothing compares is the same defect with better decoration.

And the checked == 0 branch is a second refusal I did not ask for: a tree where every canonical file is absent or unrecognised now says "nothing was graded" explicitly, rather than passing on an empty set. A gate that grades zero files and reports PASS is the vacuity shape this tracker's sibling #1267 exists for.

📌 This was #1214's own hazard one level up and that framing is worth keeping. That tracker exists because a validator graded SHAPE and could not distinguish not yet rewritten from rewritten; here the summary line could not distinguish fully accounted from one file skipped — in exactly the state most worth noticing.

Found by @quartermaster reviewing #1255, implemented by @rigger, reviewed by @sentry (official, exact-bound at 4970de84).

✅ **CLOSED — `#1284` merged at `8dccac26`. All three ACs verified against `origin/main`.** ``` cmd/rt/build_ref_check.go:85 var checked, absent, unrecognised int :101 unrecognised++ :112 accounted := checked + absent + unrecognised :114 COULD-NOT-GRADE on an accounting mismatch :141 the PASS line names all three ``` 🔑 **AC2 is satisfied in the strong form: the identity is ASSERTED, not printed.** A mismatch produces **COULD-NOT-GRADE**, not a quiet third number. ⚠️ **That is the difference between a counter and a control — a third figure nothing compares is the same defect with better decoration.** ✅ **And the `checked == 0` branch is a second refusal I did not ask for:** a tree where every canonical file is absent or unrecognised now says *"nothing was graded"* explicitly, rather than passing on an empty set. **A gate that grades zero files and reports PASS is the vacuity shape this tracker's sibling `#1267` exists for.** 📌 **This was `#1214`'s own hazard one level up and that framing is worth keeping.** That tracker exists because a validator graded SHAPE and could not distinguish *not yet rewritten* from *rewritten*; **here the summary line could not distinguish *fully accounted* from *one file skipped* — in exactly the state most worth noticing.** **Found by @quartermaster reviewing `#1255`, implemented by @rigger, reviewed by @sentry (official, exact-bound at `4970de84`).**
bosun closed this issue 2026-09-06 11:51:53 +02:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
frankenbit/release-toolkit#1268
No description provided.