Skip to content

Commit 35aad65

Browse files
committed
fix(runtime): keep the tracker id out of the refusal STRING, and pin on sqlite
Two gate-driven corrections to the refusal, both mechanical: - `check:doc-authoring` — a runtime message reaches authors and operators who have no tracker to resolve `#NNNN` with, so the card id moves to the `//` comment above the constant. The changeset's quoted message follows, and now quotes the envelope key list the refusal actually prints (measured: 12 keys). - `check:driver-memory-census` — the real-engine pin bound `@objectstack/driver-memory`, whose consumer set #5704 froze and #6664 ruled to a ledger; a new binding there is a maintainer ruling, not bookkeeping. It binds sqlite `:memory:` instead, which is what #5704 migrated the test backends to. Nothing about the pin needed that driver: what has to be real here is the ENGINE, because the null exemption is the engine's. Claude-Session: https://claude.ai/code/session_01JbZnqu8bt6YqfJsr9vaFb3 Co-authored-by: Claude <noreply@anthropic.com>
1 parent 26f18cd commit 35aad65

3 files changed

Lines changed: 19 additions & 5 deletions

File tree

‎.changeset/15124-action-engine-facade-find-query-envelope.md‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,9 @@ handler — nothing above reaches you, so the facade refuses the withdrawn shape
6262
```
6363
find('task') was given a key 'status' the query envelope does not carry.
6464
ctx.engine.find(object, query) takes the engine QUERY ENVELOPE, not a bare
65-
filter — move the filter under `where`: find(object, { where: { … } }) (#15124).
65+
filter — move the filter under `where`: find(object, { where: { … } }).
66+
Envelope keys: context, cursor, distinct, expand, fields, limit, offset,
67+
orderBy, search, searchFields, top, where.
6668
```
6769

6870
⚠️ **That refusal matters most for a filter whose value is `null`.** The engine's

‎packages/runtime/src/action-engine-facade-find-envelope.test.ts‎

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
import { describe, it, expect, beforeAll } from 'vitest';
4545
import { assertEngineDeleteDispatch } from '@objectstack/metadata-core';
4646
import { ObjectQL } from '@objectstack/objectql';
47-
import { InMemoryDriver } from '@objectstack/driver-memory';
47+
import { SqliteWasmDriver } from '@objectstack/driver-sqlite-wasm';
4848
import { buildActionEngineFacade, ACTION_ENGINE_FIND_ENVELOPE_PRESCRIPTION } from './action-execution.js';
4949

5050
const deps: any = { resolveService: () => undefined, getObjectQL: async () => undefined };
@@ -185,10 +185,19 @@ const PROBE_OBJECT = {
185185
},
186186
} as any;
187187

188-
/** A real `ObjectQL` over a real in-memory driver, seeded with three rows. */
188+
/**
189+
* A real `ObjectQL` over a real driver, seeded with three rows.
190+
*
191+
* sqlite `:memory:` rather than `@objectstack/driver-memory`: #5704 migrated
192+
* this project's test backends to it and froze the memory driver's consumer
193+
* set, which `check:driver-memory-census` holds to a ruled ledger. A new
194+
* binding there would need a maintainer ruling, and nothing about this pin
195+
* needs that driver — what has to be REAL here is the ENGINE, because the
196+
* null-exemption this block is about is the engine's.
197+
*/
189198
async function makeRealEngine() {
190199
const engine = new ObjectQL();
191-
engine.registerDriver(new InMemoryDriver({}) as any, true);
200+
engine.registerDriver(new SqliteWasmDriver({ filename: ':memory:' }) as any, true);
192201
await engine.init();
193202
engine.registry.registerObject(PROBE_OBJECT, 'test');
194203
await engine.syncSchemas?.();

‎packages/runtime/src/action-execution.ts‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1476,9 +1476,12 @@ export function buildActionApi(_deps: ActionExecutionDeps, ql: any, ec: any): an
14761476
* would stay green against any unnamed `Error` at all, and the pin has to
14771477
* compare text.
14781478
*/
1479+
// The card id stays in this comment and out of the string: a runtime message
1480+
// reaches authors and operators who have no tracker to resolve `#NNNN` with
1481+
// (#15124, and `check:doc-authoring` enforces it).
14791482
export const ACTION_ENGINE_FIND_ENVELOPE_PRESCRIPTION =
14801483
'ctx.engine.find(object, query) takes the engine QUERY ENVELOPE, not a bare filter — '
1481-
+ 'move the filter under `where`: find(object, { where: { … } }) (#15124).';
1484+
+ 'move the filter under `where`: find(object, { where: { … } }).';
14821485

14831486
/**
14841487
* The envelope's own key set, read off the DECLARATION rather than restated.

0 commit comments

Comments
 (0)