Skip to content

fix(formula): a bare date ordering before a record. date arithmetic still slips past the flow-condition refusal (follow-up of #36333) #36377

Open

Description

@objectstack-fleet

repo:objectstack#4 · os-project-manager · session_01FEkQ5pb2t8Z8C64PkPyVt1

Follow-up of PR #36333 (#34946), carried from contract review 7076631700 S1 (should-fix, non-blocking) and its nits N1–N3. Filed under the maintainer's 2026-11-22 07:49Z rule that should-fix items go to their own card.

S1 (by code read, not yet run; measure first). A flow condition that orders a bare date field against a text literal AND-ed before a root read's date arithmetic, e.g. due_date > "2026-01-01" && record.due_date + 1 > 5, is accepted, though it faults on every run. In packages/formula/src/cel-engine.ts the bare pass meets the Timestamp-vs-string ordering first and confirmAgainstDateText stands it down; the record-root pass types bare names and roots together (buildTypedEnv(bareTypes, 'flattened', …)), meets the same ordering first, sees it is not isDateArith and answers null; recordRootDateTextIssue then asks recordRootReadsFaultDateArith, which types the roots alone, meets record.due_date + 1 first and stands down as "answered by firstTypeMismatch". All-root and all-bare spellings are refused; only the mixed one falls through. Not a regression (main accepts it too).
Fix direction from the review: when the root pass's first fault is not date arithmetic, also ask the roots-only typing, or have the stand-down ask firstTypeMismatch's actual answer.

Nits (same card, optional):

Done when: S1 measured; if confirmed, the mixed spelling is refused at os validate and the publish door like the other two, pinned with an ablation; nits pinned or split off. Narrowing (newly refused) ⇒ declare it as #36333 did.

Activity

  1. added
    priority:p2
    pm:queue
    domain:server
    on Nov 22, 2026
  2. objectstack-fleet commented on Nov 22, 2026

    @objectstack-fleet
    ContributorAuthor

    triage#1 · hotlong · session_01Q4EjjMnyLqJdzuktEmRPXH

    Triage: lands in domain:server (packages/formula flow-condition check) · pm:queue; rationale: area:build (writing metadata; it had no area) · Bug · a bare date ordered against a text literal AND-ed before a record. date arithmetic (due_date > "2026-01-01" && record.due_date + 1 > 5) is accepted though it faults on every run. By code read; measure first. Follow-up of #34946 → p2 as filed · size S.

  3. objectstack-fleet commented on Nov 22, 2026

    @objectstack-fleet
    ContributorAuthor

    triage#1 · hotlong · session_01Q4EjjMnyLqJdzuktEmRPXH

    Triage: lands in domain:server (packages/formula flow-condition check) · pm:queue; rationale: area:build (writing metadata; it had no area) · Bug · a bare date ordered against a text literal AND-ed before a record. date arithmetic (due_date > "2026-01-01" && record.due_date + 1 > 5) is accepted though it faults on every run. By code read; measure first. Follow-up of #34946 → p2 as filed · size S.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:builddomain:serverpm:queuepriority:p2

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions