@@ -440,9 +440,10 @@ const DATE_FAIL_CLOSED_CLAUSE =
440440 * (`date − date + 1`, `today() + 30`) — always faults at runtime and never
441441 * recovers, so it blocks the build. A formula reads that fault as null; a
442442 * flattened (flow) condition's fault fails the run, under the
443- * `date-arithmetic-run-fails` / `-run-may-fail` codes (#30016), and a
443+ * `date-arithmetic-run-fails` / `-run-may-fail` codes (#30016), a
444444 * fail-closed site's refuses the write, under `date-arithmetic-fail-closed`
445- * (#30250, {@link dateArm}).
445+ * (#30250), and an advisory rule's skips the rule, under
446+ * `date-arithmetic-fail-open` (#30494, {@link dateArm}).
446447 * - `type-mismatch` (**warning**): a text/boolean field used with an
447448 * arithmetic/ordering operator against a number — nulls unless the text value
448449 * happens to be numeric, so it stays advisory. An **error** where the caller
@@ -611,25 +612,32 @@ function typeSoundnessIssue(
611612 * where it holds the date: `run-may-fail`. A `record`-scoped site that fails
612613 * closed (`faultOutcome: 'fail-closed'`: an `error` validation rule, a field
613614 * write rule, an option `visibleWhen`, a hook `condition`) refuses the write
614- * on the fault: `fail-closed` (#30250). An advisory rule (`fail-open`) keeps
615- * the null sentence. The grade stays an error everywhere.
615+ * on the fault: `fail-closed` (#30250). An advisory rule (`faultOutcome:
616+ * 'fail-open'`) is skipped on the fault and the write proceeds: `fail-open`,
617+ * the `type-mismatch-fail-open` clause (#30494). The grade stays an error
618+ * everywhere.
616619 */
617- type DateArm = 'run-fails' | 'run-may-fail' | 'fail-closed' ;
620+ type DateArm = 'run-fails' | 'run-may-fail' | 'fail-closed' | 'fail-open' ;
618621function dateArm (
619622 scope : 'record' | 'flattened' ,
620623 faultOutcome : ExprSchemaHint [ 'faultOutcome' ] ,
621624 bareNamesUnproven : boolean | undefined ,
622625) : DateArm | null {
623- if ( scope !== 'flattened' ) return faultOutcome === 'fail-closed' ? 'fail-closed' : null ;
626+ if ( scope !== 'flattened' ) {
627+ return faultOutcome === 'fail-closed' || faultOutcome === 'fail-open' ? faultOutcome : null ;
628+ }
624629 return faultOutcome === 'run-fails' && ! bareNamesUnproven ? 'run-fails' : 'run-may-fail' ;
625630}
626631
627632/**
628- * [#30016, #30250] The fault clause of a date verdict whose fault does not read
629- * null; `held` names what a flow condition's field holds at run time.
633+ * [#30016, #30250, #30494] The fault clause of a date verdict whose fault does
634+ * not read null; `held` names what a flow condition's field holds at run time.
635+ * An advisory rule's is the type mismatch's own `fail-open` clause, word for
636+ * word: one outcome, one sentence.
630637 */
631638function dateArmFault ( arm : DateArm , ref : string | null , held : 'date' | 'text' ) : string {
632639 if ( arm === 'fail-closed' ) return `this faults at runtime, and here ${ DATE_FAIL_CLOSED_CLAUSE } ` ;
640+ if ( arm === 'fail-open' ) return `this faults at runtime, and here ${ TYPE_MISMATCH_FAULT_ARMS [ 'fail-open' ] . clause } ` ;
633641 const fails =
634642 'a flow condition that cannot be evaluated fails the run: the flow stops at this condition and the ' +
635643 'work the flow exists to do is not done (it does not read null).' ;
@@ -645,8 +653,9 @@ function dateArmFault(arm: DateArm, ref: string | null, held: 'date' | 'text'):
645653 * - `date-text-arithmetic`: arithmetic on that text the evaluator faults on —
646654 * `record.end_date - record.start_date` (either field kind), `record.d -
647655 * duration('24h')` — so the expression reads null (in a flow condition the
648- * run fails instead, and on a fail-closed site the write is refused:
649- * `flowArm`, #30016, #30250). Any role.
656+ * run fails instead, on a fail-closed site the write is refused, and on an
657+ * advisory rule the rule is skipped: `flowArm`, #30016, #30250, #30494).
658+ * Any role.
650659 * - `date-duration-value`: a formula (`value` role) that computes a
651660 * `google.protobuf.Duration` — `today() - record.start_date` — which a field
652661 * serialises as `{}`. A predicate that COMPARES a duration
0 commit comments