You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
test(scripts): floor eight more self-tests with a hoisted single battery
The b5 recipe (PR #15217) applied to the remaining eight census rows of
#13799 batch 8a. Each file gets ONE battery opened at the top of its
self-test body, named `BASENAME self-test`, with the floor read off a run
(the roster pinned at 9999 first, the breach line naming N), the roster's own
size pinned at 1, `registerCase()` called from the block body of the helper
the file already has, and a verdict refusing below-floor / DID NOT RUN /
undeclared batteries through the file's own failure sink.
Floors measured on a run: check-adr-symbol-anchors 17, symbol-anchors 51,
check-i18n-walk-parity 23, check-test-completeness 67, checklist-select 17,
release-rehearsal-clone 32, render-release-coverage-anchor 10,
run-with-stall-guard 41.
Two of them are the census's own warning coming true: symbol-anchors has 40
static `assert(` sites but registers 51 (loops), and
render-release-coverage-anchor has 8 static `expect(` sites but registers 10.
A floor counted from the source would have been wrong in both.
Where the helper is module-level (check-adr-symbol-anchors, symbol-anchors,
render-release-coverage-anchor) the case sites call a thin in-body wrapper
that registers and then defers to the existing assertion, exactly as PR
#15156 landed for that shape; no assertion condition is touched.
checklist-select also stops transcribing its case count: the success line's
hand-typed `17` is now read off a counter (#15305). It renders the same text
today, which is what makes the byte comparison across the change readable.
check-test-completeness scopes its floor to the loud run, because
`selfTest({ quiet: true })` also runs on every production invocation of that
gate, where nothing claims a self-test verdict.
Part of #13799Fixes#15305
Co-authored-by: Claude <noreply@anthropic.com>
assert(workflow.includes('node scripts/check-adr-symbol-anchors.mjs'),'lint.yml must invoke this gate');
233
-
assert(workflow.includes('node scripts/check-adr-symbol-anchors.mjs --self-test'),'lint.yml must invoke this gate\'s --self-test');
288
+
check(workflow.includes('node scripts/check-adr-symbol-anchors.mjs'),'lint.yml must invoke this gate');
289
+
check(workflow.includes('node scripts/check-adr-symbol-anchors.mjs --self-test'),'lint.yml must invoke this gate\'s --self-test');
234
290
235
291
// 5. The census declaration is intact, INCLUDING the one-way error direction
236
292
// the ruling ordered recorded (point 5).
237
-
assert(CENSUS_13556.rotRateIsLowerBound===true,'the 72.1% figure is a LOWER bound and must be declared as one');
238
-
assert(CENSUS_13556.totalSurface===CENSUS_13556.distinctLineAnchors+CENSUS_13556.continuationAnchors,'the declared surface must be the sum of its parts');
293
+
check(CENSUS_13556.rotRateIsLowerBound===true,'the 72.1% figure is a LOWER bound and must be declared as one');
294
+
check(CENSUS_13556.totalSurface===CENSUS_13556.distinctLineAnchors+CENSUS_13556.continuationAnchors,'the declared surface must be the sum of its parts');
295
+
296
+
// ── The floor: every declared battery RAN, and ran its cases (#13489) ────
297
+
//
298
+
// Evaluated after every battery has had its chance and BEFORE the verdict, so
299
+
// the success line below can only be printed by a run in which the set of
300
+
// batteries that registered assertions EQUALS the set declared. A set
301
+
// difference names WHICH battery stopped; a count says only that something did.
302
+
// The floor's refusal joins the SAME sink the cases use — the module-level
303
+
// `assert`, which prints and exits 1 — so a breached floor cannot be printed
`SELF_TEST_BATTERIES declares ${declaredBatteries.length} batteries, below the pinned `
313
+
+`${SELF_TEST_BATTERY_FLOOR} — a battery deleted from the roster takes its own floor with it.`,
314
+
);
315
+
}
316
+
for(const[name,count]ofbatterySeen){
317
+
if(declaredBatteries.includes(name))continue;
318
+
floorBreached=true;
319
+
floorFailure(
320
+
`self-test battery "${name}" registered ${count} case(s) but is not declared in `
321
+
+'SELF_TEST_BATTERIES — an assertion attributed to no declared battery is one nothing floors.',
322
+
);
323
+
}
324
+
for(constnameofdeclaredBatteries){
325
+
constcount=batterySeen.get(name)??0;
326
+
if(count>=SELF_TEST_BATTERIES[name])continue;
327
+
floorBreached=true;
328
+
floorFailure(
329
+
count===0
330
+
? `self-test battery "${name}" DID NOT RUN — 0 cases registered, ${SELF_TEST_BATTERIES[name]} pinned. `
331
+
+'The verdict below would have claimed those cases hold.'
332
+
: `self-test battery "${name}" registered ${count} case(s), below its pinned floor of `
333
+
+`${SELF_TEST_BATTERIES[name]} — cases that used to run no longer do.`,
334
+
);
335
+
}
336
+
if(floorBreached){
337
+
floorFailure(
338
+
'A battery at or below its floor means cases STOPPED RUNNING — the battery is the bug, not the '
339
+
+'number. Find what stopped registering (an early return, a deleted block, a guard that now '
340
+
+'skips) and restore it.',
341
+
);
342
+
}
343
+
assert(!floorBreached,floorMessages.join('\n '));
239
344
240
345
console.log(`✅ check-adr-symbol-anchors --self-test: every finding class provoked, healthy anchors silent, population live, wiring pinned (${live.counts.anchors} live anchors)`);
0 commit comments