Skip to content

fix(scripts): make the last two dispatched self-tests prove they reached their verdict (batch 3) - #15123

Merged
baozhoutao merged 1 commit into
mainfrom
claude/issue-13798-batch3-verdict-handshake
Sep 4, 2026
Merged

fix(scripts): make the last two dispatched self-tests prove they reached their verdict (batch 3)#15123
baozhoutao merged 1 commit into
mainfrom
claude/issue-13798-batch3-verdict-handshake

Conversation

@claude

@claude claude Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Part of #13798 (batch 3)

The last two gates the census reads as DEFEATED on the file surface this batch was dispatched for: an early return anywhere above the verdict line printed nothing and still exited 0, so a self-test that never finished reported as one that passed.

⚠️ This is NOT the closing PR. The batch closes its own two files, but a full re-census on this branch finds two other gates still DEFEATED — see "Why Part of and not Fixes" below. The card stays open for a batch 4.

Spelling chosen per file, not by default

Both dispatches discard the self-test's return value, so the sentinel form (PR #13797 precedent, landed at scale in PRs #14479 / #14853) is the fitting one for each. The module-level-flag form exists for gates whose self-test return value is load-bearing; neither of these is one.

file dispatch on main return value load-bearing? form
scripts/check-type-check-coverage.mjs selfTest(); process.exit(0); no — discarded, then a hard process.exit(0) sentinel
scripts/pm/bare-root-worklist.mjs if (--self-test) selfTest(); else report(); no — discarded sentinel

check-type-check-coverage.mjs was re-read fresh after PR #14805 (ruling A1 of #14569) merged at 00:29:24Z and changed it. That PR raised CI_TSC_HEAP_CEILING_MB and added two self-test rows pinning a NODE_OPTIONS pairing; it did not make the self-test's return value load-bearing, so the sentinel still fits. Neither CI_TSC_HEAP_CEILING_MB, nor those rows, nor the stale arm is touched here — that is another card's ruled work.

bare-root-worklist.mjs carried the unbraced-branch trap batches 1 and 2 both recorded (if (...) selfTest(); else report(...)), so the if body is braced; the else stays unbraced, as in the landed scripts/pm/check-label-desc-cap.mjs precedent.

The third landed spelling, the requireReachedVerdict helper (PR #14960), is for a file needing the check at ten sites. Each file here has exactly one dispatch site, so it would buy nothing. No fourth spelling was invented.

Boundary-only

Nothing inside either self-test body changed beyond the verdict marker. The census's hole-1 floor classification is NONE for both files before and after — hole 1 is #13799's, deliberately untouched here.

Evidence — each handshake shown FAILING, not merely green

A green self-test proves nothing about this defect. Driven by the census's own instrument, probeEarlyReturn from scripts/measure-self-test-floor.mjs, which injects return; as the first statement of the dispatched function. It mutates a copy beside the original, re-reads the marker from disk (marker x1, else the reading is refused as NOT MEASURED), and deletes the copy. A wrapper additionally pinned each tracked original's git hash-object before and after every probe: an empty hash would have been read as failure, never as "nothing to compare".

file before — origin/main 97a22639b after — this branch
check-type-check-coverage.mjs DEFEATED · mutated exit 0 · 0 bytes printed HELD · mutated exit 1 · 211 bytes · ✗ check:type-check-coverage self-test: selfTest() returned without reaching its verdict,
pm/bare-root-worklist.mjs DEFEATED · mutated exit 0 · 0 bytes printed HELD · mutated exit 1 · 204 bytes · ✗ bare-root-worklist self-test: selfTest() returned without reaching its verdict,

Blob hashes across every probe: a3f7431aa…a3f7431aa… and 53e25cb5b…53e25cb5b… before the edit, 46e198d98…46e198d98… and 473f914b6…473f914b6… after. Zero leftover .self-test-floor-probe-* copies. The instrument's own positive/negative controls ran on every invocation and none failed.

Why Part of and not Fixes

A full node scripts/measure-self-test-floor.mjs --probe on this branch's head, 167 files: 159 HELD · 2 DEFEATED · 6 NOT MEASURED. The two files this batch owns are both HELD. The two still DEFEATED are neither of them:

  • scripts/check-adr-symbol-anchors.mjs
  • scripts/symbol-anchors.mjs

Both arrived in commit 09cc6be43 (PR #14277, #13556) after batch 1 measured. Batch 1 listed both on its exclusion list as held by that then-unmerged PR and recorded them as carrying "no --self-test dispatch in code at all" — true of the tree it measured, false of the tree today: both now dispatch through the pre-handshake if (process.argv.includes('--self-test')) selfTest(); shape, both probe DEFEATED with mutated exit 0 and 0 bytes printed. They are outside this batch's declared file surface, so they are not touched here; #13798 needs a batch 4 of exactly those two. Fixes here would have closed the card over a live population — the batch-2 plan that called this "the last batch" was written before #14277 landed.

The 6 NOT MEASURED are the standing set the earlier ACCEPTs put outside this card's batches (they need reshaping, not a transplant): check-platform-checklist.mjs, check-regen-pending.mjs, git-merge-regen.mjs, setup-git-hooks.mjs, pm/dispatch-gates.mjs (#13800) and check-workspace-manifest-cycles.mjs (#14842).

Gates — run at head efe6a7a99, exit codes captured before any pipe

node scripts/pm/dispatch-gates.mjs --repo objectstack-ai/objectstack derived 26 families (19 by path + 2 by change KIND + 6 declared whole-tree, 1 reached both ways), harvested with --commands. 25 RAN-PASS, 1 NOT MEASURED:

  • node scripts/check-test-completeness.mjsexit 3, PREREQUISITE NOT MET, no saved turbo log on this tree. Read as NOT MEASURED, never as a pass and never as a red. Same standing reading batch 2 recorded.

Run explicitly on top of the derivation, because a derived family is not a complete account of what CI runs:

  • node scripts/check-type-check-coverage.mjs --self-test — exit 0, ✓ … 48 semantic case(s) + 68 observation + 45 re-measure + 28 built-closure + 19 auto-lowering + 18 exit-code case(s) hold.
  • node scripts/pm/bare-root-worklist.mjs --self-test — exit 0, OK self-test: 66 live row(s), 58 unreachable as spelled, 58 recorded verdict(s) — none stale, none missing, none contradicted. The "this tool declares no population of its own" assertion still holds with the new module-level constant in the file.
  • pnpm check:pm-dispatch-gates — exit 0, ✓ dispatch-gates self-test: 1322 cases pass.
  • pnpm check:type-check-debt — first run exit 3 (PREREQUISITE NOT MET: 33 workspace dependencies unbuilt). Built the closure exactly as lint.yml does — pnpm exec turbo run build --filter='./packages/*' --filter='./packages/*/*', 71/71 tasks, exit 0 — then re-ran: exit 0, check-type-check-coverage: OK — 72/79 workspace packages type-checked … 7 in the DEBT ledger (117 frozen raw errors). No ledger drift; unlike batch 1's .mts case there is no return-type annotation to correct here.
  • pnpm lint — whole repo, not narrowed: exit 0, 5853 files, 0 errors, 0 warnings (counts read from --format json).
  • pnpm check:nul-bytes exit 0, plus a direct control-byte sweep of both touched files: no match.

Changeset

None — scripts/** publishes nothing from any released package. skip-changeset applied.

🤖 Generated with Claude Code

https://claude.ai/code/session_012zGPuVVX3deAx9LdjK8jCk


Generated by Claude Code

…erdict

`check-type-check-coverage.mjs` and `bare-root-worklist.mjs` were the last two
gates in `scripts/**` that the census reads as DEFEATED: an early `return`
anywhere above the verdict line printed NOTHING and still exited 0, so a
self-test that never finished reported as one that passed.

Both dispatches DISCARD the self-test's return value
(`selfTest(); process.exit(0);` and `if (--self-test) selfTest(); else report()`),
so the sentinel spelling landed in PRs #14479 / #14853 is the fitting form for
each: `SELF_TEST_VERDICT` returned only after the success line, compared at the
dispatch, which refuses anything else with exit 1. Nothing inside either
self-test body changes.

Part of #13798

Co-Authored-By: Claude Opus 5 <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

Development

Successfully merging this pull request may close these issues.

2 participants