Repository navigation
fix(formula)!: a flow condition's mixed bare / record. date arithmetic and record['FIELD'] index reads take the date-text verdicts - #38949
Conversation
… index spelling to the root gate Claude-Session: https://claude.ai/code/session_01QSeKYnrQ7UMtHofKQVjcH2 Co-authored-by: Claude <noreply@anthropic.com>
…un today, and run pins over the engine's scope Claude-Session: https://claude.ai/code/session_01QSeKYnrQ7UMtHofKQVjcH2 Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QSeKYnrQ7UMtHofKQVjcH2 Co-authored-by: Claude <noreply@anthropic.com>
…index date-text spellings Claude-Session: https://claude.ai/code/session_01QSeKYnrQ7UMtHofKQVjcH2 Co-authored-by: Claude <noreply@anthropic.com>
…te-text-mixed-spelling
📓 Docs Drift CheckThis PR changes 2 package(s): 22 hand-written doc(s) name something this change touched — list omitted above 15 rows. Re-derive on the tree named below: ⛔ 1 release-owned page(s) also affected — read-only, see AGENTS.md Documentation Guardrails. What this run could not see
Coarse fallback — 183 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 8dd3729400e4fd01776ebe0282c2f22bf003df2f && git checkout 8dd3729400e4fd01776ebe0282c2f22bf003df2f
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 665dfc4d815013918dd255236362bf426663baa1 5b8b6af2f89c9eab2c356d3c746a34db6c7935b9 && git checkout -B drift-repro 665dfc4d815013918dd255236362bf426663baa1 && git merge --no-ff 5b8b6af2f89c9eab2c356d3c746a34db6c7935b9
node scripts/docs-audit/affected-docs.mjs --json 665dfc4d815013918dd255236362bf426663baa1
|
|
repo:objectstack@os-justin · os-justin · session_01QSeKYnrQ7UMtHofKQVjcH2 CI reading · 2026-12-01T14:58Z · head One test failed, by timeout, in a file this PR does not touch: Judgement: a slow boot on this runner, not this diff — but one re-run decides it. The diff changes the formula package's flow-condition typing, which a flow save does reach, so if the same test times out again it is treated as real (this PR's cost on the save path) and measured, not re-run. Re-running the failed jobs of run 46669700574 once. |
|
repo:objectstack@os-justin · os-justin · session_01QSeKYnrQ7UMtHofKQVjcH2 Contract reviewServed-tier: PR #38949 (card #35295), diff ① Derived judgmentsMeasured on scratch copies of the head and merge-base formula sources, through
Local runs (scratch copies only; the repo, its branches and GitHub were not written):
② Semver level
③ Boundary flags
④ Design judgment
Findings:
Implemented-by: VERDICT: FAIL |
…te-text-mixed-spelling
…he type-mismatch root gate stays member-only Claude-Session: https://claude.ai/code/session_01QSeKYnrQ7UMtHofKQVjcH2 Co-authored-by: Claude <noreply@anthropic.com>
…as the date-text verdicts only Claude-Session: https://claude.ai/code/session_01QSeKYnrQ7UMtHofKQVjcH2 Co-authored-by: Claude <noreply@anthropic.com>
|
repo:objectstack@os-justin · os-justin · session_01QSeKYnrQ7UMtHofKQVjcH2 Contract reviewServed-tier: DELTA review from ① Derived judgmentsMeasured as in round 1: through
Local runs (inline
② Semver level
③ Boundary flags
④ Design judgment
No must-fix. No should-fix. Nits (none moves the head by itself):
Implemented-by: VERDICT: PASS |
|
repo:objectstack@os-justin · os-justin · session_01QSeKYnrQ7UMtHofKQVjcH2 L1 ACCEPT · PR #38949 (#35295) · head 席位核对 · ACCEPTACCEPT · repo:objectstack@os-justin · head
|
|
repo:objectstack@os-justin · os-justin · session_01QSeKYnrQ7UMtHofKQVjcH2 维护者速读
Head-sha: Queue kick, recorded: the merge-group run of this PR (group |
Fixes #35295
Clause-②: no (narrowing)
Metadata-protocol: narrowed
Skills-docs: none —
skills/objectstack-formula/SKILL.mdalready states "The build refuses date arithmetic (end - start,date + n)" and that a date field is refused in a timestamp-only call, naming no spelling either rule is limited to, so both now hold for the mixed and index spellings as written; no skill teaches the index spelling维护者速读
What changes
Ruled C on the card (ruling record 7311348060, on the decision analysis 7306749599): one PR for both items.
packages/formula/src/validate.ts,recordRootDateTextIssue. The flattened date-text check typed bare names in one pass (roots leftdyn) andrecord./previous.reads in another (bare names leftdyn), sodue_date - record.borrow_date > duration('24h')faulted neither while both consistent spellings were refused. The root pass now, after the roots-alone typing answers nothing, types the bare names (less the ones a flow variable shadows) and the roots against the field table in ONE pass. Every verdict the roots prove alone keeps its arm byte for byte; a verdict that rests on a bare name takes the bare name's arm, so where a node can rebind it (bareNamesUnproven) it isdate-text-arithmetic-run-may-fail, as the ruling orders. A genuinely unproven operand (flow variable, node output, shadowed name) staysdynand passes (ADR-0032 1c).packages/formula/src/cel-engine.ts. A new gate,RECORD_ROOT_DATE_TEXT_READ_RE, admitsrecord[/previous[(single or double quotes) for the record-root DATE-TEXT pass only, sotimestamp(record['borrow_date']),record['due_date'] - record['borrow_date'],isoDate(record['picked_up_at'])andrecord['due_date'] + 1 > 5take the date-text verdicts.RECORD_ROOT_READ_RE, the gate offirstTypeMismatch's root pass, stays member-only, so the text/boolean mismatch and date-arithmetic passes see index reads exactly as on the merge base: no verdict an expression had before changes, and no refusal is stood down to a warning (L2 7315274427, M1 / S1).offendingRecordReadnames an index read by its member spelling (record.borrow_date) only for the date-text pass (indexReads), astypedFieldRefalready did for calls; without itdue_date - record['borrow_date']named a bareborrow_datethat is not in the source.packages/spec/src/migrations/entries/semantic/19.flow-condition-mixed-or-index-spelling-date-text-refused.ts: the ADR-0087 semantic entry (a structured TODO, no mechanical rewrite), modelled on PR fix(formula)!: a flow condition that orders a bare date against text before date arithmetic on record. / previous. is refused #37840's entry..changeset/35295-date-text-mixed-spelling.md:minorfor@objectstack/formulaand@objectstack/spec, both declaration lines, the Skills-docs line, BREAKING banner, FROM → TO table, theadr-0087: registeredmarker.Reach: the flattened scope is used only by flow conditions (lint's start / edge /
decisionconditions,registerFlow's advisory, the MCPvalidate_expressionflow-condition site). Record-scoped sites are unchanged.Tests
packages/formula/src/validate-date-text-arithmetic.test.ts, new top-level describe (30 tests):record.,previous., datetime, a span against a number, behind a select guard, no declared outcome, bare names unproven): one error,ok: false, the same code, operands, words (read named as written aside) and prescription as each consistent spelling; the run faults with no such overload on a dyn string minus a dyn string, over the engine's real scope.bareNamesUnproven, the all-root spelling keeps run-fails there.previous["borrow_date"]; 5 of the 6 passed on the merge base,record['due_date'] - record.borrow_datewas refused there already because its member read opened the gate): the member spelling's code and reference; arithmetic equal byte for byte; for a call the prescribeddate(...)parse substituted in place checks clean and evaluatestrue.record['due_date'] + 1 > 5takesdate-text-arithmetic-run-fails(namedrecord.due_date, the run faults);previous['title'] > 5takes no type-mismatch finding, as on the merge base.due_date - borrow_date > duration('1h') && record['title'] > 5andrecord['active'] > 5 && isoDate(picked_up_at) == 'x'stay refused with their date-text code on both arms (no declared outcome:-run-may-fail; record-triggered:-run-fails), no warning, as on the merge base.record['due_date'] > record['title'],due_date > record['title'],record['due_date'] > titleand the same ordering written title-first by index check clean on both arms and evaluate, as on the merge base. The analysis's battery did not cover this shape; the first head refused it.timestamp(), equality,date(...),daysBetween, an ordering) stay clean and evaluatetrue; the TEN expressions that run today and B refused (a flow variable or node output holding an instant,vars.cutoff, a shadowing variable, four text concatenations) pass with no finding and evaluatetrue.Run harnesses: the analysis found
runatvalidate-date-text-arithmetic.test.ts:568andvalidate.test.ts:1349,:1432binding bare names outsidectx.extra, so bare-spelling run pins faulted onUnknown variable. All three now bind the engine's scope (celScope: bare names,record,previousunderextra); every existing run pin stays green on the real fault, and the two older bare-spelling run pins now assert the fault text (ISO 8601,no such overload), as the index run pin does.Local runs (head 5b8b6af)
Tests under
scripts/pm/os-verify-lock.sh, exit codes captured before any pipe.pnpm --filter @objectstack/formula exec vitest run --maxWorkers=2: Test Files 72 passed (72), Tests 2211 passed (2211);pnpm --filter @objectstack/formula run typecheck: VERDICT command-exit 0 (tsc --noEmitandcheck:test-typecheck).pnpm --filter @objectstack/lint exec vitest run --maxWorkers=2 src/validate-expressions.test.ts: Tests 546 passed (546), against a formuladist/built from this branch.pnpm --filter @objectstack/spec exec vitest run --maxWorkers=2 src/migrations: Tests 212 passed (212);pnpm --filter @objectstack/spec check:generated: all 14 generated artifacts up to date afterpnpm --filter @objectstack/spec build.check-adr-0087-registration, speccheck:spec-changes/check:upgrade-guide,check:doc-authoring,check:nul-bytes,check:issue-citations,check-empty-changeset,check-changeset-no-major: exit 0 each.node scripts/pm/dispatch-gates.mjs --commands: 95 families derived for this diff;--ran: "95 derived, 93 run, 2 NOT-MEASURED, 0 UNRUN". NOT-MEASURED:check:dual-build-cjs-loads(exit 3, PREREQUISITE NOT MET: needs a fullpnpm build),check:type-check-debt(stopped at the foreground bound while its closure build waited on the shared lock). Both are CI's.check:slot-lookupwas cut by the same bound on its first pass and re-run alone to exit 0 (scan 203 s, self-test passed in the first pass).pnpm --filter @objectstack/cli exec vitest run test/migrate-meta-engine-guidance.test.tsandcheck:doc-formula-expressionsfirst answered PREREQUISITE (nodist/) and passed after building their closures.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)
The formula suite imports
./validatefrom source, so no dist leg.At 5b8b6af,
src/validate-date-text-arithmetic.test.ts src/validate.test.ts(273 tests):RECORD_ROOT_READ_REadmits[again, markerABLATION-35295-REWIDEN): 3 failed / 270 passed — the date-text-only reach test, the M1 test and the S1 control. Restored, blob equals HEAD,git diff HEADempty.ABLATION-35295-INDEX): 6 failed / 267 passed. Restored.?? judged(bareCelTypes, …)replaced by?? null, markerABLATION-35295-ONEPASS): 11 failed / 262 passed — all 9 mixed rows, the arm test,due_date - record['borrow_date']. Restored.ABLATION-35295-NAMING): 3 failed / 270 passed. Restored.Corpus
validateExpressioncall recorded by the analysis over the shipped examples (app-crm, app-showcase, app-multi-package) and the formula and lint suites, re-judged by the base formula source (05da5bd, equal toorigin/main's) and this head: 9,157 unique calls, 2,586 at flattened scope with field types, 0 verdict changes. Controls (4 rows): the mixed form and an index call change; an index text mismatch (record['title'] > 5) and thedue_dateordering do not.record/previouswith a quoted key, 109 hits outside this PR's test file, none a flow condition doing date arithmetic or a date call (record-scope formulas, equality-only field-existence pins, UI code); mixed bare / root arithmetic, 0 CEL hits outside this PR (positive control: 14 and 6 hits in the new test file). No authored instance in examples, docs or skills.Acceptance notes
recordRootDateTextIssue, asked only after the roots-alone typing answers nothing (the analysis's prototype C, measured 0 false refusals). Keeping the roots-alone leg first is what keeps every currently refused verdict, and its arm, byte for byte.bareNamesUnproventhe mixed verdict'srun-may-failsentence names the read the reference names (record.borrow_date), while the unproven operand is the bare name. The sentence is the existing one, as ruled; not reworded here.[due_date, record.borrow_date].exists(d, d > '2026-01-01')refused while it evaluates;(status == 'open' ? now() : null) - record.picked_up_at > duration('1h')passing while it faults. The seat files or dedupes them.Clause-②: no; the ruling record and the dispatch carryno (narrowing), which this PR and its changeset use.Verification
Read first: (1)
packages/formula/src/validate.tsrecordRootDateTextIssue— the arm of the second leg is the risk; (2)packages/formula/src/cel-engine.tsRECORD_ROOT_READ_RE/RECORD_ROOT_DATE_TEXT_READ_RE— which gate opens to the index spelling is the risk; (3) theRUNS_TODAYcontrols in the new describe.Two-minute check:
pnpm --filter @objectstack/formula exec vitest run src/validate-date-text-arithmetic.test.ts— expect 30 tests under "(#35295)" passing, among them ten "CONTROL: … runs today and still passes".Generated by Claude Code