Commit 7125007
* chore: bump objectui to 3b2e4d98d904
fix(list): route remaining system-field groupings through shared classifier (#2706)
objectui@3b2e4d98d904d695a8372c394d46b81673011270
* fix(formula): null-guarded numeric formulas + floor/ceil + reject date arithmetic (#3306)
Shipped template `Field.formula` fields (hr_employee.tenure_years,
hr_time_off_request.days) silently evaluated to null on the pinned runtime.
Three independent CEL-engine gaps, now closed:
1. `cond ? <value> : null` — cel-js's ternary unifier rejects a concrete
int/double/string branch against null (even `true ? 5 : null` faulted),
so the blessed null-guard idiom nulled. AST pre-pass wraps the non-null
branch in dyn() (value-preserving, null-branch-only, idempotent) so it
compiles AND evaluates. Applied in compile(), evaluate(), and the build
soundness check. Mirrors the #3183 rewriteTemporalEquality pattern.
2. floor/ceil were unregistered — `floor(...)` faulted and nulled. Registered
(return int, round toward -inf/+inf, NOT trunc) + added to the catalog
(CEL_STDLIB_FUNCTIONS + objectstack-formula SKILL.md).
3. Date arithmetic (`date - date + 1`, `today() + 30`) compiled clean (dyn
operands) but always nulls at runtime. The soundness check now types
date/datetime fields as Timestamp and flags date/duration ARITHMETIC
against a number as a hard build ERROR pointing at daysBetween/daysFromNow/
addDays. Sound by construction: ordering, equality, and string concat of a
date field stay clean (runtime-tolerated); a `!= null` guard no longer
masks the inner fault (== null no-op overloads in the check-only env).
Tests: null-guard idiom (compile+eval, incl. the two hr templates), floor/ceil
semantics, date-arith RED on the shipped bug (incl. behind a null guard) and
GREEN on every runtime-tolerated date use, stack-level validateStackExpressions.
Fixes #3306.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
---------
Co-authored-by: Jack Zhuang <277994282+os-zhuang@users.noreply.github.com>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 62a2117 commit 7125007
8 files changed
Lines changed: 420 additions & 55 deletions
File tree
- .changeset
- packages
- formula/src
- lint/src
- skills/objectstack-formula
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
465 | 465 | | |
466 | 466 | | |
467 | 467 | | |
468 | | - | |
| 468 | + | |
469 | 469 | | |
470 | 470 | | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
471 | 479 | | |
472 | 480 | | |
473 | 481 | | |
| |||
495 | 503 | | |
496 | 504 | | |
497 | 505 | | |
| 506 | + | |
498 | 507 | | |
499 | 508 | | |
500 | 509 | | |
| |||
588 | 597 | | |
589 | 598 | | |
590 | 599 | | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
591 | 642 | | |
0 commit comments