Skip to content

Commit 15d05d2

Browse files
committed
docs(permissions): the system-context census row for the served master-detail write check's system exit
Claude-Session: https://claude.ai/code/session_01WYYhVJ78u7PhwFViWo1EmQ Co-authored-by: Claude <noreply@anthropic.com>
1 parent bdce014 commit 15d05d2

1 file changed

Lines changed: 8 additions & 7 deletions

File tree

‎content/docs/permissions/system-context.mdx‎

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ the seed loader replaying package fixtures, a plugin's boot reconciler, a
1010
service self-write, a migration.
1111

1212
This page is **the authority** for what that flag actually does. It exists
13-
because the flag is not one concept: it is a single boolean read at **121
13+
because the flag is not one concept: it is a single boolean read at **122
1414
distinct sites across 20 packages**, and knowing three of those behaviours gives
1515
no hint that the other hundred-and-four exist. Every documented app-side bug
1616
traced to `isSystem` had the same shape — the metadata was complete and correct,
@@ -106,6 +106,7 @@ that silently does not happen.
106106
| 7 | Write bypass = `true`, effective write scope = `org` | plugin-security | Get: widest write scope without holding any capability | `packages/plugins/plugin-security/src/security-plugin.ts#start` |
107107
| 8 | Metadata-plane schema masking exempt (ADR-0106 D4) | metadata-core | Get: unmasked object schema. Note: the exemption is a **caller** property — it short-circuits before the security service is consulted | `packages/metadata-core/src/object-schema-fls.ts#isObjectSchemaMaskExempt` |
108108
| 9 | `explain()` may target a principal other than the caller | plugin-security | Get: no `manage_users` / delegated-admin check | `packages/plugins/plugin-security/src/security-plugin.ts#explainAccessForCaller` |
109+
| 9b | The master-detail write check the `security` service serves (`checkControlledByParentWrite`, ADR-0055) answers `allow` | plugin-security | Get: `allow` for any record, with no master judged — the write path's own first exit, so a gate composing it admits exactly what the record's own system-context update would. Lose: nothing a caller reaches today: its two consumers, the `sys_attachment` and `sys_comment` parent gates, return before they ask for a system session | `packages/plugins/plugin-security/src/security-plugin.ts#checkControlledByParentWrite` |
109110
| 10 | Anonymous-deny treats the caller as authenticated | core | Get: passes the 401 seam with no `userId` | `packages/core/src/security/anonymous-deny.ts#shouldDenyAnonymous` |
110111
| 11 | Permission-set projection middleware skipped | plugin-security | Lose: projection of permission-set-derived columns | `packages/plugins/plugin-security/src/permission-set-projection.ts#createPermissionSetWriteThrough` |
111112
| 11b | Position write-through skipped — a `sys_position` write is not mirrored into the environment ledger | plugin-security | Get: the seeders and the package door write rows for definitions that already have their home, untouched. Lose: a system-written row has no environment definition, so the security catalog read does not resolve it until a data-door edit, or the one-time row-only position backfill, gives it one | `packages/plugins/plugin-security/src/position-write-through.ts#createPositionWriteThrough` |
@@ -142,7 +143,7 @@ that silently does not happen.
142143

143144
### 3. Sharing (`plugin-sharing`)
144145

145-
The largest single consumer — **17 of the 121 sites**.
146+
The largest single consumer — **17 of the 122 sites**.
146147

147148
| # | Behaviour when `isSystem` | What you get / what you lose | Anchor |
148149
|:--|:---|:---|:---|
@@ -285,7 +286,7 @@ Ownership injection, `readonly` bypass and sharing materialisation are
285286
independent decisions, and a seed loader plausibly wants the first two but not
286287
the third. The concept is nevertheless **staying as one boolean**:
287288

288-
- **Shipped semantics.** `isSystem` is a published contract with 121 read sites
289+
- **Shipped semantics.** `isSystem` is a published contract with 122 read sites
289290
in 20 packages. Splitting it is a breaking contract change across all of them.
290291
(The ruling was taken when the census read 80 sites in 18 packages; the count
291292
has grown, which strengthens rather than weakens the argument.)
@@ -359,16 +360,16 @@ still holds equal to the census on every pull request:
359360
| Appearances of the bare identifier `isSystem` in non-test sources | 813 | — |
360361
| — parsed as a declaration | 28 | ✅ |
361362
| — parsed as an object-literal / type key (producers and option objects) | 310 | — |
362-
| — parsed as a property **read** | 127 | ✅ |
363+
| — parsed as a property **read** | 128 | ✅ |
363364
| — parsed in some other syntactic position (a local, a cast, a conditional) | 9 | ✅ |
364365
| — the remainder: text inside comments and string literals | 358 | — |
365366
| Of those reads: reads of one of the unrelated metadata fields | 6 | ✅ |
366-
| Of those reads: reads of `ExecutionContext.isSystem` | **121** | ✅ |
367-
| — behaviour-bearing (rows 1–61 above) | 118 | ✅ |
367+
| Of those reads: reads of `ExecutionContext.isSystem` | **122** | ✅ |
368+
| — behaviour-bearing (rows 1–61 above) | 119 | ✅ |
368369
| — carry the flag onward only (rows 62–64 above) | 3 | ✅ |
369370
| Packages containing at least one elevation read | **20** | ✅ |
370371
| Files containing at least one elevation read | 57 | ✅ |
371-
| — the distinct symbols those reads live in — what this page anchors | 103 | ✅ |
372+
| — the distinct symbols those reads live in — what this page anchors | 104 | ✅ |
372373
| — of those files, the ones holding more than one read in one symbol | 8 | ✅ |
373374

374375
The six rows marked — are a **dated decomposition, not a live claim**: they were

0 commit comments

Comments
 (0)