Skip to content

Commit fb3d1ff

Browse files
docs(spec,qa): OS_PROTOCOL_INCOMPATIBLE ledger comment and manifest-install-contract acceptance[1] name when migrateCommand is absent (#34026)
<!-- claude-projects-attribution: {"github_login":"zhuangjianguo"} --> _Requested by **Steedos** · [project thread](https://claude.ai/code/project/chan_018ETKaNwMZCNRYD7D8Q9Ubb?thread=cmsg_018ETKaNwMZCNRYD7D8Q9UbbTGhxJSYAmQXU7efVdNqrpw)_ Fixes #33618 Clause-②: no Metadata-protocol: none ## 维护者速读 - 改了什么:两处文字,不动代码。错误码台账里 `OS_PROTOCOL_INCOMPATIBLE` 那一行的注释,以及测试清单 `platform-core.manifest-install-contract` 的 acceptance[1](rev 10 → 11)。两处都改为与已发布的拒绝一致:迁移命令只在迁移下限(16)到运行时主版本之间给出,低于下限或高于运行时都不给。 - 为什么改:#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 (#26480) or BELOW the floor (#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 #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 #33931.** #33931 (#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 #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 (#33931 head; merge base 895783a) 3616dbc86b76d2e05519e3b4eafcbd695af3a4cf EXIT=0 git merge-tree --write-tree --name-only 1ca1a70 895783a (origin/main then) 780e88e EXIT=0 ``` #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>
1 parent bf594eb commit fb3d1ff

3 files changed

Lines changed: 38 additions & 9 deletions

File tree

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
'@objectstack/spec': patch
3+
---
4+
5+
docs(spec): the error-code ledger's `OS_PROTOCOL_INCOMPATIBLE` comment says when the refusal carries a `migrateCommand` and when it does not
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
Comment only; no schema, type, code or export changes. The comment on the `OS_PROTOCOL_INCOMPATIBLE` row in `src/api/error-code-ledger.zod.ts` said the remedy is `objectstack migrate meta --from N` and listed `migrateCommand` among the `error.details` members unconditionally. It now matches the shipped refusal. `requiredRange`, `rangeSource`, `protocolVersion` and `targetMajor` are on every refusal. `migrateCommand` is present only from the migrate-meta support floor (16, ADR-0087 D3) up to the runtime's major, and is bare when the target major cannot be determined. It is absent for a package ahead of the runtime and for one below the floor, and in both cases the message names the remedies that apply.

‎docs/qa/platform-checklist/areas/platform-core.json‎

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1647,7 +1647,7 @@
16471647
"title": "The package manifest is enforced at the install boundary: an incompatible `engines` range is refused before the registry write, the namespace gate holds ownership, and a namespace-less runtime package has one derived",
16481648
"since": "v15",
16491649
"status": "active",
1650-
"revision": 10,
1650+
"revision": 11,
16511651
"priority": "P1",
16521652
"surface": "api",
16531653
"personas": [
@@ -1687,7 +1687,7 @@
16871687
"evidence": "the refusal body, plus the GET /packages/:id and GET /packages reads taken after it"
16881688
},
16891689
{
1690-
"clause": "the refusal is a STRUCTURED diagnostic, not a bare failure: it carries code OS_PROTOCOL_INCOMPATIBLE, the declared `requiredRange`, the `rangeSource` it was read from, the protocol version it was judged against (`protocolVersion`, the protocol major padded to a semver such as '18.0.0' — never the runtime's package version; packages/metadata-core/src/protocol-handshake.ts ProtocolIncompatibleDiagnostic), and the remedy, which depends on the direction: a declared target major AT OR BELOW the runtime's carries a `migrateCommand` of the form `objectstack migrate meta --from <targetMajor>`; a target major ABOVE the runtime's carries NO `migrateCommand`, because `migrate meta` only moves metadata forward, and its `message` names the two remedies that apply instead, upgrading the runtime to protocol <targetMajor> or installing a build of the package for this runtime's protocol (checkProtocolCompat, #26480) — an author refused at the boundary is told which key to fix and which command or upgrade resolves it",
1690+
"clause": "the refusal is a STRUCTURED diagnostic, not a bare failure: it carries code OS_PROTOCOL_INCOMPATIBLE, the declared `requiredRange`, the `rangeSource` it was read from, the protocol version it was judged against (`protocolVersion`, the protocol major padded to a semver such as '18.0.0' — never the runtime's package version; packages/metadata-core/src/protocol-handshake.ts ProtocolIncompatibleDiagnostic), and the remedy, which depends on the direction and on the migrate-meta support floor (16, `MIGRATION_SUPPORT_FLOOR`, ADR-0087 D3): a declared target major AT OR ABOVE the floor and AT OR BELOW the runtime's carries a `migrateCommand` of the form `objectstack migrate meta --from <targetMajor>`; a target major BELOW the floor carries NO `migrateCommand`, because `migrate meta --from N` refuses every N under the floor, and its `message` names the two remedies that apply instead, installing a build of the package for this runtime's protocol or bringing its metadata to protocol 16 by another path and then running `objectstack migrate meta --from 16` (checkProtocolCompat, #33466); a target major ABOVE the runtime's carries NO `migrateCommand`, because `migrate meta` only moves metadata forward, and its `message` names the two remedies that apply instead, upgrading the runtime to protocol <targetMajor> or installing a build of the package for this runtime's protocol (checkProtocolCompat, #26480) — every refusal carries `targetMajor` whichever direction it takes, and an author refused at the boundary is told which key to fix and which command or upgrade resolves it",
16911691
"oracle": "api",
16921692
"verify": "read the named fields off the captured refusal body; the migrateCommand's --from must be the major of the DECLARED range, not the runtime's. On the AHEAD probe (steps[2], ^(RT+1)) the body carries targetMajor RT+1 and NO migrateCommand member at all, and its message names the runtime upgrade; a `migrate meta` command offered there is a FAIL, since it cannot resolve that refusal",
16931693
"evidence": "both refusal bodies (the older and the AHEAD probe) with every named field shown"
@@ -1797,6 +1797,12 @@
17971797
"date": "2026-11-14",
17981798
"change": "steps[0] names where RT is read (stale read, card #33330, row 68 of the #32908 close-out ledger; QA run #33025 comment 6844741021 on #32908). GET /api/v1/meta has no protocol field; the major comes from GET /api/v1's version, which DiscoverySchema (packages/spec/src/api/discovery.zod.ts) declares and metadata-protocol's discovery-version.ts fills with the runtime's version, whose major equals the protocol major because protocol-version.test.ts holds PROTOCOL_VERSION in lockstep with the spec package major. No clause changed. Read from source at base 87330e89, not driven live",
17991799
"ref": "#33330"
1800+
},
1801+
{
1802+
"revision": 11,
1803+
"date": "2026-11-15",
1804+
"change": "acceptance[1] scopes migrateCommand to the migrate-meta support floor. Loose end of #33031 (PR #33466): the clause said every declared target major at or below the runtime's carries `objectstack migrate meta --from <targetMajor>`, but checkProtocolCompat (packages/metadata-core/src/protocol-handshake.ts) leaves migrateCommand out when the target major is below MIGRATE_META_SUPPORT_FLOOR (16, held equal to the spec's MIGRATION_SUPPORT_FLOOR) and its message names the two remedies that apply. The clause also says every refusal carries targetMajor. The steps' probes (^(RT-1), ^(RT+1)) and the verify text are unchanged: on an 18 runtime ^(RT-1) targets 17, above the floor. Read from source at base 895783a1e8, not driven live",
1805+
"ref": "#33618"
18001806
}
18011807
]
18021808
},

‎packages/spec/src/api/error-code-ledger.zod.ts‎

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -831,15 +831,28 @@ export const ERROR_CODE_LEDGER = {
831831
// declared `engines.protocol` range excludes this runtime's major
832832
// (`ProtocolIncompatibleError`, `protocol-handshake.ts`). Answered 422:
833833
// the manifest is well-formed, but it declares a range this runtime can
834-
// never satisfy, and the remedy is a body change
835-
// (`objectstack migrate meta --from N`). It matches this package's own
836-
// METADATA_SCHEMA_INVALID. It is not 409, which this ledger keeps for
837-
// refusals from environment state (CONCURRENT_UPDATE). The two HTTP
838-
// doors that reach the throw, `POST /api/v1/packages` and (since #21805)
834+
// never satisfy, so the same body never succeeds on this runtime. The
835+
// remedy is a different body (migrated metadata, or a build for this
836+
// runtime's protocol), or, for a package ahead of the runtime, a runtime
837+
// upgrade, which is a deployment change, not environment state. It
838+
// matches this package's own METADATA_SCHEMA_INVALID. It is not 409,
839+
// which this ledger keeps for refusals from environment state
840+
// (CONCURRENT_UPDATE). The two HTTP doors that reach the throw,
841+
// `POST /api/v1/packages` and (since #21805)
839842
// `POST /api/v1/marketplace/install-local`, answer the same bytes through
840843
// the shared `protocolIncompatibleAnswer`, carrying `requiredRange`,
841-
// `rangeSource`, `protocolVersion`, `targetMajor` and `migrateCommand` in
842-
// `error.details`.
844+
// `rangeSource`, `protocolVersion` and `targetMajor` in `error.details`
845+
// on every refusal. `migrateCommand` is present only when the chain can
846+
// replay the package's metadata: `objectstack migrate meta --from N` for
847+
// a `targetMajor` from the migrate-meta support floor
848+
// (`MIGRATION_SUPPORT_FLOOR`, 16, ADR-0087 D3) up to the runtime's major,
849+
// and the bare `objectstack migrate meta` when `targetMajor` is null. It
850+
// is absent when `targetMajor` is AHEAD of the runtime (#26480), where
851+
// the message names upgrading the runtime or installing a build for this
852+
// runtime's protocol, and absent BELOW the floor (#33466), where
853+
// `--from N` refuses and the message names installing a build for this
854+
// runtime's protocol, or bringing the metadata to the floor by another
855+
// path and then running `--from 16`.
843856
'OS_PROTOCOL_INCOMPATIBLE',
844857
],
845858
'@objectstack/objectql': [

0 commit comments

Comments
 (0)