Skip to content

Derive four self-test verdict counts from their battery ledger - #17367

Merged
baozhoutao merged 1 commit into
mainfrom
claude/issue-16664-derive-self-test-verdict-counts
Sep 10, 2026
Merged

Derive four self-test verdict counts from their battery ledger#17367
baozhoutao merged 1 commit into
mainfrom
claude/issue-16664-derive-self-test-verdict-counts

Conversation

@baozhoutao

Copy link
Copy Markdown
Contributor

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 +
batterySeen ledger (the shape PR #16669 read from for check-wildcard-fallthrough.mjs,
Fixes #15231). Each verdict now reads its number off that ledger instead.

scripts/measure-self-test-floor.mjs:1891 is untouched — its number is a
citation 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.mjs

  • before: console.log('✓ self-test: 19 cases');
  • after: console.log(`✓ self-test: ${batterySeen.size} cases`);
  • source: batterySeen.size — the roster here has 19 named batteries and the
    printed number has always meant "batteries that ran", not raw assert(
    call sites (measured: batterySeen.size = 19, sum(batterySeen.values()) = 26 — the
    printed literal matches the former, not the latter).

scripts/check-kernel-hook-pairs.mjs

  • before: console.log('✓ self-test: 10 cases');
  • after: console.log(`✓ self-test: ${batterySeen.size} cases`);
  • source: batterySeen.size (measured: size = 10, sum = 16 — printed literal
    matches size).

scripts/check-quick-reference-counts.mjs

  • before: console.log('✓ check-quick-reference-counts self-test: 22 cases pass.');
  • after: console.log(`✓ check-quick-reference-counts self-test: ${batterySeen.size} cases pass.`);
  • source: batterySeen.size (measured: size = 22, sum = 37 — printed literal
    matches 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.mjs

  • before: console.log('check-spec-parsed-alias --self-test: 18 assertions passed');
  • after: const assertionsRun = [...batterySeen.values()].reduce((total, count) => total + count, 0); console.log(`check-spec-parsed-alias --self-test: ${assertionsRun} assertions passed`);
  • source: sum(batterySeen.values()), not batterySeen.size — this file's
    roster is a single battery ('check-spec-parsed-alias self-test': 18), the
    line 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-test
output, then reverting the mutation exactly (confirmed via git diff showing
zero residual change before moving to the next leg).

file leg 1 — add a case leg 2 — unrelated edit
check-init-service-contract.mjs added a 20th battery + assertion → ✓ self-test: 20 cases added an unrelated comment above const ROOT = … → stayed ✓ self-test: 19 cases
check-kernel-hook-pairs.mjs added an 11th battery + assertion → ✓ self-test: 11 cases added an unrelated comment above function selfTest() → stayed ✓ self-test: 10 cases
check-quick-reference-counts.mjs added a 23rd battery + assertion → ✓ check-quick-reference-counts self-test: 23 cases pass. added an unrelated comment above function selfTest() → stayed ✓ check-quick-reference-counts self-test: 22 cases pass.
check-spec-parsed-alias.mjs added one more check(...) 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 passed added an unrelated comment above function selfTest() → stayed check-spec-parsed-alias --self-test: 18 assertions passed

Leg 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 +
batterySeen registration to derive from.

Out of scope, explicitly

Changeset

skip-changeset — measured, not asserted. These four files live under root
scripts/, which is not inside any pnpm-workspace.yaml package glob
(packages/*, packages/apps/*, …, apps/*, examples/*); the only
package.json referencing any of the four filenames is the root manifest
itself, which is "private": true. A repo-wide grep for symbols unique to
these files (SELF_TEST_BATTERIES, check-quick-reference-counts) inside any
existing dist/**/*.js returned zero hits. Nothing published moves. Applying
the skip-changeset label on this PR (not just stating it here — #17352 is
the precedent for why the label itself is required).

Local verification

pnpm run check:nul-bytes — pass (exit 0, this diff touches files so the gate
applies unconditionally).

Full command set derived via node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack against this diff (35 commands: 17 pnpm check:*, 18 direct node scripts/**) — all run, all exit 0 (captured before
any 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 every turbo 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 this
diff — 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

…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 baozhoutao added the skip-changeset PR has no user-facing published change; bypasses the changeset gate label Sep 10, 2026 — with Claude
@baozhoutao
baozhoutao marked this pull request as ready for review September 10, 2026 09:25
@baozhoutao
baozhoutao added this pull request to the merge queue Sep 10, 2026
Merged via the queue into main with commit 59db8a0 Sep 10, 2026
36 checks passed
@baozhoutao
baozhoutao deleted the claude/issue-16664-derive-self-test-verdict-counts branch September 10, 2026 10:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/s skip-changeset PR has no user-facing published change; bypasses the changeset gate

Projects

None yet

2 participants