Skip to content

Commit 5e6d804

Browse files
committed
Merge remote-tracking branch 'origin/main' into claude/project-thread-oorsb5
2 parents de4a8dc + a57a007 commit 5e6d804

69 files changed

Lines changed: 2343 additions & 116 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: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
'@objectstack/skills': patch
3+
---
4+
5+
docs(skills): more of objectstack-automation's self-contained examples are type-checked by `check:skill-examples`
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
Six more fenced TypeScript blocks in `skills/objectstack-automation/` carry the opt-in check marker, so 9 of its 19 are now compiled against the spec. In `SKILL.md` the `notify` node is typed `FlowNode` (`@objectstack/spec/automation`). In `references/examples-flows.md` the time-relative sweep is wrapped in `defineFlow`. In `references/state-machines-and-approvals.md` the `state_machine` rule is typed `StateMachineValidation` (`@objectstack/spec/data`) and the discount approval flow is wrapped in `defineFlow` with `cel` imported. In `references/integration-recipes.md` recipes 4 and 5 import `defineFlow` / `defineConnector` from `@objectstack/spec`. No example was wrong. Of the ten left unmarked, the trigger start node in `SKILL.md` and recipes 1 to 3 in `references/integration-recipes.md` compile with a wrapper but do not fit their file's token ceiling; the rest are fragments, or, for two `SKILL.md` blocks, fences indented inside a list item, which the check does not read. The marks are paid inside each file by removing restatements whose rule lives on elsewhere in the skill; every cross-reference stays, and no rule's teaching changes.
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
---
2+
'@objectstack/skills': patch
3+
---
4+
5+
docs(skills): objectstack-automation says how a `subflow` / `map` child flow name resolves, and when it is refused
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
The `subflow` and `map` rows of `skills/objectstack-automation/SKILL.md` now teach the engine's bare-name rule for `config.flowName` (ADR-0150 D3): a package's flow reaches its own package's flow, else the one holder in its declared `dependencies` closure plus `sys` packages; a package-less flow reaches the environment's flow, else the one package holder. Anything else passes `os validate` and fails the node at run time with the resolver's sentence naming every candidate and no error code: `outside-closure` (only an undeclared package or an environment-authored flow holds the name), `ambiguous-in-closure` / `ambiguous-in-environment` (two packages hold it; only a clash older than install's one-holder refusal, and such a name is never armed). A `map` fails at its first item. The automation evals gain a case that declares the dependency on the child flow's package.
11+
12+
Paid for by nine restatements cut from the same file, each keeping its other home:
13+
14+
1. The `screen` row's "never hand-roll a button label or step counter into `fields`": the same cell's "Next / Submit and Step N of M are not authored".
15+
2. The `script` example's "function returns values → outputVariable → update_record persists" comment: the prose sentence above it.
16+
3. The "CEL values or literals" comment on `script` `inputs`: Valid-but-silently-wrong #1, which lists `script` `inputs.*` as a value slot.
17+
4. "Do not remove `readonly` instead": objectstack-data's `readonly` bullet ("not by removing `readonly`").
18+
5. The `loop` row's sample envelope: #1's `{ dialect: 'cel', source: '…' }`.
19+
6. "never a reason to write code" in Integrations: the same paragraph's "Never a plugin" and "the app still writing none".
20+
7. References' "Read the source for exact field shapes; never rely on memory": `references/_index.md` ("Read them directly from `node_modules`").
21+
8. "hooks get `ctx.api`": the hook `runAs` paragraph ("that hook's `ctx.api` data operations").
22+
9. When to Use's "(auto-launched, screen, scheduled)" and "record-change": the Flow Types table and the frontmatter description.
23+
24+
The remaining 41 tokens move the file's ceiling 6527 -> 6568 under the standing ruling 「A:先削重复,余额按实测提高」 (ruling record 6513306068, letter B), pinned at the measurement.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
'@objectstack/plugin-audit': patch
3+
'@objectstack/plugin-auth': patch
4+
---
5+
6+
feat(plugin-audit): an API key or OAuth access token admitting a request leaves a `credential_use` row in `sys_audit_log`, once per credential per use window
7+
8+
Clause-②: yes (widening)
9+
Metadata-protocol: none
10+
11+
Credential use left no ledger row naming the credential: the only trace was the credential's own last-use stamp. An audit export or SIEM stream had nothing to read for "which key or token acted as whom, and when".
12+
13+
- **`sys_audit_log.action` gains `credential_use`** (`@objectstack/plugin-audit`). One row per credential per use window, written when the credential's own throttled use stamp lands: `sys_api_key.last_used_at` (the shared key-admission seam, at most once per key per hour, so every door that admits a key counts: REST, the runtime dispatcher and its `/mcp` face, the stdio MCP transport, the storage doors) and `sys_oauth_consent.last_used_at` (an OAuth access token's use on the `/mcp` door, at most once per consent per clock hour). No new timer: a second use inside the window writes no row.
14+
- **The row** names the credential's owner (`user_id`, `actor`), the credential row (`object_name` / `record_id`), the organization it is bound to (`tenant_id`, or none), and in `metadata` the `credential_kind` (`api_key` / `oauth_access_token`), the `credential_id`, the window start (`used_at`) and, for a token, the `client_id`. It never carries a key, a token, a key hash or a key prefix.
15+
- **A `skip_consent` OAuth client** (`@objectstack/plugin-auth`) has no consent row to stamp. Its use is handed to the new `audit` slot member `recordCredentialUse` from the same stamp point and under the same throttle (at most once per client, user and organization per clock hour in each process); the row names the client's `sys_oauth_application` row.
16+
- **Not yet on the row:** the source address and the user agent (`ip_address` / `user_agent` are null). Neither stamp point holds them; they follow in a separate change.
17+
18+
Nothing about which credentials are admitted changes. To read the rows: filter `sys_audit_log` on `action = 'credential_use'`.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
'@objectstack/cloud-connection': patch
3+
---
4+
5+
Clause-②: yes (widening)
6+
Metadata-protocol: none
7+
8+
An in-environment marketplace install can name the package version to install. `POST /api/v1/cloud-connection/install` now accepts `version` and forwards it to the control plane's install action, which installs that version or refuses it as it does today. Leaving `version` out still installs the latest version, and the request sent to the control plane is unchanged.
9+
10+
A `version` that is not a SemVer 2.0.0 string (for example `latest`, `1.2` or `^1.2.3`) is refused with `400 INVALID_REQUEST` before anything is sent.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
'@objectstack/lint': patch
3+
'@objectstack/service-automation': patch
4+
---
5+
6+
fix(lint, service-automation): `os validate` warns when a mapping's `connectorSource.connector` is not a declared rest or openapi connector, and a failed connector pull logs one `warn` line
7+
8+
Clause-②: no
9+
Metadata-protocol: none
10+
11+
A mapping whose `connectorSource.connector` named a datasource, a connector of another provider, or nothing at all validated with no finding, and every scheduled pull then failed into the job run's `error` with nothing in the process log. `os validate`, `os lint` and `os build` now report `mapping-connector-source-unknown` (a warning; it says when the name is a datasource), and `@objectstack/lint` exports `validateMappingConnectorSources`, `MAPPING_CONNECTOR_SOURCE_UNKNOWN`, `CONNECTOR_SOURCE_PROVIDERS` and the `MappingConnectorSourceFinding` type. The connector pull (`pullConnectorSource`) logs `[Automation] connector pull of mapping "NAME" failed (REASON): …` at `warn` on every failed pull and rethrows the failure unchanged; the job run's `error` is written as before.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
'@objectstack/skills': patch
3+
---
4+
5+
docs(skills): objectstack-data `security.md` teaches how a package's position resolves the permission sets it names
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
`skills/objectstack-data/rules/security.md`, section "Positions grant only what they name", now states the rule the security catalog enforces since ADR-0150 E3: a package's position reads each `permissionSets` name as its own package's set, else the one holder in its declared `dependencies` closure plus `sys`. Otherwise the name is refused. Two refusals are taught, each with an example: `outside-closure` (only a package the position's package does not depend on holds the set, or only the environment does, such as a set authored in Setup) and `ambiguous-in-closure` (two holders it reaches; a second package shipping a set name is already refused at install). A refused name still loads; the boot's catalog reference report logs it with every candidate, and the position grants nothing through that name while its other sets still grant. Stored grants, environment-authored positions, administrator overlays of a package position and the `everyone`/`guest` anchors still resolve across the whole environment. `evals/hooks-security-seeds-datasources.json` gains case 19, which requires the position's `permissionSets` entry plus a manifest `dependencies` entry on the set's package and refuses redeclaring the set in the position's package.
11+
12+
The file sat 16 bytes under its token ceiling. One restatement is cut in the same file: the `secret` paragraph's "**Fail-closed:** with no crypto provider, writes throw rather than persist cleartext." (86 B), which survives as "fail-closed (ADR-0100)" in the `secret` row of `rules/field-types.md`. The remainder raises the ceiling under standing ruling 6513306068, letter B: 「A:先削重复,余额按实测提高」. The file goes from 15056 to 15834 bytes, and the ceiling from 3768 to 3959 tokens, pinned at the measurement.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
'@objectstack/cloud-connection': patch
3+
---
4+
5+
fix(cloud-connection): a catalog list query the public marketplace snapshot cannot evaluate is answered by the cloud
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
With `OS_MARKETPLACE_PUBLIC_BASE_URL` set, the marketplace proxy answers `GET /api/v1/marketplace/packages` from the public snapshot and filters and pages it itself. It evaluates `q`, `limit`, `offset`, `maturity` and the `businessFunctions`, `industries` and `solutionTypes` facets, and it used to ignore every other key: a `?languages=zh-CN` read answered the whole catalog with 200 (or, with `limit`/`offset`, a page filtered by everything except the languages), and the cloud's facet counts were dropped from the re-serialized page. Nothing told that answer apart from a filtered one.
11+
12+
A list request that carries any key the snapshot does not evaluate now takes the cloud path, which receives the query string verbatim: the same answer, counts included, as a runtime without the snapshot configured. Requests made only of the keys above are still answered from the snapshot. Nothing to do on upgrade; a `languages` read on such a runtime now needs the cloud to be reachable, and answers the existing `502 MARKETPLACE_PROXY_FAILED` when it is not.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
'@objectstack/service-job': patch
3+
---
4+
5+
fix(service-job): a scheduled fire renews its cluster lease while it runs, so a long job no longer starts on a second node
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
A scheduled fire takes the cluster lock `job:NAME` with a 60-second lease (`leaseMs`) and used to never renew it. On a deployment with several nodes, a run that outlasted the lease freed the key while still running, and another node's next tick took it and started the same job, so a large sync or report ran on two nodes at once.
11+
12+
`CronJobAdapter` now renews the handle it acquired every `leaseMs / 3` (20 s by default) while the handler runs, through the lock handle's own `renew()`, and stops renewing in the same `finally` that releases the lock. Nothing new is persisted: a node that dies stops renewing and the key frees itself on its lease as before. A run shorter than a third of the lease is never renewed, and `once` jobs behave as before.
13+
14+
If a renewal fails, the run is not cancelled. The adapter logs one `warn` per failure naming the job and the error. While the handle still reports it holds the lock, the next heartbeat tries again; once the lease is lost, renewal stops for that run, and another node's next tick may take the key and start the job there too. The in-process latch from the previous fix still keeps this node from overlapping itself.

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

Lines changed: 18 additions & 18 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 **57 of the 276 sites are spelled that way**. A
135+
forwarding shim cannot, and **57 of the 277 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 | **276** |
200+
| 175 write call sites | quoted in the merged changeset | **277** |
201201
| 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 | **196 of 276** decidable, **80** undecidable |
203-
| 135 (77%) silenced by the `isSystem` guard before the posture gate | the lost issue body — **no surviving corroboration** | **not reproduced**: 153 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 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 |
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-
153 of 276 (55%) as decidably elevated, with 113 more whose elevation is a
220+
154 of 277 (56%) as decidably elevated, with 113 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 `3 / 276`, and say what it is**: the sites whose options argument was
224+
⇒ **Cite `3 / 277`, 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" — **30 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 | **276** |
237-
| …whose object name is statically decidable | 196 |
236+
| write call sites on the application surface | **277** |
237+
| …whose object name is statically decidable | 197 |
238238
| …whose object name is chosen at run time | 80 |
239-
| …against an object with tenancy ENABLED | 190 |
239+
| …against an object with tenancy ENABLED | 191 |
240240
| …against an object that declares tenancy off | 6 |
241-
| threading a tenant context | 209 |
241+
| threading a tenant context | 210 |
242242
| PROVABLY carrying none (options read, no context key) | **10** |
243243
| …of those, against a decidably tenancy-enabled object | **3** |
244244
| options argument UNREADABLE — may or may not carry one | 57 |
245245
| …of those, against a decidably tenancy-enabled object | 30 |
246-
| threading a decidably ELEVATED (`isSystem`) context | 153 |
246+
| threading a decidably ELEVATED (`isSystem`) context | 154 |
247247
| threading a context that is decidably NOT elevated | 0 |
248248
| threading a context whose elevation is a run-time fact | 113 |
249249

250250
| how the instrument reached the site | count |
251251
| :--- | ---: |
252-
| receiver carried a readable engine type | 214 |
252+
| receiver carried a readable engine type | 215 |
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 | 124 |
257+
| object name spelled inline | 125 |
258258
| object name spelled through a `const` | 72 |
259259
| object name is an `object: string` parameter | 7 |
260260
| object name is some other run-time expression | 73 |
@@ -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-11-08 at `da13e5987`.
310+
Measured on 2026-11-09 at `a06abc67a`.
311311

312312
| corpus scale (not enforced) | count |
313313
| :--- | ---: |
314-
| tracked non-test sources scanned | 1068 |
315-
| engine-shaped types recognised | 115 |
316-
| declared objects in the registry | 132 |
317-
| same-named calls subtracted as non-engine | 243 |
314+
| tracked non-test sources scanned | 1082 |
315+
| engine-shaped types recognised | 118 |
316+
| declared objects in the registry | 133 |
317+
| same-named calls subtracted as non-engine | 248 |
318318

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

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

Lines changed: 11 additions & 10 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 | 276 |
37-
| Object name statically decidable | 196 |
36+
| Write call sites | 277 |
37+
| Object name statically decidable | 197 |
3838
| Object name chosen at run time | 80 |
39-
| Against a tenancy-enabled object | 190 |
39+
| Against a tenancy-enabled object | 191 |
4040
| Against an object declaring tenancy off | 6 |
41-
| Threading a tenant context | 209 |
41+
| Threading a tenant context | 210 |
4242
| Provably carrying none | 10 |
4343
| …and decidably tenancy-enabled | 3 |
4444
| Options argument unreadable | 57 |
4545
| …and decidably tenancy-enabled | 30 |
46-
| Threading a decidably elevated context | 153 |
46+
| Threading a decidably elevated context | 154 |
4747
| Threading a decidably non-elevated context | 0 |
4848
| Threading a context of undecidable elevation | 113 |
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-11-08 at `da13e5987`.
93+
Measured on 2026-11-09 at `a06abc67a`.
9494

9595
| corpus scale (not enforced) | count |
9696
| :--- | ---: |
97-
| tracked non-test sources scanned | 1068 |
98-
| engine-shaped types recognised | 115 |
99-
| declared objects in the registry | 132 |
100-
| same-named calls subtracted as non-engine | 243 |
97+
| tracked non-test sources scanned | 1082 |
98+
| engine-shaped types recognised | 118 |
99+
| declared objects in the registry | 133 |
100+
| same-named calls subtracted as non-engine | 248 |
101101

102102
## Every site
103103

@@ -120,6 +120,7 @@ Measured on 2026-11-08 at `da13e5987`.
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/credential-use-audit.ts` | `insert` | `sys_audit_log` | enabled | elevated | 1 |
123124
| `packages/plugins/plugin-audit/src/data-export-audit.ts` | `insert` | `sys_audit_log` | enabled | elevated | 1 |
124125
| `packages/plugins/plugin-audit/src/mail-log-body-migration.ts` | `update` | `object` | undecidable | elevated | 1 |
125126
| `packages/plugins/plugin-audit/src/mail-log-body-migration.ts` | `update` | `object` | undecidable | options unreadable | 1 |

0 commit comments

Comments
 (0)