You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit e3f0aa4
Browse filesBrowse the repository at this point in the historyBrowse files
docs(permissions): count the record-file verbs in the tenant-audit and system-context censuses (#30892)
The upload link's field write and the conditional spend are two engine
write call sites (263, from 261), regenerated with
`tenant-audit-census.mjs --write` and the page's hand-stated figures
moved to match. Row 47e names the record-file verbs beside the attach
verbs: both refuse the system context through a `requireUserContext`,
so the row's key is now pinned per file.
Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016WV4cyqd3A7fbCWrqM3KCz
Copy file name to clipboardExpand all lines: content/docs/permissions/system-context.mdx
+2-1Lines changed: 2 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -186,7 +186,7 @@ One of the largest consumers of the flag;
186
186
| 47b | The inbound-mail ingest seam: `ingest` admits the system context ALONE, and `rematch` admits it without the organization, owner or `manage_mailboxes` check | service-mailbox | Get: a mail source hands a mailbox its messages, and server code re-matches any mailbox. Lose: nothing a user held — every other caller of `ingest` is refused (`PERMISSION_DENIED`), because an ingested message is shown on every record its correspondents' addresses match and a user who could hand the seam a message could write one in a correspondent's name; every other caller of `rematch` must be in the mailbox's organization and own the mailbox or hold `manage_mailboxes`|`ingest`, `authorizeRematch`|
187
187
| 47c | The inbound-mail IMAP sync: `syncMailbox` and `syncAll` admit the system context ALONE | service-mailbox | Get: the sync job reads every mailbox row (its organization, address and IMAP cursor), writes the cursor back, and hands each fetched message to `ingest` under the system context. Lose: nothing a user held — every other caller is refused (`PERMISSION_DENIED`), because a sync stores a mailbox's mail and moves its cursor |`syncMailbox`, `syncAll`|
188
188
| 47d | The print service REFUSES the system context: `printRecordToFile` admits a human user acting for themselves alone | service-print | Get: nothing — a system caller is refused (`PERMISSION_DENIED`) before any page is read, session minted or browser started. Lose: nothing a user held — the PDF is rendered as the requesting user and never as the system, so a record is archived only by someone who could read it |`refuseUnlessHumanCaller`|
189
-
| 47e | The caller-scoped attach verbs REFUSE the system context: `attachFileAs` and `assertMayAttach` admit a signed-in user alone| service-storage | Get: nothing — a system caller is refused (`PERMISSION_DENIED`); the system attaches through `attachFile`, whose rows name no user. Lose: nothing a user held — the caller-scoped verbs insert the attachment under the caller's context so every insert gate judges that user and both rows name them|`requireUserContext`|
189
+
| 47e | The caller-scoped attach verbs REFUSE the system context: `attachFileAs` and `assertMayAttach` admit a signed-in user alone, and so do the caller-scoped record-file verbs the MCP `read_file` and `create_upload_link` tools call (`listRecordFilesAs`, `readRecordFileAs`, `createUploadLinkAs`) | service-storage | Get: nothing — a system caller is refused (`PERMISSION_DENIED`); the system attaches through `attachFile`, whose rows name no user. Lose: nothing a user held — the caller-scoped verbs insert the attachment under the caller's context so every insert gate judges that user and both rows name them, and the record-file verbs read the record and judge the file as that user, and bind an upload link to them |`packages/services/service-storage/src/file-attachment-service.ts#requireUserContext`, `packages/services/service-storage/src/record-file-access.ts#requireUserContext`|
190
190
| 47f | The file-reference claim path asks no read verdict of a system write: a record write claims or copies a referenced file only as its caller may read it (the download door's verdict), and a system write carries no caller to ask | service-storage | Get: a system write claims or copies any file the organization-scoped lookup reaches, as before #25692; a deliberate server-side copy between records runs this way. Lose: nothing a user held — a user write is judged by the download door's verdict, and a context-less programmatic write is not asked either |`referencingCallerOf`|
191
191
| 47g | The `sys_file` storage-owned columns guard returns early on create: a system insert keeps the `key`, `mime_type`, `size`, `status` and `etag` it writes | service-storage | Get: the storage service's own inserts (the upload doors, the field-file copy and backfill) write those five columns. Lose: nothing a user held — a non-system create has them dropped and starts `pending`, and on update the same columns are `readonly`, so the UPDATE `readonly` strip keeps them for every non-system caller |`installSysFileStorageOwnedColumnsGuard`|
192
192
@@ -674,6 +674,7 @@ and CI refuses one that differs from what the tree produces.
Copy file name to clipboardExpand all lines: content/docs/permissions/tenant-audit-census.mdx
+29-29Lines changed: 29 additions & 29 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -93,7 +93,7 @@ what moved this page's population from 225 to 227; nothing about the two sites
93
93
changed, only whether this instrument could see them.
94
94
95
95
**The expensive failure direction is a keyword.** Sites whose receiver the author
96
-
typed `any` have no type to read, and there are 62 of them — just over a fifth
96
+
typed `any` have no type to read, and there are 63 of them — just over a fifth
97
97
of the population, concentrated in exactly the seed and bootstrap paths this
98
98
control exists for. Scoring an unreadable receiver as "not an engine" would have
99
99
dropped every one of them silently, with a clean exit and a smaller number that
@@ -132,7 +132,7 @@ are reported as `undecidable` rather than assumed either way.
132
132
133
133
The same holds twice over for the context. An options argument spelled as a
134
134
literal can be read; one spelled `options`, `{ ...opts }`, or handed through a
135
-
forwarding shim cannot, and **55 of the 261 sites are spelled that way**. A
135
+
forwarding shim cannot, and **56 of the 263 sites are spelled that way**. A
136
136
context resolved from an inline literal or a local `const` can be tested for
137
137
`isSystem`; one arriving from a helper call cannot.
138
138
@@ -160,8 +160,8 @@ now **0**: nothing on this surface threads a context that provably lacks the fla
160
160
161
161
**"No tenant context" counted sites it had not read.** An options argument the
162
162
walker could not parse was folded into the same bucket as one it had read and
163
-
found empty. That published **63 sites "carrying no tenant context at all"**
164
-
when 8 said so and 55 were simply unread — an over-claim in the *alarming*
163
+
found empty. That published **64 sites "carrying no tenant context at all"**
164
+
when 8 said so and 56 were simply unread — an over-claim in the *alarming*
165
165
direction, on the very figure this page tells other cards to cite. `carries` is
166
166
now three-valued, and an unreadable argument can never contribute to the
167
167
provable count.
@@ -197,10 +197,10 @@ reproduce them. Where it disagrees, it disagrees on the page:
197
197
198
198
| carried figure | where it survives | this census |
199
199
| :--- | :--- | ---: |
200
-
| 175 write call sites | quoted in the merged changeset |**261**|
201
-
| 24 carrying no tenant context | quoted in the merged changeset |**2** provable and tenancy-enabled; **29** more whose options argument is unreadable |
202
-
| 127 of 175 statically decidable, 48 runtime-parameter-name sites | restated on the `isSystem`-scoping card |**184 of 261** decidable, **77** undecidable |
203
-
| 135 (77%) silenced by the `isSystem` guard before the posture gate | the lost issue body — **no surviving corroboration**|**not reproduced**: 144 decidably elevated, 0 decidably not, 109 undecidable |
200
+
| 175 write call sites | quoted in the merged changeset |**263**|
201
+
| 24 carrying no tenant context | quoted in the merged changeset |**2** provable and tenancy-enabled; **30** more whose options argument is unreadable |
202
+
| 127 of 175 statically decidable, 48 runtime-parameter-name sites | restated on the `isSystem`-scoping card |**185 of 263** decidable, **78** undecidable |
203
+
| 135 (77%) silenced by the `isSystem` guard before the posture gate | the lost issue body — **no surviving corroboration**|**not reproduced**: 144 decidably elevated, 0 decidably not, 111 undecidable |
204
204
| 141 and 132, two independent re-derivations | the card that filed this work | — |
205
205
206
206
**The differences are not reconciled, and deliberately so.** The old census's
@@ -210,21 +210,21 @@ be stated is what this instrument counts, which is written above and re-runnable
210
210
at any commit.
211
211
212
212
Two structural facts do plausibly widen this reading against any hand or regex
213
-
one, and both are counted in the generated tables below: the 62 sites reached
213
+
one, and both are counted in the generated tables below: the 63 sites reached
214
214
through an erased (`any`) receiver, and the 68 that name their object through a
215
215
`const` rather than inline. An instrument that read either the way a person does
216
216
would report a smaller number and would not say so.
217
217
218
218
The fourth row is the one worth flagging to anyone citing it. **The 135 / 77%
219
219
figure has no surviving corroboration anywhere in the tree.** This census reads
220
-
144 of 261 (55%) as decidably elevated, with 109 more whose elevation is a
220
+
144 of 263 (55%) as decidably elevated, with 111 more whose elevation is a
221
221
run-time fact — so the claim is neither confirmed nor refuted, and the honest
222
222
answer is that a static reading cannot settle it.
223
223
224
-
⇒ **Cite `2 / 261`, and say what it is**: the sites whose options argument was
224
+
⇒ **Cite `2 / 263`, and say what it is**: the sites whose options argument was
225
225
READ and holds no tenant context, against a decidably tenancy-enabled object.
226
226
That is the control's provable yield surface. ⛔ Do not cite it as "the sites
227
-
without tenant context" — **29 further sites** have an options argument this
227
+
without tenant context" — **30 further sites** have an options argument this
228
228
cannot read, and they are neither in nor out.
229
229
230
230
{/* BEGIN GENERATED: tenant-audit-census (scripts/tenant-audit-census.mjs) — DO NOT EDIT */}
@@ -233,31 +233,31 @@ cannot read, and they are neither in nor out.
233
233
234
234
| what | count |
235
235
| :--- | ---: |
236
-
| write call sites on the application surface |**261**|
237
-
| …whose object name is statically decidable |184|
238
-
| …whose object name is chosen at run time |77|
239
-
| …against an object with tenancy ENABLED |178|
236
+
| write call sites on the application surface |**263**|
237
+
| …whose object name is statically decidable |185|
238
+
| …whose object name is chosen at run time |78|
239
+
| …against an object with tenancy ENABLED |179|
240
240
| …against an object that declares tenancy off | 6 |
241
-
| threading a tenant context |198|
241
+
| threading a tenant context |199|
242
242
| PROVABLY carrying none (options read, no context key) |**8**|
243
243
| …of those, against a decidably tenancy-enabled object |**2**|
244
-
| options argument UNREADABLE — may or may not carry one |55|
245
-
| …of those, against a decidably tenancy-enabled object |29|
244
+
| options argument UNREADABLE — may or may not carry one |56|
245
+
| …of those, against a decidably tenancy-enabled object |30|
246
246
| threading a decidably ELEVATED (`isSystem`) context | 144 |
247
247
| threading a context that is decidably NOT elevated | 0 |
248
-
| threading a context whose elevation is a run-time fact |109|
248
+
| threading a context whose elevation is a run-time fact |111|
249
249
250
250
| how the instrument reached the site | count |
251
251
| :--- | ---: |
252
-
| receiver carried a readable engine type |199|
253
-
| receiver erased, placed by the object NAME |52|
252
+
| receiver carried a readable engine type |200|
253
+
| receiver erased, placed by the object NAME |53|
254
254
| receiver erased, placed by an `object: string` PARAMETER | 5 |
255
255
| receiver erased, placed by an `UNTYPED_RECEIVERS` row | 5 |
256
256
257
-
| object name spelled inline |116|
257
+
| object name spelled inline |117|
258
258
| object name spelled through a `const`| 68 |
259
259
| object name is an `object: string` parameter | 7 |
260
-
| object name is some other run-time expression |70|
260
+
| object name is some other run-time expression |71|
261
261
262
262
### Subtractions the census could NOT defend — enforced
263
263
@@ -307,13 +307,13 @@ holds still. They are required to be HERE and to say WHEN they were true;
307
307
their values are not compared. The reasoning, and the measurement behind it,
0 commit comments