Skip to content

Commit 906f6f6

Browse files
committed
Merge remote-tracking branch 'origin/main' into claude/project-thread-ny8fif
# Conflicts: # packages/spec/dropped-refinements.baseline.json
2 parents bf19962 + ed45eb9 commit 906f6f6

169 files changed

Lines changed: 10582 additions & 618 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+
'@objectstack/objectql': patch
3+
---
4+
5+
perf(objectql): a cascade delete reads its first relation's dependents once, not twice
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
A delete that cascades first collects every row it will remove, then walks the relations and deletes them. The walk asked the collection's dependents probe again, with nothing written in between: the same relation, the same parent ids, the same system-identity read. It now takes the collection's answer for each probe it repeats, until its own first write. A cascaded child's delete or a `set_null` clear runs hooks, and a hook may write a row the next probe must see, so every probe after that first write reads as before.
11+
12+
Deleting a record with one cascading relation runs one SQL statement fewer: measured locally on the SQL-performance bench, one opportunity with 10 line items went from 58 to 57 statements on SQLite and on PostgreSQL 16. What a delete hook, the caller and a restore see is unchanged; an `afterFind` hook on the child object is called for one system-identity read fewer. The recycle-bin snapshot keeps its own read, because it stores the rows as the database holds them, and the probe's rows come through the engine's read.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
'@object-ui/data-objectstack': patch
3+
'@object-ui/types': patch
4+
'@object-ui/components': patch
5+
'@object-ui/plugin-timeline': patch
6+
---
7+
8+
feat(console): surfaces that never draw a record count decline the list total
9+
10+
Clause-②: no
11+
Metadata-protocol: none
12+
13+
The list door (`GET /data/:object`) runs a `count(*)` over the full predicate beside every paged read, unless the request sends `count=false`. On PostgreSQL that count is now the largest part of a paged list's database time. The ObjectStack adapter never forwarded `$count`, so no Console surface could decline the total.
14+
15+
- `ObjectStackAdapter.find()` now honours `$count: false`. Such a read takes the adapter's raw GET, which sends `count=false`, and the result carries no `total`. The page length is not used in its place. An absent `$count`, or `$count: true`, still gets the total, as before.
16+
- The timeline rail (`object-timeline` and the timeline view), the `element:record_picker` block and the `element:repeater` block draw rows and never a record count, so they now send `$count: false`. Surfaces that print a total keep it: the grid and list footers, related lists, the lookup picker's "showing N of M", kanban lane counts, and the calendar, map, tree and gantt row-ceiling note.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
'@objectstack/metadata-protocol': patch
3+
'@objectstack/metadata': patch
4+
'@objectstack/objectql': patch
5+
---
6+
7+
perf(metadata-protocol): the served item read caches its caller-independent compiled answer (ADR-0156)
8+
9+
Clause-②: yes
10+
Metadata-protocol: none
11+
12+
`getMetaItem` (the served face of `GET /api/v1/meta/:type/:name`, and the per-item read an app bundle makes for every app, object, view, page and dashboard it names) no longer recompiles an item whose sources have not changed. Every caller gets the same answer it got before, the response body and ETag included: only the server's work per request moves.
13+
14+
- **What is cached.** The compiled envelope of a by-name read of `app`, `object`, `view`, `page` and `dashboard` items, per engine. A read for a package, a state, a member or a draft preview is never cached. The per-caller gate, field mask, translation and ETag stay computed on every request, and the live trailers (`registration`, `disabledActions`, `cascadeDeleteObjects`) are read on every hit.
15+
- **What retires it.** Each source counts its own changes at its own mutation point: the `sys_metadata` overlay generation, the schema registry's `objectRevision` and a new `revision` that every public write of `SchemaRegistry` moves (the classification of its public methods is exhaustive by type), and a new `revision` on `MetadataManager`. Any move drops every entry. A source without its counter makes the cache decline.
16+
- **What another process can change.** After a bound (`OS_METADATA_COMPILE_CACHE_TTL_MS`, default 30000 ms) the cache confirms before it recompiles, once per bound per engine however many readers cross it: a digest of every stored row's identity, binding, state, `version`, `checksum` and `updated_at` (so an `updated_at` stamped from a clock that is behind still moves it; the bodies are not read) and each loader's reading of its backing store (`FilesystemLoader` stats the type directories and files its reads touched). If nothing moved, the entries stand for another bound, never past 10 bounds from when each was compiled; that cap is the only bound on a writer that bypasses the engine and rewrites a body while leaving all three bookkeeping columns as they were (#34522 tracks a column that would close it). Every confirmation also retires the overlay row cache, so a recompile reads rows at least as new as the reading, and a read in flight across a confirmation is not stored. A local counter move takes no store reading. A loader that keeps no change mark makes every entry recompile at its bound, never renewed.
17+
- **New public members (additive).** `SchemaRegistry#revision`, `MetadataManager#revision`, `MetadataManager#loaderChangeMark()`, the optional `MetadataLoader#changeMark()` and `FilesystemLoader#changeMark()`.
18+
- `OS_METADATA_COMPILE_CACHE_TTL_MS=0` is the uncached read, the same reads in the same order.
19+
20+
On a showcase Setup bundle, an immediate repeat made 213 database reads before and 9 after.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
'@objectstack/plugin-audit': patch
3+
---
4+
5+
fix(plugin-audit): a host checkpoint signer, sink or cluster service that is registered but fails to resolve stops the sealer instead of falling back
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
The audit sealer (ADR-0154) resolves three host seams on each pass: `audit.checkpointSigner`, `audit.checkpointSink` and `cluster`. It turned every resolution error into "not registered". A host signer whose factory threw (a KMS client that cannot start, a missing credential) was therefore replaced by the local signing key, a failing sink dropped the off-host export, and a failing cluster service let the pass run on the in-process lock. Nothing was logged. A seam registered as a factory was never built at all, because the sealer used the synchronous accessor, so a factory-registered host signer was silently ignored.
11+
12+
Now only an absent seam falls back: no host signer signs with the local key, no sink exports nothing, no cluster service takes the in-process lock, all as before. A seam that is registered and resolves is used, including one registered as a factory. A seam that is registered and fails to resolve stops the pass: no checkpoint is signed, and the sealer reports it at `error`, naming the slot, once while it lasts. Each pass retries.
13+
14+
A host whose signer, sink or cluster registration was failing used to seal silently with the local key or without its lock; it now seals nothing until the registration is fixed. A working host sees no change.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
'@objectstack/cli': patch
3+
---
4+
5+
fix(cli): `objectstack start` leaves nothing of its process group behind when it exits on SIGTERM
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
On a project with an `objectstack.config.ts`, a SIGTERM sent to the `objectstack start` process made it forward the signal to its `serve` child and exit with the child's code, as before, but one process of its group was still alive at that moment: the esbuild service `serve` started to bundle the config. esbuild keeps that service process for the life of its caller and it leaves only after the caller has exited, so a supervisor that read the group right after `start` exited (a container runtime, systemd, a drill reading `kill(-pid, 0)`) found a leftover process.
11+
12+
`serve` now stops the esbuild service as soon as the config module has loaded, at boot. The service exits while `serve` is still alive to reap it, so when `start` exits on SIGTERM no process of its group is left. Boots from `--artifact` or `--prebuilt` never started the service and are unchanged.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
'@objectstack/spec': minor
3+
'@objectstack/objectql': patch
4+
'@objectstack/driver-sql': patch
5+
---
6+
7+
fix(spec, objectql, driver-sql): a predicate delete with a cascade locks the rows it walks, so a concurrent commit cannot move one out of the predicate before the delete (#34373)
8+
9+
Clause-②: yes (widening: DriverOptions.lockRows and DriverCapabilities.lockRows)
10+
Metadata-protocol: added
11+
12+
**The defect.** A predicate delete (`delete(object, { where, multi: true })`, a flow's `delete_record` with `multi: true`) on an object that delete-family lookups reference reads the matched ids, walks the cascade, then deletes those rows by id. The caller's predicate is not on the final DELETE, so a guard such as `{ id, source: 'idp_pending' }` ("delete only if still pending") held only at the read: a concurrent commit that moved the row out of the predicate between the read and the delete was deleted anyway, and counted.
13+
14+
**The fix.** Inside the delete's unit of work, the matched-row read now takes a lock on a driver that can lock, so no other writer can change a matched row behind the unit: it waits until the unit ends, or one side fails. The rows deleted are still exactly the rows walked; nothing changes for a delete that meets no concurrent writer.
15+
16+
- `DriverOptions` (`@objectstack/spec/data`) gains `lockRows`: on a read inside a `transaction`, lock the returned rows against concurrent writers until the transaction ends (SQL `SELECT … FOR UPDATE`).
17+
- `DriverCapabilities` gains `lockRows`: the driver's `find()` honours that option. Absence means `false`, and the engine sends no lock request to such a driver.
18+
- `driver-sql` declares the bit. PostgreSQL and MySQL take row locks (`FOR UPDATE`), SQL Server an update lock (`UPDLOCK`). SQLite compiles nothing: its single-connection pool and database lock already keep another writer from changing a returned row behind the transaction. A second writer through the same driver waits; one on another connection either fails `SQLITE_BUSY` (rollback journal) or commits and makes the transaction's own delete fail `SQLITE_BUSY_SNAPSHOT` (WAL), so the moved row is never deleted. A `find()` with `lockRows` and no transaction is refused `PRECONDITION_REQUIRED` / 428.
19+
- The engine's read and delete verbs do not take `lockRows` from a caller (an option they do not execute, as before). Any other option bag that carries it to the engine's driver hop is refused there, before any driver runs: an object whose driver does not declare the bit answers `NOT_IMPLEMENTED` / 501, and a request with no transaction reaching that driver `PRECONDITION_REQUIRED` / 428.
20+
21+
**What keeps the window.** A driver without the bit (memory, MongoDB, OData), and a cascade that cannot run in one transaction (the `split` plan, a driver with no transactions), read unlocked as before.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
'@objectstack/lint': minor
3+
'@objectstack/spec': minor
4+
---
5+
6+
feat(lint)!: a `lookupFilters` `{ $record: "path" }` path through or to a multi-valued field is refused
7+
8+
Clause-②: no (narrowing) — a `lookupFilters[].value` `{ $record }` path on a lookup, master_detail or user field whose first segment is a multi-valued field of the object owning that field (a plain path to it, or a hop through it), or whose leaf behind a single-valued hop is a multi-valued field, linted clean and published; it is now refused at error as `object-field-ref-unknown` by `os lint`, `os validate`, `os build` and the runtime publish door, and reported (never refused) on the package publish receipt's object probe.
9+
Metadata-protocol: narrowed
10+
Skills-docs: follow-up #34201 — no doc or skill teaches `{ $record }` yet, so there is no teaching to correct here; the multi-valued clause rides the describes this change edits.
11+
12+
<!-- adr-0087: registered lookup-filter-record-path-multi-valued-refused -->
13+
14+
**BREAKING** only for a `{ $record }` path that reads a list. A `{ $record }` comparand stands for ONE value of the record being edited and pairs only with `eq`, `ne`, `gt`, `lt`, `gte` or `lte`, but the path check judged only that each segment names a field, so `{ $record: "accounts.cb_market" }` through a `multiple: true` lookup, or `{ $record: "tags" }`, linted clean. A hop through a multi-valued lookup reaches no single row, so the entry was left out without a word; a plain path to a multi-valued field put a list where one value goes. `object-field-ref-unknown` now refuses the path at the multi-valued field and names it. Multi-valued means `isMultiValueField`: a field flagged `multiple: true`, or a `multiselect`, `checkboxes` or `tags` field. A registry-injected column and a leaf on an object outside the stack are not judged. Measured first-party exposure: zero — no example app, platform object, skill or docs sample writes a `$record` path.
15+
16+
**FROM → TO.** FROM `{ $record: "accounts.cb_market" }` (a hop through a `multiple: true` lookup), `{ $record: "tags" }` or `{ $record: "account.markets" }` (a multi-valued leaf) TO a path that ends at, and hops through, single-valued fields only.
17+
18+
**Fix:** copy the value you mean onto a single-valued field of the record being edited (or of the record one single-valued hop away) and reference that. The semantic entry `lookup-filter-record-path-multi-valued-refused` carries the same notice into the upgrade guide and `os migrate meta`. `os explain object-field-ref-unknown` lists the position.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
'@objectstack/runtime': patch
3+
---
4+
5+
feat(runtime): `dispatchActionResume` resumes a handed-off `resume_run` as the person who approved it
6+
7+
Clause-②: yes (widening)
8+
Metadata-protocol: none
9+
10+
The confirmation contract says that approving a handed-off `resume_run` resumes that parked run, with the values the call carried, as the approver. Until now the framework exported no way to do that: `dispatchAction` only starts an action, and the MCP `resume_run` door hands a gated action off again. A host that implements the pending-confirmation service (`ai.actionConfirmation`) could hold a handed-off `resume_run` but had to keep refusing it.
11+
12+
`dispatchActionResume(kernel, { executionContext, runId, values, confirm })` is the approval leg. It asks every `resume_run` gate again as the approving person: the run must still be paused and started by that person, the flow action that admits it must pass every `run_action` gate, the subject record is read again as the person, and the run must be paused on a screen. Then it resumes that run. Only a run that is no longer paused is refused: a wizard the approval moved on to its next screen is still paused under the same run id, so the host's approve door decides each pending item once and voids an item whose run has moved on. The confirmation gate reads `confirm` as `dispatchAction`'s does, so a declared-gated action resumes on the person's `confirm: true` and nothing is handed off again. An AI service account is refused whatever it carries. The answer is the REST envelope, as `dispatchAction`'s is.
13+
14+
Nothing changes for an existing caller.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
'@objectstack/spec': patch
3+
---
4+
5+
docs(spec): the `tool-requires-confirmation-retired` upgrade entry no longer tells you to send `confirm: true` to `run_action`
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
The migration entry for the retired `tool.requiresConfirmation` key still told an upgrading author to put the operation behind an action with `ai.requiresConfirmation: true` and then call it over the MCP `run_action` tool with `confirm: true` on the request. Those tools now refuse any call that carries `confirm`, so that advice sent you into a refusal. The entry's `replacement` and `acceptanceCriteria` now describe what the gate does today: the person the caller acts for confirms the call, in an MCP client that supports elicitation or in the app (`status: 'pending_confirmation'`), and a server with no pending-confirmation service refuses it with `ACTION_CONFIRMATION_REQUIRED` (428, `details.reason: 'no_confirmation_service'`). Send `run_action` and `resume_run` calls without `confirm`.
11+
12+
Text only: no schema, key or runtime behaviour changes. `os migrate meta` and the upgrade guide show the corrected wording.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
'@objectstack/spec': minor
3+
'@object-ui/core': patch
4+
---
5+
6+
feat(spec): an action's answer fields gain a `table` format, so a per-row answer is drawn as rows, not raw JSON
7+
8+
Clause-②: yes (widening) — `format: 'table'` joins the field formats of `resultDialog.fields` and `preflight.fields`, and the field row gains `columns`; the only new refusals fall on the new value and the new key, and every action that parsed before still parses unchanged
9+
Metadata-protocol: added
10+
11+
An action whose server answers a list of rows (adding several people, importing a CSV) can now say how to show it. A field in `resultDialog.fields` (or `preflight.fields`, which shares the row) takes `format: 'table'` with `columns`, one entry per cell: `{ path, label?, format? }`, where `path` is read in one element of the array.
12+
13+
**FROM → TO.** FROM: the answer's list could only be shown as a JSON block (`format: 'json'`). TO: `{ path: 'rows', format: 'table', columns: [{ path: 'email', label: 'Email' }, { path: 'reason', label: 'Reason' }] }` draws one row per element, one cell per column, in `columns` order, with the column `label` (or its `path`) as the header.
14+
15+
Refused at parse, each with a message that names the fix:
16+
17+
- `format: 'table'` without `columns`, or with an empty list. The columns are never guessed from the elements' keys.
18+
- `columns` beside any other `format`, or on a field with no `format` (the dialog-level default is never `table`).
19+
- `table` as a cell `format` (a table does not nest) and as the dialog-level `resultDialog.format` (a default carries no `columns`).
20+
21+
The renderer contract is stated on `resultDialog`. The console's table renderer is still to come: until it lands, a `table` field draws its label alone, and `columns` is marked `[PLANNED — not yet rendered]`.
22+
23+
`@object-ui/core`: the `ResultDialogSpec` / `ResultDialogFieldSpec` `format` members now derive from the contract, as their label members already do, so the console's action renderers keep type-checking against the widened set.

0 commit comments

Comments
 (0)