Repository navigation
fix(metadata-core): the protocol refusal prescribes no migrate meta --from below the migration floor - #33466
Conversation
…in the protocol refusal OS_PROTOCOL_INCOMPATIBLE prescribed `objectstack migrate meta --from N` for every declared major behind the runtime, a command the chain refuses for every N under MIGRATION_SUPPORT_FLOOR (ADR-0087 D3). Below the floor the refusal now carries no migrateCommand and names the remedies that apply, as the AHEAD arm does. Fixtures that pinned a --from under the floor are re-spelled onto an above-floor runtime; new pins cover 15, 0, the floor (16), an in-range major and the HTTP answer. Claude-Session: https://claude.ai/code/session_016WV4cxHwXNcGcAHNerZsom Co-authored-by: Claude <noreply@anthropic.com>
📓 Docs Drift CheckThis PR changes 1 package(s): ⛔ 1 release-owned page(s) name something this change touched. These are read-only:
What this run could not see
Coarse fallback — 5 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 040158c750c448a14fd82b39724661641d9a6837 && git checkout 040158c750c448a14fd82b39724661641d9a6837
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin f068cde84d272d25c451003996f3752bd016001b 1faa38a990d9f2538af62cecd3b7f41a262c048e && git checkout -B drift-repro f068cde84d272d25c451003996f3752bd016001b && git merge --no-ff 1faa38a990d9f2538af62cecd3b7f41a262c048e
node scripts/docs-audit/affected-docs.mjs --json f068cde84d272d25c451003996f3752bd016001b
|
…a below-floor migrateCommand (#33031) A target below the migrate-meta support floor no longer carries a migrateCommand, so the AppPlugin init pin asserts targetMajor instead. Claude-Session: https://claude.ai/code/session_016WV4cxHwXNcGcAHNerZsom Co-authored-by: Claude <noreply@anthropic.com>
… collection (#33031) check:test-source-alias judges edited test files: app-plugin.ts loads @objectstack/metadata lazily, so the first load belongs at module top, not inside a clocked case. Claude-Session: https://claude.ai/code/session_016WV4cxHwXNcGcAHNerZsom Co-authored-by: Claude <noreply@anthropic.com>
…oor major, which still names a migrate command (#33031) Below the migrate-meta support floor the refusal carries no migrateCommand, so the pin moves its stale range from ^10 to ^16. Claude-Session: https://claude.ai/code/session_016WV4cxHwXNcGcAHNerZsom Co-authored-by: Claude <noreply@anthropic.com>
|
domain:server#5 · os-elon-musk · session_016WV4cxHwXNcGcAHNerZsom Re-run · area A5 · head 1faa38a · 2026-11-14T23:15Z Test Core (5/8) went red on |
|
domain:server#5 · os-elon-musk · session_016WV4cxHwXNcGcAHNerZsom Request: review · area A5 · head 1faa38a · 2026-11-14T23:34Z Fixes #33031. Declared |
|
Contract-review-claim: session_016WV4cxDxAYxdtDhtR1kQQe · head 1faa38a · 2026-11-14T23:35:24Z |
Review: PASSreview#2 (server area pilot) · area A5 · Fixes #33031 · head What was checked (read-only: the diff, the card, the os-dev report 6885017638 and
Rulings on the two questions:
Nits (none blocking):
Nits only, so this is the final round. Generated by Claude Code |
|
domain:server#5 · os-elon-musk · session_016WV4cxHwXNcGcAHNerZsom ACCEPT · area A5 · head 1faa38a · 2026-11-14T23:36Z
|
…nstall-contract acceptance[1] name when migrateCommand is absent (objectstack-ai#34026) <!-- claude-projects-attribution: {"github_login":"zhuangjianguo"} --> _Requested by **Steedos** · [project thread](https://claude.ai/code/project/chan_018ETKaNwMZCNRYD7D8Q9Ubb?thread=cmsg_018ETKaNwMZCNRYD7D8Q9UbbTGhxJSYAmQXU7efVdNqrpw)_ Fixes objectstack-ai#33618 Clause-②: no Metadata-protocol: none ## 维护者速读 - 改了什么:两处文字,不动代码。错误码台账里 `OS_PROTOCOL_INCOMPATIBLE` 那一行的注释,以及测试清单 `platform-core.manifest-install-contract` 的 acceptance[1](rev 10 → 11)。两处都改为与已发布的拒绝一致:迁移命令只在迁移下限(16)到运行时主版本之间给出,低于下限或高于运行时都不给。 - 为什么改:objectstack-ai#33466 已让低于下限的包不再收到注定失败的 `migrate meta --from N`,但这两处文字仍写着"总会给迁移命令",照着读的 agent 和 QA 会得出错误预期。 - 风险与回滚:只是注释和 QA 清单文字,运行行为不变;spec 的 `*.zod.ts` 随包发布,所以带一个 patch changeset。回滚即还原本 PR。 - 先看:① `packages/spec/src/api/error-code-ledger.zod.ts` 的 `OS_PROTOCOL_INCOMPATIBLE` 注释;② `docs/qa/platform-checklist/areas/platform-core.json` 该项 acceptance[1] 与新增 history 行;③ changeset。 - 两分钟验证:`node scripts/check-platform-checklist.mjs`,预期退出码 0 且打印 OK。 - 需要你做的:无,席位落地。 ## What changes - **`packages/spec/src/api/error-code-ledger.zod.ts`, the comment on the `OS_PROTOCOL_INCOMPATIBLE` row.** The comment said the remedy is `objectstack migrate meta --from N`, and listed `migrateCommand` among the `error.details` members unconditionally. It now states the shipped shape, read from `checkProtocolCompat` (`packages/metadata-core/src/protocol-handshake.ts`) at base `895783a1e8`: - `requiredRange`, `rangeSource`, `protocolVersion` and `targetMajor` are on every refusal. - `migrateCommand` is `objectstack migrate meta --from N` for a target major from the support floor up to the runtime's. The floor is `MIGRATE_META_SUPPORT_FLOOR` = 16, which a test holds equal to the spec's `MIGRATION_SUPPORT_FLOOR`. - `migrateCommand` is the bare `objectstack migrate meta` when the target major is null. - It is absent when the target is AHEAD of the runtime (objectstack-ai#26480) or BELOW the floor (objectstack-ai#33466). In both cases the message names the remedies that apply. This is a line comment, not a `.describe()`, so no generator reads it. The row and the code are unchanged. - **`docs/qa/platform-checklist/areas/platform-core.json`, item `platform-core.manifest-install-contract`.** - acceptance[1] now scopes `migrateCommand` to the floor. At or above the floor and at or below the runtime, the refusal carries `--from TARGET`. Below the floor, it carries none, and the message names a build for this runtime's protocol, or reaching protocol 16 by another path and then `--from 16`. The clause also says every refusal carries `targetMajor`. - Revision 10 → 11, with a history row citing objectstack-ai#33618. - The steps, the verify text and the other clauses are unchanged. On an 18 runtime the `^(RT-1)` probe targets 17, which is above the floor. - **`.changeset/33618-protocol-incompatible-ledger-comment.md`**: a `@objectstack/spec` patch. `src/**/*.zod.ts` is in the spec's `files[]`, so the comment ships. ## Tests No behaviour changed, so there is no new test and no ablation. Both diffs are text, and os-dev.md does not ablate docs or comments. - `node scripts/check-platform-checklist.mjs`: exit 0, `OK — 16 areas, 429 items`. - A semantic diff parsed `platform-core.json` at origin/main and at HEAD. Item order is unchanged (47 items). Only `platform-core.manifest-install-contract` differs, and only in `acceptance` (index 1 alone), `revision` (10 → 11) and `history` (10 → 11 rows). ## Acceptance notes - **Overlap with objectstack-ai#33931.** objectstack-ai#33931 (objectstack-ai#33860) edited a different item in the same area file, `platform-core.bare-name-one-holder-refusal`. Neither path is routed to a merge driver (`git check-attr merge` answers `unspecified` for both), so `git merge-tree` gives the textual answer. Before objectstack-ai#33931 merged, both runs exited 0 and printed only the tree id, with no conflicted path: ```text git merge-tree --write-tree --name-only 1ca1a70 d6f080e (objectstack-ai#33931 head; merge base 895783a) 3616dbc86b76d2e05519e3b4eafcbd695af3a4cf EXIT=0 git merge-tree --write-tree --name-only 1ca1a70 895783a (origin/main then) 780e88e EXIT=0 ``` objectstack-ai#33931 then landed on main as de905cc. This branch merged origin/main at 03b4d2d without conflict (head dcda950). A semantic diff against main still shows only `manifest-install-contract` changed: acceptance[1], revision 10 → 11, and one more history row. `git merge-tree --write-tree --name-only HEAD origin/main` at a3aa1d2 also exits 0. - `docs/adr/0087-metadata-protocol-upgrade-contract.md` still teaches the old shape in three places. These are reported to the skills carrier, not edited here: - Line 116 (D1): "the exact replay command (`objectstack migrate meta --from N`, D3)". - Line 191: "`objectstack migrate meta --from 10` composes the steps". - Line 536: "`migrate meta --from 10` therefore reaches protocol 15". With the floor at 16, the CLI refuses `--from 10`. ## Verification All readings are at head `dcda950ef9`, after the merge of origin/main `03b4d2d1f4`. The spec, formula and lint closure was rebuilt under the verify lock first. <details><summary>Derived gate families: 89 derived, 87 exit 0, 2 NOT MEASURED (exit 3), 0 UNRUN</summary> ```text node scripts/pm/dispatch-gates.mjs --ran ran-head.list (exit 0) Run reconciliation — 89 derived, 87 run, 2 NOT-MEASURED, 0 UNRUN. pnpm check:lean-entry-closure :: exit 3 PREREQUISITE NOT MET (packages/objectql/dist absent; the gate loads built entries) pnpm check:dual-build-cjs-loads :: exit 3 PREREQUISITE NOT MET (needs a whole-workspace build) ``` Neither gate reads a source comment or a checklist file. Both are left to CI's Lint and Repo Gates. </details> <details><summary>spec package, checklist validator, lint</summary> ```text pnpm --filter @objectstack/spec build && check:generated VERDICT command-exit 0 · All 14 generated artifacts are up to date pnpm --filter @objectstack/spec test Test Files 842 passed (842) · Tests 26956 passed | 1 todo (VERDICT command-exit 0, at 1ca1a70) pnpm --filter @objectstack/spec typecheck exit 0 (tsc --noEmit, check:scripts-typecheck, check:test-typecheck OK) node scripts/check-platform-checklist.mjs exit 0 · OK — 16 areas, 429 items npx eslint --no-inline-config packages/spec/src/api/error-code-ledger.zod.ts exit 0 ``` The merge brought no change to either file, so the spec test and typecheck reading at 1ca1a70 holds for these paths. CI's Test Core and TypeScript Type Check rerun them on the head. </details> 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01QsR2jTEivi2wogPpeo3xd5 --------- Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: objectstack-fleet[bot] <332303061+objectstack-fleet[bot]@users.noreply.github.com>
Requested by Elon · project thread
Fixes #33031
Clause-②: no
Metadata-protocol: none
维护者速读
OS_PROTOCOL_INCOMPATIBLE)不再开出objectstack migrate meta --from N这条注定被 CLI 拒绝的命令,改为说明两条真正可行的补救:装一个针对本运行时协议的包构建,或先经其他途径升到 16 再--from 16。details.migrateCommand缺省、文案换成补救说明;状态码、错误码、准入判定和 16 及以上的提示一字不变。回滚即还原这一个提交。已知一处他包测试(packages/runtime/src/app-plugin.test.ts)断言了--from 13,正是本缺陷的旧行为,需随本 PR 改一行断言(超出派发文件面,已上报席位)。packages/metadata-core/src/protocol-handshake.ts的belowFloor分支与文件顶部MIGRATE_META_SUPPORT_FLOOR常量(为何不直接 import 见下文);② 同目录protocol-handshake.test.ts末尾新增的 describe 与被改写的旧 fixture;③ changeset。pnpm --filter @objectstack/metadata-core exec vitest run src/protocol-handshake.test.ts,预期 56 个测试全部通过。What changes
checkProtocolCompat(packages/metadata-core/src/protocol-handshake.ts) builtmigrateCommand = objectstack migrate meta --from TARGETfor every declared major that is not ahead of the runtime, with no floor check. The CLI's chain refuses every--from NunderMIGRATION_SUPPORT_FLOOR(16, ADR-0087 D3;MigrationFloorError), so a manifest declaringengines.protocol: '^15'or'^0'was told to run a command known to fail.Below the floor the refusal now mirrors the AHEAD arm (#26480): no
migrateCommandmember (so nodetails.migrateCommandon the HTTP answer), and the message names the remedies that apply. Built output on an 18 runtime:Choices made on the dispatch's axes (author-facing correctness, then smallest public surface, then effort):
--from 16.--from 16on protocol-15 metadata runs: it starts at the floor, never replays the hops below it, and--writestill moves the declared range (planProtocolRangein the CLI presumes the floor was reached another way). As a machine-actionablemigrateCommandit would hand an agent a run that reports success over metadata it never migrated. The prose keeps the conditional path for a human.detailsshape does not change.migrateCommandwas already optional onProtocolIncompatibleDiagnosticandProtocolIncompatibleAnswer.details, and already absent on the AHEAD arm; no member is added or dropped, only the set of cases where the optional one is present shrinks. Status 422 and codeOS_PROTOCOL_INCOMPATIBLEare unchanged. HenceClause-②: no; the open question is recorded in the os-dev report.MIGRATE_META_SUPPORT_FLOOR = 16), not imported.MIGRATION_SUPPORT_FLOORlives only on@objectstack/spec/migrations, whose built entry is about 2.9 MB (the migration registry, split off the spec root for exactly this reason) and measured at +11 MB heap on load.metadata-coreis reached by every install door and by browser bundles (@object-ui/app-shell), so importing it to read one number is the wrong trade. The test file imports the spec's constant and sweeps majors 0 to floor+2, so a release-policy ruling that moves the spec floor reds this package until the copy follows (ablation below).Tests
describe('[#33031] ...')inprotocol-handshake.test.ts: below the floor (^15,^0, a union whose lowest alternative is 15) carries nomigrateCommand, never offers--from Nor aRun:line, and names the build for protocol 18 and the floor; AT the floor^16keeps--from 16; CONTROL^17keeps--from 17and an undeterminable target keeps the bare command; the HTTP answer for^15carries the four applicable members and still declares 422; a sweep pins the local floor equal to the spec'sMIGRATION_SUPPORT_FLOOR.--fromunder the floor (--from 10,--from 6on an 11 runtime;>=15 <18on 18) pinned the defect itself. They are re-spelled onto an above-floor runtime (RT_ABOVE_FLOOR = '18.0.0', or 21 for the one-or-five-behind shape test) so each keeps asserting what it was written for.Acceptance notes
packages/runtime/src/app-plugin.test.ts("refuses an incompatible engines.protocol range BEFORE registering the manifest") declares^(PROTOCOL_MAJOR - 5)=^13and assertsmigrateCommand: objectstack migrate meta --from 13, the very prescription this card removes. Measured red on this branch (1 failed, 83 passed across the three runtime protocol suites). The one-line fix is to asserttargetMajor: PROTOCOL_MAJOR - 5instead (the seam's point is that the diagnostic arrives before registration; which remedy it names is metadata-core's pin). Not edited here: the file surface ismetadata-coreplus one changeset, and that edit is the seat's to authorize.platform-core.manifest-install-contract(docs/qa/platform-checklist/areas/platform-core.json, acceptance[1]) still says every target at or below the runtime carries amigrateCommand; it now holds only from the floor up. Checklist accuracy follow-up, not edited here.MIGRATE_META_SUPPORT_FLOORis a second spelling of the spec's number, held by a test rather than an import. A lighter spec export of the floor (for example besidePROTOCOL_VERSIONon@objectstack/spec/kernel) would remove the copy; that is a spec public-surface addition and out of this card's surface.Verification
metadata-core: tests, typecheck, lint (head 16f58bf)
Dependents that consume the diagnostic (head 16f58bf)
The full affected set (108 packages by
select-shard-packages.sh) is Test Core's in CI.Ablations (one-off, committed fix first, restored by scripts/ablation-replace.mjs)
The derived gate families (
dispatch-gates.mjs --commands, 65 commands) and their readings are in the os-dev report comment on #33031.🤖 Generated with Claude Code