Skip to content

Commit d1551fd

Browse files
committed
test(objectql): the real-registry lock test's find double holds the caller's bound
check:objectql-double-limit: the bound is applied after the filter, by presence. Claude-Session: https://claude.ai/code/session_017ErfyP2Rx7XWHJA27QjyUi Co-authored-by: Claude <noreply@anthropic.com>
1 parent 323ab0b commit d1551fd

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

‎packages/objectql/src/protocol-lock-artifact-package-axis.test.ts‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,11 @@ function protocolFor(arrangement: Arrangement, order: readonly string[]) {
6868
rows.filter((r) => Object.entries(where).every(([k, v]) => v === undefined || (r as Record<string, unknown>)[k] === v));
6969
const engine = {
7070
registry,
71-
async find(table: string, opts?: { where?: Record<string, unknown> }) {
72-
return table === 'sys_metadata' ? matching(opts?.where) : [];
71+
async find(table: string, opts?: { where?: Record<string, unknown>; limit?: number }) {
72+
if (table !== 'sys_metadata') return [];
73+
const matched = matching(opts?.where);
74+
// `check:objectql-double-limit` — the caller's bound, applied after the filter.
75+
return typeof opts?.limit === 'number' ? matched.slice(0, opts.limit) : matched;
7376
},
7477
async findOne(table: string, opts?: { where?: Record<string, unknown> }) {
7578
// `check:engine-double-contract` — refuses what the real engine refuses.

0 commit comments

Comments
 (0)