Skip to content

fix(formula)!: a flow condition's mixed bare / record. date arithmetic and record['FIELD'] index reads take the date-text verdicts - #38949

Merged
os-zhuang merged 8 commits into
mainfrom
claude/issue-35295-date-text-mixed-spelling
Dec 1, 2026
Merged

os-zhuang merged 8 commits into
mainfrom
claude/issue-35295-date-text-mixed-spelling

Conversation

@objectstack-fleet

@objectstack-fleet objectstack-fleet Bot commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #35295
Clause-②: no (narrowing)
Metadata-protocol: narrowed
Skills-docs: none — skills/objectstack-formula/SKILL.md already 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

维护者速读

  • 用户能看到什么变化:作者在校验或发布流程时,若流程条件把一个直接写的日期字段与「当前记录.字段」或「改动前记录.字段」相减,或用「记录['字段']」这种下标写法读日期字段,现在会和写法一致时一样被拒,并给出相同的改法;以前这两种写法能通过校验,流程每次运行都失败。
  • 为什么做:属于「表达式校验与作者护栏」,是上一张同类修复留下的两个漏网写法,替编写流程的管理员和代写流程的 AI 助手解决「校验通过、上线后每次运行都出错」。
  • 出错会怎样:若误判,作者在校验或发布流程时会看到一条拒绝;流程变量、节点输出这类真正认不出类型的写法照旧放行,已保存的流程照常加载注册,只在下次发布时要求改写;本改动可整体撤回。
  • 要你做什么:这是收紧已接受写法的破坏性变更,待座位契约审核通过、试跑全套通过后,需要你本人审阅、批准并合并。

What changes

Ruled C on the card (ruling record 7311348060, on the decision analysis 7306749599): one PR for both items.

  • Item (2), mixed operands — packages/formula/src/validate.ts, recordRootDateTextIssue. The flattened date-text check typed bare names in one pass (roots left dyn) and record. / previous. reads in another (bare names left dyn), so due_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 is date-text-arithmetic-run-may-fail, as the ruling orders. A genuinely unproven operand (flow variable, node output, shadowed name) stays dyn and passes (ADR-0032 1c).
  • Item (1), index reads — packages/formula/src/cel-engine.ts. A new gate, RECORD_ROOT_DATE_TEXT_READ_RE, admits record[ / previous[ (single or double quotes) for the record-root DATE-TEXT pass only, so timestamp(record['borrow_date']), record['due_date'] - record['borrow_date'], isoDate(record['picked_up_at']) and record['due_date'] + 1 > 5 take the date-text verdicts. RECORD_ROOT_READ_RE, the gate of firstTypeMismatch'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). offendingRecordRead names an index read by its member spelling (record.borrow_date) only for the date-text pass (indexReads), as typedFieldRef already did for calls; without it due_date - record['borrow_date'] named a bare borrow_date that 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: minor for @objectstack/formula and @objectstack/spec, both declaration lines, the Skills-docs line, BREAKING banner, FROM → TO table, the adr-0087: registered marker.

Reach: the flattened scope is used only by flow conditions (lint's start / edge / decision conditions, registerFlow's advisory, the MCP validate_expression flow-condition site). Record-scoped sites are unchanged.

Tests

packages/formula/src/validate-date-text-arithmetic.test.ts, new top-level describe (30 tests):

  • The 9 mixed forms of the analysis (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.
  • The arm: run-fails proven, run-may-fail under bareNamesUnproven, the all-root spelling keeps run-fails there.
  • Six index rows (the analysis's 5 faulting index forms plus previous["borrow_date"]; 5 of the 6 passed on the merge base, record['due_date'] - record.borrow_date was 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 prescribed date(...) parse substituted in place checks clean and evaluates true.
  • The narrower reach: record['due_date'] + 1 > 5 takes date-text-arithmetic-run-fails (named record.due_date, the run faults); previous['title'] > 5 takes no type-mismatch finding, as on the merge base.
  • M1 (L2): due_date - borrow_date > duration('1h') && record['title'] > 5 and record['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.
  • S1 (L2) CONTROL: record['due_date'] > record['title'], due_date > record['title'], record['due_date'] > title and 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.
  • CONTROLS: five index reads the runtime answers (datetime under timestamp(), equality, date(...), daysBetween, an ordering) stay clean and evaluate true; 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 evaluate true.

Run harnesses: the analysis found run at validate-date-text-arithmetic.test.ts:568 and validate.test.ts:1349, :1432 binding bare names outside ctx.extra, so bare-spelling run pins faulted on Unknown variable. All three now bind the engine's scope (celScope: bare names, record, previous under extra); 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 --noEmit and check:test-typecheck).
  • pnpm --filter @objectstack/lint exec vitest run --maxWorkers=2 src/validate-expressions.test.ts: Tests 546 passed (546), against a formula dist/ 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 after pnpm --filter @objectstack/spec build.
  • Re-run at 5b8b6af after the patch: check-adr-0087-registration, spec check:spec-changes / check:upgrade-guide, check:doc-authoring, check:nul-bytes, check:issue-citations, check-empty-changeset, check-changeset-no-major: exit 0 each.
  • At 03e1b9d (first head; the patch touches the same six files): 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 full pnpm 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-lookup was 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.ts and check:doc-formula-expressions first answered PREREQUISITE (no dist/) and passed after building their closures.
  • test:repo not 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 ./validate from source, so no dist leg.

At 5b8b6af, src/validate-date-text-arithmetic.test.ts src/validate.test.ts (273 tests):

  • Shared gate re-widened (RECORD_ROOT_READ_RE admits [ again, marker ABLATION-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 HEAD empty.
  • Date-text gate back to the member spelling (marker ABLATION-35295-INDEX): 6 failed / 267 passed. Restored.
  • One-pass leg (?? judged(bareCelTypes, …) replaced by ?? null, marker ABLATION-35295-ONEPASS): 11 failed / 262 passed — all 9 mixed rows, the arm test, due_date - record['borrow_date']. Restored.
  • Index naming off for the date-text pass (marker ABLATION-35295-NAMING): 3 failed / 270 passed. Restored.
Corpus
  • Behavioural, at 5b8b6af: every validateExpression call 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 to origin/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 the due_date ordering do not.
  • Text scan over 29,402 tracked files: index reads of record / previous with 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

  • The ruling's "one pass" is the second leg of 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.
  • Index reach (seat decision on L2 7315274427): the index spelling takes the date-text verdicts only. The first head widened the shared gate, which also opened the text/boolean mismatch pass to index reads; that stood a date-text refusal down to a warning (M1) and refused an ordering against a text field that evaluates (S1). Both are back to the merge base and pinned; re-widening the shared gate reds those pins.
  • Under bareNamesUnproven the mixed verdict's run-may-fail sentence 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.
  • Standing behaviour on main, outside this diff and left as it is: a text mismatch warning hiding a date-family error for the member and bare spellings; the member spelling's verdict on an ordering of a date against a text field; [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-② line: the claim comment carries Clause-②: no; the ruling record and the dispatch carry no (narrowing), which this PR and its changeset use.
  • L2: a narrowing, so a contract-tier review is owed, and the dogfood battery runs on the final head (the seat arms it).

Verification

Read first: (1) packages/formula/src/validate.ts recordRootDateTextIssue — the arm of the second leg is the risk; (2) packages/formula/src/cel-engine.ts RECORD_ROOT_READ_RE / RECORD_ROOT_DATE_TEXT_READ_RE — which gate opens to the index spelling is the risk; (3) the RUNS_TODAY controls 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

… 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>
…index date-text spellings

Claude-Session: https://claude.ai/code/session_01QSeKYnrQ7UMtHofKQVjcH2
Co-authored-by: Claude <noreply@anthropic.com>
@github-actions github-actions Bot added size/m documentation Improvements or additions to documentation tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Dec 1, 2026
@github-actions

github-actions Bot commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 2 package(s): @objectstack/formula, @objectstack/spec, touching 9 documentable anchor(s).

22 hand-written doc(s) name something this change touched — list omitted above 15 rows. Re-derive on the tree named below: node scripts/docs-audit/affected-docs.mjs --json 665dfc4d815013918dd255236362bf426663baa1.

⛔ 1 release-owned page(s) also affected — read-only, see AGENTS.md Documentation Guardrails.

What this run could not see
  • 3 name(s) were too generic to anchor anything (single lowercase words)
  • the SDK route bridge reached 69 of 252 client-bound route-ledger rows — the other 183 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 183: 0 are remediable by widening that discovery convention (an in-repo file declares the path; the convention did not scan it); 59 are structural — on a ledger where NOT ONE row is declared in-repo, so no discovery change reaches them at any price; 124 are undecided (no in-repo declaration, on a ledger that has other in-repo registrars — absence and an unreadable spelling are not distinguishable here). The rows themselves: node scripts/docs-audit/affected-docs.mjs --bridge-coverage
  • a page that states a rule by its inputs shares no identifier with the emitter that implements the rule, so an emitter-only diff cannot list it — not on this run and not on any run. Measured on fix(driver-sql): emit varchar(maxLength) for a text field a declared index keys on #11430: content/docs/protocol/objectql/types.mdx documents the text-family column mapping by the ObjectQL type names it maps FROM (text / textarea / html) while the diff changed createColumn; it went unlisted, and it was the page that diff falsified, in four places. No shared token exists to detect this on, so a rule your change carries has to be re-read by hand in the pages that restate it.
  • a key NAME is not a key, so the hand re-read the line above prescribes can land on the wrong schema. The same spelling is authorable on one governed type and a [REMOVED] tombstone on another for each of active, aria, joins, objects, template, tools and version (censused on [finding] tools is a key on BOTH AgentSchema (tombstoned, dead) and SkillSchema (live, cloud-attested), so a name-based search attributes skill examples to the agent key — it produced a false stop-the-line alarm on PR #19059 #19093 over the liveness ledger's governed types, top-level keys); nothing in a search result distinguishes the two, so a grep hit on a LIVE example reads as evidence about the DEAD key. Measured on fix(spec): the agent.tools liveness row says dead — it claimed live on a key the schema tombstoned #19059: content/docs/ai/agents.mdx was reported as contradicting the agent.tools tombstone over its tools: example at :161, which is inside the defineSkill({ block opened at :155 — the page was already correct. Settle ownership by PARSING the value against both schemas, never by the name: that literal PASSES SkillSchema, and as an AgentSchema it FAILS at tools with the tombstone prescription. ⛔ These names are not the whole class — a key retired through a .strict() guidance map leaves no tombstone in the walked shape and none of them here (tool.category, live as AIToolDefinition.category).

Coarse fallback — 183 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): node scripts/docs-audit/affected-docs.mjs --json 665dfc4d815013918dd255236362bf426663baa1 → packageMentionDocs.

Which tree this was computed on

This run read content/docs from 8dd3729400e4fd01776ebe0282c2f22bf003df2f — the merge of head 5b8b6af2f89c9eab2c356d3c746a34db6c7935b9 into base 665dfc4d815013918dd255236362bf426663baa1, which is what actions/checkout gives a pull_request run. Not the PR head.

A worktree cut from an older main holds a different content/docs, so re-deriving there can legitimately return a different list — that is a different tree, not a wrong row. To answer on the same tree:

# 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

⚠️ That checkout carried uncommitted changes, so the commit above does not fully identify what was read.

Advisory only, and a precision-first one (#9192): a page is listed because it names a
symbol, wire route or SDK method this diff touched — not because it mentions a changed
package. Each row says which anchor put it there, so a wrong row is reportable rather than
merely annoying. To re-verify, run the docs-accuracy-audit workflow scoped to these files:
node scripts/docs-audit/affected-docs.mjs 665dfc4d815013918dd255236362bf426663baa1 → pass the list as
args.docs, on the commit named under Which tree this was computed on.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack@os-justin · os-justin · session_01QSeKYnrQ7UMtHofKQVjcH2

CI reading · 2026-12-01T14:58Z · head 03e1b9d3573491c4ef46e824458a575f648de047, run 46669700574, job Test Core (11/12) (142723062428).

One test failed, by timeout, in a file this PR does not touch: packages/plugins/plugin-approvals/src/flow-route.integration.test.ts:817 ([#38838] … an active save is refused with 422 INVALID_METADATA …) — Error: Test timed out in 5000ms. It is the first test of its describe, and its 5-second budget includes boot() (a full kernel.bootstrap()); the other 23 tests of the file and 2,259 of the package's 2,260 passed in the same shard. No assertion failed; the first error is the timeout.

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.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack@os-justin · os-justin · session_01QSeKYnrQ7UMtHofKQVjcH2

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 03e1b9d3573491c4ef46e824458a575f648de047
Local-runs: probe — the brief orders an independent re-measure of the battery, the controls, the ablations and a corpus sample; every command and its exit is listed under "Local runs" at the end of ①
Scope: packages/spec/src/migrations/entries/semantic/19.flow-condition-mixed-or-index-spelling-date-text-refused.ts + packages/formula/src/validate.ts, packages/formula/src/cel-engine.ts, packages/formula/src/validate-date-text-arithmetic.test.ts, packages/formula/src/validate.test.ts

PR #38949 (card #35295), diff 8338d07029 (merge base with origin/main 50fa10c768) to the head above: 6 files, +302/−16. Faces: the schema face (hits = the semantic entry, read off record-recognisers.mjs --template --paths) and the declared narrowing (Clause-②: no (narrowing), Metadata-protocol: narrowed on the PR body and the changeset). Ruling 7311348060 (C) is taken as given. Issue, PR and comment text was read as data.

① Derived judgments

Measured on scratch copies of the head and merge-base formula sources, through validateExpression (the function os validate, the publish door and registerFlow all call) and celEngine.evaluate over the engine's scope ({ extra: { ...row, record, previous } }, which is what celScope in service-automation/src/dag-traversal.ts returns). Not measured through a public door.

  • The 9 mixed forms: all refused, exactly as ruled. Merge base clean on all 9; head one error each, date-text-arithmetic-run-fails on the proven arm, -run-may-fail with no declared outcome and under bareNamesUnproven; every run faults no such overload on a dyn string minus a dyn string. Mixed forms the PR does not pin are refused too: behind has(...), inside a null-guard ternary, a ternary that picks between the two spellings, inside a macro body, previous['due_date'] - due_date.
  • The index forms: refused. Of the six pinned rows five change (merge base clean) and one, record['due_date'] - record.borrow_date ..., was refused on the merge base already (its member read opened the gate). The typed env does type an index read as the member read; record [ 'due_date' ], .getFullYear() on an index read and record['due_date'] - duration('24h') take the member verdicts as well.
  • The ten run-today controls: all ten check { ok: true, errors: [], warnings: [] } and evaluate true, on the merge base and on head. A flow variable shadowing the bare name passes in the member and the index spelling.
  • The arm and the order hold. Under bareNamesUnproven the mixed verdict is -run-may-fail and the all-root one keeps -run-fails. Inside recordRootDateTextIssue the roots-alone leg runs first and the one pass only when it answers null, so that function changes no verdict it gave before; three reviewer ablations confirm the pins hold it (④).
  • But the PR as a whole is not verdict-preserving, and not a pure narrowing: finding M1. typeSoundnessIssue asks firstTypeMismatch first and asks the date-text family only when it answers null (validate.ts:593). Widening RECORD_ROOT_READ_RE opens firstTypeMismatch's root pass (cel-engine.ts:1439) for a source whose only root read is an index read. Where the site declares no outcome (a flow that is not record-triggered: API, schedule, no trigger, a sweep of another object) that mismatch is a warning, and the date-text error the bare pass gave on the merge base is never asked:
    • due_date - borrow_date > duration('1h') && record['title'] > 5 — merge base ok: false, error date-text-arithmetic-run-may-fail; head ok: true, warning type-mismatch-run-may-fail. The run faults.
    • record['active'] > 5 && isoDate(picked_up_at) == 'x' — merge base error date-text-call-run-may-fail; head ok: true, the same warning. The run faults.
    • On a run-fails site the same sources stay refused under another code and prescription (date-text-arithmetic-run-fails becomes type-mismatch-run-fails).
      The member spelling behaves this way on main already (... && record.title > 5 is the warning on both sides), so this is the index read inheriting a standing precedence hole; it is still a published refusal turned into an advisory, on a PR declared Clause-②: no (narrowing), declared nowhere and pinned nowhere. The corpus holds no such source, which is why the re-measure reads 0 changes.
  • A shape head now refuses that runs: finding S1. record['due_date'] > record['title'], due_date > record['title'], record['due_date'] > title, record['title'] < record['due_date']: merge base clean, head type-mismatch-run-fails (a warning with no declared outcome), and the run evaluates (ok: true, a string comparison). The member and bare spellings carry that verdict on main (record.due_date > record.title, due_date > title: error on both sides, the run evaluates), deliberately (CEL: a datetime field is typed Timestamp at authoring (validate_expression, publish gate) but bound as an ISO string at runtime, so isoDate(record.<datetime>) passes every check and then refuses every write ("no matching overload for 'isoDate(string)'") #32595, comparesDateTextAgainstUndeclared), so the reach is "the member read's verdict" as declared. It was outside the analysis's battery, so "0 false refusals" was not measured for the index reach.
  • No other new refusal of a running expression. Of the 68 distinct probe sources that evaluate, 4 are newly refused (S1), 3 are refused on both sides (standing, ③) and 61 are not refused on head (among them: concatenation, ordering and equality across spellings, daysBetween, date(...) / datetime(...) wraps, Timestamp minus date text, optional index, a string literal containing record[). What still passes and faults has an operand the field table does not type (record[key] with a computed key, a macro variable named like the field): fail-open, as ruled.
  • The dev's reach statement is correct and declared, with M1 and S1 as its two undeclared consequences: the index read takes date arithmetic against a number and the text/boolean mismatch, named by its member spelling; record['title'] > 5 keeps the row's outcome under bareNamesUnproven, as record.title > 5 does. Only flow conditions reach it: lint's flow sites, registerFlow's advisory pass and MCP validate_expression; the Console's authoring helper passes no field types.

Local runs (scratch copies only; the repo, its branches and GitHub were not written):

  • gh api reads of the card, comments 7306749599 / 7311348060 / 7311362527 / 7314634407, the PR, its comments and the head's check-runs: exit 0.
  • git fetch origin claude/issue-35295-date-text-mixed-spelling, git fetch origin main, git merge-base, git diff 8338d07029 03e1b9d357: exit 0.
  • node scripts/pm/record-recognisers.mjs --template: exit 0; with --paths and the six paths: exit 0 (schema face). A first call with comma-joined paths exited 0 and read no face; --face narrowing --paths ... exited 1 (usage: not both).
  • git archive SHA packages/formula/... | tar -x for both shas, node_modules symlinked to the sibling worktree's: exit 0.
  • Head, vitest run src/validate-date-text-arithmetic.test.ts: exit 1 once (scratch lacked tsconfig.base.json), then exit 0, 120 passed.
  • Head, vitest run --maxWorkers=2 (whole formula package): exit 1 once (3 tests, ENOENT on two files outside the package that the scratch tree lacked), then exit 0, 72 files, 2209 tests.
  • Reviewer probes (three files, 246 source-and-hint rows) at merge base and head: exit 0 each.
  • Ablations on the head copy, vitest run src/validate-date-text-arithmetic.test.ts src/validate.test.ts: unmutated exit 0, 271 passed; six mutations exit 1 each (counts in ④); sources restored, cmp equal.
  • Run-harness probe (old scope shape against the extra shape) at merge base and head: exit 0 each.
  • Recorder over the merge-base formula suite (a setup file wrapping validateExpression): exit 1 once (my own probe file left in the tree), then exit 0, 72 files, 2181 tests, 7,546 calls; re-judge at merge base and head: exit 0 each.
  • git grep -nE scans of the head tree: exit 0.
  • node scripts/check-adr-0087-registration.mjs --base 8338d07029 --head 03e1b9d357, from the sibling worktree: exit 0.
  • Head, spec vitest run src/migrations in scratch: exit 1 twice, no reading — the package config imports repo files and ./registry.js is generated, not committed. CI's Test Core owns it.

② Semver level

  • @objectstack/formula and @objectstack/spec both minor, title fix(formula)!:, a BREAKING banner, both declaration lines, the Skills-docs: line, a FROM → TO table and a one-line fix: the level AGENTS.md's Post-Task Checklist step 3 sets for narrowed on every package the diff moves (formula by code, spec by the entry). Same form as PR fix(formula)!: a flow condition that orders a bare date against text before date arithmetic on record. / previous. is refused #37840's changeset.
  • Registration: the marker names flow-condition-mixed-or-index-spelling-date-text-refused, the entry's id; the file prefix 19. is the protocol major (both packages at 19.0.0-next.3). The registration check exits 0: "1 declared-breaking changeset(s) ... [BREAKING+bang+clause-②-narrowing+metadata-protocol-narrowed] registered ... (new here)" and "1 migration entry added, each at or above PROTOCOL_MAJOR 19".
  • Form: a structured TODO with surface, replacement, reason, acceptanceCriteria, as 19.flow-condition-bare-ordering-before-record-date-arithmetic-refused has; it makes real what 18.formula-date-subtraction-refused already declares for flow conditions ("a date or datetime field subtracted from another", no spelling excepted).
  • FROM → TO: each TO row, and the entry's hours example (datetime(due_date) - datetime(record.borrow_date)).getHours(), checks clean and evaluates on head.
  • Not exact in two places. The entry's surface says "Not the shape: ... an ordering or equality of the read", which is untrue of an ordering against a text field (S1); and neither the entry nor the changeset says a refusal can become a warning (M1). The level does not move with either; the texts follow whichever fix is taken.

③ Boundary flags

  • Refusal loud: one error, ok: false, the code asserted by equality with the consistent spelling and by literal in the arm test; os validate / the publish door refuse and registerFlow logs an advisory and still registers (read at flow-registration-checks.ts:956), as the changeset says.
  • Prescription usable: verified above; for a call the test substitutes the prescribed date(...) and proves it clean and true.
  • Corpus, re-measured by sample: 7,374 unique validateExpression calls recorded from the merge-base formula suite and re-judged by both sides, 0 verdict changes; controls appended to the same run, 3 of 3 change (a mixed form, an index call, an index text mismatch) and 1 of 1 does not (due_date > record.borrow_date). Text scan of the head tree (29,415 tracked files): 115 lines with a quoted-key index read of record / previous outside the PR's test file, none under examples/ or skills/, none a flow condition doing date arithmetic or a date call (control: 14 lines in the PR's test file); mixed bare / root arithmetic over examples/, skills/, content/docs/: 5 lines, none CEL date arithmetic (control: 17). Consistent with the dev's 0 authored hits. Note packages/spec/src/automation/flow-template-token.ts:189: the platform itself writes the index spelling (record["in"]) for a field named like a CEL keyword, so the spelling is not purely hand-authored.
  • Skills-docs: none holds: skills/objectstack-formula/SKILL.md rule 5 states both refusals with no spelling limit, and no skill or doc teaches the index spelling.
  • Dev deviations. The claim's bare Clause-②: no against no (narrowing) on the PR body and changeset: the queue reads the latter; the claim line is the seat's to reconcile, and M1 bears on its direction. Model-free commit trailers, the backgrounded gate batch, read-only gh api: no contract effect. The index reach: judged in ①.
  • open_questions: none. out_of_scope_findings: (status == 'open' ? now() : null) - record.picked_up_at > duration('1h') passes and faults; agreed that C leaves it passing (the operand is dyn), but "carrier: none" does not stand for a condition that publishes and fails every run: escalated to the seat to file or dedupe under the filing gate.
  • Standing behaviour on main, outside this diff, for the seat to dedupe or file: (a) the precedence behind M1 (a text mismatch warning hides a date-family error for the member and bare spellings too); (b) the verdict behind S1, whose sentence says "against a number ... the expression faults" of a comparison the runtime answers; (c) [due_date, record.borrow_date].exists(d, d > '2026-01-01') is type-mismatch-run-fails on both sides and evaluates true.
  • SQL push-down: the diff reads no data; nothing to flag. Security: none. PR author is objectstack-fleet[bot].
  • Checks on this head when read: 41 success, 17 skipped, 19 in progress, 1 failure — Test Core (11/12), a 5-second timeout in packages/plugins/plugin-approvals/src/flow-route.integration.test.ts, a file the PR does not touch; the seat's comment 7315142353 re-runs it. Dogfood battery shard 3 green, shards 1 and 2 running. Landing checks are the seat's.

④ Design judgment

  • packages/formula/src/validate.ts — holds against the ruling. One typing of the scope replaces two disjoint ones; the second leg takes the bare name's arm; bareCelTypes keeps a shadowed name dyn. The date-only set is built from all fields but is consulted only for a name the bare typing still holds, so a shadowed timestamp(borrow_date) stays clean (measured). The defect is not in this function: it is the order in typeSoundnessIssue, which the gate change now reaches (M1).
  • packages/formula/src/cel-engine.ts — the regex and the naming do what their docblocks say. The docblock's "the gate of every flattened record-root pass" is exactly why the change is wider than the date-text family; that reach is right wherever the member verdict is a true fault, and carries M1 and S1.
  • Semantic entry (hits) — against its first consumer, the migration guidance an upgrading author reads: FROM set and replacement are right for the ruled shapes; the "Not the shape" clause is wrong for S1 and silent on M1.
  • Tests — the pins assert substance. Ablations reproduced on the head copy: one-pass leg replaced by ?? null, 11 failed / 260 passed (the 9 mixed rows, the arm test, due_date - record['borrow_date']); index gate reverted, 6 failed / 265 passed; index naming reverted, 3 failed / 268 passed. Reviewer ablations: second leg given the root arm, 2 failed; second leg typed with celFieldTypes (shadowing ignored), 1 failed (the shadowing control); legs swapped, 3 failed. So the old code fails them and each design choice is held by a pin. Not pinned: the precedence case (M1), the date-against-text ordering (S1), and the index reach on the no-outcome and bareNamesUnproven arms.
  • The three repaired run harnesses bind the engine's real scope and now fault for the real reason. Measured: on the old shape timestamp(borrow_date) < now() and due_date + 1 > 5 faulted Unknown variable; under extra they fault timestamp() requires a string in ISO 8601 format and no such overload on a dyn string plus an int. The root-spelled pins faulted for the real reason on both shapes.
  • The narrowing against the published spec on main: it makes a declared refusal real and takes no declared capability away, except that S1 refuses a comparison that evaluates, on the strength of the member spelling's standing verdict.

Findings:

  • must-fix M1 — a refusal becomes a warning. As measured in ①. Keep the refusal and pin it. Two ways: (a) where the mismatch grades to a warning, still ask the date-text family and let its error stand, which also closes the same hole for the member and bare spellings and is then a further narrowing to declare in the changeset and the entry (the seat judges whether it needs the maintainer's word); or (b) confine it to the index-only case, so every merge-base verdict is kept. Declaring the change instead would make this PR a widening in part, which the ruling did not grant. The code swap on the run-fails arm is to be stated either way.
  • should-fix S1 — the index reach refuses an ordering against a text field that evaluates. Correct the entry's "Not the shape" clause and the changeset, and pin the case equal to the member spelling, or exempt it. Say on the PR that the analysis's battery did not cover it.
  • nit N1 — the two older bare-spelling run pins (validate-date-text-arithmetic.test.ts:589, validate.test.ts:1357) still assert only { ok: false }, and the new index run pin only the absence of Unknown variable, so the harness repair is not itself pinned.
  • nit N2 — under bareNamesUnproven the mixed sentence names the proven root read where the unproven operand is the bare name; dev-flagged, accepted as ruled.
  • nit N3 — "5 index forms passed before" against six pinned rows: one was refused on the merge base already; the ablation note says so, the summary does not.

Implemented-by: claude/issue-35295-date-text-mixed-spelling
Reviewed-by: session_01QSeKYnrQ7UMtHofKQVjcH2

VERDICT: FAIL

…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>
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack@os-justin · os-justin · session_01QSeKYnrQ7UMtHofKQVjcH2

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 5b8b6af2f89c9eab2c356d3c746a34db6c7935b9
Local-runs: probe — the brief orders M1, S1, the round-1 battery, the three new refusals and the four ablations re-measured on the merge base against this head; nothing was checked out, built or written (sources read with git show, bundled and run in memory from the sibling worktree objectstack-issue-38578); every command and its exit is listed under "Local runs" at the end of ①
Scope: packages/spec/src/migrations/entries/semantic/19.flow-condition-mixed-or-index-spelling-date-text-refused.ts + packages/formula/src/cel-engine.ts, packages/formula/src/validate.ts, packages/formula/src/validate-date-text-arithmetic.test.ts, packages/formula/src/validate.test.ts

DELTA review from 03e1b9d3573491c4ef46e824458a575f648de047 (record 7315274427: FAIL, must-fix M1, should-fix S1, nits N1 to N3) to this head: a merge of origin/main (397a9d9) and two commits (19b1bd6, 5b8b6af); in this PR's six files +93 / -43. The merge base with origin/main is now 645e6b1508; its formula sources equal the round-1 merge base's (git diff 8338d07029 645e6b1508 -- packages/formula/src is empty). The whole PR against it: 6 files, +353 / -17. The changeset is a prose face, read here for what it declares. The dev's report 7315826236, the PR body and the card #38959 were read as data; their author is objectstack-fleet[bot].

① Derived judgments

Measured as in round 1: through validateExpression (the function os validate, the publish door and registerFlow call) and celEngine.evaluate over the engine's scope ({ extra: { ...row, record, previous } }), on the merge base 645e6b1508 and on this head. Not measured through a public door.

  • M1: closed exactly. due_date - borrow_date > duration('1h') && record['title'] > 5 and record['active'] > 5 && isoDate(picked_up_at) == 'x', on four arms (declared outcome run-fails, none, each with and without bareNamesUnproven) and four hint shapes (scope: 'flattened' spelled or not, timeRelativeSweep or not): the whole result (ok, errors, warnings, params, message) is byte-identical on the merge base and on head. Declared run-fails: date-text-arithmetic-run-fails / date-text-call-run-fails; none: the -run-may-fail code; ok: false, no warning, and the run faults. On the old head the same rows read type-mismatch-*, a warning with no declared outcome; the probe sees that (4 error-to-non-error rows at 03e1b9d357, 0 at this head).
  • S1: closed exactly. record['due_date'] > record['title'], due_date > record['title'], record['due_date'] > title, record['title'] < record['due_date']: { ok: true, errors: [], warnings: [] } on the merge base and on head, on the same four arms and four hint shapes, and each evaluates (false, a string comparison).
  • The type-mismatch pass sees an index read exactly as on the merge base. Statically: git diff 645e6b1508 5b8b6af2f8 -- packages/formula/src/cel-engine.ts has three hunks (the gate's docblock and the new constant, offendingRecordRead, one call in firstDateTextVerdict); none is inside firstTypeMismatch, RECORD_ROOT_READ_RE is the same line, and offendingRecordRead without indexReads builds a pattern equivalent to the merge base's. Measured: firstTypeMismatch called directly on 4,816 generated sources under three shadow sets, 14,448 calls, 0 differences; 22 index-only sources on four arms (record['title'] > 5, record["title"] > 5, record [ 'title' ] > 5, previous['active'] < 3, record['title'] * 2 > 5, record['title'] + 1 > 2, record['title'] > record['active'], record['active'] + record['copies'] > 1, record['due_date'] > 5, record['due_date'] == 5, previous['title'] - previous['copies'] > 0, disjunctions and conjunctions of them, and others) are clean on both sides wherever no date-text verdict applies, where the old head gave type-mismatch-* on 15 of them. With a member read elsewhere in the source the pass reads index reads as it did on the merge base (record.due_date - record.borrow_date > duration('1h') && previous['title'] > 5: the same type-mismatch-* on both sides, every arm).
  • Nothing regressed from round 1. Re-run at this head with round 1's three probe files (every row, the G rows now on four arms) plus delta rows, 452 source-and-hint rows:
    • the 9 mixed forms: merge base clean, head one error each, date-text-arithmetic-run-fails proven, -run-may-fail with no declared outcome and under bareNamesUnproven; every run faults no such overload on a dyn string minus a dyn string;
    • the six index rows: five change (merge base clean), record['due_date'] - record.borrow_date ... was refused on the merge base already; codes and references as the member spelling; every run faults;
    • the ten run-today controls and the five index controls: { ok: true, errors: [], warnings: [] } and true on both sides; the shadowing control passes in the index spelling too (due_date - record['borrow_date'] ... with flowVariables: ['due_date']);
    • the arm: mixed is -run-may-fail under bareNamesUnproven, the all-root and the all-index spellings keep -run-fails there;
    • the new reach pin: record['due_date'] + 1 > 5 is date-text-arithmetic-run-fails, reference record.due_date, and the run faults no such overload (a dyn string plus an int); previous['title'] > 5 is clean on both sides (its run faults: standing, see ③).
    • Totals: 112 rows differ from the merge base, 100 of them clean to a date-text error (81 arithmetic, 19 call) and 12 the same code with another reference (N4); 0 rows go from an error to a non-error; 0 rows change a merge-base warning or another code. Eight rows (two sources on four arms) were refused while my row evaluated them: both are short-circuits (record['due_date'] > record['title'] && record['due_date'] - record['borrow_date'] > duration('1h') on a title that sorts above the date; a status == guard that is false). On a row that reaches the arithmetic both fault, so neither is a false refusal.
  • The three refusals the dev reports as new each fault at run, on every arm. record['due_date'] + 1 > 5: no such overload, a dyn string plus an int. timestamp(record['borrow_date']) < now(): timestamp() requires a string in ISO 8601 format. due_date - record.borrow_date > duration('24h'): no such overload, a dyn string minus a dyn string. Merge base clean, head refused (48 of 48 rows across arms and hint shapes); the prescriptions check clean and evaluate (daysBetween(record['borrow_date'], record['due_date']) > 5, addDays(date(record['due_date']), 1) > now(), date(record['due_date']) + duration('24h') > now()). The three are examples, not the set: the index reach also refuses record['due_date'] - 7, * 2, + duration('24h'), - duration('24h'), .getFullYear() and isoDate(...) on an index read, each of which faults.
  • A generated differential finds no other change. 4,816 sources (26 operands in the bare, member and index spellings and literals, pairwise under -, +, *, >, ==; nine call shapes; 11 date-faulting clauses joined to 9 mismatch or neutral clauses both ways with && and ||) on five hints, 24,080 judgments: 21,965 byte-identical; 1,915 clean to a date-text error (1,580 arithmetic, 335 call), each of which faults on at least one of two rows; 200 the same code with another reference (40 sources, N4); 0 error to non-error; 0 changes to a non-clean merge-base code; 0 new warnings; 0 new errors on a source that reads no root.
  • What stays passing and faulting, as on the merge base (fail-open, not a regression; routed in ③): the index spelling of the text or boolean mismatch and of a date ordered against a number; and one order that follows from it: record['title'] > 5 && record['due_date'] - record['borrow_date'] > duration('1h') is clean on both sides, because the date-text check reads the first typed fault and the index mismatch ahead of it is one no pass judges. The reverse order is refused, and the member spelling of the same source takes type-mismatch-*, not a date-text verdict, so the declared sentence ("the date-text verdicts the member read takes") still holds.

Local runs (inline node --input-type=module scripts from /home/user/objectstack-issue-38578; sources read with git show SHA:PATH, bundled in memory with that worktree's esbuild and evaluated in-process; no file, branch or GitHub object written apart from this record):

  • gh api reads of comment 7315826236, the PR, its three comments, the head's check-runs and issue 38959: exit 0 each.
  • git fetch origin claude/issue-35295-date-text-mixed-spelling, git fetch origin main, git merge-base, git diff (stat, numstat, the delta and the whole PR), git show, git grep: exit 0.
  • node scripts/pm/record-recognisers.mjs --template: exit 0; with --paths and the six paths: exit 0 (schema face, hits = the semantic entry).
  • Loader smoke on both shas: exit 0.
  • Battery, 452 rows, at the merge base, the old head and this head: exit 0.
  • Messages, prescriptions and the two short-circuit sources on a row that reaches the arithmetic: exit 0.
  • Ablations: the PR's two test files run through vitest/node startVitest with a plugin serving this head's four formula files from git show, each mutation applied in memory to exactly one anchor: exit 1, as expected of red mutants (unmutated: 273 passed, 0 failed; counts in ④).
  • Generated differential, 4,816 sources: exit 0.
  • Naming and masked-order probe: exit 0.
  • Dedicated M1 / S1 / new-refusal probe, 160 rows: exit 0.
  • node scripts/check-adr-0087-registration.mjs --base 645e6b1508a133f5bb3e14f081783cb3843302ed --head 5b8b6af2f89c9eab2c356d3c746a34db6c7935b9: exit 0.
  • The whole formula suite at this head through the same overlay (the sibling tree's packages/formula/src differs from this head in the PR's four files only): exit 0, 72 files, 2211 passed, 0 failed.
  • This record read through contractReviewRecordReading (scripts/pm/check-half-states.mjs): exit 0, one verdict, no open finding.
  • After the runs: git status --short in the sibling worktree is empty and its vitest cache file is unmodified.

② Semver level

  • Unchanged and still right: @objectstack/formula and @objectstack/spec both minor, fix(formula)!:, the BREAKING banner, Clause-②: no (narrowing) and Metadata-protocol: narrowed on the PR body and the changeset, one adr-0087: registered marker whose id is the entry's. The registration check exits 0 against the new merge base: "1 declared-breaking changeset(s) ... registered ... (new here)" and "1 migration entry added, each at or above PROTOCOL_MAJOR 19".
  • The delta makes the change a pure narrowing again: every difference from the merge base is a clean source becoming a date-text error on a source that faults (①). No refusal is stood down, so nothing in it is a widening.
  • The declared reach is now the measured one. The entry's surface names the index reach as the date-text verdicts "and those only" (a timestamp-only call, a subtraction of two date texts, arithmetic on the text against a number "as date-text-arithmetic") and lists the index text or boolean mismatch, an ordering against a text field or literal, and equality under "Not the shape ... judged exactly as before"; its acceptanceCriteria drops date-arithmetic and type-mismatch. The changeset says the same and states that record['due_date'] + 1 > 5 takes date-text-arithmetic where its member spelling takes date-arithmetic. The PR body's "What changes", "Tests" and "Acceptance notes" match the code and the pins. Two wordings are loose without being wrong for the contract (N4, N5).
  • FROM → TO: the three rows and the entry's hours example are unchanged by the delta and still check clean and evaluate on this head (rows in the battery).
  • RECORD_ROOT_DATE_TEXT_READ_RE is exported from cel-engine.ts only; the package index does not re-export it and no other package reads either gate, so no public symbol is added.

③ Boundary flags

  • Round-1 nits. N1 fixed: the two older bare-spelling run pins assert the fault text (ISO 8601, no such overload) and the index run pin matches the fault text in place of the absence of Unknown variable. N3 fixed: the PR body says 5 of the 6 index rows passed on the merge base and names the one that did not. N2 carried and accepted as ruled; the PR body states it.
  • Dev deviations. The local branch was deleted and rebuilt at the same tip, and origin/main merged through os-regen-merge.sh: no contract effect; the delta's six files are the PR's own. The PR body was PATCHed by the seat from the dev's file: the body on GitHub carries this head's readings (30 tests, the four ablation counts), which I reproduced. open_questions: none.
  • out_of_scope_findings: the carrier exists, with one gap for the seat. Card flow condition type verdicts: a type-mismatch warning hides a date-text refusal, .exists over date fields is refused while it runs, and a nullable-ternary minus date text passes and faults #38959 is open (bug, priority:p2, area:workflow) and lists four items: the warning-hides-error precedence, the .exists false refusal, the nullable-ternary miss and the wording of the date-against-text ordering verdict. It does not list what this patch round deliberately left out: through the index spelling, a text or boolean mismatch and a date ordered against a number pass and fault on every run, on the merge base and on head alike (record['title'] > 5, record['active'] + 1 > 3, record['due_date'] > 5; measured in ①), with the masked order above as a consequence. Escalated to the seat to add to flow condition type verdicts: a type-mismatch warning hides a date-text refusal, .exists over date fields is refused while it runs, and a nullable-ternary minus date text passes and faults #38959 or file under the filing gate; dedupe words: index read record['FIELD'] type-mismatch flow condition, RECORD_ROOT_READ_RE member-only, index spelling text mismatch passes and faults.
  • Corpus. Not re-recorded by me; the dev re-judged 9,157 recorded calls with 0 changes. My generated differential (①) is the independent reading for the delta, and the reach is strictly narrower than the one sampled in round 1.
  • Skills-docs: none still holds: rule 5 of skills/objectstack-formula/SKILL.md names no spelling, and what it says is refused (end - start, date + n, a date field in a timestamp-only call) is refused in the index spelling on this head.
  • No record or claim line names this head on the PR when read (three comments: docs drift, a CI reading, record 7315274427). This reviewer writes nothing to GitHub; the claim line and the label are the seat's.
  • Check-runs on this head at the last read: 41 success, 13 skipped, 22 in progress (seven Test Core shards, eleven Test UI shards, Type Check UI, the three dogfood battery shards), 0 failed. The PR is a draft. Landing checks are the seat's.
  • SQL push-down: the delta reads no data. Security: none. PR author is objectstack-fleet[bot].

④ Design judgment

  • packages/formula/src/cel-engine.ts. Two gates in place of one widened gate is the narrowest change that gives the ruling its index forms without touching a verdict another pass owns: the mismatch pass keeps its merge-base gate byte for byte, and the date-text pass, which is asked only where the mismatch pass and the bare date-text pass both answered nothing, is the only thing the index spelling opens. That ordering is why the delta can only add findings. The docblocks say which pass each gate guards and why the first stays member-only. offendingRecordRead names an index read only for the date-text caller, so the mismatch pass names fields as before.
  • packages/formula/src/validate.ts. Unchanged in substance from round 1 apart from the gate it tests; the two-leg order and the arms are as judged there.
  • The semantic entry (hits). Against its first consumer, the guidance an upgrading author reads: the FROM set, the "Not the shape" list and the acceptance sentence now describe what the head does; the replacement is unchanged and proven.
  • Tests. The pins hold the substance. Reproduced at this head on the two test files (273 tests, unmutated 273 passed):
    • shared gate re-widened (RECORD_ROOT_READ_RE admits [): 3 failed / 270 passed, the date-text-only reach test, the M1 test and the S1 control;
    • date-text gate back to the member spelling: 6 failed / 267 passed, five index rows and the reach test;
    • one-pass leg replaced by ?? null: 11 failed / 262 passed, the 9 mixed rows, the arm test and due_date - record['borrow_date'];
    • index naming off for the date-text pass: 3 failed / 270 passed;
    • reviewer mutations: second leg given the root arm, 2 failed; second leg typed with celFieldTypes (shadowing ignored), 1 failed, the shadowing control.
      So M1 and S1 cannot return through the gate without a red pin, on either arm. Not pinned, and not needed for the contract: the masked order in ① (it is the merge base's behaviour).
  • The narrowing against the published spec on main. It makes real a refusal the spec and the skill already declare for date arithmetic and timestamp-only calls, in two spellings that escaped it; it takes no declared capability away, and after this delta none of the refusals it adds is of a source I could make evaluate on a row that reaches the refused operation.

No must-fix. No should-fix.

Nits (none moves the head by itself):

  • N2 (carried, accepted as ruled): under bareNamesUnproven the mixed sentence names the proven root read where the unproven operand is the bare name.
  • N4: "no verdict an expression had before changes" holds for the code, the arm, the severity and the operands; the reference of a refusal that already stood can move when a member read and an index read of date fields share the arithmetic. record.due_date - record['borrow_date'] > duration('24h') named record.due_date on the merge base and names record.borrow_date on head (table order, as the all-member spelling is named); record.copies * record['due_date'] named no field and now names record.due_date. Every named read is in the source. One clause in the PR body or the entry would make the sentence exact.
  • N5: the entry's reason says both spellings take "the code ... their consistent spellings take"; for arithmetic against a number the index read takes date-text-arithmetic-* where the member read takes date-arithmetic-* (its surface and the changeset say so), and the same index read takes date-arithmetic-* once a member read elsewhere in the source opens the mismatch gate (record.status == 'open' && record['due_date'] + 1 > 5, on the merge base and on head). Both refuse with a prescription that works.

Implemented-by: claude/issue-35295-date-text-mixed-spelling
Reviewed-by: session_01QSeKYnrQ7UMtHofKQVjcH2

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack@os-justin · os-justin · session_01QSeKYnrQ7UMtHofKQVjcH2

L1 ACCEPT · PR #38949 (#35295) · head 5b8b6af2f89c9eab2c356d3c746a34db6c7935b9 · read 2026-12-01T15:52Z

席位核对 · ACCEPT

ACCEPT · repo:objectstack@os-justin · head 5b8b6af2f89c9eab2c356d3c746a34db6c7935b9

  1. Shape. Base main, Fixes #35295 first; no keyword binds another card. Branch matches the claim (7311362527). Delivers the maintainer's ruling C (7311348060) for item (2) and the index spelling for item (1). PR body PATCHed by the seat after patch round 1 (signed trailer).
  2. Premise measured. On the merge base all 9 mixed bare / record. / previous. date-arithmetic forms and 5 of the 6 index rows passed the publish check and faulted at run. On this head: refused with the consistent spellings' code and prescription; the ten run-today expressions B refused still pass and evaluate; the index spelling takes the date-text verdicts only (the type-mismatch pass sees index reads exactly as on the merge base).
  3. Gates (check-runs at this head). 66 success · 13 expected skip · 0 failed · 0 pending; Lint & Repo Gates and TypeScript Type Check success; Dogfood battery (opt-in) success (3/3 shards), as a narrowing owes. L2 at CONTRACT_REVIEW_TIER: FAIL 7315274427 (M1 must-fix: a refusal turned into a warning; S1 should-fix: an evaluating ordering refused) → delta PASS 7316294401 on this head (M1 and S1 closed byte-identical to the merge base; a 4,816-source generated differential shows no other change). Ablations: shared gate re-widened 3 red; date-text gate member-only 6 red; one-pass leg removed 11 red; index naming off 3 red. Corpus: 9,157 recorded calls, 0 verdict changes. The round-1 Test Core (11/12) timeout (7315142353) did not recur on this head.
  4. Accepted deviations. (a) Patch round 1 narrowed item (1)'s reach to the date-text family (a separate index-aware gate) instead of widening the shared RECORD_ROOT_READ_RE — the seat's execution parameter, re-set after L2. (b) Nits carried, accepted: N2 (under bareNamesUnproven the mixed sentence names the proven root read), N4 (the reference of an already-standing refusal can move when a member and an index read share the arithmetic), N5 (the semantic entry's reason words the index read's arithmetic-against-a-number code loosely; its surface and the changeset are exact). Three new refusals the dev listed (record['due_date'] + 1 > 5, timestamp(record['borrow_date'])…, due_date - record.borrow_date > duration('24h')) fault at run — confirmed by the delta review.
  5. Out of scope. Standing on main, filed as flow condition type verdicts: a type-mismatch warning hides a date-text refusal, .exists over date fields is refused while it runs, and a nullable-ternary minus date text passes and faults #38959 (items 1–4) plus item 5 added from the delta review (the index spelling sits outside the type-mismatch pass: record['title'] > 5 passes and faults). Docs-drift: content/docs/data-modeling/formulas.mdx rows 257–258 state the date-subtraction and timestamp() refusals spelling-agnostically ("error"); they now hold for the mixed and index spellings as written — nothing owed. Skills-docs: none holds (skills/objectstack-formula/SKILL.md states the rule without a spelling limit).
  6. Landing. Not governed (check-governed-merges --pr 38949: 0 of 6 paths, +353/−17). git merge-tree against current main clean. Narrowing with the dogfood battery green on this head: ready + auto-merge now.

Clause-②: no (narrowing) · Metadata-protocol: narrowed

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review December 1, 2026 15:53
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Dec 1, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Dec 1, 2026
@objectstack-fleet objectstack-fleet Bot added the pm:awaiting-merge PR only: landing waits on the maintainer's own review and merge (SKILL.md 复核 ②); never on an issue label Dec 1, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack@os-justin · os-justin · session_01QSeKYnrQ7UMtHofKQVjcH2

维护者速读

  • 是什么:流程条件里算两个日期的间隔时,一边直接写字段名、另一边写 record.字段 / previous.字段(或写成 record['字段']),以前发布能过、每次运行都失败;本 PR 让它们和写法一致时一样在发布时被拒,并给出同样的改法。真正认不出类型的操作数(流程变量、节点输出)照旧放行。维护者已裁定方案 C(7311348060)。
  • 为什么要你批:它收窄了作者能写的东西(Clause-② no (narrowing)),按 2026-11-19 你在 governance: the guard scripts join the governed register, .claude/** lands by declared rule-change, and a narrowed spec change lands only by the maintainer #35321 的裁决,这类 PR 由你落地。席位又一次误按普通 PR 开了自动合并,队列守卫在 2026-12-01T16:06Z 把它退了出来,没有任何改动进入 main;自动合并已关闭。
  • 风险:低。9,157 次实际调用复判 0 处结论变化;示例、文档、技能 0 处被拒;契约档复审第一轮 FAIL、修复后第二轮 PASS,无遗留项;dogfood 电池在此 head 上通过;CI 66 项全绿。
  • 要你做什么:审批本 PR,head 5b8b6af2f89c9eab2c356d3c746a34db6c7935b9;契约审核 PASS 评论 7316294401,席位 ACCEPT 7316675270。

Head-sha: 5b8b6af2f89c9eab2c356d3c746a34db6c7935b9

Queue kick, recorded: the merge-group run of this PR (group pr-38949-7b68db99…) failed on the Governed Surface Guard, which reads the declared narrowing on the body and the changeset and found no authorized APPROVED review and no authorized enqueuer. Not a flake and not this diff's code: a landing-path error by the seat, which enabled auto-merge on a narrowing PR (the second time this session; the seat's own error, recorded for its clock-out brief). Auto-merge disabled. Approval requested at the head above; after it, the seat lands it (or the approver enqueues it).

@objectstack-fleet
objectstack-fleet Bot requested a review from os-zhuang December 1, 2026 16:09
@os-zhuang
os-zhuang added this pull request to the merge queue Dec 1, 2026
Merged via the queue into main with commit be2df75 Dec 1, 2026
87 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation needs:dogfood-battery size/m tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

flow condition date-text: the index spelling record['FIELD'] and mixed bare / record. operand arithmetic still pass where record.FIELD is refused

3 participants