Skip to content

Commit ee8203b

Browse files
committed
test(automation): the history-row double refuses an operator it does not implement (ADR-0162 item 8)
Claude-Session: https://claude.ai/code/session_01JQwxbaoxpe1tyHuqnsAUFB Co-authored-by: Claude <noreply@anthropic.com>
1 parent 348f094 commit ee8203b

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

‎packages/services/service-automation/src/step-child-runs.test.ts‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,8 +155,14 @@ describe('[ADR-0162 item 8] a delegating step records the child runs it started'
155155
*/
156156
function rowTable(): SuspendedRunStoreEngine & { rows: Map<string, any> } {
157157
const rows = new Map<string, any>();
158+
// Equality only: an operator or a combinator is refused, never read as a
159+
// field name.
158160
const matches = (row: any, where: Record<string, unknown> | undefined) =>
159-
!where || Object.entries(where).every(([k, v]) => row[k] === v);
161+
!where || Object.entries(where).every(([k, v]) => {
162+
if (k.startsWith('$')) throw new Error(`rowTable: unsupported combinator ${k}`);
163+
if (v !== null && typeof v === 'object') throw new Error(`rowTable: unsupported operator on ${k}`);
164+
return row[k] === v;
165+
});
160166
return {
161167
rows,
162168
async find(_object, options) {

0 commit comments

Comments
 (0)