test(scripts): control the self-test probe against the helper handshake spelling - #15491
Conversation
…ke spelling `measure-self-test-floor --probe` had zero coverage of one of the three landed handshake spellings. The helper form (`requireReachedVerdict(name, reached)`) has exactly one carrier under `scripts/` — `check-platform-checklist.mjs` — whose `ENTRY_BY_HAND` row is a deliberate `null`, so every probe run recorded `NOT MEASURED` for it and no sweep in this tree had ever read that shape in either direction: not held, not defeated. A green `--probe` was therefore evidence for the sentinel and flag spellings only. Add a helper-shaped fixture to the inline controls, which run on every invocation and never behind a flag, exactly as the sentinel-shaped `SOUND_GATE` does. The fixture mirrors the real spelling: a module-level `...ReachedVerdict` flag set as the self-test's last act, and a `requireReachedVerdict(name, reached)` helper the dispatch calls afterwards, refusing out loud after a leading blank line — which also exercises `firstNonBlankLine` reading past that blank. Both directions, from ONE pair differing by ONE line — the dispatch asking the helper. With the line, the probe must read HELD (and must have SPOKEN, with the helper's own refusal as the first non-blank line); with it deleted, the same file must read DEFEATED printing zero bytes. A fixture-derivation control refuses if the anchor stops matching, so the two directions can never silently become the same file. No change to the three-valued verdict (`DEFEATED` / `HELD` / `ACCIDENT`, `mutatedSpoke`), to the baseline precondition, to `ENTRY_BY_HAND`, or to any census row: the fixtures are spawned from a temp dir and the verdict is still taught no refusal wording. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012zGPuVVX3deAx9LdjK8jCk
|
ACCEPT — PM seat Reviewed against the three-dot diff Generated by Claude Code |
Fixes #15371
The reading this closes
measure-self-test-floor --probehad zero coverage of one of the three landed handshake spellings. The helper form —requireReachedVerdict(name, reached)— has exactly one carrier underscripts/,check-platform-checklist.mjs, whoseENTRY_BY_HANDrow is a deliberatenull(its dispatch calls several self-test functions and combines their statuses). So every probe run recorded{"verdict":"NOT MEASURED","why":"entry read by hand as not probeable -- see ENTRY_BY_HAND"}and no sweep in this tree had ever read that shape in either direction — not held, not defeated. A green
--probewas evidence for the sentinel and flag spellings only.What this does (option A, as ruled)
A helper-shaped fixture joins the instrument's inline controls — the ones that run on every invocation, never behind a flag, exactly as the sentinel-shaped
SOUND_GATEdoes. It mirrors the real spelling rather than approximating it: a module-level...ReachedVerdictflag set as the self-test's last act, and arequireReachedVerdict(name, reached)helper that the dispatch calls afterwards, refusing out loud and exiting 1. The refusal is printed after a leading blank line, as the real helper prints it, so the control also exercisesfirstNonBlankLinereading past that blank.Both directions come from ONE pair differing by ONE line — the dispatch asking the helper:
HELPER_HANDSHAKE_GATEHELD,mutatedSpoke === true, first non-blank line is the helper's refusalHELPER_HANDSHAKE_GATE_HOLED(same bytes, handshake call deleted)DEFEATED,mutatedBytes === 0A fixture-derivation control refuses if the anchor ever stops matching, so the two directions can never silently become the same file.
⛔ Unchanged, deliberately: the three-valued verdict (
DEFEATED/HELD/ACCIDENT,mutatedSpoke), the baseline precondition from #15455 (baselineExit !== 0⇒ NOT MEASURED), theENTRY_BY_HANDnullrow forcheck-platform-checklist.mjs(that is #14842's question), and every census row. The verdict is still taught no refusal wording — recognising which handshake a file carries remains #14968's column. The fixture's own message is asserted only so theHELDit earns is the helper's refusal and not some other printer's.The control, printed in both directions
The controls are silent when they pass, so each direction is shown by ablating the expectation on the committed implementation and quoting what the instrument then prints. Every ablation was proved on disk before the run (old text x0 / injected text x1) and the file restored to its
HEADblob afterwards (git hash-objectequal toHEADblob34896fd57,git diff HEADempty) — verified after each one.A reads the sound direction (
HELD), B the holed one (DEFEATED), C publishes the refusal the probe actually read past the leading blank line, and D shows the pair is load-bearing: without the deletion the "holed" direction readsHELDand prints bytes. With the expectations as committed, all four are silent and the instrument exits 0.Verification
All runs on commit
8f5df3f96(the tip of this branch, and the tree every number below was read from). Exit codes captured before any pipe (cmd > file 2>&1; EXIT=$?); each line quoted is the one the tool printed. Heavy runs went throughscripts/pm/os-verify-lock.shas other devs do.The instrument itself —
node scripts/measure-self-test-floor.mjs(normal mode, controls run and refuse before any number is printed): exit 0--probe, on this branch AND on the branch point (e8c7956c4, a second worktree, installed) — both exit 0, and the two reports are byte-identical (diffof the full outputs is empty), which is the claim: a new inline control moves no census row.That
n/mrow is the reading this card is about, and it is deliberately still there — the fixture buys the coverage the row cannot.--self-teston the instrument: not applicable, by design. This file ships no--self-testmode; its controls run inline on every invocation so they cannot become unrun (stated in its header, and it is excluded from its own census asCENSUS_SELF).Derived gate family —
node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstackderived 22 commands from the change set (it reads the change set from git itself;--repoasserted and holds). Every one was run: 22 of 22 exit 0. Highlights:pnpm lint(eslint . --no-inline-config, whole repo, not narrowed): exit 0, no findings.NOT MEASURED, recorded as such:
pnpm check:published-readme-exportsexits 1 in this checkout — it is not in the derived family and was run only because its roster lives underscripts/. Every one of its findings iswhose type entry packages/PKG/dist/DIR does not exist. Build first: pnpm build, i.e. an unbuilt tree, not a finding about this diff. It is reported as a prerequisite miss, never as a pass and never as a failure.Scope
One file,
scripts/measure-self-test-floor.mjs, +84 lines. No changeset: nothing is published from a package.🤖 Generated with Claude Code
https://claude.ai/code/session_012zGPuVVX3deAx9LdjK8jCk
Generated by Claude Code