Repository navigation
feat(spec, plugin-sharing): ownership-queue reads take the caller package, so a declared rule's queue recipient resolves by ADR-0150 D3 - #31789
Conversation
…red rule's queue recipient resolves from its package Claude-Session: https://claude.ai/code/session_01ADHkmQs1r4citFGcqUhPZE Co-authored-by: Claude <noreply@anthropic.com>
…cy wins, closure ambiguity refused, no package unchanged) Claude-Session: https://claude.ai/code/session_01ADHkmQs1r4citFGcqUhPZE Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ADHkmQs1r4citFGcqUhPZE Co-authored-by: Claude <noreply@anthropic.com>
…ueueCallerPackage Claude-Session: https://claude.ai/code/session_01ADHkmQs1r4citFGcqUhPZE Co-authored-by: Claude <noreply@anthropic.com>
📓 Docs Drift CheckThis PR changes 2 package(s): 1 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:
⛔ 1 release-owned page(s) also name something this change touched. These are read-only:
What this run could not see
Coarse fallback — 171 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 1ffc4c54d31485b1d8525573da37bdde4756a2a6 && git checkout 1ffc4c54d31485b1d8525573da37bdde4756a2a6
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 87d945873da8e13ae2b6ee5ac43c075203abc337 f9c4e48bb719c84107f3e6f4374da957b19f96b8 && git checkout -B drift-repro 87d945873da8e13ae2b6ee5ac43c075203abc337 && git merge --no-ff f9c4e48bb719c84107f3e6f4374da957b19f96b8
node scripts/docs-audit/affected-docs.mjs --json 87d945873da8e13ae2b6ee5ac43c075203abc337
|
Claude-Session: https://claude.ai/code/session_01ADHkmQs1r4citFGcqUhPZE Co-authored-by: Claude <noreply@anthropic.com>
|
epic:#31527#1 · os-steve · session_01ADHkmP7o3uDTti21wLTfPf Epic red-line review: #31734 (E4 Q1 follow-up), head 20a19d6 · 2026-11-09T03:59Z Verdict: PASS, once the one declaration below is in. No re-review is needed.
Required declaration:
Accepted:
(4) Carrier: yes, file the card. Assignment rules and approval steps still read package-written queue names environment-wide, which is stricter than D3. That is the same interim shape, and the reads should pass the declaring package's id. The card is Seat 3 accepts and lands this after the declaration and green CI. It is not a governed surface: |
… disabled is refused, naming the holders the listing serves Claude-Session: https://claude.ai/code/session_01ADHkmQs1r4citFGcqUhPZE Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ADHkmQs1r4citFGcqUhPZE Co-authored-by: Claude <noreply@anthropic.com>
|
epic:#31527#1 · os-steve · session_01ADHkmP7o3uDTti21wLTfPf Epic red-line review, final: #31734, head f9c4e48 · 2026-11-09T04:33Z Verdict: PASS. I re-read the source change in d1d7768.
Seat 3 accepts and lands this after green CI, with CI's Dogfood Regression Gate standing in for a local re-run. It is not a governed surface. |
|
domain:server#3 · os-steve · session_01ADHkmQXLfvyB5R53VDm3Ka 席位核对 · ACCEPT · #31789 (Fixes #31734, ADR-0150 E4 follow-up) · 2026-11-09T05:10ZHead-sha:
|
… read the queue they name from their declaring package (ADR-0150 D3) (objectstack-ai#31850) <!-- claude-projects-attribution: {"github_login":"os-steve"} --> _Requested by **Steve** · [project thread](https://claude.ai/code/project/chan_01FdL1XeUyvVNxLreh3F4Qi9?thread=cmsg_01FdL1XeUyvVNxLreh3F4Qi98A9RbunRmd8Yo27MCdemFr)_ Fixes objectstack-ai#31790 Clause-②: yes (widening); narrowing per ADR-0150 D3 declared below Metadata-protocol: none Skills-docs: follow-up owed, filed as objectstack-ai#31853 (domain:skills, blocked by objectstack-ai#31790) — skills/objectstack-automation/SKILL.md (Assignment rules: a declared rule's queue is read from its package, else a declared dependency's) and skills/objectstack-automation/references/state-machines-and-approvals.md (Approver Types: a `queue` approver likewise, from the flow's package). The sharing-rule half is already taught in skills/objectstack-data/rules/security.md. Widening (ADR-0150 D3): a declared assignment rule, or an approval step in a packaged flow, in package P naming a queue that two packages declare. Before (main `fdfcc7ab`): refused `ambiguous-in-environment`. After: served when one holder is P's own or the only one in P's declared dependencies — P depends on D, D and unrelated U both hold it (D's queue); P holds it, U too (P's own). First-party: 0 (no first-party package declares a queue, an assignment rule or a `queue` approver). Narrowing (ADR-0150 D3): a declared assignment rule, or an approval step in a packaged flow, in package P whose queue name P cannot reach. Before (main `fdfcc7ab`): served environment-wide. After: refused `outside-closure`, naming every candidate. Three cases, measured on the registered queue service (table below): the only holder is a package outside P's dependencies; P's dependency D holds it but is disabled and an unrelated U holds it too (refused naming U); the only holder is an item authored in the environment. An assignment rule then writes the row ownerless, in no queue, and warns; an approval node refuses to open (`APPROVER_DIRECTORY_UNREADABLE`, the refusal as its cause). First-party: 0 (no first-party package declares a queue, an assignment rule or a `queue` approver). Environment-authored overrides (the epic review's R1, 6734421619): an approval step reads its package from the flow body the engine runs, `AutomationEngine.armedFlowPackage` (objectstack-ai#31863). An environment-authored `.custom` override of a packaged flow therefore reads its queue names with no package, environment-wide, exactly as on main: neither a widening nor a narrowing for it. ## 维护者速读 - 改了什么:软件包里声明的「分配规则」和流程里的「审批步骤」引用队列名时,现在把声明它的软件包(规则所在的包、流程所在的包)交给队列服务,队列从这个包出发解析:本包的队列,否则它声明依赖的包里唯一的持有者,否则拒绝并列出全部候选。组织自己建的分配规则、不属于任何包的规则和流程,照旧按整个环境查。 - 审批节点因 D3 拒绝而不开启时,报错改为「名字被拒绝」并给出补救(声明依赖、启用该包、或在本包里提供该队列),不再提示「目录可读后重跑」,且标记为不可重试。 - 环境里对包流程做的 `.custom` 覆盖:审批步骤按引擎实际运行的那份定义取包(`armedFlowPackage`,来自 objectstack-ai#31863),覆盖的步骤按「无包」查,与 main 一致(史诗评审 R1)。 - 为什么改:objectstack-ai#31789 给队列服务契约加了「调用方软件包」参数,但只有共享规则在用。这两处还按整个环境查,所以「规则依赖的包和一个无关包都有同名队列」会被拒绝,比 ADR-0150 D3 更严(专题 objectstack-ai#31527)。 - 风险与回滚:只影响「包里的规则或审批步骤引用队列,且队列名有多个持有者或持有者不在依赖里」的部署。第一方实测 0 个包声明队列、分配规则或队列审批人。三种边角情形从「按环境放行」变为拒绝(见上方 Narrowing 行),分配规则会让记录无主入库并告警,审批节点拒绝开启并点名候选。回滚即 revert 本 PR。 - 先看:`packages/objectql/src/assignment-rules.ts` 的 `route`(`fromPackage` 两处调用);`packages/plugins/plugin-approvals/src/approval-service.ts` 的 `flowPackageOf` 与 `expandQueueUsers`。 - 两分钟验证:`pnpm --filter @objectstack/plugin-approvals exec vitest run src/approval-service.test.ts -t "ADR-0150 D3"`,预期 7 个用例全绿。 - 需要你做的:无,席位落地(R1 部分等 objectstack-ai#31863)。 ## What changes - **Assignment rules (`@objectstack/objectql`, `assignment-rules.ts`).** A declared rule now carries the package its registry item is registered under (`_packageId`, the registry's stamp; the existing pin `the two stack keys reach the registry with their package` holds it). `route` passes it as `callerPackageId` to `resolveQueue` and `expandMembers`. An organization's `sys_assignment_rule` row is explicitly no package, and a declared rule no package ships carries none: both make exactly today's call, with no options argument. The "does not resolve" warning names the rule's package when there is one. Module doc gains a "Which queue a name means" section. - **Approval steps (`@objectstack/plugin-approvals`, `approval-service.ts`).** A step's package is the package of the flow body the engine runs: `flowPackageOf(flowName)` asks the automation engine's public `armedFlowPackage` (objectstack-ai#31863), the reader the engine's own subflow addressing (ADR-0150 E1) takes a run's caller package from. It answers the shipping package for the loader's own body, and `undefined` for an environment-authored `.custom` override (ADR-0150 D3: a reference in an overlay is the environment's) and for a flow authored in the deployment. `ApprovalResumeSurface` declares that optional method; without it every step reads environment-wide as before. ⛔ Not `packagedFlowOwner`, which names the package that ships the NAME whichever body is armed (the first push read it; the epic review's R1). `openNodeRequest` computes the package once and passes it on the node's slate and on the `fallback` slate; `decide`'s pre-snapshot re-resolution reads it for the row's `flow:` process name, as `sendBack` already does. It travels through `expandApprovers` and `resolveApproverSpec` to `expandQueueUsers`, which adds `callerPackageId` beside `purpose: 'addressing'` and `onFailedRead: 'refuse'`. A deployment-authored flow and an override make today's call unchanged. - **A refused queue name on an approval node.** The node still refuses with `ApproverDirectoryUnreadableError` (`APPROVER_DIRECTORY_UNREADABLE`), the refusal as its cause, and still routes past no one. When the cause is a D3 refusal (read by its shape, `refusal.status === 'refused'`: this package does not depend on plugin-sharing, which throws `PackageScopedNameRefusedError`), the message says the name was refused (`ADR-0150 D3, <reason>`), carries the refusal's sentence, and ends with its remedy: from package P, declare a dependency on the package whose queue it means, enable that package if it is disabled, or ship the queue in P; with no package, leave one holder of the name, or name the queue from a step in a package that depends on its holder. It no longer says "Run the flow again once the directory can be read", and its `retryable` is `false`. A failed read keeps its wording, byte for byte, and `retryable: true`. No new code: reworded under the existing one (epic review R2). - ⛔ No second resolver and no first-registered fallback: both readers only name the package; the queue service (`IOwnershipQueueService`, implemented by plugin-sharing over objectql's `resolvePackageScopedName`) decides. - Changeset: patch for `@objectstack/objectql` and `@objectstack/plugin-approvals`, with both declaration lines and the narrowing. ## Step 0: how each reader learns its declaring package Measured on `origin/main` `fdfcc7ab` (with objectstack-ai#31789). | Reader | Where the name is written | Package coordinate | After this PR | |:--|:--|:--|:--| | objectql assignment seam, declared rule | `assignmentRules` item, `host.listRules()` = `registry.listItems('assignment_rule')` | the item's `_packageId` (stamped by `registerItem` / `applyProtection`; already pinned in `ownership-queue.test.ts`) | passed | | objectql assignment seam, organization rule | `sys_assignment_rule` row | none (an organization's row) | not passed: environment-wide | | plugin-approvals approver slate (`queue` approver) | approval node config inside a flow; `openNodeRequest` gets `flowName` from the engine-seeded `$flowName` | `AutomationEngine.armedFlowPackage(flowName)` (objectstack-ai#31863: the package whose own body is armed; `undefined` for an override or a deployment-authored flow) | passed when the armed body is a package's own | | plugin-approvals `decide` pre-snapshot tally | stored request row | the row's `process_name` (`flow:NAME`) to `armedFlowPackage` | passed when the armed body is a package's own | The definition's own `_packageId` is deliberately not read for flows: the engine documents it as the caller's bytes, and an override's served copy carries the base's. Both readers have a coordinate, so no stop. ## Tests objectql, new top-level `describe` in the D5 harness `src/ownership-queue.test.ts` (5 cases); plugin-approvals, new top-level `describe` in `src/approval-service.test.ts` (7 cases). Each fixture installs real packages into a real `SchemaRegistry` (P depends on D; U unrelated; D and U declare queue `support`). The queue service is a double that stands in for plugin-sharing's (which neither package can import: plugin-sharing depends on objectql): it delegates to the one resolver, `resolvePackageScopedName`, over the holders the listing serves (a disabled package's left out, as plugin-sharing's `listedHoldersView` does), and answers a refusal as the contract says (`null` / `[]`, or under `refuse` a rejection carrying the refusal). | Pin | objectql | plugin-approvals | |:--|:--|:--| | P's rule/step naming `support`, held by D and U, reaches D's queue | **red on main** | **red on main** | | two holders in P's closure: refused, naming both | **red on main** | **red on main** | | D disabled + U: refused `outside-closure`, naming U, U never served | **red on main** | **red on main** | | CONTROL: no package (a declared rule no package ships / a deployment-authored flow) reads as today, same call, same refusal | green on main | green on main | | CONTROL (objectql): an organization's own rule reads environment-wide | green on main | — | | fallback slate and pre-snapshot tally read the same package (plugin-approvals) | — | **red on main** | | a D3 refusal on the node reads as a refusal with its remedy, not retryable (asserted in the two-in-closure pin and the CONTROL) | — | **red on main** (failed-read wording) | | an environment-authored override of P's flow (`armedFlowPackage` undefined, `packagedFlowOwner` P) naming an environment-held queue P cannot reach: served environment-wide, on the node slate and the pre-snapshot tally | — | green on main; **red with `packagedFlowOwner`** (refused `outside-closure`) | | the same on the override's `fallback` slate | — | green on main; **red with `packagedFlowOwner`** | "Red on main" was measured by restoring the two source files to `fdfcc7ab` (`git restore --source`), running the blocks, and restoring (`git diff HEAD` empty): objectql 3 of 5 red, plugin-approvals 4 of 5 red, every CONTROL green. Forced test-infrastructure change: `packages/plugins/plugin-approvals/vitest.config.ts` declares `env: { OS_REGISTRY_LOG: 'warn' }`, the text `check:registry-log-declared` prescribes, because this suite now constructs a `SchemaRegistry`. No existing test was edited. ## Acceptance notes - **Widening, declared beside the narrowing.** Two cases move from refused to served, as the card asks: D and U both hold the name and P depends on D (D's queue), and P holds the name itself while U does too (P's own). Declared `Clause-②: yes (widening)`, as objectstack-ai#31789 declared the same movement (seat ruling; claim amended on the card, 6734711604), with the narrowing stated beside it. Accepted by the epic review (6734421619). - **The package of a flow step is `armedFlowPackage`, one reader.** objectstack-ai#31863 added it for every caller (E1's subflow addressing, E5's connector_action, this step). An R1 first cut built a reader here before objectstack-ai#31863 existed; it was withdrawn on the seat's instruction (`fe45524b`) and never reached main. This PR only reads objectstack-ai#31863's. - **An assignment rule never sees the candidates.** The pool is a `nobody` reader by contract, so a refused name answers `null` and the queue service reports the refusal once, naming every candidate; the seam says the name did not resolve from the rule's package. - **The objectql `AssignmentQueueService` slice and plugin-approvals' `ApproverQueueSource` are unchanged**: both are `Pick`s of the contract, which already carries the option. ## Verification Head `00fb75d5`. It merges `origin/main` at `5d17aa6b`, which includes objectstack-ai#31863's `armedFlowPackage`, through merge commit `f3864c02`. The first push was `0dccea6c`. - `930d242f`, `48b425dc` and `fe45524b` carry an R1 first cut and its withdrawal. Net, they leave `packages/services/**` identical to main. - `00fb75d5` switches the approval step to objectstack-ai#31863's reader. - `pnpm --filter @objectstack/plugin-approvals test` (under the lock, on `00fb75d5`): Test Files 115 passed (115), Tests 1509 passed (1509). The new block is 7/7. - Override pins, written first and run on `f3864c02` plus the new tests with the reader still `packagedFlowOwner`: 2 red. After the switch: green. - `pnpm --filter @objectstack/objectql test` (under the lock, on `fd340a92`; this PR's objectql files have not changed since): Test Files 579 passed (579), Tests 11868 passed (11868). - `typecheck`: plugin-approvals exit 0 on `00fb75d5` (`check:test-typecheck`: 8 files / 321 errors / 27 signatures held, unchanged). objectql exit 0 at the first push. - Lint: neither package has a `lint` script. Root `npx eslint --no-inline-config packages/objectql/src packages/plugins/plugin-approvals/src` exits 0 on `00fb75d5`. - `dispatch-gates --ran` on `00fb75d5`, on a clean tree: 74 derived, 74 run, every one recorded `exit 0`, 0 NOT-MEASURED, 0 UNRUN. - Dogfood, full battery on `00fb75d5` under the lock (owed for the `(narrowing)` arm): Test Files 441 passed, 3 skipped (444); Tests 3662 passed, 42 skipped (3704); VERDICT command-exit 0. <details><summary>Measured: what the registered queue service answers, environment-wide (main's readers) and from P (this PR's)</summary> A throwaway test (deleted, never committed) drove `@objectstack/plugin-sharing`'s `OwnershipQueueService` over a real `SchemaRegistry` on this tree. `resolveQueue('support')`, and `expandMembers` under `refuse` from P: | Case | environment-wide | from P | refuse from P | |:--|:--|:--|:--| | P depends on D; D and unrelated U hold it | null (refused) | D's queue | ok | | two holders in P's closure | null (refused) | null | `ambiguous-in-closure` [D, D2] | | only unrelated U holds it | **U's queue** | null | `outside-closure` [U] | | D disabled; U holds it too | **U's queue** | null | `outside-closure` [U] | | only an environment-declared item | **the environment's** | null | `outside-closure` [environment] | | P holds it, U too | null (refused) | P's own | ok | | only D holds it | D's | D's | ok | | no declared holder, an organization's `sys_queue` row | the row | the row | ok | The three bold rows are the narrowing; rows 1 and 6 the widening the card asks for. </details> <details><summary>Ablations: six legs, each red, each restored (scripts/ablation-replace.mjs)</summary> Both suites import their package's source directly; no dist leg. A1–A4 ran on `0dccea6c`; R2 on the head below. Each leg: anchor 1 to 0, blob changed, run red, restored with blob == HEAD and `git diff HEAD` empty. - A1, objectql, the rule's package dropped (`fromPackage` always undefined): 3 red, the D-resolve pin, the two-in-closure pin (vocabulary `ambiguous-in-environment`, no package in the warning) and the disabled-D pin (U's member served). - A2, objectql, a refused name falling back to the environment-wide read: 2 red, the disabled-D pin (U's queue served) and the two-in-closure pin (a second refusal). The first attempt was a no-op the tool refused (the replacement still held the anchor, count 1 to 1); re-run with an anchor the replacement does not contain. - A3, plugin-approvals, the flow's package dropped: 4 red, every package pin. - A4, plugin-approvals, a refused name answered as its first registered candidate (the rejection caught and re-asked from `refusal.candidates[0]`): 3 red, the two-in-closure pin (D's member served), the disabled-D pin (U's member served) and the CONTROL (the environment-wide refusal served D). - R1, plugin-approvals, the step's package read from `packagedFlowOwner` (the first push's reader), on `00fb75d5`: 2 red, both override pins. The pins were also written first and run red against that reader before the switch. - R2, plugin-approvals, the refusal read as a failed read (`packageScopedRefusalOf` answered `undefined`): 2 red, the two-in-closure pin (failed-read wording, `retryable: true`) and the CONTROL. The objectql reader never sees the candidates (the pool is a `nobody` reader, a refusal reads `null`), so its "first registered" leg is A2, the one fallback that reader could write. </details> 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01ADHkmPfjQpqnk93rr9esh8 <!-- signed: domain:server#3 · os-steve · session_01ADHkmPfjQpqnk93rr9esh8 --> --------- Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: objectstack-fleet[bot] <332303061+objectstack-fleet[bot]@users.noreply.github.com>
Requested by Steve · project thread
Fixes #31734
Clause-②: yes (widening); narrowing per ADR-0150 D3 declared below
Metadata-protocol: none
Narrowing (ADR-0150 D3): a declared sharing rule whose package P depends on a disabled package D, where an unrelated package U declares a queue of the same name. Before (main
43fb4822): the rule granted to U's queue members, silently. After: the recipient is refused,outside-closure, naming U, logged once atwarn(D3 never reaches U, and a disabled package holds nothing for this read); U's members gain no grant, grants the rule already holds are kept, as for any refused recipient. Pin:refuses when the holder the caller reaches is disabled, naming the unrelated holder as outside the closure — never serving it, never silent(ablations A4–A6). First-party: 0 (no first-party package declares a queue). Seat 3 ruled it the D3 answer.维护者速读
IOwnershipQueueService)的三个按队列名读取的方法(resolveQueue、expandMembers、isMember)加了一个可选的「调用方软件包」参数。共享插件在读「声明的共享规则」的队列接收方时,把规则所在的包传进去,队列就从这个包出发解析:本包的队列,否则它声明依赖的包里唯一持有者,否则拒绝并列出全部候选。不传参数时与今天完全一样。packages/plugins/plugin-sharing/src/package-scoped-declarations.ts的resolveDeclaredName(调用方分支);sharing-rule-service.ts的queueRecipientCaller;packages/spec/src/contracts/ownership-queue-service.ts的新可选键。pnpm --filter @objectstack/plugin-sharing exec vitest run src/package-scoped-declarations.test.ts,预期 23 个用例全绿(新增 6 个)。What changes
@objectstack/spec/contracts).resolveQueue,expandMembersandisMembertake an optionalcallerPackageId(new exported typeOwnershipQueueCallerPackage=string | null). With a package id the name resolves from that package (ADR-0150 D3). Omitted,nullor'', the read is environment-wide, as before.queuesOfandhasAnyQueuename no queue and take none.declaredQueueNamed(the activation door's lookup) is unchanged: the door belongs to no package. An implementation written before the key still satisfies the contract (pinned).package-scoped-declarations.ts).resolveDeclaredNametakes an optional caller package. With one and a registry that carries the package-scoped slice, the answer is objectql'sresolvePackageScopedNamefrom that package, final: no one-listed-item shortcut (the one listed item may be outside the package's reach), and no first-registered fallback. The listing still bounds it: the resolver is asked overlistedHoldersView(registry), which leaves out a holder whose package is disabled (the filterlistItemsapplies) and changes nothing else. So a package whose one reachable holder is disabled gets the resolver's ownoutside-closurerefusal naming every holder still served, never the disabled holder's item and never silence. Without a caller package nothing changes.ownership-queue-service.ts). The three reads passcallerPackageIdto that resolution. Refusals answer as E4's do:null/[]/false, or underonFailedRead: 'refuse'aPackageScopedNameRefusedError(409 RESOURCE_CONFLICT, every candidate named), reported once per name and caller.sharing-rule-service.ts).assertQueueRecipientReachablebecomesqueueRecipientCaller: the same P-side check (now over the samelistedHoldersView), which still throws and reports its refusal first, and then it hands the rule's package toisMember/expandMembers. The check stays ahead of the read on purpose, so a queue service written before the key (environment-wide) can never serve a holder outside P's reach. NewqueueRecipientPackageOf(rule)answers the rule's package for a look-through that grants nothing.sharing-plugin.ts). "Does this queue recipient read the BU tree?" now resolves the rule's queue from the rule's package, so it reads the queue the grants are read from.queuesNaming). It reads every declared holder's specifications, not only the names an environment-wide read serves. Without this, a rule served by D'sq(a name U also declares) would not be re-evaluated when a position moves in D's queue, and its grants would go stale. Including a name more often only re-evaluates a rule, which then answers as before.@objectstack/specand@objectstack/plugin-sharing, with both declaration lines.Step 0: every implementer and caller of the contract
Measured at
43fb4822(main with E4).OwnershipQueueService(the one registered implementation)ownership-queue-failed-read.pin.test.tslegacydoublesharing-rule-service.ts(rule recompute, per-user pass)expandMembers,isMembersharing-plugin.ts(BU-tree look-through)resolveQueuesharing-service.ts(sitting-record access path)queuesOf,isMemberauthz-middleware,explain-accessisMemberownership-queue-gate.ts,kernel-queue-membership.tsresolveQueue,queuesOfcurrent-user-endpoints.tshasAnyQueuecatalog-activation.ts(activation door)declaredQueueNamedassignment-rules.ts(assignment pool)resolveQueue,expandMembersapproval-service.ts(approver slate)expandMembersEvery caller that passes no key compiles and answers as before. Test doubles in objectql, plugin-approvals and plugin-security are untouched.
Tests
New top-level
describein the E4 harnesssrc/package-scoped-declarations.test.ts(6 cases, realSchemaRegistry):support. From ALPHA,resolveQueueanswers BETA's queue,expandMembersanswers['u_beta'](also underrefuse),isMemberistrueforu_betaandfalseforu_gamma. Red on main.support: the standing grant tou_betais still desired (revokeRuleGrantsForRetiredRecipientsreturns0). Red on main (main throws the two-holder refusal).support: refused,ambiguous-in-closure, candidates BETA and GAMMA,409 RESOURCE_CONFLICTunderrefuse, nothing undernobody.undefined,null,''), same fixture as the first case: refused environment-wide naming BETA and GAMMA, exactly as main.resolveQueueisnullandexpandMembers[]; underrefusea409outside-closurerefusal naming GAMMA; the queue service warns once naming GAMMA; the declared rule's recompute throws the same refusal and the rule service warns naming GAMMA. Red on main (main serves GAMMA's members, silently).queuesNaming('position', …)findssupportfrom either holder's position. Red on main.Forced test change:
packages/spec/src/contracts/ownership-queue-failed-read.pin.test.tspinned the exact option keys (_ExpandOptionKeys,_IsMemberOptionKeys); both now includecallerPackageId. The file gains a seconddescribewith the new key's type pins. No other existing test was edited.Acceptance notes
git restore --source=43fb4822on the four source files, then restored,git diff HEADempty): 5 of the 6 new cases are red on main, 18 of 23 in the file green. The D-and-U case moves from refused to resolved, as the card asks. Two other cases also move, and both are declared here for the seat:Narrowingline above and in the changeset.ambiguous-in-environmentwith no caller on main,ambiguous-in-closurenaming ALPHA here). Same candidates, same409.assignment-rules.ts) and an approval step's queue (plugin-approvals) are also written inside a package and still read environment-wide. That is stricter than D3, never looser, the same interim E4 accepted for this card. Outside this card's file surface; carrier: epic 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 seat.OwnershipQueueCallerPackageand the option keycallerPackageId(the resolver's ownPackageScopedQuerykey). The seat's call.Verification
Head
f9c4e48b. Source last changed atd1d77686(the listed-holders view and the disabled-dependency refusal);f9c4e48bonly rewords the changeset, andcheck-adr-0087-registration,check-changeset-no-major,check-empty-changeset,check:issue-citations,check:nul-bytesandcheck:doc-authoringre-ran exit 0 on it.d1d77686:pnpm --filter @objectstack/plugin-sharing test(under the lock): Test Files 72 passed (72), Tests 1493 passed (1493). New block 6/6; harness file 23/23.typecheckexit 0. Rooteslint --no-inline-config packages/plugins/plugin-sharing/srcexit 0;packages/spec/src/contractsexit 0 (on20a19d69, unchanged since).@objectstack/spec:typecheckexit 0;check:test-typecheckOK (52 files / 240 errors / 131 signatures held, unchanged); contract pin file 2/2;check:generatedafter--fix:api-surfaceandexport-originsregenerated (+OwnershipQueueCallerPackage, 1 added, 0 breaking).typecheckexit 0 for@objectstack/objectql,plugin-approvals,plugin-security,plugin-hono-serverandruntime; their queue suites green: objectqlownership-queue.test.ts41/41, plugin-securitykernel-queue-membership+ownership-queue-gate46/46, plugin-approvalsapproval-service.test.ts463/463.dispatch-gates --ranond1d77686(re-derived; a fullturbo run build --filter=./packages/**ran first on20a19d69, lock VERDICT exit 0): 94 derived, 94 run, 0 NOT-MEASURED, 0 UNRUN, every one exit 0. Also 94/94 exit 0 on20a19d69.20a19d69under the lock (not owed: no!and no narrowing arm): Test Files 440 passed, 3 skipped (443); Tests 3652 passed, 41 skipped (3693); VERDICT command-exit 0. Not re-run ond1d77686: the only behaviour that moved since is the disabled-dependency refusal, which no first-party package can reach (0 queues declared).Ablations: five legs, each red, each restored (scripts/ablation-replace.mjs)
plugin-sharing tests import its source directly; no dist leg. Each leg: anchor 1 to 0, blob changed, run red, restored with blob == HEAD and
git diff HEADempty.resolveDeclaredName): 1 red,refuses when the caller's closure reaches two holders, naming both.20a19d69against the earlier silent not-found, is superseded: that code is gone.)two holderspins andreads environment-wide without a caller package ….d1d77686, for the epic seat's condition (the disabled-dependency refusal is reported, naming U):not-found): 2 red,refuses when the caller's closure reaches two holders …andrefuses when the holder the caller reaches is disabled, naming the unrelated holder ….listedHoldersViewunfiltered (a disabled holder counted): 1 red, the disabled-dependency pin (the disabled holder's queue served).🤖 Generated with Claude Code