Repository navigation
fix(cli): os build refuses the engines.protocol range the boot refuses - #39115
Conversation
os build (and os compile) now runs the boot's protocol handshake through the same judge os validate calls, findProtocolRangeRefusal, right after the config loads and ahead of every write. A refused range exits 1 with OS_PROTOCOL_INCOMPATIBLE, the boot's message and its migrate step, and leaves no artifact behind. Claude-Session: https://claude.ai/code/session_01QSeKYoSKoNUygbCoMBTbGc Co-authored-by: Claude <noreply@anthropic.com>
…ngeset Claude-Session: https://claude.ai/code/session_01QSeKYoSKoNUygbCoMBTbGc Co-authored-by: Claude <noreply@anthropic.com>
📓 Docs Drift CheckThis PR changes 1 package(s): 19 hand-written doc(s) name something this change touched — list omitted above 15 rows. Re-derive on the tree named below: ⛔ 5 release-owned page(s) also affected — read-only, see AGENTS.md Documentation Guardrails. What this run could not see
Coarse fallback — 41 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): Which tree this was computed onThis run read A worktree cut from an older # while this PR is open — GitHub drops the merge commit once it closes
git fetch origin 72508bf938a8f7045d4ca94825870287fc5ca11c && git checkout 72508bf938a8f7045d4ca94825870287fc5ca11c
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 634c59826e597f008f81b0740bcd853f4b642c30 3495f7fdc95569fbb4ca4d7be19f0bdccb5b4d81 && git checkout -B drift-repro 634c59826e597f008f81b0740bcd853f4b642c30 && git merge --no-ff 3495f7fdc95569fbb4ca4d7be19f0bdccb5b4d81
node scripts/docs-audit/affected-docs.mjs --json 634c59826e597f008f81b0740bcd853f4b642c30
|
|
repo:objectstack@os-justin · os-justin · session_01QSeKYoSKoNUygbCoMBTbGc Final green head for review · 2026-12-02T10:38Z |
|
repo:objectstack@os-justin · os-justin · session_01QSeKYnrQ7UMtHofKQVjcH2 L1 ACCEPT · PR #39115 (#39098) · head 席位核对 · ACCEPTACCEPT · repo:objectstack@os-justin · head
|
|
repo:objectstack@os-justin · os-justin · session_01QSeKYoSKoNUygbCoMBTbGc Landing · 2026-12-02T10:41Z · head
|
Fixes #39098
Clause-②: no
Metadata-protocol: none
Ruling-ref: 7337736429 — maintainer 「38928 选 A」, carried to
os buildby the seat (claim 7340449102)维护者速读
What changes
os build(andos compile, whichos devruns at boot) now makes the callos validatemakes at its step 1b',findProtocolRangeRefusal, as its own step 1b': right after the config loads and the producer's conversions are folded, ahead of every other check of the stack and before anything is written. Where the boot refuses the declaredengines.protocolrange, the build exits 1 whatever any flag says.OS_PROTOCOL_INCOMPATIBLE), the boot's message with itsRun: objectstack migrate meta --from 18, and the registered entry that command lists (protocol-18-range-refused). The lines are the onesos validateprints.--json:success: falsewith the refusal as the oneerrors[]row, the rowos validate --jsonemits for the same project (path,code,httpStatus,message,details,migrationEntries), plus the build's usualwarningsandconversions.makeDirectorySync), the access-matrix snapshot is written in the D6 gate, the runtime bundle after that, anddist/objectstack.jsonlast. The advisorycheckProtocolVersionGapran after that last write. The refusal sits above all of them, so a refused build leaves no artifact, nodist/directory, no runtime bundle and no snapshot. The advisory is unchanged and still prints for a range the boot admits.findProtocolRangeRefusalis unchanged; only its header prose now names both doors.packages/cli/test/validate-build-gate-parity.test.ts: thefindProtocolRangeRefusalrow moves fromVALIDATE_ONLY_GATEStoSHARED_NON_REGISTRY_GATES, as that file's own pruning test (every VALIDATE_ONLY_GATES entry is still validate-only) demands oncecompile.tsmakes the call. The ledger header's count of the rows it holds is replaced by their names.os doctorare untouched.Read first (by risk)
packages/cli/src/commands/compile.ts, step 1b': its position (after the fold, before step 2 and every write) and both exits.packages/cli/src/commands/build-protocol-range-refusal.test.ts: the no-artifact assertions and the validate-parity pins.packages/cli/test/validate-build-gate-parity.test.ts: the moved row.Two-minute check: in any
defineStackproject on this branch, setengines: { protocol: '^18' }and runnode packages/cli/bin/run-dev.js build --jsonfrom it. Expected: exit 1,success: false,errors[0].codeisOS_PROTOCOL_INCOMPATIBLE,errors[0].migrationEntriesis["protocol-18-range-refused"], and nodist/directory appears.Tests
New
packages/cli/src/commands/build-protocol-range-refusal.test.ts(integration tier: it spawns the CLI; 7 tests; file wall 6.2 s locally on a shared box). Five spawns, started together:'^18'with--jsonexits 1,success: false, and the row'scode,httpStatus,messageanddetailsequal whatassertProtocolCompat+protocolIncompatibleAnswerreturn for the same manifest, withprotocol-18-range-refusedinmigrationEntries. Neitherdist/objectstack.jsonnordist/exists afterwards.'^18'exits 1, prints the code, the boot's message and the entry id, noBuild complete, no artifact.'^19'with--jsonexits 0,success: true, artifact written.'^18'and'^19',os build --jsonandos validate --jsonon identical projects give the same exit,successequalsvalid, and on the refusal the twoerrorsarrays are equal. A vacuity pin asserts the parity ranges hold both verdicts. The range-by-range battery against the boot stays at the judge, invalidate-protocol-range-refusal.test.ts.Test runs (HEAD 3495f7f unless noted)
origin/main9da8804, which carries the validate half), in adefineStackproject with'^18':os build --jsonexited 0 withsuccess: true, the range only underprotocolVersionGap, anddist/objectstack.jsonwritten; the text face exited 0 with✓ Build completeand the⚠ Installed @objectstack/spec is v19.0.0-next.3 but this app declares engines.protocol '^18'advisory.os validate --jsonon the same project exited 1 withOS_PROTOCOL_INCOMPATIBLE.pnpm --filter @objectstack/cli exec vitest run --maxWorkers=2 src/commands/build-protocol-range-refusal.test.ts src/commands/validate-protocol-range-refusal.test.ts src/utils/protocol-version-gap.test.ts test/validate-build-gate-parity.test.tsat 1a2e009: 4 files, 81 tests passed.src/commands/compile-child-failure-line.pin.test.ts+ the new file +test/validate-build-gate-parity.test.ts+test/build-text-face-advisory-count.test.ts: 4 files, 60 tests passed.OS_TEST_TIERS=nightly):test/compile-artifact-packages.e2e.test.ts,test/build-json-failure-conversions.e2e.test.ts,test/build-json-failure-warnings.e2e.test.ts,test/build-json-advisory-parity.e2e.test.ts: 4 files, 39 tests passed.pnpm --filter @objectstack/cli typecheck(tsc --noEmitandcheck:test-typecheck): exit 0.pnpm --filter @objectstack/cli build: exit 0.scripts/ablation-replace.mjs, anchorif (protocolRefusal) {incompile.ts→if (protocolRefusal && process.env.OS_TEST_NEVER === "x") {, landed 1→0, blob 8ee4e413→68da5519): THE PIN, the text-face pin and the'^18'parity pin failed, 3 of 7. The premise, the control, the'^19'parity pin and the vacuity pin stayed green, as expected. Restored: blob == HEAD,git diff HEADempty.Acceptance notes
os devcompiles at boot throughos compile, which shares this class, so a'^18'project underos devnow stops at the compile step with the same code and words (the dev parent prints its existing "did not load or compile" line under the child's output) instead of at the boot. Same refusal, one step earlier;os dev --no-compileover an existing artifact still reaches the boot's own refusal.AppPluginjudges, as inos validate. Apackages[]body's own manifest range is judged by the package doors at install. Not measured here.describeinvalidate-protocol-range-refusal.test.ts, which is outside the claimed surface.Verification
Gates
The local gate list is
dispatch-gates --commandsat 3495f7f: 71 commands.--ranreconciliation: 71 derived, 65 run, 6 NOT-MEASURED, 0 UNRUN. All 65 run exited 0. NOT MEASURED locally, left to CI'sLint & Repo Gates:check:query-options-erasureandcheck:slot-lookup(repo-wide ESLint ratchet scans; each passed its self-test and was killed by the foreground timeout during the scan), andcheck:dual-build-cjs-loads,check:i18n,check:i18n-coverage,check:i18n-walk-parity(exit 3, PREREQUISITE NOT MET: built dist / example closures this worktree did not build).overlap-check.mjsbefore each push: clean againstorigin/mainand the one open PR sharingcompile.ts. Repo-wide scans, the type-check lanes and Test Core are CI's.Generated by Claude Code