Derive four self-test verdict counts from their battery ledger - #17367
Merged
baozhoutao merged 1 commit intoSep 10, 2026
Conversation
…ledger check-init-service-contract.mjs, check-kernel-hook-pairs.mjs, check-quick-reference-counts.mjs and check-spec-parsed-alias.mjs each printed a transcribed literal count that nothing derived. All four already carry the SELF_TEST_BATTERIES + batterySeen ledger the floor above the verdict line evaluates, so each verdict now reads its number off that ledger instead of a hand-maintained literal, the same shape PR #16669 landed for check-wildcard-fallthrough.mjs. Three files count batteries that ran (batterySeen.size); check-spec-parsed-alias.mjs counts individual assertions (sum of batterySeen.values()), matching what its own verdict text calls them. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012GKcPZbMoGq7WPzKLfRBTU
baozhoutao
marked this pull request as ready for review
September 10, 2026 09:25
baozhoutao
enabled auto-merge
September 10, 2026 09:25
baozhoutao
deleted the
claude/issue-16664-derive-self-test-verdict-counts
branch
September 10, 2026 10:06
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Clause-②: no
Closes #16664
What
Four self-test verdict lines printed a transcribed literal count that nothing
derived. All four already carry the identical
SELF_TEST_BATTERIES+batterySeenledger (the shape PR #16669 read from forcheck-wildcard-fallthrough.mjs,Fixes #15231). Each verdict now reads its number off that ledger instead.scripts/measure-self-test-floor.mjs:1891is untouched — its number is acitation of another gate's historical output, not a live verdict line, and the
card is explicit that it is not an instance.
Per-file before / after
scripts/check-init-service-contract.mjsconsole.log('✓ self-test: 19 cases');console.log(`✓ self-test: ${batterySeen.size} cases`);batterySeen.size— the roster here has 19 named batteries and theprinted number has always meant "batteries that ran", not raw
assert(call sites (measured:
batterySeen.size= 19,sum(batterySeen.values())= 26 — theprinted literal matches the former, not the latter).
scripts/check-kernel-hook-pairs.mjsconsole.log('✓ self-test: 10 cases');console.log(`✓ self-test: ${batterySeen.size} cases`);batterySeen.size(measured: size = 10, sum = 16 — printed literalmatches size).
scripts/check-quick-reference-counts.mjsconsole.log('✓ check-quick-reference-counts self-test: 22 cases pass.');console.log(`✓ check-quick-reference-counts self-test: ${batterySeen.size} cases pass.`);batterySeen.size(measured: size = 22, sum = 37 — printed literalmatches size). This is the file the card names as the sharpest instance — a
gate whose own subject is counts, printing an underived one about itself.
scripts/check-spec-parsed-alias.mjsconsole.log('check-spec-parsed-alias --self-test: 18 assertions passed');const assertionsRun = [...batterySeen.values()].reduce((total, count) => total + count, 0); console.log(`check-spec-parsed-alias --self-test: ${assertionsRun} assertions passed`);sum(batterySeen.values()), notbatterySeen.size— this file'sroster is a single battery (
'check-spec-parsed-alias self-test': 18), theline calls the number "assertions" rather than "cases", and the printed
literal matches the sum of individual
check(...)calls (measured: size =1, sum = 18 — the printed literal matches the sum). This is the exact shape
PR fix(tooling): derive check-wildcard-fallthrough's self-test case count from its own ledger #16669 landed for
check-wildcard-fallthrough.mjs.All four print byte-identical output to before the change — the counts were
accurate today, they were simply not derived (#15305 precedent: accurate by
coincidence is still the defect).
Verification — both legs, per file
Each leg was run by temporarily mutating the file, observing
--self-testoutput, then reverting the mutation exactly (confirmed via
git diffshowingzero residual change before moving to the next leg).
check-init-service-contract.mjs✓ self-test: 20 casesconst ROOT = …→ stayed✓ self-test: 19 casescheck-kernel-hook-pairs.mjs✓ self-test: 11 casesfunction selfTest()→ stayed✓ self-test: 10 casescheck-quick-reference-counts.mjs✓ check-quick-reference-counts self-test: 23 cases pass.function selfTest()→ stayed✓ check-quick-reference-counts self-test: 22 cases pass.check-spec-parsed-alias.mjscheck(...)call to the existing single battery (no roster change needed — the roster value is a floor, not an equality) →check-spec-parsed-alias --self-test: 19 assertions passedfunction selfTest()→ stayedcheck-spec-parsed-alias --self-test: 18 assertions passedLeg 1 alone would not distinguish a derived number from one that just happens
to track additions by luck; leg 2 is the control that rules that out.
Dropped out
None. All four files named on the card carry a live
SELF_TEST_BATTERIES+batterySeenregistration to derive from.Out of scope, explicitly
verdict counts, not floors, and none of the existing
SELF_TEST_BATTERY_FLOORconstants were touched.
number before this change; the defect was that nothing derived it.
check-wildcard-fallthrough.mjs([finding] check-wildcard-fallthrough self-test prints a transcribed17 caseswhile the body asserts 18 — a stale count nothing derives or compares #15231) and the file(s) under [finding] check-regen-pending self-test: the battery-roster comment transcribes14 callsfor fixtureSelfTest while the body has 27 — and the sibling count in the same sentence is still right #16007 areuntouched — out of this card's scope.
scripts/measure-self-test-floor.mjs:1891is untouched — it is a citationof another gate's historical output, not a live verdict line.
Changeset
skip-changeset— measured, not asserted. These four files live under rootscripts/, which is not inside anypnpm-workspace.yamlpackage glob(
packages/*,packages/apps/*, …,apps/*,examples/*); the onlypackage.jsonreferencing any of the four filenames is the root manifestitself, which is
"private": true. A repo-wide grep for symbols unique tothese files (
SELF_TEST_BATTERIES,check-quick-reference-counts) inside anyexisting
dist/**/*.jsreturned zero hits. Nothing published moves. Applyingthe
skip-changesetlabel on this PR (not just stating it here — #17352 isthe precedent for why the label itself is required).
Local verification
pnpm run check:nul-bytes— pass (exit 0, this diff touches files so the gateapplies unconditionally).
Full command set derived via
node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstackagainst this diff (35 commands: 17pnpm check:*, 18 directnode scripts/**) — all run, all exit 0 (captured beforeany pipe), reconciled with
--ran:✓ dispatch-gates --ran: 35 derived famil(ies) accounted for — 35 run, 0 NOT-MEASURED (a DERIVED zero — all 35 recorded an exit code and none of them is 3).Includes the four directly-matched gates for the touched files themselves:
pnpm check:init-service-contract,pnpm check:kernel-hook-pairs,pnpm check:quick-reference-counts,pnpm check:spec-parsed-alias.Root
scripts/is outside everyturbo ls-visible package dependency graph,so leg ① (
pnpm --filter '<pkg>^...' build) and leg ② (pnpm --filter <pkg> test/typecheck) of the local verification scope are both empty for thisdiff — there is no package these files belong to. The gate commands above are
the entire local verification surface for a root-
scripts/change.Generated by Claude Code