Skip to content

Commit ad92dfd

Browse files
fix(lint)!: refuse == / != on a list-valued field reached through a lookup hop (#36673)
Fixes #36237 Clause-②: yes (narrowing) Metadata-protocol: narrowed Skills-docs: none — the objectstack-formula skill already teaches that a list field compared with a scalar literal is refused, and the has()-guarded `in` rewrite; a hop read of a list field takes the same rewrite ## 维护者速读 - 用户能看到什么变化:作者在校验规则或公式里拿关联对象的多值字段和单个值做等号比较时,构建和保存对象时会直接报错并给出改写,以前静默通过。 - 为什么做:多值字段被单值比较的问题根字段已经拦住,隔一层关联就漏掉了;这次补上,替写条件的作者解决"规则看着对却永远不触发"。 - 出错会怎样:误拦只会出现在保存或构建时,作者按提示改写即可通过,已存的数据照常读取;撤回这次改动即恢复旧行为。 - 要你做什么:无。 ## What changes The root-field case (`record.labels == 'vip'` on a list-valued field) is refused as `list-equality` by the shared validator. One lookup hop away, `record.account.labels == 'vip'`, nothing refused it: `ExprSchemaHint` carries the root object's fields only, so the validator never learns that `labels` on the hop target is a list. Route taken: the card's route 2, a lint pass beside `refuseUndeclaredHopField`. No `ExprSchemaHint` member is added. - `@objectstack/formula`: new export `findHopListEquality(source, listLeaves)`. It returns the `list-equality` refusals (the same code, params, message and rewrite as the root case) for each `==` / `!=` between a one-hop read `record.REF.LEAF` and a non-null scalar literal, where `listLeaves` maps the reference REF to the list-valued fields of its target. The comparison walk the root case used is now shared: it was moved out of `checkListEquality` into `forEachListEquality`, with no change in behaviour. `relationship-traversal.ts` gains the module-internal reader `hopMemberOf`, which is `rootMemberOf` one segment further. - `@objectstack/lint`: `refuseHopListEquality` builds that map from the objects as served (a reference that is itself multi-valued, or that targets the stored-metadata family, is left out) and runs at the same two sites as `refuseUndeclaredHopField`: a validation rule's hydrated `condition` / `when` (nested branches included), and a formula `expression`. - `@objectstack/spec`: the ADR-0087 semantic entry `cel-list-equality-refused` now names the one-hop read in its `surface` (a validation rule's `condition` / `when` and a field `expression`, REF single-valued, LEAF list-valued; not a multi-valued reference, a second hop, a `previous` hop, or a hop at any other site) and states its doors in `replacement` (`os validate`, `os build`, the object save door; not the Studio draft check, not the shared-validator half of the MCP `validate_expression` tool). Prose only: no schema shape changes, and `check:generated` reports all 14 artifacts up to date. Reach, measured once (the card asked for this). A hop is served at exactly two sites: a validation rule predicate and a formula expression. Every other CEL site (an action's `visible`, a flow condition, a hook condition) binds the stored id at `record.account`, so this shape is not a list comparison there. - On a real ObjectQL write path, with a throwaway probe that is not committed: the rule `record.account.labels == 'vip'` ACCEPTED the write both for an account labelled `['vip','eu']` and for one labelled `['eu']`, so it never fires. The prescribed rewrite REFUSED the VIP account and ACCEPTED the EU one. - Doors that now refuse: `os validate` / `os build`, and the object save door (`runStackExpressionPasses` with `runtimeWriteType: 'object'`, pinned in the new lint test). ## Tests - `packages/formula/src/validate-hop-list-equality-36237.test.ts`: a premise check on the evaluator (a hydrated hop list compared with a scalar gives a constant), refusals in both operand orders and in both member spellings, the code and params, a rewrite that evaluates per row and is not itself refused, and controls (a scalar leaf, null tests, `in`, a root field, an unmapped reference, two hops, a comprehension that binds `record`, an empty map, a source that does not compile). - `packages/lint/src/validate-expressions.hop-list-equality-36237.test.ts`: refusals on one hop to a `multiselect` and on one hop to a `multiple: true` `user` field, with the slot's key path; the prescribed rewrite passes with zero errors; one hop to a scalar field passes; a conditional rule's `when`, a formula and the object save door are covered; a multi-valued reference and a site that serves no hop are controls. - Ablation, one for each card pin (lint source; the test reads `src` directly, so no build is needed): deleting the rule-site call turns the two refusal pins and the when/formula pin red (3 failed); pointing the leaves at every target field instead of the list-valued ones turns the two scalar controls red (2 failed). Both mutations were applied and restored by `scripts/ablation-replace.mjs`: the anchor went 1 to 0, and the restored blob matched HEAD with an empty `git diff HEAD`. <details><summary>Readings (local, final head a59d4a8)</summary> - Dogfood battery at a59d4a8 (the title carries `!`; `pnpm --filter @objectstack/dogfood test` under the lock, no shard, no path): VERDICT command-exit 0; Test Files 487 passed, 3 skipped (490); Tests 4121 passed, 68 skipped (4189); no failures. - `@objectstack/formula` test: Test Files 71 passed (71), Tests 2128 passed (2128). Read at ff7e133; formula source is unchanged since. - `@objectstack/lint` test: Test Files 228 passed (228); Tests 9476 passed, 5 skipped. Read at d26a320, after the two ledger files were added; lint source is unchanged since. The 5 skips depend on a built `dist`. - `@objectstack/spec` migrations tests: Test Files 5 passed (5), Tests 200 passed (200). `check:generated`: all 14 artifacts up to date. - `@objectstack/formula` and `@objectstack/lint` typecheck: VERDICT command-exit 0. - Derived gate families (`dispatch-gates --commands`): 67 before the spec entry edit, of which 64 exited 0 and 3 are NOT MEASURED (`check:dual-build-cjs-loads`, `check:lean-entry-closure`, `check-plugin-teardown-shape --self-test`; their prerequisite is a whole-tree build or a deeper clone). Re-derived at a59d4a8 there are 92. The 25 new ones (spec families) all exited 0, two of them after a re-run once a concurrent build had restored `dist`. - Re-run at a59d4a8, all exit 0: `check-adr-0087-registration --base origin/main`, `check-empty-changeset`, `check:nul-bytes`, `check-affected-docs`, `check-drift-comment`, `check:issue-citations`, `check:doc-authoring`, `check:changeset-gate-self-tests`. </details> ## Acceptance notes - Public API: `findHopListEquality` is a new named export of `@objectstack/formula`. That package has one entry, and keeping the refusal there avoids a second copy of its code, params, message and rewrite in lint. Nothing existing changes shape. - Narrowing, declared: a source that `os validate`, `os build` or an object save accepted before is now refused when it compares a hop-reached list with a scalar. That comparison never fired at runtime (measured above), so the only rules refused are ones that already did nothing. The title and the changeset headline carry `!`, and the changeset carries the BREAKING line with FROM / TO. - Not reached by this route, by design: Studio's draft check and the shared-validator half of the MCP `validate_expression` tool. Both judge the root case through `ExprSchemaHint`, which carries the root object's fields only. The card's Done-when ("or the condition's author is told at save") is met at the object save door. The ADR-0087 entry now names the same doors. - ADR-0087 disposition: `already-registered cel-list-equality-refused`. This PR extends that entry's surface and replacement. - In-repo producers, found by grepping `examples/` and `packages/qa` for `record.X.Y ==|!=` plus a literal: 4 candidates. One is a hop to a single `select` at a validation rule (`app-showcase` invoice `record.account.status`), which is accepted. The other three are object-valued fields at an action `visible`, which is not a hop site. None would be refused, and the dogfood battery agrees. ## Verification Files to read first, ordered by risk: 1. `packages/formula/src/validate.ts`: the `forEachListEquality` extraction (the root-case behaviour must be byte-identical) and `findHopListEquality`. 2. `packages/lint/src/validate-expressions.ts`: `refuseHopListEquality` and its two call sites. 3. `.changeset/36237-hop-list-equality.md`. Two-minute check: `pnpm --filter @objectstack/lint exec vitest run src/validate-expressions.hop-list-equality-36237.test.ts`. Expect 10 passed. --- _Generated by [Claude Code](https://claude.ai/code/session_011y7As7qKGpBTzxc5S8q3Ko)_ <!-- signed: repo:objectstack#7 · os-alice · session_011y7As7qKGpBTzxc5S8q3Ko --> --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent 49c6bf3 commit ad92dfd

10 files changed

Lines changed: 426 additions & 4 deletions
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
---
2+
'@objectstack/formula': minor
3+
'@objectstack/lint': minor
4+
'@objectstack/spec': minor
5+
---
6+
7+
fix(lint)!: `==` / `!=` between a list-valued field reached through a lookup hop and a scalar is refused, as the root-field case is
8+
9+
Clause-②: yes (narrowing)
10+
Metadata-protocol: narrowed
11+
Skills-docs: none — the `objectstack-formula` skill already teaches that a list field compared with a scalar literal is refused and the `has()`-guarded `in` rewrite; a hop read of a list field takes the same rewrite
12+
13+
<!-- adr-0087: not-required (already-registered cel-list-equality-refused) the same list-equality refusal and membership rewrite, one hop away; this change extends that entry's surface to the one-hop read at a validation rule predicate and a field expression, and states its doors (os validate, os build, the object save door) -->
14+
15+
**BREAKING** accept-set narrowing, shipped as `minor`; the new `@objectstack/formula` export `findHopListEquality` widens the package's public surface.
16+
17+
`record.labels == 'vip'` on a list-valued field has been refused as `list-equality` since the shared validator learned it, but the same comparison one hop away, `record.account.labels == 'vip'` where `account` is a lookup and `labels` a list-valued field of its target, was refused nowhere. A validation rule's `condition` / `when` and a formula's `expression` are the two sites that serve a hop: the engine hydrates the related row, so `record.account.labels` is the stored list, and comparing it with a scalar answers `false` (for `!=`, `true`) on every row. A rule written that way never fires and saves clean.
18+
19+
- **The refusal.** At those two sites, the publish lint (`os validate` / `os build`) and the object save door refuse a `==` / `!=` between a read of a hop target's list-valued field (an inherently multi-value type, or a multi-capable type declared `multiple: true`) and a non-null scalar literal, either operand order, in the root case's words, prescribing the root case's membership test on the hop read.
20+
- **What carries it.** `@objectstack/formula` exports `findHopListEquality(source, listLeaves)`, which returns the `list-equality` refusals (same code and params as `validateExpression`'s) for the reference → list-valued-leaves map its caller hands in. `ExprSchemaHint` is unchanged. The ADR-0087 entry `cel-list-equality-refused` now names the one-hop read and its doors; the Studio draft check and the shared-validator half of the MCP `validate_expression` tool do not see a hop.
21+
- **Still accepted.** A hop to a scalar field (`record.account.tier == 'vip'`), `record.account.labels == null`, `'vip' in record.account.labels`, a hop through a reference that is itself multi-valued, and every site that serves no hop (an action's `visible`, a flow condition), where `record.account` is the stored id.
22+
23+
FROM → TO:
24+
25+
- `record.account.labels == 'vip'` → `(has(record.account.labels) && record.account.labels != null && "vip" in record.account.labels)`
26+
- `record.account.labels != 'vip'` → `(!has(record.account.labels) || record.account.labels == null || !("vip" in record.account.labels))`
27+
28+
One-line fix: test membership with `in` on the hop read, guarded as the refusal prescribes.

‎packages/formula/src/index.ts‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,10 @@ export type { UnknownFunctionCall } from './unknown-function';
183183
// ADR-0032 — shared validator + introspection (one validator for build,
184184
// registration, and the agent-callable validate_expression tool).
185185
export { validateExpression, introspectScope, expectedDialect, inferExpressionType, nearestName, CEL_STDLIB_FUNCTIONS } from './validate';
186+
// [#36237] The `list-equality` refusal one relationship hop away, for the
187+
// caller that resolves hop targets (`@objectstack/lint`): the hint describes
188+
// the root object's fields only.
189+
export { findHopListEquality } from './validate';
186190
export type { FieldRole, ExprInput, ExprSchemaHint, ExprFaultOutcome, ExprValidationError, ExprValidationResult, InferredValueType } from './validate';
187191
// #22727 — the declaration authoring stamps onto a formula field: its
188192
// `returnType`, and for a provably-money result its currency, copied from the

‎packages/formula/src/relationship-traversal.ts‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,27 @@ export function rootMemberOf(node: unknown, roots: readonly string[]): { readonl
238238
return op === 'id' && typeof args === 'string' && roots.includes(args) ? { root: args, field: member.name } : undefined;
239239
}
240240

241+
/**
242+
* [#36237] The ONE-HOP read `node` itself is — `record.account.labels`,
243+
* `record['account']['labels']`, any mix of the {@link asMember} spellings —
244+
* as `{ root, field, leaf }`, or `undefined` when `node` is anything else: a
245+
* read of the root's own member (`record.labels`, {@link rootMemberOf}'s
246+
* answer), a deeper read (`record.a.b.c`), a call, a literal.
247+
*
248+
* {@link rootMemberOf} one segment further, for a check that judges an
249+
* OPERAND reached through a relationship: `@objectstack/lint`'s hop pass asks
250+
* whether one side of a `==` is a read of the hop target's field.
251+
*/
252+
export function hopMemberOf(
253+
node: unknown,
254+
roots: readonly string[],
255+
): { readonly root: string; readonly field: string; readonly leaf: string } | undefined {
256+
const member = asMember(node);
257+
if (!member) return undefined;
258+
const read = rootMemberOf(member.receiver, roots);
259+
return read ? { ...read, leaf: member.name } : undefined;
260+
}
261+
241262
/**
242263
* Analyse one authored CEL source for the hops it takes through `root`.
243264
*
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
// Copyright (c) 2026 ObjectStack. Licensed under the Apache-2.0 license.
2+
3+
/**
4+
* [#36237] `findHopListEquality` — the `list-equality` refusal one
5+
* relationship hop away. `record.account.labels == 'vip'`, where `account` is
6+
* a reference and `labels` a list-valued field of its target, compares the
7+
* whole hydrated list with the scalar: one constant on every row, the root
8+
* case's defect (`validate-list-equality-36167.test.ts`). The hint carries the
9+
* root object's fields only, so the caller that resolves hop targets hands
10+
* the reference → list-valued-leaves map in.
11+
*
12+
* The first describe proves the premise on the evaluator, over the shape the
13+
* hop loader binds (the related row nested under the reference field).
14+
*/
15+
16+
import { describe, it, expect } from 'vitest';
17+
18+
import { celEngine } from './cel-engine';
19+
import { findHopListEquality } from './validate';
20+
21+
/** `account` reaches a target whose `labels` is list-valued. */
22+
const LEAVES: ReadonlyMap<string, ReadonlySet<string>> = new Map([['account', new Set(['labels'])]]);
23+
24+
describe('the premise — a hydrated hop to a list, compared with a scalar, is a constant', () => {
25+
const run = (source: string, labels: unknown) =>
26+
celEngine.evaluate({ dialect: 'cel', source }, { record: { account: { id: 'a1', labels } } });
27+
it.each([[['vip', 'eu']], [['eu']], [[]], [null]])('labels = %j', (labels) => {
28+
expect(run("record.account.labels == 'vip'", labels)).toEqual({ ok: true, value: false });
29+
expect(run("record.account.labels != 'vip'", labels)).toEqual({ ok: true, value: true });
30+
});
31+
});
32+
33+
describe('findHopListEquality — refused', () => {
34+
it.each([
35+
["record.account.labels == 'vip'", '==', 'false'],
36+
["'vip' != record.account.labels", '!=', 'true'],
37+
["record['account']['labels'] == 'vip'", '==', 'false'],
38+
["record.amount > 1 && record.account.labels != 'vip'", '!=', 'true'],
39+
] as const)('%s, under the root case\'s code and params', (source, operator, answer) => {
40+
const errors = findHopListEquality(source, LEAVES);
41+
expect(errors).toHaveLength(1);
42+
const [e] = errors;
43+
expect(e.code).toBe('list-equality');
44+
expect(e.code === 'list-equality' && e.params.reference).toBe('record.account.labels');
45+
expect(e.code === 'list-equality' && e.params.operator).toBe(operator);
46+
expect(e.code === 'list-equality' && e.params.answer).toBe(answer);
47+
expect(e.source).toBe(source);
48+
});
49+
50+
it('the prescribed rewrite answers per row on the hydrated hop, and is not itself refused', () => {
51+
const [eq] = findHopListEquality("record.account.labels == 'vip'", LEAVES);
52+
const [ne] = findHopListEquality("record.account.labels != 'vip'", LEAVES);
53+
const eqRewrite = eq!.code === 'list-equality' ? eq!.params.rewrite : '';
54+
const neRewrite = ne!.code === 'list-equality' ? ne!.params.rewrite : '';
55+
expect(eqRewrite).toBe('(has(record.account.labels) && record.account.labels != null && "vip" in record.account.labels)');
56+
const run = (source: string, labels: unknown) =>
57+
celEngine.evaluate({ dialect: 'cel', source }, { record: { account: { id: 'a1', labels } } });
58+
expect(run(eqRewrite, ['vip', 'eu'])).toEqual({ ok: true, value: true });
59+
expect(run(eqRewrite, ['eu'])).toEqual({ ok: true, value: false });
60+
expect(run(eqRewrite, null)).toEqual({ ok: true, value: false });
61+
expect(run(neRewrite, ['vip'])).toEqual({ ok: true, value: false });
62+
expect(run(neRewrite, null)).toEqual({ ok: true, value: true });
63+
expect(findHopListEquality(eqRewrite, LEAVES)).toEqual([]);
64+
expect(findHopListEquality(neRewrite, LEAVES)).toEqual([]);
65+
});
66+
});
67+
68+
describe('findHopListEquality — CONTROL, accepted', () => {
69+
it.each([
70+
// A scalar field on the same hop target.
71+
"record.account.name == 'vip'",
72+
"record.account.labels == null",
73+
"'vip' in record.account.labels",
74+
// The list-valued field of the ROOT object is the shared validator's verdict, not this one's.
75+
"record.labels == 'vip'",
76+
// Another reference the map does not name.
77+
"record.parent.labels == 'vip'",
78+
// Two hops deep is the traversal checks' refusal.
79+
"record.account.owner.labels == 'vip'",
80+
// A comprehension macro binding `record` holds an item, not the row.
81+
"[{'account': {'labels': 'x'}}].exists(record, record.account.labels == 'x')",
82+
])('%s', (source) => {
83+
expect(findHopListEquality(source, LEAVES)).toEqual([]);
84+
});
85+
86+
it('an empty map, and a source that does not compile, get no verdict', () => {
87+
expect(findHopListEquality("record.account.labels == 'vip'", new Map())).toEqual([]);
88+
expect(findHopListEquality("record.account.labels == 'vip' &&", LEAVES)).toEqual([]);
89+
});
90+
});

‎packages/formula/src/validate.ts‎

Lines changed: 58 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ import {
3434
type FieldCelType,
3535
} from './cel-engine';
3636
import { templateEngine } from './template-engine';
37-
import { findTraversalConflicts, readRootMembers, rootMemberOf, traversalsOf, type RootMemberRead } from './relationship-traversal';
37+
import { findTraversalConflicts, hopMemberOf, readRootMembers, rootMemberOf, traversalsOf, type RootMemberRead } from './relationship-traversal';
3838
import { MULTI_OPTION_TYPES, REFERENCE_VALUE_TYPES } from '@objectstack/spec/data';
3939
// #13594 — the one reader of cel-js's `found no matching overload for '…'`
4040
// template. Both this module (which asks whether the name is ADVERTISED, to word
@@ -1567,6 +1567,62 @@ function checkListEquality(
15671567
: undefined;
15681568
};
15691569
const filterCompiled = schema?.filterCompiled === true;
1570+
forEachListEquality(tree, subjectOf, (read, op, operand) => {
1571+
errors.push(listEqualityRefusal(source, read, op, operand, filterCompiled));
1572+
});
1573+
}
1574+
1575+
/**
1576+
* [#36237] {@link checkListEquality} one relationship hop away: `==` / `!=`
1577+
* between a read of a list-valued field ON A HOP TARGET
1578+
* (`record.account.labels`) and a non-null scalar literal, refused under the
1579+
* same `list-equality` code, in the root case's words and with its
1580+
* `has()`-guarded `in` prescription (`record.account.labels` is a
1581+
* `<root>.<field>` read of the related record the hop hydrates).
1582+
*
1583+
* {@link ExprSchemaHint} describes the root object's fields and no hop
1584+
* target's, so this is a function of its own for the caller that resolves hop
1585+
* targets — `@objectstack/lint`, at the two sites that serve a hop (a
1586+
* validation rule's hydrated predicate, a formula's `expression`).
1587+
* `listLeaves` maps each single-valued reference field of the root object to
1588+
* the list-valued fields its target declares; a read it does not name gets no
1589+
* verdict. Only `record` hops are judged ({@link DEFAULT_TRAVERSAL_ROOT}, the
1590+
* root a hop is served from), and a source that does not compile gets none —
1591+
* that is `validateExpression`'s `invalid-cel` verdict.
1592+
*/
1593+
export function findHopListEquality(
1594+
source: string,
1595+
listLeaves: ReadonlyMap<string, ReadonlySet<string>>,
1596+
): ExprValidationError[] {
1597+
const errors: ExprValidationError[] = [];
1598+
if (listLeaves.size === 0 || (!source.includes('==') && !source.includes('!='))) return errors;
1599+
if (!compileCel(source).result.ok) return errors;
1600+
const tree = parseCelToAst(source);
1601+
if (tree == null) return errors;
1602+
const subjectOf = (node: unknown, bound: ReadonlySet<string>): ListSubjectRead | undefined => {
1603+
const read = hopMemberOf(node, [DEFAULT_TRAVERSAL_ROOT]);
1604+
return read && !bound.has(read.root) && listLeaves.get(read.field)?.has(read.leaf)
1605+
? { reference: `${read.root}.${read.field}.${read.leaf}`, bare: false }
1606+
: undefined;
1607+
};
1608+
forEachListEquality(tree, subjectOf, (read, op, operand) => {
1609+
errors.push(listEqualityRefusal(source, read, op, operand, false));
1610+
});
1611+
return errors;
1612+
}
1613+
1614+
/**
1615+
* Every `==` / `!=` in `tree` with a list subject (`subjectOf`) on one side
1616+
* and a scalar literal ({@link scalarLiteralOf}) on the other, either order,
1617+
* handed to `onHit` once per comparison. `subjectOf` is asked with the names
1618+
* the enclosing comprehension macros bind ({@link COMPREHENSION_MACRO_NAMES}):
1619+
* the receiver is read outside the binding, the body inside it.
1620+
*/
1621+
function forEachListEquality(
1622+
tree: unknown,
1623+
subjectOf: (node: unknown, bound: ReadonlySet<string>) => ListSubjectRead | undefined,
1624+
onHit: (read: ListSubjectRead, op: '==' | '!=', operand: string) => void,
1625+
): void {
15701626
const walk = (node: unknown, bound: ReadonlySet<string>): void => {
15711627
if (!node || typeof node !== 'object') return;
15721628
if (Array.isArray(node)) {
@@ -1592,7 +1648,7 @@ function checkListEquality(
15921648
const read = subjectOf(args[side], bound);
15931649
const operand = read ? scalarLiteralOf(args[1 - side]) : undefined;
15941650
if (!read || operand === undefined) continue;
1595-
errors.push(listEqualityRefusal(source, read, op, operand, filterCompiled));
1651+
onHit(read, op, operand);
15961652
break;
15971653
}
15981654
}

‎packages/lint/src/authored-site-expression.test.ts‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,9 @@ const EXT = {
195195

196196
const VALIDATOR = { kind: 'validator', why: 'the shared validator: the tool runs `validateExpression` itself' } as const;
197197
const HOP_FIELD: Fixture = { objects: [REQ, BAL], expression: 'record.balance.nope > 1', severity: 'error', names: 'nope' };
198+
// [#36237] A list-valued field on the hop target, compared with a scalar.
199+
const BAL_TAGS = { name: 'bal', fields: { ...BAL.fields, tags: { type: 'tags', label: 'Tags' } } };
200+
const HOP_LIST: Fixture = { objects: [REQ, BAL_TAGS], expression: "record.balance.tags == 'x'", severity: 'error', names: 'record.balance.tags' };
198201
const BODY_HOP: Fixture = { objects: [REQ, BAL], expression: "record.meta.name == 'x'", severity: 'error', names: 'sys_metadata' };
199202
const ANCHOR: Fixture = { objects: [EXT], expression: "record.owner_id == 'u1'", severity: 'warning', names: 'owner_id' };
200203
const asValue = (f: Fixture): Fixture => ({ ...f, expression: `${f.expression} ? 1 : 0` });
@@ -206,6 +209,7 @@ const SITE_CALLS: Record<ObjectSite, Record<string, Classified>> = {
206209
isBareReferenceToAny: { kind: 'plumbing', why: "filters the shared validator's findings on a field-rule slot" },
207210
refuseStoredMetadataBodyHop: { kind: 'pass', fixture: BODY_HOP },
208211
refuseUndeclaredHopField: { kind: 'pass', fixture: HOP_FIELD },
212+
refuseHopListEquality: { kind: 'pass', fixture: HOP_LIST },
209213
warnUnprovisionedAnchors: { kind: 'pass', fixture: ANCHOR },
210214
atSlot: { kind: 'plumbing', why: "sets the judged slot's key path on the findings" },
211215
celSourceOf: { kind: 'plumbing', why: 'reads the CEL source off the slot' },
@@ -231,6 +235,7 @@ const SITE_CALLS: Record<ObjectSite, Record<string, Classified>> = {
231235
celSourceOf: { kind: 'plumbing', why: 'reads the CEL source off the field' },
232236
refuseStoredMetadataBodyHop: { kind: 'pass', fixture: asValue(BODY_HOP) },
233237
refuseUndeclaredHopField: { kind: 'pass', fixture: asValue(HOP_FIELD) },
238+
refuseHopListEquality: { kind: 'pass', fixture: asValue(HOP_LIST) },
234239
// [#35356] ADR-0157 D4: a working-day call whose calendar code is not a quoted literal.
235240
computedCalendarCodeMessage: {
236241
kind: 'pass',
@@ -547,6 +552,11 @@ const FLOW_CALLS: Record<string, FlowClassified> = {
547552
why: 'runs only where a relationship hop is hydrated (a rule condition, a formula); nothing hydrates one at a flow condition',
548553
fixture: { objects: [FLOW_OBJ, BAL], expression: 'record.balance.nope > 1' },
549554
},
555+
refuseHopListEquality: {
556+
kind: 'pass-silent-here',
557+
why: 'runs only where a relationship hop is hydrated (a rule condition, a formula); nothing hydrates one at a flow condition',
558+
fixture: { objects: [FLOW_OBJ, BAL_TAGS], expression: "record.balance.tags == 'x'" },
559+
},
550560
};
551561

552562
/** The start node of a hand-written flow on `obj`, with the trigger `kind` names. */

0 commit comments

Comments
 (0)