Repository navigation
fix(objectql): judge an authored action artifact-shipped by each holder's owner key, not by bare name - #33271
Conversation
…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
…judgement Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016WV4cyWLSMyXZGc6dwhCAu
📓 Docs Drift CheckThis PR changes 1 package(s): 6 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:
⛔ 2 release-owned page(s) also name something this change touched. These are read-only:
What this run could not see
Coarse fallback — 21 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 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
|
Contract reviewServed-tier: ① Derived judgments
② Semver level
③ Boundary flags
Implemented-by: 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
… find bound Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016WV4cyWLSMyXZGc6dwhCAu
|
Contract-review-claim: session_016WV4d1PGptBW3QRQNmy5e6 · head efef478 · 2026-11-14T16:56:44Z review#3. |
Contract reviewServed-tier: Delta over my FAIL at ① Derived judgments
② Semver levelUnchanged from the first record: ③ Boundary flags
Implemented-by: VERDICT: PASS |
|
domain:server#5 · os-elon-musk · session_016WV4cyWLSMyXZGc6dwhCAu
|
…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>
Requested by Elon · project thread
Fixes #32990
Clause-②: yes (widening)
Metadata-protocol: none
维护者速读
ObjectQLPlugin绑定环境自写的脚本 action 时,原来只要有任何代码包发布了同名 action 就跳过;现在逐个读每个持有者的同名 action,按它所属的对象判断:只有某个包的同名 action 拥有该行所在对象(或该 action 不绑定对象)时才跳过。声明式.customoverride 也按自己对象上的那个包匹配,不再按名字取第一个包。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。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.resyncAuthoredActionsbinds 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 underapp:PACKAGE). The skip,isArtifactShippedAction, askedregistry.getArtifactItem('action', NAME): any code package's artifact of the bare name, on any object, skipped the row.isArtifactShippedActionnow reads every code package's artifact of the name (artifactActionsNamed) and judges each by the object it owns, with the router's own predicatestandaloneActionOwnsRoute: 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 }), thengetArtifactItemprefer-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.tsorpackages/spec.FROM → TO
Composition: package A ships a script action
approveon its object, package B one of the same name on its own, and the environment stores its own package-less script actionapproveon a third object. Readings are the engine dispatch on a booted kernel (ObjectKernel+ObjectQLPlugin, itskernel:readyresync).maine540baf8)Action 'approve' on object 'OBJECT' not foundB.customdeclared override of B's action, A registered firstUnchanged, 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#32365case 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 bootsObjectKernelwithObjectQLPlugin, 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 underapp: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 answeredAction 'approve' on object 'env_lead' not found; the override case answeredran betawith A registered first.Ablations (each through
scripts/ablation-replace.mjs: mutation landed by anchor count and blob hash, restore verified as blob equal toHEADwith an empty diff; the suite imports./plugin.jsfrom source, so no rebuild is involved):Five ablations, each red
artifactActionsNamed(name).length > 0): 2 failed (two holders; one holder).some(() => false)): 2 failed (the disabled-holder and the object-less CONTROLs).standaloneActionOwnsRoute: 1 failed (the object-less CONTROL).artifacts[0]): 1 failed (the override of the second holder).return falsebefore 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-replacerefused it (anchor count 1 to 1) and restored, so it ran nothing; it was re-run with a different anchor.Acceptance notes
ObjectQL'sarrivesAsDeclaredBase(packages/objectql/src/engine-actions.ts) readsgetArtifactItem('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.isArtifactShippedHookstays name-only; ADR-0150 D4 names it as gaining the package, a separate card.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 theos-dev-reportcomment on #32990; CI: see the check runs.🤖 Generated with Claude Code