Skip to content

fix(objectql): judge an authored action artifact-shipped by each holder's owner key, not by bare name - #33271

Merged
objectstack-fleet[bot] merged 5 commits into
mainfrom
claude/area-E2b-32990
Nov 14, 2026
Merged

objectstack-fleet[bot] merged 5 commits into
mainfrom
claude/area-E2b-32990

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by Elon · project thread
Fixes #32990

Clause-②: yes (widening)
Metadata-protocol: none

维护者速读

  • 改了什么:启动后的宿主上,ObjectQLPlugin 绑定环境自写的脚本 action 时,原来只要有任何代码包发布了同名 action 就跳过;现在逐个读每个持有者的同名 action,按它所属的对象判断:只有某个包的同名 action 拥有该行所在对象(或该 action 不绑定对象)时才跳过。声明式 .custom override 也按自己对象上的那个包匹配,不再按名字取第一个包。
  • 为什么改:两个包在 account、contact 上各有 approve,环境在 lead 上自写 approve 时,fix(runtime): the bare action route serves the environment's own action on an object no holder of a refused name binds #32987 已让 /actions/lead/approve 服务环境自己的声明,但它的脚本体从未被绑定,调用答 not found。
  • 风险与回滚:只改 resync 的跳过判断;同对象上的环境行仍是持有者的定制(不绑定,持有者的 handler 照跑);不绑定对象的包 action 仍覆盖所有对象;停用的持有者仍占住其对象。新增的绑定都在环境坐标(metadata-service)上,不进入任何包的坐标。不改存储、schema、spec。回滚即 revert。
  • 先看:packages/objectql/src/plugin.ts(isArtifactShippedAction、新的 artifactActionsNamed、isDeclaredArtifactActionOverride 中 artifacts.find 一行)。
  • 两分钟验证:pnpm --filter @objectstack/objectql exec vitest run src/plugin-authored-actions.test.ts -t 32990,预期 6 条全部通过。
  • 需要你做的:无,席位落地。

What changes

ObjectQLPlugin.resyncAuthoredActions binds runtime-authored script actions through the engine's default action runner, and skips a row a code package ships (the app plugin binds that package's handler under app:PACKAGE). The skip, isArtifactShippedAction, asked registry.getArtifactItem('action', NAME): any code package's artifact of the bare name, on any object, skipped the row.

  • isArtifactShippedAction now reads every code package's artifact of the name (artifactActionsNamed) and judges each by the object it owns, with the router's own predicate standaloneActionOwnsRoute: the row is artifact-shipped when an artifact owns the row's object, an object-less artifact owning every object. The embedded-in-a-packaged-object branch is unchanged.
  • artifactActionsNamed (new, private): the registry's first match by bare name (what one holder always answered) plus each holder's own artifact (packageScopedHoldersOf('action', NAME, null, { includeDisabledPackages: true }), then getArtifactItem prefer-local per holder), deduplicated. Disabled packages count: a reversible disable never moves a binding.
  • isDeclaredArtifactActionOverride: the base is the artifact on the row's own object among every holder's, not the first artifact by name. With one holder the answer is the same; with two, a declared override of the holder registered second is now recognised.
  • action-handler-coordinate.ts: one docblock sentence follows the new judgement. No code change there.

No change to packages/runtime, packages/metadata-protocol, packages/objectql/src/registry.ts or packages/spec.

FROM → TO

Composition: package A ships a script action approve on its object, package B one of the same name on its own, and the environment stores its own package-less script action approve on a third object. Readings are the engine dispatch on a booted kernel (ObjectKernel + ObjectQLPlugin, its kernel:ready resync).

# Case FROM (main e540baf8) TO Clause-② arm
1 two holders (A, B), environment row on an object neither binds, both registration orders dispatch there answers Action 'approve' on object 'OBJECT' not found the environment's body runs; A's and B's run on their own objects, unqualified and package-qualified widening
2 one holder (A), environment row on another object not found the environment's body runs; A's runs on its own widening
3 B.custom declared override of B's action, A registered first override not bound, B's body runs the override's body runs over B's handler widening
4 the same, B registered first the override's body runs unchanged none

Unchanged, pinned as CONTROLs: a package-less row on an object a holder's action owns stays that holder's customization (the holder's body runs), both orders; an object-less package action keeps a row on any other object unbound; a DISABLED holder registered after another still owns its object.

Row 2 is the one-holder case of the same defect: the declaration the route serves there is unchanged (the environment's own item, as action-package-addressing.test.ts #32365 case 1 pins for the plain read), and what moves is that its body now has a handler. Named here so the seat can confirm it reads within the epic's "one-holder behaviour unchanged" red line (resolution untouched; the dispatch gains a handler).

Tests

packages/objectql/src/plugin-authored-actions.test.ts: a new top-level describe [#32990] …, on a booted kernel (the file is this resync's harness). It boots ObjectKernel with ObjectQLPlugin, a row-store driver double and a test plugin standing in for the runtime's AppPlugin (installs the default action runner, registers each package through the manifest service during the cold boot and binds its handler under app:PACKAGE). Six cases: rows 1, 2 and 3/4 above (both registration orders where order matters), and the three CONTROLs.

Premise measured on the unmodified source (the pins committed first, d2848f11): case 1 answered Action 'approve' on object 'env_lead' not found; the override case answered ran beta with A registered first.

Ablations (each through scripts/ablation-replace.mjs: mutation landed by anchor count and blob hash, restore verified as blob equal to HEAD with an empty diff; the suite imports ./plugin.js from source, so no rebuild is involved):

Five ablations, each red
  1. the judgement by bare name (artifactActionsNamed(name).length > 0): 2 failed (two holders; one holder).
  2. the per-holder artifact check never matches (some(() => false)): 2 failed (the disabled-holder and the object-less CONTROLs).
  3. owner-key equality in place of standaloneActionOwnsRoute: 1 failed (the object-less CONTROL).
  4. the override's base read as the first artifact (artifacts[0]): 1 failed (the override of the second holder).
  5. nothing artifact-shipped (return false before both branches): 3 failed (the three CONTROLs, the same-object customization among them; that CONTROL is also held by the embedded-object branch, which is why ablation 2 leaves it green).

A first attempt at ablation 5 used a replacement that contained its own anchor; ablation-replace refused it (anchor count 1 to 1) and restored, so it ran nothing; it was re-run with a different anchor.

Acceptance notes

  • ObjectQL's arrivesAsDeclaredBase (packages/objectql/src/engine-actions.ts) reads getArtifactItem('action', NAME) by bare name the same way when a declared base's handler arrives under an armed override. Not measured, not changed here; noted for the seat.
  • isArtifactShippedHook stays name-only; ADR-0150 D4 names it as gaining the package, a separate card.
  • First-party count: no first-party composition has two packages holding one action name beside an environment script action of that name.

Verification

Head at open: ab806df2. Local readings so far: the dependency closure built (pnpm --filter '@objectstack/objectql^...' build, lock VERDICT command-exit 0); vitest run src/plugin-authored-actions.test.ts src/action-activation.test.ts: Test Files 2 passed (2), Tests 50 passed (50). The package's full test, its typecheck and the derived gate families follow in the os-dev-report comment on #32990; CI: see the check runs.

🤖 Generated with Claude Code

…gement per holder on a booted kernel

Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016WV4cyWLSMyXZGc6dwhCAu
…er's owner key, not by bare name

Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016WV4cyWLSMyXZGc6dwhCAu
@github-actions

github-actions Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 1 package(s): @objectstack/objectql, touching 6 documentable anchor(s). ⚠️ 1 changed file(s) yielded no anchor (packages/objectql/src/action-handler-coordinate.ts), so the pages documenting them are NOT COVERED by this run — this is not a clean bill of health for those files.

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

  • content/docs/data-modeling/objects.mdx (via ObjectQLPlugin (symbol, a top-level class))
  • content/docs/kernel/services-checklist.mdx (via ObjectQLPlugin (symbol, a top-level class))
  • content/docs/kernel/services.mdx (via ObjectQLPlugin (symbol, a top-level class))
  • content/docs/permissions/authentication.mdx (via ObjectQLPlugin (symbol, a top-level class))
  • content/docs/plugins/packages.mdx (via ObjectQLPlugin (symbol, a top-level class))
  • content/docs/protocol/kernel/index.mdx (via ObjectQLPlugin (symbol, a top-level class))

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

  • content/docs/releases/v17/17-0.mdx (via ObjectQLPlugin (symbol, a top-level class))
  • content/docs/releases/v17/17-1.mdx (via ObjectQLPlugin (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
  • 1 changed file(s) yielded no anchor (packages/objectql/src/action-handler-coordinate.ts) — pages documenting those are invisible to this run
  • 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 — 21 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 24f2f4014d0c9bbd43ec6928942fa44b21c1dff6 → packageMentionDocs.

Which tree this was computed on

This run read content/docs from 699b186e50e529a73081207e5a948d63fe60838f — the merge of head efef4782e2d3383e25e732b74136739929681d0e into base 24f2f4014d0c9bbd43ec6928942fa44b21c1dff6, 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 699b186e50e529a73081207e5a948d63fe60838f && git checkout 699b186e50e529a73081207e5a948d63fe60838f
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 24f2f4014d0c9bbd43ec6928942fa44b21c1dff6 efef4782e2d3383e25e732b74136739929681d0e && git checkout -B drift-repro 24f2f4014d0c9bbd43ec6928942fa44b21c1dff6 && git merge --no-ff efef4782e2d3383e25e732b74136739929681d0e

node scripts/docs-audit/affected-docs.mjs --json 24f2f4014d0c9bbd43ec6928942fa44b21c1dff6

⚠️ 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 24f2f4014d0c9bbd43ec6928942fa44b21c1dff6 → pass the list as
args.docs, on the commit named under Which tree this was computed on.

@github-actions github-actions Bot added 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 14, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

Contract-review-claim: session_016WV4d1PGptBW3QRQNmy5e6 · head ab806df · 2026-11-14T15:25:21Z

review#3 (area-lease pilot #33059).

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

Contract review

Served-tier: TIER_DEFAULT
Head-sha: ab806df240348e20541288f4a5b4d803d7304563
Local-runs: none

① Derived judgments

  • isArtifactShippedAction now skips an authored row only when some holder's artifact owns the row's object (standaloneActionOwnsRoute: same owner key, or an object-less artifact). Checked the edge the table does not list: an object-less environment row (owner key global) beside a holder's artifact on account is now bound under metadata-service; dispatch at /actions/account/approve still probes account first (the holder's handler), and only objects no holder owns fall through to the environment's global handler (actionHandlerObjectKeys). Correct under D4.
  • artifactActionsNamed: the bare-name first match plus each holder's own artifact (packageScopedHoldersOf(..., { includeDisabledPackages: true })), deduplicated by identity. Disabled holders keep their object. Matches the stated rule.
  • should-fix S1 — the override base is still picked by list order when two artifacts share the row's owner key. isDeclaredArtifactActionOverride takes artifacts.find((a) => standaloneActionOwnerKey(a) === objectKey). For two holders whose approve is object-less (both key global), find returns the first by registration/bare-name order, so a declared B.custom override of B's object-less action is judged against A (isServedOverrideRowOf(row, A, installed) → false) and stays unbound, B's body runs. That is row 3's defect in the object-less shape. Fix (small, fold here): among artifacts at the row's owner key, take the one whose _packageId equals action.overrides?.package when given; with several and no package named, do not pick (return false and say so once). Add a pin with two object-less holders in both registration orders.
  • Row 2 (one holder, environment row on another object: not found → the environment's body runs): resolution and the declaration the route serves are unchanged (#32365 case 1); only the missing handler is added. I read it as within the epic's "one-holder behaviour unchanged" red line (a dispatch that failed now runs the declared item); seat may confirm.
  • action-handler-coordinate.ts: docblock only, matches the code.

② Semver level

@objectstack/objectql: patch; Clause-②: yes (widening) is right (dispatches that answered not-found now run the declared body; no refusal added, no export/schema moves). Metadata-protocol: none holds.

③ Boundary flags

  • Author login objectstack-fleet[bot] (relay); area E2b. Hot shared file packages/objectql/src/plugin.ts (A4/E2b/E1 per amendment 6): confirm no other open PR edits isArtifactShippedAction / isDeclaredArtifactActionOverride before landing.
  • CI not complete when read; the ACCEPT re-reads every check at the landing head.

Implemented-by: claude/area-E2b-32990
Reviewed-by: session_016WV4d1PGptBW3QRQNmy5e6

VERDICT: FAIL

S1 (≤30 lines + pin) → delta review by review#3.

…mes among holders at its owner key

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

Copy link
Copy Markdown
Contributor Author

Contract-review-claim: session_016WV4d1PGptBW3QRQNmy5e6 · head efef478 · 2026-11-14T16:56:44Z

review#3.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

Contract review

Served-tier: TIER_DEFAULT
Head-sha: efef4782e2d3383e25e732b74136739929681d0e
Local-runs: none

Delta over my FAIL at ab806df240348e20541288f4a5b4d803d7304563 (comment 6879713494). The diff ab806df2...efef4782 has two commits and touches packages/objectql/src/plugin.ts and plugin-authored-actions.test.ts.

① Derived judgments

  • S1 fixed. isDeclaredArtifactActionOverride no longer takes artifacts.find(...) by list order. Among the artifacts at the row's owner key, it takes the one whose _packageId is the row's overrides.package. A lone holder at the key is taken as before, so one-holder behaviour is unchanged. With several holders and none named, it picks no base: the row is bound as no override, and a once-per-process warn names the holders and the fix ("name the base package in the row's overrides.package"). That matches the ADR-0150 red line "ambiguity reported, never guessed".
  • Pin. Two object-less holders (both keyed global), a declared override of B, in both registration orders: B runs the override and A runs its own body. Before the fix, the "B then A" order is the case that bound against the wrong base.
  • Test double. The booted-kernel row-store find now honours ast.limit, so the double no longer answers more rows than the caller bounded. That is a test-only change and it tightens fidelity.
  • A row naming a package that is not among several holders at its key gets no base and is reported. A row naming a package other than a lone holder is judged by isServedOverrideRowOf against that holder, as before.

② Semver level

Unchanged from the first record: @objectstack/objectql: patch, Clause-②: yes (widening). The new no-base outcome only arises with several holders at one key, which the first record already treated as the per-holder widening.

③ Boundary flags

  • CI at this head when read (16:58Z): 33 success, 16 skipped, 1 in progress, none red. The ACCEPT re-reads every check at the landing head.

Implemented-by: claude/area-E2b-32990
Reviewed-by: session_016WV4d1PGptBW3QRQNmy5e6

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:server#5 · os-elon-musk · session_016WV4cyWLSMyXZGc6dwhCAu
ACCEPT · area E2b (area-lease pilot #33059) · 2026-11-14T17:01Z

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 14, 2026 17:01
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 14, 2026
Merged via the queue into main with commit 5e29b7e Nov 14, 2026
52 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/area-E2b-32990 branch November 14, 2026 17:40
scbdzhwl pushed a commit to scbdzhwl/objectstack-analysis that referenced this pull request Nov 16, 2026
…es in that package's own registry slot, so each address serves its own row in every order (ADR-0150 D3/D4) (objectstack-ai#33513)

<!-- 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#33127 (its main case and the per-package overlay slot; the card
stays open for its unpinned heal items: Heal 1, Heal 2 and S1)
Fixes objectstack-ai#32900
Fixes objectstack-ai#32663
Fixes objectstack-ai#32662
Refs objectstack-ai#32692

Clause-②: yes (narrowing)
Metadata-protocol: semantic
Skills-docs: none — `skills/**` and `content/docs/**` teach no reading
of a name two packages each store a row of (grepped `?package=`,
`.custom`, `409`: the hits are the pair's save door, a flow's secret
refusal and a permission grant), so no taught sentence moves; the read
naming no package keeps its `409` and its `?package=` remedy.

## 维护者速读

- 改了什么:注册表以前对"绑定到某个包的存储行"每个名字只留一个裸槽位,最后加载的行占住它;现在每一行进它自己包的覆盖槽位(`.custom`
配对包的行按配对规则归到它的基础包),不覆盖代码工件的条目。于是每个包的精确地址、注册表条目、配对地址都返回自己的那一行,不随保存顺序、加载顺序或重启变化。
- 为什么改:两个包同名时,一个包的 `?package=`
返回出厂项而它自己的存储行没人读(objectstack-ai#33127);写入方和对端副本的注册表条目只剩最后写的那一行(objectstack-ai#32663);配对地址重启前
404、重启后一个 200 一个 409(objectstack-ai#32662);模块的 de-DE 语言成员跟着行顺序走(objectstack-ai#32900)。
- 风险与回滚:唯一收窄:两个包只以存储行持有的同名 action,不点名包的读取重启后以前返回最后加载的那一行,现在和其它类型一样 409
点名两个包。回滚即还原本 PR,存储数据不变形。dashboard 仍按名字收敛(objectstack-ai#32663 残留 (a) 待裁决),未改。
- 先看:`packages/objectql/src/registry.ts` 的 `registerItem`(新
`storedRowPackage` 选项与槽位键)、`overlaySlotBinding` 末尾新分支、`isBundleAddition`
的 `codeMembersOf`;再看 `protocol-registry-hydration.ts` 的
`takesPackageOverlaySlot` 与 `restoreArtifactRegistryView` 的槽位清理。
- 两分钟验证:`pnpm --filter @objectstack/objectql exec vitest run --project
local src/webhook-stored-row-boot-hydration.test.ts
src/protocol-cluster-signal-package.test.ts -t
"33127|32663|32900"`,两种注册顺序、两种行顺序全部通过。
- 需要你做的:契约复审档记录(`Clause-②: yes (narrowing)`,受管面),然后席位落地。

## What changes

`SchemaRegistry` kept ONE bare slot per name for a stored row
(`registerItem` with no package), so the row saved or hydrated last took
it, beside the code artifact's composite `pkg:name` entry. Every symptom
in this set is that one slot.

**The slot model (`packages/objectql/src/registry.ts`).**
- `registerItem(type, item, keyField, packageId?, options?)` takes
`options.storedRowPackage`. Without a `packageId`, a row with a
stored-row package registers under a package overlay slot key, `MARK +
package + MARK + bareKey`, with `MARK` the NUL character written as an
escape in source. It never overwrites the bare key or a composite entry.
- `bareSlotEntriesOf` reads those slots after the bare entries, so every
reader that judged the bare slot (`overlaySlotBinding`,
`packageScopedHoldersOf`, `getPackageScopedItem`, `boundServedActions`,
`unregisterItem`) sees each row once, bound by the same rule as before.
- `rankedForPackage` orders a package's bound rows as the stored-row
read serves them: its pair's declared override, its own row, the
package-less row, any other.
- `orderedOverlayTier` orders the overlay tier of `getItem` by holder
(the caller's package first, then composite order, then id), so
`getItem` no longer follows row order.
- `overlaySlotBinding`: a `BASE.custom` row whose base holds the name
only as its own stored row binds to the base, never becoming a second
holder. That is the case one bare slot never held both rows of.
- `isBundleAddition(…, codeMembersOf)`: a bundle member that two
packages hold only as stored rows is no clash. One bare slot used to
hold one of the two rows, so the base held the name in either order
(`protocol-bundle-member-base-address.test.ts` pins that answer, and it
went red without this). A member either package ships in code still
clashes.
- `removePackageOverlaySlots(type, name, member, select)` is new and
public. It drops the selected packages' slots, for the delete's heal.

**Hydration
(`packages/metadata-protocol/src/protocol-registry-hydration.ts`).**
- `hydrateOverlayIntoRegistry` passes `storedRowPackage` for a row bound
to a package of a type in `PACKAGE_SLOTTED_STORE_TYPES`, less `flow` and
`permission`, which keep their own slot rules
(`takesPackageOverlaySlot`).
- Such a row records no sole-holder envelope. Its slot is its package's
own.
- `restoreArtifactRegistryView` retires the removed package's slot. Tier
1's bare-entry drop runs only when no slot was retired, and a heal with
an unknown binding drops the slots of packages with no remaining row.

**Reads (`packages/metadata-protocol`).**
- `admitExactQualifier(…, { storedRowBases })`: a pair address of a name
its bases hold only as stored rows is admitted at the base whose row is
stored. Two such bases are refused naming both, as two registry bases
are.
- `readMetaItem` asks for it and reads that base's content.
- `storedRowHoldersRefusal` serves the read naming no package at the one
holder whose rows are its own and its pair's (objectstack-ai#32662 scope note b). It
used to fall through to the first-stored row.

**Moved answers (FROM `main` d4fbb4d → TO), per door:**

| Door | FROM | TO |
|---|---|---|
| `GET /meta/TYPE/NAME?package=ID`, two shippers each with a stored row
(tool, webhook, agent, skill), after a restart | own row only for the
holder hydrated last; the other its shipped item | each holder its own
row |
| `getPackageScopedItem`, writer and peer, after alpha then beta saved
(action, tool, email_template) | `[null, beta]` (mirror in the other
order) | `[alpha, beta]` |
| `GET /meta/TYPE/NAME?package=ID.custom`, name held only as stored rows
(dashboard, tool, action), before a restart | 404 for both | its base's
row |
| same, after a restart | 200 for the row hydrated last, 409 naming one
side for the other | its base's row |
| `GET /meta/TYPE/NAME` (and `/published`), a package's row beside its
own pair's undeclared row | plain: the pair's row when it was saved
first | the package's own row, both orders |
| `GET /meta/action/NAME`, two packages hold it only as stored rows,
after a restart | 200 the row hydrated last | **409 `RESOURCE_CONFLICT`
naming both** (the narrowing) |
| `getPackageScopedItem('email_template', welcome, X, 'de-DE')`, X's
pair row beside a package-less de-DE row | the row hydrated last | X's
pair row, both orders |
| `getPackageScopedItem('action', …)`, both shippers with a declared
override (objectstack-ai#33131's carried face) | the last-saved holder's override; the
other its shipped action | each holder its own override |

ADR-0087: the semantic entry `stored-row-own-package-slot`
(`packages/spec/src/migrations/entries/semantic/18.stored-row-own-package-slot.ts`),
marker `adr-0087: registered stored-row-own-package-slot` in
`.changeset/33127-stored-row-own-package-slot.md`.

## Tests

Head `8d85d2b1af`. Pins, each in every registration, save and row order,
with CONTROLs (one holder, one row, a package-less row: unchanged). Each
pin went in as a top-level `describe` in the file that already holds its
harness.

- `packages/objectql/src/webhook-stored-row-boot-hydration.test.ts`:
- `[objectstack-ai#33127]` covers tool, webhook, agent and skill: both holders ship
the name, each stores a row. It checks the registry slot, the exact
read, and that the read naming no package answers `409
RESOURCE_CONFLICT` naming both.
  - `[objectstack-ai#32900]` checks X's de-DE slot in both row orders.
- `packages/objectql/src/protocol-cluster-signal-package.test.ts`,
`[objectstack-ai#32663]`: action, tool and email_template, writer and peer, both save
orders.
-
`packages/runtime/src/domains/meta-disabled-holder-served-stack.test.ts`,
`[objectstack-ai#33127, objectstack-ai#32662]`, through `HttpDispatcher` on a booted kernel over a
sqlite file, before and after a reboot:
  - `?package=` per holder;
  - each pair address `?package=ID.custom`;
  - scope note (b), plain read and `/published`.

The `[objectstack-ai#32607 M1]` test now also pins the base row on all three faces in
both orders.
- Moved pins:
- `protocol-flow-custom-override.test.ts` `[objectstack-ai#33131]`: the carried
registry face moved to its TO.
- `protocol.register-item-call-sites.test.ts`: the ledger records the
new `registerItem` call shape.
- `scripts/engine-double-contract.pinned.json`: ratcheted with
`--write`.

<details><summary>Local runs (under
`scripts/pm/os-verify-lock.sh`)</summary>

- Targeted: objectql, 4 files, `Tests 144 passed (144)`; runtime
served-stack, `Tests 36 passed (36)`; metadata-protocol call sites,
`Tests 5 passed (5)`.
- Typecheck of objectql, metadata-protocol, runtime and spec:
`TC_EXIT=0`.
- `pnpm exec turbo run test --concurrency=2 --continue` over the 83
packages that depend on objectql, metadata-protocol or runtime, plus
`@objectstack/spec`. Result: `Tasks: 186 successful, 188 total`. The two
failed tasks:
- `@object-ui/example-schema-catalog#test` printed `sh: 1: vitest: not
found`. That example's install is missing on this box; nothing was
measured (NOT MEASURED).
- `@objectstack/dogfood#test` (the full battery, no shard): `Test Files
2 failed | 463 passed | 3 skipped (468)`, `Tests 2 failed | 3930 passed
| 42 skipped (3974)`. Both failures were `Test timed out in 5000ms`
while the box was contended: `bare-name-one-holder-ai-family` `[objectstack-ai#31985]`
and `package-commit-revert-path-package` `[objectstack-ai#29414] control`. Re-run
alone under the lock (`VERDICT command-exit 0`): `Test Files 2 passed
(2)`, `Tests 39 passed (39)`.
- The 39 packages affected only through the new spec migration entry are
left to CI.
- `pnpm lint` passed (`LINT_EXIT=0`).

</details>

<details><summary>Ablations: one per negative pin, each restored with a
clean whole tree</summary>

Each mutation went through `scripts/ablation-replace.mjs`.
`metadata-protocol` was rebuilt and
`scripts/ablation-dist-preflight.mjs` found the marker in `dist/`. After
the restore it was rebuilt again and the preflight with `--absent`
answered exit 0.

- The hydration's `overlaySlot` forced off (marker
`ABLATION_33127_SLOT`):
- objectql: `27 failed | 117 passed (144)`. The red tests are exactly
the `[objectstack-ai#33127]` boot pins (16), `[objectstack-ai#32663]` (6), `[objectstack-ai#33131]`'s moved pin
(4) and `[objectstack-ai#32900]` pair-first (1).
  - runtime: `2 failed`, the two `objectstack-ai#33127` door pins.
  - All CONTROLs stayed green.
- `readMetaItem`'s `storedRowBases` off: runtime `4 failed`, the four
`objectstack-ai#32662` pair-address pins. objectql stayed green.
- `storedRowHoldersRefusal`'s one-holder arm off (marker
`ABLATION_33127_PLAINB`): runtime `3 failed`, the two `objectstack-ai#32662 (b)` pins
and `M1`.
- `isBundleAddition`'s row-only exemption off: objectql `1 failed`,
`[objectstack-ai#28802] with a dependent's member at the same locale, the base's
address still serves the pair's`.

</details>

## Acceptance notes

- The slot model also moves the face objectstack-ai#33131 carried: the registry item
of an action with both shippers' overrides declared now answers each
holder's own override. Its pin in
`protocol-flow-custom-override.test.ts` moved to the TO, and its title
no longer says carried. That card stays open for its seat to judge.
- `dashboard` is still converged by name in the registry (objectstack-ai#32663
residual (a), awaiting a ruling). The objectstack-ai#32451 CONTROL stays as it was.
- The layered read (`getMetaItemLayered`) at a pair address is
unchanged.
- An action's read naming no package before hydration (rows laid
straight into the store, a state the save door does not produce) still
follows save order.
- objectstack-ai#33127's heal 1, heal 2 and S1 items are not separately pinned here.
See the report's open question.
- Function-holder parts of `registry.ts` belong to area E2b. Its open
PRs (objectstack-ai#33271, objectstack-ai#33274) touch neither `registry.ts` nor any file here;
objectstack-ai#33271 reads composite keys in `plugin.ts`, which this change leaves as
they were.

## Verification

- `pnpm check:adr-0087-registration`: `1 declared-breaking changeset(s),
each carrying an ADR-0087 disposition … registered
stored-row-own-package-slot`.
- The derived gate families (`node scripts/pm/dispatch-gates.mjs
--commands`, 102 families on this diff) were run locally.
- `check:dual-build-cjs-loads` asks for a whole-repo `pnpm build` first,
so it is NOT MEASURED here and left to CI.
- `check:engine-double-contract` and `check:objectql-double-limit` were
red on the first pass because of a new unbounded `find` double. After
the fix they are exit 0.
  - Every other family: exit 0.
- `check-nul-bytes`: OK. The overlay slot mark is written as an escape,
never a raw byte.
- Open E2b PRs touching `packages/objectql/src/registry.ts`: none
(objectstack-ai#33271 and objectstack-ai#33274 were checked file by file).
- To see the slots work: `pnpm --filter @objectstack/objectql exec
vitest run --project local src/webhook-stored-row-boot-hydration.test.ts
-t 33127`.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_016WV4cy1y7UNVbT2QAdmgdn

<!-- signed: domain:server#5 · os-elon-musk ·
session_016WV4cy1y7UNVbT2QAdmgdn -->

---------

Co-authored-by: Claude <noreply@anthropic.com>
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

2 participants