Repository navigation
fix(scripts): teardown-shape self-test refuses an unreachable pinned control as PREREQUISITE NOT MET (exit 3) - #18644
Merged
Conversation
… with the prerequisite code `node scripts/check-plugin-teardown-shape.mjs --self-test` exited 1 — the code reserved for a tree that is genuinely wrong — when a shallow clone could not reach the commit its positive control is pinned to. The true condition is PREREQUISITE NOT MET, which every sibling gate in this tree already answers with exit 3 (`EXIT_PREREQUISITE_NOT_MET`, `scripts/import-prerequisite.mjs` — imported here rather than respelled, a module this gate already imports). The refusal itself is unchanged: it fires where it fired, and its text — which already names `git fetch --unshallow origin main` — is byte-identical. Only the code moves. A self-test that RAN and failed still exits 1. The entry point flattened every early return to 1, so the code had to survive the verdict handshake: it now keeps the prerequisite code alone, and still answers 1 for an early return that names no reason (including a bare `return`, which arrives as `undefined`). Pinned by a new case in the positive-control battery: a `git` that resolves nothing is what a shallow clone looks like from here, and the self-test spawns itself under one to assert the code and the remedy text. Claude-Session: https://claude.ai/code/session_017ef78bLdybu3AffehKkhfk Co-authored-by: Claude <noreply@anthropic.com>
Collaborator
Author
席内复核(派发席
|
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.
Fixes #18217
Clause-②: no — a gate's exit register is not a published contract face, and nothing under any package's
files[]moves. Re-judged from the actual diff, measured below.What moved, and what deliberately did not
node scripts/check-plugin-teardown-shape.mjs --self-testexited 1 — the code reserved for a tree that is genuinely wrong — when a shallow clone could not reach the commit its positive control is pinned to. The true condition is PREREQUISITE NOT MET, which this tree already answers with exit 3.One file, three lines of behaviour:
EXIT_PREREQUISITE_NOT_METinstead of1.return, which arrives asundefinedand whoseprocess.exit(undefined)is the exit-0 hole that handshake exists to close — is still 1.⛔ The refusal itself is unchanged: it fires where it fired, and its text — which already names
git fetch --unshallow origin main— is byte-identical. Only the code moved. A self-test that RAN and genuinely failed still exits 1.Import or respell: measured on this tree, then followed
Both spellings of the constant exist under
scripts/. Imported by check-dts-closure, check-i18n-bundles, check-i18n-coverage, check-i18n-walk-parity, check-sourcemap-no-sources-content, check-vendor-export-contract, ci/select-shard-timings-run, pm/check-dispatch-gates, pm/check-governed-merges and pm/dispatch-gates — the gate the card names as owning this code. Re-declared locally by check-test-completeness, check-release-section-coverage, pm/changeset-deadline-census, pm/check-half-states, pm/check-prior-rulings and pm/check-settings-deny-roster — each one a script that does not otherwise depend on that frame.This gate already imports
scripts/import-prerequisite.mjs(requireDefaultExport), so importing the constant from it adds no dependency edge and leaves the number declared once, in the module that argues it. Taken: import.Acceptance, both directions, on a REAL shallow clone
Not faked by editing the pin to a nonexistent sha. A throwaway
git clone --depth 1 file://…of this branch's base:git rev-parse --is-shallow-repositoryreadstrue,git cat-file -e 621a487607881c66b2899b7e3477115229a156b4exits 1 (the object is genuinely absent), andnode_modulesis symlinked in so the import-prerequisite guard is not the thing being measured.origin/main@ 25c9a83diffover both runs' stdout and stderr is empty: the refusal text, remedy line included, is byte-identical.origin/main@ 25c9a83preFixResult.findings.length === 1flipped to=== 2)1 of 48 case(s) failed— not 3--self-test), both treesThe pass line is byte-identical except its case COUNT, which went up, 47 to 48: the added case is this behaviour's pin. That battery's floor moves 1 to 2 with it, so deleting the case reds instead of silently shrinking the battery. Nothing goes down.
The added case
The self-test spawns itself under a
gitthat resolves nothing (a stub first onPATH, exiting 128). The branch taken is the sameshow.status !== 0the real shallow clone takes; what is pinned is the exit code together with the remedy text. Out of process deliberately — the code is only observable at the dispatch, and an in-process call would read a number the entry point could still flatten.Ablation ledger
Every leg through
scripts/ablation-replace.mjs(anchor must hit, before/after counts, blob hashes, proven restore, EXIT/INT/TERM trap). Each restore printedblob == HEAD (e4d9e35d06b1)and an emptygit diff HEAD.return EXIT_PREREQUISITE_NOT_MET;toreturn 1;1 of 48 case(s) failed, exit 1 — the case reports the child status as 1selfTestCode === EXIT_PREREQUISITE_NOT_MET ? … : 1toprocess.exit(1);1 of 48 case(s) failed, exit 1preFixResult.findings.length === 1to=== 2(a self-test that RAN and failed)1 of 48 case(s) failedconst SELF = fileURLToPath(import.meta.url);toreturn;(the hole-2 handshake probe)Gates
Derived at 19cae6e with
node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack: 30 commands, every one run, each exit code recorded, then reconciled:All 30 recorded
exit 0.check:pm-dispatch-gateswas detached and waited on by recorded PID withtail --pid, 818.5s on this box; itsexit 0is read from two facts rather than claimed — the&&chain advanced past the first leg (so that leg exited 0), and the second leg was then re-run standalone with its status captured before any pipe (exit=0, 812.2s, 1746 cases pass).Changeset
skip-changeset, measured rather than assumed: the diff's only path is judged against every non-private manifest'sfiles[](70 manifests; the repo root isprivate).scripts/check-plugin-teardown-shape.mjslies under no package directory, so nothing published moves. Firing control on the same probe:packages/lint/CHANGELOG.mdreads PUBLISHED via@objectstack/lintfiles[] "CHANGELOG.md".Acceptance notes
node scripts/measure-self-test-floor.mjs --probe --only scripts/check-plugin-teardown-shape.mjsrefuses on this tree (its handshake recogniser and the landed spellings disagree about three unrelated files) — so the handshake column is NOT MEASURED by that instrument here. Control: the refusal is byte-identical onorigin/main@ 25c9a83, so it pre-exists this change. The handshake is instead proven directly by the fourth ablation leg above. Reported to the dispatching seat as a candidate card; not filed from here.lint.yml's step comment for this gate says "onegit showand two spawns"; the added case makes it three. Not edited: this card's declared file surface isscripts/. Noted, not filed.Generated by Claude Code