Skip to content

Commit 60e5e25

Browse files
committed
Merge remote-tracking branch 'origin/main' into claude/project-thread-dhp24e
2 parents 9eafdc7 + c94a4da commit 60e5e25

78 files changed

Lines changed: 4060 additions & 287 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.

‎.changeset/31699-connection-key-package.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Part of #31699 (ADR-0150 child B, PR 3a: the storage half). The maintainer's rul
3333

3434
**Declared limits.**
3535

36-
- MySQL 8, upgraded databases: `driver-sql` reads the guard's functional key part as an expression, not as a partial guard, so the widening arm keeps the old key there. The old key keeps refusing what it refused, so an organization cannot connect a second package's instance of one name on such a database until `driver-sql` recognises the form. A database created fresh on MySQL 8 has the wide key and the guard and no old key. The permission-set grant's guard (#32164) shares this limit. MySQL before 8.0.13 and MariaDB before 10.3 build no form, keep the old key (or build it under the driver's generated name where it is missing) and say so at `error` each boot.
36+
- MySQL 8, upgraded databases: `driver-sql` reads the guard's functional key part as the partial unique it is, so the old key retires there as it does on PostgreSQL, as one safe `replace_unique_index` on the next sync that runs safe drift. A database created fresh on MySQL 8 has the wide key and the guard and no old key. MySQL before 8.0.13 and MariaDB before 10.3 build no form, keep the old key (or build it under the driver's generated name where it is missing) and say so at `error` each boot.
3737
- `driver-memory` builds no guard (no raw-SQL seam), as for the grant: a pin measures that its unique check treats a NULL package as distinct, so two package-less connections of one instance are admitted there.
3838
- The MySQL, MariaDB and real-mongod pins run in suites that run on `main` only, so they first run after this lands.
3939

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
'@objectstack/objectql': patch
3+
'@objectstack/lint': patch
4+
---
5+
6+
fix(objectql, lint): on a `managedBy: 'synced'` object, the stripped-`apiMethods` warning and the `object/managed-api-method-unaffordable` finding no longer tell the author to open a verb through `userActions`, which the parse refuses there (ADR-0153 D4, #32134)
7+
8+
Clause-②: no
9+
Metadata-protocol: none
10+
11+
- `reconcileManagedApiMethods` (`@objectstack/objectql`): on a write-locked bucket (`MANAGED_BY_WRITE_LOCKED_BUCKETS`, today `synced` alone) the warning's remedy now reads "userActions cannot open a write on this bucket (ADR-0153 D4): remove [VERBS] from enable.apiMethods and send writes through a declared action (ADR-0153 D5)." Every other bucket keeps "Declare userActions to open a verb the object legitimately takes from a user context." The strip itself is unchanged.
12+
- `object/managed-api-method-unaffordable` (`@objectstack/lint`): on `synced` the verdict says `userActions` cannot open a write there instead of "(needs userActions …)", and the fix line offers only the removal and a declared action. `os explain object/managed-api-method-unaffordable` gains a paragraph saying so. Every other bucket's verdict and fix line are unchanged, and the rule id, severity, `path` and what the rule refuses are unchanged.

‎.changeset/32284-run-wait-ms.md‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
'@objectstack/spec': minor
3+
'@objectstack/service-automation': minor
4+
---
5+
6+
feat(automation): a run record says how much of its duration the run spent suspended, so a resumed screen flow no longer reads as an 18-second execution
7+
8+
Clause-②: yes (widening)
9+
Metadata-protocol: added
10+
11+
A run's `durationMs` is its total wall time, pauses included. A screen flow resumed after the user filled the screen in reported `durationMs: 18691`, almost all of it the user's wait, and nothing on the record told an admin that the run was waiting rather than slow.
12+
13+
`ExecutionLogSchema` (`@objectstack/spec/automation`), the run record served by `GET /api/v1/automation/:name/runs/:runId` and the runs list, gains an optional `waitMs`: the total time the run spent suspended at a `screen`, `approval`, `wait` or other pausing node, summed over all its pauses. `durationMs` keeps its meaning, so the time a run spent executing is `durationMs - waitMs`. A run that never paused carries `waitMs: 0`, a measured zero; a `paused` entry carries the wait up to the moment it was written. Absent means not recorded (a `missed` entry, or a run paused before this release), which is not the same as zero.
14+
15+
`@objectstack/service-automation` fills it on every run record: initial execution and its retries, resume (completed, refused, stranded, re-suspended), a paused run cancelled or failed where it waits, and the operator restore of a consumed suspension, which keeps the clock of the pause it re-arms. A suspension carries one number, `SuspendedRun.activeMs` (the time the run had executed when it paused), so the wait sums across any number of pauses and process restarts. `sys_automation_run` gains two nullable columns: `active_ms` on paused rows (and on a stranded row's consumed snapshot) and `wait_ms` on terminal rows.
16+
17+
Nothing to migrate: rows written before this release keep both columns empty and read `waitMs` as not recorded. A client that validates the run record with `ExecutionLogSchema` from an older `@objectstack/spec` strips the new member and reads the record as before.
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 protocol upgrade guide names what each package's address answers when two packages each hold a stored row of one name: that package's own row, in every save order, before and after a restart (ADR-0150 D3/D4)
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
The semantic entry `stored-row-own-package-slot` (`packages/spec/src/migrations/entries/semantic/18.stored-row-own-package-slot.ts`) registers the narrowing `.changeset/33127-stored-row-own-package-slot.md` declares (ADR-0087, `adr-0087: registered`): no automatic rewrite, since every stored row keeps its shape and its binding. It adds no key and no export.
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
---
2+
'@objectstack/objectql': minor
3+
'@objectstack/metadata-protocol': minor
4+
---
5+
6+
fix(objectql,metadata-protocol)!: a stored row bound to a package lives in that package's own registry slot, so each package's address serves its own row in every save order, before and after a restart (ADR-0150 D3/D4)
7+
8+
Clause-②: yes (narrowing) — one served answer goes away: an action that two packages hold only as stored rows was served by the read naming no package after a restart (the row hydrated last); it now refuses `409 RESOURCE_CONFLICT` naming both, as every other type the registry reads by package already did (#32607). The widening is on `SchemaRegistry`, exported from `@objectstack/objectql`: `registerItem` takes an optional fifth argument `{ storedRowPackage }`, and one new public method `removePackageOverlaySlots(type, name, member, select)`; and four reads that answered a shipped item, a 404 or a 409 now answer the address's own stored row (below).
9+
Metadata-protocol: semantic
10+
Skills-docs: none — `skills/**` and `content/docs/**` teach no reading of a name two packages each store a row of (grepped `?package=`, `.custom`, `409`: the hits are the pair's save door, a flow's secret refusal and a permission grant), so no taught sentence moves; the read naming no package keeps its `409` and its `?package=` remedy.
11+
12+
<!-- adr-0087: registered stored-row-own-package-slot -->
13+
14+
**BREAKING** for a reader of an action that two packages hold only as stored rows, by the read naming no package (`GET /api/v1/meta/action/NAME`), after a restart: it refused before the restart and served the row hydrated last after it; it now refuses `409 RESOURCE_CONFLICT` naming both packages, before and after. The fix: read each package's action by its package (`?package=ID`).
15+
16+
The registry kept ONE slot per name for a stored row (`registerItem` with no package), so the row saved or hydrated last took it. Each stored row of a type the registry reads by package (action, tool, agent, skill, webhook, api, email template, picklist, mapping, dataset; flow and permission keep their own slot rules) that is bound to a package — its own, or its `.custom` pair's by the pair-row rule — now lives in that package's own overlay slot, beside the package's code artifact, which it never overwrites.
17+
18+
- **#33127 — two packages ship a name and each stores its own row.** At boot (`loadMetaFromDb`) the row hydrated last took the name's slot: that package's registry item and `?package=` read answered its row, the other package's answered its shipped item, which package by row order (tool, webhook, agent, skill measured). Each package now answers its own row in every registration and row order; the read naming no package still refuses `409` naming both.
19+
- **#32663 — the writer's registry item.** After alpha then beta saved a row of one name, both replicas' registry items answered `[null, beta's row]` at the two packages (the mirror in the other order) while the exact reads, row-served, answered each package's own row. The registry now agrees with the exact reads on the writer and on the peer (action, tool, email template). A `dashboard` is converged by name, unchanged.
20+
- **#32662 — a pair address of a name held only as stored rows.** `?package=ID.custom` answered `404` for both packages before a restart and, after it, `200` for the row hydrated last and `409` naming one package for the other (dashboard, tool, action). Each pair address now answers its base package's row, before and after.
21+
- **#32662 scope note (b).** A package's row beside its own pair's undeclared row: the read naming no package served the pair's row when it was saved first while `/published` served the package's own row. Both now serve the package's own row in either order.
22+
- **#32900.** A module's locale member stored in its App's pair (declaring the module) beside a package-less row of the same locale: the module's registry item at that locale followed the row order. It now answers the module's own pair row in both orders; the install and seal answers are unchanged.
23+
24+
Unchanged, pinned as CONTROLs: a name one package holds (its row in its slot, its exact read and its read naming no package); two packages with one stored row (the other keeps its shipped item); a package-less row (it keeps the bare slot); the read naming no package of a two-holder name (`409` naming both).
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
'@objectstack/lint': minor
3+
'@objectstack/spec': minor
4+
---
5+
6+
fix(lint): `os build` and the runtime `object_extension` publish door refuse a formula an object extension adds that reads its own value, itself or through another formula, as they refuse one the object declares
7+
8+
Clause-②: no (narrowing) — `os build`, `os validate`, `os lint` and the `object_extension` publish door (Studio, `PUT /api/v1/meta/object_extension/TARGET`, the MCP and AI authoring doors) now refuse one shape an extension could carry before: a `formula` field an extension adds that sits on a cycle of formulas (itself, two added formulas reading each other, or a cycle closing through a formula the target declares). No exported type or signature changes. Measured first-party: 0 `objectExtensions` entries add a `formula` field (`examples/app-showcase` one entry, a `select`, a `url` and a `number` field; `packages/plugins/plugin-auth` one, a `secret` field; HotCRM none), so nothing first-party is newly refused.
9+
Metadata-protocol: narrowed
10+
Skills-docs: none owed — this PR edits `content/docs/deployment/validating-metadata.mdx` (the object extension paragraph names the cycle check); `skills/objectstack-formula` and `skills/objectstack-data` teach formula fields and `defineObjectExtension({ extend, fields })` without saying an extension is exempt from the cycle check, so the build and the door now give the verdict the object's own formulas already get.
11+
12+
<!-- adr-0087: registered object-extension-formula-cycle-refused -->
13+
14+
**BREAKING** accept-set narrowing of `os build`, `os validate`, `os lint` and the runtime `object_extension` publish door.
15+
16+
**Before:** the formula-cycle check ran on the object walk and named the object's declared formulas only. A formula an extension adds that reads itself (`a__c = record.a__c`), or two that read each other, was accepted at the build and the door; the engine never evaluated them, and they read null on every row.
17+
18+
**Now:** the cycle is found on the target as served (its declared fields with every kept extension's fields folded in), and each member an extension adds is refused with the object's own verdict and sentence (at the door, a name the target already serves included: the written definition is the one served) (`expression-invalid`), located at the entry: `object 'TARGET' · objectExtensions[0] · field 'FIELD' expression` (`packages[j].manifest.` prefixed in a built artifact). It runs at the `object_extension` door (`422 INVALID_METADATA`) as in `os build`.
19+
20+
**Unchanged:** a cycle among the object's own formulas, at the same location; a member the target declares on a cycle an extension closes keeps its location at the object, named once; a draft save (never gated); a stored row (judged only when it is published again). At the extension door a cycle among the target's own formulas, or a sibling package's, is not charged to the extension write, and a formula that only reads a cycle is not refused. In `os build` on an object the stack declares, a field two packages' extensions add at the same priority is not judged, since which definition the registry serves is registration order, so a cycle through it is not found there; on an object the stack does not declare, the later entry's definition is judged. The publish door judges the written entry's own definition of every field it adds, whatever priority another package's extension adds the same field at, so it can refuse a tie, or an entry another package outranks, that `os build` lets through.
21+
22+
**Fix:** before building or publishing again, break the cycle: have one formula on it read stored fields, or formulas that do not read it back.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
'@objectstack/service-analytics': patch
3+
---
4+
5+
feat(service-analytics): the engine-aggregate path filters on a related record's field — a one-hop dotted `where` leaf (`'order.status'`) is served as the engine's nested-relation condition instead of refused (#33335)
6+
7+
Clause-②: yes (widening) — `ObjectQLStrategy` serves a query shape it refused with `400 INVALID_FIELD` ("cannot evaluate a cross-object filter … the engine cannot join in an aggregate"): a one-hop dotted member in the caller's `where` (a dataset query's `runtimeFilter`, a dashboard global filter, a widget filter). No authorable schema, export or wire shape changes, and every other answer is unchanged.
8+
Metadata-protocol: none
9+
10+
A dashboard over detail rows can now leave out the rows of a cancelled parent on every deployment, where before only a query the native-SQL strategy served could (a SQL datasource, with no bucketed date dimension, no federated object, and no engine-enforced read gate on any object it reads).
11+
12+
**What a served leaf means.** `{ 'order.status': { $ne: 'cancelled' } }` reaches the engine as `{ order: { status: { $ne: 'cancelled' } } }`, the nested-relation condition the engine already serves in `where`: it reads the related object as the caller (its row-level security and field permissions apply) and keeps the base rows whose relationship points at a record that read returned.
13+
14+
- A row with no related record, or one the caller cannot read, is not selected, whatever the operator (`$ne` and `$nin` included). To keep such rows, OR in the relationship itself: `{ $or: [{ 'order.status': { $ne: 'cancelled' } }, { order: { $null: true } }] }`.
15+
- No matching related record selects no row, never the unfiltered set.
16+
- A related field the caller cannot read is refused `403 PERMISSION_DENIED`; more than 1,000 matching related records are refused `400 INVALID_FILTER`, never truncated.
17+
- Leaves on one relationship in one conjunction are one condition (one related record satisfies all of them).
18+
- The `/analytics/sql` echo refuses such a query `400 INVALID_FILTER`, as it does the authored nested-relation form; `/analytics/query` returns its rows.
19+
20+
**Still refused (`400 INVALID_FIELD`, `param: 'where'`)**, each with its reason and the native-SQL route in the message: a path of two or more relationships, a related-field leaf under `$not` (write `$ne` / `$nin` inside the leaf), a related field compared with a `{ $field }` reference, and a relationship the cube joins onto a different object than the field declares. A cross-object measure, and a related field in a dataset's own `filter` or a measure's own `filter`, stay refused as before.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
'@objectstack/spec': patch
3+
---
4+
5+
docs(spec): `innerRefusal` (on `AutomationResult`, `FlowFailureDetailsSchema` and `FlowInnerRefusalSchema`) is now described as the refusal a node met inside the run, from a data node's read or write or a `script` node's function resolution, instead of only a node's write.
6+
7+
Clause-②: no
8+
Metadata-protocol: none
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
'@objectstack/driver-sql': patch
3+
---
4+
5+
fix(driver-sql): on an upgraded MySQL 8 database the widening arm reads the package-less guard's functional key part as the partial unique it is, so the old, narrower unique key retires as it does on PostgreSQL
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
`metadata-protocol` builds each package-less guard on MySQL 8.0.13+ as a UNIQUE index over one functional key part, `(CASE WHEN <package column> IS NULL THEN <the driver's hash-shadow digest of the key columns> END)`. `os migrate plan` and the dev `autoMigrate: 'safe'` sync read that key part as an unknown expression, never as the guard the widening arm waits for, so on a database upgraded from a release that had the narrower key they kept that key and offered nothing.
11+
12+
- FROM kept TO retired, on an upgraded MySQL 8 database, once the guard stands: `sys_user_permission_set`'s `(user_id, permission_set, organization_id)`, `sys_connector_connection`'s `(organization_id, connector_name)` and `sys_metadata_activation`'s `(metadata_type, name)` are each one `replace_unique_index`, categorized `safe`, created before it is dropped, applied by the next sync that runs safe drift or by `os migrate apply` with no `--allow-destructive`. Who sees it: a user can hold two packages' permission sets of one name in one organization, and an organization can connect two packages' connector instances of one name, where the old key refused the second. A second row naming no package is still refused, by the guard. Measured on MySQL 8.0.46 for all three tables.
13+
- The guard is recognised strictly: the whole expression must be that `CASE WHEN <column> IS NULL THEN … END` over exactly the driver's own digest (`UNHEX(SHA2(CONCAT(<key columns> joined by 0x1f), 256))`, plain columns) of the narrower key's columns in key order, scoped by the one nullable column the wider key gained. Any other functional index (another function, hash, separator or scope, a NULL-safe part, an `ELSE`) is not a guard, and the narrower key stays kept beside it.
14+
- Unchanged: MariaDB (its guard is a row-scoped generated column, already read as a guard), SQLite and PostgreSQL; a narrower key carried by a #11627 hash shadow is still kept whatever the guard; MySQL before 8.0.13 builds no guard and keeps the old key.

0 commit comments

Comments
 (0)