Skip to content

Commit 8e83084

Browse files
committed
Merge remote-tracking branch 'origin/main' into claude/authorize-gate-judges-every-client-id
Keeps both declarations at the shared insertion point in auth-manager-before-hook.ts: the authorize gate's client collection and the cloud-managed reset doors from main. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017xRBcT1w3zpekijraHJE4f
2 parents 8a779de + b8ac0e2 commit 8e83084

98 files changed

Lines changed: 4004 additions & 409 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: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
---
2+
'@objectstack/metadata-protocol': patch
3+
---
4+
5+
fix(metadata-protocol): a bare save of a name an enabled and a disabled package both hold writes the enabled holder's row, where the bare read serves it
6+
7+
Clause-②: yes (widening) — a bare save of a name an enabled and a disabled package both hold, refused 409 naming both when each held a stored row, now writes the enabled holder's row; nothing the save door accepted is refused
8+
Metadata-protocol: none
9+
10+
A save that names no package (`PUT /meta/:type/:name` with no `?package=`, or `saveMetaItem` with no `packageId`) now resolves its address the way the read at the same address does (ADR-0150 D3/D5). A disabled package holds nothing an address reaches. Before this fix the save door still counted a disabled package as a holder of the name. So when an enabled package E and a disabled package D both held the name, the save could:
11+
12+
- write a new package-unbound row, an environment-own item that shadows both packages once D is enabled again;
13+
- update D's row silently, so the next read kept serving E's item and the edit never showed;
14+
- refuse 409 naming D, while the read served E without ambiguity.
15+
16+
The bare save of such a name is now E's write (ADR-0150 D4). It writes E's row, D's row stays byte-unchanged, and D is never named. When two or more enabled packages hold the name beside the disabled one, the save refuses 409 and names only the enabled ones. When a package-unbound row already stands in for the item, the save edits that row, which is the one the read serves. Once D is enabled again, the bare read and the bare save both answer 409 naming both packages. A name no disabled package holds saves exactly as before. So does a name only disabled packages hold.
17+
18+
What moves, for a bare save of a name held by an enabled package E and a disabled package D:
19+
20+
- FROM D's row silently updated TO E's row written, D's row unchanged.
21+
- FROM a package-unbound row written TO a row bound to E.
22+
- FROM 409 naming E and D TO E's row updated (a widening: the save now writes where it refused).
23+
24+
Nothing to migrate. To edit D's own row while D is disabled, name it: `?package=` on the REST door, `packageId` in process.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
'@objectstack/runtime': patch
3+
---
4+
5+
fix(runtime): an addressed `/automation/:ns/:name/(runs|trigger)` route under a verb it does not serve answers the automation domain, as its bare path does
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
On the standalone server (the dispatcher plugin on an HTTP adapter), an address is served exactly as its bare path (ADR-0150 D5), but a verb the route is not served under was answered differently on the two. `DELETE /api/v1/automation/send_digest/runs` answered the automation domain's `405` with `Allow: GET` in the dispatcher's envelope, and `401 UNAUTHENTICATED` to an anonymous caller. `DELETE /api/v1/automation/crm/send_digest/runs` answered the transport's `405` with `Allow: GET, HEAD` and an `error.details` envelope, to an anonymous caller too. The same held for `POST` / `PUT` on the addressed `/runs`, `GET` on `/automation/NS/NAME/trigger` and `GET` on `/automation/trigger/NS/NAME`.
11+
12+
The dispatcher now declares those three addressed shapes as routes whose domain decides every verb, as it already did for their bare two-segment shapes. Each of them answers an anonymous caller `401`, and a signed-in caller the domain's `405` with the verbs the route serves (`Allow: GET` for `/runs`, `Allow: POST` for both triggers) in the dispatcher's envelope. A served verb on an address (`GET .../runs`, `POST .../trigger`) is unchanged, and so is a three-segment path whose first segment is no installed namespace: under an unserved verb it now answers the dispatcher's `404 ROUTE_NOT_FOUND`, as the same path does under `GET`.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
'@objectstack/plugin-auth': patch
3+
---
4+
5+
fix(auth)!: a cloud-managed environment sets no local password for anyone, a platform administrator included
6+
7+
Clause-②: yes (narrowing) — narrowed: on a cloud-managed environment only (`OS_CLOUD_MANAGED=1`), `POST /admin/set-user-password` now answers `409 RESOURCE_CONFLICT` for an `env_native` target too, where it set the password, and `POST /set-initial-password` now answers `409 RESOURCE_CONFLICT` to a signed-in platform administrator too, where it set their first local password; `POST /reset-password` and `POST /phone-number/reset-password` now answer `409 RESOURCE_CONFLICT` to every request, where a valid token or code set (or created) the password, and `POST /request-password-reset` and `POST /phone-number/request-password-reset` answer `409 RESOURCE_CONFLICT` too, where they answered success and sent a link or code. Two refusal sentences are added (`CLOUD_MANAGED_REFUSAL_MESSAGES.resetPassword` and `.requestPasswordReset`). The two existing ones (`.setUserPassword` and `.setInitialPassword`) no longer promise a local or break-glass password. The managed `set-user-password` arm no longer reads the target's identity source, so its `503 SERVICE_UNAVAILABLE` answer for an unreadable source is gone on a managed environment.
8+
Metadata-protocol: none
9+
Skills-docs: none — no skill under `skills/**` teaches the cloud-managed password doors; `content/docs/permissions/authentication.mdx` gains the rule in this change.
10+
11+
<!-- adr-0087: not-required (no-migration-prescription) No schema key, accepted value or metadata type is added, removed, renamed or re-shaped. The moved answers are runtime refusals at six auth doors under a deployment switch that only hosted environments set, so there is nothing stored for a migration to rewrite and no tombstone. -->
12+
13+
**BREAKING** for a cloud-managed environment (`OS_CLOUD_MANAGED=1`, set only on hosted containers): a hosted environment sets no local password for anyone and has no local break-glass administrator. `POST /admin/set-user-password` (the Set Password action on a user) refuses every target, an environment-native account included; `POST /set-initial-password` refuses every signed-in caller, a platform administrator included; and the self-service reset doors (`POST /reset-password`, `POST /phone-number/reset-password`, and `POST /request-password-reset`, `POST /phone-number/request-password-reset`, which send the link or code) refuse every request. Each answers `409 RESOURCE_CONFLICT` and writes nothing. A caller with no session at `set-initial-password` is answered as before.
14+
15+
Unchanged: every self-hosted deployment (the variable unset), where the doors answer as before, SSO-only mode's rules included; and a local password a user already holds on a managed environment (invalidating those is the hosting cloud's work).
16+
17+
What to do: nothing on a self-hosted deployment. On a hosted environment, sign in through the hosting organisation's identity provider; there is no local password to set.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
'@objectstack/metadata-protocol': patch
3+
---
4+
5+
fix(metadata-protocol): the by-name read of an action grafts a package's artifact envelope only onto the item that package holds at its own `(object, name)`, so the environment's own action on another object is served as the environment's (#33456)
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
ADR-0150 D4 keys an action by `(package, object, name)`. The by-name read (`getMetaItem`, `getMetaItemForExecution`) looked the served item's artifact envelope up by name alone, so beside ONE package that binds an action name to one object, the environment's own package-less action of that name bound to another object (or object-less) was served carrying that package's `_packageId`, `_packageVersion` and `_provenance: 'package'`.
11+
12+
What moves, with ALPHA and BETA two packages and `approve` the action name:
13+
14+
- ALPHA binds `approve` to `account`, the environment's own row binds it to `contact` (or BETA binds it to `contact` alone and the row binds it to `account`): `GET /api/v1/meta/action/approve` on `RestServer` and the runtime dispatcher, `getMetaItemForExecution`, and the declaration `/actions/contact/approve` (`/actions/account/approve` in the second shape) judges, serve the environment's item with no package envelope, FROM the holder's `_packageId` and `_provenance: 'package'`. The route's `packageId` stays unset and the environment's handler runs, as before.
15+
- The same with the row object-less beside ALPHA on `account`, or bound to `account` beside ALPHA object-less: no package envelope, FROM ALPHA's.
16+
17+
Not changed: a package-less row on the object a package binds the name to (that package's customization, still under its envelope); a name two packages hold on one object (refused, naming both); a name one package holds with no package-less row; a read naming a package (`?package=`), which keeps that package's own item and envelope; every type other than `action`; stored rows (no migration).
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
'@objectstack/spec': patch
3+
'@objectstack/plugin-security': patch
4+
---
5+
6+
fix(plugin-security, spec): the master-detail write refusal tells its user which master record needs their access, in their language
7+
8+
Clause-②: no
9+
Metadata-protocol: none
10+
11+
A write of a `controlled_by_parent` detail (create, edit, delete and the other write verbs) refused because the caller lacks edit access on its master record (or read access, on a detail that declares `writeRequiresMasterRead`) now carries a `userMessage`. It names the master object's label: the deployment's translation in the caller's language, else the declared label. The caller's language is the request locale, else the workspace default, else English. The console shows a refusal's `userMessage` in place of its generic "You don't have permission to save this record.", so a user creating a billing milestone under a contract they can read but not edit now reads that the missing access is on the contract.
12+
13+
The sentences are new keys in the operation-message catalog (en, zh-CN, ja-JP, es-ES): `errors.master_record_edit_denied` and `errors.master_record_read_denied`, with `{{master}}`, and their `_opaque` forms, which name no master. The opaque forms answer a writer who cannot read the master reference (the refusal names no master to them) and a master object with no label. A deployment overrides any of the four with a `translation` item under that key.
14+
15+
The HTTP status, `code`, `message` and `details` of the refusal are unchanged; only `userMessage` is added. The owner-rule refusal of a row whose optional master is empty is unchanged and carries no `userMessage`.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
'@objectstack/platform-objects': patch
3+
---
4+
5+
fix(platform-objects): the Sessions page subtitle no longer says "active" on the revoked view
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
`sys_session`'s object description was "Active user sessions", and the console draws an object's description as the subtitle of every list view, so Setup → Sessions → Revoked (the audit view of ended sessions) was titled as active sessions. The description is now the neutral "User sessions", in the source and in all eleven locale bundles. No key, field, view or action changes; the toolbar's "Sign out other devices" action is unchanged and still shows on every session view.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
'@objectstack/spec': patch
3+
---
4+
5+
docs(spec): the `HttpConfigSchema.method` TSDoc says how a durable `http` node's verb is resolved, without quoting removed code
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
The TSDoc on `method` in `io-node-config.zod.ts` quoted two `??` spellings the `http` node executor no longer has. It now says that a durable node with no `method` sends `POST`, whether through the messaging HTTP outbox or on the no-outbox fallback, and that the executor resolves the verb once from the authored `method` and `durable`. The schema itself is unchanged.
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
---
2+
'@objectstack/spec': minor
3+
'@objectstack/objectql': patch
4+
'@objectstack/driver-sql': patch
5+
'@objectstack/driver-turso': patch
6+
---
7+
8+
feat(spec, objectql, driver-sql, driver-turso): a per-measure aggregation filter runs in SQL on driver-sql, behind one declared driver capability (#33698)
9+
10+
Clause-②: yes (widening: one optional DriverCapabilities bit)
11+
Metadata-protocol: semantic
12+
13+
**The capability.** `DriverCapabilities` (`@objectstack/spec/data`) gains one optional boolean, `aggregationFilter`: the driver's `aggregate()` evaluates a per-measure `aggregations[].filter` itself, with the answers the engine's in-memory aggregation gives, except that text compares by the database collation (see the last paragraph). Absence means `false`. A driver that declares nothing keeps exactly the path it had.
14+
15+
**What runs where.**
16+
17+
- `engine.aggregate` sends an aggregate whose measures carry a `filter` to `driver.aggregate` only when the driver declares `aggregationFilter: true` and has the method. Every other driver keeps the in-memory path: `find()` for the scoped rows, then the filter and the aggregate in the engine. A non-UTC timezone with a date bucket still forces the in-memory path, as before.
18+
- `driver-sql` declares the bit and compiles each filtered measure as a conditional aggregate, the predicate from the same where compiler a `where` uses: `sum(CASE WHEN (pred) THEN amount END)`, the same for `avg`, `min`, `max`; `count(CASE WHEN (pred) THEN 1 END)` for a count of rows (no `ELSE 0`, which `count` would count); `count(CASE WHEN (pred) THEN field END)` for a count of a field; `count(distinct CASE WHEN (pred) THEN field END)` for `count_distinct`. A group the filter empties answers `0` for `sum` and the counts and `null` for `avg`, `min` and `max`, as before. The tenant wall and the read scope stay on the statement's own `where`, so a measure filter only narrows inside them. `SqliteWasmDriver` inherits the compile.
19+
- `driver-turso` turns the bit off in remote mode, where the remote transport refuses the key; local and embedded-replica modes inherit driver-sql's compile.
20+
- A direct `SqlDriver#aggregate` call with a measure filter now answers the filtered numbers instead of refusing `NOT_IMPLEMENTED` / 501. The 501 remains only for a compiled predicate the driver cannot isolate, which no tested dialect produces.
21+
22+
**What answers differently in memory.** A measure filter, a `having` clause and the in-memory `where` that plugin drivers use all go through one engine evaluator. In that evaluator a column holding no value (SQL NULL) now fails `$gt`, `$gte`, `$lt`, `$lte` and `$between`, as SQL does and as the spec says (null is not ordered). Before, NULL counted as `0` for numbers, so "count where amount ≤ 0" also counted every row with no amount, and `$between` matched a NULL column for any bounds. A `having` on an empty group's `avg`, `min` or `max` (which is `null`) likewise no longer passes an ordering test. `$eq`, `$ne`, `$in`, `$nin`, `$exists`, `$null`, `$empty` and a `null` comparand answer as before.
23+
24+
**A measure filter the `where` compiler refuses now refuses on driver-sql.** Because driver-sql compiles a measure filter with the same where compiler, a filter that compiler refuses answers the same `400 INVALID_FILTER` its `where` twin answers. The recorded case is a `{ $field }` comparison between columns of different classes on an object with no audit fields (`created_at` against an image field): before, the engine evaluated it in memory and answered `200`; on driver-sql it now answers `400 INVALID_FILTER`, as `where` always did. A driver without the bit still evaluates it in memory and answers `200`.
25+
26+
**Declared latitude: text compares by the database collation.** On driver-sql a measure filter now answers what the `where` of the same datasource answers, so text comparison in it follows the database collation, where the in-memory path compares text exactly. Ordering a non-temporal text column (`$gt` / `$lt` / `$between` on text) follows the collation everywhere; on a case- or accent-insensitive collation, equality and membership do too, so `stage $eq 'won'` also counts `Won` rows, as `where` already does. Measured: SQLite and PostgreSQL 16 agree with the in-memory path on every operator with a `C.UTF-8` collation; PostgreSQL 16 with an ICU `en-US` collation differs only in text ordering. MySQL, SQL Server and Oracle were not measured; the MySQL and SQL Server default collations are case-insensitive.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
'@objectstack/scenarios': patch
3+
---
4+
5+
feat(scenarios): the scorecard sums the ask side's cost and time per served model, and the authoring turns' time, and states each Run half's guardrail
6+
7+
Clause-②: yes (widening) — new exports `TurnCost`, `TurnTime`, `ModelSpend`, `AskSpend`, `turnCost`, `turnTime`, `askSpend`, `authorTimeText`, `askCostText` and `askTimeText` (`scorecard.ts`, `./runner`), with `AuthorCost` now an alias of `TurnCost` (same shape); new optional fields `ModeScorecard.authorTime` / `askSpend` and `CardScorecard.authorTime` / `askSpend` (`scorecard.ts`), `TurnSummary.reportedDurationMs` / `reportedApiDurationMs` (`orchestrate.ts`) and `ParsedTurn.meta.reportedDurationMs` / `reportedApiDurationMs` (`transcript.ts`); the guardrail line's new export `guardrailTally`, type `GuardrailVerdict` and optional field `HalfScores.guardrails` (`scorecard.ts`); all reached through `./runner`
8+
Metadata-protocol: none
9+
10+
Until now the scorecard summed cost for the authoring turns only and stated no time beside it, so comparing ask models by score per dollar or per minute had nothing to read: every question and operation turn kept its cost and elapsed time in the record, but no row summed them.
11+
12+
The scorecard adds `Author time`, `Ask cost` and `Ask time` rows (each mode) and `author time`, `ask cost` and `ask time` lines (the card). The ask figures cover every question and operation turn that ran, the Run half's and the iterate's, grouped by the model each turn was served (`claude-haiku-5-5: $0.31 over 28 ask turns`). Cost follows the author-cost rule: a model's cost is stated only when every one of its turns reported one, never reading a missing cost as zero. Time is the runner's own clock (`elapsedMs`, the driver's process from spawn to exit, already recorded for `claude`, `codex` and `external:` turns), stated only when every counted turn was timed; otherwise the cell says how many turns were not timed (`2 of 28 ask turns not timed`), never a smaller sum. A replayed turn re-reads the recorded run's time, and a turn recorded before the runner kept a process is not timed, never zero. A scorecard written before these rows reads `not recorded` in them.
13+
14+
Each turn also records the duration the `claude` CLI states on its result line (`reportedDurationMs` from `duration_ms`, `reportedApiDurationMs` from `duration_api_ms`), beside the runner's clock; the rows sum the runner's clock only.
15+
16+
The scorecard also states each Run half's guardrail checks (`RunHalf.guardrails`, today `guardrail:injection_as_data`) on a row of their own, `Run · guardrails` and `Iterate · Run · guardrails`: `pass`, `fail`, or `not measured: <reason>`, never a pass when nothing was measured. A half recorded before the guardrail was graded shows nothing, and a card none of whose halves carries one has no such row.

0 commit comments

Comments
 (0)