fix(scripts): make the last two dispatched self-tests prove they reached their verdict (batch 3) - #15123
Merged
Conversation
…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
baozhoutao
marked this pull request as ready for review
September 4, 2026 01:40
baozhoutao
enabled auto-merge
September 4, 2026 01:40
This was referenced Sep 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #13798 (batch 3)
The last two gates the census reads as
DEFEATEDon the file surface this batch was dispatched for: an earlyreturnanywhere above the verdict line printed nothing and still exited 0, so a self-test that never finished reported as one that passed.DEFEATED— see "WhyPart ofand notFixes" 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.
mainscripts/check-type-check-coverage.mjsselfTest(); process.exit(0);process.exit(0)scripts/pm/bare-root-worklist.mjsif (--self-test) selfTest(); else report();⭐
check-type-check-coverage.mjswas re-read fresh after PR #14805 (ruling A1 of #14569) merged at 00:29:24Z and changed it. That PR raisedCI_TSC_HEAP_CEILING_MBand added two self-test rows pinning aNODE_OPTIONSpairing; it did not make the self-test's return value load-bearing, so the sentinel still fits. NeitherCI_TSC_HEAP_CEILING_MB, nor those rows, nor thestalearm is touched here — that is another card's ruled work.bare-root-worklist.mjscarried the unbraced-branch trap batches 1 and 2 both recorded (if (...) selfTest(); else report(...)), so theifbody is braced; theelsestays unbraced, as in the landedscripts/pm/check-label-desc-cap.mjsprecedent.The third landed spelling, the
requireReachedVerdicthelper (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
NONEfor 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,
probeEarlyReturnfromscripts/measure-self-test-floor.mjs, which injectsreturn;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'sgit hash-objectbefore and after every probe: an empty hash would have been read as failure, never as "nothing to compare".origin/main97a22639bcheck-type-check-coverage.mjsDEFEATED· mutated exit 0 · 0 bytes printedHELD· mutated exit 1 · 211 bytes ·✗ check:type-check-coverage self-test: selfTest() returned without reaching its verdict,pm/bare-root-worklist.mjsDEFEATED· mutated exit 0 · 0 bytes printedHELD· mutated exit 1 · 204 bytes ·✗ bare-root-worklist self-test: selfTest() returned without reaching its verdict,Blob hashes across every probe:
a3f7431aa…→a3f7431aa…and53e25cb5b…→53e25cb5b…before the edit,46e198d98…→46e198d98…and473f914b6…→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 ofand notFixesA full
node scripts/measure-self-test-floor.mjs --probeon this branch's head, 167 files: 159 HELD · 2 DEFEATED · 6 NOT MEASURED. The two files this batch owns are bothHELD. The two stillDEFEATEDare neither of them:scripts/check-adr-symbol-anchors.mjsscripts/symbol-anchors.mjsBoth 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-testdispatch in code at all" — true of the tree it measured, false of the tree today: both now dispatch through the pre-handshakeif (process.argv.includes('--self-test')) selfTest();shape, both probeDEFEATEDwith 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.Fixeshere 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 MEASUREDare 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) andcheck-workspace-manifest-cycles.mjs(#14842).Gates — run at head
efe6a7a99, exit codes captured before any pipenode scripts/pm/dispatch-gates.mjs --repo objectstack-ai/objectstackderived 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.mjs— exit 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 aslint.ymldoes —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.mtscase 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-bytesexit 0, plus a direct control-byte sweep of both touched files: no match.Changeset
None —
scripts/**publishes nothing from any released package.skip-changesetapplied.🤖 Generated with Claude Code
https://claude.ai/code/session_012zGPuVVX3deAx9LdjK8jCk
Generated by Claude Code