Skip to content

Commit 9ea89d0

Browse files
os-warrenclaude
andcommitted
docs(adr): ADR-0142 D6 states the ruled node refusal on a failed directory read; D2 names every read the expansion makes
Round 2 of the contract review. D6: on a failed read behind a queue, team or position approver the approval node refuses to open under every onEmptyApprovers policy, loudly, with its own retryable error class naming the failed read; the execution point is named (the resolver's directoryFailure, the queue branch's early return, openNodeRequest before slateNamesAPerson). D2: the fault list covers the sys_queue row read, so a queue that could not be resolved is not a queue that resolves nowhere; a refusal names the read. Item 2 spells the never-written literal by the queue's machine name. Status line cites both ruling records. Claude-Session: https://claude.ai/code/session_01JQwxbYJgdcYRwx5iQa5Ksc Co-authored-by: Claude <noreply@anthropic.com>
1 parent 2f923ae commit 9ea89d0

1 file changed

Lines changed: 31 additions & 23 deletions

File tree

‎docs/adr/0142-ownership-queue-membership-claim-and-assignment-rules.md‎

Lines changed: 31 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# ADR-0142: An ownership queue is a platform primitive — a queue entity, membership through the existing recipient kinds, claim through the ownership-transfer gate, and declarative assignment rules evaluated on insert
22

3-
**Status**: Proposed (2026-10-25) · **Amended** (2026-10-28, ruling [`6457475657`](https://github.com/objectstack-ai/objectstack/issues/25769#issuecomment-6457475657) on #25769, letter A) — D3's `current_user.queues` producer is `@objectstack/plugin-security`, kernel-side, under the reserved key `queues`; see the note in D3 · **Amended** (2026-11-03, ruling record [`6594432222`](https://github.com/objectstack-ai/objectstack/issues/29604#issuecomment-6594432222) on #29604, letter B) — D2 tells an empty expansion (a fact) from a failed member-table read (a fault): the admission consumers (D3, D4, D5) keep "nobody" on a failed read, the D6 approver slate and the D7 grant recompute refuse it; see the notes in D2, D6 and D7. `docs/adr/**` is Tier H (Prime Directive #14): this record becomes **Accepted** by the
3+
**Status**: Proposed (2026-10-25) · **Amended** (2026-10-28, ruling [`6457475657`](https://github.com/objectstack-ai/objectstack/issues/25769#issuecomment-6457475657) on #25769, letter A) — D3's `current_user.queues` producer is `@objectstack/plugin-security`, kernel-side, under the reserved key `queues`; see the note in D3 · **Amended** (2026-11-03, ruling records [`6594432222`](https://github.com/objectstack-ai/objectstack/issues/29604#issuecomment-6594432222) and [`6599731698`](https://github.com/objectstack-ai/objectstack/issues/29604#issuecomment-6599731698) on #29604, letter B in both) — D2 tells an empty expansion (a fact) from a failed read behind the queue (a fault): the admission consumers (D3, D4, D5) keep "nobody" on a failed read, the D7 grant recompute refuses it, and the D6 approver slate refuses it with the approval node refusing to open; see the notes in D2, D6 and D7. `docs/adr/**` is Tier H (Prime Directive #14): this record becomes **Accepted** by the
44
maintainer's merge, and ⛔ the one PR under [Execution plan](#execution-plan-after-acceptance) is cut after that merge,
55
never before it. Until a published `@objectstack/*` release carries that PR, HotCRM keeps the STOPGAP module this record
66
exists to retire. **This record declares; it implements nothing** — no schema, no code, no changeset.
@@ -312,11 +312,14 @@ empty expansion is a fact, not a fault: the consumers below each say what they d
312312
2026-11-03, ruling record [`6594432222`](https://github.com/objectstack-ai/objectstack/issues/29604#issuecomment-6594432222)
313313
on #29604, letter B). An expansion is *empty* when every member specification was read and reached nobody — an unstaffed
314314
position, an emptied team, a queue with no member rows, a name that resolves nowhere (D1) — and the consumers below each
315-
say what they do with it. A read *fails* when a member table a specification reads (`sys_queue_member`, `sys_user_position`,
316-
`sys_team_member`, `sys_business_unit_member`, the BU tree) cannot be read at all: the expander then knows nothing about
317-
who is in the queue, and "nobody" would be an invented answer. A table that does not exist in the composition is absence,
318-
not failure, as the sibling recipient reads already hold it. Who is owed which answer follows from what the consumer does
319-
with the set, and the consumer says which it is owed when it calls (how the call says so is the implementing PR's):
315+
say what they do with it. A read *fails* when any read the expansion makes cannot be read at all — the queue's own row
316+
(`sys_queue`, through which an authored queue resolves), the member rows (`sys_queue_member`), and the member tables a
317+
specification reads (`sys_user_position`, `sys_team_member`, `sys_business_unit_member`, the BU tree): the expander then
318+
knows nothing about who is in the queue, and "nobody" would be an invented answer. A queue that could not be resolved is
319+
not a queue that resolves nowhere: the first is a failed read, the second is absence. A table that does not exist in the
320+
composition is absence, not failure, as the sibling recipient reads already hold it. Who is owed which answer follows
321+
from what the consumer does with the set, and the consumer says which it is owed when it calls (how the call says so is
322+
the implementing PR's):
320323

321324
- the **admission consumers** — the access path (D3), the claim admission (D4) and the assignment pool (D5) — keep
322325
**"nobody"** for a failed read, logged at `warn`, because for them nobody *denies*: a sitting record is not reached
@@ -327,8 +330,8 @@ with the set, and the consumer says which it is owed when it calls (how the call
327330
read: they turn the member set into routed work or materialised grants, so "nobody" there revokes every grant the queue
328331
gave and routes a request past the people who could not be read — the posture every other sharing and approvals
329332
recipient read gave up when the team, position and role reads were made to read to completion and refuse a failed read.
330-
A refusal is a thrown failure naming the specification and the table, never `[]` or `false`; what each refusing
331-
consumer does with it is written under D6 and D7.
333+
A refusal is a thrown failure naming the read, never `[]`, `null` or `false`; what each refusing consumer does with it
334+
is written under D6 and D7.
332335

333336
**Membership moves, and three things follow it.** A write to `sys_queue_member`, and a write to any membership table a
334337
queue's members read (`sys_user_position`, `sys_team_member`, `sys_business_unit_member`, the BU tree), changes who is in
@@ -525,8 +528,9 @@ remove gate; Prime Directive #10):
525528
ADR-0105 D9), and the queue service expands it.
526529
2. `resolveApproverSpec` gains the queue branch: the slate is the queue's expansion; an empty expansion warns as the
527530
graph types do ("expanded to nobody") and then returns `[]` as the person types do — a new combination, because the
528-
graph path writes the `type:value` literal after its warning and this branch must not. The `queue:<id>` literal slot
529-
is never written again; a slot a stored request already holds stays as stored, decidable by the override, exactly as
531+
graph path writes the `type:value` literal after its warning and this branch must not. The `queue:<name>` literal slot
532+
(the queue's machine name, D1, as the resolver writes an approver's `value`) is never written again; a slot a stored
533+
request already holds stays as stored, decidable by the override, exactly as
530534
ADR-0090 D3's `role:` slots are. The node's `onEmptyApprovers` decides the empty slate.
531535
3. The spec drops `queue` from `NON_AUTHORABLE_APPROVER_TYPES` and so from `xEnumDeprecated`; `APPROVER_VALUE_BINDINGS.queue`
532536
becomes a real binding — a kind the designer contract does not have today, "a catalog item **or** an organization row,
@@ -539,18 +543,22 @@ remove gate; Prime Directive #10):
539543
5. A test drives a stored `queue` approver through the real service to a slate of the queue's members, and the
540544
cross-organization integration suite gains the queue case.
541545

542-
**Amended** (2026-11-03, ruling record [`6594432222`](https://github.com/objectstack-ai/objectstack/issues/29604#issuecomment-6594432222)
543-
on #29604, letter B) — item 2's "expanded to nobody" is the *empty* case of D2 as amended. A **failed** member-table read
544-
behind the queue **refuses** the slate instead of shrinking it, in the failure class the approvals resolver already gives a
545-
`team` or `position` approver whose directory read failed (#29362, #29503): the expansion throws rather than answering
546-
`[]`; the resolver's directory-failure catch takes the throw and warns that the read **failed**, carrying the error, never
547-
that the queue "expanded to nobody" (`packages/plugins/plugin-approvals/src/approval-service.ts#warnExpansionFailed` is
548-
that warning), so an operator is not sent to staff a queue whose members simply could not be read; and the request is not
549-
routed on an invented set: the slot is **held** as the `queue:<name>` literal, as a `team` whose read failed is held — a
550-
slot no acting path admits a caller under, decidable by the override — so the request waits rather than advances past the
551-
queue's people. Item 2's "never written again" is therefore the empty case: a member who joins later is not owed a request
552-
that expanded to nobody, while a failed read owes the request to members who exist and could not be read.
553-
`onEmptyApprovers` decides an empty slate as before and is not reached through a held slot.
546+
**Amended** (2026-11-03, ruling records [`6594432222`](https://github.com/objectstack-ai/objectstack/issues/29604#issuecomment-6594432222) and
547+
[`6599731698`](https://github.com/objectstack-ai/objectstack/issues/29604#issuecomment-6599731698) on #29604, letter B in
548+
both) — item 2's "expanded to nobody" is the *empty* case of D2 as amended. A **failed** read behind the queue (D2)
549+
**refuses** the slate, and the approval node then **refuses to open**, under every `onEmptyApprovers` policy alike
550+
(`admin_rescue`, `auto_approve`, `fail`, `fallback`): the request is not routed to the organization's administrators, not
551+
auto-approved and not opened on a fallback slate. The node fails loudly with an error class of its own — not `NO_APPROVERS`,
552+
not "expanded to nobody" — that names the read that failed, and the failure is retryable: the run is re-triggered once the
553+
directory reads again. No parked or auto-retry state is part of this decision; one that is wanted is its own card. The
554+
ruling puts a `team` or `position` approver whose directory read failed in the same class, so the one node refusal covers
555+
the three; it replaces the earlier wording of record 6594432222, under which a refused slate followed the approvals
556+
resolver's existing failure class. The execution point: the directory-failure catch of
557+
`packages/plugins/plugin-approvals/src/approval-service.ts#resolveApproverSpec` already records the failure
558+
(`directoryFailure`); the `queue` branch's early "expanded to nobody" return must consult it first, and
559+
`packages/plugins/plugin-approvals/src/approval-service.ts#openNodeRequest` must see it and refuse before
560+
`packages/plugins/plugin-approvals/src/approver-address.ts#slateNamesAPerson` hands the slate to `onEmptyApprovers`. Item
561+
2's "never written again" stays whole: a failed read writes no `queue:<name>` literal and no slot of any kind.
554562

555563
What it resolves to at runtime: the queue's members at node entry, in the request's organization. Re-admission is not an
556564
ADR-0087 conversion: the enum member never left, no stored shape changes, and the designer annotation is not a protocol
@@ -585,7 +593,7 @@ The recipient becomes authorable in the same PR when **all** of the following ho
585593

586594
**Amended** (2026-11-03, ruling record [`6594432222`](https://github.com/objectstack-ai/objectstack/issues/29604#issuecomment-6594432222)
587595
on #29604, letter B) — item 1's "an empty queue grants nothing and warns once" is the *empty* case of D2 as amended. A
588-
**failed** member-table read behind the queue **refuses** the grant pass instead of answering nobody, and every pass that
596+
**failed** read behind the queue (D2) **refuses** the grant pass instead of answering nobody, and every pass that
589597
materialises or revokes a queue recipient's grants takes the refusal in the isolation shape the other recipient kinds
590598
already have (#29362, #29503): the rule-wide passes (`evaluateRule`, the per-record `evaluateAllForRecord` and the
591599
recipient-axis `revokeRuleGrantsForRetiredRecipients` in `packages/plugins/plugin-sharing/src/sharing-rule-service.ts`) and

0 commit comments

Comments
 (0)