docs(778): the population was wrong three times — record what finally fixed it
PR Gates / CI image pin matches docker/ci (pull_request) Successful in 11s
Build ErsatzTV Image / Delimiter ban (release path) (pull_request) Successful in 19s
PR Gates / Docs update reminder (pull_request) Successful in 12s
PR Gates / decisions lifecycle (pull_request) Successful in 22s
PR Gates / Fix proofs (Proves trailers) (pull_request) Successful in 12s
review-verdict/h10 Awaiting review verdict for e5996b7
Review verdict / Set review-verdict status (pull_request_target) Successful in 16s
PR Gates / Script tests (pytest) (pull_request) Successful in 4m47s
Build ErsatzTV Image / Build & test (.NET) (pull_request) Canceled after 7m29s
Build ErsatzTV Image / EF migration integrity (SQLite + MySql) (pull_request) Canceled after 0s
Build ErsatzTV Image / Functional E2E (curl + UI contracts) (pull_request) Canceled after 0s
Build ErsatzTV Image / Build & push image (amd64) (pull_request) Canceled after 0s
Build ErsatzTV Image / API docs in sync (OpenAPI + endpoint index) (pull_request) Canceled after 0s
Build ErsatzTV Image / Formatting (changed .cs conform to .editorconfig) (pull_request) Canceled after 0s

The record said "wrong twice" and drew the lesson "execute the traversal and eyeball
it". The third instance (rglob picking up untracked `.husky/_` shims) shows that was
still the wrong generalisation: every round had executed its traversal, and every round
had an argument for why it was sufficient.

What held was changing the SOURCE, not the walk — `git ls-files` instead of the
filesystem. The index is authoritative, identical for CI and every checkout, and
excludes untracked build output by construction. So the lesson is the one
`testing.guard-derives-population-from-source` already states, one level up: ask what
the authoritative list of these things IS, and if the answer is "whatever the walk
finds", the guard is not finished however carefully the walk is written.

Decisions-Edit: yes

refs #778

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-08-19 17:54:00 +02:00
co-authored by Claude Opus 5
parent 4261f76dd2
commit e5996b7c1e
@@ -78,18 +78,27 @@ over — `MARKED_JOBS` in `test_ci_dropped_step_guard.py` is a hand-written mirr
required contexts, annotated with a date. A dated comment is a claim about the past. Two independent
guards now depend on that configuration; one of them checks it.
**The deliverable's own population was wrong twice, and that is the most transferable part of this
record.** The inventory is the detector, so its population *is* the guard. Round one derived it by
filtering the scope on an outbound-network token list — which omitted `git fetch`, this repo's
commonest remote read, so a hook that fetches `origin/main` and derives a push decision was
invisible. Round two dropped the filter but used non-recursive `glob`, so four nested files stayed
out, one of them calling a live ErsatzTV API and acting on the reply. Both rounds shipped with an
argument for why the traversal was sufficient, and both arguments were wrong in the same way: a
completeness claim resting on a traversal nobody had compared against the filesystem. The
generalisation is not "use rglob"; it is that **the scope may be hand-written and reviewable, but
anything narrowing the population must be executed and its output eyeballed against `ls`**, because
the members it drops are invisible by construction — which is `testing.guard-derives-population-from-source`
turned on the very artifact meant to enforce it.
**The deliverable's own population was wrong three times, and that is the most transferable part of
this record.** The inventory is the detector, so its population *is* the guard. Round one filtered
the scope on an outbound-network token list, which omitted `git fetch` — this repo's commonest remote
read — so a hook that fetches `origin/main` and derives a push decision was invisible. Round two
dropped the filter but used non-recursive `glob`, so four nested files stayed out, one of them
calling a live ErsatzTV API and acting on the reply. Round three used `rglob`, which is recursive
and therefore also enumerated `.husky/_/` — untracked, gitignored shims that `npm ci` generates —
leaving the guard **red on every developer checkout and green in CI**, which never runs `npm ci`. A
guard that fails everywhere except where it runs teaches its readers to ignore it, which is worse
than no guard at all.
Every round shipped with an argument for why the traversal was sufficient, and every argument was
wrong the same way. The fix that finally held was not a better traversal: it was **deriving the
population from `git ls-files`**. The filesystem is not an authoritative source — it reports build
output, editor droppings and whatever else is on disk, and it differs per machine. The index is
authoritative, versioned, identical for CI and every checkout, and excludes untracked generated files
by construction rather than by an exclusion list somebody has to maintain. So the generalisation is
the one `testing.guard-derives-population-from-source` already states, applied one level up: when a
guard enumerates a population, ask **what is the authoritative list of these things** — and if the
answer is "whatever the walk finds", the guard is not finished, however carefully the walk is
written.
**Grade down before you argue.** Three cold-review rounds demoted row after row — the scheduled-merge
path, both merge-consent head/base reads, the file enumerator, every registry-tag row — and in each