Repository navigation
fix(formula)!: a flow condition's record. / previous. date arithmetic is refused as its bare name is - #36333
Conversation
… / previous. date arithmetic as refused like its bare name WIP: pins, ADR-0087 entry and changeset ahead of the implementation. Claude-Session: https://claude.ai/code/session_01FEkQ5pb2t8Z8C64PkPyVt1 Co-Authored-By: Claude <noreply@anthropic.com>
… takes the bare name's date-arithmetic verdict firstTypeMismatch's flattened record-root pass now answers date-arith for date/duration arithmetic against a number on a record.FIELD / previous.FIELD read, naming the root; typeSoundnessIssue gives a root read the row's arm. Claude-Session: https://claude.ai/code/session_01FEkQ5pb2t8Z8C64PkPyVt1 Co-Authored-By: Claude <noreply@anthropic.com>
📓 Docs Drift Check4 anchor(s) derived from 2 changed package(s); no hand-written page names any of them, so this run has nothing to list — not a clean bill of health. This check sees only pages that NAME a derived anchor: one that documents this change in prose, or enumerates it in an authoring dialect, names none and stays invisible to it on every run. What this run could not see
Coarse fallback — 175 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): Which tree this was computed onThis run read A worktree cut from an older # while this PR is open — GitHub drops the merge commit once it closes
git fetch origin 2496f6b3a24f91da5083d6381c0fe365ad30173b && git checkout 2496f6b3a24f91da5083d6381c0fe365ad30173b
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 3f7fdd002130a34ce24f735733c2642538914af9 f278fece6f2227841ace298611c7444c63319422 && git checkout -B drift-repro 3f7fdd002130a34ce24f735733c2642538914af9 && git merge --no-ff f278fece6f2227841ace298611c7444c63319422
node scripts/docs-audit/affected-docs.mjs --json 3f7fdd002130a34ce24f735733c2642538914af9 |
… date arithmetic; changeset narrowed, formula and spec minor Claude-Session: https://claude.ai/code/session_01FEkQ5pb2t8Z8C64PkPyVt1 Co-Authored-By: Claude <noreply@anthropic.com>
|
repo:objectstack#4 · os-project-manager · session_01FEkQ5pb2t8Z8C64PkPyVt1 Final head declared (area a4-B) · 2026-11-22T07:39Z:
|
|
repo:objectstack#4 · os-project-manager · session_01FEkQ5nbzs5iP1HcMCFhZo5 L1 verdict (L1-a): REWORK, one evidence item (no code) at head 席位核对Shape and gates:
Against the card. Its "Done when" is met.
R1 (must fix: the narrowing's battery is not pinned to this head).
Next. R1, with |
|
repo:objectstack#4 · os-project-manager · session_01FEkQ5pb2t8Z8C64PkPyVt1 Dogfood battery at the final head (area a4-B) · 2026-11-22T08:29Z: answers L1-a REWORK 7076065383 (R1, evidence only). Head unchanged:
|
|
repo:objectstack#4 · os-project-manager · session_01FEkQ5nbzs5iP1HcMCFhZo5 L1 verdict (L1-a): ACCEPT at head 席位核对R1 (full dogfood battery at the head): closed by 7076550688.
The full read in 7076065383 stands for everything else: the code, pins, ablations, declarations, the ADR-0087 entry and Next. Seat 7 runs the contract review (narrowing). Then the seat adds the four pieces and the maintainer merges. |
|
repo:objectstack#4 · os-project-manager · session_01FEkQ5pb2t8Z8C64PkPyVt1 Final head for seat 7 L2 · 2026-11-22T08:30Z: |
|
repo:objectstack#7 · zhuangjianguo · session_01QsR2jTeURPvEm465RcoYEC Contract-review-claim: session_01QsR2jTeURPvEm465RcoYEC · head f278fec · 2026-11-22T08:32Z |
|
repo:objectstack#7 · zhuangjianguo · session_01QsR2jTeURPvEm465RcoYEC Contract reviewServed-tier: Inputs: card #34946 with its 9 comments, PR #36333 body and 7 comments (no review, no inline comment), the net diff ① Derived judgments
② Semver level
③ Boundary flags
④ Design judgmentThe narrowing makes the spec's own refusal real; it takes no declared capability away. On Tried to break it:
S1 (should-fix) — non-blocking, carry on a follow-up card; it does not block this landing. A residual acceptance of the narrowed shape, by code read (not run; the follow-up measures it first). Source: a bare date field ordered against a text literal, AND-ed before a root read's arithmetic, i.e. Nits (no effect on correctness or the contract; accepted deviations or the same follow-up card):
No must-fix. One should-fix, S1, non-blocking and carried to a follow-up card by the landing seat. Implemented-by: VERDICT: PASS |
|
repo:objectstack#4 · os-project-manager · session_01FEkQ5krBqrrgxCYgjXmfbv 席位核对Awaiting the maintainer's merge (narrowing) · 2026-11-22T08:40Z · head
|
|
repo:objectstack#4 · os-project-manager · session_01FEkQ5pb2t8Z8C64PkPyVt1 Removed from the merge queue · 2026-11-22T08:54Z: the merge-group |
|
repo:objectstack#7 · zhuangjianguo · session_01QsR2jTeURPvEm465RcoYEC Contract reviewServed-tier: Delta record on the unchanged head, following the full record 7076631700. The head of PR #36333 is still ① Derived judgmentsUnchanged from 7076631700. ② Semver levelUnchanged from 7076631700. ③ Boundary flagsUnchanged from 7076631700. Nothing escalated. ④ Design judgmentS1: closed. It is carried by card #36377, and it was graded non-blocking in 7076631700. The code at this head is not changed: the mixed spelling (a bare date field ordered against a text literal, AND-ed before a root read's date arithmetic) is still accepted here, as it is on Nits N1, N2 and N3 are on #36377 as well, word for word in substance, marked optional. They stay accepted deviations at this head. No must-fix, no should-fix. Implemented-by: VERDICT: PASS |
…ite, and judges a flow condition only where the run binds the typed row (objectstack-ai#36340) <!-- claude-projects-attribution: {"github_login":"zhuangjianguo"} --> _Requested by **Steedos** · [project thread](https://claude.ai/code/project/chan_018ETKaNwMZCNRYD7D8Q9Ubb?thread=cmsg_018ETKaNwMZCNRYD7D8Q9UbbPgGMxS6cCEEprR4e3dQNe9)_ Fixes objectstack-ai#36167 This is the card's last item: the builder half (objectstack-ai#36185) and the validator half (objectstack-ai#36207) are merged, and the remaining follow-ups have their own cards (objectstack-ai#36217 skills text, objectstack-ai#36218 review follow-ups, objectstack-ai#36219 the as-you-type editor). Clause-②: yes (widening) Metadata-protocol: added Skills-docs: follow-up objectstack-ai#36217 ## 维护者速读 - 作者把多值字段(多选、多人等)与单个值比较相等时,系统给出的改写建议现在在每个位置都能用:共享规则条件里也能用,且建议本身加了括号,不会被前面的条件拆开;由接口、定时或无触发方式启动的流程里,这种写法不再被误拒。 - 属于「表达式校验与作者护栏」:上一个已合并的拉取请求开始拒绝这种写法,复审发现它给的改写在共享规则里无法生效、部分写法会报错,还会误拒正确的流程条件。 - 若出错,作者看到的只是另一种改写建议,或某个流程条件不再被拦下;本改动可以整体撤回,不影响已存储的数据。 - 无 ## What changes Follow-up to objectstack-ai#36207, which merged before its round-4 review findings were addressed. This PR covers four of them: r05 S1, r05 S2, r05 S4 / r06 N1, and r06 S1. **The prescribed rewrite is spelled for its site and parenthesised whole** (`listMembershipRewrite` in `packages/formula/src/validate.ts`). Each spelling below was measured on the site's own evaluator or filter compiler: | site | `==` rewrite | `!=` rewrite | |---|---|---| | a `record.` / `previous.` read evaluated as CEL (validation rule, field rule, formula, action `visible` / `disabled` / `pressed`, hook condition) | `(has(record.f) && record.f != null && "v" in record.f)` | `(!has(record.f) \|\| record.f == null \|\| !("v" in record.f))` | | a bare name at a flow condition (the run binds every declared field, `null` when empty) | `(f != null && "v" in f)` | `(f == null \|\| !("v" in f))` | | a sharing rule `condition`, compiled to a query filter (new `ExprSchemaHint.filterCompiled`, filled by the publish lint) | `(record.f != null && record.f.contains("v"))` | `(record.f == null \|\| !record.f.contains("v"))` | No single spelling works at every site, which is why the rewrite differs per site: - `"v" in record.f` does not lower to a filter. `compileCelToFilter` answers "`in` requires a field on the left (got literal)", so the sharing rule is dropped as `sharing-rule-unlowerable-condition`. - `has()` does not lower either ("unsupported operator call"). - On the CEL evaluator, `record.f.contains("v")` faults on a list, because there is no `list.contains` overload. - `record.f != null && "v" in record.f` faults on a row that lacks the key ("No such key"), which a sparse action row does. It also faults on a null `previous`, as on a create. The filter spelling lowers to `$and[{f:{$null:false}}, {f:{$contains:"v"}}]` and `$or[{f:{$null:true}}, {$not:{f:{$contains:"v"}}}]`. `$contains` on a JSON-stored (multi-value) column is membership in `matchesFilterCondition` and in driver-sql (`sql-driver-17590-json-column-membership.test.ts`). A number or boolean operand is passed as its text (`contains("3")`), since `$contains` compares text. The sharing-site message also says why `==` does not work there: the query filter refuses `$eq` against a list column. **A flattened (flow) site is judged only where the run binds a row of the typed object** (r06 S1). `checkListEquality` now returns early at a `'flattened'` site unless `faultOutcome` is `'run-fails'`. That outcome is declared only on a record-triggered flow, or on a time-relative sweep of the typed object: the lint's `faultOutcomeOf` ledger, `validate-expressions.ts` around line 1632. On any other flow (API, schedule, no trigger), the ledger's own row says the run "holds what its entrance handed it". `seedRunVariables` flattens whatever record that is. So an API flow whose request body carries a string `labels` runs `labels == 'frontend'` correctly, and objectstack-ai#36207 refused it. The MCP tool already passes this outcome for `flow_condition` (its default `triggerKind` is `record_change`). `registerFlow`'s advisory pass now passes it on the same flows (`runBindsTypedRow`, which this PR moves above the hint). Side effect: on those flows, the pass's logged type-mismatch lines take the `run-fails` wording that `os validate` already prints. It still only logs and never throws. **Docblocks (r05 S4 / r06 N1).** - `ExprSchemaHint.multiValueFields` now names the forms actually judged: - `record.f` / `previous.f` and the bracket spelling; - the optional spellings, which are refused as `invalid-cel` first; - the bare name, only at a flattened site with `run-fails`, excluding `flowVariables` and `bareNamesUnproven`; - comprehension-bound names, which are never the field. - `ExpressionRefusalParams['list-equality']` now documents `reference` (the bracket spelling renders `record.f`; a bare name is the bare name) and the per-site `rewrite`. **Semantic entry** `cel-list-equality-refused` now has the per-site replacement text and the narrowed surface. The surface adds the sharing rule condition and limits flows to the proven-row ones. ## Tests - `packages/formula/src/validate-list-equality-36167.test.ts` - New describe, "the prescribed rewrite tests membership where it is read". For each site class it takes the rewrite out of the refusal itself, pins its text, and runs it: - **CEL member read:** evaluated on rows `[a,b]` / `[b]` / `[]` / `null` / absent, and with `previous = null`. Each is also checked inside `record.name == 'x' && …`, `record.name == 'y' && …` and `false || …`, which pins the parenthesisation. - **Bare name:** evaluated with the row bound as top-level names. - **Filter:** lowered with `compileCelToFilter` and matched with `matchesFilterCondition` (with the column declared `tags`), including inside `&&`. - Each rewrite validates clean at its own site. - The CEL `in` form is shown not to lower. - New describe, "a flattened site with no proven row binding gets no verdict": bare and `record.` reads, `fail-closed` / `fail-open`, plus a proven-site control. - `packages/formula/src/expression-refusal-codes.test.ts`: the two `list-equality` PINS carry the new rewrites. Two new pins cover the bare name at a proven flattened site and the `filterCompiled` site, with params and the whole message. - `packages/lint/src/validate-expressions.list-equality-36167.test.ts`: - action `visible` rewrites pinned, and each validates clean; - a flow condition's bare `!=` rewrite pinned in the parenthesised form and accepted inside `stage == 'qa' && …`; - CONTROLS: an API, a trigger-less autolaunched and a scheduled flow get no list-equality, bare or `record.`; - new describe, the sharing rule `condition`: refused with the `contains` rewrite, and that rewrite draws no finding from the expression lint or from `validateSharingRuleEnforceability` (it lowers); - CONTROL: the CEL `in` forms draw `sharing-rule-unlowerable-condition` there. - `packages/services/service-automation/src/list-equality-advisory-36167.test.ts`: - `makeFlow` now states its trigger (`record-after-update`); - parenthesised bare rewrite pinned and not reported itself; - CONTROLS: API, scheduled and trigger-less flows report nothing; - premise: the bare rewrites answer per row on `evaluateCondition`, including `false && (…)`. - Two fixtures fixed at `254d40cb` (they had never run; each stopped before the behaviour it pins): - the sharing-rule describe in the lint pin built its rule with a recipient type the spec does not have (`role`) and no rule `type`, so all three cases failed at the spec-validity guard. It now uses `type: 'criteria'` and a `team` recipient, as the other spec-valid sharing fixtures do; - the API-flow CONTROL in the service-automation pin carried no hook secret, so `registerFlow` refused the flow before the advisory pass ran. It now names a `secretRef` (ADR-0041). - `packages/mcp/src/mcp-validate-expression.list-equality-36167.test.ts`: the `flow_condition` rewrite is pinned and validates clean. CONTROL: `triggerKind` `api` / `schedule` / `none` get no list-equality. ## Acceptance notes - **Clause ② for this diff: `yes (widening)`.** Two things widen: - it adds the optional public key `ExprSchemaHint.filterCompiled`; - flow conditions on API / scheduled / trigger-less flows are accepted again, after objectstack-ai#36207 refused them. Nothing in this diff refuses more. The changed rewrite text and the narrower flattened scope are not narrowings. `Metadata-protocol: added` because an accepted value is restored, so every package moved is `minor`. - The driver-sql leg of the filter rewrite is cited, not run here: `$contains` membership on a JSON column is pinned in `sql-driver-17590-json-column-membership.test.ts`, and `$not` is NULL-safe (objectstack-ai#5146). This PR measures the lowering and `matchesFilterCondition`. - Decision node `config.condition` in the lint: only the start node's gate and edge / branch conditions carry the flow's outcome. An inert node condition already has its own `flow-inert-node-condition` finding, and gets no list-equality verdict. - L2 S1 carried by objectstack-ai#36218 (scope !== 'record'); nits N1–N4 accepted. ## Verification Final head `254d40cb` (handover head `5a29954a` + `origin/main` merged at `2b570445` + the two fixture fixes). Every reading below is at that head. <details><summary>Package suites and pins</summary> - Build closure `--filter '@objectstack/lint^...' --filter '@objectstack/mcp^...' --filter '@objectstack/service-automation^...' --filter '@objectstack/scenarios^...' build`: lock VERDICT command-exit 0. Later a full `pnpm build --concurrency=2`: 120/120 tasks, VERDICT command-exit 0. - Pins: formula `validate-list-equality-36167` + `expression-refusal-codes` 250/250 (the 8 bare-name failures of the handover run are gone); lint `validate-expressions.list-equality-36167` 27/27 (3 failed before the fixture fix); mcp `mcp-validate-expression.list-equality-36167` 15/15; service-automation `list-equality-advisory-36167` 22/22 (1 failed before the fixture fix). - Full suites, one locked run, VERDICT command-exit 0: formula build + test 70 files / 2107 tests + typecheck exit 0; lint 225 files / 9434 tests + typecheck exit 0; mcp 83 files / 1467 tests + typecheck exit 0; service-automation 290 files / 4220 tests + typecheck exit 0; spec `src/migrations` 5 files / 198 tests. </details> <details><summary>Ablations (seven, each through ablation-replace WRAP mode under the lock)</summary> Each mutation was proven on disk (anchor 1 to 0, blob changed) and restored (blob equal to the HEAD blob, empty `git diff HEAD`). Every mutated module is read from source by its suite, so there is no dist leg. | ablation | file | pin result | |---|---|---| | delete the flattened proven-row early return | formula `validate.ts` | 5 failed / 245 passed (250) | | never take the `filterCompiled` spelling | formula `validate.ts` | 13 failed / 237 | | drop the outer parentheses of the `!=` member-read rewrite | formula `validate.ts` | 6 failed / 244 | | drop `has()` from the `==` member-read rewrite | formula `validate.ts` | 4 failed / 246 | | lint passes no `filterCompiled` at the sharing rule | lint `validate-expressions.ts` | 2 failed / 25 (27) | | service-automation always declares `run-fails` | `flow-registration-checks.ts` | 3 failed / 19 (22): the API, scheduled and trigger-less CONTROLS | | service-automation never declares `run-fails` | `flow-registration-checks.ts` | 5 failed / 17 (22) | </details> <details><summary>Derived gates</summary> - `dispatch-gates --commands` at `254d40cb`: 96 families. `dispatch-gates --ran` with recorded exit codes: 96 derived, 96 run, 0 NOT-MEASURED (a derived zero), every family exit 0. - Three needed a prerequisite first and were re-run: `check-plugin-teardown-shape --self-test` (exit 3 on the shallow clone until its pinned fixture commit was fetched, then exit 0); the cli `migrate-meta-engine-guidance` vitest (exit 1, MODULE_NOT_FOUND on an unbuilt `@objectstack/mcp` dist, then 3/3 after the full build); `check:dual-build-cjs-loads` (exit 3 PREREQUISITE NOT MET, then exit 0 after the full build: 124 require entry points across 72 packages load). - `check:type-check-debt` exit 0. `check:nul-bytes` OK. `overlap-check` VERDICT clean exit 0 against `origin/main` `2b570445` and objectstack-ai#36333 (shares `validate.ts`, merges cleanly). - CI at `254d40cb`: all 69 check-runs completed, every one success or skipped (Check Changeset, PR-body guards, Governed Surface Queue Guard, every Lint and Type Check lane, Test Core 10/10 shards, Test UI 16/16, Build Core, Dogfood Regression Gate). - `test:repo` was not run locally (the diff touches no repo-project test); CI's Test Core ran it. </details> Dogfood battery: n/a (no `!` in the title, and `Clause-②: yes (widening)` has no `(narrowing)` arm). Two-minute check: `pnpm --filter @objectstack/formula exec vitest run src/validate-list-equality-36167.test.ts`. Expected: every test passes, including the "prescribed rewrite" and "no proven row" describes. Read first, by risk: 1. `packages/formula/src/validate.ts`: `listMembershipRewrite` and the early return in `checkListEquality`. 2. `packages/services/service-automation/src/flow-registration-checks.ts`: `faultOutcome` on the advisory hint. 3. `packages/lint/src/validate-expressions.ts`: the sharing-rule `check(…, true)`. --- 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01QsR2jVXKcrF3rr7ShYFZ9E <!-- signed: repo:objectstack#7 · zhuangjianguo · session_01QsR2jVXKcrF3rr7ShYFZ9E --> --------- Co-authored-by: Claude <noreply@anthropic.com>
Requested by Leehom · project thread
Fixes #34946
Clause-②: no (narrowing)
Metadata-protocol: narrowed
Skills-docs: none —
skills/objectstack-formula/SKILL.mdalready states "No date arithmetic. The build refusesdate + nandend - start" and names no site it is limited to, so it now holds for a flow condition'srecord.FIELD/previous.FIELDreads as writtenrepo:objectstack#4 · os-project-manager · session_01FEkQ5pb2t8Z8C64PkPyVt1
维护者速读
What changes
A flow condition (start, edge,
decisionbranch) is evaluated over a scope where the run's row is bound twice: its fields flattened to bare names, and the row itself asrecord(with the row before the write asprevious). The date-arithmetic verdict typed the bare names only.firstTypeMismatch's flattened record-root pass typedrecord.FIELD/previous.FIELDbut kept only the text/boolean mismatch, sorecord.due_date + 1 > 5passed whiledue_date + 1 > 5was refused, and both fault at run time on theYYYY-MM-DDtext on every run.Measured through
validateStackExpressions(theos validatebody) on a record-triggered flow (record-after-update), objectlibrary_loanwithdue_date: dateandpicked_up_at: datetime(bothrequired), start condition:origin/main28ba01f)due_date + 1 > 5google.protobuf.Timestamp + int,due_daterecord.due_date + 1 > 5record.due_datenamedprevious.due_date + 1 > 5previous.due_datenamedpicked_up_at + 1 > 5(CONTROL, datetime)picked_up_atrecord.picked_up_at + 1 > 5(CONTROL)previous.picked_up_at + 1 > 5(CONTROL)record.due_date < today()(CONTROL)timestamp(record.due_date) < now()(CONTROL, date-text)The datetime control: a
datetimefield is a Timestamp in the type check exactly as adatefield is, and its bare name already took the date-arithmetic verdict, so its root reads now take that verdict too, word for word with the reference swapped. That is the dispatch's control ("keep whatever verdict the bare name gets for a datetime").packages/formula/src/cel-engine.ts,firstTypeMismatch: the record-root pass now answerscategory: 'date-arith'when its first operator fault is date/duration arithmetic against a number (isDateArith), withfieldandrootfromoffendingRecordRead(…, 'timestamp'). The text/boolean branch is unchanged. The comment that said thedate-arithverdict "stays the bare name's alone" is corrected, and therootfield's doc andrecordRootReadsFaultDateArith's doc say the root read is answered there too.packages/formula/src/validate.ts,typeSoundnessIssue: a root read's date verdict takes the row's arm (dateArmwithbareNamesUnprovenfalse), as the root read's type mismatch (lint: a flow condition's bare-name type verdict ignores names a screen node or an open binder (script, connector_action, wait, subflow, map) binds, so a record-triggered flow can be refusedtype-mismatch-run-failson a name that holds the bound value #30025) and date-text verdicts (recordRootDateTextIssue) already do. Sorecord.due_date + 1 > 5staysdate-arithmetic-run-failswhere bare names are unproven or a flow variable shadowsdue_date. The bare name's arm is unchanged.recordRootDateTextIssueruns only whenfirstTypeMismatchanswers null, and it already stood down on this exact shape (recordRootReadsFaultDateArith). The a flow condition passes timestamp(record.<date field>) while the same call over the bare name is refused: record.FIELD reads are not typed for the date-text verdicts there #34662 date-text pins are green and unchanged.packages/spec/src/migrations/entries/semantic/18.flow-condition-record-date-arithmetic-refused.ts: the ADR-0087 semantic entry (a structured TODO; no mechanical rewrite, since a span in days and a shifted date are different intents), modelled on18.cel-list-equality-refused.ts..changeset/34946-flow-record-date-arithmetic.md:minorfor@objectstack/formulaand@objectstack/spec(Metadata-protocol: narrowedgradesminor; spec ships the new ADR-0087 entry in its generated migration registry), the declaration lines, the BREAKING banner, a FROM to TO table, andadr-0087: registered flow-condition-record-date-arithmetic-refused.Reach (the dispatch asked to stop if the narrowing reached beyond flow conditions): the flattened scope is used only by flow conditions.
@objectstack/lintpasses it for start, edge anddecisionconditions,@objectstack/service-automation'sregisterFlow(advisory only) and the MCPvalidate_expressiontool'sflow_conditionsite. Formula fields, validation rules, hooks and actions arerecord-scoped, whererecord.due_date + 1was already refused (date-arithmetic,-fail-closed,-fail-open). No widening was needed.Tests
packages/formula/src/validate.test.ts, new top-level describe (a flow condition passes record.<date field> + 1 while the same arithmetic over the bare name is refused: the date-arithmetic verdict is not applied to record./previous. reads #34946):record.andprevious.date arithmetic refused underdate-arithmetic-run-failswith full params (operands,referencenaming the read), and the evaluator faults on them over the run's scope. CONTROL: the datetime field's root reads equal the bare name's verdict. Arms:run-may-failwith no declared outcome,run-failskept on a root read when bare names are unproven or shadowed. CONTROL:record.due_date < today(),previous.due_date < today(),date(record.due_date) < now()and the prescribed rewrites (daysBetween(record.due_date, today()) > 5,addDays(record.due_date, 1) < today(),addDays(previous.due_date, -7) < today()) are clean. The date-text shapes keep their one finding (date-text-call-run-fails,date-text-arithmetic-run-fails) andrecord.title > 5keepstype-mismatch-run-fails.packages/lint/src/validate-expressions.test.ts, new top-level describe: start, edge anddecisionconditions refuserecord./previous.at the bare name's path and severity, with the bare name's message and the reference swapped. Reported underexpression-invalidthroughrunAuthoringRules('build', …), the rule body the runtime publish door runs. CONTROL: datetime root reads equal the bare name's findings at all three sites;record.due_date < today()stays clean;timestamp(record.due_date) < now()keeps exactly one date-text finding.packages/services/service-automation/src/flow-registration-schema-e2e.test.ts, new top-level describe:registerFlowlogs the date-arithmetic advisory forrecord./previous.as for the bare name and still registers. CONTROL: an ordering againsttoday()is not advised.packages/runtime/src/domains/meta-flow-condition-record-date-text.test.ts, new top-level describe (a flow condition passes record.<date field> + 1 while the same arithmetic over the bare name is refused: the date-arithmetic verdict is not applied to record./previous. reads #34946, added atf278fece6f): the publish door (publishMetaItemover the realObjectQLengine) refuses the bare name,record.due_dateandprevious.due_datedate arithmetic withINVALID_METADATA/ 422 and one date-arithmetic issue naming the read, leaving the item draft. CONTROL: a datetime field's root reads take the same refusal;record.due_date < today()publishes and goes active. The loan fixture gains one requireddatefielddue_date. Runs atf278fece6f: 4/4 passed; ablating the cel-engine record-rootisDateArithbranch turns exactly the 2 new tests red, restored to the HEAD blob withgit diff HEADempty andablation-dist-preflight --absentclean.Publish door, first measured on head 4426723 as a scratch copy of the same rig (now committed as the pin above):
due_date + 1 > 5INVALID_METADATA/ 422expression-invalid,due_daterecord.due_date + 1 > 5INVALID_METADATA/ 422expression-invalid,record.due_dateprevious.due_date + 1 > 5INVALID_METADATA/ 422expression-invalid,previous.due_datepicked_up_at + 1 > 5(CONTROL)INVALID_METADATA/ 422expression-invalid,picked_up_atrecord.picked_up_at + 1 > 5(CONTROL)INVALID_METADATA/ 422expression-invalid,record.picked_up_atprevious.picked_up_at + 1 > 5(CONTROL)INVALID_METADATA/ 422expression-invalid,previous.picked_up_atrecord.due_date < today()(CONTROL)At
f278fece6f(the patch round: changeset regrade and the runtime pin): runtime pin 4/4 and its ablation as above;dispatch-gates --commands98 families derived (one more than at 4426723:check:route-envelope); the families for the changed paths (check-adr-0087-registration,check-changeset-no-major,check-empty-changeset,check:cross-package-test-inputs,check:test-source-alias,check:tier-file-adoption,check:route-envelope) exit 0;overlap-checkclean. The runs below and the dogfood battery are from 4426723; the patch round changed only the changeset and a runtime test file.Local runs (head 4426723)
All under
scripts/pm/os-verify-lock.sh, exit codes captured before any pipe:pnpm --filter @objectstack/formula buildexit 0;pnpm --filter @objectstack/formula testexit 0, Test Files 70 passed (70), Tests 2067 passed (2067);pnpm --filter @objectstack/formula typecheckexit 0 (test layer: 7 errors held intest-typecheck-debt.json, unchanged).pnpm --filter @objectstack/lint exec vitest run --maxWorkers=2 src/validate-expressions.test.tsexit 0, Tests 529 passed (529).pnpm --filter @objectstack/service-automation exec vitest run --maxWorkers=2 src/flow-registration-schema-e2e.test.tsexit 0, Tests 7 passed (7).pnpm --filter @objectstack/spec exec vitest run --maxWorkers=2 src/migrationsexit 0, Test Files 5 passed (5), Tests 198 passed (198) (spec built with the new entry;gen:migration-registryruns in its build).node scripts/pm/dispatch-gates.mjs --commandsderived 97 families for this diff; all 97 run locally, reconciled with--ran: "97 derived, 97 run, 0 NOT-MEASURED, 0 UNRUN".pnpm check:dual-build-cjs-loadsfirst answered PREREQUISITE NOT MET (exit 3, no full build yet), then exit 0 aftercheck:type-check-debtbuilt the tree; every other family exit 0 on the first run.!title), on head 4426723:pnpm --filter @objectstack/dogfood testunder the lock, VERDICT command-exit 0, Test Files 484 passed, 3 skipped (487), Tests 4107 passed, 68 skipped (4175), no failure.test:repo(vitestrepoproject) not run locally: the diff touches none of its tests; it is CI's (Test Core).Ablations (each committed first, mutated through scripts/ablation-replace.mjs, restored to the HEAD blob)
isDateArithbranch of the record-root pass (packages/formula/src/cel-engine.ts). Anchorif (rootTyped && isDateArith(rootTyped)) {replaced by a never-true guard carryingABLATED_34946(anchor 1 to 0, blob8eb099d83f32to4975d5dd3077), formula rebuilt,ablation-dist-preflight.mjs @objectstack/formula ABLATED_34946exit 0 (the marker reacheddist/, which the lint and service-automation suites read). Red: formulavalidate.test.ts3 failed / 236 passed (the three a flow condition passes record.<date field> + 1 while the same arithmetic over the bare name is refused: the date-arithmetic verdict is not applied to record./previous. reads #34946 verdict tests; the CONTROL for orderings and date-text stayed green), lint 5 failed / 524 passed (all five non-ordering a flow condition passes record.<date field> + 1 while the same arithmetic over the bare name is refused: the date-arithmetic verdict is not applied to record./previous. reads #34946 tests), service-automation 1 failed / 6 passed (the advisory test). Restored: blob back to8eb099d83f32=HEAD:packages/formula/src/cel-engine.ts,git diff HEADempty, rebuilt, preflight--absentexit 0, lint 529/529 again.typeSoundnessIssue(packages/formula/src/validate.ts). AnchordateArm(scope, faultOutcome, mismatch.root !== undefined ? false : bareNamesUnproven)replaced bydateArm(scope, faultOutcome, bareNamesUnproven ...)(blobaeedf005910etob35d7d64bb2a). Red: formulavalidate.test.ts1 failed / 146 passed, the arm test (record.due_date + 1 > 5under unproven bare names). Restored: blobaeedf005910e= HEAD,git diff HEADempty, 147/147.Acceptance notes
due_date + 1 > 5 && record.due_date + 1 > 5), the first (bare) verdict is reported, atdate-arithmetic-run-may-fail. Still an error; the swap-to-the-root-read steptypeSoundnessIssuedoes for a bare type mismatch was not extended to the date verdict.offendingRecordReadnames the firsttimestampfield read through a root, in field-map order.Metadata-protocol: narrowedwith aminorchangeset (regraded atf278fece6f).record.date arithmetic still passes; measured first on that card) and nits N1–N3.Verification
Read first, by risk:
packages/formula/src/cel-engine.ts, the newisDateArithbranch offirstTypeMismatch's record-root pass (the narrowing itself).packages/formula/src/validate.ts, thedateArmcall intypeSoundnessIssue(the root read's arm).packages/spec/src/migrations/entries/semantic/18.flow-condition-record-date-arithmetic-refused.ts(the upgrade-guide text).Two-minute check:
pnpm --filter @objectstack/formula exec vitest run --maxWorkers=2 src/validate.test.ts -t 34946shows 4 passing tests.Generated by Claude Code