Skip to content

Commit b3e5ab4

Browse files
committed
Merge remote-tracking branch 'origin/main' into claude/sec-hardening-r17
2 parents b018a55 + 022b4e7 commit b3e5ab4

60 files changed

Lines changed: 3719 additions & 49 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
'@object-ui/app-shell': patch
3+
'@object-ui/i18n': patch
4+
---
5+
6+
feat(console): Connect an Agent lists the AI assistants you authorized and your API keys
7+
8+
Clause-②: yes (widening)
9+
Metadata-protocol: none
10+
11+
- **`@object-ui/app-shell`**: under the setup steps on Connect an Agent (which sits in Account's AI Assistant group), a "What can act as you" card lists the assistants the signed-in person authorized on the OAuth consent page, read from `oauth.authorizedClients.list()`: the client's name (its client id beside a fallback when it declares none), each granted scope in the consent page's own words, when it was authorized, when it was last used (the server records the hour, so it reads "in the hour from …") or that no use is recorded, and the organization only when it is not the active one. Assistant rows carry no Revoke yet; the card says so. Below them, the person's own API keys (`sys_api_key` rows filtered to the signed-in user, so a platform administrator sees their own keys here too): name, prefix, created, last used or never used, and the revoked or expired state. An active key's Revoke asks first, naming the key, then writes `revoked: true`, which ends the key's access at once; the list re-reads in place, and a key minted on the same page appears without a reload.
12+
- **`@object-ui/i18n`**: the new `connectAgent.access.*` strings in all eleven packs. Scope wording reuses the existing `oauth.consent.scope.*` keys.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
'@objectstack/plugin-audit': patch
3+
'@objectstack/rest': patch
4+
---
5+
6+
feat(audit): every data export writes one run-level `sys_audit_log` row, and the `export` action comes back with its writer
7+
8+
Clause-②: yes (widening)
9+
Metadata-protocol: none
10+
11+
`GET /data/:object/export` used to leave the compliance ledger nothing to say: a user could download up to 50,000 rows of any object they may export, `sys_audit_log` included, and no row recorded who, what or how much. Each export the door streams now writes one row with `action: "export"`, the object, `record_id: null` and the exporter (user, actor, tenant, and the agent or impersonator when there is one). Its `metadata` carries the format, the row count, the effective and requested limit and whether the 50,000 cap clipped it, whether the file was truncated at the limit, a bounded summary of the filter (field names and operators, at most 32 terms, never a comparand), whether a search term narrowed it (never the term) and the outcome. An export whose read fails after the checks records `outcome: "failed"` with the status and machine code it answered.
12+
13+
A request refused before anything is read (no export permission, a bad parameter, an unparseable filter) writes no row; neither does the import template. The row is written after the file is finished, so the audit write never changes or delays the download; a ledger write that fails is logged at `error` once per cause and the export is unaffected.
14+
15+
`export` is declared again on `sys_audit_log.action` (it was retired under #8147 because nothing wrote it) and is shown by the `config_changes` list view beside `config_change` and `import`. The writer lives on the `audit` service slot as `recordDataExport`, beside `recordAuthEvent` and `recordActionInvocation`; a kernel without the audit plugin exports exactly as before.
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
'@objectstack/lint': patch
3+
---
4+
5+
feat(lint): warn when a permission set reads a roll-up summary over child data it cannot read
6+
7+
Clause-②: yes (widening) — `@objectstack/lint` exports one new rule function, `validateRollupSourceVisibility`, its two rule-id constants `SECURITY_ROLLUP_SOURCE_UNREADABLE` and `SECURITY_ROLLUP_SOURCE_ROW_SCOPED`, and the `RollupSourceVisibilityFinding` / `RollupSourceVisibilitySeverity` types; nothing that passed before is refused.
8+
Metadata-protocol: none
9+
10+
A `summary` (roll-up) field keeps its documented semantics: the engine recomputes it as the system over the whole child collection, and on read it follows only the parent field's own field-level security. So a permission set that can see the summary field still reads the roll-up when it cannot read the aggregated child field, a child field the roll-up's `filter` tests, or the child object, or when it reads only some child rows. Two new author-time findings now say so, for each permission set and each summary field it can see:
11+
12+
- `security-rollup-source-unreadable` (warning) — the set cannot read `summaryOperations.object`, `summaryOperations.field`, or a top-level field key of `summaryOperations.filter`. A `count` reads no value, so its `field` is not judged; its `filter` is.
13+
- `security-rollup-source-row-scoped` (info) — the set reads all of those, but one of its own read-class `rowLevelSecurity` policies on the child, or the child's `defaultRowScope`, narrows which child rows it reads.
14+
15+
"Can read" follows the runtime's three gates: the object grant (its own entry, otherwise `'*'`, which covers a private object only with View All or Modify All), the field entry (`readable: false`, made inert by View All or Modify All on the object), and the capability gate (an object's or field's `requiredPermissions` against the set's `systemPermissions`, which View All and Modify All do not lift). A set holding View All or Modify All on the child is still reported for a capability-gated child object or field, and for a row policy unless the child is private, has tenancy off or is auth-managed, the postures on which the bypass skips row security. A summary field the set cannot see, through any of the three gates on the parent, is not reported.
16+
17+
The fix line names the remedy and its reach: `fields: { 'invoice.total': { readable: false } }` on the set hides the summary field from every holder of that set, and a co-held set with no entry for it does not restore it; to keep it for some holders, declare `readable: true` on it in the sets they hold.
18+
19+
Both findings are advisory: they never fail `os lint`, `os validate` or `os build` (only `--strict` promotes a warning), and the rule does not run at the runtime publish gate. `os explain security-rollup-source-unreadable` and `os explain security-rollup-source-row-scoped` print the full reasoning.

‎content/docs/data-modeling/fields.mdx‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -376,6 +376,17 @@ decision that governs the write is the one on the **child**. The parent's own
376376
row is unaffected — a user still needs edit access to change any other field on
377377
it — and the summary column stays subject to the parent's field-level security
378378
on read.
379+
So a permission set that cannot read the aggregated child field, a child field
380+
the roll-up's `filter` tests, or the child object (whether through its object
381+
grant, its field entries or a `requiredPermissions` capability it does not hold),
382+
or that reads only some child rows, still reads the roll-up; `os lint`,
383+
`os validate` and `os build` tell you about each such set
384+
(the `security-rollup-source-unreadable` warning, and the `security-rollup-source-row-scoped`
385+
note — see [the one gate, four doors](/docs/deployment/validating-metadata#the-one-gate-four-doors)).
386+
If the value should not be visible, set `readable: false` on the summary field in
387+
that set: it hides the field from every holder of the set, and another set they
388+
hold with no entry for the field does not restore it, so declare `readable: true`
389+
on the field in the sets whose holders should keep it.
379390
380391
A child validation rule can read a parent summary one hop through its
381392
reference, for example "each supplier has at most one primary contact" as a

‎content/docs/deployment/cli.mdx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -776,7 +776,7 @@ os compile --json # JSON output for CI pipelines
776776
→ Normalizing stack definition...
777777
→ Lowering inline handlers...
778778
→ Validating protocol compliance...
779-
→ Running author-time rules (63)...
779+
→ Running author-time rules (64)...
780780
→ Checking that every required capability has a provider installable in this edition...
781781
→ Collecting package docs (ADR-0046)... 0 collected
782782
→ Writing artifact...

‎content/docs/deployment/validating-metadata.mdx‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -524,6 +524,7 @@ orthogonal to both, and no cell here can carry it; it is written out in
524524
| Row-level-security predicates (#4983) — a permission set's policies, an object's `defaultRowScope`, a membership key's `filter` and a field permission entry's `when` (#25866); at the save door also a membership key nothing owns (#25234) | ✓ | ✓ | ✓ | ✓ᵖᵉᵒ |
525525
| Membership key declarations — `userField` / `valueField` columns, one key on one object, a key the registered resolver also owns (save door only) (#25234) | ✓ | ✓ | ✓ | ✓ᵒ |
526526
| Advisory: retired permission residue — the `allowRestore` / `allowPurge` default the parse strips in silence (`permission-retired-lifecycle-residue`, #17425) | ✓ | ✓ | ✓ | ✓ᵖᵉ |
527+
| Advisory: a roll-up a permission set reads over child data it cannot read — the child object, the aggregated child field or a field the roll-up's `filter` tests unreadable to the set, through its grants, its field entries or a `requiredPermissions` capability it lacks (`security-rollup-source-unreadable`, a warning), or child rows a row-level policy narrows (`security-rollup-source-row-scoped`, a note); a roll-up aggregates the whole child collection and follows only the parent field's own permissions | ✓ | ✓ | ✓ | — |
527528
| Platform-schedule `create_record` organization (#6285) | — | — | — | ✓ᶠ |
528529
| Public-form anonymous intake on this deployment's tenancy posture — advisory only (#21476) | — | — | — | ✓ᵛ |
529530
| Public-form file fields — a form open to anonymous intake whose sections declare a `file`, `image`, `avatar`, `video` or `audio` field (#25650) | ✓ | ✓ | ✓ | ✓ᵛ |
@@ -809,7 +810,7 @@ A clean run walks the registry and reports timing:
809810
Config: /path/to/support-desk/objectstack.config.ts
810811
Load time: 21ms
811812
→ Validating against ObjectStack Protocol...
812-
→ Running author-time rules (63)...
813+
→ Running author-time rules (64)...
813814
→ Checking that every required capability has a provider installable in this edition...
814815
→ Checking package docs (ADR-0046)...
815816

‎content/docs/getting-started/build-with-claude-code.mdx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ visible: 'status != "resolved"'
310310
◆ Validate
311311
────────────────────────────────────────
312312
→ Validating against ObjectStack Protocol...
313-
→ Running author-time rules (63)...
313+
→ Running author-time rules (64)...
314314
315315
✗ Author-time rules failed (1 issue)
316316
• stack · action 'resolve_ticket' visible: bare reference `status` — a

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

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -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 **55 of the 264 sites are spelled that way**. A
135+
forwarding shim cannot, and **55 of the 265 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 | **264** |
200+
| 175 write call sites | quoted in the merged changeset | **265** |
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 | **187 of 264** decidable, **77** undecidable |
203-
| 135 (77%) silenced by the `isSystem` guard before the posture gate | the lost issue body — **no surviving corroboration** | **not reproduced**: 147 decidably elevated, 0 decidably not, 109 undecidable |
202+
| 127 of 175 statically decidable, 48 runtime-parameter-name sites | restated on the `isSystem`-scoping card | **188 of 265** decidable, **77** undecidable |
203+
| 135 (77%) silenced by the `isSystem` guard before the posture gate | the lost issue body — **no surviving corroboration** | **not reproduced**: 148 decidably elevated, 0 decidably not, 109 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
@@ -217,11 +217,11 @@ 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-
147 of 264 (56%) as decidably elevated, with 109 more whose elevation is a
220+
148 of 265 (56%) as decidably elevated, with 109 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 / 264`, and say what it is**: the sites whose options argument was
224+
⇒ **Cite `2 / 265`, 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,28 +233,28 @@ cannot read, and they are neither in nor out.
233233

234234
| what | count |
235235
| :--- | ---: |
236-
| write call sites on the application surface | **264** |
237-
| …whose object name is statically decidable | 187 |
236+
| write call sites on the application surface | **265** |
237+
| …whose object name is statically decidable | 188 |
238238
| …whose object name is chosen at run time | 77 |
239-
| …against an object with tenancy ENABLED | 181 |
239+
| …against an object with tenancy ENABLED | 182 |
240240
| …against an object that declares tenancy off | 6 |
241-
| threading a tenant context | 201 |
241+
| threading a tenant context | 202 |
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 | 55 |
245245
| …of those, against a decidably tenancy-enabled object | 29 |
246-
| threading a decidably ELEVATED (`isSystem`) context | 147 |
246+
| threading a decidably ELEVATED (`isSystem`) context | 148 |
247247
| threading a context that is decidably NOT elevated | 0 |
248248
| threading a context whose elevation is a run-time fact | 109 |
249249

250250
| how the instrument reached the site | count |
251251
| :--- | ---: |
252-
| receiver carried a readable engine type | 202 |
252+
| receiver carried a readable engine type | 203 |
253253
| receiver erased, placed by the object NAME | 52 |
254254
| receiver erased, placed by an `object: string` PARAMETER | 5 |
255255
| receiver erased, placed by an `UNTYPED_RECEIVERS` row | 5 |
256256

257-
| object name spelled inline | 118 |
257+
| object name spelled inline | 119 |
258258
| object name spelled through a `const` | 69 |
259259
| object name is an `object: string` parameter | 7 |
260260
| object name is some other run-time expression | 70 |
@@ -307,11 +307,11 @@ 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-11-06 at `19cadde19`.
310+
Measured on 2026-11-06 at `4addb47fd`.
311311

312312
| corpus scale (not enforced) | count |
313313
| :--- | ---: |
314-
| tracked non-test sources scanned | 1044 |
314+
| tracked non-test sources scanned | 1045 |
315315
| engine-shaped types recognised | 112 |
316316
| declared objects in the registry | 130 |
317317
| same-named calls subtracted as non-engine | 234 |

‎content/docs/ui/react-pages.mdx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,7 @@ objectstack validate
404404
────────────────────────────────────────
405405
→ Loading configuration...
406406
→ Validating against ObjectStack Protocol...
407-
→ Running author-time rules (63)...
407+
→ Running author-time rules (64)...
408408
→ Checking that every required capability has a provider installable in this edition...
409409
→ Checking package docs (ADR-0046)...
410410

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

Lines changed: 8 additions & 7 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 | 264 |
37-
| Object name statically decidable | 187 |
36+
| Write call sites | 265 |
37+
| Object name statically decidable | 188 |
3838
| Object name chosen at run time | 77 |
39-
| Against a tenancy-enabled object | 181 |
39+
| Against a tenancy-enabled object | 182 |
4040
| Against an object declaring tenancy off | 6 |
41-
| Threading a tenant context | 201 |
41+
| Threading a tenant context | 202 |
4242
| Provably carrying none | 8 |
4343
| …and decidably tenancy-enabled | 2 |
4444
| Options argument unreadable | 55 |
4545
| …and decidably tenancy-enabled | 29 |
46-
| Threading a decidably elevated context | 147 |
46+
| Threading a decidably elevated context | 148 |
4747
| Threading a decidably non-elevated context | 0 |
4848
| Threading a context of undecidable elevation | 109 |
4949

@@ -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-11-06 at `19cadde19`.
93+
Measured on 2026-11-06 at `4addb47fd`.
9494

9595
| corpus scale (not enforced) | count |
9696
| :--- | ---: |
97-
| tracked non-test sources scanned | 1044 |
97+
| tracked non-test sources scanned | 1045 |
9898
| engine-shaped types recognised | 112 |
9999
| declared objects in the registry | 130 |
100100
| same-named calls subtracted as non-engine | 234 |
@@ -120,6 +120,7 @@ Measured on 2026-11-06 at `19cadde19`.
120120
| `packages/plugins/plugin-audit/src/activity-changed-fields-backfill.ts` | `update` | `sys_activity` | enabled | elevated | 1 |
121121
| `packages/plugins/plugin-audit/src/auth-event-audit.ts` | `insert` | `sys_audit_log` | enabled | options unreadable | 1 |
122122
| `packages/plugins/plugin-audit/src/comment-parent-pair-backfill.ts` | `update` | `sys_comment` | enabled | elevated | 1 |
123+
| `packages/plugins/plugin-audit/src/data-export-audit.ts` | `insert` | `sys_audit_log` | enabled | elevated | 1 |
123124
| `packages/plugins/plugin-audit/src/mail-log-body-migration.ts` | `update` | `object` | undecidable | elevated | 1 |
124125
| `packages/plugins/plugin-audit/src/mail-log-body-migration.ts` | `update` | `object` | undecidable | options unreadable | 1 |
125126
| `packages/plugins/plugin-audit/src/read-audit.ts` | `insert` | `sys_audit_log` | enabled | options unreadable | 1 |

0 commit comments

Comments
 (0)