Skip to content

Commit 5b370a2

Browse files
committed
test(objectql): the rule-copy save-door double holds the caller's find bound, and the engine-double ledger records it
Claude-Session: https://claude.ai/code/session_01L9qibx3A7AeHSnSr39oxaV Co-authored-by: Claude <noreply@anthropic.com>
1 parent f783577 commit 5b370a2

2 files changed

Lines changed: 18 additions & 2 deletions

File tree

‎packages/objectql/src/protocol-validation-rule-copy-save-refusal.test.ts‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,9 @@ function makeHost() {
9393
assertEngineFindOnePredicate(_t, o);
9494
return findRow(o.where)?.row ?? null;
9595
},
96-
async find(_t: string, o: { where: Record<string, unknown> }) {
97-
return Array.from(rows.values()).filter((r) => matches(r, o.where));
96+
async find(_t: string, o: { where: Record<string, unknown>; limit?: number }) {
97+
const found = Array.from(rows.values()).filter((r) => matches(r, o.where));
98+
return typeof o?.limit === 'number' ? found.slice(0, o.limit) : found;
9899
},
99100
async insert(table: string, data: Record<string, unknown>) {
100101
if (table !== 'sys_metadata') return { id: 'side_table' };

‎scripts/engine-double-contract.pinned.json‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2786,6 +2786,21 @@
27862786
"verb": "update",
27872787
"pinned": 1
27882788
},
2789+
{
2790+
"file": "packages/objectql/src/protocol-validation-rule-copy-save-refusal.test.ts",
2791+
"verb": "delete",
2792+
"pinned": 1
2793+
},
2794+
{
2795+
"file": "packages/objectql/src/protocol-validation-rule-copy-save-refusal.test.ts",
2796+
"verb": "findOne",
2797+
"pinned": 1
2798+
},
2799+
{
2800+
"file": "packages/objectql/src/protocol-validation-rule-copy-save-refusal.test.ts",
2801+
"verb": "update",
2802+
"pinned": 1
2803+
},
27892804
{
27902805
"file": "packages/objectql/src/protocol-view-identity-overlay.test.ts",
27912806
"verb": "delete",

0 commit comments

Comments
 (0)