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(formula,lint): warn on date field == temporal-function silent-miss (#3183)
A `Field.date` deserializes as a "YYYY-MM-DD" string (ADR-0053 Phase 1), and
cel-js's equality hard-codes `string == <timestamp>` to false, so
`record.due_date == today()` compiles clean but silently never matches. cel-js
offers no operator-layer hook to fix the comparison, so this adds a build-time
advisory warning (the established ADR-0032 guardrail strategy) that turns the
silent runtime miss into a loud, self-correcting build signal.
- formula: `ExprSchemaHint.dateFields`; `validateExpression` flags `==`/`!=`
between a named `date` field and today()/daysFromNow()/daysAgo()/now(), with a
message pointing at the working idioms (date(...), a range, or daysBetween).
Warning severity — the write/validation path may carry a real Date, so it never
fails the build. Ordering operators already work (they fault→hydrate) and are
not flagged.
- lint: `validateStackExpressions` threads each object's `date` field names into
the validator so the warning fires across formulas, validations, flow/action/
sharing/hook predicates. Restricted to `type: 'date'` (unambiguously a string);
`datetime` excluded to avoid false positives.
A runtime fix (data-layer date hydration) stays tracked in #3183 — a naive
version would trade this silent-miss for another (breaking `dateField ==
"literal"`), so it needs its own design.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SuiM565BZ3TR1VD3prMguB
0 commit comments