Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions .changeset/validate-formula-bare-refs.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
---
"@objectstack/formula": patch
"@objectstack/cli": patch
"@objectstack/formula": minor
"@objectstack/cli": minor
---

feat(validate): flag bare field references in record-scoped CEL sites at build time

> **Heads-up for downstream:** this adds a NEW build-time error. A `Field.formula`
> or validation predicate that references a field bare (`amount` instead of
> `record.amount`) now fails `objectstack compile`. These expressions were already
> silently broken at runtime (they evaluated to `null` / never fired), so this is a
> fix that surfaces a latent bug — but a stack carrying one will go from
> "builds, silently wrong" to "fails the build" on upgrade. The error message
> states the exact correction (`write record.<field>`).

A `Field.formula` and an object validation predicate evaluate against the
`record` namespace only — there is no field flattening — so a bare top-level
identifier (`amount`, `status`) resolves to nothing and the expression silently
Expand Down