|
54 | 54 | import { randomUUID } from 'node:crypto'; |
55 | 55 | import { afterEach, describe, expect, it, vi } from 'vitest'; |
56 | 56 | import { ObjectKernel } from '@objectstack/core'; |
57 | | -import { ObjectQL } from './engine.js'; |
| 57 | +import { ObjectQL, type EngineReadOptions } from './engine.js'; |
58 | 58 | import { ObjectQLPlugin } from './plugin.js'; |
59 | 59 |
|
60 | 60 | type Stores = Map<string, Map<string, Record<string, unknown>>>; |
@@ -137,6 +137,9 @@ function makeMemoryDriver(stores: Stores, drops: string[]) { |
137 | 137 | return driver; |
138 | 138 | } |
139 | 139 |
|
| 140 | +/** The data plane read, as the system reads it: typed, never erased (`check:query-options-erasure`). */ |
| 141 | +const SYSTEM_READ: EngineReadOptions = { context: { isSystem: true } }; |
| 142 | + |
140 | 143 | const Q = 'com.qa.q'; |
141 | 144 | const R = 'com.qa.r'; |
142 | 145 | const NAME = 'qa_probe_gadget'; |
@@ -202,7 +205,7 @@ describe('#23646 — an orphan adoption moves an adopted object\'s registry owne |
202 | 205 | */ |
203 | 206 | async function served(k: Booted) { |
204 | 207 | const read = await k.protocol.getMetaItem({ type: 'object', name: NAME }); |
205 | | - const records = await k.engine.find(NAME, {}, { context: { isSystem: true } } as any); |
| 208 | + const records = await k.engine.find(NAME, {}, SYSTEM_READ); |
206 | 209 | const object = k.engine.registry.getObject(NAME) as { label?: string; _packageId?: string } | undefined; |
207 | 210 | return { |
208 | 211 | owner: k.engine.registry.getObjectOwner(NAME)?.packageId, |
|
0 commit comments