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 8b657ca
Browse filesBrowse the repository at this point in the historyBrowse files
feat(plugin-security, plugin-sharing): security and sharing stored references gain a package column, backfilled at boot from the one package that holds the name (ADR-0150 D8 R1, R3, R5, R6, R13)
7
+
8
+
Clause-②: no
9
+
Metadata-protocol: none
10
+
11
+
Five stored references that name a declared item by its bare name now carry, beside the name, the package that holds it: `sys_user_permission_set.permission_set_package` (R1), `sys_audience_binding_suggestion.permission_set_package` (R3), `sys_sharing_rule.package_id` on package- and platform-managed rows (R5), `sys_queue_member.queue_package` (R6) and `sys_assignment_cursor.rule_package` (R13). Each is nullable, read-only to users, and filled in by the platform.
12
+
13
+
At every boot, once the registry has sealed its holders, each table's rows that name no package are walked and asked the one ADR-0150 D3 rule, from the package that wrote the reference. A grant, a sharing-rule row, a queue member and a cursor are the environment's own rows, so they are asked with no caller package. A suggestion is the reference of the package that made it, so it is asked from that package: its own set first, then the one holder among its declared dependencies. A suggesting package's own set therefore binds to it even where an unrelated package holds a set of the same name from before the one-holder rule, which is D3's answer for that package, not a pick; and a set only an unrelated package holds is left null and reported, never bound to it. A name exactly one package holds is bound to that package. A name the rule refuses (two or more holders, or for a suggestion none among the suggesting package's dependencies) is left null and logged as a warning naming every candidate; it is never bound to the first. A name that only the environment or the platform holds, or that nothing holds, is left null and reported. A row that already names a package is never read again, so a second boot writes nothing and reports the same names. Suggestion rows bound to a dependency of the suggesting package rather than to the package itself are logged too.
14
+
15
+
Nothing reads the new columns yet: who may hold what, which rule shares what, and who a queue routes to answer exactly as before, and no unique key changes. Writers do not stamp the columns yet either; each reader's own card moves its reader and writer together. If the boot pass fails, it logs a warning, leaves its rows as they are and is tried again at the next boot. Rolling back drops nothing a reader needs.
fix(runtime): a job with no `organization` pulls as the organization its writes are stamped with, so its upsert match uses the organization index
7
+
8
+
Clause-②: yes (widening) — @objectstack/objectql gains `ObjectQL#systemWriteOrganization()`, the engine's own answer to which organization an organization-less system write resolves to
9
+
Metadata-protocol: none
10
+
11
+
A `job` whose `pull` syncs a mapping and that declares no `organization` ran its pull with no organization in its context (`{ isSystem: true }`). Every write of that pull was still stamped with the install's organization: on the `single` posture with exactly one organization, the engine derives it for an organization-less system write (ADR-0131 D9). But the import's match lookup had no organization to scope by, so on `single`, where a read gets no tenant scope, it read the target table once per row instead of probing the `(organization_id, <key>)` unique index. A large sync on the most common setup stayed table-scan slow.
12
+
13
+
Each run of such a pull now asks the engine, once, before it reads or writes, the same decision the engine's system insert makes, and runs as that organization when the engine derives one. The lookup then carries it on the tenant column, and the rows land exactly where they did before. When the engine does not derive one (a `group` or `isolated` posture, zero or several organizations, a composition with no organization object), the pull runs as before, and its writes are refused or stamped exactly as before. A job that declares an `organization` is unchanged, and so are the `body` and `handler` run forms. If the organization probe fails, the run says so once at `warn`, naming the job, and goes on as before.
Copy file name to clipboardExpand all lines: content/docs/permissions/tenant-audit-census.mdx
+16-16Lines changed: 16 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -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 **57 of the 277 sites are spelled that way**. A
135
+
forwarding shim cannot, and **57 of the 279 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
@@ -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 |**277**|
200
+
| 175 write call sites | quoted in the merged changeset |**279**|
201
201
| 24 carrying no tenant context | quoted in the merged changeset |**3** 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 |**197 of 277** decidable, **80** undecidable |
203
-
| 135 (77%) silenced by the `isSystem` guard before the posture gate | the lost issue body — **no surviving corroboration**|**not reproduced**: 154 decidably elevated, 0 decidably not, 113 undecidable |
202
+
| 127 of 175 statically decidable, 48 runtime-parameter-name sites | restated on the `isSystem`-scoping card |**197 of 279** decidable, **82** undecidable |
203
+
| 135 (77%) silenced by the `isSystem` guard before the posture gate | the lost issue body — **no surviving corroboration**|**not reproduced**: 156 decidably elevated, 0 decidably not, 113 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
@@ -217,11 +217,11 @@ 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
-
154 of 277 (56%) as decidably elevated, with 113 more whose elevation is a
220
+
156 of 279 (56%) as decidably elevated, with 113 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 `3 / 277`, and say what it is**: the sites whose options argument was
224
+
⇒ **Cite `3 / 279`, 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
227
without tenant context" — **30 further sites** have an options argument this
@@ -233,30 +233,30 @@ 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 |**277**|
236
+
| write call sites on the application surface |**279**|
237
237
| …whose object name is statically decidable | 197 |
238
-
| …whose object name is chosen at run time |80|
238
+
| …whose object name is chosen at run time |82|
239
239
| …against an object with tenancy ENABLED | 191 |
240
240
| …against an object that declares tenancy off | 6 |
241
-
| threading a tenant context |210|
241
+
| threading a tenant context |212|
242
242
| PROVABLY carrying none (options read, no context key) |**10**|
243
243
| …of those, against a decidably tenancy-enabled object |**3**|
244
244
| options argument UNREADABLE — may or may not carry one | 57 |
245
245
| …of those, against a decidably tenancy-enabled object | 30 |
246
-
| threading a decidably ELEVATED (`isSystem`) context |154|
246
+
| threading a decidably ELEVATED (`isSystem`) context |156|
247
247
| threading a context that is decidably NOT elevated | 0 |
248
248
| threading a context whose elevation is a run-time fact | 113 |
249
249
250
250
| how the instrument reached the site | count |
251
251
| :--- | ---: |
252
-
| receiver carried a readable engine type |215|
252
+
| receiver carried a readable engine type |217|
253
253
| receiver erased, placed by the object NAME | 52 |
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
257
| object name spelled inline | 125 |
258
258
| object name spelled through a `const`| 72 |
259
-
| object name is an `object: string` parameter |7|
259
+
| object name is an `object: string` parameter |9|
260
260
| object name is some other run-time expression | 73 |
261
261
262
262
### Subtractions the census could NOT defend — enforced
@@ -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