main is red: the #650 pageSize call-site guard keys its registry on line:column, so any merge that shifts a line breaks it #684

Closed
opened 2026-07-27 18:48:28 +02:00 by timothy · 1 comment
Owner

Symptom

Build & test (.NET) fails on main at 1d76a088c (run 1387, API run id 1656) in
web/src/api/pageSizeCallSites.guard.test.ts, with 4 UNREGISTERED and 5 STALE entries.

This is not confined to that historical run — main is red right now. Reproduced locally on a
clean origin/main (ac0f65c74). The later green main runs (1393, 1388) do not contradict it:
their Build & test completed in ~47s, i.e. the docs-only fast path, so the web suite never ran.
The last main push that actually exercised it is the one that failed.

Root cause

Corrected after review — the first version of this issue misattributed it. The guard's REGISTRY
pins every pageSize call site by absolute line:column (#650 follow-up F5/M-6), making it a
function of every other file in the repo. The guard was born red:

  • #651 (fad6805b9) moved AutoTuneScreen.tsx up ten lines and FillerPresetsScreen.tsx down
    seventy-two, and merged before the guard's own PR (#675) did (git merge-base --is-ancestor fad6805b9 d751f5e01 succeeds). The registry, authored against a pre-#651 base, was stale the
    instant it landed — and two of its entries named sites #651 had deleted outright.
  • The guard's own merge run was CANCELLED (run id 1655 on d751f5e01), so nothing reported the
    red. It first surfaced on the next push, #676's merge — which touches no web/src file and is
    not the cause. ci.cancelled-is-not-a-verdict, paying out.

That is one ordering accident, not a recurring pattern. The exposure is general anyway: every PR
is green against its own base, so the breakage exists only in the merge result and lands on main
after review and after the merge gate.

Two secondary staleness items found on the way:

  • The guard's doc comment cited spa.list-completeness-vs-bounded-pickers, which #651 superseded and
    moved to archive/ — a stale breadcrumb.
  • The registry's class-b label ("bounded page with totalCount surfaced") was applied to sites that
    render no hint and never did, so the registry claimed evidence that does not exist.

Fix

Key the registry on (file, kind, value) and drop the position. A new site, a removed site and a
changed value all still fail; only moving an unchanged site stops failing. The MULTISET comparison
is preserved. The SCANNER's positional identity (pageSizeSiteId) is untouched — its test asserts
real AST positions against fixed inline fixtures, the opposite case, with no churn.

Adds a search-bounded class for the #651 shape, and a deviation class so the registry refuses to
launder a live defect into a compliant-looking label (#685 filed for the CollectionsScreen
§3b violation found while reconciling).

Done-when

  • Registry keyed on identity, not position; multiset comparison preserved
  • The guard passes on this branch, whose only delta from origin/main is this fix — so the
    merge result is green by construction (the original wording, "main is green after merge", was
    circular: unsatisfiable before the merge it was meant to gate)
  • Negative controls demonstrated, each mutation confirmed to have applied: new site FAILS,
    removed registry entry FAILS, changed value FAILS, third duplicate occurrence FAILS,
    deviation without a tracking issue FAILS, non-deviation carrying one FAILS, report dropping
    positions FAILS, pure line move PASSES
  • Full web suite green (1184 tests) + scripts/tests 338 + npm run typecheck + eslint clean
  • Decision record added and catalog regenerated; guard's stale record breadcrumb corrected
  • Adversarial review passed — 3 rounds, cold brief, worktree-isolated; Review-verdict: MERGEABLE @ 6894511. Rounds 1 and 2 both returned BLOCKED and both were acted on.
  • CI green on the PR head (689451161) — combined state success. Build & test (.NET) took
    21m38s, i.e. a real full run, not the ~47s docs-only fast path that made main look green
    while this was broken.
## Symptom `Build & test (.NET)` fails on `main` at `1d76a088c` ([run 1387](https://gitea.tblindustries.be/timothy/ersatztv/actions/runs/1387), API run id 1656) in `web/src/api/pageSizeCallSites.guard.test.ts`, with 4 UNREGISTERED and 5 STALE entries. **This is not confined to that historical run — `main` is red right now.** Reproduced locally on a clean `origin/main` (`ac0f65c74`). The later green `main` runs (1393, 1388) do not contradict it: their `Build & test` completed in ~47s, i.e. the docs-only fast path, so the web suite never ran. The last `main` push that actually exercised it is the one that failed. ## Root cause **Corrected after review — the first version of this issue misattributed it.** The guard's REGISTRY pins every `pageSize` call site by absolute `line:column` (#650 follow-up F5/M-6), making it a function of **every other file in the repo**. The guard was **born red**: - #651 (`fad6805b9`) moved `AutoTuneScreen.tsx` up ten lines and `FillerPresetsScreen.tsx` down seventy-two, and **merged before the guard's own PR (#675) did** (`git merge-base --is-ancestor fad6805b9 d751f5e01` succeeds). The registry, authored against a pre-#651 base, was stale the instant it landed — and two of its entries named sites #651 had deleted outright. - **The guard's own merge run was CANCELLED** (run id 1655 on `d751f5e01`), so nothing reported the red. It first surfaced on the next push, #676's merge — which touches **no `web/src` file** and is not the cause. `ci.cancelled-is-not-a-verdict`, paying out. That is one ordering accident, not a recurring pattern. **The exposure is general anyway:** every PR is green against its own base, so the breakage exists only in the merge result and lands on `main` after review and after the merge gate. Two secondary staleness items found on the way: - The guard's doc comment cited `spa.list-completeness-vs-bounded-pickers`, which #651 superseded and moved to `archive/` — a stale breadcrumb. - The registry's `class-b` label ("bounded page with `totalCount` surfaced") was applied to sites that render no hint and never did, so the registry claimed evidence that does not exist. ## Fix Key the registry on `(file, kind, value)` and drop the position. A new site, a removed site and a changed value all still fail; only *moving* an unchanged site stops failing. The MULTISET comparison is preserved. The SCANNER's positional identity (`pageSizeSiteId`) is untouched — its test asserts real AST positions against fixed inline fixtures, the opposite case, with no churn. Adds a `search-bounded` class for the #651 shape, and a `deviation` class so the registry refuses to launder a live defect into a compliant-looking label (**#685** filed for the `CollectionsScreen` §3b violation found while reconciling). ## Done-when - [x] Registry keyed on identity, not position; multiset comparison preserved - [x] The guard passes on this branch, whose only delta from `origin/main` is this fix — so the merge result is green by construction (the original wording, "main is green after merge", was circular: unsatisfiable before the merge it was meant to gate) - [x] Negative controls demonstrated, each mutation confirmed to have applied: new site FAILS, removed registry entry FAILS, changed value FAILS, third duplicate occurrence FAILS, deviation without a tracking issue FAILS, non-deviation carrying one FAILS, report dropping positions FAILS, pure line move PASSES - [x] Full web suite green (1184 tests) + `scripts/tests` 338 + `npm run typecheck` + eslint clean - [x] Decision record added and catalog regenerated; guard's stale record breadcrumb corrected - [x] Adversarial review passed — 3 rounds, cold brief, worktree-isolated; `Review-verdict: MERGEABLE @ 6894511`. Rounds 1 and 2 both returned BLOCKED and both were acted on. - [x] CI green on the PR head (`689451161`) — combined state `success`. `Build & test (.NET)` took 21m38s, i.e. a real full run, not the ~47s docs-only fast path that made `main` look green while this was broken.
Author
Owner

Closing record

Outcome: Fixed and merged as aa1f504e0 (PR #686). main was red on the #650 pageSize
call-site guard; the guard now passes on merged main, verified by running it against a clean
checkout rather than trusting the merge API. Registry identity moved from absolute line:column to
(file, kind, value), so an unrelated line shift can no longer red main.

Root cause: The registry keyed each site on its source position, making it a function of every
other file in the repo. The guard was born red: #651 moved AutoTuneScreen.tsx up ten lines and
FillerPresetsScreen.tsx down seventy-two, and merged before the guard's own PR (#675) did, so the
registry — authored against a pre-#651 base — was stale on arrival, with two entries naming sites
#651 had deleted. A cancelled CI run is what let it land: the guard's own merge run (id 1655 on
d751f5e01) was cancelled, so nothing reported the red, which first surfaced on the next push.
#676's merge, which I initially blamed, touches no web/src file and is not the cause.

Decisions/conventions changed: Added testing.enumerating-guard-identity-not-position — a guard
whose input is the whole repository must not encode anything the whole repository can change without
meaning to. Also establishes that a registry must not launder a defect into a compliant-looking
label (the deviation class, whose entries must name a tracking issue via a structural field).

Reusable knowledge:

  1. A cancelled run hides a born-red merge. ci.cancelled-is-not-a-verdict cost a known-good
    main here — the cancelled run was silently treated as "nothing to see".
  2. A fast-path green is not a green. The two main runs after the breakage took ~47s
    (docs-only path) and never ran the web suite, so main looked fine while broken. Check the
    duration before reading a green as coverage.
  3. A registry test's inputs are every other file in the repo, so it can be invalidated by a
    branch that never touches it, and CI cannot see it coming — each PR is green against its own base.
  4. A #\d+ regex over prose is not an issue reference check. The first version of the
    deviation test passed with the tracking reference deleted, because the note legitimately cited
    two historical issues. Use a structural field.
  5. Verify a mutation applied before trusting its result. One negative control here silently
    matched nothing and "passed", proving exactly nothing.

Verification: 8 mutations, each confirmed applied before its result was read — 7 must-fail cases
all red, the pure line move green. Full web suite 1184/1184, scripts/tests 338/338, typecheck +
eslint clean. CI green on head 689451161 with Build & test (.NET) at 21m38s (a real run, not the
fast path). Guard re-run against merged main post-merge.

Deferred: #685 — CollectionsScreen's AddItemsDialog degrades to an unfiltered whole-type
50-row window on an empty query and surfaces no truncation. Found while reconciling the registry;
deliberately not fixed here, and recorded as a deviation rather than mislabelled compliant.

Docs updated: docs/decisions/records/testing/enumerating-guard-identity-not-position.md (new),
docs/decisions/README.md (regenerated catalog). No route/endpoint/SPA-screen change, so
blazor-route-parity.md, api-conventions.md and spa-conventions.md needed no edit — the §3b
deviation this surfaced is tracked in #685 rather than changing the convention.

Process note: Review was same-family (cold brief, worktree-isolated, 3 rounds), not
cross-family — the Codex quota is exhausted until Aug 1. Rounds 1 and 2 both returned BLOCKED, and
both blockers were mine: a misattributed merge in the record, and a false exhaustiveness claim I
introduced by writing a comment and the registry it describes in the same pass.

## Closing record **Outcome:** Fixed and merged as `aa1f504e0` (PR #686). `main` was red on the #650 `pageSize` call-site guard; the guard now passes on merged `main`, verified by running it against a clean checkout rather than trusting the merge API. Registry identity moved from absolute `line:column` to `(file, kind, value)`, so an unrelated line shift can no longer red `main`. **Root cause:** The registry keyed each site on its source position, making it a function of every other file in the repo. **The guard was born red:** #651 moved `AutoTuneScreen.tsx` up ten lines and `FillerPresetsScreen.tsx` down seventy-two, and merged *before* the guard's own PR (#675) did, so the registry — authored against a pre-#651 base — was stale on arrival, with two entries naming sites #651 had deleted. **A cancelled CI run is what let it land**: the guard's own merge run (id 1655 on `d751f5e01`) was cancelled, so nothing reported the red, which first surfaced on the next push. #676's merge, which I initially blamed, touches no `web/src` file and is not the cause. **Decisions/conventions changed:** Added `testing.enumerating-guard-identity-not-position` — a guard whose input is the whole repository must not encode anything the whole repository can change without meaning to. Also establishes that a registry must not launder a defect into a compliant-looking label (the `deviation` class, whose entries must name a tracking issue via a structural field). **Reusable knowledge:** 1. **A cancelled run hides a born-red merge.** `ci.cancelled-is-not-a-verdict` cost a known-good `main` here — the cancelled run was silently treated as "nothing to see". 2. **A fast-path green is not a green.** The two `main` runs after the breakage took ~47s (docs-only path) and never ran the web suite, so `main` looked fine while broken. Check the duration before reading a green as coverage. 3. **A registry test's inputs are every other file in the repo**, so it can be invalidated by a branch that never touches it, and CI cannot see it coming — each PR is green against its own base. 4. **A `#\d+` regex over prose is not an issue reference check.** The first version of the deviation test passed with the tracking reference deleted, because the note legitimately cited two historical issues. Use a structural field. 5. **Verify a mutation applied before trusting its result.** One negative control here silently matched nothing and "passed", proving exactly nothing. **Verification:** 8 mutations, each confirmed applied before its result was read — 7 must-fail cases all red, the pure line move green. Full web suite 1184/1184, `scripts/tests` 338/338, typecheck + eslint clean. CI green on head `689451161` with `Build & test (.NET)` at 21m38s (a real run, not the fast path). Guard re-run against merged `main` post-merge. **Deferred:** #685 — `CollectionsScreen`'s `AddItemsDialog` degrades to an unfiltered whole-type 50-row window on an empty query and surfaces no truncation. Found while reconciling the registry; deliberately *not* fixed here, and recorded as a `deviation` rather than mislabelled compliant. **Docs updated:** `docs/decisions/records/testing/enumerating-guard-identity-not-position.md` (new), `docs/decisions/README.md` (regenerated catalog). No route/endpoint/SPA-screen change, so `blazor-route-parity.md`, `api-conventions.md` and `spa-conventions.md` needed no edit — the §3b deviation this surfaced is tracked in #685 rather than changing the convention. **Process note:** Review was same-family (cold brief, worktree-isolated, 3 rounds), not cross-family — the Codex quota is exhausted until Aug 1. Rounds 1 and 2 both returned BLOCKED, and both blockers were mine: a misattributed merge in the record, and a false exhaustiveness claim I introduced by writing a comment and the registry it describes in the same pass.
timothy added the bugpriority: high labels 2026-07-27 19:43:18 +02:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: timothy/ersatztv#684