Skip to content

Commit 62a137b

Browse files
os-samclaude
andauthored
docs(pm): express the entry guard's self-test size as a floor, not a reading (#14002)
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 a065e46 and 223 at 9c4c431. 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). Claude-Session: https://claude.ai/code/session_01Msg17tAHJ3jVTYFgHydCm2 Co-authored-by: Claude <noreply@anthropic.com>
1 parent 0f12e32 commit 62a137b

1 file changed

Lines changed: 17 additions & 7 deletions

File tree

scripts/pm/check-governed-merges.mjs

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3498,13 +3498,23 @@ function runTestModeExitFor(paths) {
34983498
return testVerdict(paths).governed ? EXIT_TEST_GOVERNED : EXIT_TEST_NOT_GOVERNED;
34993499
}
35003500

3501-
// `invokedDirectly` for the same reason line 810 carries it: this module is
3502-
// imported for its exported predicates (`proxyRearmPlan` — see
3503-
// scripts/pm/ci-failure.mjs), and an unguarded trigger ran THIS file's 77
3504-
// assertions inside the importer's own `--self-test`, printing a second
3505-
// summary and putting an unrelated file's failures on the importer's exit
3506-
// code. A self-test is a mode of the file that is being RUN, never a side
3507-
// effect of importing it.
3501+
// `invokedDirectly` for the same reason the main-invocation guard above
3502+
// carries it: this module is imported for its exported predicates
3503+
// (`proxyRearmPlan` — see scripts/pm/ci-failure.mjs), and an unguarded
3504+
// trigger ran this file's whole self-test inside the importer's own
3505+
// `--self-test`, printing a second summary and putting an unrelated file's
3506+
// failures on the importer's exit code. The suite was 77 assertions at PR
3507+
// #9897, where this guard landed, and is now more than three times that: the
3508+
// 77 is anchored to that PR and frozen as a historical fact, while the
3509+
// multiple is a FLOOR and is written as one on purpose. The live figure is
3510+
// whatever `--self-test` prints from `checked`; it moves on most edits to
3511+
// this file and has never once gone down across this file's history, so a
3512+
// floor stays true where a reading rots. Both figures that stood here had
3513+
// rotted before anyone looked — 77 was written as THIS file's current size
3514+
// and was by then off by a factor of three, and the neighbouring "line 810"
3515+
// had drifted onto unrelated code — so do not "helpfully" refresh either
3516+
// back into a reading. A self-test is a mode of the file that is being RUN,
3517+
// never a side effect of importing it.
35083518
if (invokedDirectly && process.argv.includes('--self-test')) {
35093519
await selfTest();
35103520
}

0 commit comments

Comments
 (0)