[BREAKING_CHANGE] Add generic date functions to validation rules
Validation rules can now measure durations in minutes or hours, move dates, truncate them to calendar boundaries, and extract date parts with dateDiff, dateAdd, dateTrunc, and datePart. The editor descriptions/examples, SDK builders, AI syntax description/snapshot, English docs, and agent reference use the new functions.
This PR targets main and contains the standalone validation-rule date implementation transferred from #30674. The date functions preserve Claude's arithmetic semantics while reusing the existing relative-date boundary/arithmetic helpers and unit schema; the review follow-up uses shared CustomError codes for invalid date units/parts and translates those errors in the frontend. Minutes/hours measure elapsed time; longer units use UTC calendar semantics. Month-end clamping, fractional amounts, offsets, and ISO weeks retain the source implementation. Computed-field type-checking, SQL rendering, and JS/Postgres parity tests are preserved in #30498.
Breaking change: daysSince is removed from string expressions, the SDK builder, and shared utility exports. Replace daysSince(date) with dateDiff(date, now, 'DAY'), or ruleExpression.daysSince(field) with ruleExpression.dateDiff(field, ruleExpression.now, 'DAY'). Existing stored expressions must be updated before upgrading; no compatibility alias or automatic data migration is included.
Comparison behavior change: ==/!= compare a date with a date-time by UTC calendar day. Two valid date-times now compare as instants for equality and ordering, independent of offset or fractional-second spelling, preserving nanosecond precision. This can change existing rules and trigger conditions that relied on string comparison. The SDK changelog and both validation-rule docs call this out explicitly.
Validation:
- 770 differential dateAdd/dateTrunc checks match Claude's original implementation.
- Shared date, validation-rule, and relative-date suites: 272 tests passed, including rejection of removed
daysSinceexpressions. - Frontend validation-rule utility suites: 89 tests passed, including generated helper examples.
- SDK rule-expression suite: 38 tests passed, including all four date builders and removal of
daysSince. - Agent skills source/distribution validation, build, and 72 tests passed.
- Shared Vite build, scoped shared TypeScript checks, repository Oxlint rules, formatting, and diff checks passed. Build reported circular-export warnings in unchanged files.
Tests used an isolated toolchain with workspace-source resolution. Full workspace typechecks and the database-backed AI snapshot suite were not run.