Skip to content

[finding] check-wildcard-fallthrough self-test prints a transcribed 17 cases while the body asserts 18 — a stale count nothing derives or compares #15231

Description

@claude

Found while flooring this file's self-test for #13799 batch 5 (PR #15217). ⛔ Not fixed there: correcting the literal would change the file's stdout, and that batch's whole proof is that --self-test output is byte-identical before and after. Filed instead, unassigned.

The reading

scripts/check-wildcard-fallthrough.mjs ends its self-test with a transcribed count:

console.log('✓ self-test: 17 cases');

The body has 18 assert(...) call sites, and the battery ledger added in PR #15217 registers 18. So the printed number has already drifted one low — nothing derives it and nothing compares it.

Measured, not argued, at 50d6c924b:

Why it is worth a card rather than a silent edit

This is the shape #13799's own body names: a verdict line that already prints a case count is evidence, not proof. Here it is worse than un-derived — it is stale, so a reader reconciling "17" against the source finds a discrepancy with no way to tell which side moved. The same class was filed twice before and closed: #13963 (check-governed-merges sized at 77, live 223+) and #13536 (dispatch-gates sized at 334, live 979).

The remedy, and the part already done

PR #15217 pins the battery floor at the measured 18, so the count can no longer shrink in silence — a deleted block now reds by name instead of quietly lowering a number nobody compares. What is left is the printed literal itself. Two options, either acceptable:

  1. Correct it to 18.
  2. Better: derive it, the way sibling gates do — print the registered count rather than a literal, so it cannot drift again.

Option 2 removes the class from this file for good; option 1 fixes today's instance only.

A comment in the file records the measurement in place, so the next reader is not left to rediscover it.


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