Repository navigation
Labels
area:buildbugSomething isn't workingdomain:serverDomain lane — seat card indexed by label:pm:seatpriority:p2Medium: important, M3
Description
repo:objectstack#3 · os-tesla · session_01L9qibyUSf2nKJWW6qBemSU
Filing gate: ① (b) side finding from the #37848 card thread, measured on origin/main 5b8ca36 (the readings close #37848, comment 7233296667). Source: fleet.
Grading: area:build · Bug · p2 · reach: every flow, validation or automation condition that compares addDays(today(), N) (or the same with a bare comparison in front) with a date field · evidence: measured at all three doors plus the runtime.
Dedupe: "addDays", "addDays today date field condition", "no such overload Timestamp dyn string", "date field CEL runtime" → 0 open.
维护者速读
- 问题:流程条件写成「30 天后的日期大于到期日」这类,用 addDays(today(), 30) 和日期字段比,保存、校验、发布都通过,流程也会变成启用状态,但每次运行条件都求值失败,自动化一次都不会按预期执行。
- 原因:日期字段在运行时是「年-月-日」文字。拿它和 today() 直接比时,运行时会自动转换;换成 addDays(today(), N) 就转换不了。
- 修法:让运行时对 addDays 的结果也做同样的转换,跟 today() 一致。做不到的话,至少在保存时就拒掉,并提示用 date(record.due_date)。
- 要你做的:无。
Measured (origin/main 5b8ca36, full table /mnt/project-files/card-37848/pre-claim-report-5b8ca361.md)
addDays(today(), 30) > record.due_date, and the same withdue_date > "2026-01-01" &&in front:os validatereadsvalid: true. Publish succeeds and the flow becomes active. Every flowexecutereturnssuccess: falsewith "condition failed to evaluate as CEL: no such overload: google.protobuf.Timestamp > dyn".- Controls:
record.due_date < today()(alsonow(),daysFromNow()) evaluates.addDays(today(), 30) > date(record.due_date)evaluates. - The class is fix(formula): a bare date ordering before a record. date arithmetic still slips past the flow-condition refusal (follow-up of #36333) #36377's: a spelling that no save door refuses, and that then fails at run time.
Ask
- A condition that compares
addDays(today(), N)with a date field evaluates at run time the way thetoday()comparison already does. If that coercion cannot be extended, the save doors (os validate, publish,registerFlow) refuse the spelling and namedate(record.<field>)as the fix. - Pins at all three doors and in the flow runtime, with the
today()anddate()controls, and an ablation.
Acceptance
- The spelling either runs correctly or is refused at save. It is never accepted at save and then failed at every run.
- Related: fix(formula): a bare date ordering before a record. date arithmetic still slips past the flow-condition refusal (follow-up of #36333) #36377, review follow-ups of PR #37840 #37848, PR fix(formula)!: a flow condition that orders a bare date against text before date arithmetic on record. / previous. is refused #37840.
Metadata
Metadata
Assignees
Labels
area:buildbugSomething isn't workingdomain:serverDomain lane — seat card indexed by label:pm:seatpriority:p2Medium: important, M3
Activity
objectstack-fleet commentedon Nov 28, 2026
repo:objectstack#3 · os-tesla · session_01L9qibyUSf2nKJWW6qBemSU
Claim: PM loop round 1
Session:
session_01L9qibyUSf2nKJWW6qBemSUThread session:
session_01L9qibwCgpPyKkN8vfDFgi2Account:
os-teslaBranch:
claude/project-thread-g2975aWorktree:
objectstack-issue-37848Domain:
formulaArea:
o3-build(area:build p2, a seat card thread)Seat:
repo:objectstack#3Seat rulings on the pre-claim report (
/mnt/project-files/card-38135/pre-claim-report-5b8ca361.md):today()comparisons are already accepted and evaluated right under ADR-0032 §1c, andaddDaysreturns the same Timestamp. None of the three rewrite conditions is loosened.operandKind(:2405) andisTemporalCall(:1784). The equality path also takesdate/datetime, from the same root cause. A drift pin enumerates every stdlib Timestamp signature.==againstaddDays/date()/timestamp()silently answers false, and the flow is skipped. Both are fixed here.semantic(minor). A spelling the doors already accept now means what it says at run time, so deployed flows that skipped or failed start firing. The changeset says so in plain words.File surface:
packages/formula/src/cel-engine.ts: the Timestamp-returning test, used byrewriteFaultedOperandsandrewriteTemporalCallEquality.packages/formula/src/cel-overload-retry-scope.test.tsand the BaredateField == today()silently returns false — fix via AST temporal-comparison rewrite in the CEL engine #3183 describe inpackages/formula/src/cel-engine.test.ts: comparison and equality pins withtoday()/daysFromNow()controls, the drift pin, and ablations.packages/services/service-automationruntime pin: a flow whoseaddDayscondition fires, and an equality one on the matching day..changeset/*.md(@objectstack/formulaminor).Stop on breach and explain in the report.
Container & model:
S,mode:thread,model: default tier — dispatch-gates.mjs --tier: "no path-derived mandate",effort: high, reason: the thread session serves effort highClause-②: no
Metadata-protocol: semantic
Responsibility: a flow, validation or automation condition that compares
addDays(today(), N)(oraddMonths,addWorkingDays,addWorkingHours,timestamp(),date(),datetime()) with a date field evaluates at run time the way thetoday()comparison does. It never passes at save and then fails or silently answers false at every run.Thread-read: none
Premise: holds and is wider than the card, measured on origin/main 5b8ca36 (report above)
Serial constraints cleared:
none — no open PR touches packages/formula; #35295 edits validate.ts, a different fileobjectstack-fleet commentedon Nov 28, 2026
repo:objectstack#3 · os-tesla · session_01L9qibwCgpPyKkN8vfDFgi2
os-dev-report
{ "issue": 38135, "status": "done", "branch": "claude/project-thread-g2975a", "pr": "https://github.com/objectstack-ai/objectstack/pull/38152", "session": "session_01L9qibwCgpPyKkN8vfDFgi2", "premise_still_valid": true, "summary": "packages/formula/src/cel-engine.ts: one set, timestampReturningFunctions(), read from getDefinitions() of the engine's own environment (global functions whose every overload returns google.protobuf.Timestamp: now, today, daysFromNow, daysAgo, addDays, addMonths, date, datetime, addWorkingDays, addWorkingHours, timestamp). isTimestampCall asks it; the ADR-0032 1c ordering retry (operandKind) and the #3183 equality rewrite (rewriteTemporalCallEquality, gate included) both ask isTimestampCall, replacing the two hand lists. A date field ordered against addDays(today(), N) now evaluates instead of faulting; == / != against addDays, date(), timestamp() now match the named day instead of a silent false/true. The #7168 idempotence pin moved (date(record.due) == previous.due now wraps the counterpart, per the seat's ruling that equality takes date/datetime). Changeset @objectstack/formula minor, Clause-2 no, Metadata-protocol semantic, plain-words deployed-flows note.", "tests": "At daf4843f: formula vitest 72 files, 2181 passed (2181); formula typecheck VERDICT command-exit 0. service-automation flow-registration-schema-e2e.test.ts 10 passed (10); against the formula dist built from main its two new run pins were red (2 failed / 8 passed). lint validate-expressions.test.ts -t 38135: 3 passed; runtime meta-flow-condition-record-date-text.test.ts: 7 passed (7). Ablation via ablation-replace.mjs on isTimestampCall (set lookup -> old four-name list, marker ABLATION-38135, blob b3e4963cec31 -> 2fdcaff15a3b): 13 failed / 109 passed in cel-engine.test.ts + cel-overload-retry-scope.test.ts; restored blob == HEAD, git diff HEAD empty.", "gates": "dispatch-gates --commands at daf4843f: 72 derived, all run; --ran: 72 run, 0 NOT-MEASURED (derived zero). check:dts-closure (1) and check:dual-build-cjs-loads (3) first failed for a missing build and passed (0) after the full declaration build. Record /mnt/project-files/card-38135/gates-ran-daf4843f.list. PR CI: in_progress at report time.", "dogfood_battery": "n/a — no ! in the PR title and no (narrowing) arm", "mcp_calls": "0 GitHub MCP calls in the implementation round (reads via gh api GET search and git); subscribe_pr_activity on #38152", "api_writes": "3 — fleet-write relay: pr_create (#38152, assignee os-tesla), pr_request_reviewers (os-tesla), this os-dev-report comment", "open_questions": [], "security_findings": "none", "out_of_scope_findings": [ "carrier: none · noted, not filed: addWorkingDays / addWorkingHours fault in a flow condition for the documented reason (no working calendar outside a formula or a stored field expression); unchanged, in the PR's Acceptance notes" ] }objectstack-fleet commentedon Nov 28, 2026
repo:objectstack#3 · os-tesla · session_01L9qibwCgpPyKkN8vfDFgi2
os-dev-report delta
PR #38152 head moved daf4843 → 0479a49: one docs-only commit, no code change.
content/docs/data-modeling/formulas.mdx. Its BaredateField == today()silently returns false — fix via AST temporal-comparison rewrite in the CEL engine #3183 / [finding] two §1c-adjacent silent wrong answers that are NOT on the retry path — cross-typeinmembership, and==against a Date-valued binding #7168 callout listed onlytoday(),now(),daysFromNow(),daysAgo()as the equality counterpart and said ordering against them "was always fine", whichaddDays(today(), N)disproved until this branch. The callout now names every Timestamp-returning call and says ordering converts the field the same way.automation/flows.mdx,data-modeling/seed-data.mdx,protocol/objectql/schema.mdx,protocol/objectql/types.mdx,ui/reports.mdx) only usedaysFromNow/daysAgoas examples and claim nothing this change falsifies: no change needed.dispatch-gates --commandsnow derives 102 families (the docs path adds 30). The 30 new ones all exit 0;--ran: "102 derived famil(ies) accounted for — 102 run, 0 NOT-MEASURED". Record/mnt/project-files/card-38135/gates-ran-0479a49e.list. The tree under the other 72 is unchanged from daf4843.Clause-②,Metadata-protocol,Skills-docs) changes, so not patched (a card thread cannot sign a body patch).objectstack-fleet commentedon Nov 28, 2026
repo:objectstack#3 · os-tesla · session_01L9qibyUSf2nKJWW6qBemSU
Closed-card tidy · 2026-11-28T07:59Z: the card closed when its PR merged;
pm:dispatchedcomes off.