Skip to content

Commit daf666a

Browse files
committed
docs(adr): ADR-0155 acceptance carries O7's pointer notes
ADR-0155 Acceptance criterion 2 has O7's dated, append-only pointer notes land in the edit that records the rulings. Under ruling record 6942854600 all five are owed: ADR-0139 D1 (one more leaf, and its read-verbs sentence for that leaf alone), ADR-0139 O4 (answered), ADR-0139 D3 (that leaf's driver declaration under R2), ADR-0111 D7 (R2's inert-grant arm, effective at the switch) and a cross-reference from ADR-0147 D-a (the shared seam's recipient rule on its anchor). ADR-0155 O7 records that they landed. No decision in those records moves beyond the note each names. Claude-Session: https://claude.ai/code/session_01ADHkmSLi1reMd27fT62jJ3 Co-authored-by: Claude <noreply@anthropic.com>
1 parent 73df76d commit daf666a

4 files changed

Lines changed: 38 additions & 1 deletion

‎docs/adr/0111-record-share-management-authority-and-verb-boundary.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,8 @@ Three write-time refusals so a persisted share always means something:
139139
2. **`grant()` validates the object is in an enforcing posture** — `effectiveSharingModel` is `private` or `read` **and** the object has an `owner_id` field. Otherwise → **422** (`SHARING_NOT_ENABLED`): a share on a public / bypass / owner-less object enforces nothing. `controlled_by_parent` is refused explicitly (Salesforce parity — a detail record is not independently shareable; its access follows the master).
140140

141141
*Amended 2026-10-24 (ruling 6377844010 on objectstack-ai/objectstack#25549, letter A; landed in #25591).* An external principal meets an owner-only floor on every object (ruling 6355206139, letter B), so a share row on a public object IS consulted for that population. On an object whose effective model is `public` and whose `owner_id` is real (not a federated phantom anchor), `grant()` therefore admits a `user` recipient whose `sys_member.role` in the record's organization is exactly `external`; every other recipient keeps the 422. The verdict reads the object and the recipient's population, never the granter. A sharing rule materialises rows for its external recipients only and reports the skipped half in one line. `controlled_by_parent` stays refused for every recipient.
142+
143+
*Amendment note 2026-11-17 ([ADR-0155](./0155-sharing-scope-share-grants-lower-to-an-engine-internal-semi-join-leaf.md), Accepted; ruling record [`6942854600`](https://github.com/objectstack-ai/objectstack/issues/33787#issuecomment-6942854600) on #33787, its ② ruled R2).* This rule gains one more arm. A share on an object whose evaluator cannot run ADR-0155's share-grant leaf (`driver-mongodb`, `driver-odata`, a driver this repository does not ship that does not declare it evaluates the leaf, or an object bound to another datasource than `sys_record_share`) enforces nothing, so `grant()` and the sharing-rule save door refuse it as inert with the same **422** (`SHARING_NOT_ENABLED`), and no gate consults existing grants on that object; owner, queue and approval access is unchanged. The arm takes effect with ADR-0155's plugin-sharing switch, with the boot report and changelog entry D10 asks for, and not before. Nothing else in D7 moves.
142144
3. **Manual and rule shares coexist by `source`.** The upsert key becomes `(object, record, recipient, source)` so a manual grant no longer clobbers a `source: 'rule'` row and vice versa. When multiple rows grant the same recipient, the widest `access_level` wins (Salesforce's RowCause model — grants are additive, never subtractive).
143145

144146
### D8 — Share-link re-share semantics are made explicit

‎docs/adr/0139-engine-internal-semi-join-leaf-readable-parent-ids.md‎

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,14 @@ any position but a `$in` comparand, the engine refuses it loudly. ⛔ No second
151151
> `FIELD in current_user.org_user_ids` names, under its own brand, never as a mode of `ReadableIds`. "No `EXISTS`, no
152152
> correlated form" stands. So does everything this D1 says about `ReadableIds`.
153153
154+
> **Amendment note (2026-11-17, [ADR-0155](./0155-sharing-scope-share-grants-lower-to-an-engine-internal-semi-join-leaf.md) — ruling record [`6942854600`](https://github.com/objectstack-ai/objectstack/issues/33787#issuecomment-6942854600) on #33787).**
155+
> ADR-0155 (Accepted) revisits "No second leaf" for **one** more leaf and nothing else: the record ids that
156+
> `sys_record_share` grants one user on one object (provisionally `SharedRecordIds`), under its own brand, never as a
157+
> mode of `ReadableIds` or of ADR-0147's leaf. It is the second record to do so, and a new leaf still needs a Tier H
158+
> record of its own. It also revisits this D1's read-verbs sentence for that leaf alone (its ③, ruled A): the leaf's
159+
> write form is legal in the `where` of a predicate `update`, and nowhere else. For `ReadableIds`, for ADR-0147's leaf
160+
> and on `delete`, the sentence stands as written. "No `EXISTS`, no correlated form" stands.
161+
154162
### D2 — ObjectQL composes the scope, once per parent object per request, fail closed
155163

156164
At the engine's executor boundary — on the final AST, after ingress parsing, the comparand doors, the middleware chain
@@ -203,6 +211,15 @@ restriction".
203211
- The leaf joins the per-driver conformance case-sets, so a driver that compiles it is measured and one that refuses
204212
is recorded as refusing.
205213

214+
> **Amendment note (2026-11-17, [ADR-0155](./0155-sharing-scope-share-grants-lower-to-an-engine-internal-semi-join-leaf.md) — ruling record [`6942854600`](https://github.com/objectstack-ai/objectstack/issues/33787#issuecomment-6942854600) on #33787).**
215+
> The refusal bullet's "⛔ No `DriverCapabilities` bit returns" is revisited for ADR-0155's leaf alone, as ADR-0147
216+
> revisits it for its own. Under ADR-0155's ②, ruled R2 for the storage that cannot run that leaf, a driver declares
217+
> whether it evaluates such leaves, and the declaration is read up front: on an object whose evaluator does not
218+
> declare it, the producer writes no share arm and share grants are refused as inert (ADR-0111 D7, as noted there).
219+
> A leaf that still reaches a driver that cannot run it is refused in this bullet's envelope (its R1). The
220+
> declaration's name is ADR-0155's O1, and where ADR-0147's declaration is the same one, it is built once (ADR-0155
221+
> D4). This note moves nothing this section says about `ReadableIds`.
222+
206223
### D4 — The six consumers emit one leaf per parent object, and no pre-scan
207224

208225
- **The activity stream and the compliance ledger** keep
@@ -373,6 +390,11 @@ change is #33696's, and by the ruling it lands only after this amendment merges.
373390
- **O3** — `driver-mongodb`: the cost of a pipeline form is unprototyped; it refuses until measured.
374391
- **O4** — `packages/plugins/plugin-sharing/src/sharing-service.ts` reads a caller's record-share grants at
375392
`limit: 5000` with no warning; that scope rides into the subquery unchanged. A separate finding, not this record's.
393+
**Answered** (2026-11-17): [ADR-0155](./0155-sharing-scope-share-grants-lower-to-an-engine-internal-semi-join-leaf.md)
394+
(Accepted; ruling record
395+
[`6942854600`](https://github.com/objectstack-ai/objectstack/issues/33787#issuecomment-6942854600) on #33787) lowers
396+
the share arm to its own engine-internal semi-join leaf over `sys_record_share`, with no cap, so every grant counts.
397+
The amendment notes under D1 and D3 say what that record revisits here.
376398
- **O5** — whether `controlled_by_parent`'s id set becomes a seventh consumer (D6). **Answered** (2026-10-21): the
377399
ruling is recorded verbatim in D6, as amended.
378400

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

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,18 @@ when the read runs, where the array was read when the request was resolved ([Con
167167
With no active organization the leaf composes to the plain `$in: [caller]`, and no subquery is issued.
168168
- **The name.** `OrgMemberIds` is the proposed name, a new export of `@objectstack/spec` beside `ReadableIds` (O1).
169169

170+
> **Amendment note (2026-11-17, [ADR-0155](./0155-sharing-scope-share-grants-lower-to-an-engine-internal-semi-join-leaf.md) — ruling record [`6942854600`](https://github.com/objectstack-ai/objectstack/issues/33787#issuecomment-6942854600) on #33787).**
171+
> ADR-0155 (Accepted) adds a third leaf over `sys_record_share`, and the executor seam that passes an
172+
> arrives-composed leaf through is built once for both leaves (its D4, "Built once"). That seam holds one recipient
173+
> rule for both: every identity a composed leaf names is compared with what the reading context itself carries. For
174+
> this record's leaf it compares the anchor's caller and organization, together, with the anchor the reading context
175+
> carries (D-e), and admits the leaf only when both are equal; a system context is exempt; a mismatch, or a reading
176+
> context that carries no anchor, is a composition fault refused in ADR-0139 D3's envelope. Nothing is re-derived from
177+
> the context's `userId` or `tenantId`, and the delegator's rebuilt context of D-c carries the live principal's anchor
178+
> and is admitted under it. The rule checks the anchor; it changes neither what the anchor carries nor where it is
179+
> captured (this D-a and D-c), and nothing else in this record moves. Its cases are pinned on the card that adds this
180+
> leaf to the seam (ADR-0155 plan step 2).
181+
170182
### D-b — The inner filter: exactly today's read
171183

172184
The subquery is the resolver's own read, restated as SQL, with nothing added:

‎docs/adr/0155-sharing-scope-share-grants-lower-to-an-engine-internal-semi-join-leaf.md‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -837,7 +837,8 @@ ADR-0147's leaf and `delete` keep it as written. B and C were not taken.
837837
seam and what its recipient rule checks on that record's anchor (D4). They land with the governed edit that records
838838
the maintainer's rulings in this record's Status line. The first acceptance criterion already requires that edit,
839839
and the same rulings decide which notes are owed. None is in this record's diff, which adds this record and its
840-
index row and edits no other record.
840+
index row and edits no other record. **Landed** (2026-11-17): all five, dated and append-only, in the edit that
841+
records the rulings in the Status line.
841842
- **O8** — Readers of `buildReadFilter` and of the security service's read filter outside this repository (the cloud
842843
repository's packages) were not read from this tree, and neither was any host that registers an object-scoped
843844
middleware or a find hook for `sys_record_share` by name (D4), an opt-in of that table into record-view auditing

0 commit comments

Comments
 (0)