Repository navigation
fix(formula): a date ordered against a text field gets its own refusal code, date-text-ordering - #39148
Conversation
…ing verdict 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>
…card pins 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>
…em4-date-text-ordering-code
📓 Docs Drift Check7 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 — 16 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 af603c834a9fdf6ea014e5f3d6ae1f86ab7dc273 && git checkout af603c834a9fdf6ea014e5f3d6ae1f86ab7dc273
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 8236b793b19c942debd9df6a05fe3818593995b9 c18de9c61d02f22725e4826388d59a69027cb0ef && git checkout -B drift-repro 8236b793b19c942debd9df6a05fe3818593995b9 && git merge --no-ff c18de9c61d02f22725e4826388d59a69027cb0ef
node scripts/docs-audit/affected-docs.mjs --json 8236b793b19c942debd9df6a05fe3818593995b9 |
|
repo:objectstack@os-justin · os-justin · session_01QSeKYnrQ7UMtHofKQVjcH2 Contract-review-claim: session_01QSeKYnrQ7UMtHofKQVjcH2 · head 0fee6f4 · 2026-12-02T14:53Z First record. Face: the |
|
repo:objectstack@os-justin · os-justin · session_01QSeKYnrQ7UMtHofKQVjcH2 Contract reviewServed-tier: Face: the ① Derived judgments1. The vocabulary change: added the way the closed set is extended.
Naming. The dev's claim holds: in this ledger, a suffix names the fault outcome a sentence states. This verdict states none, and its sentence is identical at every site, so it gets one code with no suffix. That is the precedent of 2. The verdict is not reopened: same sources, same grade per site.
Declared precedence change (
3. The sentence is true for present values. Measured at runtime with
4. Consumers.
5.
6. Changeset (
7. Tests and ablations, run locally. Isolated worktree at
② Semver level
③ Boundary flags
FindingsS1 (should-fix) — In a mixed source, the new code's params and sentence can describe something other than the ordering.
N1 (nit): "does not fault" is unqualified.
N2 (nit, outside the diff, read only):
N3 (nit): the #30026 note ( Implemented-by: VERDICT: PASS |
…perands and counterpart (#38959 item 4, L2 S1) In a mixed source the Timestamp typing's first fault need not be the kept ordering, and the first text field need not be its counterpart. The #32595 walk now reports the comparison it keeps (an ordering first, then an equality), and validate.ts reads the params and sentence from it. Grade and code are unchanged: field and root, which grade under bareNamesUnproven, are untouched. Lint: the #30026 counter comment and note say which codes are softened. Claude-Session: https://claude.ai/code/session_01QSeKYnrQ7UMtHofKQVjcH2 Co-authored-by: Claude <noreply@anthropic.com>
…able ordering-over-equality preference (#38959 item 4, L2 S1) The checker's first fault masks an equality met before an ordering, so no source reaches the preference; the walk reports the comparison it stops at. Claude-Session: https://claude.ai/code/session_01QSeKYnrQ7UMtHofKQVjcH2 Co-authored-by: Claude <noreply@anthropic.com>
|
repo:objectstack@os-justin · os-justin · session_01QSeKYnrQ7UMtHofKQVjcH2 Contract-review-claim: session_01QSeKYnrQ7UMtHofKQVjcH2 · head c18de9c · 2026-12-02T16:26Z Delta record after the S1 should-fix in 7349732810. The same reviewer reads it at |
|
repo:objectstack@os-justin · os-justin · session_01QSeKYnrQ7UMtHofKQVjcH2 Contract reviewServed-tier: Delta of record 7349732810 (PASS at
① Derived judgmentsS1: closed.
Sweep: the delta moves params and sentence only. I generated 1,286 sources and judged each at 7 sites (predicate), 7,538 judgments in all:
N3: closed.
Declared deviation:
Pins.
Runs (isolated worktree at
② Semver levelUnchanged from 7349732810. ③ Boundary flagsOut-of-scope (a), an equality ahead of an ordering masks the ordering: it does not block this PR and is not graded here.
Out-of-scope (b),
Dev flag, the ordering-over-equality preference removed in SQL push-down: not applicable. Nothing in this diff materialises ids or joins in-app. Nits:
S1: closed. No must-fix, no should-fix. Implemented-by: VERDICT: PASS |
|
repo:objectstack@os-justin · os-justin · session_01QSeKYnrQ7UMtHofKQVjcH2 L1 ACCEPT · PR #39148 (#38959 item 4, ruling 7344060050 option A) · head Seat check · ACCEPTACCEPT · repo:objectstack@os-justin · head
|
Part of #38959
Item 4 only, ruled option A in 7344060050. Items 1, 5 and 2 landed in #39072, and item 3 is recorded as accepted fail-open; the seat closes the card when this lands.
Clause-②: yes
Metadata-protocol: none
Skills-docs: none — the kind is
nonewith no arm, andskills/objectstack-formulanames notype-mismatch*code for this shape维护者速读
date-text-ordering,说的是实际发生的事——按文本逐字比较,不会运行出错;该拦截的照样拦截,级别(错误/警告)不变。Fix round (contract review 7349732810, S1 and N3), head
c18de9c61ddate-text-orderingnow come from the comparison that keeps the verdict.comparesDateTextAgainstUndeclaredreturns that comparison instead of a boolean: its operator, its operand types and its counterpart.firstTypeMismatchpasses the comparison on asordering, andvalidate.tsreads the params and sentence from it.fieldandrootare untouched, so the grade cannot move.dateTextOrdering: trueflag that thecel-engine.tsbullet and the ablation lines below describe.referenceis narrower. It now appears only for a direct text-field read. Computed text (upper(record.title),string(record.notes), a concatenation) loses it, and the sentence then reads "a text value". An index readrecord['title']gainsreference: record.title. The params type is unchanged.#30026note are reworded; prose only.No must-fix, no should-fix.What changes
@objectstack/formula,expression-refusal.ts. One new code in the closed refusal vocabulary,date-text-ordering, paramsoperands,operator,reference?(the text counterpart as written, when it is a field read). Its pin file holds three pins: a formula-field warning, a record-triggered flow error with the reversed operand order, and a counterpart that is no field read.validate.ts,typeSoundnessIssue. Where the type mismatch is the kept date-against-text ordering (the 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 verdict, unchanged), the refusal isdate-text-orderingwith a sentence that says what the run does: the runtime holds the date field as its text, so the comparison evaluates as a text comparison and does not fault, answering by spelling, not by date. It prescribesdate(TEXT)to compare dates (null where the text is no date) orstring(...)on the date side to compare text on purpose. Both prescriptions are pinned clean at every site and evaluated.type-mismatch*code carried: an error at a site that declares its fault outcome (fail-closed rule, advisory rule, record-triggered flow, sweep of the typed object, a member read underbareNamesUnproven), a warning elsewhere (formula field, flow condition with no declared outcome, unproven bare name). Review S3 on fix(formula)!: flow-condition verdicts agree with the run — severity, the index spelling, macro variables #39072 stays as ruled: the three S3 sources keep the warning grade, now under the new code.date-text-ordering-run-may-failwas not taken. In this ledger a-run-fails/-run-may-fail/-fail-closed/-fail-open/-sweep-run-fails/-value-run-may-failsuffix names the fault outcome a sentence states at one site. This verdict has no fault, so it has no outcome to name, and its sentence is the same at every site. The contract ("a code names ONE message template") then gives one code with no suffix. That is the precedent oflist-equalityanddate-duration-value, and the shape of thedate-text-arithmetic/date-text-callfamily names. It does not matchDATE_TEXT_FAMILY_RE(date-text-(call|arithmetic)), so the item-1 precedence never takes it as a date-text fault.record.due_date > record.title && record.due_date - record.borrow_date > duration('1h')), the date-text error wins at error sites too. At warning sites it already won (item 1). At error sites this moves the code fromtype-mismatch*-failstodate-text-arithmetic*, at the same grade.cel-engine.ts.firstTypeMismatchreports which mismatch is the kept ordering (dateTextOrdering: true, from thekeptOrderingflag it already computed). This is three code lines (one result field, two spreads) and their doc comment beyond the claim's "comment only" surface, declared below. The two comments that still called item 4 open are rewritten (N8):cel-engine.ts, besideoffendingRecordRead(..., !keptOrdering), and the S3 pin's comment invalidate-date-text-arithmetic.test.ts.@objectstack/lint,validate-expressions.ts. This is one consumer branch that matched the old code on this shape. The#30026note, which says why a time-relative sweep of another object only warns, fired ontype-mismatch-run-may-failwarnings. The ordering was served as that code, so the note was printed for it. It now countsdate-text-orderingwarnings at a flow condition too, so the note still prints for the ordering, as before. Without this, the note would silently drop fordue_date > titleon such a flow (measured on the built lint: the warning alone, no note).Consumer pins of the old code on this shape
Updated, every one:
packages/formula/src/validate-date-text-arithmetic.test.ts: the 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 rows (eight ordering rows,type-mismatch-fail-closedtodate-text-ordering;record.title < today()keepstype-mismatch-fail-closedas the control), the flattened macro row (type-mismatch-run-may-failtodate-text-ordering), the flow condition type verdicts: a type-mismatch warning hides a date-text refusal,.existsover date fields is refused while it runs, and a nullable-ternary minus date text passes and faults #38959 macro pins ([due_date].exists(d, d > title)and the inner-map source,type-mismatch-run-failstodate-text-ordering), and the S3 pin (three sourceswarning:type-mismatch-run-may-failtowarning:date-text-ordering, member controlerror:type-mismatch-run-failstoerror:date-text-ordering).packages/formula/src/expression-refusal-codes.test.ts: the new code's pins, and one sweep source (record.close_date < record.name) so the closed-set sweep reaches it. The sweep budget docblock's call count (a volatile count) is replaced by its formula, per AGENTS.md.packages/lint/src/validate-expressions.ts(source, above).Searched, with nothing pinning the old code or sentence on this shape. Each suite below ran green against the rebuilt formula:
packages/objectql/src/publish-type-mismatch-fail-closed.test.ts(12 passed),packages/services/service-automation/src/flow-registration-checks.test.ts(35 passed);@objectstack/lintsuite (261 files, 10,327 passed);packages/mcp/src/mcp-validate-expression.test.ts(80 passed);INVALID_METADATAwith the message, and the grade is unchanged, so the status is too;git grepof tests,packages/qa,examplesanddocs/qafor the old sentence on a date-vs-text source and for the operand spellingsTimestamp < string/string < google.protobuf.Timestamp: no hit outside formula.Tests
validate-date-text-arithmetic.test.ts, "a date ordered against a text field is served under its own code, with a true sentence (flow condition type verdicts: a type-mismatch warning hides a date-text refusal,.existsover date fields is refused while it runs, and a nullable-ternary minus date text passes and faults #38959 item 4)". It covers:record.due_date > record.titleand its reverse, and a datetime pair, at seven sites, each at the grade the old code carried there;record.title > 5,record.title < today()) keepstype-mismatch*at every site and faults;packages/lint/src/validate-expressions.mismatch-precedence-38959.test.ts(spec-valid fixtures). It covers the publish lint over:title > 5keepstype mismatch.INVALID_METADATA, so nostatusassertion applies.codeis asserted at the formula layer.Runs at 0fee6f4 (after merging origin/main 27ce3c0)
pnpm --filter @objectstack/formula build && … vitest run --maxWorkers=2: 72 files, 2270 passed;@objectstack/lintvitest: 261 files, 10327 passed (oneos-verify-lockrun, VERDICT command-exit 0).pnpm --filter @objectstack/formula typecheckandpnpm --filter @objectstack/lint typecheck(both includecheck:test-typecheck): exit 0, at 037ff18 (pre-merge; the merge brought no formula or lint change).mcp-validate-expression.test.ts80 passed; objectqlpublish-type-mismatch-fail-closed.test.ts12 passed; service-automationflow-registration-checks.test.ts35 passed (against the rebuilt formula and lint).expression-refusal-codes.test.tsalone: 461 ms and 252 ms, against its 16 000 ms budget.Ablations (scripts/ablation-replace.mjs, each restore verified: blob equals HEAD, git diff HEAD empty)
if (mismatch.dateTextOrdering) {toif (false) {(the new branch): the two formula files, 34 failed.}, true);to}, false);(date-text precedence at every grade): 5 failed, the precedence pins at the error sites.cel-engine.tsroot-pass flag to...(false ? …): 14 failed. First-pass flag to...(false ? …): 18 failed.(w.code === 'date-text-ordering' && scope === 'flattened')to(false): 1 failed, the sweep-note pin.Acceptance notes
cel-engine.tsfor its comment only. The verdict's identity is known only insidefirstTypeMismatch(keptOrdering), so three code lines there carry it out. Rebuilding it invalidate.tsfrom the operand spelling would mislabelbool + DateTextreal faults. The lint source line is the consumer branch named above. Both are outside the stated surface and are reported to the seat.record.due_date > record.title || record.active + 1 > 2anddue_date > title && notes * 2 > 1answer thebool + int/string * intmismatch under itstype-mismatch*code, not the ordering. The new sentence speaks of "this comparison" only.packages/spec/src/migrations/entries/semantic/19.flow-condition-mismatch-warning-and-index-mismatch-refused.ts(fix(formula)!: flow-condition verdicts agree with the run — severity, the index spelling, macro variables #39072) describes the ordering as "the mismatch kept as before" and its warning grade. Both still hold in grade, and it names no code for it. It is untouched.content/docs/releases/**andCHANGELOG.mdare untouched; the changeset names the code move.Verification
Read first, by risk:
packages/formula/src/validate.ts: theif (mismatch.dateTextOrdering)branch anddateTextOver(…, always).packages/formula/src/cel-engine.ts: the twodateTextOrderingspreads.packages/lint/src/validate-expressions.ts: the counter line.Two-minute check:
pnpm --filter @objectstack/formula exec vitest run --maxWorkers=2 src/validate-date-text-arithmetic.test.ts -t "item 4". Expect every case green, including the seven per-site grade cases for each pair and the two CONTROL blocks.Gates: dispatch-gates --commands (71 families) and --ran reconciliation
node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstackat 0fee6f4: 71 families.--ranreconciliation: "71 derived famil(ies) accounted for — 67 run, 4 NOT-MEASURED".check:dual-build-cjs-loads: exit 3, needs a full build;check:query-options-erasure: exit 124 at my 200 s per-gate timeout;check:slot-lookupandcheck:type-check-debt: not started, over the foreground cap in the earlier rounds on this card.check:nul-bytes,check:doc-authoring,check:issue-citations,check:adr-0087-registration --base origin/main,check:empty-changeset,check:changeset-no-major,check:closing-keyword-parity: exit 0.Generated by Claude Code