Skip to content

Commit d7c257e

Browse files
feat(objectql, core, spec): the engine seam for the fixed-read leaf and its driver declaration (ADR-0155, step 2 of 6) (#35839)
<!-- claude-projects-attribution: {"github_login":"os-tesla"} --> _Requested by **Tesla** · [project thread](https://claude.ai/code/project/chan_01AXsQkLFKRdQCqQ3RTr6Jao?thread=cmsg_01AXsQkLFKRdQCqQ3RTr6JaoW11cvRcbZ7pZthNEZt4aqc)_ Fixes #35786 Clause-②: yes Metadata-protocol: added Skills-docs: none — DriverCapabilities keys are declared by driver code, not taught under skills/** (zero readableIdsLeaf hits in skills/ at origin/main); the generated references (content/docs/references/data/driver*.mdx) carry the describe text ## 维护者速读 - 用户无感:这一步只在引擎内部装上"共享授权"读取凭据的放行与拒收关口,目前没有任何功能写出这种凭据,线上行为前后一致。 - 属于"共享授权读取不再截断、每条授权都算数"系列的第二步(共六步),为后续让数据库直接按共享表过滤、不再拼一长串编号铺路。 - 关口判错时,带这种凭据的查询会被拒收并报内部错误,不会多放出任何数据;眼下没有写入方,直接撤回本次合并即可复原。 - 无。 ## What changes ADR-0155 step 2 of 6: the engine seam for a fixed-read leaf (`SharedRecordIds`) and the driver declaration that gates it. Nothing on main writes the leaf yet (step 6) and no driver declares it (steps 3 and 4), so no observable behaviour on main changes. - **Driver declaration** (`@objectstack/spec`, `data/driver.zod.ts`). `DriverCapabilities.fixedReadLeaves`: a list of leaf names (`z.enum(FIXED_READ_LEAF_NAMES)`), today `['SharedRecordIds']`; absence = none. It stays separate from `readableIdsLeaf`. A `ReadableIds` leaf is not a fixed-read leaf, and a fixed-read leaf inside a composed `ReadableIds` scope needs both bits, because a driver without `readableIdsLeaf` refuses the composed leaf (ADR-0139 D3). Both describes now point at each other. The name vocabulary (`FIXED_READ_LEAF_NAMES`, `FixedReadLeafName`, `fixedReadLeafNameOf`) lives in `data/fixed-read-leaf.ts`, beside the brands. - **Door** (`@objectstack/objectql`, `filter-comparand-shape.ts` and the array branch in `engine-top-level.ts`). A branded leaf is admitted as a `$in` comparand. The position walk runs before the list-shape door, so a misplaced branded leaf (`$nin`, `$eq`, a list member, a filter node, a nested-relation condition) answers the D4 refusal rather than a non-list 400. An unbranded JSON copy is still `INVALID_FILTER` / 400 at the door. - **Seam** (`fixed-read-leaf-position.ts` for the walk, `fixed-read-leaf-seam.ts` for the pass-through). It runs at the executor boundary after the security scope is composed, and on the predicate `update` / `delete` paths. The leaf is handed to the driver by reference only when all of these hold: - **position:** on `id` of the object the leaf names, directly or inside a composed scope over that object; - **verb and form:** a read verb with the read form, or a predicate `update`'s `where` with the write form (③ A). Otherwise it is refused; - **recipient:** the context's user or its delegator; a system context is exempt; - **class:** outside both D4 classes, i.e. the object is on the same datasource as `sys_record_share`, and no middleware and no `beforeFind` / `afterFind` hook is registered for `sys_record_share` by name; - **driver:** the target driver's `fixedReadLeaves` names the leaf. Anything else is refused before any driver is asked. - **Refusal** (`@objectstack/core`, `utils/fixed-read-leaf-refusal.ts`). `fixedReadLeafRefusal` / `refuseFixedReadLeafOnce` / `describeFixedReadLeaf` build the one envelope: `INTERNAL_ERROR` / 500, naming the evaluator, the leaf (its name and its inner-read table, never the recipient) and the remedy, logged at `error` once per evaluator. `logRefusalOnce` is factored out of `refuseReadableIdsOnce`, whose behaviour is unchanged. - **Filter tokens** (`@objectstack/core`, `utils/filter-tokens.ts`). `resolveFilterTokens` returns a fixed-read leaf by reference, as it already does a `ReadableIds` leaf. - **Conformance** (`@objectstack/spec`, `data/fixed-read-leaf-conformance.ts`). - The open-question sentence is dropped. - 11 seam cases are added (32 in all): the write form on each read verb and inside a composed scope, and the leaf outside `$in` in five positions. - objectql now runs every seam case against the real seam. ### Compile surfaces (one conclusion each) | Surface | Conclusion | |---|---| | `driver-sql` filter compiler | Out of scope (step 3). On this step the seam refuses before the driver is called, since no driver declares `fixedReadLeaves`. | | Turso remote | Out of scope (step 3), for the same reason. | | analytics `compileScopedFilterToSql` | Out of scope (step 5). The analytics merges do not admit the brand, so a leaf there is still a non-list 400. | | `lowerAnalyticsWhere` | Out of scope (step 5). | | formula `matchesFilterCondition` | Already compliant on this step. The seam refuses a leaf in `having` and in `aggregations[].filter` at both the door and the boundary, so the in-memory matcher never sees one. Its other callers are step 5's. | | `driver-memory` | Out of scope (step 4). | | `driver-mongodb` | Out of scope (step 5). | ### Zone 2 measurements (A to G) - **A.** No driver declares the leaf: zero `fixedReadLeaves` hits under `packages/drivers`, `packages/plugins` and `packages/services`. Control: `readableIdsLeaf: true` hits `packages/drivers/driver-memory/src/memory-driver.ts:605` and `packages/drivers/driver-sql/src/sql-driver.ts:415`. D-0 holds. The pass-through is proven against a recording driver in `engine-fixed-read-leaf-seam.test.ts`. - **B.** Step 1 shipped brands (`FixedReadLeafBrand`, `fixedReadLeafBrandOf`) but no names. The names were added in `packages/spec/src/data/fixed-read-leaf.ts`, so the declaration is a list of names, not symbols. - **C.** Door call sites: - `engine-top-level.ts:1061` (array branch); - the `filter-comparand-shape.ts:137` wrapper (object branch, `having`, aggregation filters). - The write-path collectors sit beside it at `engine-update.ts:530` and `engine-delete-and-aggregate.ts:245`. - **D.** `composeReadableIdsChain` (`engine-readable-ids-permission-formula.ts:183`) composes the security scope by reference. `composeReadableIdsLeaves` (`filter-comparand-shape.ts:263`) returns an unchanged subtree by reference, so a nested leaf survives composition. The seam descends every composed scope (`fixed-read-leaf-position.ts`, the `$in` composed branch). - **E.** - ① `resolveDatasourceBinding` (`engine.ts:3436`), already on the security host. - ② `hasObjectMiddleware` (`engine.ts:1914`). - There was no by-name find-hook reader, because `hasHooksFor` counts global hooks. `hookNamesObject` is added at `engine-top-level.ts:3755`, and `hooks` is exposed on the security host (`engine.ts:6148`, +1 line). - **F.** The recipient is compared against `userId` and `onBehalfOf.userId` (`packages/spec/src/kernel/execution-context.zod.ts:298`); `isSystem` is exempt. The seam only reads them and never writes. - **G.** The seam reads `IDataEngine.getDriverForObject` (`packages/spec/src/contracts/data-engine.ts:535`) plus `driverEvaluatesFixedReadLeaf` (`fixed-read-leaf-seam.ts`). No new public engine method is added. ## Tests Code readings are at `7473e42d46`, except the patch round 2 block, which is at head `9e745a0607`. All readings are local, under the shared verify lock (`VERDICT command-exit` lines quoted). `test:repo` is not run locally; CI's `Test Core` owns it. <details><summary>Patch round 2: a door refusal is logged on the boundary's flag (head 9e745a0)</summary> - Every verb's door calls now run through `atFixedReadLeafDoor` (`fixed-read-leaf-seam.ts`): the `where` lowering of find, findOne, count, aggregate, update and delete, plus the aggregate's `having` and per-aggregation `filter` doors. The helper logs the seam's refusal at `error` on the same per-engine flag `passFixedReadLeaves` uses, then re-throws it unchanged. - `pnpm --filter @objectstack/objectql typecheck`: exit 0. The seam test: `Tests 64 passed (64)`, `VERDICT command-exit 0`. - New pins in `describe('[ADR-0155 D4] a refusal at the door is logged on the boundary\'s flag, once per engine')`: - two misplaced-leaf refusals log one line; - a door refusal and a boundary refusal share one log, in either order; - one per door site, nine in all; - an unbranded copy stays `INVALID_FILTER` / 400, is not logged and does not spend the flag. - Ablations, committed first and restored to the HEAD blob `24ffa64865d4` with `git diff HEAD` empty: - M1, the door logs nothing: `Tests 11 failed | 53 passed (64)`, the per-site and two-refusal pins; - M2, the door logs on its own flag: `Tests 1 failed | 63 passed (64)`, the share-one-log pin. - Derived gates for the round's paths: 59 families, all run on `9e745a0607` and every one exited 0. `--ran` reports `59 run, 0 NOT-MEASURED`. `check:facade-delegation-only` reports `engine.ts: 6854 lines, ceiling 6854 (0 left)`. </details> <details><summary>objectql: full local suite, typecheck, seam test</summary> - `pnpm --filter @objectstack/objectql exec vitest run --project local --maxWorkers=2` at `1726a5644b`: `Test Files 620 passed (620)`, `Tests 14038 passed (14038)`, `VERDICT command-exit 0`. - `pnpm --filter @objectstack/objectql typecheck` plus the seam test, at `b40270ee52` (after the test's options were typed): `Tests 52 passed (52)`, `VERDICT command-exit 0`. - After that, the only commit is `7473e42d46`, a docs-only census row. </details> <details><summary>spec and core: typecheck and full local suites</summary> - `pnpm --filter @objectstack/spec typecheck`: exit 0. - `pnpm --filter @objectstack/spec exec vitest run --project local --maxWorkers=2`: `Test Files 865 passed (865)`, `Tests 27732 passed | 1 todo (27733)`. - `pnpm --filter @objectstack/core exec vitest run --project local --maxWorkers=2`: `Test Files 155 passed (155)`, `Tests 3676 passed (3676)`. - One locked run, `VERDICT command-exit 0`. Core typecheck: exit 0. Spec build: `VERDICT command-exit 0`. The closure build `--filter '@objectstack/objectql^...'`: `VERDICT command-exit 0`. </details> <details><summary>Ablation: the recipient rule (one behaviour, one run)</summary> - Mutation: `principalAdmitted` in `fixed-read-leaf-position.ts` short-circuited to `true`, through `scripts/ablation-replace.mjs`. On disk: `anchor 1 -> 0`, blob `8caf15107ba9 -> 4a7c5bd39384`. The objectql test imports this source relatively, so no dist rebuild was involved. - Predicted direction: red on the recipient refusals. Observed: `Tests 5 failed | 47 passed (52)`. The five are: - any other recipient is refused; - the recipient rule holds on the write form; - the recipient rule holds inside a composed scope; - a delegated operation carrying a third identity's leaf is refused; - a context with no user and no system flag is refused. - Restore: `git checkout HEAD -- PATH`. The blob is back to `8caf15107ba9…` (the HEAD blob), `git diff HEAD` is 0 bytes, and the tree is clean. </details> <details><summary>Reverse type verification (cross-package)</summary> - Run against the rebuilt `packages/spec/dist/data` declarations: `const ok: DriverCapabilities = { fixedReadLeaves: ['SharedRecordIds'] }` compiles (exit 0). - `{ fixedReadLeaves: ['ReadableIds'] }` is red: `error TS2322: Type '"ReadableIds"' is not assignable to type '"SharedRecordIds"'` (exit 2). </details> <details><summary>Derived gate families (local, final head 7473e42)</summary> - `node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack` derives 131 families. - All 131 were run on `7473e42d46`, and every one exited 0. - `--ran` answers: `131 derived famil(ies) accounted for — 131 run, 0 NOT-MEASURED (a DERIVED zero — all 131 recorded an exit code and none of them is 3)`. - The first pass (at `1726a5644b`) went red on two ratchets, both fixed in this PR: - `check:query-options-erasure`: the test surface grew 236 to 243. The seven option bags in the new test are now typed, and the surface is back to 236. - `check:system-context-census`: `passFixedReadLeaves` reads `isSystem` with no row for it. Row 18f was added and the register regenerated. </details> ## Acceptance notes - **Metadata-protocol: `added`, `@objectstack/spec` at `minor`** (patch round 1). The claim spelled `none`, but the diff moves `packages/spec/authorable-surface/data.json` (`data/DriverCapabilities:fixedReadLeaves` enters). Under AGENTS.md's Post-Task step 3, a new key is `added`, as the `readableIdsLeaf` precedent (#34565) declared. `@objectstack/core` and `@objectstack/objectql` stay `patch`, following the gate's remedy: raise the package that carries the protocol change. Under `none`, `check-changeset-no-major` measured exit 1 (`none-baseline-moved`). - **Deviations from the dispatch's suggested route**: 1. Leaf names (`FIXED_READ_LEAF_NAMES`, `FixedReadLeafName`, `fixedReadLeafNameOf`) are added to spec. Step 1 shipped brands only, and the declaration is a list of names. 2. There are two seam modules, not one. The door walk lives in `fixed-read-leaf-position.ts` because `engine-top-level.ts` imports the door, and a single module would close an import cycle. 3. `engine-update.ts` and `engine-delete-and-aggregate.ts` import `securityResolversHost`, the first importers besides `engine.ts`. `engine.ts` is at 6854 of its 6854-line ceiling (`scripts/facade-delegation-registry.json`, 0 left): +1 for the security host's `hooks`, and +1 in patch round 2 for `count`'s host, which gains `facade` and `logger`. 4. A misplaced leaf refused at the door is logged at `error` on the same once-per-engine flag as a boundary refusal (patch round 2, `atFixedReadLeafDoor`). `judgeFilter` is not logged: it returns the refusal as a judgement and runs nothing. 5. An array-form `in` / `nin` carrying a leaf stays a 400 from the authoring lowering (`parseFilterAST`); only `=` lowers it by reference, and that is refused by name (500). 6. `logRefusalOnce` is factored out of `refuseReadableIdsOnce`; that function's behaviour is unchanged. - **Holds respected**: no boot refusal; no producer writes the leaf; ADR-0147 anchor cases are not pinned; no driver declares `fixedReadLeaves`. - **Changeset**: `@objectstack/spec` at `minor`; `@objectstack/core` and `@objectstack/objectql` at `patch`. No `skip-changeset`. - **Liveness row**: n/a. `DriverCapabilities` is not a registered metadata type, and `check:liveness` exits 0. ## Verification **Files to read first (by risk)** 1. `packages/objectql/src/fixed-read-leaf-position.ts`, the `judge` hunk. The position, verb and form rules decide what reaches a driver; a wrong admission here is the only way a leaf passes. 2. `packages/objectql/src/fixed-read-leaf-seam.ts`, `passFixedReadLeaves`. The recipient, the two classes and the declaration consult, and the once-per-evaluator log. 3. `packages/objectql/src/filter-comparand-shape.ts`, the wrapper. The position walk now runs before the list-shape door; this ordering is what turns a misplaced branded leaf into a 500 instead of a 400. **Two-minute verification** `pnpm --filter @objectstack/objectql exec vitest run --maxWorkers=2 src/engine-fixed-read-leaf-seam.test.ts` should report `Tests 64 passed (64)`. That covers all 33 conformance seam cases against the real seam, plus the recipient, declaration, class, pipeline-written, door and door-log cases. L2: this PR owes a contract review (`CONTRACT_REVIEW_TIER`). --- _Generated by [Claude Code](https://claude.ai/code/session_01L9qibvQwUyVQ6n8wEMcUgF)_ <!-- signed: repo:objectstack#7 · os-tesla · session_01L9qibvQwUyVQ6n8wEMcUgF --> --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent f51578e commit d7c257e

32 files changed

Lines changed: 1411 additions & 44 deletions
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/core': patch
4+
'@objectstack/objectql': patch
5+
---
6+
7+
feat: the engine's seam for the fixed-read leaf, and the driver declaration for it (ADR-0155, step 2 of 6)
8+
9+
Clause-②: yes
10+
Metadata-protocol: added
11+
12+
No visible change on its own: nothing on main writes a fixed-read leaf yet (the sharing plugin starts writing `SharedRecordIds` at ADR-0155's last step), and no driver declares one (the SQL drivers and the memory driver declare it on the steps that compile it).
13+
14+
- **The driver declaration** (`@objectstack/spec`). `DriverCapabilities.fixedReadLeaves` lists the fixed-read leaves a driver's filter compiler evaluates exactly, by name, e.g. `['SharedRecordIds']`; absence means none. The names are `FIXED_READ_LEAF_NAMES`, and `fixedReadLeafNameOf(leaf)` maps a leaf to its name. It stays separate from `readableIdsLeaf`: a `ReadableIds` leaf is not a fixed-read leaf, and a driver that evaluates both declares both. Both descriptions now say so.
15+
- **The seam** (`@objectstack/objectql`). The engine's comparand door admits a branded `SharedRecordIds` leaf as a `$in` comparand, and the engine hands it to the driver by reference only when it sits on `id` of the object it names (directly, or inside a composed `ReadableIds` scope over that object), on a read verb in its read form or in a predicate update's `where` in its write form, for the context's user or its delegator (a system context is exempt), outside both classes ADR-0155 D4 recognises (the object on another datasource than `sys_record_share`; a middleware or a `beforeFind` / `afterFind` hook registered for `sys_record_share` by name), and to a driver whose `fixedReadLeaves` names it. Anything else is refused before any driver is asked, `INTERNAL_ERROR` / 500, logged at `error` once per evaluator. An unbranded copy is still refused at the door as a non-list comparand, `INVALID_FILTER` / 400.
16+
- **The refusal** (`@objectstack/core`). `fixedReadLeafRefusal`, `refuseFixedReadLeafOnce` and `describeFixedReadLeaf` are the one envelope every evaluator answers a fixed-read leaf it will not run with; `logRefusalOnce` is the once-per-instance log it shares with the `ReadableIds` refusal.
17+
- **Filter tokens** (`@objectstack/core`). `resolveFilterTokens` returns a fixed-read leaf by reference, as it does a `ReadableIds` leaf, so a read scope that carries a placeholder beside the leaf keeps the leaf's brand.

‎content/docs/permissions/system-context.mdx‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ bugs — it is the protection or the side effect that silently does not happen.
125125
| 18c | **Credential-column filter / sort refusal not applied** — a `where`, `orderBy`, per-aggregation `filter` or `expand` entry naming a `password` / `secret` column is evaluated | objectql | Get: the server's own match on a stored credential value, a lookup that never returns it. Every other caller, administrators included, is refused `400 INVALID_FIELD` for anything but a has-a-value check (ADR-0100). Lose: nothing a wire caller reaches — `isSystem` is never set on an inbound request | `rejectCredentialEvaluation` |
126126
| 18d | **Stored-metadata type read gate not applied** — a read of `sys_metadata` / `sys_metadata_history` is not narrowed by the capability its row's type requires | objectql | Get: every row of the family on `find` / `findOne` / `count` / `aggregate` — the metadata loader, the `/meta` doors' own store reads, boot (a read with no execution context is not narrowed either). Lose: the narrowing that serves a stored row of a capability-gated type (`datasource`, `external_catalog`) only to holders of the capability the `/meta` type gate names for it | `storedMetadataTypeReadFilter` |
127127
| 18e | **`internal: true` evaluate refusal not applied on the engine's read path** — a filter, sort, group key, aggregation operand, per-aggregation `filter`, nested-relation condition or `expand` entry naming a field declared `internal: true` is evaluated | objectql | Get: the server's own match on a flagged column (the API-key, share-link, SCIM-credential and approval-token lookups, the better-auth adapter), which still never returns the value. Every other caller of `find` / `findOne` / `count` / `aggregate`, administrators included, is refused `400 INVALID_FIELD`; the data door asks the same judgement for every caller, a system context included. Lose: nothing a wire caller reaches — `isSystem` is never set on an inbound request | `rejectInternalFieldEvaluation` |
128+
| 18f | **Fixed-read leaf recipient check not applied** — a `SharedRecordIds` leaf (ADR-0155) that names another principal is handed on to the driver | objectql | Get: server code may hand the engine a share-table read for any recipient. Nothing on main writes the leaf yet; the sharing plugin starts at ADR-0155's last step. Every other caller's leaf must name its own user or its delegator, or the operation is refused `500 INTERNAL_ERROR` before any driver is asked (ADR-0155 D4). The position, verb, class and driver-declaration checks apply to every caller, a system context included. Lose: nothing a wire caller reaches — no request can spell the leaf, and `isSystem` is never set on an inbound request | `passFixedReadLeaves` |
128129

129130
### 2. Write pipeline and data integrity
130131

@@ -561,6 +562,7 @@ and CI refuses one that differs from what the tree produces.
561562
| `packages/objectql/src/engine-update.ts#update` | 4 | 19, 20 |
562563
| `packages/objectql/src/engine-validate.ts#validate` | 1 | 21b |
563564
| `packages/objectql/src/engine.ts#isSystem` | 1 | 64 |
565+
| `packages/objectql/src/fixed-read-leaf-seam.ts#passFixedReadLeaves` | 1 | 18f |
564566
| `packages/objectql/src/internal-field-evaluation-guard.ts#rejectInternalFieldEvaluation` | 1 | 18e |
565567
| `packages/objectql/src/recycle-bin/list.ts#assertCallerManagesRecycleBin` | 1 | 29f |
566568
| `packages/objectql/src/recycle-bin/purge.ts#recycleBinWallDenies` | 1 | 29d |

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,8 @@ const result = AggregationPipelineSchema.parse(data);
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) |
169169
| **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) |
170170
| **zonedDateBucketing** | `boolean` | optional | `aggregate()` buckets a date groupBy on the calendar of the resolved IANA zone the engine sends (DriverAggregateQuery.timezone), DST-correct, equal to the in-memory buckets (absence = false: the engine buckets a non-UTC zone in memory) |
171-
| **readableIdsLeaf** | `boolean` | optional | The filter compiler compiles (or, in process, evaluates) a composed `ReadableIds` semi-join leaf (absence = false: the engine refuses a nested-relation condition on a read verb up front, INVALID_FILTER / 400) |
171+
| **readableIdsLeaf** | `boolean` | optional | The filter compiler compiles (or, in process, evaluates) a composed `ReadableIds` semi-join leaf (absence = false: the engine refuses a nested-relation condition on a read verb up front, INVALID_FILTER / 400). A `ReadableIds` leaf is not a fixed-read leaf, so `fixedReadLeaves` neither implies nor is implied by this bit |
172+
| **fixedReadLeaves** | `Enum<'SharedRecordIds'>[]` | optional | The fixed-read leaves (ADR-0155 D4) the filter compiler evaluates exactly, by name, e.g. ["SharedRecordIds"] (absence = none: the engine refuses an operation carrying such a leaf before calling the driver, INTERNAL_ERROR / 500). Separate from `readableIdsLeaf`: a `ReadableIds` leaf is not a fixed-read leaf |
172173
| **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. |
173174
| **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. |
174175
| **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. |

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,8 @@ const result = DataTypeMappingSchema.parse(data);
8181
| **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) |
8282
| **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) |
8383
| **zonedDateBucketing** | `boolean` | optional | `aggregate()` buckets a date groupBy on the calendar of the resolved IANA zone the engine sends (DriverAggregateQuery.timezone), DST-correct, equal to the in-memory buckets (absence = false: the engine buckets a non-UTC zone in memory) |
84-
| **readableIdsLeaf** | `boolean` | optional | The filter compiler compiles (or, in process, evaluates) a composed `ReadableIds` semi-join leaf (absence = false: the engine refuses a nested-relation condition on a read verb up front, INVALID_FILTER / 400) |
84+
| **readableIdsLeaf** | `boolean` | optional | The filter compiler compiles (or, in process, evaluates) a composed `ReadableIds` semi-join leaf (absence = false: the engine refuses a nested-relation condition on a read verb up front, INVALID_FILTER / 400). A `ReadableIds` leaf is not a fixed-read leaf, so `fixedReadLeaves` neither implies nor is implied by this bit |
85+
| **fixedReadLeaves** | `Enum<'SharedRecordIds'>[]` | optional | The fixed-read leaves (ADR-0155 D4) the filter compiler evaluates exactly, by name, e.g. ["SharedRecordIds"] (absence = none: the engine refuses an operation carrying such a leaf before calling the driver, INTERNAL_ERROR / 500). Separate from `readableIdsLeaf`: a `ReadableIds` leaf is not a fixed-read leaf |
8586
| **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. |
8687
| **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. |
8788
| **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. |

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ const result = DriverCapabilitiesSchema.parse(data);
3535
| **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) |
3636
| **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) |
3737
| **zonedDateBucketing** | `boolean` | optional | `aggregate()` buckets a date groupBy on the calendar of the resolved IANA zone the engine sends (DriverAggregateQuery.timezone), DST-correct, equal to the in-memory buckets (absence = false: the engine buckets a non-UTC zone in memory) |
38-
| **readableIdsLeaf** | `boolean` | optional | The filter compiler compiles (or, in process, evaluates) a composed `ReadableIds` semi-join leaf (absence = false: the engine refuses a nested-relation condition on a read verb up front, INVALID_FILTER / 400) |
38+
| **readableIdsLeaf** | `boolean` | optional | The filter compiler compiles (or, in process, evaluates) a composed `ReadableIds` semi-join leaf (absence = false: the engine refuses a nested-relation condition on a read verb up front, INVALID_FILTER / 400). A `ReadableIds` leaf is not a fixed-read leaf, so `fixedReadLeaves` neither implies nor is implied by this bit |
39+
| **fixedReadLeaves** | `Enum<'SharedRecordIds'>[]` | optional | The fixed-read leaves (ADR-0155 D4) the filter compiler evaluates exactly, by name, e.g. ["SharedRecordIds"] (absence = none: the engine refuses an operation carrying such a leaf before calling the driver, INTERNAL_ERROR / 500). Separate from `readableIdsLeaf`: a `ReadableIds` leaf is not a fixed-read leaf |
3940
| **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. |
4041
| **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. |
4142
| **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. |
@@ -94,7 +95,8 @@ const result = DriverCapabilitiesSchema.parse(data);
9495
| **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) |
9596
| **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) |
9697
| **zonedDateBucketing** | `boolean` | optional | `aggregate()` buckets a date groupBy on the calendar of the resolved IANA zone the engine sends (DriverAggregateQuery.timezone), DST-correct, equal to the in-memory buckets (absence = false: the engine buckets a non-UTC zone in memory) |
97-
| **readableIdsLeaf** | `boolean` | optional | The filter compiler compiles (or, in process, evaluates) a composed `ReadableIds` semi-join leaf (absence = false: the engine refuses a nested-relation condition on a read verb up front, INVALID_FILTER / 400) |
98+
| **readableIdsLeaf** | `boolean` | optional | The filter compiler compiles (or, in process, evaluates) a composed `ReadableIds` semi-join leaf (absence = false: the engine refuses a nested-relation condition on a read verb up front, INVALID_FILTER / 400). A `ReadableIds` leaf is not a fixed-read leaf, so `fixedReadLeaves` neither implies nor is implied by this bit |
99+
| **fixedReadLeaves** | `Enum<'SharedRecordIds'>[]` | optional | The fixed-read leaves (ADR-0155 D4) the filter compiler evaluates exactly, by name, e.g. ["SharedRecordIds"] (absence = none: the engine refuses an operation carrying such a leaf before calling the driver, INTERNAL_ERROR / 500). Separate from `readableIdsLeaf`: a `ReadableIds` leaf is not a fixed-read leaf |
98100
| **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. |
99101
| **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. |
100102
| **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. |

‎packages/core/src/index.ts‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,9 @@ export * from './utils/blank-storage-form.js';
209209
// above gives.
210210
export * from './utils/json-column-operator-refusal.js';
211211
export * from './utils/readable-ids-driver-refusal.js';
212+
// [ADR-0155 D4] …and the fixed-read leaves' refusal, on the same floor for the
213+
// same reason: the engine's seam answers it now, each evaluator on its own card.
214+
export * from './utils/fixed-read-leaf-refusal.js';
212215

213216
// [#12350 / ADR-0126 §4] THE activation-ledger row contract, parameterized by
214217
// `metadata_type`. Same reason as the two entries above: its consumers —

0 commit comments

Comments
 (0)