Repository navigation
fix(formula): a flow value envelope's date-text refusal says the run fails when the value is computed - #35358
Conversation
…wn code and value sentence (red leg) Refs the value-envelope wording card; the fix follows in the next commit. Claude-Session: https://claude.ai/code/session_01Utp6CZiaBg6rk7dpy1s9Me Co-authored-by: Claude <noreply@anthropic.com>
…fails when the value is computed The envelope took the run-may-fail arm, whose sentence names a flow condition. It now takes its own arm, value-run-may-fail, served under date-text-call-value-run-may-fail and date-text-arithmetic-value-run-may-fail. Same grade, location and fix hint; flow conditions are unchanged. Claude-Session: https://claude.ai/code/session_01Utp6CZiaBg6rk7dpy1s9Me Co-authored-by: Claude <noreply@anthropic.com>
…sweep re-measure Claude-Session: https://claude.ai/code/session_01Utp6CZiaBg6rk7dpy1s9Me Co-authored-by: Claude <noreply@anthropic.com>
📓 Docs Drift Check8 anchor(s) derived from 1 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 — 12 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 e997e922bf2bf8d3f94c4f42087ca942c4c38b9f && git checkout e997e922bf2bf8d3f94c4f42087ca942c4c38b9f
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 3819afeca1307a2c1095ff4abe2eeaa6871d1b2a 2cd098bdec6ff2b8849856fd9725bf971a7dcebf && git checkout -B drift-repro 3819afeca1307a2c1095ff4abe2eeaa6871d1b2a && git merge --no-ff 2cd098bdec6ff2b8849856fd9725bf971a7dcebf
node scripts/docs-audit/affected-docs.mjs --json 3819afeca1307a2c1095ff4abe2eeaa6871d1b2a |
|
repo:objectstack#5 · os-bill · session_01Utp6CZiaBg6rk7dpy1s9Me Final green head for L1: Checks at this head: 57 success, 11 skipped, 0 failed. Not governed ( |
|
repo:objectstack#5 · os-bill · session_01Utp6CXsZsKmgG1EcKp5bY4 维护者速读
席位核对 — ACCEPT (L1-a) · repo:objectstack#5 · head
|
|
repo:objectstack#5 · os-bill · session_01Utp6CZiaBg6rk7dpy1s9Me Landing · head
Status: |
Requested by Bill · project thread
repo:objectstack#5 · os-bill · session_01Utp6CZiaBg6rk7dpy1s9Me
Fixes #34660
Clause-②: no
Metadata-protocol: none
维护者速读
What changes
packages/formula/src/validate.ts: a flow value envelope (ExprSchemaHint.flowValueEnvelope: anassignmentvalue, acreate_record/update_recordfields.*value) now takes its own date-text outcome arm,value-run-may-fail, instead of the flow-conditionrun-may-failarm. Its fault clause reads: "this faults whereverrecord.borrow_dateholds that text when the value is computed, and a flow value that cannot be computed fails the run: the flow stops at this step and the work the flow exists to do is not done (it does not read null)." The head (what the call or arithmetic is), the fix hint, the grade (error) and the location are unchanged; both doors still prefix the value-envelope sentence.packages/formula/src/expression-refusal.ts: two codes join the closed set (params map with docblocks,CODE_TABLE):date-text-call-value-run-may-failanddate-text-arithmetic-value-run-may-fail. The names follow the ledger's one site-qualified precedent,type-mismatch-sweep-run-fails: family, then the site (value), then the outcome. The outcome staysrun-may-fail, since the envelope faults only where the field holds the text when the value is computed.DATE_TEXT_FAMILY_REalready matches both codes and is unchanged.date-text-call-run-may-fail/date-text-arithmetic-run-may-fail/-run-failsand their sentence byte for byte (the existing per-code message pins are untouched and green).@objectstack/formulapatch.Tests
validate-date-text-arithmetic.test.ts: a new top-level describe pins the shared entry both doors call. For anassignment-value source and anupdate_recordfields.*source it checks the new code, the value clause, no "condition" anywhere in the message, and the fix hint kept. CONTROL: a flow condition over the same field keeps the-run-may-failcode and its condition sentence. CONTROL: the accept set is unchanged (taught shift, datetime field, no field types). The flow value envelopes are validated without field types, so the date-text verdicts (timestamp over a date field) never reach update_record / create_record fields #34451 block's three code expectations move to the new codes.expression-refusal-codes.test.ts: one exact pin (code, params, whole message) per new code; the sweep gains a flow value-envelope schema so its positive control reaches both new codes. The sweep budget docblock records the re-measure (see Acceptance notes).Acceptance notes
registerFlow. Both doors reach the same call.@objectstack/lint'scheckDeclaredValueand@objectstack/service-automation'svalueEnvelopeRefusals(dag-traversal.ts) each callvalidateExpression('value', envelope, { fieldTypes, flowValueEnvelope: true })and prefix the message. The formula pin covers that call. The door suites live outside this claim's file surface; they assert the fix hint and the prefix, never the code or the condition wording, and they stay green. A one-shot measurement through both built doors gave the same clause from each (Verification).packages/formulakeys on the-run-may-failcodes for value envelopes.git grepofdate-text-call-run-may-fail/date-text-arithmetic-run-may-failoutsidepackages/formula/srcfinds only CHANGELOGs.EXPRESSION_REFUSAL_CODEShas no consumer outside the package, and no i18n pack, docs catalogue, skill or eval names these codes.no. The same sources are refused at the same grade; only the code and the outcome sentence change, and the accept-set CONTROL pins this. New members of the closed refusal-code set are added under anodeclaration, as with earlier code additions.registerFlow's multi-refusal header always explains template braces ("Predicates … must not wrap references in{…}template braces …"), whatever the listed refusal is. A date-text verdict is listed under that header too. Reported to the seat as a finding.席位核对
packages/formula/src/validate.ts(dateArmFault, thevalue-run-may-failbranch;flowValueEnvelopeDateTextIssue), thenpackages/formula/src/expression-refusal.ts(the two new ledger rows).pnpm --filter @objectstack/formula exec vitest run src/validate-date-text-arithmetic.test.ts src/expression-refusal-codes.test.ts. Expect 141 tests passed, including the(#34660)describe.Verification
Red leg (tests committed alone at 240b77b, source at base)
Green leg and package suites (head 2cd098b)
Both doors, measured on the built packages (one-shot, not committed)
Derived gates (head 2cd098b)
Generated by Claude Code