This repository was archived by the owner on Nov 4, 2026. It is now read-only.
Repository navigation
Commit 1bd79c8
fix(core): declare the field-rule fault directions, and stop a blank predicate defaulting in silence (objectui#8069) (#8904)
* docs(core): name the three field-rule FAULT directions and the four other fallback policies (objectui#8069)
`resolveFieldRuleState` handed `evalFieldPredicate` three bare positional
booleans — `true` / `false` / `false` — and answered the adjacent "no rule
declared" case with the SAME literal, so each permissive value was written
twice and nothing in the source said which of the two questions either copy
answered.
Zero behaviour change, and the values are untouched. Six module-private
constants now spell the two questions apart (`*_WHEN_FAULTED` vs
`*_WHEN_ABSENT`) and carry, in one place, what the direction is, that the
three faults compose rather than cancel, and what the history does and does
not record about why they point that way (objectui#1578 and ADR-0036 record
a per-key "a fault is safe" rationale; no commit puts the case where all
three faults arrive from one typo).
`evalFieldPredicate`'s docblock gains the call-site policy table: five
distinct fault policies share this one helper, two of which — `evalCel` and
`ExpressionEvaluator.evaluateCelCondition` under `throwOnError` — detect a
fault by calling it twice with OPPOSITE fallbacks, and therefore depend on
`fallback` staying freely specifiable.
Part of objectui#8069. Q2 (does the direction belong in the authored
contract) and Q3 (a loud-but-safe middle) stay undecided; no fallback value
moves here.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01611D6ZaRaMmwTNQmSbk8MH
* fix(core): a declared-but-blank field-rule predicate is no longer silent (objectui#8069)
`''` and `' '` are authorable — `ExpressionWireSchema` is a bare `z.string()`
with no `.min(1)`, and `resolveFieldRuleState`'s guard is `!= null`, so a blank
predicate passes both. `evalFieldPredicate` then returned the caller's
permissive fallback on its first line, BEFORE `warnPredicateFailure` or
`onFault` could fire.
That is a third state, not a spelling of either neighbour: the key is present
(so it is not "the author wrote no rule") and nothing evaluates (so no engine
fault is raised). The one state an author reaches by starting a rule and not
finishing it was the one state that said nothing at all — the exact silence
objectui#4051 / objectstack#5149 ruled out for every other fault.
Both spellings now report `[blank] the predicate is declared but empty —
nothing to evaluate` through the same single reporting site as every other
fault, on both channels (the built-in warning and the `onFault` passback, so
the fault-probing callers that pass `warn: false` are not silenced either).
Every verdict is unchanged, the envelope spelling included: `{ source: '' }`
used to reach the engine and come back "AST-only evaluation not yet supported;
persist `source`" and `{ source: ' ' }` "Unexpected token: EOF" — two
misleading reasons for one author mistake, both already resolving to the same
fallback this keeps.
Blankness is decided by `isBlankPredicateText` (`evaluator/declaredPredicate.ts`),
the repo's one definition of that question since objectui#3960, exported for
this second consumer rather than copied — a fourth local `trim()` here is the
drift it was consolidated to stop.
For this one fault class the once-per-predicate dedupe key joins the caller's
LOCATOR: a blank predicate has no distinguishing text, so every blank rule in
an app shares the key `""` and the first would silence every other author's.
Non-blank keys are unchanged.
Part of objectui#8069.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01611D6ZaRaMmwTNQmSbk8MH
* fix(core): the blank dedupe key reads an OPTIONAL `Expression['source']` (objectui#8069)
`tsc --noEmit` on a built workspace: `expr.source` is `string | undefined` in
the spec, so calling `.trim()` on it is TS18048. The absent case is blank by
the same rule as a whitespace-only one and lands in the same locator-joined
key shape.
Part of objectui#8069.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01611D6ZaRaMmwTNQmSbk8MH
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent 5b6deed commit 1bd79c8
4 files changed
Lines changed: 437 additions & 31 deletions
File tree
- .changeset
- packages/core/src/evaluator
- __tests__
| 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 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
248 | 248 | | |
249 | 249 | | |
250 | 250 | | |
251 | | - | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
252 | 257 | | |
253 | 258 | | |
254 | 259 | | |
255 | | - | |
256 | 260 | | |
257 | 261 | | |
258 | 262 | | |
| |||
356 | 360 | | |
357 | 361 | | |
358 | 362 | | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
28 | 36 | | |
29 | | - | |
| 37 | + | |
30 | 38 | | |
31 | 39 | | |
32 | 40 | | |
| |||
0 commit comments