Skip to content

Commit 62b5cd4

Browse files
committed
test(dogfood): read positions from the security catalog and stage an existing database's rows where a gate judges a row; refresh the census and the double ledgers
Claude-Session: https://claude.ai/code/session_01YLbobfnaoKFrxZcQZT8rYP Co-authored-by: Claude <noreply@anthropic.com>
1 parent 5f1181b commit 62b5cd4

12 files changed

Lines changed: 136 additions & 158 deletions

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

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

8585
**The expensive failure direction is a keyword.** Sites whose receiver the author
86-
typed `any` have no type to read, and there are 51 of them — just over a fifth
86+
typed `any` have no type to read, and there are 47 of them — just over a fifth
8787
of the population, concentrated in exactly the seed and bootstrap paths this
8888
control exists for. Scoring an unreadable receiver as "not an engine" would have
8989
dropped every one of them silently, with a clean exit and a smaller number that
@@ -122,7 +122,7 @@ are reported as `undecidable` rather than assumed either way.
122122

123123
The same holds twice over for the context. An options argument spelled as a
124124
literal can be read; one spelled `options`, `{ ...opts }`, or handed through a
125-
forwarding shim cannot, and **53 of the 239 sites are spelled that way**. A
125+
forwarding shim cannot, and **53 of the 234 sites are spelled that way**. A
126126
context resolved from an inline literal or a local `const` can be tested for
127127
`isSystem`; one arriving from a helper call cannot.
128128

@@ -187,10 +187,10 @@ reproduce them. Where it disagrees, it disagrees on the page:
187187

188188
| carried figure | where it survives | this census |
189189
| :--- | :--- | ---: |
190-
| 175 write call sites | quoted in the merged changeset | **239** |
190+
| 175 write call sites | quoted in the merged changeset | **234** |
191191
| 24 carrying no tenant context | quoted in the merged changeset | **2** provable and tenancy-enabled; **32** more whose options argument is unreadable |
192-
| 127 of 175 statically decidable, 48 runtime-parameter-name sites | restated on the `isSystem`-scoping card | **160 of 239** decidable, **79** undecidable |
193-
| 135 (77%) silenced by the `isSystem` guard before the posture gate | the lost issue body — **no surviving corroboration** | **not reproduced**: 126 decidably elevated, 0 decidably not, 105 undecidable |
192+
| 127 of 175 statically decidable, 48 runtime-parameter-name sites | restated on the `isSystem`-scoping card | **159 of 234** decidable, **75** undecidable |
193+
| 135 (77%) silenced by the `isSystem` guard before the posture gate | the lost issue body — **no surviving corroboration** | **not reproduced**: 126 decidably elevated, 0 decidably not, 100 undecidable |
194194
| 141 and 132, two independent re-derivations | the card that filed this work | — |
195195

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

202202
Two structural facts do plausibly widen this reading against any hand or regex
203-
one, and both are counted in the generated tables below: the 51 sites reached
203+
one, and both are counted in the generated tables below: the 47 sites reached
204204
through an erased (`any`) receiver, and the 53 that name their object through a
205205
`const` rather than inline. An instrument that read either the way a person does
206206
would report a smaller number and would not say so.
207207

208208
The fourth row is the one worth flagging to anyone citing it. **The 135 / 77%
209209
figure has no surviving corroboration anywhere in the tree.** This census reads
210-
126 of 239 (53%) as decidably elevated, with 105 more whose elevation is a
210+
126 of 234 (54%) as decidably elevated, with 100 more whose elevation is a
211211
run-time fact — so the claim is neither confirmed nor refuted, and the honest
212212
answer is that a static reading cannot settle it.
213213

214-
⇒ **Cite `2 / 239`, and say what it is**: the sites whose options argument was
214+
⇒ **Cite `2 / 234`, and say what it is**: the sites whose options argument was
215215
READ and holds no tenant context, against a decidably tenancy-enabled object.
216216
That is the control's provable yield surface. ⛔ Do not cite it as "the sites
217217
without tenant context" — **32 further sites** have an options argument this
@@ -223,30 +223,30 @@ cannot read, and they are neither in nor out.
223223

224224
| what | count |
225225
| :--- | ---: |
226-
| write call sites on the application surface | **239** |
227-
| …whose object name is statically decidable | 160 |
228-
| …whose object name is chosen at run time | 79 |
229-
| …against an object with tenancy ENABLED | 159 |
226+
| write call sites on the application surface | **234** |
227+
| …whose object name is statically decidable | 159 |
228+
| …whose object name is chosen at run time | 75 |
229+
| …against an object with tenancy ENABLED | 158 |
230230
| …against an object that declares tenancy off | 1 |
231-
| threading a tenant context | 178 |
231+
| threading a tenant context | 173 |
232232
| PROVABLY carrying none (options read, no context key) | **8** |
233233
| …of those, against a decidably tenancy-enabled object | **2** |
234234
| options argument UNREADABLE — may or may not carry one | 53 |
235235
| …of those, against a decidably tenancy-enabled object | 32 |
236236
| threading a decidably ELEVATED (`isSystem`) context | 126 |
237237
| threading a context that is decidably NOT elevated | 0 |
238-
| threading a context whose elevation is a run-time fact | 105 |
238+
| threading a context whose elevation is a run-time fact | 100 |
239239

240240
| how the instrument reached the site | count |
241241
| :--- | ---: |
242-
| receiver carried a readable engine type | 188 |
242+
| receiver carried a readable engine type | 187 |
243243
| receiver erased, placed by the object NAME | 33 |
244-
| receiver erased, placed by an `object: string` PARAMETER | 13 |
244+
| receiver erased, placed by an `object: string` PARAMETER | 9 |
245245
| receiver erased, placed by an `UNTYPED_RECEIVERS` row | 5 |
246246

247-
| object name spelled inline | 107 |
247+
| object name spelled inline | 106 |
248248
| object name spelled through a `const` | 53 |
249-
| object name is an `object: string` parameter | 17 |
249+
| object name is an `object: string` parameter | 13 |
250250
| object name is some other run-time expression | 62 |
251251

252252
### Subtractions the census could NOT defend — enforced
@@ -297,11 +297,11 @@ holds still. They are required to be HERE and to say WHEN they were true;
297297
their values are not compared. The reasoning, and the measurement behind it,
298298
are in `scripts/check-tenant-audit-census.mjs`.
299299

300-
Measured on 2026-10-10 at `b88b35678`.
300+
Measured on 2026-10-11 at `5f1181bb1`.
301301

302302
| corpus scale (not enforced) | count |
303303
| :--- | ---: |
304-
| tracked non-test sources scanned | 631 |
304+
| tracked non-test sources scanned | 636 |
305305
| engine-shaped types recognised | 72 |
306306
| declared objects in the registry | 117 |
307307
| same-named calls subtracted as non-engine | 162 |

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

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

3434
| Measure | Value |
3535
|---|---:|
36-
| Write call sites | 239 |
37-
| Object name statically decidable | 160 |
38-
| Object name chosen at run time | 79 |
39-
| Against a tenancy-enabled object | 159 |
36+
| Write call sites | 234 |
37+
| Object name statically decidable | 159 |
38+
| Object name chosen at run time | 75 |
39+
| Against a tenancy-enabled object | 158 |
4040
| Against an object declaring tenancy off | 1 |
41-
| Threading a tenant context | 178 |
41+
| Threading a tenant context | 173 |
4242
| Provably carrying none | 8 |
4343
| …and decidably tenancy-enabled | 2 |
4444
| Options argument unreadable | 53 |
4545
| …and decidably tenancy-enabled | 32 |
4646
| Threading a decidably elevated context | 126 |
4747
| Threading a decidably non-elevated context | 0 |
48-
| Threading a context of undecidable elevation | 105 |
48+
| Threading a context of undecidable elevation | 100 |
4949

5050
## Subtractions the census could NOT defend — enforced
5151

@@ -90,11 +90,11 @@ 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-10 at `b88b35678`.
93+
Measured on 2026-10-11 at `5f1181bb1`.
9494

9595
| corpus scale (not enforced) | count |
9696
| :--- | ---: |
97-
| tracked non-test sources scanned | 631 |
97+
| tracked non-test sources scanned | 636 |
9898
| engine-shaped types recognised | 72 |
9999
| declared objects in the registry | 117 |
100100
| same-named calls subtracted as non-engine | 162 |
@@ -159,10 +159,6 @@ Measured on 2026-10-10 at `b88b35678`.
159159
| `packages/plugins/plugin-pinyin-search/src/companion-projection.ts` | `update` | `schema.name` | undecidable | elevated | 1 |
160160
| `packages/plugins/plugin-security/src/auto-org-admin-grant.ts` | `delete` | `object` | undecidable | elevated | 1 |
161161
| `packages/plugins/plugin-security/src/auto-org-admin-grant.ts` | `insert` | `object` | undecidable | elevated | 1 |
162-
| `packages/plugins/plugin-security/src/bootstrap-builtin-positions.ts` | `insert` | `object` | undecidable | context, elevation undecidable | 1 |
163-
| `packages/plugins/plugin-security/src/bootstrap-builtin-positions.ts` | `update` | `object` | undecidable | context, elevation undecidable | 1 |
164-
| `packages/plugins/plugin-security/src/bootstrap-declared-positions.ts` | `insert` | `object` | undecidable | context, elevation undecidable | 1 |
165-
| `packages/plugins/plugin-security/src/bootstrap-declared-positions.ts` | `update` | `object` | undecidable | context, elevation undecidable | 1 |
166162
| `packages/plugins/plugin-security/src/bootstrap-platform-admin.ts` | `insert` | `object` | undecidable | elevated | 1 |
167163
| `packages/plugins/plugin-security/src/bootstrap-platform-admin.ts` | `update` | `object` | undecidable | elevated | 1 |
168164
| `packages/plugins/plugin-security/src/claim-seed-ownership.ts` | `update` | `schema.name` | undecidable | elevated | 1 |
@@ -178,7 +174,6 @@ Measured on 2026-10-10 at `b88b35678`.
178174
| `packages/plugins/plugin-security/src/position-environment-backfill.ts` | `insert` | `DATA_MIGRATION_FLAG_OBJECT` | undecidable | elevated | 1 |
179175
| `packages/plugins/plugin-security/src/position-write-through.ts` | `delete` | `sys_position` | enabled | elevated | 1 |
180176
| `packages/plugins/plugin-security/src/position-write-through.ts` | `update` | `sys_position` | enabled | elevated | 1 |
181-
| `packages/plugins/plugin-security/src/security-plugin.ts` | `insert` | `sys_position_permission_set` | enabled | context, elevation undecidable | 1 |
182177
| `packages/plugins/plugin-security/src/suggested-audience-bindings.ts` | `delete` | `sys_audience_binding_suggestion` | enabled | context, elevation undecidable | 2 |
183178
| `packages/plugins/plugin-security/src/suggested-audience-bindings.ts` | `insert` | `sys_audience_binding_suggestion` | enabled | context, elevation undecidable | 1 |
184179
| `packages/plugins/plugin-security/src/suggested-audience-bindings.ts` | `update` | `sys_audience_binding_suggestion` | enabled | context, elevation undecidable | 3 |

0 commit comments

Comments
 (0)