Repository navigation
Commit 0b9ad00
fix(scripts): doc-authoring self-test pins its batteries by NAME, so a battery that stops running is named rather than uncounted (#13487)
* fix(scripts): doc-authoring self-test pins its batteries by NAME, not by a bare pass
`selfTest()` decided success as `failures.length === 0` with no assertion-count
floor anywhere, so "every case held" and "the cases never ran" produced the same
output: an early return at the top of `selfTestRule3()` left that whole battery
unrun and the script still exited 0, printing the verdict line asserting those
cases hold — in the gate that exists to catch prose claiming more than the code
delivers.
Every battery now declares itself with `battery('<name>')`, every `expect()` is
attributed to the battery most recently opened, and the floor requires the
OPENED set to equal the DECLARED set with each battery at or above its own
pinned count. A set difference names WHICH battery stopped running; a count says
only that something did. A bare non-zero total would not have caught the 40->3
case the card warns about, and a pinned TOTAL rots as soon as a sibling grows.
`main()` no longer does `return selfTest()`: `selfTest()` returns a verdict
sentinel only after the floor has been evaluated and the success line printed,
so a `return` that leaves the function early is refused instead of exiting 0
with no output at all.
Audited before designing: 16 batteries, 198 assertions, and every static
`expect()` call site in the file executes today — no battery was already dark.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Pk26oZ12t5N1hwGW1m1MgC
* fix(scripts): pin the battery registry's own size, not just each battery's count
Deleting an entry from SELF_TEST_BATTERIES silences that battery's floor exactly
as effectively as zeroing its count, so the registry size is pinned too — the
same shrink-only shape, with the same MAINTAINER-ONLY refusal beside it.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Pk26oZ12t5N1hwGW1m1MgC
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent c39369d commit 0b9ad00
1 file changed
Lines changed: 160 additions & 9 deletions
0 commit comments