Skip to content

fix(metadata-protocol)!: a stored row bound to a package that holds none of its name, or a pair row of a two-holder name, is no longer laid into the first-registered holder's registry slot (ADR-0150 D4) - #33166

Merged
objectstack-fleet[bot] merged 10 commits into
mainfrom
claude/project-thread-y6vjs1
Nov 14, 2026

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by Tesla · project thread
Part of #32692

Clause-②: no (narrowing)
Metadata-protocol: none
Skills-docs: none — skills/** and content/docs/** teach no stored row bound to a package that holds none of its name, and no pair row of a two-holder name; the prescription ships in the ADR-0087 entry and the changeset's FROM → TO.

BREAKING (narrowing, patch on @objectstack/metadata-protocol and @objectstack/objectql, ADR-0087 entry stored-row-of-a-non-holder-under-two-holders registered): with two or more packages holding a name, a holder's registry item stops answering another package's stored row as its own.

维护者速读

  • 改了什么:两个包 A、B 都发布同名条目(tool、webhook、connector 等 14 类密封类型)。环境里有一条存储行绑定在第三个包 S 上(S 根本不持有这个名字),或者绑定在某个持有者的 .custom 结对包上。以前读侧回填按"先注册的那个持有者"给它套外壳,于是 A(或者换个注册顺序就是 B)把这条行当成自己的答出来。现在:S 的行一律不进任何持有者的槽位,由启动普查 metadata_sealed_overlay_unserved 报出;结对行按 overlayRowBinding 判定它定制的那个持有者(停用的也算),判不出归属就不注册。
  • 为什么改:专题 design(metadata): address behavioural metadata by package — key flows, actions, jobs and other non-object types by (package, name); re-open ADR-0028 (replaces #30806 phase 3 renames) #31527 红线 2(歧义要报,不能猜成某个持有者的);metadata-protocol: the boot hydration binds a stored webhook row of a name two packages hold by registration or load order; key its artifact lookup by (package, name) (ADR-0150 D3/D4) #32692 的第一半。webhook 派发、执行列表直接读 registry,会用错正文(例如 A 的事件发到 S 行的 URL)。
  • 不变:只有一个持有者的名字;行服务类型(dashboard、report、email_template 等 9 类);permission(存储的权限集分叉另有维护者裁决,这里保持原样,见下方问题);flow。
  • 遗留(不在本 PR):两条行各绑一个持有者时仍是最后读到的覆盖(registry 每个名字只有一个裸槽位,归 ADR-0150 专题线的按包槽位卡);第二个持有者安装前已注册的副本不会被收回(S1)。
  • 风险与回滚:仓内第一方组合没有这种形状,答案不变。只动内存 registry 槽位,不改任何键、值或存储形状。回滚即 revert。
  • 先看:packages/metadata-protocol/src/protocol-registry-hydration.ts(judgesRowHolder、namesNoHolderAmongMany、pairRowEnvelopeHolder,以及 hydrateOverlayIntoRegistry 里的两处调用);packages/objectql/src/webhook-stored-row-boot-hydration.test.ts 的 #32692 段。
  • 待维护者回答:两个持有者下,绑定在不持有该名字的包上的 permission 存储行,现在仍落在先注册持有者的槽位(与注册顺序有关)。拒绝它会改变部署实际执行的授权,所以本 PR 没碰;是否另开卡处理,请定夺。

What changes

hydrateOverlayIntoRegistry (the boot load, an unscoped list read, the write-through of a save) builds a registry entry from each stored sys_metadata row. For a row whose package holds no item of the name, the artifact lookup scoped to that package falls back to the package registered FIRST, so the row wore that holder's envelope and took its slot.

For the types judgesRowHolder names (every package-scoped type except flow, permission and the row-served types: action, hook, job, webhook, connector, sharing_rule, queue, assignment_rule, analytics_cube, picklist, api, tool, skill, agent):

A name one package holds keeps every reading.

Why

ADR-0150 D4: a stored row binds to the (package, name) it customizes; red line 2: ambiguity is reported, never guessed. Measured on main before the change (step 0, #31699 comment 6857806396): the stray row landed in the first-registered holder's slot, a different slot in each order.

Verification

  • packages/objectql/src/webhook-stored-row-boot-hydration.test.ts: 32 tests, each order of registration. Ablated from scratch builds, each rule turns its own pins red: the stray decline (4), the pair envelope (5), the null-binding decline (2), the every-holder binding (2), the one-holder guard (1), the permission exemption (2), the row-served exemption (2). BASE (84c66d36's hydrator) fails 9 of the then 25.
  • Full suites: @objectstack/metadata-protocol 22803 passed, @objectstack/objectql 12908 passed. A local tsc is not meaningful in this container (dependencies built without declarations); CI typechecks.
  • Gates: check:adr-0087-registration, check:empty-changeset, check:changeset-fixed, packages/spec migrations (198), packages/cli migrate-meta-engine-guidance (3).

Red-line read

Run in this thread by a separate review pass (maintainer's instruction: 「你自己有fable,自己审就可以了吧?」). Round 1 FAIL (three must-fix: the null-binding pair arm registered the row, the envelope moved with a disable, the prescribed .custom migration is excluded for 13 of the 14 types); round 2 PASS on 7ae13371, with four notes, all taken in a63814ee (the row-served exemption pinned with an email_template shape, the sealed-table pin, the permission CONTROL renamed as pending a ruling, the 409 sentence narrowed).

Human Minimum

  • 1. Schemas start as Zod; packages/spec holds no runtime logic.
  • 2. Every name I added uses the casing for its kind.
  • 3. No formatter ran; pnpm lint passes.
  • 4. One issue, one branch off an up-to-date main, one pull request.
  • 5. A change that publishes carries a changeset, and both declaration lines are filled in here and in the changeset.
  • 6. packages/spec touched: its generated artifacts are regenerated and committed.
  • 7. No hand edits to content/docs/references/, packages/*/CHANGELOG.md or content/docs/releases/.
  • 8. Title, body and comments are in English.
  • The Before Submitting list in CONTRIBUTING.md is done.

🤖 Generated with Claude Code

https://claude.ai/code/session_01L9qibzKCovWpJoMZD6U3NT

…tem of a two-holder name is declined, never grafted onto the first holder

Claude-Session: https://claude.ai/code/session_01L9qibzKCovWpJoMZD6U3NT
Co-authored-by: Claude <noreply@anthropic.com>
…-y6vjs1

# Conflicts:
#	packages/metadata-protocol/src/protocol-registry-hydration.ts
…le addition keeps its row), run after the borrowed-envelope rule, report once and not for a sealed row

Claude-Session: https://claude.ai/code/session_01L9qibzKCovWpJoMZD6U3NT
Co-authored-by: Claude <noreply@anthropic.com>
…nvelope of the holder it customizes, not the first-registered holder's

The artifact lookup scoped to a pair id that holds no item of the name fell
back to the package registered first, so a row of the second holder's pair
was served as the first holder's item in one registration order. The
envelope now comes from the holder overlayRowBinding binds the row to, or
none when it binds to none. The stray-row warning prescribes the declared
override in the holder's .custom pair.

Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L9qibzKCovWpJoMZD6U3NT
…pgrade-guide entry

Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L9qibzKCovWpJoMZD6U3NT
…udge the pair envelope over every holder, keep permission and row-served types as they were

A pair row of a name one package holds keeps its lookup. The envelope is
read from overlayRowBinding with disabled holders counted, so a disable
never moves it. The stray-row warning is removed: every type the decline
reaches is sealed, and the boot census names the row. The changeset now
ships patch (Metadata-protocol: none), prescribes deletion for the sealed
types and the .custom override for action alone, and names the two carries.

Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L9qibzKCovWpJoMZD6U3NT
…nsus relies on, and name the permission pick as pending a ruling

Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L9qibzKCovWpJoMZD6U3NT
@github-actions github-actions Bot added size/m documentation Improvements or additions to documentation tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 13, 2026
@github-actions

github-actions Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 3 package(s): @objectstack/metadata-protocol, @objectstack/objectql, @objectstack/spec, touching 13 documentable anchor(s).

5 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:

  • content/docs/concepts/metadata-lifecycle.mdx (via SchemaRegistry (symbol, a top-level class))
  • content/docs/deployment/environment-variables.mdx (via SchemaRegistry (symbol, a top-level class))
  • content/docs/kernel/services-checklist.mdx (via SchemaRegistry (symbol, a top-level class))
  • content/docs/plugins/adding-a-metadata-type.mdx (via SchemaRegistry (symbol, a top-level class))
  • content/docs/protocol/kernel/plugin-spec.mdx (via SchemaRegistry (symbol, a top-level class))

⛔ 1 release-owned page(s) also name something this change touched. These are read-only:

  • content/docs/releases/v17/17-4.mdx (via SchemaRegistry (symbol, a top-level class))

content/docs/releases/ is RELEASE-OWNED (AGENTS.md "Documentation Guardrails"): release
notes are written centrally at release time, and a code PR that edits them is the exact PR
that guardrail exists to stop. They are still audited — read-only. If one of them is actually
wrong, file an issue or open a dedicated docs-only PR; do not edit it here.

What this run could not see
  • 3 name(s) were too generic to anchor anything (single lowercase words)
  • the SDK route bridge reached 65 of 247 client-bound route-ledger rows — the other 182 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 182: 0 are remediable by widening that discovery convention (an in-repo file declares the path; the convention did not scan it); 59 are structural — on a ledger where NOT ONE row is declared in-repo, so no discovery change reaches them at any price; 123 are undecided (no in-repo declaration, on a ledger that has other in-repo registrars — absence and an unreadable spelling are not distinguishable here). The rows themselves: node scripts/docs-audit/affected-docs.mjs --bridge-coverage
  • a page that states a rule by its inputs shares no identifier with the emitter that implements the rule, so an emitter-only diff cannot list it — not on this run and not on any run. Measured on fix(driver-sql): emit varchar(maxLength) for a text field a declared index keys on #11430: content/docs/protocol/objectql/types.mdx documents the text-family column mapping by the ObjectQL type names it maps FROM (text / textarea / html) while the diff changed createColumn; it went unlisted, and it was the page that diff falsified, in four places. No shared token exists to detect this on, so a rule your change carries has to be re-read by hand in the pages that restate it.
  • a key NAME is not a key, so the hand re-read the line above prescribes can land on the wrong schema. The same spelling is authorable on one governed type and a [REMOVED] tombstone on another for each of active, aria, joins, objects, template, tools and version (censused on [finding] tools is a key on BOTH AgentSchema (tombstoned, dead) and SkillSchema (live, cloud-attested), so a name-based search attributes skill examples to the agent key — it produced a false stop-the-line alarm on PR #19059 #19093 over the liveness ledger's governed types, top-level keys); nothing in a search result distinguishes the two, so a grep hit on a LIVE example reads as evidence about the DEAD key. Measured on fix(spec): the agent.tools liveness row says dead — it claimed live on a key the schema tombstoned #19059: content/docs/ai/agents.mdx was reported as contradicting the agent.tools tombstone over its tools: example at :161, which is inside the defineSkill({ block opened at :155 — the page was already correct. Settle ownership by PARSING the value against both schemas, never by the name: that literal PASSES SkillSchema, and as an AgentSchema it FAILS at tools with the tombstone prescription. ⛔ These names are not the whole class — a key retired through a .strict() guidance map leaves no tombstone in the walked shape and none of them here (tool.category, live as AIToolDefinition.category).

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

Which tree this was computed on

This run read content/docs from caf5a39a5007a1159f6ab9f3be325e6f992ab3ec — the merge of head 4571f2464692d9e37e4a41f81cf97651a365b91d into base 5e250a65992192bdc9b3fb3be304a2fca245b2d1, which is what actions/checkout gives a pull_request run. Not the PR head.

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

# while this PR is open — GitHub drops the merge commit once it closes
git fetch origin caf5a39a5007a1159f6ab9f3be325e6f992ab3ec && git checkout caf5a39a5007a1159f6ab9f3be325e6f992ab3ec
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 5e250a65992192bdc9b3fb3be304a2fca245b2d1 4571f2464692d9e37e4a41f81cf97651a365b91d && git checkout -B drift-repro 5e250a65992192bdc9b3fb3be304a2fca245b2d1 && git merge --no-ff 4571f2464692d9e37e4a41f81cf97651a365b91d

node scripts/docs-audit/affected-docs.mjs --json 5e250a65992192bdc9b3fb3be304a2fca245b2d1

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

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

…stalledPackageSource, and the pin file's string lists

The dts build refused both helpers with TS2559 (a weak type sharing no
member with InstalledPackageSource); the test layer's typecheck refused an
implicit any and a narrowed type literal.

Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L9qibzKCovWpJoMZD6U3NT
…econd findOne double

Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L9qibzKCovWpJoMZD6U3NT
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:server#7 · os-tesla · session_01L9qibzKCovWpJoMZD6U3NT

Posted 2026-11-14T00:26Z. Red-line read run in the card thread on the maintainer's instruction, rounds 1 to 3 by a separate review pass.

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 4571f2464692d9e37e4a41f81cf97651a365b91d
Local-runs: probe — the narrowing is an answer that moves with registration order and holder state, so it was judged by running the read-side hydrator from scratch builds (BASE at 84c66d36 against each head, both orders, plus ablations), never in the worktree
Scope: packages/metadata-protocol/src/protocol-registry-hydration.ts, packages/metadata-protocol/src/protocol-package-bindings.ts, packages/objectql/src/registry.ts, packages/objectql/src/webhook-stored-row-boot-hydration.test.ts, packages/spec/src/migrations/entries/semantic/18.stored-row-of-a-non-holder-under-two-holders.ts, .changeset/32692-stored-row-names-no-holder.md, .changeset/32692-stored-row-upgrade-guide-entry.md, scripts/engine-double-contract.pinned.json + packages/metadata-protocol/src/protocol-artifact-lookup.ts, packages/metadata-protocol/src/protocol-write-gates.ts, packages/metadata-protocol/src/protocol-lock-state.ts, packages/metadata-protocol/src/protocol-diff-delete-load.ts, packages/metadata-protocol/src/protocol-meta-list-reads.ts, packages/metadata-core/src/customization-pair-lookup.ts, packages/core/src/package-scoped-resolution.ts, packages/core/src/security/security-catalog.ts, packages/spec/src/kernel/customization-package.ts, packages/spec/src/kernel/metadata-plugin.zod.ts, packages/plugins/plugin-webhooks/src/declared-webhooks.ts, docs/adr/0150-behavioural-metadata-addressed-by-package-objects-keep-the-literal-prefix.md

① Derived judgments

  • The change does what it declares. For the 14 judged types (action, hook, job, webhook, connector, sharing_rule, queue, assignment_rule, analytics_cube, picklist, api, tool, skill, agent), a stored row bound to a package holding none of a two-holder name lands in no holder's slot, in either registration order. A pair row wears the envelope of the holder overlayRowBinding binds it to, and one that binds to none is declined.
  • Nothing refused is now served. Round 2 compared 300 snapshots over tool, action, dashboard, permission and webhook against BASE: 222 identical, and every moved answer went from a first-registered holder's guess to the bound holder or to the shipped item.
  • The "Not changed" list is true. Every one-holder, dashboard and permission scenario is identical to BASE.
  • A disable does not move the envelope. The binding is read over every holder, so a disabled holder's pair row keeps its envelope and _lock and stays out of registry.listItems while disabled.
  • The migration is admissible. All 14 types read allowEnvironmentOverlay: false or are absent from the type registry, so delete-only is the right prescription; action is the one type OVERRIDE_TYPE_CLASSIFICATION makes overridable and it alone gets the .custom route.
  • The pins discriminate. 32 of 32 pass at this head. Each rule's ablation turns its own pins red, the row-served exemption included (2 red with the exemption dropped).
  • The round-3 delta changes no runtime behaviour. 6437503f re-types two helper parameters and adds a type-only import: the transpiled output of protocol-registry-hydration.ts is byte-identical before and after (same sha256). The two string[] annotations are in the test file. 4571f246 moves one ledger row to 2, and the pin file holds exactly two findOne doubles.

② Semver level

patch on @objectstack/metadata-protocol and @objectstack/objectql with Metadata-protocol: none is right. Nothing a metadata author can write changes, so by the AGENTS.md definition the kind is none, and a breaking non-protocol change ships patch with its BREAKING banner and ADR-0087 marker, both present. check-adr-0087-registration reads the changeset as declared-breaking with a registered disposition. patch on @objectstack/spec for the semantic entry is right: it adds no key and no export.

One nit: SchemaRegistry#overlayRowBinding gains an optional includeDisabledPackages. It is additive, its default is unchanged, and the hydrator is its only caller, so it does not lift the level. The changeset names it.

③ Boundary flags

  • Carried, declared in the changeset. Two rows bound to two different holders still last-win in the name's one bare slot. A copy registered before a second holder installs is not taken back, and the next unscoped hydration can still lay it into the first holder's slot until a restart. Both belong to the per-package overlay slot on the ADR-0150 epic line.
  • Permission is exempt pending a ruling. A stray permission row under two holders keeps the first-registered holder's slot, an order-dependent pick. The pin's title says so. The maintainer's answer on a stored permission fork under two holders is still owed.
  • Harness. The probes and pins run a real SchemaRegistry and protocol over an engine double with no metadata service. Exact-read answers are that harness's.
  • Not driven. The save and delete doors were read through the spec's classification table, not exercised.
  • Not re-run by this review. CI at this head and the dogfood battery at 6437503f are the implementer's report; this review ran the pin file and two gates only.

④ Design judgment

The narrowing makes the spec's own rule real instead of taking a capability away. ADR-0150 D4 binds an overlay to the (package, name) it customizes; the hydrator's artifact lookup fell back to the first-registered holder, so one stored row was served as a different holder's item in each registration order. What goes away is that guess. A holder's own item, a row bound to a holder, and a one-holder name all keep their answers.

Against the three red lines: resolution does not loosen (no refused answer became served); ambiguity is not guessed (a row that names no holder is declined and the boot census names it); the PR is independently releasable (one-holder behaviour unchanged, no migration to run, declarations and ADR-0087 entry present).

Findings by round:

  • Round 1, FAIL. Three must-fix: a null-bound pair row was registered, which served a previously refused read and broke both holders' exact reads for a row-served type; the envelope moved with a disable; the prescribed migration was a save the platform excludes for 14 of 15 types. Four should-fix: the take-back carry was undeclared, permission needed a ruling, the warning was unpinned, and three changeset declarations were untrue.
  • Round 2, PASS. All three must-fix closed and measured. One should-fix (pin the row-served exemption), one question (permission), two notes (a half-true sentence about the 409, no guard on the sealed-type assumption). All four were taken in a63814ee: the exemption pin goes red under its ablation, the sentence is split, the sealed-table pin exists, and the permission pin names itself as pending.
  • Round 3, PASS. Types and one ledger row only; no runtime change.

Open at this head: no must-fix, no should-fix. One nit (the optional parameter, above).

Implemented-by: claude/project-thread-y6vjs1
Reviewed-by: session_01L9qibzKCovWpJoMZD6U3NT

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:server#7 · os-tesla · session_01L9qibzuZJBQY4wUQFJbkfx

维护者速读 · PR #33166 @ 4571f246 · 2026-11-14T00:26Z

  • 改了什么:如果一个名字同时有两个或更多包持有,而某条存储行绑定的包并不持有这个名字,这条行不再被塞进「先注册的那个持有包」的注册表槽位。成对的定制行只算作它绑定的那个持有包的,一个都绑不上就不收。涉及 14 种行为类元数据(action、hook、webhook、connector 等),依据 ADR-0150 D4。
  • 为什么改:以前这类行落到哪个包名下,取决于包的注册顺序,同一份数据换个启动顺序就换了归属(metadata-protocol: the boot hydration binds a stored webhook row of a name two packages hold by registration or load order; key its artifact lookup by (package, name) (ADR-0150 D3/D4) #32692,objectql: narrow the phase-1 one-holder refusal from environment to namespace for webhook, connector and email_template (ADR-0150 child B, webhook family) #31699 的子卡)。
  • 权限与边界:收窄。原来被拒的读取没有一个变成可读。只有一个持有包的场景、dashboard、permission,答案都与改动前逐个相同。
  • 风险与回滚:这是 BREAKING 变更,已登记 ADR-0087 条目 stored-row-of-a-non-holder-under-two-holders。迁移方式是删除这些行;只有 action 可以走 .custom 覆盖路线。回滚就是 revert。
  • 先看:protocol-registry-hydration.ts 的 judgesRowHolder、namesNoHolderAmongMany、pairRowEnvelopeHolder。
  • 需要你做的:permission 的游离行还留在先注册的持有包槽位上,这一点等你裁决。卡线程推荐 A:照永久 permission 分叉裁决保持不动,因为拒收会在启动时改变已生效的授权。现在的行为与改动前相同,所以不挡这次落地。
  • 席位意见:落地。红线复核按你 22:59Z 的指示由卡线程自行用 Fable 进行:首轮 FAIL(三项必须修),第二轮 PASS,第三轮的增量只是改类型标注和台账,转译输出逐字节相同,PASS。CI 全绿,没有碰受管面,改动 479 行。

席位核对

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 14, 2026 00:27
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 14, 2026
Merged via the queue into main with commit 16e3486 Nov 14, 2026
68 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/project-thread-y6vjs1 branch November 14, 2026 00:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants