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
docs(skills): objectstack-formula factual sweep — every behavioral claim verified against the implementation (#13674)
Six measured falsehoods corrected, token-neutral under the skills ratchet
(6002/6002, no ceiling raise). Verified against `@objectstack/formula`,
`@objectstack/lint` and `@objectstack/spec` by reading plus executed probes.
Claude-Session: https://claude.ai/code/session_01EXxTW8mvPBhoHxmyPZ63de
Co-authored-by: Claude <noreply@anthropic.com>
`node_modules/@objectstack/formula/src/validate.ts` — a
160
-
test asserts every entry resolves at runtime, so this table stays in sync with it.
155
+
Registered automatically by `@objectstack/formula`, which ships `dist` only —
156
+
there is no `src/` to read in an installed app. Its exported
157
+
`CEL_STDLIB_FUNCTIONS` is the canonical list, pinned by two tests: every entry
158
+
resolves at runtime, and this table documents them all.
161
159
162
160
**Dates**
163
161
@@ -172,7 +170,7 @@ test asserts every entry resolves at runtime, so this table stays in sync with i
172
170
|`addMonths(d, n)`| timestamp | Shift **any** date by `n` months; clamps to month-end (`addMonths(date('2026-01-31'), 1)` → Feb 28) |
173
171
|`date(s)` / `datetime(s)`| timestamp | Parse an ISO date / date-time string to a timestamp |
174
172
175
-
> **No date arithmetic.** Do NOT write `end - start`, `date + n`, or `today() + 30` — CEL has no numeric arithmetic on dates, so these fault and the field silently nulls (the build now rejects them). Use `daysBetween(start, end)` for a span in days, and `daysFromNow(n)` / `addDays(d, n)` / `addMonths(d, n)` to shift a date. Inclusive day span: `daysBetween(record.start_date, record.end_date) + 1`. Tenure in years: `daysBetween(record.hire_date, today()) / 365`. For a genuine sub-day offset use `now() + duration("3h")` — the calendar-day helpers always land on UTC midnight.
173
+
> **No date arithmetic.** Do NOT write `end - start`, `date + n`, or `today() + 30` — a date mixed with a number faults and the field silently nulls (the build rejects it); `end - start` does not fault, it yields a `duration` stored as `{}`. Use `daysBetween(start, end)` for a span in days, and `daysFromNow(n)` / `addDays(d, n)` / `addMonths(d, n)` to shift a date. Inclusive day span: `daysBetween(record.start_date, record.end_date) + 1`. Tenure in years: `daysBetween(record.hire_date, today()) / 365`. For a genuine sub-day offset use `now() + duration("3h")` — the calendar-day helpers always land on UTC midnight.
176
174
177
175
**Numbers**
178
176
@@ -418,14 +416,14 @@ to the envelope.
418
416
|`Field`|`expression` (when `type: 'formula'`) | cel |
419
417
|`Field`|`visibleWhen` / `readonlyWhen` / `requiredWhen`| cel |
420
418
|`View` / `Page`|`visibleWhen` (form section/field, page component) | cel |
421
-
|`Field`|`defaultValue` (M9.9b) | cel |
419
+
|`Field`|`defaultValue` (envelope only; bare string = literal) | cel |
422
420
|`ConditionalValidation`|`when`| cel |
423
421
|`View` / `Page`|`visibleOn` / `visibility` (deprecated aliases of `visibleWhen`, ADR-0089) | cel |
424
422
|`Action`|`disabled`| cel (or boolean) |
425
423
|`Hook`|`condition`| cel |
426
424
|`SharingRule`|`condition`| cel |
427
425
|`Flow.decision`|`expression` / edge `condition`| cel (use `vars.<step>.<key>`) |
428
-
|`Dataset.records[*]`| any value | cel (via `cel\`\``) |
426
+
|`Seed.records[*]`| any value | cel (via `cel\`\``) |
0 commit comments