docs(pm): express the dispatch-gates self-test size as a floor, not a frozen reading - #13962
Conversation
The entry-guard docblock carried "this file carries it at 334" — a frozen
reading of a number that moves on most edits to this file. It had drifted to
1073 by the time anyone looked: a factor of 3.2.
Writing today's number would re-freeze the same defect one value later, so the
figure is now a FLOOR ("more than ten times" #9897's 77), stated as a floor on
purpose and pointing at `--self-test`'s `cases.length` as the live reading.
Measured before choosing the shape: across all 83 commits that have touched
this file, the assertion count went up 72 times, held flat 10 times, and has
never once gone down (14 -> 1047 static call sites; 1073 at runtime after the
file-local loop expansions). A floor is safe precisely because of that.
The neighbouring 77 is left frozen deliberately — it is anchored to PR #9897
and was true there (70 static assertions at that commit), so it is a historical
fact rather than a live count. The sentence now says so explicitly.
No behaviour change: the `invokedDirectly` guard and the self-test are
untouched. `--self-test` still reports 1073 cases pass.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Pk26oZ12t5N1hwGW1m1MgC
|
ACCEPT — ⭐⭐ The Zone 2 A measurement is the model for how to use a proxyRunning the self-test at 83 historical commits is unaffordable (2-6 min a run). So the dev used a static proxy — the count of
It also checked that every multiplier is a literal array in this file, so no loop draws its population from the repo tree — which is what makes the proxy stable across history rather than only at the calibration point. Then the sweep, 83 commits touching the file (2026-08-10 → 08-31): 72 increases, 10 flat, 0 decreases. ⇒ ⭐ A proxy calibrated against the real reading, with the mechanism that could invalidate it checked separately, is a measurement. An uncalibrated proxy would have been a guess with numbers on it. The shape the measurement chose2a — a bound, expressed as a multiple of the The shipped text does four things I want on record:
⭐⭐ "What would catch a wrong edit?" — nothing, and it explained structurally why⛔ Not "I ran it and it was green". The dev established that every gate in the derived family that reads this file masks comments before judging: And it stated the residual risk plainly rather than burying it: "If the count ever fell below 770 the sentence would go false and nothing would flag that either — the Zone 2 A history measurement is the entire basis for accepting that risk."
⛔ My own zero was wrong, and the counter-check is the only reason I knowZone 2 C asked whether the neighbouring I went to verify and my It is not. The phrase wraps across a line break: ⭐ That is instrument lesson ② on this lane's own list — cross-line text makes a single-string grep return zero — committed again by the seat that wrote it down this morning. I caught it only because the rule says to counter-check a zero against a control, and the control ( Gates14 families derived (harvested with ⭐ Two gates first exited 1 with "PREREQUISITE NOT MET — the dependency yaml is not installed" in a fresh worktree. The dev read them as not measured, ran ⛔ No ablation, correctly: the change is comment-only, and — per the field above — there is no mechanical check here that could be proved failable. Governed-surface checkDiff is ArmingFollows once CI settles green on the head. Generated by Claude Code |
Fixes #13536
The defect
The
invokedDirectlydocblock inscripts/pm/dispatch-gates.mjssized this file's own self-test with a frozen literal:334was a reading ofcases.length— a number the self-test computes and prints at runtime. It had drifted to 1073, a factor of 3.2. The figure is load-bearing prose: it is the severity term in the argument for why a self-test must be a MODE of the file being run and never a side effect of importing it. Writing today's number would re-freeze the same defect one value later, which is exactly how the card describes the original mistake.Zone 2 A — the history measurement that chose the shape
Question: has this file's self-test case count ever DECREASED across a commit?
Answer: no — not once, over the file's entire life.
Method. The runtime count is
cases.length, accumulated byconst t = (name, cond) => cases.push([name, cond]). Running the self-test at every historical commit is not affordable (a single run is 2–6 minutes on this shared box), so I used a static proxy — the count oft(call sites — and validated the proxy against the live run before trusting it:t(call sites at9c4c431fd--self-testoutput1073 cases passThe +26 is fully accounted for, and every multiplier is a literal array in this file — no loop draws its population from the repo tree, so the printed count is a function of this file plus a few
existsSyncbranches:rootFileDeclarations(8 entries, 2 assertions each) +14['check:entry-guard', 'check:parse-guard'](3 assertions each) +3fabricatedlist +3['check:docs', 'check:skill-refs']+2['check:i18n', 'check:i18n-coverage']+2misparsedFamilySources,packageLedgerFamilySources(2 entries each) +1 eachResult over all 83 commits that have touched the file (2026-08-10 through 2026-08-31,
git log --follow):The count went 14 to 1047 monotonically — it has never gone down.
Which shape that chose. The measurement clears option 2a (a bound). A lower bound stays true under a count that only ever grows, and it keeps the severity term the argument needs, which dropping the figure entirely would blunt. So: a floor, phrased as a multiple of the 77 already in the sentence — "more than ten times that many". Live ratio is 1073/77 = 13.9, so the floor carries ~39% headroom, and by the history measurement that headroom only widens.
Two smaller findings pushed the same way. The printed number is not even a pure function of this file — eight assertions sit behind
if (existsSync(...))branches, so the same commit can print different totals in different checkouts. And the count moves on 88% of commits here (72 of 82 transitions). Both make an exact figure doubly unfreezable.Zone 2 B — occurrence count
334appears exactly once in the file, re-derived on currentorigin/main(9c4c431fd) after PR #13930 landed. PM reading confirmed; the replace-one was safe.After the change:
0.Zone 2 C — the neighbouring 77 is correctly frozen (and a finding next door)
Verified, PM reading holds.
77is a historical fact anchored to PR #9897, not a live count, so it is correct to leave frozen — and the new text now says so explicitly ("which carried 77 assertions at that PR") rather than leaving it ambiguous:assert(call sites inscripts/pm/check-governed-merges.mjsa065e46550b4)9c4c431fd(today)70 static + 7 loop expansion = the 77 the prose names, so 77 was true at #9897 and is now roughly a third of the truth. Frozen-and-anchored is the right call.
scripts/pm/check-governed-merges.mjscarries the same defect in its own docblock, and there it is not anchored:"THIS file's 77 assertions" is a present-tense claim about that file's current count, which is now 223+. That is the identical rot, one file over. Not touched here.
The new text
Per the card's Zone 3 note, the paragraph now separates what still holds (the property: this file's self-test is enormous next to the one #9897 fixed, so an import-triggered run is far worse here) from what was measured once (77, at #9897). And it states why the figure is a floor, so the next reader who reaches for the live number is told, in place, not to.
No gate was added to pin the docblock to the live count — the card rules that out, and I agree: it would tax every edit to a constantly-edited file and re-freeze the number by another route.
What would catch a wrong edit here
Plainly: nothing would. Stating that rather than implying coverage:
--self-teststays green (1073 cases) — but it was green with334too. It asserts nothing about this prose.check:entry-guardreports "masked prose/payloads accepted";check-self-test-wiredcounts--self-test"in code (comments masked)"). By construction they cannot see this paragraph.So the defence this PR ships is not mechanical: it is that the claim is now a floor instead of a reading, which stays true without maintenance, plus a sentence telling the next editor why refreshing it would be wrong. If the count ever fell below 770 the sentence would go false and nothing would flag that either — the history measurement above is the whole basis for accepting that risk.
Changeset
None. Script-only, and comment-only within that: no package publishes anything from this diff, matching the repo's precedent for script-only commits. The diff is one file under
scripts/pm/, which is inside the closed list theskip-changesetlabel exists for. I have appliedskip-changesetup front rather than waiting forCheck Changesetto go red.Gates: derived vs run
Derived with
node scripts/pm/dispatch-gates.mjs --repo objectstack-ai/objectstack(14 families; provenance line confirms the answer is about this repo at9c4c431fd). Reconciliationcomm -23of derived against run is empty — every derived family was invoked. Verdicts:pnpm check:agent-test-spellingpnpm check:bash32-floorpnpm check:cli-command-idspnpm check:cross-package-test-inputspnpm check:entry-guardpnpm check:parse-guardpnpm check:pnpm-filter-targetspnpm check:watch-hint-literalnode scripts/check-ci-filter-parity.mjsnode scripts/check-cross-package-test-inputs.mjsnode scripts/check-self-test-wired.mjsnode scripts/check-shard-attestation.mjsnode scripts/check-test-completeness.mjspnpm check:pm-dispatch-gates1073 cases passPlus, outside the derivation:
pnpm check:ratchet-remedy-authority— green. Run explicitly because#13813records that this gate builds its scan surface withreaddirSyncat runtime and spells no declarative glob, so path derivation cannot name it.node scripts/pm/dispatch-gates.mjs --self-test— green,1073 cases pass.check-test-completenessis NOT MEASURED, not red. It grades a savedturbo run testlog and was invoked with no argument; the gate prints its own instruction for this case: "running the family locally, record this gate as NOT MEASURED... ⛔ It is not a red, and there is nothing here to fix." CI passes it a real log.Two gates (
check-ci-filter-parity,check-shard-attestation) first returnedPREREQUISITE NOT MET — the dependency yaml is not installed, which is also not a red. I ranpnpm install --frozen-lockfileand re-ran both to green rather than reporting an unmeasured gate.Every derived family is now green except the one NOT MEASURED row. Session: https://claude.ai/code/session_01Pk26oZ12t5N1hwGW1m1MgC
All gate verdicts above are quoted from each gate's own printed verdict line, with exit codes captured by redirect before any pipe. Gate union run at
44fbc0a37, which is the head of this branch.Generated by Claude Code
Generated by Claude Code