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
{{ message }}
Repository navigation
Commit 2087f66
Browse filesBrowse the repository at this point in the historyBrowse files
fix(formula)!: refuse a flow condition that orders a bare date against text before date arithmetic on its record. read
The bare pass and the record-root pass both met the bare Timestamp-vs-text
ordering first and stood it down, and the record-root date-text pass stood
down because the roots' own typing met date arithmetic first, a shape it
read as answered by firstTypeMismatch. That pass is only reached where
firstTypeMismatch answered null, so the stand-down could only ever drop a
fault nobody else refused. Drop it (and its now-unused predicate); the mixed
spelling takes the all-root spelling's date-text-arithmetic verdict.
Claude-Session: https://claude.ai/code/session_01L9qibz2oLCRAYBpwsBBUyG
Co-authored-by: Claude <noreply@anthropic.com>
fix(formula)!: a flow condition that orders a bare date field against text before date arithmetic on `record.FIELD` or `previous.FIELD` is now refused, as its all-bare and all-root spellings already were
7
+
8
+
Clause-②: no (narrowing)
9
+
Metadata-protocol: narrowed
10
+
Skills-docs: none — no page under `skills/**` teaches date arithmetic in a flow condition; `content/docs/data-modeling/formulas.mdx` already names date arithmetic an error, and the refusal's own sentence names the fix
**BREAKING** accept-set narrowing. In a flow condition (a start, edge or `decision` branch condition) the run binds the record's fields under their bare names and also as `record`, with the row before the write as `previous`. A condition that first orders a `date` or `datetime` field's bare name against a text literal and then does arithmetic against a number on a `record.FIELD` / `previous.FIELD` read, such as `due_date > "2026-01-01" && record.due_date + 1 > 5`, passed `os validate` and the publish door with no finding. The flow then failed on every run, because the field reaches the run as its text and the evaluator cannot add a number to it. The all-bare spelling (`due_date > "2026-01-01" && due_date + 1 > 5`) and the all-root spelling (`record.due_date > "2026-01-01" && record.due_date + 1 > 5`) were refused already.
15
+
16
+
-**The verdict.** The mixed spelling now gets the all-root spelling's verdict: `date-text-arithmetic-run-fails` on a record-triggered flow or a sweep of the typed object, `date-text-arithmetic-run-may-fail` elsewhere, naming the read as written. A root read keeps the row's arm where bare names are unproven. Where a flow variable holds the bare name, the ordering is not the field's, and the root read's arithmetic takes `date-arithmetic-run-fails`, as `record.due_date + 1 > 5` alone does.
17
+
-**Where.**`os validate` / `os build` (`validateStackExpressions`) report an `error`, and the flow publish door refuses the publish with `INVALID_METADATA` (422). `registerFlow` logs it as an advisory and still registers the flow, so a stored flow keeps its run-time behaviour until it is next published.
18
+
-**Not refused.** The same bare ordering beside an ordering of the root read (`due_date > "2026-01-01" && record.due_date < today()`), and `daysBetween` / `addDays` over it. The run-time evaluator is unchanged.
One-line fix: in a flow condition, never add or subtract a number on a date field read through `record` or `previous`, whatever precedes it; use `daysBetween(a, b)` for a span and `addDays(d, n)` to shift a date.
0 commit comments