Repository navigation
fix(formula)!: a flow condition that orders a bare date against text before date arithmetic on record. / previous. is refused - #37840
Conversation
…t text before date arithmetic on its record. read The bare pass and the record-root pass both met the bare Timestamp-vs-text ordering first and stood it down, and the record-root date-text pass stood down because the roots' own typing met date arithmetic first, a shape it read as answered by firstTypeMismatch. That pass is only reached where firstTypeMismatch answered null, so the stand-down could only ever drop a fault nobody else refused. Drop it (and its now-unused predicate); the mixed spelling takes the all-root spelling's date-text-arithmetic verdict. Claude-Session: https://claude.ai/code/session_01L9qibz2oLCRAYBpwsBBUyG Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L9qibz2oLCRAYBpwsBBUyG Co-authored-by: Claude <noreply@anthropic.com>
…n the Skills-docs line Claude-Session: https://claude.ai/code/session_01L9qibz2oLCRAYBpwsBBUyG Co-authored-by: Claude <noreply@anthropic.com>
📓 Docs Drift Check5 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 — 178 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 85c63b5b2f987fe28711eb6a7e0926ed8a89f08f && git checkout 85c63b5b2f987fe28711eb6a7e0926ed8a89f08f
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 1028438748dfbb6a76a981a25310fe39c481fb2c 8ca7780c1a863d26cc9ca028d51be5aeb69514e9 && git checkout -B drift-repro 1028438748dfbb6a76a981a25310fe39c481fb2c && git merge --no-ff 8ca7780c1a863d26cc9ca028d51be5aeb69514e9
node scripts/docs-audit/affected-docs.mjs --json 1028438748dfbb6a76a981a25310fe39c481fb2c |
|
repo:objectstack#3 · os-tesla · session_01L9qibwSEecrzDjKjbk24r1 Contract-review-claim: session_01L9qibwSEecrzDjKjbk24r1 · head 8ca7780 · 2026-11-27T06:33Z L1-a (the seat's L1 thread) runs the isolated |
|
repo:objectstack#3 · os-tesla · session_01L9qibwSEecrzDjKjbk24r1 Contract reviewServed-tier: Inputs: card #36377 (body and its 4 comments: two triage notes, the claim 7210742031, the os-dev-report 7211625108; no earlier record or ruling on this card), PR #37840 body, file list (7 files) and net diff against Check-runs on the head when read: none failed. Success: Check Changeset, Check PR Size, Dogfood Regression Gate, Governed Surface Queue Guard, Lint · PM dispatch-gates, Lint · scoped · tooling self-tests, PR-body guards, Spec property liveness, Type Check · source gates, Flag docs affected by code changes, Plan Test Core shards, Plan Test UI shards, Auto Label, filter. Skipped by their own conditions: 10 (opt-in harnesses, Build Docs, Queue verdict, Temporal Conformance and the like). STILL PENDING, so not judged here: Test Core 1/10 to 10/10, Build Core, Build UI Deps, Live E2E UI, Type Check · workspace, Type Check · consumer gates, Type Check · debt ledger, Lint · ESLint, Lint · CI, release & engine gates, Lint · docs & code guards, Lint · repo & tooling gates, Lint · scoped · query-options erasure, Lint · scoped · slot lookup & corpus. The new pins in this diff run in Test Core, so their gate verdict is not in yet; this record judges the design and the declaration, and landing still waits on those runs. The PR is a draft. ① Derived judgments
② Semver levelClause-②: no (narrowing) — present line-initial in the PR body and in the changeset, with The changeset sets ③ Boundary flags
④ Design judgmentDoes the narrowing take a declared capability away, or make the spec's own refusal real? The second. Nothing published on Attempts to break it, all by code read:
No must-fix, no should-fix. Nits (none moves the verdict; a fix belongs on the prose faces only, or in a follow-up card, since any other fix moves the head and this record stops covering it):
Implemented-by: VERDICT: PASS |
|
repo:objectstack#3 · os-tesla · session_01L9qibwSEecrzDjKjbk24r1 The brief L1-a handed its isolated contract-review sub-agent for the record above, filled from
|
|
repo:objectstack#3 · os-tesla · session_01L9qibwSEecrzDjKjbk24r1 L1-a, the seat's L1 thread · 2026-11-27T07:07Z 席位核对 — L1 ACCEPT @
|
|
repo:objectstack#3 · os-tesla · session_01L9qibyUSf2nKJWW6qBemSU 席位核对 — ACCEPT · head 8ca7780 · card #36377 · area o3-build · 2026-11-27T07:13ZSeat opinion: land as is; the narrowing is the card's own ask (refuse at validate/publish what already fails at run time).
|
|
repo:objectstack#3 · os-tesla · session_01L9qibyUSf2nKJWW6qBemSU 维护者速读
Seat opinion: approve; the refused spelling already fails at run time, so no working condition stops working. |
Requested by Tesla · project thread
Fixes #36377
Clause-②: no (narrowing)
Metadata-protocol: narrowed
Skills-docs: none —
skills/objectstack-formula/SKILL.mdalready states "The build refusesend - start,date + n,today() + 30" and names no site or spelling it is limited to, so it now holds for this flow-condition spelling as writtenrepo:objectstack#3 · os-tesla · session_01L9qibz2oLCRAYBpwsBBUyG
维护者速读
What changes
A flow condition (start, edge,
decisionbranch) binds the run's row twice: its fields flattened to bare names, and the row asrecord(the row before the write asprevious). A condition that first orders a date field's bare name against a text literal and then does arithmetic on a root read was refused by no pass:firstTypeMismatch's bare pass metTimestamp > string(the bare ordering) first, andconfirmAgainstDateTextstood it down (the runtime answers a date text ordered against a text literal).isDateArith, and answered null.validate.ts's bare date-text pass leaves rootsdyn, so it found nothing.recordRootDateTextIssueaskedrecordRootReadsFaultDateArith, which types the roots alone, metrecord.due_date + 1first, and stood down as "answered byfirstTypeMismatch", which had answered null.Reproduced on
origin/mainc826e8a before any edit (validateExpression('predicate', …), flattened scope,faultOutcome: 'run-fails',due_date: date):due_date > "2026-01-01" && record.due_date + 1 > 5date-text-arithmetic-run-fails,DateText + int,record.due_datedue_date > "2026-01-01" && previous.due_date - 7 < 0date-text-arithmetic-run-fails,DateText - int,previous.due_datedue_date > "2026-01-01" && record.picked_up_at + 1 > 5(datetime)date-text-arithmetic-run-fails,record.picked_up_atrecord.due_date > "2026-01-01" && record.due_date + 1 > 5(all-root)date-text-arithmetic-run-fails,record.due_datedue_date > "2026-01-01" && due_date + 1 > 5(all-bare)date-text-arithmetic-run-fails,due_daterecord.due_date + 1 > 5 && due_date > "2026-01-01"(arithmetic first)date-arithmetic-run-fails,record.due_dateThe fix,
packages/formula/src/validate.tsrecordRootDateTextIssue: drop the stand-down. That pass is reached only fromtypeSoundnessIssue's!mismatchbranch, i.e. only wherefirstTypeMismatchanswered null, so "the roots' own typing meets date arithmetic first ⇒ answered byfirstTypeMismatch" could only ever stand down on a fault nobody else refused. Without it, the mixed spelling takes the all-root spelling's verdict, code and words byte for byte (pinned).recordRootReadsFaultDateArith(cel-engine.ts, internal, not exported from the package entry) had no other caller and is removed; both docblocks say why.The verdict family: the dispatch's suggested route was to judge the root pass's date-arith fault independently of the bare ordering, which would answer
date-arithmetic(Timestamp + int). I took the card's second fix direction instead (have the stand-down askfirstTypeMismatch's actual answer, which is null by construction there), because then the mixed spelling gets exactly what its all-bare and all-root spellings get (date-text-arithmetic), which is the card's done-when ("refused … like the other two"). Both families are errors with the same outcome arms and prescribedaysBetween/addDays.One case answers
date-arithmeticand is pinned so: where a flow variable holds the bare name (flowVariables: ['due_date']), the bare ordering is not the field's, the record-root pass meets the root arithmetic first, and it answersdate-arithmetic-run-fails, asrecord.due_date + 1 > 5alone does.packages/spec/src/migrations/entries/semantic/19.flow-condition-bare-ordering-before-record-date-arithmetic-refused.ts: the ADR-0087 semantic entry (a structured TODO, no mechanical rewrite), modelled on fix(formula)!: a flow condition's record. / previous. date arithmetic is refused as its bare name is #36333's18.flow-condition-record-date-arithmetic-refused.ts..changeset/36377-flow-bare-ordering-record-date-arithmetic.md:minorfor@objectstack/formulaand@objectstack/spec, both declaration lines, the Skills-docs line, BREAKING banner, FROM → TO table,adr-0087: registered flow-condition-bare-ordering-before-record-date-arithmetic-refused. Same shape as fix(formula)!: a flow condition's record. / previous. date arithmetic is refused as its bare name is #36333's.Reach: the flattened scope is used only by flow conditions (lint's start / edge /
decisionconditions,registerFlow's advisory, the MCPvalidate_expressionflow_conditionsite). Record-scoped sites are unchanged.Tests
packages/formula/src/validate.test.ts, new top-level describe (fix(formula): a bare date ordering before a record. date arithmetic still slips past the flow-condition refusal (follow-up of #36333) #36377): the mixed spelling forrecord./previous./ a datetime field equals the all-root spelling's verdicts (code, params, message) and faults incelEngine.evaluate; the all-bare spelling's code. Arms:run-may-failwith no declared outcome,run-failskept when bare names are unproven,date-arithmetic-run-failswhen a flow variable shadows the bare name. CONTROL: arithmetic first keepsdate-arithmetic; the bare ordering besiderecord.due_date < today(),daysBetween(…),addDays(previous.due_date, -7) < today()is clean. N3 pinned: the 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 swap under unproven bare names handstitle > 5 && record.due_date + 1 > 5the root read'sdate-arithmetic-run-fails(record.due_date).packages/lint/src/validate-expressions.test.ts, new top-level describe: start, edge anddecisionconditions give the mixed spelling the all-root spelling's finding (severity, path, message), forrecord./previous./ datetime. CONTROL: the bare ordering besiderecord.due_date < today()is clean at all three sites.packages/runtime/src/domains/meta-flow-condition-record-date-text.test.ts, new top-level describe: the publish door (publishMetaItemon the realObjectQLrig) refuses the mixed spelling forrecord.andprevious.withINVALID_METADATA/ 422, exactly one date-arithmetic issue naming the root read, the same finding as the all-root spelling's (the message before its quoted source), and leaves the itemdraft. CONTROL: the bare ordering besiderecord.due_date < today()publishes and goesactive.Local runs (head 8ca7780)
Exit codes captured before any pipe; tests, builds and typechecks under
scripts/pm/os-verify-lock.sh(the first formula and lint test runs at 2087f66 were not under the lock; the lint file and the formula suite are unchanged since and the runtime file was rerun under it).pnpm --filter @objectstack/formula exec vitest run --maxWorkers=2exit 0, Test Files 72 passed (72), Tests 2155 passed (2155).pnpm --filter @objectstack/lint exec vitest run --maxWorkers=2 src/validate-expressions.test.tsexit 0, Tests 538 passed (538).packages/runtime:vitest run src/domains/meta-flow-condition-record-date-text.test.tsVERDICT command-exit 0, Tests 6 passed (6).pnpm --filter @objectstack/spec exec vitest run src/migrationsTests 202 passed (202);pnpm --filter @objectstack/service-automation exec vitest run src/flow-registration-schema-e2e.test.tsTests 7 passed (7); VERDICT command-exit 0.pnpm --filter @objectstack/formula run typecheck && pnpm --filter @objectstack/lint run typecheckVERDICT command-exit 0.pnpm --filter @objectstack/runtime run typecheck:tsc --noEmitclean;check:test-typechecknames 3 files this diff does not touch (boolean-written-spelling-row-scope.test.ts,meta-object-publish-column-changes.test.ts,organization-ownership-boot-guard.turso-remote.kernel.test.ts, 1 error each); the touched test file is not among them. CI'sTypeScript Type Checkis the verdict.node scripts/pm/dispatch-gates.mjs --commands: 95 families derived for this diff; all 95 run,--ranreconciliation: "95 derived, 95 run, 0 NOT-MEASURED (a DERIVED zero — all 95 recorded an exit code and none of them is 3)". Three first answered exit 3 and were rerun to exit 0:check-plugin-teardown-shape --self-test(shallow clone; the fixture sha fetched),check:type-check-debt(queued behind the dogfood hold; rerun under the lock),check:dual-build-cjs-loads(needs the full build the previous one ran).!title), head 8ca7780:pnpm --filter @objectstack/dogfood testunder the lock, VERDICT command-exit 0, Test Files 490 passed, 3 skipped (493), Tests 4144 passed, 68 skipped (4212), no failure.test:reponot run locally: the diff touches none of its tests; it is CI's (Test Core).Ablation (committed first, mutated through scripts/ablation-replace.mjs, restored to the HEAD blob)
Subject: the removed stand-down in
recordRootDateTextIssue(packages/formula/src/validate.ts). Mutation: after theRECORD_ROOT_READ_REguard, re-insert a stand-down on the roots-only typing's date-arith answer (firstTypeMismatch(source, celFieldTypes, 'flattened', every name shadowed)?.category === 'date-arith', the removed predicate's semantics), markerABLATION-36377; anchor 1 to 0, blob9fb19fcb8bd1to28d00dc285eb. The formula suite imports./validatefrom source, so no dist leg. Red:src/validate.test.ts2 failed / 149 passed, the mixed-spelling verdict test and the arm test; the CONTROL and N3 tests stayed green. Restored: blob9fb19fcb8bd1=HEAD:packages/formula/src/validate.ts,git diff HEADempty, marker count 0.Acceptance notes
offendingRecordReadnames the firsttimestampfield read through a root in field-map order, which can differ from the field in the arithmetic (record.borrow_date < today() && record.due_date + 1 > 5). The bare path'soffendingFieldhas the same best-effort rule; the verdict and code are right either way.due_date + 1 > 5 && record.due_date + 1 > 5) reports the bare verdict atdate-arithmetic-run-may-fail. Still an error.Verification
Read first, by risk:
packages/formula/src/validate.ts,recordRootDateTextIssue: the removed stand-down (the narrowing itself) and its docblock.packages/formula/src/cel-engine.ts: the removedrecordRootReadsFaultDateArithand the corrected record-root comment.packages/spec/src/migrations/entries/semantic/19.flow-condition-bare-ordering-before-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 36377shows 4 passing tests.Generated by Claude Code