Skip to content

Commit 723e27a

Browse files
committed
docs(adr): ADR-0147 round 3 — OrgMemberIds is the proposed name; ADR-0057-erp gains its Status-line Amended entry
Seat rulings on PR #29501 round 2: naming is the lane seat's call, so O1 names OrgMemberIds as proposed and leaves the driver-declaration name to the S1 spec card, with no maintainer gate; ADR-0057-erp's Status line gains one inline Amended entry pointing at its D3 note (after the ADR-0131 entry; the indexer keys on the earliest keyword, Accepted). Claude-Session: https://claude.ai/code/session_01ADHkmSNasUm3e1dfbV5aaD Co-authored-by: Claude <noreply@anthropic.com>
1 parent e010433 commit 723e27a

2 files changed

Lines changed: 13 additions & 12 deletions

‎docs/adr/0057-erp-authorization-core-business-units-and-scope-depth.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# ADR-0057: ERP-Grade Authorization Core — Business-Unit Partitioning, Scope-Depth Grants, and Hierarchy Rollup
22

3-
**Status**: Accepted in part (2026-06-21) — D1–D3/D8 implemented (scope-depth enum + evaluator, `sys_business_unit` tree, hierarchy-resolver seam, conformance rows); **D4–D7 superseded by ADR-0090 D3 / ADR-0095**: the `sys_role`/`sys_user_role`/`role_and_subordinates` vocabulary never shipped — the code realizes them as flat `sys_position`/`sys_user_position` with rollup on the BU tree. This ADR's own implementation-status table predates that supersession; read it with the rename applied. · **Amended** (2026-10-14, [ADR-0131](./0131-total-organization-ownership-no-null-organization-id.md) D3/D13): the flat `sys_position` row object named above is itself retired by #15204 stage 8 (`66949b7729`, 2026-10-13), and its `sys-position.object.ts`, which the path note below names, is deleted; a position is a metadata-registry definition, and the `sys_user_position` assignment stays.
3+
**Status**: Accepted in part (2026-06-21) — D1–D3/D8 implemented (scope-depth enum + evaluator, `sys_business_unit` tree, hierarchy-resolver seam, conformance rows); **D4–D7 superseded by ADR-0090 D3 / ADR-0095**: the `sys_role`/`sys_user_role`/`role_and_subordinates` vocabulary never shipped — the code realizes them as flat `sys_position`/`sys_user_position` with rollup on the BU tree. This ADR's own implementation-status table predates that supersession; read it with the rename applied. · **Amended** (2026-10-14, [ADR-0131](./0131-total-organization-ownership-no-null-organization-id.md) D3/D13): the flat `sys_position` row object named above is itself retired by #15204 stage 8 (`66949b7729`, 2026-10-13), and its `sys-position.object.ts`, which the path note below names, is deleted; a position is a metadata-registry definition, and the `sys_user_position` assignment stays. · **Amended** (2026-11-02, [ADR-0147](./0147-membership-scoped-rls-lowers-to-an-engine-internal-org-member-semi-join-leaf.md), #29360): D3's "mirroring the `org_user_ids` cap" carries a dated note; that cap no longer exists, and D3's own bound requirement is unchanged.
44
**Shares its number with**: [`0057-system-data-lifecycle-and-retention`](./0057-system-data-lifecycle-and-retention.md) (System data has a lifecycle — declarative retention, rotation, and reclamation) — an unrelated decision under the same number. Numbers are never reassigned (AGENTS.md Prime Directive 13); cite this record unambiguously as `ADR-0057-erp-authorization-core-business-units-and-scope-depth`.
55
**Deciders**: ObjectStack Protocol Architects
66
**Path note (2026-09), paths only — no decision changes**: this record cites the **pre-rename**

‎docs/adr/0147-membership-scoped-rls-lowers-to-an-engine-internal-org-member-semi-join-leaf.md‎

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,12 @@ are cut after acceptance and ⛔ never before it. **This record declares; it imp
2222
(the RLS compiler's deliberate lack of a subquery form, unchanged here), [ADR-0105](./0105-group-tenancy-posture-and-first-class-org-scope.md)
2323
D2 / D11 (`accessible_org_ids`; the `rls-membership-resolver` seam), [ADR-0091](./0091-grant-lifecycle-and-recertification.md) (validity windows), [ADR-0049](./0049-no-unenforced-security-properties.md)
2424
(enforce-or-remove), [ADR-0112](./0112-error-code-vocabulary-and-ledger.md) (the refusal envelope).
25-
- **Amends**: three places, each by a dated, append-only pointer note and nothing else (no Status line moves) —
25+
- **Amends**: three places, each by a dated, append-only pointer note and nothing else —
2626
[ADR-0139](./0139-engine-internal-semi-join-leaf-readable-parent-ids.md) D1 ("No second leaf") and D3 ("No
2727
`DriverCapabilities` bit returns"), each revisited for this one leaf; and
2828
[ADR-0057-erp-authorization-core-business-units-and-scope-depth](./0057-erp-authorization-core-business-units-and-scope-depth.md)
29-
D3's "mirroring the `org_user_ids` cap" (the cap it cites no longer exists).
29+
D3's "mirroring the `org_user_ids` cap" (the cap it cites no longer exists). That record's Status line also gains one
30+
inline `· **Amended**` entry pointing at the note, after its ADR-0131 entry. ADR-0139's Status line does not move.
3031
- **Leaves unchanged**: the authoring spelling of every RLS predicate, `defaultRowScope` and shipped permission set; the
3132
RLS compiler's closed pushdown form set and its lack of an authorable subquery form; `ReadableIds` (ADR-0139) and
3233
its six consumers; the `rlsMembership` contract ([D-f](#d-f--the-same-class-rlsmembership-is-out-of-scope-with-the-reason));
@@ -52,7 +53,7 @@ backend's bound-parameter limit every `sys_user` read fails with a 500 (measured
5253
32,000 members and refused 40,000; the Postgres protocol caps a statement at 65,535 parameters).
5354

5455
**Decision.** The spelling stays. The compiler lowers `FIELD in current_user.org_user_ids` to a second branded
55-
engine-internal comparand, a sibling of ADR-0139's `ReadableIds`, provisionally named `OrgMemberIds`. It means exactly
56+
engine-internal comparand, a sibling of ADR-0139's `ReadableIds`, named `OrgMemberIds`. It means exactly
5657
the set the list holds today: the caller, plus every non-blank `user_id` of the active organization's `sys_member` rows,
5758
read with system authority and filtered by nothing else. The SQL family compiles it to `IN (SELECT user_id FROM
5859
sys_member WHERE …)`. Every other evaluator (a driver that does not compile it, a federated object, an in-process
@@ -164,8 +165,7 @@ when the read runs, where the array was read when the request was resolved ([Con
164165
```
165166

166167
With no active organization the leaf composes to the plain `$in: [caller]`, and no subquery is issued.
167-
- **The name is provisional.** `OrgMemberIds` would be a new export of `@objectstack/spec` (as `ReadableIds` is), so it
168-
lands only under a name the maintainer approves (O1).
168+
- **The name.** `OrgMemberIds` is the proposed name, a new export of `@objectstack/spec` beside `ReadableIds` (O1).
169169

170170
### D-b — The inner filter: exactly today's read
171171

@@ -226,8 +226,8 @@ the floor path the evaluator is handed `$in: S` and answers exactly as today.
226226
choose the plan is consulted, so it is not the inert bit ADR-0049 removes. **This revisits ADR-0139 D3's "⛔ No
227227
`DriverCapabilities` bit returns" for this one leaf:** D3's reason (a bit the engine does not consult is inert)
228228
holds for `ReadableIds`, whose answer is compile-or-refuse, and fails here, where a refusal is excluded. ADR-0139 D3
229-
carries a dated pointer to this record; `ReadableIds` keeps D3 as written. The declaration's name and shape are the
230-
spec card's, under the maintainer's naming approval (O1).
229+
carries a dated pointer to this record; `ReadableIds` keeps D3 as written. The declaration's name and shape are fixed by
230+
the S1 spec card (O1).
231231
- **Every occurrence, nested ones included.** The choice is made for every occurrence of the leaf in the filter an
232232
evaluator receives, including one inside a `ReadableIds` leaf's composed `scope`. That happens when the parent P is
233233
`sys_user` or any object whose RLS names `org_user_ids`, and ADR-0139 D2 composes P's scope from `getReadFilter(P)`:
@@ -348,8 +348,9 @@ caller's own memberships, not by an organization's size, and are out of scope to
348348

349349
## Open items (not blocking acceptance; each becomes a reading on its card)
350350

351-
- **O1** — The leaf's name (provisionally `OrgMemberIds`) and the driver's compile declaration are new public names in
352-
`@objectstack/spec`. They land under names the maintainer approves, decided with this record's approval.
351+
- **O1** — Names. The leaf's proposed name is `OrgMemberIds`. The driver's compile declaration is named by the S1
352+
spec card. Both are new public names in `@objectstack/spec`; naming is the lane seat's call, with no separate
353+
maintainer gate.
353354
- **O7** — The analytics read-scope compiler takes the floor. Compiling the leaf in its own SQL is a later card in the
354355
`service-analytics` lane, measured against the floor-parity pin.
355356
- **O2** — `driver-mongodb`: the cost of a `$lookup` compilation is unprototyped (shared with ADR-0139 O3). It takes
@@ -369,8 +370,8 @@ caller's own memberships, not by an organization's size, and are out of scope to
369370

370371
The maintainer approves this record (Tier H), with the three pointer notes it carries: ADR-0139 D1 ("No second
371372
leaf"), ADR-0139 D3 ("No `DriverCapabilities` bit returns"), and ADR-0057-erp D3's "`org_user_ids` cap" bullet. Each is
372-
append-only and dated, and none moves a Status line. The maintainer also approves the names O1 asks for, with this
373-
record.
373+
append-only and dated. ADR-0057-erp's Status line carries the one inline `· **Amended**` entry that points at its note;
374+
ADR-0139's Status line does not move.
374375

375376
## Execution plan (after acceptance)
376377

0 commit comments

Comments
 (0)