Skip to content

[finding] check-regen-pending self-test: the battery-roster comment transcribes 14 calls for fixtureSelfTest while the body has 27 — and the sibling count in the same sentence is still right #16007

Description

@claude

Filed unassigned by the dev seat working the p0 main-red card, while editing this file. ⛔ Not fixed there: that PR is a one-key Corepack pin, and a stale comment count is a different defect class, so it is filed rather than ridden along. Same class as the two [finding] cards already on record for transcribed self-test counts (see #15231 and #15291) — a third instance, in a different file, and this one is in a comment rather than in printed output.

The drift, measured

scripts/check-regen-pending.mjs:720, inside the governance block that declares SELF_TEST_BATTERIES, explains why the three callees' inner sinks are deliberately NOT batteries:

// STOP -- the three callees' own inner sinks are NOT batteries here, and they
// are worth naming because all three are different shapes: `fixtureSelfTest`'s
// `check()` helper (14 calls), `decisionTableSelfTest`'s literal 8-row table
// with its driving loop, and `prePushIsArmedSelfTest`'s bare boolean.

Counted off the source:

revision check( call sites in fixtureSelfTest comment says
f7db8f4fd (main) 27 14
b101c2e05 (the p0 branch) 28 14
git show origin/main:scripts/check-regen-pending.mjs \
  | awk '/^function fixtureSelfTest\(\)/,/^function prePushIsArmedSelfTest\(\)/' \
  | grep -c "^\s*check("
# 27

Why it is worth a card rather than a shrug

The number is nearly double what the comment claims, so it is not a rounding drift — roughly half of that callee's assertions arrived after the sentence was written and none of them moved it.

What makes it more than cosmetic is the sibling number in the same sentence: decisionTableSelfTest's "literal 8-row table" is still exactly 8 rows today. One transcribed count in one sentence has drifted and the other has not, and nothing derives or compares either — so a reader has no way to tell which of the two to trust, in the one block whose entire subject is which numbers in this file are load-bearing and which are not. That block is what a future author consults before changing the roster.

Note the floor itself is sound and is not what drifted: SELF_TEST_BATTERIES floors each callee at 1 registration, deliberately not at an assertion count, and SELF_TEST_BATTERY_FLOOR is 3. Adding or removing a check() cannot move either. That is exactly why nothing red when the count doubled, and why nothing will red the next time.

Shape of a repair (triage's call, not a decision here)

Options, cheapest first:

  1. Delete the parenthetical. The argument does not need the number — "a check() helper", "a literal table with its driving loop", "a bare boolean" already contrasts the three shapes, which is the sentence's whole job. Nothing can then drift.
  2. Derive it. Have the self-test print the per-callee assertion count it actually accumulated, so the number is read off the run rather than transcribed. Heavier, and it invites the "pinned total" mistake the same block already argues against.
  3. Correct it and leave it transcribed. Cheapest today, reproduces the defect tomorrow — and is what the two prior findings on this class describe happening.

Option 1 looks right and it is what the block's own reasoning argues for, but the disposition belongs to triage.

🤖 Generated with Claude Code

https://claude.ai/code/session_01M59rPZZFzqhfMUPFqqZTkf


Generated by Claude Code

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions