Repository navigation
fix(metadata-protocol)!: history and rollback doors refuse a bare two-holder name and address one holder by ?package= - #33193
Conversation
… of a by-package name WIP: the /meta history and rollback doors take ?package=, a bare request of a name two row slots hold is refused naming both, and the repository records whose row each history snapshot is of. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L9qibvyhxPWfA8DsbmVYJ5
…ress one holder by package Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L9qibvyhxPWfA8DsbmVYJ5
…he holder refusal with candidates Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L9qibvyhxPWfA8DsbmVYJ5
…e name Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L9qibvyhxPWfA8DsbmVYJ5
…dress Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L9qibvyhxPWfA8DsbmVYJ5
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L9qibvyhxPWfA8DsbmVYJ5
📓 Docs Drift CheckThis PR changes 5 package(s): 56 hand-written doc(s) name something this change touched — list omitted above 15 rows. Re-derive on the tree named below: ⛔ 17 release-owned page(s) also affected — read-only, see AGENTS.md Documentation Guardrails. What this run could not see
Coarse fallback — 178 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 a1452deeba305b43e2116e76a672a51450492be6 && git checkout a1452deeba305b43e2116e76a672a51450492be6
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin b63c894934b5e427b456b997774f48a220edb7e5 952550aea38aba428e045206b01aedc104f49090 && git checkout -B drift-repro b63c894934b5e427b456b997774f48a220edb7e5 && git merge --no-ff 952550aea38aba428e045206b01aedc104f49090
node scripts/docs-audit/affected-docs.mjs --json b63c894934b5e427b456b997774f48a220edb7e5
|
…y it minor Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L9qibvyhxPWfA8DsbmVYJ5
|
epic:#31527#3 · os-tesla · session_01L9qibzECS2npZFku4956Um Contract reviewServed-tier: Read: card #32905 and its five comments (triage 6839348119, claim 6867138888, measurement 6867256997, regrade 6867282696 "stays p2", os-dev-report 6869029675); the PR body, file list and net diff against Check-runs on this head when judged: ① Derived judgments
② Semver level
③ Boundary flags
④ Design judgment
Implementing files, tried against the brief's four attacks. Can a bare rollback still write one holder's row when two hold the name? Not when both hold a stored active row, whether two pairs or a package beside the package-less row: refused 409 before anything is read. A holder whose row is inactive or deleted is not a slot, so the name is then one-slot and resolves bare; the removed holder's attributed versions are refused by
Does
Does writing Does a one-holder name's bare history and rollback answer exactly as on
Agreement with the contract, remaining sentences.
Findings: F1 must-fix (red Implemented-by: VERDICT: FAIL |
…does Bare history and rollback now also refuse where the bare plain read refuses (a second holder in code counts), and a bare rollback of a one-slot name restores what main restores. `?package=P` addresses the slot of the row a read naming P serves, including the package-less fallback; with no stored row an uninstalled package is refused like a save naming it. `?package=` on a type not stored per package is refused 400 on both doors. The rollback request gets a spec schema. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L9qibvyhxPWfA8DsbmVYJ5
…nd which answer as before Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L9qibvyhxPWfA8DsbmVYJ5
… collection in the slot pins Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L9qibvyhxPWfA8DsbmVYJ5
|
epic:#31527#3 · os-tesla · session_01L9qibzECS2npZFku4956Um Contract reviewServed-tier: Delta review, rendered 2026-11-14T04:03Z, of the patch round on record 6869129898 (head Check-runs on this head when judged. ① Derived judgments
② Semver level
③ Boundary flags
④ Design judgment
Each finding of record 6869129898, against the code.
Red line 3, tried again on this head. A one-holder name, bare: history unfiltered, rollback unchecked, both as Findings on this head: N1 should-fix ( Implemented-by: VERDICT: PASS |
… number of at least 1 The rollback request's spec schema now declares `toVersion` as the door enforces it, and the door reads that declaration in place of an undeclared whole-number parse. The changeset grades every package but spec `patch` under the breaking banner, names the zero-row two-shipper refusal, and states what the bare doors do not yet ask for an action. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L9qibvyhxPWfA8DsbmVYJ5
|
epic:#31527#3 · os-tesla · session_01L9qibvyhxPWfA8DsbmVYJ5 LandingHead-sha:
Ready + auto-merge now. 2026-11-14T17:02Z |
⛔ merge queue 构建失败 — 先分诊,再决定要不要重排队列构建 43619123356 红了。队列跑的是全量套件(PR 侧 CI 只跑 affected 子集), 分类: 失败的 job(日志抽取,best effort):
跨 PR 相同签名(24h,按失败测试文件聚合):
历史信号:
分诊清单:
Generated by Claude Code · merge-queue-triage workflow (#4859) |
|
epic:#31527#3 · os-tesla · session_01L9qibvyhxPWfA8DsbmVYJ5 Merge-queue red: triageQueue build 43619123356 (tree Signature: First diagnosis: load, not this PR. The file's import closure does meet this diff (
The failing case runs in about 0.5 s alone, both ways. Each case of that describe boots the engine, installs two or three packages and restarts, under the 5 s default; on a loaded shard that is the margin that gave out. Disposition: not re-enqueued blind. The fix is in this PR: that describe gets 2026-11-14T17:33Z |
…d shard Each case of that describe boots the engine, installs two or three packages and restarts it: about half a second alone, but a merge-queue shard timed one out at the 5 s default while the file took 63 s. The file's runtime is the same on main's sources and on this branch's, measured back to back, so the budget is room for load, not for a slower product. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L9qibvyhxPWfA8DsbmVYJ5
|
epic:#31527#3 · os-tesla · session_01L9qibvyhxPWfA8DsbmVYJ5 Contract reviewServed-tier: Delta review of the hop Check-runs on this head when read (17:57Z, 37 runs created). Success: Auto Label, Check Documentation Links, Check PR Size, Dogfood Regression Gate, Governed Surface Queue Guard, ① Derived judgments
② Semver level
③ Boundary flags
④ Design judgment
The hop, tried four ways.
Findings on this head: no must-fix, no should-fix · two nits (the "restarts it" clause over-states what ten of the cases do; the local timings rest on the seat's word). The PASS of record 6880527562 stands on Implemented-by: VERDICT: PASS |
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L9qibvyhxPWfA8DsbmVYJ5
|
epic:#31527#3 · os-tesla · session_01L9qibvyhxPWfA8DsbmVYJ5 Regen-provenance: 6881836907 · A second merge-forward of 2026-11-14T18:33Z |
|
epic:#31527#3 · os-tesla · session_01L9qibvyhxPWfA8DsbmVYJ5 Re-landing after the queue redHead-sha:
Auto-merge again. 2026-11-14T19:05Z |
…dies and packages off the loader's keyed entries; loadManyKeyed entries carry their package (objectstack-ai#33299) <!-- claude-projects-attribution: {"github_login":"os-elon-musk"} --> _Requested by **Elon** · [project thread](https://claude.ai/code/project/chan_01WedDzV26nniwxv7jC88B9D?thread=cmsg_01WedDzV26nniwxv7jC88B9DDZYUbJbnXUTqZoZ56k4czR)_ Fixes objectstack-ai#32680 Clause-②: yes (narrowing) Metadata-protocol: none Skills-docs: none — no skill teaches how `MetadataManager`'s plural reads stamp a loader's bodies or what `loadManyKeyed` entries carry; the moved answers live in the metadata service's internal read path. ## 维护者速读 - 改了什么:`MetadataManager.loadMany` 对按包存放的类型,直接用加载器 keyed 条目里每行自己的 body 和包戳,不再按内容把 `loadMany` 的 body 配回行;`loadManyKeyed` 返回的条目带上 `packageId`。 - 为什么改:两个包同名、另有一行 body 也写着这个名字时,旧的内容配对放弃打戳,启动预载把一个 body 放进裸槽,启动后裸读答出这个 body 而不是 409;加载器两次读序列化不同也会无声不打戳;调用方拿到两个同名条目分不清是哪个包。 - 风险与回滚:只影响接了 `DatabaseLoader` 的宿主(工作区内 0 处);该形状下启动后裸读由答一个 body 改为 409 点名两个包(收窄,已声明);库里的行不动。回滚 = revert 本 PR。 - 先看:`packages/metadata/src/metadata-manager.ts` 的 `keyedEntryBodies`(风险 hunk:剩余 body 的按值比较只决定保留,不决定包);同文件 `keyedEntryOf`;`packages/metadata/src/loaders/database-loader.test.ts` 末尾的 `[objectstack-ai#32680]` describe。 - 两分钟验证:`pnpm --filter @objectstack/metadata exec vitest run src/loaders/database-loader.test.ts -t 32680`,预期 54 个用例全绿(本 PR 新增 53 个,加改写的 objectstack-ai#32458 用例 1 个)。 - 需要你做的:无,席位落地。objectstack-ai#32681(包外绑对象的 action 行该归哪个键)另需你拍板,见下方 Acceptance notes。 ## What changes `MetadataManager.loadMany`, for an unbundled type stored per `(package, name)` (`PACKAGE_SLOTTED_STORE_TYPES`) on a loader that holds items per package (`loadManySlots`: `DatabaseLoader`, the artifact door's `MemoryLoader`), now hands on each keyed entry's own body, stamped (`_packageId`) with the package the loader holds that entry for when the body carries the entry's key as its `name` (`keyedEntryBodies`). It no longer pairs `loader.loadMany`'s bodies to the keyed entries by their `JSON.stringify` (the former `withLoaderEntryPackages`). Bodies the keyed read cannot name (a row whose `name` column is empty) are still handed on after them, unstamped: they are `loadMany`'s bodies less one per keyed entry whose body is the same value (key order aside), so the comparison decides only what is kept, never a package, and it runs only when `loadMany` answers more bodies than the keyed read. `MetadataManager.loadManyKeyed` entries carry `packageId` where the loader's entry carries one (`keyedEntryOf`), for the slotted path and the bundled one (`email_template`). Every moved answer, FROM to TO (the changeset carries the same list): | Shape (host wiring a `DatabaseLoader`) | Read | FROM | TO | |:--|:--|:--|:--| | Name two packages hold, beside another row whose body says the name (F2) | `MetadataManager.loadMany` | one body, unstamped | both holders stamped with their own row's package, the other row's body unstamped | | same | boot pass registry | the one body in the bare slot | each package's slot, the other row's body in the bare slot | | same | bare read after the pass | that body | `409 RESOURCE_CONFLICT` naming both packages (for `action` also `platform`, see notes); the same as without the pass | | Name one package holds, beside another row whose body says the name | `loadMany` / boot pass | unstamped, filed in the bare slot | stamped, filed in the holder's slot | | same | read naming a package that holds no row, after the pass | the holder's body | nothing, as without the pass | | Loader whose two reads serialise a body differently (F3) | `loadMany` | both holders unstamped | both stamped | | Any type stored per `(package, name)` | `MetadataManager.loadManyKeyed` | `{ name, data }` | `{ name, data, packageId }` where the loader holds it for a package | Not changed: a name one package holds with no other row's body saying it (CONTROL pins), a name no package holds, and a loader without `loadManySlots`. The number of entries both plural reads hand on is unchanged for every shape but F2, where the other row's body is now kept beside both holders. ## Tests New top-level describe `[objectstack-ai#32680]` in `packages/metadata/src/loaders/database-loader.test.ts` (53 cases): F2 per boot-pass type with the other row stored first and last (bare read 409 naming both after the pass; reads naming ALPHA, BETA, GAMMA equal the cold read); F3 with a key-reordering loader, plus a row whose name column is empty kept once; F4 per slotted type and `email_template`; one holder beside another row's body (every read equals the cold read); CONTROL one holder per type. The objectstack-ai#32458 pin "two holders of a name and another row's body that says the same name" moves FROM `[[null, ALPHA]]` TO `[[ALPHA, ALPHA], [BETA, BETA], [null, ALPHA]]`, its title rewritten to say so. BEFORE, on main `d4fbb4db` with the same fixtures: 43 of the 53 new cases red, the 10 CONTROLs green. The F2 bare read after the pass answered `com.alpha.app` with registry keys `['helper']` for every type. Downstream readers (`MetadataManager.loadMany` / `loadManyKeyed` callers), consumer direction: objectql `action-governance`, `metadata-sync-flow-two-holders`, `plugin-governance-scoped-metadata`, `webhook-stored-row-boot-hydration` (59 passed); runtime `action-activation-unpackaged`, `actions-addressed-route`, `mcp-package-object-discovery`, `action-governance-scope-divergence` (218 passed). Ablations (each through `scripts/ablation-replace.mjs`, mutation landed on disk and restored to the HEAD blob with `git diff HEAD` empty; the suite reads `src/` by relative import, so no build leg): 1. the keyed read swapped back for `loader.loadMany` (no stamp at all): 42 red (the CONTROLs among them, since this drops every stamp), the 12 F4 cases green; 2. `keyedEntryOf` without `packageId`: the 12 F4 cases red, nothing else; 3. the remainder compared by `JSON.stringify` instead of by value: the F3 case red (the empty-name row handed on twice); 4. the remainder dropped: F3 and the two objectstack-ai#32458 pins that keep an empty-name row red. ## Acceptance notes - **objectstack-ai#32681 is not in this PR.** It is returned to the PM for a decision: which key a package-less action row bound to an object takes beside two packages that bind the name to different objects. Re-measured on this branch (the shape does not move here): ALPHA `approve` on `account`, BETA's on `contact`, a package-less one on `account`; the cold read naming ALPHA answers ALPHA's row, after the boot pass it answers the package-less row. The mirror shape moves too: one holder ALPHA on `account` and a package-less row on `contact` hand on one row (the package-less one, folded into ALPHA by the loader's per-name D4 rule), so after the pass a read naming ALPHA answers the `contact` row where the cold read answers ALPHA's `account` row. ADR-0150 D4's action key `(package, objectName, name)` and its R15 row ("two holders → the ambiguous set") read the shape two ways, so it is not settled here. - For `action`, the F2 bare refusal after the pass also names `platform`: the other row (stored under its own key) is registered under its body's name in the bare slot, and an action name's package-less registry slot that no loader stores under that name counts as the platform's (objectstack-ai#32560). The boot pass registering a stored row under its body's `name` rather than its row key is unchanged here. - No change in `packages/metadata-protocol/src/**` and none in `packages/metadata/src/loaders/database-loader.ts` (open PR objectstack-ai#33193 edits it). - Local gates were narrowed to the package's tests, typecheck, the new pins and the ablations; the derived gate families run in CI. ## Verification <details><summary>metadata suite and typecheck on fad580c</summary> ```text pnpm --filter @objectstack/metadata test && pnpm --filter @objectstack/metadata typecheck Test Files 77 passed (77) Tests 2367 passed (2367) os-verify-lock: VERDICT command-exit 0 ``` </details> <details><summary>Targeted gates run locally</summary> ```text EXIT=0 node scripts/check-adr-0087-registration.mjs --base origin/main EXIT=0 node scripts/check-changeset-no-major.mjs --base origin/main EXIT=0 node scripts/check-empty-changeset.mjs --base origin/main EXIT=0 pnpm check:nul-bytes EXIT=0 pnpm check:durability-log-level EXIT=0 pnpm check:doc-authoring EXIT=0 pnpm check:issue-citations EXIT=0 pnpm check:slot-lookup EXIT=0 pnpm check:test-source-alias EXIT=0 pnpm check:cross-package-test-inputs EXIT=0 node scripts/check-closing-keyword-parity.mjs ``` </details> --- _Generated by [Claude Code](https://claude.ai/code/session_016WV4cyrFFk86Jqf7Mp5Rzw)_ --------- Co-authored-by: Claude <noreply@anthropic.com>
…s the stored computed fields it hands back (objectstack-ai#33350) <!-- claude-projects-attribution: {"github_login":"os-elon-musk"} --> _Requested by **Elon** · [project thread](https://claude.ai/code/project/chan_01WedDzV26nniwxv7jC88B9D?thread=cmsg_01WedDzV26nniwxv7jC88B9D75mRNRrsy6GfiJD9q7La4j)_ Part of objectstack-ai#32958 Clause-②: yes (widening) Metadata-protocol: added Skills-docs: none — the published skills teach neither the delete door's answer keys nor the stored-expression fill any metadata door runs; an optional key on the delete answer changes nothing an author writes. ## 维护者速读 - **改了什么**:删除自有包的 `object_extension`(它曾重定义一个存储型计算字段的表达式)时,删除入口现在会像保存、回滚、撤销入口一样,把对象已有记录按恢复后的表达式重算回填,并在返回里用新的可选 `advisories` 逐字段说明。 - **为什么改**:删除扩展后对象已改用原表达式计算,但老记录仍是被删表达式算出的值,报表、筛选、汇总读到的都是旧数,且没有任何提示。 - **风险与回滚**:回填只在删除确实让某个存储计算字段改变时才跑,复用保存入口同一条回填路径;回填失败不会让删除失败,只在 `advisories` 里报未完成。回滚即 revert 本 PR。 - **先看**:`packages/metadata-protocol/src/protocol-diff-delete-load.ts`(注册表 heal 前后的 capture/fill 两处)、`packages/spec/src/api/protocol.zod.ts`(`DeleteMetaItemResponseSchema.advisories`)、`packages/objectql/src/stored-expression-backfill.test.ts`(两种保存顺序的钉子)。 - **两分钟验证**:`pnpm --filter @objectstack/objectql exec vitest run src/stored-expression-backfill.test.ts -t 32958`,预期 4 个用例全绿(本修复之前前两个是红的:行值停在 `[8, 16, 24]`)。 - **需要你做的**:无,席位落地。 ## What changes `deleteMetaItem` (`DELETE /api/v1/meta/:type/:name`) removed the row and healed the registry, so the object served the definition beneath the removed one, but it ran no stored-expression fill. Deleting an own-package `object_extension` that re-declared a stored computed field therefore left every existing row on the value the removed expression computed. - `protocol-diff-delete-load.ts`: on the repository path's row-deleted branch, an active-state delete captures the object's stored computed fields (`captureStoredExpressionChange`) before `restoreArtifactRegistryView`, and runs `fillStoredExpressionChange` after the audit row, projector and mutation event, before the answer: the save door's order. The notices ride a new omitted-when-empty `advisories` on the answer. A draft discard captures nothing. No storage sync is added, matching the revert door's removal limb from objectstack-ai#32921. - `protocol.ts`: the two delete signatures and the public docblock declare `advisories`. - `protocol-stored-expression-fill.ts`: the module docblock lists the delete door among the doors that fill. - `packages/spec`: `DeleteMetaItemResponseSchema` gains optional `advisories: RuntimeAuthoringIssue[]`; its docblock no longer says the key is deliberately undeclared. Regenerated: `authorable-surface/api.json` (one key), `content/docs/references/api/protocol.mdx`. - Changeset: `@objectstack/spec` minor, `@objectstack/metadata-protocol` patch (the same grading as objectstack-ai#32921). ## Tests - `packages/objectql/src/stored-expression-backfill.test.ts`, new top-level `describe('[objectstack-ai#32958] …')` in the existing door harness (real protocol, real engine): 1. object saved, then the extension: delete ⇒ registry serves the owner's expression, rows `[1, 2, 3]`, 3 row writes, one `stored-expression-filled` notice, and the answer parses through `DeleteMetaItemResponseSchema` unstripped. CONTROL before the delete: the extension's expression served and rows `[8, 16, 24]`. 2. extension saved, then the object: same assertions, same CONTROL. 3. an extension that changed no stored computed field: no row write, no `advisories` key. 4. a draft discard: no row write, no `advisories` key. - `packages/spec/src/api/protocol.test.ts`: the pin that said the delete answer declares neither `version` nor `advisories` is split: `version` stays undeclared; `advisories` is declared, carried, and absent on a clean answer. ## Acceptance notes - **The card's second item is NOT in this PR**, hence `Part of objectstack-ai#32958`: the `object-storage-sync-refused` text (`objectStorageSyncRefusedNotice`) still speaks of "this save" and "publish the object again" on rollback and revert answers. That function lives in `packages/metadata-protocol/src/protocol-registry-hydration.ts`, a file held by in-flight E1 work for this pilot, so it was not edited. The delete door added here runs no storage sync and never emits that notice. - The no-row branch of the delete door (no stored row, a stale registry shadow healed) captures and fills nothing; it is unchanged. - The legacy raw-engine delete path serves only code-only types (`job`, `agent`) and defines no object; unchanged. - A removed extension that changed a stored field's TYPE (not only its expression) gets the fill but no storage sync, as the revert door's removal limb does today. - Overlapping open PR checked: objectstack-ai#33193 edits `packages/spec/src/api/protocol.zod.ts` in other schemas (history/rollback request), not `DeleteMetaItemResponseSchema`. ## Verification <details><summary>Premise on origin/main (e540baf), both orders: red</summary> ``` × object saved first, then the extension: the delete rewrites every row the removed expression computed × extension saved first, then the object: the delete rewrites every row the removed expression computed AssertionError: expected [ 8, 16, 24 ] to deeply equal [ 1, 2, 3 ] (both, at the rows assertion; the registry assertion before it passed) Tests 2 failed | 2 passed | 60 skipped (64) ``` </details> <details><summary>Ablation of the omitted-when-empty answer (one mutation, both negative pins)</summary> Mutation via `scripts/ablation-replace.mjs`: the spread of `advisories` replaced by an unconditional `advisories` key; `ablation-dist-preflight` proved the marker in `metadata-protocol/dist` (2 files). Result: tests 3 and 4 red (`Tests 2 failed | 2 passed`). Restore leg: `git checkout HEAD`, blob hash equal to HEAD's, rebuild, `--absent` preflight clean, whole tree clean; all 4 green again. </details> <details><summary>Local runs on the merged head</summary> - `pnpm --filter @objectstack/metadata-protocol test`: Test Files 339 passed, 9 skipped; Tests 22843 passed (lock VERDICT command-exit 0). - `pnpm --filter @objectstack/objectql test`: Test Files 595 passed; Tests 12946 passed (lock VERDICT command-exit 0). - `@objectstack/spec`, narrowed to the 36 test files that import the protocol schema or the authorable surface: Tests 2340 passed. The full spec suite was not run locally: the shared verify lock was held by another session's workspace-wide test run for over 30 minutes. CI's Test Core runs it. - `pnpm typecheck` for spec, metadata-protocol and objectql: exit 0. - `pnpm lint`: exit 0. - `pnpm --filter @objectstack/spec check:generated`: all 14 artifacts up to date. - The 119 derived gate families (`dispatch-gates --commands`): 116 exit 0; 3 exit 3 (`check:skill-examples`, `check:dual-build-cjs-loads`, `check:type-check-debt`: PREREQUISITE NOT MET, unbuilt packages outside the closure), NOT MEASURED locally, CI runs them. </details> 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_016WV4cy1y7UNVbT2QAdmgdn --------- Co-authored-by: Claude <noreply@anthropic.com>
…efused names it under the advisory rule object-registry-refused (objectstack-ai#33397) <!-- claude-projects-attribution: {"github_login":"os-elon-musk"} --> _Requested by **Elon** · [project thread](https://claude.ai/code/project/chan_01WedDzV26nniwxv7jC88B9D?thread=cmsg_01WedDzV26nniwxv7jC88B9D4Jsmd91BqTVB7dSii9uJMV)_ Fixes objectstack-ai#33005 Clause-②: no Metadata-protocol: none ## 维护者速读 - **改了什么**:发布时运行时注册表拒收某个对象,不再只打一行 warn。`publishPackageDrafts` 在该对象的 `published[]` 元素上带一条 `warning` advisory(稳定规则码 `object-registry-refused`,`where` 写明对象名),服务端打一次 error 日志(后果 + 修法);`publishMetaItem` 与 publish 模式的 `saveMetaItem` 同样带这条 advisory。 - **为什么改**:之前发布答 `published`/`success: true`,却没有任何地方点名这个对象,紧接着的种子加载就撞 `OBJECT_NOT_FOUND`。按裁决选项 D:先告警,outcome 枚举与 `success` 不变(选项 A 另开卡)。 - **风险与回滚**:低。只在注册表真的拒收时多出一条 advisory 和一行 error 日志;干净发布的响应字节不变,没有改 spec。回滚就是 revert 本 PR。 - **先看**:`packages/metadata-protocol/src/protocol-registry-hydration.ts`(`applyObjectRegistryMutation` 改为把拒收交回,新增 `reportObjectRegistryRefusal`)· `protocol-history-and-publish.ts`(`runPublishSideEffects` 与 Phase 2 的元素挂载)· `protocol-publish-drafts-advisories.test.ts` 新增的 describe。 - **两分钟验证**:`pnpm --filter @objectstack/metadata-protocol exec vitest run --maxWorkers=2 src/protocol-publish-drafts-advisories.test.ts`,预期 10/10 通过;其中 objectstack-ai#33005 两条钉住规则码、对象名与 error 日志只出现一次。 - **需要你做的**:无,席位落地。 ## What changes The registry write-through runs after the metadata commit (ADR-0067 D2). When `registerObject` threw there, `ProtocolRegistryHydrationFacet.applyObjectRegistryMutation` caught it and logged only `console.warn`, so `publishPackageDrafts` answered `outcome: 'published'`, `success: true`, with nothing naming the object. A seed load right after that publish then hit `OBJECT_NOT_FOUND`. This PR implements the maintainer's option D ruling (card comment 6879630490): - `applyObjectRegistryMutation` keeps its `warn` line and now also returns the refusal (`ObjectRegistryRefusal`, the thrown value) instead of discarding it. `applyRegistryWriteThrough` passes it on from its `object` branch. Every other branch, and every other caller (rollback, revert, orphan adoption, remote mutation, batch registration), behaves as before and ignores the return value. - New `reportObjectRegistryRefusal(name, refusal)` and the stable rule id `OBJECT_REGISTRY_REFUSED = 'object-registry-refused'`. These follow the pattern of `objectStorageSyncRefusedNotice` (`object-storage-sync-refused`). The reporter logs one `console.error` line that states the consequence and the fix (AGENTS.md "Degradation log levels"), with the registry's reason as a separate argument. It returns one `warning` in the `RuntimeAuthoringIssue` shape: `where: object "NAME"`, `path: ''`. An undeclared failure's text stays out of the 2xx body (`clientFacingFailureText`). - `runPublishSideEffects` reports the refusal once per call and returns it as `registryRefused`. - `publishPackageDrafts` Phase 2 appends that advisory to the refused object's `published[]` element. It comes after the gate's findings and before any storage notice, and an element with no advisories still carries no `advisories` key. Outcome and `success` are unchanged. - Within the ruling's 30-line allowance, on the existing `advisories` field: `publishMetaItem` and a publish-mode `saveMetaItem` add the same advisory to their own `advisories`. That is about 8 extra lines. - `protocol.ts` updates the private method signatures of the three host stubs for the new return types. No spec or `protocol.zod.ts` change; outcome enum untouched. ## Tests New top-level describe in `packages/metadata-protocol/src/protocol-publish-drafts-advisories.test.ts`, using that file's shared stub harness: 1. A two-object batch where the registry refuses `ticket` answers `success: true`, `outcome: 'published'`, `publishedCount: 2`. `ticket`'s element carries exactly one advisory: `rule: 'object-registry-refused'`, `severity: 'warning'`, `where: 'object "ticket"'`, the message names `'ticket'`, the key set matches the other doors, and the undeclared reason is withheld. Exactly one `console.error` line names `ticket`, with the reason whole as its second argument. The sibling `invoice` element has no `advisories` key. 2. `publishMetaItem` and a publish-mode `saveMetaItem` answer the same rule with the right `where`, and each logs once. The test file also gains a module-top `import '@objectstack/lint'` (required by `check:test-source-alias` for an edited test file). ## Acceptance notes - **Premise re-measured at `origin/main` 4c9104e before any edit** (scratch test, deleted): `{"outcome":"published","success":true,"published":[{"type":"object","name":"ticket","version":"..."}]}`, WARN `[Protocol] registerObject failed for ticket: registry refused the object`, ERROR `[]`, one `registerObject` call. - **Overlap:** open PRs objectstack-ai#33276 and objectstack-ai#33193 also touch `protocol-history-and-publish.ts`. This diff's hunks there are one import line, `runPublishSideEffects`'s write-through capture and return type, two lines in `publishMetaItem`'s advisory block, and one line in Phase 2's element loop. It uses the current `main` advisory helpers and none of their hunks. - **File surface:** `protocol.ts` (three stub return types) is outside the dispatch's file list, but inside the claim's `packages/metadata-protocol/src/**`. - **Not covered by D, left as they were:** the `object_extension` and overlay branches of `applyRegistryWriteThrough`, and the non-publish callers of the object write-through (rollback, revert, orphan adoption, remote mutation fan-out). They still log at `warn` and answer nothing. The stricter reading ("never `published` while an object does not resolve") belongs to the follow-up option A card. - **Read-only observation:** with a real `SchemaRegistry`, `judgeBatchObjectRegistrations` registers every promoted object inside `restoringOnRefusal` in Phase 1, so a refusal that repeats every time already answers `refused` truthfully. What reaches this advisory is a refusal that shows up only at Phase 2's real registration. ## Verification Final head: `2dfe890ee` (objectstack, branch `claude/area-A4-33005`). All heavy runs went through `scripts/pm/os-verify-lock.sh` (slot `a4-33005`). Exit codes were captured before any pipe. <details><summary>Package suites</summary> - `pnpm --filter @objectstack/metadata-protocol typecheck && pnpm --filter @objectstack/metadata-protocol test` at `2dfe890ee`: typecheck clean, `Test Files 339 passed | 9 skipped (348)`, `Tests 22846 passed | 43 skipped (22889)`. `tsc --listFilesOnly` includes the edited test file. - Direct dependents, with each package's dependency closure built: `@objectstack/objectql` `Test Files 595 passed (595)`, `Tests 12946 passed`; `@objectstack/rest` `Test Files 410 passed (410)`, `Tests 8370 passed | 332 skipped`. Both ran at `474253a15`; the only later commit adds one import line to a metadata-protocol test file. The other 80 downstream packages that `turbo ls --affected` lists are left to CI (`Test Core`). That set comes from the package dependency graph, so it cannot see tests that read another package's source from disk. No export of the package changed: the new symbols are not re-exported from its index. - `eslint --no-inline-config` on the five touched source and test files: exit 0. </details> <details><summary>Ablation (one-time proof, not kept as a test)</summary> The fix was committed first. `node scripts/ablation-replace.mjs` replaced `return { error: err };` in `applyObjectRegistryMutation` with `return undefined;`; the anchor went 1 to 0 and the blob changed 7f14707 to afb04eb6c844. The pin file then failed, `Tests 2 failed | 8 passed (10)`, both failures in the objectstack-ai#33005 describe. The tool restored the file: blob back to 7f14707, equal to HEAD; `git diff HEAD` empty; `git status --porcelain` empty. The test imports `./protocol.js` from source, so no rebuild was needed. </details> <details><summary>Gate families</summary> The families `node scripts/pm/dispatch-gates.mjs --commands` derives (72) were run one by one. The run at `474253a15` turned up one real finding, `check:test-source-alias`: the edited test file needed a module-top `import '@objectstack/lint'`. It was fixed in `2dfe890ee` and re-run green. At that point `check:dual-build-cjs-loads`, `check:lean-entry-closure` and `check:type-check-debt` had not been measured (missing built output or a lock wait); all three were re-run at `2dfe890ee` and exited 0. The full union is being re-run at `2dfe890ee`; the result goes in the os-dev report comment on the card. </details> 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_016WV4cw787kMeaX7oyz7DDC --------- Co-authored-by: Claude <noreply@anthropic.com>
…object, name) on the stored side, so a package-less save never lands in another object's holder (objectstack-ai#33318) <!-- claude-projects-attribution: {"github_login":"os-elon-musk"} --> _Requested by **Elon** · [project thread](https://claude.ai/code/project/chan_01WedDzV26nniwxv7jC88B9D?thread=cmsg_01WedDzV26nniwxv7jC88B9DDZYUbJbnXUTqZoZ56k4czR)_ Part of objectstack-ai#32681 Clause-②: yes (narrowing) Metadata-protocol: none ## 维护者速读 - 改了什么:`DatabaseLoader` 存一条不属于任何包、绑在某对象上的 `action` 行时,按 `(对象, 名字)` 数持有者(和内存注册表一致),不再按名字数所有包;它按槽读行时,把"名字被两个包持有、只有一个包绑了同一对象"的包外行当作那个包的定制,排在该包自己的行前面交出。 - 为什么改:席位裁决 A(2026-11-14T16:12Z):包外行按 `(对象, 名字)` 归属。之前 ALPHA 绑 `account`、BETA 绑 `contact` 时,包外的 `account` 存档写成包外行(而注册表把它当 ALPHA 的定制);只有 BETA 绑 `contact` 时,包外的 `account` 存档被写成 BETA 的 `account` 绑定(BETA 从没声明过);启动预载前后点名 ALPHA 的读答案不同。 - 风险与回滚:只影响接了 `DatabaseLoader` 的宿主(工作区内 0 处);库里已有的行不改不迁移,只改新写入落在哪一行、以及冷读怎么归属;回滚 = revert 本 PR。 - 先看:`packages/metadata/src/loaders/database-loader.ts` 的 `slottedSaveTarget`(风险 hunk:按 `storeRowSlotKey` 分槽、按包桶命名未命名行)与 `loadManySlots`;`packages/metadata/src/package-slotted-store.ts` 的 `storeRowWriteKey` 与 `pluralEntryCustomizedHolders`。 - 两分钟验证:`pnpm --filter @objectstack/metadata exec vitest run src/loaders/database-loader.test.ts -t 32681`,预期新增用例全绿。 - 需要你做的:无,席位落地。镜像形状(ALPHA 绑 `account`、包外行绑 `contact`)的启动预载修复依赖 objectstack-ai#33299 先合入,见 Acceptance notes。 ## What changes Seat ruling A on objectstack-ai#32681: a package-less action row bound to an object is keyed per `(object, name)` everywhere, as ADR-0150 D4 keys an action by `(package, objectName, name)`. - **Save** (`DatabaseLoader.save` through `slottedSaveTarget`): rows are keyed as the in-memory store keys items (`storeRowSlotKey`), and `storeRowWriteKey` counts the holders of the written body's identity (`slotIdentityOf`: an object-bound action's object and name), as `storeWriteKey` already does in memory. A package binding the name to another object is a different key, never a holder of this one. The unique-key bucket a pending object-naming acts on is still the package's (every row of the package the write's slots belong to). - **Slot read** (`DatabaseLoader.loadManySlots`, and `loadSlots`, which filters it): a package-less action row bound to an object that exactly one package binds the name to, under a name two or more packages hold, is handed on held for that package, just before that package's own row of the object (`pluralEntryCustomizedHolders`). That is where the boot priming pass files it: the unscoped plural read keeps it apart from both holders, and the pass registers it after them, so the store's `(object, name)` write rule puts it in that package's slot. Readers that keep a slot's first item (`slotStoreOf`, `list`) now answer it without the pass too. The row is not rebound: no write, its `package_id` stays empty. Every moved answer, FROM to TO (host wiring a `DatabaseLoader`; ALPHA and BETA are two packages, `approve` the action name): | Shape | Answer | FROM | TO | |:--|:--|:--|:--| | ALPHA `approve` on `account`, BETA's on `contact`; a package-less save of `approve` on `account` | the row written | a new package-less row bound to `account` | ALPHA's `account` row (its customization, D4) | | BETA's `approve` on `contact` alone; a package-less save of `approve` on `account` | the row written | a new row with `package_id` BETA bound to `account` (a binding BETA never declared) | a new package-less row bound to `account` | | ALPHA's `approve` on `account` alone; a package-less save of an object-less `approve` | the row written | a new row with `package_id` ALPHA, object-less | a new package-less object-less row | | BETA's `approve` on `contact` and a package-less row on `account`; ALPHA's first save of `approve` on `account` | the row written | a new ALPHA row beside the package-less one | the package-less row, updated and bound to ALPHA (a package's first item takes over the bare slot, as in memory) | | ALPHA's row on `account`, BETA's on `contact`, a stored package-less row on `account` (any version order) | read naming ALPHA without the boot pass (`MetadataManager.get`) | ALPHA's own row | the package-less row, as after the pass | | same | `list('action')` without the pass | ALPHA's row and the package-less row | the package-less row (ALPHA's slot), as after the pass | | same | bare read, read naming BETA, every read after the pass | `409` naming ALPHA and BETA; BETA's row; as listed | unchanged | | a package-less row on `o1`, then a package's save on `o2` | the row written | the package's save takes the `o1` row over | the package's own new row; the `o1` row keeps its column (moved objectstack-ai#32540 pin) | | ALPHA on `account`, BETA on `contact`, package-less save (A-B-save / B-save-A) | `/actions/account/approve` declaration | ALPHA's own body while ALPHA's slot holds the customization / refused `ambiguous-in-environment` (and `contact`: no declaration) | the item ALPHA's slot holds, ALPHA's handler run, in both orders | The second row is the narrowing: an address naming BETA no longer reaches an `account` binding a package-less save wrote into BETA's bucket. Not changed: types other than `action` (their identity is the name, and the slot read's new rule never fires for them); a name one package holds; stored rows (no migration: a stored package-less row is read as its holder's customization, never rebound; rows earlier saves wrote are listed by the ADR-0150 D10 report as before). ## Tests - `packages/metadata/src/loaders/database-loader.test.ts` describe `[objectstack-ai#32681]` (11 cases); the moved objectstack-ai#32540 pin in `metadata-manager-match-endpoint.test.ts`; `packages/runtime/src/action-package-addressing.test.ts` describe `[objectstack-ai#32681]` (3 cases: real ObjectQL registry, protocol over a MetadataManager from the real MetadataPlugin boot pass, DatabaseLoader over a writable `sys_metadata` double routed through the engine dispatch asserts). - BEFORE (observed with the fix reverted): A-B-save judged ALPHA's own body while ALPHA's slot read the customization; B-save-A refused the `account` route `ambiguous-in-environment` and found no `contact` declaration; the single-holder save stored a `[BETA, account]` row. ## Acceptance notes - The mirror shape (ALPHA's `approve` on `account`, a package-less row on `contact`) is not in this PR. `DatabaseLoader`'s unscoped plural read folds the package-less `contact` row into ALPHA by name, so after the boot pass a read naming ALPHA answers the `contact` row where the read without the pass answers ALPHA's `account` row. Counting per `(object, name)` there hands both rows on, but `main`'s `MetadataManager.loadMany` then pairs bodies by content and stamps neither, the pass files ALPHA's body in the bare slot, and a read naming BETA would answer ALPHA's item. That half needs objectstack-ai#33299's keyed-entry stamping first; it is not stacked here (AGENTS.md: a stacked series is not a supported form). - Single-holder cell after boot (same fold as the mirror shape, follows objectstack-ai#32680): with BETA's `approve` on `contact` alone and a package-less row on `account`, a read naming BETA after the boot pass still answers the `account` row and `/actions/contact/approve` finds no declaration — as on `main`. Carried by the follow-up on this card. - The ADR-0150 D10/R15 report's `packageLessRowOwners` (area E1) still counts holders per name, so a package-less row this PR reads as ALPHA's customization is still listed as ambiguous there. Noted for E1. - No change in `packages/metadata-protocol/src/**` or `packages/metadata/src/metadata-manager.ts`; in `database-loader.ts` only `slottedSaveTarget`, `loadManySlots`, the imports and one doc paragraph move (open PR objectstack-ai#33193 edits the history functions). ## Verification <details><summary>Local runs</summary> At c7e35e3: `@objectstack/metadata` test 77/77 files, 2325 tests; `@objectstack/objectql` 595/595 files, 12942 tests; `@objectstack/runtime` 599/599 files, 10678 passed, 19 skipped; metadata + runtime typecheck exit 0; dogfood battery 464 passed / 3 skipped files, 3927 passed / 42 skipped tests, no failures. Derived gates: 70 families, 69 exit 0, 1 NOT MEASURED (`check:dual-build-cjs-loads`, no dist in the worktree; CI Build Core covers it). Ablation (stored-side files reverted to the merge base, landing proven by grep): metadata `[objectstack-ai#32681]` 10 failed / 1 CONTROL green, the moved o1 pin red; runtime (metadata dist rebuilt, preflight `--absent` exit 0) 3 of 3 red. Restored to the HEAD blobs, tree clean. After merging `origin/main` (with objectstack-ai#33299) at 123588d, clean merge: `@objectstack/metadata` test 78/78 files, 2412 tests; typecheck exit 0. </details> --- _Generated by [Claude Code](https://claude.ai/code/session_016WV4cyrFFk86Jqf7Mp5Rzw)_ <!-- signed: domain:server#5 · os-elon-musk · session_016WV4cyrFFk86Jqf7Mp5Rzw --> --------- Co-authored-by: Claude <noreply@anthropic.com>
…ers per (object, name), so the boot pass keeps a package-less row on another object beside the holder's (objectstack-ai#33422) <!-- claude-projects-attribution: {"github_login":"os-elon-musk"} --> _Requested by **Elon** · [project thread](https://claude.ai/code/project/chan_01WedDzV26nniwxv7jC88B9D?thread=cmsg_01WedDzV26nniwxv7jC88B9DDZYUbJbnXUTqZoZ56k4czR)_ Fixes objectstack-ai#32681 Clause-②: yes (narrowing) Metadata-protocol: none ## 维护者速读 - 改了什么:动作(`action`)的无包行在非限定的复数读取(`pluralEntryKeys`,`loadMany` / `loadManyKeyed` / `DatabaseLoader` 的非限定读取共用)里,按 `(对象, 名字)` 数持有者:只有当名字唯一的持有包也把该名字绑在同一个对象上时,无包行才并入它(它的定制);绑在没人绑的对象上的无包行是环境自己的条目,单独保留。 - 为什么改:席位裁决 A(2026-11-14T16:12Z)的后一半。之前 ALPHA 把 `approve` 绑在 `account`、一条无包行绑在 `contact` 时,复数读取按名字把两行并成一条、只留最后保存的那行,启动预载后注册表只剩一个;点名 ALPHA 的读取在预载后答出 `contact` 行(ALPHA 从没声明过的绑定),而冷读答 ALPHA 自己的 `account` 行。只有 BETA 绑 `contact`、无包行在 `account` 时同理。 - 风险与回滚:只影响接了 `DatabaseLoader` 的宿主(工作区内 0 处);库里的行不改不迁移,只改复数读取保留哪些行、预载注册哪些;同一对象上的单持有者、两个包持有同名的情形不变;回滚 = revert 本 PR。 - 先看:`packages/metadata/src/package-slotted-store.ts` 的 `pluralEntryKeys`(风险 hunk:`customizes` 判定)与新 helper `entryIdentitiesOf`。 - 两分钟验证:`pnpm --filter @objectstack/metadata exec vitest run src/loaders/database-loader.test.ts -t "counts an action name"`,预期 11 个用例全绿。 - 需要你做的:无,席位落地。 ## What changes Second half of seat ruling A on objectstack-ai#32681 (ADR-0150 D4: an action is keyed by `(package, objectName, name)`). The first half (objectstack-ai#33318) keyed `DatabaseLoader`'s saves and slot reads per `(object, name)`; this one does the same for the unscoped plural read, now that objectstack-ai#33299's keyed-entry stamping is on `main`. `pluralEntryKeys` (`packages/metadata/src/package-slotted-store.ts`) is the key `MetadataManager.loadMany`, `MetadataManager.loadManyKeyed` and `DatabaseLoader`'s unscoped reads keep one entry per. For `action`, an entry that carries no package is now folded into the name's one holder only when that holder binds the name to the entry's own object (or both are object-less): the holders of the entry's `(object, name)`, counted from the row's `bundle_member` column first, else its body's object, through a new helper `entryIdentitiesOf` that `pluralEntryCustomizedHolders` now shares. Bound to an object no package binds the name to, the row is the environment's own entry and keeps a key of its own, so the boot priming pass registers it beside the holder's item and the store's `(object, name)` write rule files it in the bare slot. Every moved answer, FROM to TO (host wiring a `DatabaseLoader`; stored rows; `approve` the action name): | Shape | Answer | FROM | TO | |:--|:--|:--|:--| | ALPHA on `account`, a package-less row on `contact` | plural read (`loadMany`) | one entry, the row saved last | both | | same | registry after the boot pass | `contact` key alone (package-less saved last) / ALPHA's `account` key alone (saved first) | ALPHA's `account` key and the `contact` key | | same, package-less row saved last | read naming ALPHA after the pass | the `contact` row | ALPHA's `account` item, as without the pass | | BETA on `contact` alone, a package-less row on `account` | plural read; registry after the pass | one entry; one key | both; BETA's `contact` key and the `account` key | | same, package-less row saved last | read naming BETA after the pass | the `account` row | BETA's `contact` item, as without the pass | | ALPHA on `account` + a package-less object-less row; ALPHA object-less + a package-less row on `account` | plural read; registry; reads after the pass | one entry, one key | both, both keys, reads equal to the reads without the pass | The narrowing: after the boot pass, a read naming a package no longer reaches a package-less row bound to an object that package never bound the name to. Re-measured with objectstack-ai#33299 merged: the fold no longer loosens a read naming BETA into ALPHA's item. In the mirror shape, a read naming BETA (which holds nothing) answers the environment's `contact` row before and after the pass, in both version orders, and never ALPHA's. Not changed: a name one package holds on one object beside a package-less row on that object (one entry, the row saved last); a name two packages hold (the package-less row keeps its own entry and `pluralEntryCustomizedHolders` names the holder it customizes, as in objectstack-ai#33318); the `/actions/OBJECT/NAME` route's declaration read (see Acceptance notes); types other than `action`; stored rows (no migration). ## Tests - `packages/metadata/src/loaders/database-loader.test.ts`, describe `[objectstack-ai#32681] the plural read counts an action name's holders per (object, name)…` (11 cases): four moved shapes in both version orders (plural read entries, cold reads, registry keys after the real `MetadataPlugin` boot pass, reads after the pass equal to the cold reads, no row updated); CONTROL one package on one object (both orders: one entry, the one saved last, its key); CONTROL two packages on one object (three entries, bare read refused naming both and the environment, before and after the pass). - Moved pin: `[objectstack-ai#32791]` "a package's row bound to an object and an object-less package-less row saved last" — the registry now holds ALPHA's `account` key beside the bare slot (FROM the bare slot alone); the bare reads are unchanged. - `packages/runtime/src/action-package-addressing.test.ts`, describe `[objectstack-ai#32681] /actions/account/approve…` (4 new cases): mirror shape and single-holder cell, both save orders, over the writable `sys_metadata` double, the real `MetadataPlugin` boot pass and the protocol: registry holds both keys, a read naming the holder answers its own item, and the package-less row's route judges that item and runs the environment's handler. ## Acceptance notes - The holder's own route (`/actions/account/approve` in the mirror shape, `/actions/contact/approve` in the single-holder cell) still judges no declaration, before and after this change alike (measured both ways, the metadata fix ablated and rebuilt): its declaration read is the protocol's execution face (`getMetaItemForExecution`), which beside one package holder answers the environment's item on the other object (`judgeBareActionRead` keeps main's answer on that face); the route then sees another object's action. That face is in `packages/metadata-protocol` (area E1), where objectstack-ai#32551 records it as followed up by its owner seat; filed as objectstack-ai#33456 (lease:E1). The route of the package-less row's object judges and runs that one item (pinned). - On the same route the environment's item is served with the holder's `_packageId` and `_provenance: 'package'` (the protocol's artifact envelope lookup goes by name, not `(object, name)`); the route's own `packageId` is unset and the environment's handler runs. Measured in the runtime harness, also area E1, carried by objectstack-ai#33456. - With one package holding the name on one object and a package-less row on that same object, the read naming the package without the pass answers the package's own row, while after the pass it answers the package-less row when that row was saved last (saved first, the pass registers the package's row alone). That fold (one entry per `(package, name)`, the row saved last) is unchanged here and pinned as a CONTROL. - No change in `packages/metadata-protocol/src/**`, `packages/metadata/src/metadata-manager.ts` or `packages/metadata/src/loaders/database-loader.ts`. ## Verification <details><summary>Local runs</summary> At 8efae7e (after merging `origin/main` with objectstack-ai#33193): `@objectstack/metadata` test 78/78 files, 2423 tests; `@objectstack/objectql` 595/595 files, 12978 tests; `@objectstack/runtime` 599/599 files, 10707 passed, 19 skipped; metadata and runtime typecheck exit 0; eslint on the three changed source/test files exit 0; dogfood battery 466 passed / 3 skipped files, 3944 passed / 42 skipped tests. Derived gates: 59 families, 58 exit 0, 1 NOT MEASURED (`check:dual-build-cjs-loads`, no full dist in the worktree; CI Build Core covers it); `dispatch-gates --ran` reconciles 59/59. Ablation (the `customizes` line mutated back to the by-name fold through `ablation-replace.mjs`, metadata rebuilt, `ablation-dist-preflight --absent` exit 0): metadata 8 moved cases red, every CONTROL and the first half's 11 cases green; runtime 4 of 4 new cases red (registry held one key). Route answers in that state equal the fixed state's (holder's route: no declaration; package-less row's route: that item, environment's handler). Restored to the HEAD blob (`git diff HEAD` empty), metadata rebuilt, fix marker back in `dist/`. </details> --- _Generated by [Claude Code](https://claude.ai/code/session_016WV4cyrFFk86Jqf7Mp5Rzw)_ <!-- signed: domain:server#5 · os-elon-musk · session_016WV4cyrFFk86Jqf7Mp5Rzw --> --------- Co-authored-by: Claude <noreply@anthropic.com>
…clare a connector of the same name (ADR-0150 child B, the narrowing) (objectstack-ai#33431) domain:server#7 · os-tesla · session_01L9qibzKCovWpJoMZD6U3NT <!-- claude-projects-attribution: {"github_login":"os-tesla"} --> _Requested by **Tesla** · [project thread](https://claude.ai/code/project/chan_01AXsQkLFKRdQCqQ3RTr6Jao?thread=cmsg_01AXsQkLFKRdQCqQ3RTr6Jao3aDjoEUznHeGMZJaoMEKa5)_ Fixes objectstack-ai#31699 Clause-②: yes (narrowing) Metadata-protocol: added ## 维护者速读 - 改了什么:连接器(objectstack-ai#31699 的最后一个类型)把「一个名字一个包」收窄到「一个命名空间一个」。两个不同命名空间的包可以各自声明同名连接器,各自物化、连接、派发。 - 怎么做到的:connector 加入 core / objectql / metadata 三个命名空间类型集合;协调器拆掉一持有者兜底,物化器的各个表和 OAuth 授权句柄按 (包, 名) 建键;引擎对每个调用方(包括无包的调用方)都问解析器,解析到的持有者没有实例时回答 `none`,只有插件代码注册的连接器例外;拉取按映射所在的包解析连接器;带命名空间地址的连接门(`/automation/connectors/:ns/:name/connection`)连接该命名空间那个包的实例。 - 仍然拒绝:同一命名空间的共有者、没有命名空间的包与他包同名、一个包内重名、两个持有者下没有自己包戳的条目(点名两个持有者,谁都不物化)。没有包作用域注册表的组合仍然一个名字一个实例。 - 答复变化:changeset 的 Clause-② 列了十条 FROM → TO,标为 BREAKING。单持有者部署只变三处:3b 的回退分支(解析到的包没有实例时不再用名字的唯一实例,插件代码注册的除外)、只有停用包持有的名字(停用包以外的调用方不再派发;停用包自己的流程照旧读自己的实例)、无包戳条目换持有者后到下次协调之间不派发。凭据列表、重载合并、惰性描述符审计在单持有者下都与 main 相同。 - 与交接清单的偏差:交接 6871869590 写的是裸连接门和 `GET /connectors` 加 `?package=`。本 PR 用已有的命名空间地址代替第二种写法,`GET /connectors` 不加过滤,每个描述符带 `packageId`。认领修订 6882996364 事先说明了这一点。 - 先看:`packages/services/service-automation/src/engine.ts`(`resolveConnectorInstanceFor`)、`src/plugin.ts`(协调器的期望集合与 `judgedByPackage`、`connectionDoorSubject`)、`src/connector-pull.ts`(第 2 步)、`packages/runtime/src/domains/automation.ts`(准入块)。 ## What changes - **Type sets.** `connector` joins `NAMESPACE_SCOPED_BARE_NAME_TYPES` (core), `PACKAGE_SCOPED_READ_TYPES` (objectql) and `PACKAGE_SLOTTED_STORE_TYPES` (metadata). Every covered type has now narrowed. - **Reconcile** (`plugin.ts`): - The backstop is gone (`refusedDeclaredConnectorNames`, and `refusedConnectorNames` in `connector-package-scope.ts`). - Each entry is the instance of its own package. An entry with no package of its own is the instance of the package its name resolves to over every holder. Under two holders it is refused naming both and materialized as neither (`connectorInstanceRefusal`). - `desired`, the materialized, degraded and credential-refusal maps, retry, dematerialize and `grantHandles` are keyed by instance (`connectorInstanceKey`: `name`, or `PACKAGE/NAME`). - A name repeated within one package is a duplicate naming the package. A composition with no package-scoped registry keeps one instance per name (`judgedByPackage`, red line 1). - A reloaded artifact (objectstack-ai#7742) supersedes the registry's entries by `(package, name)`: an unstamped artifact item is stamped with its manifest id at capture, so a reload of one package leaves the other package's instance of the name live. With no manifest id, or no package-scoped registry, it supersedes by name, as before. - An OAuth2 grant handle reads its instance's fixed package. The inert-descriptor audit judges each entry by the instance a caller of its package would be served. Instance log lines name the package. - **Dispatch** (`engine.ts`, `resolveConnectorInstanceFor`): - Every caller asks the resolver over the served holders, a caller with no package included, so a two-holder name is refused naming both rather than answered `none`. - A resolved holder with no instance answers `none`, unless the name has a connector a plugin registers in code (package `null`, origin `plugin`), which is served as before. That keeps a package's catalog descriptor plus a plugin's connector working. - A name only disabled packages hold answers the same way (notes 6816295828 and 6820178514). - `getConnectorDescriptors` sets `packageId`. - **Pull** (`connector-pull.ts`): the mapping's connector is resolved from the mapping's holder package through the registry's optional `resolveConnectorInstanceFor`, and its origin, degraded state, provider (`materializedProviderOf`), action and `inputSchema` are read from that instance. New reason `connector_name_refused` (409). - **Connection door**: `ConnectorConnectionRequest.package` (spec, optional). The runtime admits a namespace address of a two-holder connector name to the addressed holder (`admitAutomationAddress` answers a slot, as for a flow) and passes the package. The bare door keeps its 409. - **Credential listing**: each declaring entry is matched to its own instance's state, by the instance's package (an environment row or a compatibility entry is its holder's instance); the reported `packageId` is the entry's stamp, as on main. - **objectstack-ai#33218 review N6**: judged, not restamped. A row a moved declaration left stamped with its old package is that package's own again once it declares the name beside the new holder. Pinned. - **Docs**: `content/docs/automation/connectors.mdx` gains "Two packages, one connector name" and two failure-mode rows. The objectql, core and metadata module docs say the connector narrowed. ## Verification - New pins: - `connector-connection-door.test.ts` (7): both instances materialize; the bare door 409 and the addressed begin, read and revoke per package, each with its own row and token; revoke one, the other keeps serving; an unowned entry under two holders refused; a duplicate within a package; the no-registry CONTROL; N6. - `flow-package-scoped-resolution.test.ts`: the narrowing `none` pin (FROM the fallback arm); the plugin catalog CONTROL; the disabled holder in both registration orders (A's caller never served B's or A's instance; a caller with no package served B; CONTROL both enabled) and a lone disabled holder; the null caller refused naming both; the no-registry CONTROL. - `connector-pull.test.ts` (4) and `connector-pull-service-door.test.ts` (1): each package's mapping pulls its own instance; the provider read per instance; holder with no instance is `connector_not_registered`; an environment mapping over two holders is `409 connector_name_refused`. - `connector-materialization.test.ts`: two holders of different namespaces both materialize (FROM the boot refused); a reload of one holder's artifact leaves the other's instance live; the credential listing reports each of two instances' states, and a `sys_metadata` or `__runtime__` entry over a one-holder name reads the holder's state. - `connector-connection-door.test.ts` (review round): a disabled holder at the bare door and at its own namespace address (404, nothing written), both orders; a revoked instance is held degraded; the unstamped entry's handle reads its fixed package. - `flow-package-scoped-resolution.test.ts` (review round): a caller inside the disabled package reads its own instance (both orders, and alone); two catalog holders beside a plugin connector (each package served the plugin's, the null caller refused naming both). - `connector-pull.test.ts` (review round): one of two holders disabled, the environment's mapping pulls through the served holder. - `connector-descriptor-audit.test.ts`: a package's catalog entry is not silenced by another package's live instance of its name. - runtime `automation-addressed-route.test.ts`: each namespace address reads its own package's instance (FROM 409). - `marketplace-install-local-bare-name-conflict.test.ts`: the refusal case is now a same-namespace co-owner; a cross-namespace connector install is admitted (FROM 422). - Updated pins: the one-holder type-set pins in core, objectql and metadata; the CLI stored-references report (no sealed clash left). - Ablations A1 to A14 (`scripts/ablation-replace.mjs`, each restored with an empty `git diff HEAD`), each red on its pins: the fallback arm back (3), the disabled branch off (1), the null caller not asking the resolver (8), no plugin instance (1), the unowned entry not refused (1), no registry judged (6), grant handles by name (5), the pull by bare name (4), the door ignoring the package (3), the provider by name (1), no connector slot at the runtime address (1); the reload merge by bare name (1, A12); the credential listing by stamp (1, A13); the inert audit by name (1, A14). Record: `server-seat-7/r2026-11-14/31699-narrow-ablations.txt`. - Full suites before the rebase: service-automation 3923, core 3480, objectql 12967, metadata 2479, metadata-protocol 22848 (43 skipped), cloud-connection 1207. After the rebase on `df9fe946`: service-automation 3941, runtime 12060 (19 skipped), core 3480, objectql 12976, metadata 2479, metadata-protocol 22848 (43 skipped), cloud-connection 1210, CLI stored-references 13. All passed. Rebased again on `4ace1fa9` over objectstack-ai#33193 (head `1530146d`): metadata 2490, metadata-protocol 22865 (43 skipped), service-automation 3941, runtime 12074 (19 skipped), spec 28422 (1 todo), spec `check:generated` green. - Gates: `tsc --noEmit` (service-automation, runtime), ESLint on every changed file, tenant-audit, system-context, route-ledger and engine-double censuses, changeset no-major / empty / fixed, doc-authoring, doc-anchors, spec `check:generated` (its test-typecheck leg needs a larger Node heap here: `NODE_OPTIONS=--max-old-space-size=12288`; then OK, no debt moved). `dispatch-gates --ran`: 124 derived families accounted for, 122 run green, 2 NOT-MEASURED for prerequisites this checkout lacks and the diff does not touch: `check:dual-build-cjs-loads` (no `studio` / `embedder-openai` dist) and the `check-plugin-teardown-shape` self-test (shallow clone). `check:dts-closure` was red once in the sweep and green when re-run alone (311/311 declaration files present). ## Contract review An isolated contract reviewer read the card, ADR-0150, the handoff and the diff with no anchor on mine. - r1 on `4a9d32b9`: PASS-WITH-CHANGES. Two must-fix items: M1, the credential listing lost an environment row's state; M2, a reload of one package's artifact tore down the other package's instance. Five should-fix items (S1 to S5) and four nits. - Every item was taken: fixed in code (M1, M2, the nits), or declared in the changeset and docs with FROM and TO (S1 to S4), with pins for S5. The ablations were extended to A12 to A14. - delta-1 on `de90aedb`: PASS. Three notes; I acted on all three: no-registry reloads supersede by name as on main, a changeset clause, and a `__runtime__` pin. - delta-2 on `510a8400`: PASS. - delta-3 on `e467615b`, the rebase over objectstack-ai#33193: PASS. `connector` joins `PACKAGE_SLOTTED_METADATA_TYPES` (`@objectstack/spec`), the one list the history and rollback doors and the metadata store read; the changeset says what moves on those doors. The brief, the r1 record and the delta record are posted as comments on this PR. ## Human Minimum - [x] 1. Schemas start as Zod; `packages/spec` holds no runtime logic. (Two optional members on TypeScript interfaces; no schema.) - [x] 2. Every name I added uses the casing for its kind. - [x] 3. No formatter ran; `pnpm lint` passes on the changed files. - [x] 4. One issue, one branch off an up-to-date `main`, one pull request. - [x] 5. A change that publishes carries a changeset, and both declaration lines are filled in here and in the changeset. - [x] 6. `packages/spec` touched: `check:generated` is green for its artifacts. - [x] 7. No hand edits to `content/docs/references/`, `packages/*/CHANGELOG.md` or `content/docs/releases/`. - [x] 8. Title, body and comments are in English. - [x] The *Before Submitting* list in CONTRIBUTING.md is done. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01L9qibzKCovWpJoMZD6U3NT --------- Co-authored-by: Claude <noreply@anthropic.com>
epic:#31527#3 · os-tesla · session_01L9qibvyhxPWfA8DsbmVYJ5
Requested by Tesla · project thread
Fixes #32905
Clause-②: yes (narrowing)
Metadata-protocol: added
Skills-docs: none — no skill under
skills/names the history or rollback door, and the docs that do (content/docs/api/metadata-api.mdx,content/docs/kernel/contracts/metadata-service.mdx,content/docs/plugins/adding-a-metadata-type.mdx,content/docs/permissions/system-context.mdx) list the routes without teaching how a name two packages hold is addressed, so no sentence there turns false; the generated API reference (content/docs/references/api/protocol.mdx) carries the newpackageIdfield.Levels follow the metadata protocol alone (maintainer ruling A, 2026-10-21):
minorfor@objectstack/spec, the one package that carries the added protocol surface (HistoryMetaItemRequestSchema.packageId, the authorable-surface entryapi/HistoryMetaItemRequest:packageId, the newRollbackMetaItemRequestSchemathat declares the rollback door's request with itspackageIdand atoVersionof at least 1, andPACKAGE_SLOTTED_METADATA_TYPES/isPackageSlottedMetaType, the one list of types stored per package that the doors and the console both read), and the levelCheck Changesetdemands forMetadata-protocol: added. Every other package ispatchunder the BREAKING banner above:@objectstack/metadata-protocol(historyMetaItemandRollbackMetaItemRequesttakepackageId),@objectstack/rest(both doors accept?package=; the rollback door readstoVersionthrough its declaration),@objectstack/metadata(new exportshistoryRowAttribution,ENVIRONMENT_HISTORY_MARK;PACKAGE_SLOTTED_STORE_TYPESis now built from the spec list, same members),@object-ui/data-objectstack(history()/rollback()takepackageId),@objectstack/metadata-core(a field description only) and@object-ui/app-shell(no exported signature changes:HistoryPanelandStudioItemToolsare not exported, andMetadataResourceHistoryPagekeeps its props).维护者速读
?package=只读、只回滚那一家的版本。非按包存储的类型带?package=返回 400。控制台的 History 工具会带上条目页的包。packages/metadata-protocol/src/protocol-history-slots.ts(判定规则)和 dogfood 测试history-rollback-two-holders.dogfood.test.ts。pnpm --filter @objectstack/dogfood exec vitest run --maxWorkers=1 test/history-rollback-two-holders.dogfood.test.ts,11 条全绿。What changed
The rule (
historySlotOf, newprotocol-history-slots.ts), for a type stored per(package, name)(PACKAGE_SLOTTED_STORE_TYPES), is the oneDatabaseLoaderalready keeps forMetadataManager.getHistory/rollback:?package=): refused409 RESOURCE_CONFLICTwherever the bare plain read refuses the name, before any row is read or written: a name whose active rows are held by two or more row slots (two packages', or a package's beside the package-less row;ambiguous-in-environment,details.candidatesnaming every holder), a name one row holds while a second package ships it in code, and a name two packages ship with no stored row (the registry'sresolveItem, the resolver the plain read asks, throws the read's own refusal, ADR-0150 D5). One slot or none: answers exactly as onmain, its whole log, and a bare rollback restores any of its versions with no ownership check (so a name saved package-less and later taken over by a package still rolls back to its environment versions, the M1 case).?package=P(the/layers?package=spelling): the slot of the row a read namingPserves (findServedOverlayRowwithservedOverride: P's own row, its.custompair's declared override of P, or the package-less row that read falls back to), else P's own slot when P ships the name. A package that neither holds nor ships the name is refused409not-held-by-qualifierwhile another slot holds it; with no row stored, a rollback naming a package that is not installed is refused422 WRITABLE_PACKAGE_REQUIRED(theuninstalledNamedBaseRefusala save gets) instead of minting a slot.404 VERSION_NOT_FOUNDsaying whose it is ("Nothing was restored.").?package=stays refused400as onmain, nowVALIDATION_ERROR(param: package) saying why, on both doors before either door's early answers; never accepted and dropped.Attribution.
SysMetadataRepository(the/metadoors' store) now writessys_metadata_history.package_idfor by-package types, asDatabaseLoaderdoes (sys_metadata= the package-less row).@objectstack/metadataexports that rule ashistoryRowAttribution/ENVIRONMENT_HISTORY_MARKso both writers read one rule.Doors.
GET /meta/:type/:name/historyandPOST /meta/:type/:name/rollbackdeclarepackagein their closed query sets (META_ITEM_HISTORY_PARAMS,META_ITEM_ROLLBACK_PARAMS), refuse it repeated, foldall/empty to no package (metaItemPackageBinding), and render the refusal withdetails.candidates(packageScopedCandidates, as the plain read does). The rollback door's request is now declared in spec (RollbackMetaItemRequestSchema,toVersiona whole number of at least 1), besideHistoryMetaItemRequestSchema.packageId, and the door readstoVersion(body,versionalias and query) through that declaration in place of the undeclared whole-number parse, so the published contract and the door spell a version one way.Console.
MetadataClient.history()/rollback()takepackageId(sent as?package=); the History tool sends its item page's?package=(routed page), the edit page's history sheet sendsownerPackageId(the package its layered read uses), and Studio's item tools send thepackageIdits Layers read already uses — each only for a type stored per package.HistoryPanelasksisPackageSlottedMetaType(@objectstack/spec/api) before naming the package, so an object, view or page opened under a package reads and restores its history bare, as onmain(round 4, record 6878813627 M1: the doors refuse?package=400on those types). The by-package type list lives once in spec,PACKAGE_SLOTTED_METADATA_TYPES;@objectstack/metadata'sPACKAGE_SLOTTED_STORE_TYPESis built from it, andprotocol-history-slots.test.tsholds the doors' refusal and the console's predicate to the same list.Measurement (before the fix)
Posted on the card: 6867256997. On a booted showcase with two
AppPluginpackages each holding flowqa_hist_shared: bare history 200 interleaving both holders' versions;?package=400 (not supported); bare rollback{toVersion: 2}(beta's) 200 and wrote beta's body into alpha's row — a silent pick. Seat regrade: stays p2 (triage 6867291698).After the fix (same boot,
history-rollback-two-holders.dogfood.test.ts)GET …/history, two holdersPOST …/rollback, two holdersGET …/history?package=alpha.customPOST …/rollback?package=alpha.customto beta's versionPOST …/rollback?package=alpha.customto an unattributed versionPOST …/rollback?package=alpha.customto its own version?package=com.qa.hist32905.alpha(the base)?package=a stranger packagenot-held-by-qualifier?package=onview(not stored per package), both doorsVALIDATION_ERROR, saying the type is not stored per package (r1 of this PR had accepted and dropped it)rollback?package=an uninstalled packageWRITABLE_PACKAGE_REQUIRED;?package=the installed pair restores (200)?package=history lists and restores the environment v2Red lines
/layersand every other door are untouched; the new refusals only narrow.CONTROL: a name one package holds keeps its whole log and its bare rollback, as before(dogfood), CONTROL — no package, 'all' and the empty string send no 'packageId' (REST), CONTROL: no 'packageId' sends no 'package' key on either door (client) and CONTROL: no '?package=' sends no 'packageId' on either door (console) hold the one-holder and bare spellings unchanged;rest-server-meta-member-selector.test.tsstays green with only its measured-set pin takingpackage.the bare history of the two-holder name is refused 409 naming both holders,the bare rollback of the two-holder name is refused 409 naming both, and neither holder's row changes,?package= restores only that holder's row; the other holder's version and an unattributed one are refused, writing nothing,a package that holds nothing of the name is refused naming the holders(dogfood); the protocol's two-holder refusal is a 409 naming every holder in 'details.candidates' (REST). An unattributed legacy version is never assigned to a holder while two hold the name. Round 2 adds, at the dogfood boot,a name two packages ship, only one customized, is refused bare at both doors, as the bare plain read refuses it,?package= on a type not stored per package is refused 400 at both doors, never accepted and dropped,a rollback naming no installed package, of a name no row holds, is refused and stores nothing; an installed holder restoresandCONTROL (M1): a name the environment saved and a package took over restores the environment's versions, bare and addressed, as before; inprotocol-history-slots.test.ts(13 cases) each arm ofhistorySlotOfalone, both F5 arms (P ships the name / does not, the read falls back to the package-less row: the environment's slot); and in the REST file, through the real protocol, the400on aviewat both doors. Round 3 addsa name two packages ship and neither customized, no row stored, is refused bare at both doors…(dogfood) andRollbackMetaItemRequestSchema declares what the rollback door enforces(spec:0,-1,1.5,'2',truerefused;1with every optional member preserved).package_idalready existed), no dependency on another child's branch; the bare one-holder behaviour is unchanged so it ships alone.Ablations
Each leg mutated one source line with
scripts/ablation-replace.mjs(anchor must hit once; blob change proved; restore to HEAD proved), rebuilt@objectstack/metadata-protocol, proved the mutation live indist/withscripts/ablation-dist-preflight.mjs(exit 0, tree clean), and ranhistory-rollback-two-holders.dogfood.test.ts. L1, L2 and L5 ran on r1 and their anchors are unchanged; L3 and L4 were re-anchored onto the rewrittenisVersionOf(L3b, L4b) and re-run on this head with L6–L10. After the last leg the rebuild was proved clean:ablation-dist-preflight … __ablate32905 --absentexit 0 (22 built files), tree clean, and the file is 11/11 green.historySlotOfwhen no package is namedthe bare history of the two-holder name is refused 409 naming both holders:expected 200 to be 409(also the base-package case's bare-409 line)historySlotOfwhen no package is namedthe bare rollback … neither holder's row changes:{"success":true,…"restoredFromVersion":1} expected 200 to be 409; the cascade reddens the two?package=cases (the bare write grew alpha's log:expected [ 1, 3, 6 ] to have a length of 2)isVersionOfaccepts another holder's attributed version?package= reads that holder's versions alone…:expected [ 1, 2, 3, 4 ] to have a length of 2 but got 4;?package= restores only that holder's row…:expected 200 to be 404; also the base-package caseisVersionOfaccepts an unattributed version under two holders?package= reads…:expected [ 1, 3, 5 ] to have a length of 2 but got 3;?package= restores…:expected 200 to be 404; also the stranger-package casenot-held-by-qualifierrefusal disableda package that holds nothing of the name is refused naming the holders:{"events":[]} expected 200 to be 409a name two packages ship, only one customized, is refused bare at both doors…: bare historyexpected 200 to be 409?package=on a type not stored per package let through (F4)?package= on a type not stored per package is refused 400 at both doors…:{"events":[]} expected 200 to be 400a rollback naming no installed package, of a name no row holds, is refused…:expected 404 to be 422CONTROL (M1) … restores the environment's versions, bare and addressed:expected [ 4, 5 ] to include 2CONTROL (M1) …: bare rollback to the environment v1expected 404 to be 200HistoryPanelnames the package for every type again (addressedPackage = packageId)a type not stored per package reads and restores bare under ?package=…(history called withpackageId), Studio'sdataandinterfacespillars (object,pagehistory withpackageId), and Studio's object rollbackRollbackMetaItemRequestSchema.toVersionloosened back toz.number()(spec rebuilt, marker proved inpackages/spec/dist)rest-server-query-number-census.test.ts, 8 of 35 red:body { toVersion: 1.5 },0,-1, theversionalias1.5/0, and?toVersion="1.5"/"0"/"-1"now reach the protocol instead of answering400— the door reads the declarationVerification
Round 4, on head
248bc6bec(after one more merge oforigin/main), each command run with</dev/nulland its exit code landed on disk first:dispatch-gates --commands: 123 commands, all exit 0;dispatch-gates --ran: 123 derived, 123 run, 0 NOT-MEASURED.pnpm lint: exit 0.@objectstack/metadata-protocol,rest,spec,dogfoodexit 0;rest check:test-typecheckexit 0;@object-ui/data-objectstackand@object-ui/app-shelltype-checkexit 0 (after building their dependency closure).data-objectstack120 files / 1386 passed; app-shell item-tools, Studio item-tools and ResourceEditPage 65 files / 312 passed.check:generated(spec): exit 0 after--fixregeneratedapi-surfaceandexport-originsfor the two new exports.Acceptance notes
com.qa.hist.{alpha,beta}.customeachPUT /meta/flow/qa_hist_runtime?package=<pair>(nooverrides) made the bareGET /meta/flow/qa_hist_runtimeanswer 200 with alpha.custom's flow when measured; metadata-protocol: a name held only by stored rows of two enabled packages answers the bare read by save order while /layers refuses 409 (ADR-0150 D3) #32607 (closed by PR fix(metadata-protocol)!: a name two or more enabled packages hold only as stored rows, and no package ships, is refused by the read naming no package instead of served by save order (ADR-0150 D3) #33182, merged 2026-11-14) makes that read refuse 409. This PR's history and rollback doors refuse that name bare either way (they judge the row slots).GET /meta/:type/:name/diff?from=&to=still reads the name's versions across holders (measured: diffs alpha's v1 against beta's v2; it writes nothing), and@objectstack/client'sgetHistory(the SDK) sends no package; the console usesdata-objectstack's client. Filed as metadata-protocol: the history diff door compares two package holders' versions of one name as if they were one item's (ADR-0150 D4, after #32905) #33308 (the diff door) and client: meta.getHistory, rollbackItem and diffItem cannot name a package, so a two-holder item's history is unreachable through the SDK (ADR-0150 D3, after #32905) #33310 (the SDK). Other package-scoped types not stored per(package, name)(page, dashboard, …) are not addressed by ADR-0150 D3 here and their history door answers as before.action): the bare doors judge an action name by its row slots and the registry'sresolveItemonly, not by the bare read's own action judges (refuseAmbiguousObjectLessAction,judgeBareActionRead). Measured on the objectql: narrow the phase-1 one-holder refusal from environment to namespace for action (ADR-0150 child B, action family) #31697 artifact boot (two packages shippingqa_shared_digestobject-less andqa_shared_boundeach on its own object, no stored row): bare read409, bare history200 {"events":[]}, bare rollback404 VERSION_NOT_FOUND(nothing restored). The changeset says so. Filed as metadata-protocol: bare history and rollback of an action two packages ship answer 200 empty and 404 where the bare read answers 409 (ADR-0150 D4, after #32905) #33311.HistoryPanelthreads nomembertoday (pre-existing); unchanged.packages/rest/src/rest-server.ts(the two closed query sets live there, route rule 5);packages/spec/src/api/protocol.zod.tsplus its generatedauthorable-surface/api.jsonandcontent/docs/references/api/protocol.mdx(HistoryMetaItemRequestis the protocol's request type);packages/metadata-core/src/objects/sys-metadata-history.object.ts(doc ofpackage_idonly);ui/…/StudioItemTools.tsxandResourceEditPage.tsx(one prop each: the History tool's other two mounts), andStudioDesignSurface.itemTools-28239.test.tsx(its history/rollback call pins now carry thepackageIdits Layers pin already did).meta-item-history-routes.ts— 5865708652 (letter B, three sites), 5856774816 (three sites), ruling record 6787890900 (two sites), maintainer ruling 2026-08-22 option B;rest-server-meta-member-selector.test.ts— 6116165299 (Q2 i, closed sets). No ruling line is edited or removed by this diff (git diffofruling|maintainer|⛔lines: two added⛔comments, none removed).Generated by Claude Code
🤖 Generated with Claude Code
https://claude.ai/code/session_01L9qibvyhxPWfA8DsbmVYJ5