Repository navigation
fix(metadata-core): the protocol refusal prescribes no migrate meta --from below the migration floor - #33466
fix(metadata-core): the protocol refusal prescribes no migrate meta --from below the migration floor#33466objectstack-fleet[bot] wants to merge 4 commits into
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 |
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