Skip to content

Commit bda699c

Browse files
committed
WIP(#27237): regenerate the tenant-audit and platform-object tenancy censuses after merging main
Claude-Session: https://claude.ai/code/session_01Utp6CaqVRa7ow6CjE1JwaG Co-authored-by: Claude <noreply@anthropic.com>
1 parent 82760e4 commit bda699c

3 files changed

Lines changed: 44 additions & 35 deletions

File tree

‎content/docs/permissions/tenant-audit-census.mdx‎

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ what moved this page's population from 225 to 227; nothing about the two sites
9393
changed, only whether this instrument could see them.
9494

9595
**The expensive failure direction is a keyword.** Sites whose receiver the author
96-
typed `any` have no type to read, and there are 60 of them — just over a fifth
96+
typed `any` have no type to read, and there are 61 of them — just over a fifth
9797
of the population, concentrated in exactly the seed and bootstrap paths this
9898
control exists for. Scoring an unreadable receiver as "not an engine" would have
9999
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.
132132

133133
The same holds twice over for the context. An options argument spelled as a
134134
literal can be read; one spelled `options`, `{ ...opts }`, or handed through a
135-
forwarding shim cannot, and **51 of the 249 sites are spelled that way**. A
135+
forwarding shim cannot, and **51 of the 250 sites are spelled that way**. A
136136
context resolved from an inline literal or a local `const` can be tested for
137137
`isSystem`; one arriving from a helper call cannot.
138138

@@ -197,10 +197,10 @@ reproduce them. Where it disagrees, it disagrees on the page:
197197

198198
| carried figure | where it survives | this census |
199199
| :--- | :--- | ---: |
200-
| 175 write call sites | quoted in the merged changeset | **249** |
200+
| 175 write call sites | quoted in the merged changeset | **250** |
201201
| 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 | **171 of 249** decidable, **78** undecidable |
203-
| 135 (77%) silenced by the `isSystem` guard before the posture gate | the lost issue body — **no surviving corroboration** | **not reproduced**: 143 decidably elevated, 0 decidably not, 98 undecidable |
202+
| 127 of 175 statically decidable, 48 runtime-parameter-name sites | restated on the `isSystem`-scoping card | **172 of 250** 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, 98 undecidable |
204204
| 141 and 132, two independent re-derivations | the card that filed this work | — |
205205

206206
**The differences are not reconciled, and deliberately so.** The old census's
@@ -210,18 +210,18 @@ be stated is what this instrument counts, which is written above and re-runnable
210210
at any commit.
211211

212212
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 60 sites reached
214-
through an erased (`any`) receiver, and the 56 that name their object through a
213+
one, and both are counted in the generated tables below: the 61 sites reached
214+
through an erased (`any`) receiver, and the 57 that name their object through a
215215
`const` rather than inline. An instrument that read either the way a person does
216216
would report a smaller number and would not say so.
217217

218218
The fourth row is the one worth flagging to anyone citing it. **The 135 / 77%
219219
figure has no surviving corroboration anywhere in the tree.** This census reads
220-
143 of 249 (57%) as decidably elevated, with 98 more whose elevation is a
220+
144 of 250 (58%) as decidably elevated, with 98 more whose elevation is a
221221
run-time fact — so the claim is neither confirmed nor refuted, and the honest
222222
answer is that a static reading cannot settle it.
223223

224-
⇒ **Cite `2 / 249`, and say what it is**: the sites whose options argument was
224+
⇒ **Cite `2 / 250`, and say what it is**: the sites whose options argument was
225225
READ and holds no tenant context, against a decidably tenancy-enabled object.
226226
That is the control's provable yield surface. ⛔ Do not cite it as "the sites
227227
without tenant context" — **29 further sites** have an options argument this
@@ -233,29 +233,29 @@ cannot read, and they are neither in nor out.
233233

234234
| what | count |
235235
| :--- | ---: |
236-
| write call sites on the application surface | **249** |
237-
| …whose object name is statically decidable | 171 |
236+
| write call sites on the application surface | **250** |
237+
| …whose object name is statically decidable | 172 |
238238
| …whose object name is chosen at run time | 78 |
239-
| …against an object with tenancy ENABLED | 170 |
239+
| …against an object with tenancy ENABLED | 171 |
240240
| …against an object that declares tenancy off | 1 |
241-
| threading a tenant context | 190 |
241+
| threading a tenant context | 191 |
242242
| PROVABLY carrying none (options read, no context key) | **8** |
243243
| …of those, against a decidably tenancy-enabled object | **2** |
244244
| options argument UNREADABLE — may or may not carry one | 51 |
245245
| …of those, against a decidably tenancy-enabled object | 29 |
246-
| threading a decidably ELEVATED (`isSystem`) context | 143 |
246+
| threading a decidably ELEVATED (`isSystem`) context | 144 |
247247
| threading a context that is decidably NOT elevated | 0 |
248248
| threading a context whose elevation is a run-time fact | 98 |
249249

250250
| how the instrument reached the site | count |
251251
| :--- | ---: |
252252
| receiver carried a readable engine type | 189 |
253-
| receiver erased, placed by the object NAME | 50 |
253+
| receiver erased, placed by the object NAME | 51 |
254254
| receiver erased, placed by an `object: string` PARAMETER | 5 |
255255
| receiver erased, placed by an `UNTYPED_RECEIVERS` row | 5 |
256256

257257
| object name spelled inline | 115 |
258-
| object name spelled through a `const` | 56 |
258+
| object name spelled through a `const` | 57 |
259259
| object name is an `object: string` parameter | 7 |
260260
| object name is some other run-time expression | 71 |
261261

@@ -307,13 +307,13 @@ holds still. They are required to be HERE and to say WHEN they were true;
307307
their values are not compared. The reasoning, and the measurement behind it,
308308
are in `scripts/check-tenant-audit-census.mjs`.
309309

310-
Measured on 2026-10-28 at `28c124d6d`.
310+
Measured on 2026-10-29 at `82760e4ee`.
311311

312312
| corpus scale (not enforced) | count |
313313
| :--- | ---: |
314-
| tracked non-test sources scanned | 800 |
315-
| engine-shaped types recognised | 94 |
316-
| declared objects in the registry | 121 |
317-
| same-named calls subtracted as non-engine | 181 |
314+
| tracked non-test sources scanned | 801 |
315+
| engine-shaped types recognised | 95 |
316+
| declared objects in the registry | 122 |
317+
| same-named calls subtracted as non-engine | 185 |
318318

319319
{/* END GENERATED: tenant-audit-census */}

‎docs/audits/2026-08-tenant-audit-write-call-sites.counts.md‎

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -33,17 +33,17 @@ silent, and `node scripts/tenant-audit-census.mjs --write` is the resolution.
3333

3434
| Measure | Value |
3535
|---|---:|
36-
| Write call sites | 249 |
37-
| Object name statically decidable | 171 |
36+
| Write call sites | 250 |
37+
| Object name statically decidable | 172 |
3838
| Object name chosen at run time | 78 |
39-
| Against a tenancy-enabled object | 170 |
39+
| Against a tenancy-enabled object | 171 |
4040
| Against an object declaring tenancy off | 1 |
41-
| Threading a tenant context | 190 |
41+
| Threading a tenant context | 191 |
4242
| Provably carrying none | 8 |
4343
| …and decidably tenancy-enabled | 2 |
4444
| Options argument unreadable | 51 |
4545
| …and decidably tenancy-enabled | 29 |
46-
| Threading a decidably elevated context | 143 |
46+
| Threading a decidably elevated context | 144 |
4747
| Threading a decidably non-elevated context | 0 |
4848
| Threading a context of undecidable elevation | 98 |
4949

@@ -90,14 +90,14 @@ holds still. They are required to be HERE and to say WHEN they were true;
9090
their values are not compared. The reasoning, and the measurement behind it,
9191
are in `scripts/check-tenant-audit-census.mjs`.
9292

93-
Measured on 2026-10-28 at `28c124d6d`.
93+
Measured on 2026-10-29 at `82760e4ee`.
9494

9595
| corpus scale (not enforced) | count |
9696
| :--- | ---: |
97-
| tracked non-test sources scanned | 800 |
98-
| engine-shaped types recognised | 94 |
99-
| declared objects in the registry | 121 |
100-
| same-named calls subtracted as non-engine | 181 |
97+
| tracked non-test sources scanned | 801 |
98+
| engine-shaped types recognised | 95 |
99+
| declared objects in the registry | 122 |
100+
| same-named calls subtracted as non-engine | 185 |
101101

102102
## Every site
103103

@@ -204,7 +204,7 @@ Measured on 2026-10-28 at `28c124d6d`.
204204
| `packages/services/service-automation/src/connector-credentials.ts` | `delete` | `sys_connector_credential` | enabled | context, elevation undecidable | 1 |
205205
| `packages/services/service-automation/src/connector-credentials.ts` | `insert` | `sys_connector_credential` | enabled | context, elevation undecidable | 1 |
206206
| `packages/services/service-automation/src/connector-credentials.ts` | `update` | `sys_connector_credential` | enabled | context, elevation undecidable | 1 |
207-
| `packages/services/service-automation/src/connector-credentials.ts` | `update` | `sys_connector_credential` | enabled | elevated | 2 |
207+
| `packages/services/service-automation/src/connector-credentials.ts` | `update` | `sys_connector_credential` | enabled | elevated | 3 |
208208
| `packages/services/service-automation/src/flow-credential-channel.ts` | `delete` | `sys_flow_credential` | enabled | elevated | 5 |
209209
| `packages/services/service-automation/src/flow-credential-channel.ts` | `insert` | `sys_flow_credential` | enabled | elevated | 1 |
210210
| `packages/services/service-automation/src/flow-credential-channel.ts` | `update` | `sys_flow_credential` | enabled | elevated | 2 |

‎scripts/platform-object-tenancy-census.json‎

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,13 @@
2626
"predicate": "resolveTenantFieldName(registered schema) !== null, where the registered schema is the authored schema plus the columns resolveInjectedSystemColumns says the registration injects (the applySystemFields pass). Both functions are loaded from source and executed; neither is re-spelled here.",
2727
"population": "every object registered by a tracked packages/**/*.object.ts module whose name carries a platform prefix (sys_ / cloud_ / ai_). The cloud repository's own cloud_ objects are not in this tree and so not in this census.",
2828
"totals": {
29-
"registered": 88,
29+
"registered": 89,
3030
"inReach": 44,
31-
"outOfReach": 44
31+
"outOfReach": 45
3232
},
3333
"reasonTotals": {
3434
"managedBy: 'better-auth'": 25,
35-
"systemFields.tenant: false": 19,
35+
"systemFields.tenant: false": 20,
3636
"tenancy.enabled: false": 2
3737
},
3838
"unexplained": [],
@@ -687,6 +687,15 @@
687687
"managedBy: 'better-auth'"
688688
]
689689
},
690+
{
691+
"name": "sys_trusted_key",
692+
"file": "packages/platform-objects/src/system/sys-trusted-key.object.ts",
693+
"reach": "out",
694+
"tenantField": null,
695+
"reasons": [
696+
"systemFields.tenant: false"
697+
]
698+
},
690699
{
691700
"name": "sys_two_factor",
692701
"file": "packages/platform-objects/src/identity/sys-two-factor.object.ts",

0 commit comments

Comments
 (0)