Skip to content

fix(scripts): measure-self-test-floor's probe awards HELD only on a printed handshake, never on a bare non-zero exit - #15372

Merged
baozhoutao merged 1 commit into
mainfrom
claude/issue-15324-probe-held-needs-bytes
Sep 4, 2026
Merged

baozhoutao merged 1 commit into
mainfrom
claude/issue-15324-probe-held-needs-bytes

Conversation

@claude

@claude claude Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Fixes #15324

probeEarlyReturn() in scripts/measure-self-test-floor.mjs decided its verdict on the mutated run's exit code and nothing else:

verdict: mut.status === 0 ? 'DEFEATED' : 'HELD',

So a dispatch spelled process.exit(runSelfTest() === 0 ? 0 : 1) scored HELD: the injected early return makes runSelfTest() yield undefined, undefined === 0 is false, and the process exits 1 having printed zero bytes. Nothing noticed anything — the arithmetic of a comparison against a missing return value did it. That is the same accident-versus-handshake mistake this instrument exists to expose, made by the instrument on itself, and it inflates exactly the completion picture a green --probe sweep is quoted for.

The row already carried mutatedBytes and mutatedHead. The verdict now reads them.

What changed

A non-zero exit is a hold only when the mutated run also spoke — printed a non-blank line, the same reading mutatedHead already publishes and the HELD listing already quotes (a run whose whole output is a newline has non-zero bytes and refused nothing). The verdict is three-valued:

verdict condition
DEFEATED exit 0 — the early return went unnoticed
HELD exit != 0 and the mutated run printed a non-blank line
ACCIDENT exit != 0 and it printed nothing — never counted among HELD

ACCIDENT is tallied and listed apart in --probe, with a trailing note so the number cannot be skimmed as a hold.

The verdict deliberately does not match the refusal wording. The repair landed in three spellings and teaching this verdict any of them is the coupling #14968 is filed to remove; reporting which handshake a file carries is that card's column, not this verdict's job. This is the card's own recommendation A, with C left to #14968.

Additive only. mutatedSpoke joins the row; no --json key is renamed and no row keying changes. classifyFloor is untouched.

The instrument's own controls

This file ships no --self-test — its controls run inline on every invocation, so they cannot become unrun. A third fixture joins them, the measured accident shape reduced (process.exit(runSelfTest() === 0 ? 0 : 1) over a self-test with no handshake), asserted to read ACCIDENT with a non-zero exit and zero bytes. Two further assertions pin the discriminator from both sides: the accident fixture must still produce that shape (or the ACCIDENT above would pass for the wrong reason), and the handshake-protected fixture must be one that spoke when defeated.

Ablation, on the committed implementation: reverting only the verdict expression back to the exit-code-only form (mutation confirmed on disk — new expression 0 hits, old expression 1 hit, blob hash differs from the HEAD blob; the instrument is run directly as source, so there is no build step to reach) makes the instrument refuse itself, exit 1:

measure-self-test-floor: ITS OWN CONTROLS FAILED -- no census printed.

  - POSITIVE CONTROL FAILED: the probe read a silent non-zero exit as HELD () -- an exit code is not a handshake

Restore proven by hash: restored blob 00f6d4d6ee85eeb8c00710b2f4fcc66750d2f9af equals the HEAD blob, and git diff HEAD is empty.

Before / after, measured

Whole population, node scripts/measure-self-test-floor.mjs --probe --json, exit 0 both sides. Base c4d1354e3, branch cc3fc2def.

file base branch mutatedExit mutatedBytes
scripts/audits/14744-before-update-per-row-value-census.mjs HELD ACCIDENT 1 0
scripts/check-turbo-task-graph.mjs (sentinel) HELD HELD 1 211
scripts/check-durability-degradation-log-level.mjs (flag) HELD HELD 1 224
scripts/check-parse-guard.mjs (flag) HELD HELD 1 203

The genuine holds still quote their real refusal lines, unchanged:

✗ check-turbo-task-graph self-test: runSelfTest() returned without reaching its verdict,
✗ check-durability-degradation-log-level self-test: selfTest() returned without reaching its verdict,
✗ check-parse-guard self-test: selfTest() returned without reaching its verdict,

The card names check-platform-checklist.mjs as the helper-spelling contrast. It cannot serve as one: its ENTRY_BY_HAND row is null, so it reads NOT MEASURED on both sides and no probe run exercises the helper form at all. check-parse-guard.mjs stands in above, and the coverage gap is filed as #15371 — not addressed here.

Verdict changes across the whole population: exactly one, the file named above. Every other row is byte-identical.

Floor classification is unchanged, asserted explicitly — this card is about the probe verdict, not the floor:

base c4d1354e3 branch cc3fc2def
rows 170 170
ROSTER 162 162
COUNT 1 1
NONE 7 7

Per-file floor classification compared as an ordered file:floor join: identical.

--probe tallies, branch:

Hole 2 -- silently defeated by an early `return` in the self-test (MEASURED):
  0 DEFEATED, 164 HELD, 1 ACCIDENT, 5 NOT MEASURED.
    ACC   scripts/audits/14744-before-update-per-row-value-census.mjs -- exited 1 printing 0 byte(s); no refusal, so NOT a hold

⚠ ACCIDENT is not a hold. Those 1 file(s) exit non-zero because a comparison
   against a missing return value happened to be false, not because anything noticed.

Gates, on cc3fc2def

Exit codes captured by redirect before any pipe.

  • Derived family, node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack (19 commands, derived by the script from the merge base — no hand-built change set): all 19 exit 0.
  • Always-runs tail: check:pm-dispatch-gates (✓ dispatch-gates self-test: 1382 cases pass.), check-self-test-workflow-commands.mjs and its --self-test, check:declared-population-live, check-self-test-wired.mjs and its --self-test, check:ratchet-remedy-authority, check:nul-bytes, check:watch-hint-literal — all exit 0.
  • The six artifact rosters flagged as sitting under scripts/, read rather than assumed clear: check-published-list-mirrors.mjs (+ --self-test), check:console-injection, check:engine-double-contract, check:i18n-stale-fill — exit 0. check:published-readme-exports is NOT MEASURED: it needs a whole-repo pnpm build this fresh worktree has not run, and every one of its findings is packages/**/README.md naming a missing dist/*.d.ts with its own remedy Build first. Zero of its findings touch this diff's one path.
  • Whole-repo pnpm lint (eslint . --no-inline-config) — exit 0, zero findings, run to completion rather than narrowed.
  • Control-byte scan of the edited file beyond the gate (grep -naP over the C0 set plus DEL): no matches.

skip-changeset: this PR publishes nothing from any package — one file under scripts/, an internal measurement instrument with no package entry point.

Same-file family, out of scope here: #14963, #14842 and #15339 remain open. #15339 in particular overlaps the file but not the function — it is about PRODUCES_FAILURE in classifyFloor (the static floor criterion), while this changes only probeEarlyReturn's verdict; the two do not touch the same lines.

🤖 Generated with Claude Code

https://claude.ai/code/session_012zGPuVVX3deAx9LdjK8jCk


Generated by Claude Code

…rinted handshake

`probeEarlyReturn` decided its verdict on the mutated run's exit code alone
(`mut.status === 0 ? 'DEFEATED' : 'HELD'`), so a dispatch spelled
`process.exit(runSelfTest() === 0 ? 0 : 1)` scored HELD: the early return makes
`runSelfTest()` yield `undefined`, `undefined === 0` is false, and the process
exits 1 having printed ZERO BYTES. Nothing noticed anything. The row already
carried `mutatedBytes` and `mutatedHead`; the verdict just did not read them.

A non-zero exit is now a hold only when the mutated run also SPOKE (printed a
non-blank line — the same reading `mutatedHead` publishes and the HELD listing
quotes). The silent case gets its own verdict, ACCIDENT, tallied and listed
apart so the census never counts it among the holds. The verdict deliberately
does not match refusal WORDING: the repair landed in three spellings and
teaching this verdict any of them is the coupling #14968 is filed to remove.

Additive only: `mutatedSpoke` joins the row, no `--json` key is renamed, and
`classifyFloor` is untouched (ROSTER/COUNT/NONE are identical).

The instrument ships no `--self-test`; its controls run inline on every
invocation. A third fixture joins them — the measured accident shape — asserted
to read ACCIDENT with a non-zero exit and zero bytes, plus the other direction:
the handshake-protected fixture must be one that SPOKE when defeated.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012zGPuVVX3deAx9LdjK8jCk
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