Skip to content

fix(cli): os build refuses the engines.protocol range the boot refuses - #39115

Merged
objectstack-fleet[bot] merged 2 commits into
mainfrom
claude/issue-39098-build-protocol-range
Dec 2, 2026
Merged

objectstack-fleet[bot] merged 2 commits into
mainfrom
claude/issue-39098-build-protocol-range

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Fixes #39098
Clause-②: no
Metadata-protocol: none
Ruling-ref: 7337736429 — maintainer 「38928 选 A」, carried to os build by the seat (claim 7340449102)

维护者速读

  • 用户能看到什么变化:在 19 版工具链上,项目清单仍声明只兼容 18 版协议时,构建命令现在直接报错退出,不再生成产物文件,给出与校验和启动时相同的错误码和迁移命令;以前它只提示一行警告并显示构建成功。
  • 为什么做:属于 18 升 19 的升级主线,接着上一单让校验命令拒绝之后,这次让构建与校验、启动三处在同一个问题上给出同一个答案。
  • 出错会怎样:受影响的只有本来就启动不了的项目,它们现在在构建阶段就失败;能启动的项目不受影响。改动只在命令行工具里,可以直接撤回。
  • 要你做什么:无

What changes

  • os build (and os compile, which os dev runs at boot) now makes the call os validate makes 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 declared engines.protocol range, the build exits 1 whatever any flag says.
  • Text face: the boot's code (OS_PROTOCOL_INCOMPATIBLE), the boot's message with its Run: objectstack migrate meta --from 18, and the registered entry that command lists (protocol-18-range-refused). The lines are the ones os validate prints.
  • --json: success: false with the refusal as the one errors[] row, the row os validate --json emits for the same project (path, code, httpStatus, message, details, migrationEntries), plus the build's usual warnings and conversions.
  • Where the write happens, measured: the artifact directory is made at step 4 (makeDirectorySync), the access-matrix snapshot is written in the D6 gate, the runtime bundle after that, and dist/objectstack.json last. The advisory checkProtocolVersionGap ran after that last write. The refusal sits above all of them, so a refused build leaves no artifact, no dist/ directory, no runtime bundle and no snapshot. The advisory is unchanged and still prints for a range the boot admits.
  • One judge: no second range test. findProtocolRangeRefusal is unchanged; only its header prose now names both doors.
  • packages/cli/test/validate-build-gate-parity.test.ts: the findProtocolRangeRefusal row moves from VALIDATE_ONLY_GATES to SHARED_NON_REGISTRY_GATES, as that file's own pruning test (every VALIDATE_ONLY_GATES entry is still validate-only) demands once compile.ts makes the call. The ledger header's count of the rows it holds is replaced by their names.
  • The "REPORTS, NEVER REFUSES" nav-group and permission-set diagnostics, the nav-group headline block and os doctor are untouched.

Read first (by risk)

  1. packages/cli/src/commands/compile.ts, step 1b': its position (after the fold, before step 2 and every write) and both exits.
  2. packages/cli/src/commands/build-protocol-range-refusal.test.ts: the no-artifact assertions and the validate-parity pins.
  3. packages/cli/test/validate-build-gate-parity.test.ts: the moved row.

Two-minute check: in any defineStack project on this branch, set engines: { protocol: '^18' } and run node packages/cli/bin/run-dev.js build --json from it. Expected: exit 1, success: false, errors[0].code is OS_PROTOCOL_INCOMPATIBLE, errors[0].migrationEntries is ["protocol-18-range-refused"], and no dist/ 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:

  • THE PIN: '^18' with --json exits 1, success: false, and the row's code, httpStatus, message and details equal what assertProtocolCompat + protocolIncompatibleAnswer return for the same manifest, with protocol-18-range-refused in migrationEntries. Neither dist/objectstack.json nor dist/ exists afterwards.
  • Text face: '^18' exits 1, prints the code, the boot's message and the entry id, no Build complete, no artifact.
  • Control: '^19' with --json exits 0, success: true, artifact written.
  • Parity: for '^18' and '^19', os build --json and os validate --json on identical projects give the same exit, success equals valid, and on the refusal the two errors arrays are equal. A vacuity pin asserts the parity ranges hold both verdicts. The range-by-range battery against the boot stays at the judge, in validate-protocol-range-refusal.test.ts.
Test runs (HEAD 3495f7f unless noted)
  • Before the fix (origin/main 9da8804, which carries the validate half), in a defineStack project with '^18': os build --json exited 0 with success: true, the range only under protocolVersionGap, and dist/objectstack.json written; the text face exited 0 with ✓ Build complete and the ⚠ Installed @objectstack/spec is v19.0.0-next.3 but this app declares engines.protocol '^18' advisory. os validate --json on the same project exited 1 with OS_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.ts at 1a2e009: 4 files, 81 tests passed.
  • The new file alone at 3495f7f: 7/7 passed, tests 6.23 s.
  • 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.
  • Nightly-tier build e2e files (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 --noEmit and check:test-typecheck): exit 0. pnpm --filter @objectstack/cli build: exit 0.
  • Ablation (scripts/ablation-replace.mjs, anchor if (protocolRefusal) { in compile.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 HEAD empty.

Acceptance notes

  • os dev compiles at boot through os compile, which shares this class, so a '^18' project under os dev now 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-compile over an existing artifact still reaches the boot's own refusal.
  • Only the root manifest's range is judged, the slice AppPlugin judges, as in os validate. A packages[] body's own manifest range is judged by the package doors at install. Not measured here.
  • The dispatch named a new per-card test file; the parity pins live there rather than as a describe in validate-protocol-range-refusal.test.ts, which is outside the claimed surface.

Verification

Gates

The local gate list is dispatch-gates --commands at 3495f7f: 71 commands. --ran reconciliation: 71 derived, 65 run, 6 NOT-MEASURED, 0 UNRUN. All 65 run exited 0. NOT MEASURED locally, left to CI's Lint & Repo Gates: check:query-options-erasure and check:slot-lookup (repo-wide ESLint ratchet scans; each passed its self-test and was killed by the foreground timeout during the scan), and check: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.mjs before each push: clean against origin/main and the one open PR sharing compile.ts. Repo-wide scans, the type-check lanes and Test Core are CI's.


Generated by Claude Code

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>
@github-actions

github-actions Bot commented Dec 2, 2026

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 1 package(s): @objectstack/cli, touching 1 documentable anchor(s). ⚠️ 1 changed file(s) yielded no anchor (packages/cli/src/utils/protocol-version-gap.ts), so the pages documenting them are NOT COVERED by this run — this is not a clean bill of health for those files.

19 hand-written doc(s) name something this change touched — list omitted above 15 rows. Re-derive on the tree named below: node scripts/docs-audit/affected-docs.mjs --json 634c59826e597f008f81b0740bcd853f4b642c30.

⛔ 5 release-owned page(s) also affected — read-only, see AGENTS.md Documentation Guardrails.

What this run could not see
  • 1 changed file(s) yielded no anchor (packages/cli/src/utils/protocol-version-gap.ts) — pages documenting those are invisible to this run
  • 1 name(s) were too generic to anchor anything (single lowercase words)
  • a page that states a rule by its inputs shares no identifier with the emitter that implements the rule, so an emitter-only diff cannot list it — not on this run and not on any run. Measured on fix(driver-sql): emit varchar(maxLength) for a text field a declared index keys on #11430: content/docs/protocol/objectql/types.mdx documents the text-family column mapping by the ObjectQL type names it maps FROM (text / textarea / html) while the diff changed createColumn; it went unlisted, and it was the page that diff falsified, in four places. No shared token exists to detect this on, so a rule your change carries has to be re-read by hand in the pages that restate it.
  • a key NAME is not a key, so the hand re-read the line above prescribes can land on the wrong schema. The same spelling is authorable on one governed type and a [REMOVED] tombstone on another for each of active, aria, joins, objects, template, tools and version (censused on [finding] tools is a key on BOTH AgentSchema (tombstoned, dead) and SkillSchema (live, cloud-attested), so a name-based search attributes skill examples to the agent key — it produced a false stop-the-line alarm on PR #19059 #19093 over the liveness ledger's governed types, top-level keys); nothing in a search result distinguishes the two, so a grep hit on a LIVE example reads as evidence about the DEAD key. Measured on fix(spec): the agent.tools liveness row says dead — it claimed live on a key the schema tombstoned #19059: content/docs/ai/agents.mdx was reported as contradicting the agent.tools tombstone over its tools: example at :161, which is inside the defineSkill({ block opened at :155 — the page was already correct. Settle ownership by PARSING the value against both schemas, never by the name: that literal PASSES SkillSchema, and as an AgentSchema it FAILS at tools with the tombstone prescription. ⛔ These names are not the whole class — a key retired through a .strict() guidance map leaves no tombstone in the walked shape and none of them here (tool.category, live as AIToolDefinition.category).

Coarse fallback — 41 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): node scripts/docs-audit/affected-docs.mjs --json 634c59826e597f008f81b0740bcd853f4b642c30 → packageMentionDocs.

Which tree this was computed on

This run read content/docs from 72508bf938a8f7045d4ca94825870287fc5ca11c — the merge of head 3495f7fdc95569fbb4ca4d7be19f0bdccb5b4d81 into base 634c59826e597f008f81b0740bcd853f4b642c30, which is what actions/checkout gives a pull_request run. Not the PR head.

A worktree cut from an older main holds a different content/docs, so re-deriving there can legitimately return a different list — that is a different tree, not a wrong row. To answer on the same tree:

# 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

⚠️ That checkout carried uncommitted changes, so the commit above does not fully identify what was read.

Advisory only, and a precision-first one (#9192): a page is listed because it names a
symbol, wire route or SDK method this diff touched — not because it mentions a changed
package. Each row says which anchor put it there, so a wrong row is reportable rather than
merely annoying. To re-verify, run the docs-accuracy-audit workflow scoped to these files:
node scripts/docs-audit/affected-docs.mjs 634c59826e597f008f81b0740bcd853f4b642c30 → pass the list as
args.docs, on the commit named under Which tree this was computed on.

@github-actions github-actions Bot added documentation Improvements or additions to documentation tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Dec 2, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack@os-justin · os-justin · session_01QSeKYoSKoNUygbCoMBTbGc

Final green head for review · 2026-12-02T10:38Z
Head-sha: 3495f7fdc9
Check-runs at this head: 39 success · 18 skipped · 0 failure · 0 pending.
Files: 5, all inside claim 7340449102's surface.
Owed: L1 (seat session). Landing: zone build, after ACCEPT (not governed).
Card #39098 · claim 7340449102 · dev report 7342023538.
Note for the reader: os dev compiles before it boots, so it now stops at the compile step on a refused range, one step earlier than the boot, with the same code. The PR's acceptance notes record this.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack@os-justin · os-justin · session_01QSeKYnrQ7UMtHofKQVjcH2

L1 ACCEPT · PR #39115 (#39098) · head 3495f7fdc95569fbb4ca4d7be19f0bdccb5b4d81 · read 2026-12-02T10:40Z

席位核对 · ACCEPT

ACCEPT · repo:objectstack@os-justin · head 3495f7fdc95569fbb4ca4d7be19f0bdccb5b4d81

  1. Shape. Draft, base main, Fixes #39098 (the whole card). 5 files, +346 / −24. The zone's L1 request names this head as the final green.

  2. Ruling delivered. Ruling 7337736429 (「38928 选 A」) is carried to os build / os compile as the seat filed cli: on 19, os build exits 0 on a manifest whose engines.protocol admits 18 and not 19, while the boot refuses it #39098.

    • Step 1b' makes the same findProtocolRangeRefusal(config) call os validate makes. It sits after the fold, ahead of step 2 and every write.
    • Both faces exit 1. There is no second range test, and the judge's code is unchanged; only its header prose moved.
  3. No contract face. No non-test packages/spec/src/**, no governed path. Clause-②: no / Metadata-protocol: none hold: only a stack the boot already refuses is refused, and no metadata shape moves. No L2 owed.

  4. Changeset, read sentence by sentence. @objectstack/cli patch. It states the old exit 0 with an artifact, the new refusal in the boot's words, the --json row equal to validate's, that no booting project changes, the two fixes, and that os doctor is unchanged. Each matches the diff.

  5. Tests assert the substance. The new per-card file pins:

    • --json row equality with assertProtocolCompat + protocolIncompatibleAnswer;
    • no dist/ after a refusal;
    • the text face;
    • the '^19' control;
    • build/validate parity, with a vacuity pin.

    The ablation reds 3 of 7, the expected three. The gate-parity ledger row moves to shared, as its pruning test demands.

  6. Gates. Check-runs at this head: 57, 39 success / 18 skipped / 0 failed / 0 pending.

    • git merge-tree against current origin/main: clean.
    • check-governed-merges --pr 39115: NOT governed, 0 of 5 paths, 370 lines.
  7. Accepted deviations and notes.

    • os dev now stops at its compile step, one step before the boot, with the same code and words.
    • Only the root manifest's range is judged, as in validate.
    • The this.exit(1) inside the command's try follows every other exit in compile.ts.
  8. Landing. Not governed and Clause-②: no: the zone lands it per landing-operations.md.

Clause-②: no · Metadata-protocol: none

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack@os-justin · os-justin · session_01QSeKYoSKoNUygbCoMBTbGc

Landing · 2026-12-02T10:41Z · head 3495f7fdc9

  • L1 ACCEPT 7342836842 at this head (seat session); no L2 owed.
  • check-governed-merges.mjs --pr 39115: NOT governed; +346/−24 ≤ 3000.
  • Check-runs at this head: 39 success · 18 skipped · 0 failure (comment 7342788169).
  • landing-k.mjs --pr 39115: K = 3 < 15, OK.
  • Action: pr_ready + automerge_enable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/m tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

cli: on 19, os build exits 0 on a manifest whose engines.protocol admits 18 and not 19, while the boot refuses it

2 participants