Skip to content

Commit 2b140e9

Browse files
committed
test(cloud-connection): the purge test double honours limit and refuses combinators in its matcher; ratchet slot-lookup down
marketplace-install-local-plugin.ts reads one fewer service slot without a type (the bare 'driver' lookup is gone): 16 -> 15. Claude-Session: https://claude.ai/code/session_016GiHYRmLSNWTfbX9gVQkpz Co-authored-by: Claude <noreply@anthropic.com>
1 parent 8b3dbf1 commit 2b140e9

2 files changed

Lines changed: 8 additions & 7 deletions

File tree

‎packages/cloud-connection/src/marketplace-install-local-purge.test.ts‎

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,14 +53,15 @@ function makeEngine(tables: Record<string, Row[]>, refuse: Record<string, string
5353
async find(object: string, query?: any): Promise<any[]> {
5454
reads.push({ object, query });
5555
const where: Record<string, unknown> = query?.where ?? {};
56-
for (const [k, v] of Object.entries(where)) {
56+
const rows = (tables[object] ?? []).filter((row) => Object.entries(where).every(([k, v]) => {
57+
// Scalar equality only; anything else is refused, never guessed.
5758
if (k.startsWith('$') || (v !== null && typeof v === 'object')) {
58-
throw new Error(`fake engine: only scalar equality is implemented (got '${k}')`);
59+
throw new Error(`only scalar equality is implemented here (got '${k}')`);
5960
}
60-
}
61-
return (tables[object] ?? [])
62-
.filter((row) => Object.entries(where).every(([k, v]) => row[k] === v))
63-
.map((row) => ({ ...row }));
61+
return row[k] === v;
62+
}));
63+
const page = typeof query?.limit === 'number' ? rows.slice(0, query.limit) : rows;
64+
return page.map((row) => ({ ...row }));
6465
},
6566
async delete(object: string, options?: any): Promise<boolean> {
6667
const dispatch = assertEngineDeleteDispatch(options);

‎scripts/slot-lookup-baseline.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"packages/cli/src/commands/serve.ts": 9,
55
"packages/client/src/client.hono.test.ts": 2,
66
"packages/cloud-connection/src/cloud-connection-plugin.ts": 5,
7-
"packages/cloud-connection/src/marketplace-install-local-plugin.ts": 16,
7+
"packages/cloud-connection/src/marketplace-install-local-plugin.ts": 15,
88
"packages/core/examples/kernel-features-example.ts": 5,
99
"packages/objectql/src/plugin.integration.test.ts": 23,
1010
"packages/plugins/plugin-approvals/src/status-mirror-cascade.integration.test.ts": 3,

0 commit comments

Comments
 (0)