Skip to content

Commit 183cd58

Browse files
committed
fix(objectql): make the elevation pin's fake where-matcher refuse combinators
check:where-matcher flagged the fake driver's matches() in engine-repo-execute-elevation.test.ts as a new silently-wrong WHERE matcher (a $-prefixed combinator key would be read as a literal field name instead of being rejected). Refuse it loudly instead, matching the exact idiom engine-readonly-strip-caller-values.test.ts's own fake driver already uses. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0112hMx9hjJ9BgB28X97DS68
1 parent 7380f22 commit 183cd58

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

packages/objectql/src/engine-repo-execute-elevation.test.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,14 @@ function makeDriver() {
4343
};
4444
const matches = (row: any, where: any): boolean => {
4545
if (!where || typeof where !== 'object') return true;
46-
return Object.entries(where).every(([k, v]: [string, any]) => row?.[k] === v);
46+
return Object.entries(where).every(([k, v]: [string, any]) => {
47+
// [check:where-matcher] REFUSE a combinator this fixture does not
48+
// implement, rather than silently reading it as a field name — the
49+
// exact fake-driver idiom `engine-readonly-strip-caller-values.test.ts`
50+
// already carries.
51+
if (k.startsWith('$')) throw new Error(`fake driver: unsupported operator ${k}`);
52+
return row?.[k] === v;
53+
});
4754
};
4855
let n = 0;
4956
const driver: any = {

0 commit comments

Comments
 (0)