Skip to content

finding: check-role-word's green line counts only the LEDGER, so when the debt is finally paid a total scan failure and a clean repo print the same OK #9910

Description

@os-steve

Observation only — no gate is red, and this one is not red yet. Found while implementing #9767 (the same defect class in check:published-readme-exports); out of scope there by the card's own scale check, so recorded rather than fixed.

Instance of the #9747 meta-shape (fails toward FALSE GREEN), with a twist worth stating: the hole is latent, and it opens on success.

The line

scripts/check-role-word.mjs:236 is the whole success branch:

console.log(`check-role-word: OK (${Object.keys(current).length} baselined file(s), no new occurrences).`);

current holds only files that still carry role-word hits — the ledger. The population that was actually read (files, built by walk() over ROOTS = ['content/docs', 'skills'], thousands of files) is never printed. So the only number in the green line is debt-derived.

Why it is safe today, and why that is the problem

With a non-empty ledger (43 files right now), a scan that reads nothing is caught — but incidentally, by the stale/ratchet-down branch, not by the green line:

check-role-word: 43 problem(s)
• content/docs/...: baselined file is clean/gone (was N) — ratchet DOWN: ...

That protection is a side effect of still having debt. It evaporates at exactly the moment the gate succeeds at its purpose. With the ledger empty, current = {} and baseline = {} produce no errors in either direction, and the green line has no other number to fall back on.

Measured, not argued. Ablating ROOTS to two non-existent directories and emptying the baseline — both ablations confirmed on disk via git diff --stat before running:

check-role-word: OK (0 baselined file(s), no new occurrences). EXIT=0

A gate that read zero files, over an empty ledger, reporting success. Restored with git checkout afterwards; OK (43 baselined file(s), no new occurrences) again.

Why this is the #9767 shape, one step earlier

#9767 was the same sentence in check:published-readme-exports, and it became visible only once #9581 emptied that baseline. This gate is one debt-payment away from the identical reading. The remedy shape #9767 adopted transfers directly and cheaply: print the input volume alongside the ledger count, e.g.

check-role-word: OK (N file(s) scanned across content/docs, skills; 43 baselined, no new occurrences).

A zero in N file(s) scanned is an alarm a reader can act on; a zero in 0 baselined file(s) says nothing at all. Per #8995 the wording would want a --self-test pin in the same edit, since the counts are interpolated.

Scope

One clause in one green line, plus a pin — the same size as #9767. Filed unassigned; not urgent, but it is cheapest to fix before the ledger empties, because after that the gate looks fine.

Generated by Claude Code

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions