Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 15 additions & 10 deletions scripts/check-wildcard-fallthrough.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -460,9 +460,11 @@ const SELF_TEST_VERDICT = 'check-wildcard-fallthrough self-test reached its verd
//
// "no assertion threw" used to be this self-test's ONLY success condition, so
// "every case held" and "the cases never ran" printed the same line — and this
// file's verdict spells a TRANSCRIBED count (`17 cases`), which is evidence, not
// proof: nothing compared it, so a deleted block shrank the real count while the
// literal stayed put. Closed the way PR #13487 validated on check-doc-authoring:
// file's verdict once spelled a TRANSCRIBED count (a literal `17` against a real
// 18), which is evidence, not proof: nothing compared it, so a deleted block
// shrank the real count while the literal stayed put. The verdict now derives
// its number from the ledger this roster floors (#15231). Closed the way PR
// #13487 validated on check-doc-authoring:
// what is pinned is the registered NAMES, not a number, and the floor requires
// the OPENED set to equal the DECLARED set with each battery at or above its own
// count.
Expand Down Expand Up @@ -625,13 +627,16 @@ function selfTest() {
process.exit(1);
}

// ⚠️ MEASURED at 18, not 17: this transcribed literal had already drifted one
// below the real count before this floor existed, which is precisely why a
// printed number is evidence and not proof. It is left as-is here so this
// change stays a pure no-op on output; the correction is filed separately, and
// the floor above is what makes the drift harmless — the count can no longer
// shrink in silence.
console.log('✓ self-test: 17 cases');
// The verdict DERIVES its number from `batterySeen` — the very ledger the floor
// above just evaluated — so the printed count and the floor can never disagree,
// and a block that stops running shrinks the number instead of leaving a
// transcribed literal standing (#15231). What it counts is assertions that
// actually RAN this run, not `assert(` call sites in the source: those are two
// different facts, and only the first one is measured here. Summing the whole
// ledger is exact because reaching this line means every battery that
// registered is a declared one — the set difference above reds otherwise.
const casesRun = [...batterySeen.values()].reduce((total, count) => total + count, 0);
console.log(`✓ self-test: ${casesRun} cases`);

return SELF_TEST_VERDICT;
}
Expand Down
Loading