You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(validate): flag bare field refs in record-scoped CEL sites (#1928)
A Field.formula and an object validation predicate evaluate against the
`record` namespace only (no field flattening), so a bare top-level identifier
(`amount`, `status`) resolves to nothing and the expression silently evaluates
to null / never fires — the silent-at-runtime class behind #1927.
`validateExpression` gains an evaluation `scope`; for `scope: 'record'` it
reports a bare reference with the corrective `record.<field>` form. It acts only
on cel-js's `Unknown variable` fault, so it cannot false-positive on
arithmetic/comparison/null-guard overloads. Flow & automation conditions keep
the default `scope: 'flattened'` — the record's fields are spread to top-level
there alongside flow variables, so bare refs are correct and NOT flagged.
`objectstack compile` wires record scope for field formulas + validation
predicates; flow conditions stay flattened.
Also fixes three latent bare-ref bugs surfaced by the new check:
- crm_lead validation `lead_score_range` (rule silently never fired)
- showcase field_zoo `f_formula`, showcase project `budget_remaining` (null)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
0 commit comments