Skip to content

Commit 0eb113f

Browse files
committed
Merge origin/main into claude/issue-34389-lookup-multi-valued-path
Claude-Session: https://claude.ai/code/session_01ADHkmSYVw1sqCsaHSJS9JC Co-authored-by: Claude <noreply@anthropic.com>
2 parents 3497dfc + ed45eb9 commit 0eb113f

68 files changed

Lines changed: 2110 additions & 110 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: 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: 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.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
'@object-ui/app-shell': patch
3+
'@object-ui/console': patch
4+
---
5+
6+
fix(console-ai): the attachment notes added to a user's turn follow the conversation's language
7+
8+
Clause-②: no
9+
Metadata-protocol: none
10+
11+
In the console's AI chat, the lines the page adds to a user's turn about its attachments were always Chinese: the spreadsheet brief (headers and sample rows), the line naming the images and PDFs sent as files, and each "not read" line (over the 10 MB cap, type not supported, upload failed). A user chatting in English saw Chinese in their own message, and the agent received it too.
12+
13+
They now follow the conversation's language, the same rule every other piece of text the console sends the agent follows: a turn written in Chinese gets Chinese notes, any other gets English ones, and a turn with files but no words takes the language the conversation is held in. A turn with no attachment is sent exactly as typed, as before. No locale-pack key is added.
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): an `os migrate audit-*` run stops when the host's checkpoint signer or sink is registered but fails to resolve, instead of amending under the local key
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
The four `os migrate audit-*` ledger-copy rewrites amend a sealed row before they rewrite it (ADR-0154 D7), signing the amendment with the host's `audit.checkpointSigner` when one is registered and the local key otherwise. The CLI read that slot, and `audit.checkpointSink`, through a helper that 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 key, and a failing sink dropped the export, with nothing said. A signer registered as a factory was never built at all.
11+
12+
The run now follows the rule the sealer follows since #34280. No host signer registered still amends under the local key, and no sink exports nothing, as before. A registered signer or sink that resolves is used, including one registered as a factory. One that is registered and fails to resolve stops the run before any row is amended or rewritten: it prints `Audit redaction seal: the '<slot>' service is registered but could not be resolved (<cause>)` and exits 1. A working host sees no change.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
'@objectstack/formula': patch
3+
---
4+
5+
fix(formula): decimal text is judged against the number range before it is scaled
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
`toScaledDecimal` now judges decimal text against the number range before it scales it, the way the same value is judged as a number:
11+
12+
- Text whose number is not finite (`'1e400'`, `'1.8e308'`) spells no decimal and reads `undefined`, as a non-finite number already did.
13+
- Text whose number is zero because it is below the smallest number (`'1e-400'`) reads as zero, as that number already did.
14+
- A zero is never scaled by its exponent; one written with an exponent below the smallest number's (`'0e-325'`) reads as plain zero.
15+
16+
Inside the range every digit is still kept exactly, numbers and bigints are read as before, and `divideToPlaces` and `formatScaledDecimal` are unchanged. The home-amount projection treats an amount that spells no decimal as before: it leaves the value to the record validator, which refuses a non-finite number as `invalid_number`.

‎content/docs/deployment/cli.mdx‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2210,6 +2210,13 @@ when:
22102210
`modified`;
22112211
- the rewrite would change a column the object seals in clear.
22122212
2213+
The amendments are signed by the host's checkpoint signer (`audit.checkpointSigner`) when the
2214+
host registers one, and by the deployment's local key when it registers none; a host checkpoint
2215+
sink (`audit.checkpointSink`) is handed each amendment. A signer or sink that is registered but
2216+
cannot be resolved stops the run before any row is amended or rewritten: it prints
2217+
`Audit redaction seal: the '<slot>' service is registered but could not be resolved (<cause>)`
2218+
and exits `1`. It never falls back to the local key in place of the host's signer.
2219+
22132220
The dry run decides each row the same way and writes nothing. Re-run where the
22142221
crypto provider `os serve` seals with is available.
22152222

‎content/docs/frontend/data-objectstack.mdx‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -430,6 +430,13 @@ const [users, orders] = await Promise.all([
430430
console.log(users.data.length, users.total);
431431
```
432432

433+
A paged read (`$top` or `$skip`) reports `total` by default, and the server
434+
runs a `count(*)` over the whole filter to answer it. A surface that never
435+
shows a record count passes `$count: false`: the adapter sends `count=false`,
436+
the server skips the count, and the result carries no `total` (the page length
437+
is not put in its place). `hasMore` is still answered from the page. An absent
438+
`$count`, or `$count: true`, gets the total as before.
439+
433440
### Mutations
434441

435442
```typescript

‎content/docs/references/data/driver-nosql.mdx‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@ const result = AggregationPipelineSchema.parse(data);
166166
| **batchSchemaSync** | `boolean` | optional | Supports batched schema sync to reduce schema DDL round-trips (absence = false) |
167167
| **transactionsUnsupported** | `boolean` | optional | Transport cannot honour transactions even though `beginTransaction` is inherited (absence = false) |
168168
| **aggregationFilter** | `boolean` | optional | `aggregate()` evaluates a per-measure `aggregations[].filter` itself, with the engine's in-memory answer, except that text compares by the backend collation as in `where` (absence = false: the engine aggregates filtered measures in memory) |
169+
| **lockRows** | `boolean` | optional | `find()` honours `DriverOptions.lockRows` inside a transaction: no other writer changes a returned row behind the transaction (it waits, or one side fails) (absence = false: the engine sends no lock request) |
169170
| **create** | `never` | optional | [REMOVED] `DriverCapabilities.create` was removed in @objectstack/spec 17.0.0 (ADR-0049 enforce-or-remove) — no code in any repository ever read it, so its value never changed which code path ran. CRUD is not optional for a driver: `create`/`find`/`findOne`/`update`/`delete` are REQUIRED `IDataDriver` methods and the engine calls them unconditionally. Delete the key. |
170171
| **read** | `never` | optional | [REMOVED] `DriverCapabilities.read` was removed in @objectstack/spec 17.0.0 (ADR-0049 enforce-or-remove) — no code in any repository ever read it, so its value never changed which code path ran. CRUD is not optional for a driver: reads go through the REQUIRED `find`/`findOne`/`count` methods, called unconditionally. Delete the key. |
171172
| **update** | `never` | optional | [REMOVED] `DriverCapabilities.update` was removed in @objectstack/spec 17.0.0 (ADR-0049 enforce-or-remove) — no code in any repository ever read it, so its value never changed which code path ran. CRUD is not optional for a driver: `update`/`upsert` are REQUIRED `IDataDriver` methods, called unconditionally. Delete the key. |

0 commit comments

Comments
 (0)