From 226bbc000dc52b049000df0465694895ce6e9e2c Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 31 Aug 2026 22:53:04 +0000 Subject: [PATCH] docs(pm): express the entry guard's self-test size as a floor, not a reading MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The docblock above the `--self-test` entry guard carried two figures frozen at PR #9897 and both had rotted: * "THIS file's 77 assertions" read as a present-tense claim about this file's current suite. It printed 77 at PR #9897 and prints 255 today — a factor of 3.3. * "the same reason line 810 carries it" pointed at the sibling main-invocation guard, which really was line 810 at PR #9897. Line 810 is now an unrelated `try {` inside the regeneration predicate; the guard has moved to line 2336. Writing today's numbers would re-freeze the same defect one value later, so the 77 is now anchored to PR #9897 as the historical fact it is, today's size is a FLOOR ("more than three times that") stated as a floor on purpose and pointing at `--self-test`'s `checked` as the live reading, and the line number is replaced by a reference to the guard itself, which cannot drift. Measured before choosing the shape, on this file's own history rather than inherited from the sibling: across all 13 commits that have ever touched it (introduced 2026-08-18, never renamed), the static `assert(` count went up 10 times, held flat twice, and has never once gone down (22 -> 248 static). The counting method reproduces the two independent readings on record — 70 static at a065e46550b4 and 223 at 9c4c431fd. The runtime figure is not even constant across environments, which is a second reason a floor beats a reading: `--self-test` prints 255 in an installed tree and 253 without node_modules, where the generator-provenance row fails closed and says so on its `live:` line. Both readings are green and truthful. No behaviour change: the guard and the self-test are untouched, and the count is identical before and after this commit (255 at the merge base, 255 here). Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_01Msg17tAHJ3jVTYFgHydCm2 --- scripts/pm/check-governed-merges.mjs | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/scripts/pm/check-governed-merges.mjs b/scripts/pm/check-governed-merges.mjs index b62a544b98..ecb7ce3aa8 100644 --- a/scripts/pm/check-governed-merges.mjs +++ b/scripts/pm/check-governed-merges.mjs @@ -3498,13 +3498,23 @@ function runTestModeExitFor(paths) { return testVerdict(paths).governed ? EXIT_TEST_GOVERNED : EXIT_TEST_NOT_GOVERNED; } -// `invokedDirectly` for the same reason line 810 carries it: this module is -// imported for its exported predicates (`proxyRearmPlan` — see -// scripts/pm/ci-failure.mjs), and an unguarded trigger ran THIS file's 77 -// assertions inside the importer's own `--self-test`, printing a second -// summary and putting an unrelated file's failures on the importer's exit -// code. A self-test is a mode of the file that is being RUN, never a side -// effect of importing it. +// `invokedDirectly` for the same reason the main-invocation guard above +// carries it: this module is imported for its exported predicates +// (`proxyRearmPlan` — see scripts/pm/ci-failure.mjs), and an unguarded +// trigger ran this file's whole self-test inside the importer's own +// `--self-test`, printing a second summary and putting an unrelated file's +// failures on the importer's exit code. The suite was 77 assertions at PR +// #9897, where this guard landed, and is now more than three times that: the +// 77 is anchored to that PR and frozen as a historical fact, while the +// multiple is a FLOOR and is written as one on purpose. The live figure is +// whatever `--self-test` prints from `checked`; it moves on most edits to +// this file and has never once gone down across this file's history, so a +// floor stays true where a reading rots. Both figures that stood here had +// rotted before anyone looked — 77 was written as THIS file's current size +// and was by then off by a factor of three, and the neighbouring "line 810" +// had drifted onto unrelated code — so do not "helpfully" refresh either +// back into a reading. A self-test is a mode of the file that is being RUN, +// never a side effect of importing it. if (invokedDirectly && process.argv.includes('--self-test')) { await selfTest(); }