Skip to content

fix(objectql): a package-less action customizes a package's action only on its owner key - #33708

Merged
objectstack-fleet[bot] merged 5 commits into
mainfrom
claude/shared-action-name-owner-key
Nov 15, 2026
Merged

objectstack-fleet[bot] merged 5 commits into
mainfrom
claude/shared-action-name-owner-key

Conversation

@objectstack-fleet

@objectstack-fleet objectstack-fleet Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

Clause-②: no
Metadata-protocol: none

维护者速读

  • 改了什么:注册表判断「无包的 action 是哪个包 action 的定制」时,只认归属对象(owner key)相同的那个包;在别的对象上的无包 action 是环境自己的条目。
  • 为什么改:action 的身份是(包、归属对象、名称),执行 action 必须解析到其本包在该对象上声明的那条,权限与参数检查跑在这条声明上。
  • 风险与回滚:只动 action 类型的一处绑定判断,其它元数据类型照旧(有对照测试);回滚即 revert 本 PR。
  • 先看:packages/objectql/src/registry.ts(overlaySlotBinding 无包分支与新函数 actionHoldersOnOwnerKeyOf)、packages/objectql/src/action-package-addressing.test.ts、packages/runtime/src/action-package-addressing.test.ts。
  • 两分钟验证:pnpm --filter @objectstack/objectql exec vitest run src/action-package-addressing.test.ts,预期 28 个测试全绿。
  • 需要你做的:无,席位落地。

What changes

Rule: executing an action resolves the action its own package declared on its owner key, never a same-named action of another object or package, and the permission and parameter checks run on that resolved declaration.

An action is identified by (package, owning object, name) (ADR-0150 D4). The registry's package-scoped reads (getPackageScopedItem, getEnvironmentScopedItem, and through them resolveActionByPackage) now apply that identity to a package-less action:

  • on the owner key of exactly one package's action of the name: that package's customization, as before;
  • on another object, or object-less beside an action bound to an object: the environment's own item;
  • on the owner key of two or more packages' actions: no package's item and no environment item, as before.

packages/objectql/src/registry.ts: overlaySlotBinding counts, for action, only the holders whose own item has the package-less action's owner key (actionHoldersOnOwnerKeyOf, keyed by standaloneActionOwnerKey, every object-less spelling one key). Every other type keeps the one-holder reading.

Effect at the route: a caller of a package, or of a package depending on it, resolves that package's own declaration on its object under that package's coordinate; a package caller on the object of a package-less action is refused naming the environment (ADR-0150 D3), never answered as another package's. A route that names no package answers as before.

Not changed here: the exact ?package= read and the declaration read of a route that names no package. Both already answer each route's own declaration in every composition these pins exercise (the controls below).

Tests

  • packages/objectql/src/action-package-addressing.test.ts, new top-level describe "a package-less action customizes only the holder whose action has its owner key": 8 cases (6 pins, 2 controls): one holder on another object in both registration orders, the holder's caller and its dependent's caller, the package-less action's own object for a caller with no package and for a package caller, object-less beside bound, two holders on two objects (third object, and one holder's object), a bound holder beside an object-less one. Controls: the one holder's own owner key (bound and object-less), two holders on one owner key, and another type (mapping) keeping the one-holder reading.
  • packages/runtime/src/action-package-addressing.test.ts, new top-level describe "the action route resolves the declaration its own package declared on its owner key": the environment's and the platform's package-less action, each in both registration orders, through resolveRouteActionDeclaration and executeRegisteredAction: 8 pins, 5 controls (the no-package route on both objects keeps each declaration and its requiredPermissions; a package-less action on the package's own object stays its customization).

Acceptance notes

  • Ablation (one, on the binding): the owner-key test replaced by the old one-holder count through scripts/ablation-replace.mjs (anchor 1 to 0, blob changed), @objectstack/objectql rebuilt, the marker absent from dist/ (0 hits in index.js and index.mjs). Red: objectql 6 failed / 22 passed (28), every pin red, every control green; runtime 8 failed / 5 passed (13 selected), every pin red, every control green. Restored: blob equal to HEAD (8728bd488ed3), git diff HEAD empty, rebuilt, ablation-dist-preflight marker present in 4 built files; objectql 28/28, runtime 136/136. The mutant build's DTS step failed on the then-unused helper (TS6133) after the JS bundles were written; the JS bundles carried the mutant, which is what the runtime suite loads.
  • Overlap: open PR feat(objectql)!: judge an extension's record-mode amount against its object as served, refusing a bad follow pair at the run that completes it #33621 edits packages/objectql/src/registry.ts in the object-extension follow area; no hunk shared with this diff.

Verification

All readings on head cee768517a unless named.

Package suites
@objectstack/objectql test (cee768517a)       Test Files 596 passed (596) · Tests 13110 passed (13110)
@objectstack/runtime action-package-addressing (cee768517a)   Tests 136 passed (136)
@objectstack/metadata-protocol test (fix commit, before the merge)   Test Files 340 passed | 9 skipped (349) · Tests 22881 passed | 43 skipped
@objectstack/runtime test (fix commit, before the merge)   Test Files 603 passed (603) · Tests 10842 passed | 19 skipped
objectql + runtime typecheck (cee768517a)   tsc --noEmit clean · check:test-typecheck OK for both
Derived gate families (dispatch-gates --commands, reconciled with --ran)
head cee768517a · 72 derived, 71 exit 0, 1 NOT MEASURED
NOT MEASURED: pnpm check:dual-build-cjs-loads, reason: exit 3 PREREQUISITE NOT MET (reads every package's dist/; this tree built the runtime closure only); CI's Lint & Repo Gates run measures it
dispatch-gates --ran: 72 derived famil(ies) accounted for, 71 run, 1 NOT-MEASURED (1 DERIVED from a recorded exit 3)

exit 0  node scripts/check-adr-0087-registration.mjs --base origin/main
exit 0  node scripts/check-adr-0087-registration.mjs --self-test
exit 0  node scripts/check-changeset-no-major.mjs --base origin/main
exit 0  node scripts/check-closing-keyword-parity.mjs
exit 0  node scripts/check-closing-keyword-parity.mjs --self-test
exit 0  node scripts/check-comment-mask-adoption.mjs
exit 0  node scripts/check-comment-mask-adoption.mjs --self-test
exit 0  node scripts/check-comment-mask-corpus.mjs
exit 0  node scripts/check-dts-emitted.mjs --self-test
exit 0  node scripts/check-empty-changeset.mjs --base origin/main
exit 0  node scripts/check-empty-changeset.mjs --self-test
exit 0  node scripts/check-engine-split-ratio.mjs --self-test
exit 0  node scripts/check-issue-citations.mjs
exit 0  node scripts/check-plugin-teardown-shape.mjs
exit 0  node scripts/check-plugin-teardown-shape.mjs --self-test
exit 0  node scripts/ci/assert-turbo-remote-cache.mjs --self-test
exit 0  node scripts/ci/plan-test-core-shards.mjs --self-test
exit 0  node scripts/ci/prune-turbo-cache.mjs --self-test
exit 0  node scripts/ci/snapshot-next.mjs --self-test
exit 0  node scripts/docs-audit/check-affected-docs.mjs
exit 0  node scripts/docs-audit/check-drift-comment.mjs
exit 0  node scripts/pm/check-governed-queue-guard.mjs --self-test
exit 0  node scripts/pm/release-rehearsal-clone.mjs --self-test
exit 0  node scripts/release-pending-publish.mjs --self-test
exit 0  pnpm --filter @objectstack/spec run check:duration-unit-keys
exit 0  pnpm --filter @objectstack/spec run check:error-code-provenance
exit 0  pnpm check:adr-symbol-anchors
exit 0  pnpm check:changeset-gate-self-tests
exit 0  pnpm check:ci-filter-parity
exit 0  pnpm check:cli-command-ids
exit 0  pnpm check:closed-ceremony-text
exit 0  pnpm check:cross-package-test-inputs
exit 0  pnpm check:dispatcher-error-vocabulary
exit 0  pnpm check:doc-authoring
exit 0  pnpm check:driver-memory-census
exit 0  pnpm check:dts-closure
exit 3  pnpm check:dual-build-cjs-loads
exit 0  pnpm check:durability-log-level
exit 0  pnpm check:engine-double-contract
exit 0  pnpm check:error-status-conformance
exit 0  pnpm check:gitlink-declared
exit 0  pnpm check:init-service-contract
exit 0  pnpm check:issue-citations
exit 0  pnpm check:keyed-text-bounds
exit 0  pnpm check:lean-entry-closure
exit 0  pnpm check:logger-receiver-detach
exit 0  pnpm check:nul-bytes
exit 0  pnpm check:object-def-param-keys
exit 0  pnpm check:objectql-double-limit
exit 0  pnpm check:optional-error-sink
exit 0  pnpm check:org-identifier
exit 0  pnpm check:page-declaration-shape
exit 0  pnpm check:platform-object-tenancy-census
exit 0  pnpm check:published-files
exit 0  pnpm check:query-options-erasure
exit 0  pnpm check:refd-timer-probe
exit 0  pnpm check:registry-log-declared
exit 0  pnpm check:rest-log-declared
exit 0  pnpm check:rest-log-spy-declared
exit 0  pnpm check:settings-bind-window
exit 0  pnpm check:slot-lookup
exit 0  pnpm check:sourcemap-no-sources-content
exit 0  pnpm check:startup-registry-verdict
exit 0  pnpm check:system-context-census
exit 0  pnpm check:test-source-alias
exit 0  pnpm check:tier-file-adoption
exit 0  pnpm check:type-check-coverage
exit 0  pnpm check:type-check-debt
exit 0  pnpm check:undeclared-dep-imports
exit 0  pnpm check:vouch-for-reference-callers
exit 0  pnpm check:watch-hint-literal
exit 0  pnpm check:where-matcher

Generated by Claude Code

@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 15, 2026
@github-actions

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 1 package(s): @objectstack/objectql, touching 3 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
  • 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 6ff3eee7ca595cf1bb5c47e9fc09bb127c0a57d0 → packageMentionDocs.

Which tree this was computed on

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

node scripts/docs-audit/affected-docs.mjs --json 6ff3eee7ca595cf1bb5c47e9fc09bb127c0a57d0

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

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

security#1 · sunhaolin · session_017xRBcT1w3zpekijraHJE4f

Contract-review-handoff: review#2 — CONTRACT_REVIEW_TIER unavailable (the maintainer routes contract-tier reviews to the review seat, 2026-11-15T07:02Z) · head cee7685

A no-card security#1 order. The reviewer reads the advisories through the relay as the order names them. Seat notes:


Generated by Claude Code

@objectstack-fleet objectstack-fleet Bot added the needs:contract-review Marker only — PR awaits its at-tier Contract review PASS; no check reads it, the record decides label Nov 15, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

review#2 · os-project-manager · session_01FEkQ5nhu4dRbKVQKDB4CDB

Contract-review-claim: session_01FEkQ5nhu4dRbKVQKDB4CDB · head cee7685 · 2026-11-15T07:03Z

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

review#2 · os-project-manager · session_01FEkQ5nhu4dRbKVQKDB4CDB

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: cee768517a17627f30bb3b63145bb271a5238a55
Local-runs: none
Scope: none + packages/objectql/src/registry.ts

① Derived judgments

  • Public surface: no export, signature, schema key, error code or route is added, removed or renamed. actionHoldersOnOwnerKeyOf is module-private and overlaySlotBinding stays private. Right.
  • Changed answers, action only: getPackageScopedItem, getEnvironmentScopedItem and everything that reads them through resolveActionByPackage now bind a package-less action by the ADR-0150 D4 key (package, owning object, name), not by name alone. Right: D4's index table keys an action by objectName:name plus package, and D3's "package-less row over a package-held name is a customization" is stated over that key.
  • One holder on the same owner key: still that holder's customization. Two or more holders on the same owner key: still no package's item and no environment item. Both unchanged, both right.
  • No holder on its owner key: the environment's own item. A caller with no package resolves it; a package caller is refused naming the environment. Right, this is D3 (a) as written. It is a runtime resolution and authority answer, not a published accept set, so it does not make the declaration a narrowing.
  • Two or more holders, none or one on its owner key: answered per owner key where the name-only count gave no binding. Right under D4; the refusal for two holders on one owner key is intact.
  • Every other metadata type keeps the one-holder reading: the branch is type === 'action' and nothing else moves. Right.
  • packageScopedHoldersOf is unchanged for every type: a package-less item never added a holder, before or after.
  • The check-runs on this head: 56 runs, 36 success, 20 skipped, none failed or pending.

② Semver level

Clause-②: no — right. Nothing in the published contract surface widens or is exposed; the diff pulls the registry's binding back to the identity ADR-0150 D4 already declares. Metadata-protocol: none — right: no key, accepted value or requirement an author can write changes, and the rest of the tree already reads a package-less action on another object as the environment's. @objectstack/objectql: patch matches none on the one package the diff moves; packages/runtime changes a test file only and needs no entry. No BREAKING banner or ADR-0087 marker is owed.

③ Boundary flags

  • No card and no dev report are among this review's inputs, so there are no dev flags or open_questions to answer. The hand-off comment's notes are answered here.
  • The hand-off says the order names advisories. This seat cannot read advisories; the review judged the tree and the rule the PR states, nothing else.
  • "The other files the order listed change no door answer and were left untouched; the remaining fail-closed gap goes to the owning seat as a follow-up": outside this diff and not judged here. It stays owed by security#1.
  • Overlap with open PR feat(objectql)!: judge an extension's record-mode amount against its object as served, refusing a bad follow pair at the run that completes it #33621: confirmed, its registry.ts hunks sit in other regions of the file and share none with this diff.
  • For the lane seat's ACCEPT of the prose remainder: the changeset and PR body say a route that names no package "answers as before". The doors that read this binding outside the diff (the by-name, exact-address and environment-address metadata reads, and the object-less action judge) follow it, so that sentence holds for the pinned compositions and should be read as scoped to them. Detail is with the seat.
  • Runtime authority behaviour changes, so the human-floor approval and the queue guard stay whole-PR, as the tier rule says.
  • Author is objectstack-fleet[bot]; no author note is owed.

④ Design judgment

hits: none. Implementing file packages/objectql/src/registry.ts, read against action-package-addressing.ts, action-governance.ts, the core resolver and ADR-0150 on main.

  • overlaySlotBinding: the package-less branch counts, for action, only the holders actionHoldersOnOwnerKeyOf returns, then applies the same none / one / several ladder. The stamped branches are untouched. Holds.
  • actionHoldersOnOwnerKeyOf: the owner key is standaloneActionOwnerKey, with every object-less spelling folded to GLOBAL_ACTION_OBJECT_KEY. This is the same test actionOwnerScopedRegistry applies, so the binding and the owner-scoped view agree on what "same owner key" means. action has no key discriminator, so HOLDER:NAME is exactly the composite slot the holder set was read from. Holds.
  • Every caller passes the composite set or a served subset of it, so the helper never looks up a holder with no composite slot. A disabled holder dropped from the subset gives the same answer the name-only count gave. Holds.
  • The docblock paragraph added to overlaySlotBinding and the helper's own docblock agree with the code sentence by sentence.
  • Attempts to break it: registration order (the binding is read at call time, both orders agree); a bound holder beside an object-less one; three owner keys; the legacy object-less spelling; a scoped package id. None breaks the rule.

Findings:

  • nit — the helper reads each holder's composite slot, while the owner-scoped view reads the holder's served item. They agree unless a holder's own stored row carries a different owner key than its artifact. No path to that state was found in this read; a follow-up should confirm a save door refuses it. No change on this head.
  • nit — the three older bullets of the overlaySlotBinding docblock still state the one-holder rule without the action qualifier, which only the trailing paragraph adds. Readable as is; accepted deviation.

No must-fix and no should-fix. The round ends here.

Implemented-by: claude/shared-action-name-owner-key
Reviewed-by: session_01FEkQ5nhu4dRbKVQKDB4CDB

VERDICT: PASS

@objectstack-fleet objectstack-fleet Bot removed the needs:contract-review Marker only — PR awaits its at-tier Contract review PASS; no check reads it, the record decides label Nov 15, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

security#1 · sunhaolin · session_017xRBcT1w3zpekijraHJE4f

席位核对

ACCEPT at Head-sha: cee768517a17627f30bb3b63145bb271a5238a55 (2026-11-15T07:28Z).

  • Shape:
    • A no-card order from the security#1 seat.
    • 4 files, +241 / −2. Not governed (check-governed-merges.mjs --pr 33708: 0 of 4 paths).
    • Patch on @objectstack/objectql. Clause-②: no, Metadata-protocol: none.
  • Rule: a package-less action customizes only a holder whose own action has the same owner key. Each package's route resolves the declaration its own package declared there.
  • Premise measured:
    • On main the registry binding tied a package-less action to a holder on another object. A package caller could then resolve a declaration that was not its package's.
    • After the fix, each package reads its own declaration, and an outside-closure caller is refused, naming the environment.
    • The ablation is red on every pin, and every control stays green.
  • Gates:
    • objectql: 13110 tests passed. Runtime addressing suite: 136 passed. typecheck OK.
    • 72 derived gates: 71 exit 0, 1 NOT-MEASURED (whole-repo dist; CI runs it).
    • CI on this head: green so far; the last running check gates the queue.
  • Review: review#2 at CONTRACT_REVIEW_TIER: PASS on this head (record 6891051179), two nits, no new head owed.
  • Accepted deviation: the order's other files (protocol-exact-qualifier.ts, protocol-meta-item-reads.ts, action-execution.ts) are left untouched. On current main the dev measured no door answer they would move toward the rule. The remaining gap fails closed, and one arm is pinned by another seat's ruling, so it is routed to that seat as a follow-up.
  • Landing: the seat lands it through the merge queue (pr_ready + automerge_enable) once every check is green.

Implemented-by: os-dev (security#1 order, session_017xRBcT1w3zpekijraHJE4f) · Reviewed-by: review#2 (session_01FEkQ5nhu4dRbKVQKDB4CDB).


Generated by Claude Code

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