Skip to content

fix(formula): a flow value envelope's date-text refusal says the run fails when the value is computed - #35358

Merged
objectstack-fleet[bot] merged 3 commits into
mainfrom
claude/issue-34660-value-envelope-refusal-wording
Nov 19, 2026
Merged

objectstack-fleet[bot] merged 3 commits into
mainfrom
claude/issue-34660-value-envelope-refusal-wording

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by Bill · project thread

repo:objectstack#5 · os-bill · session_01Utp6CZiaBg6rk7dpy1s9Me

Fixes #34660

Clause-②: no
Metadata-protocol: none

维护者速读

  1. 流程作者在流程的赋值或记录写入步骤里把日期字段当文本计算时,校验和发布时的报错原来说“条件运行时流程会失败”,现在改为说“计算这个值时流程会在这一步停下”。
  2. 这一步根本没有条件,旧说法会让作者去找一个不存在的条件,这是流程报错文案的体验问题。
  3. 出错时只是这条报错的措辞或代码不对,同样的写法仍然被拒绝,流程条件处的报错不受影响,回滚即可恢复原样。
  4. 无。

What changes

  • packages/formula/src/validate.ts: a flow value envelope (ExprSchemaHint.flowValueEnvelope: an assignment value, a create_record / update_record fields.* value) now takes its own date-text outcome arm, value-run-may-fail, instead of the flow-condition run-may-fail arm. Its fault clause reads: "this faults wherever record.borrow_date holds 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-fail and date-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 stays run-may-fail, since the envelope faults only where the field holds the text when the value is computed. DATE_TEXT_FAMILY_RE already matches both codes and is unchanged.
  • Flow conditions keep date-text-call-run-may-fail / date-text-arithmetic-run-may-fail / -run-fails and their sentence byte for byte (the existing per-code message pins are untouched and green).
  • Changeset: @objectstack/formula patch.

Tests

  • validate-date-text-arithmetic.test.ts: a new top-level describe pins the shared entry both doors call. For an assignment-value source and an update_record fields.* 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-fail code 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

  • One verdict for lint and registerFlow. Both doors reach the same call. @objectstack/lint's checkDeclaredValue and @objectstack/service-automation's valueEnvelopeRefusals (dag-traversal.ts) each call validateExpression('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).
  • A1 holds. No code reader outside packages/formula keys on the -run-may-fail codes for value envelopes. git grep of date-text-call-run-may-fail / date-text-arithmetic-run-may-fail outside packages/formula/src finds only CHANGELOGs. EXPRESSION_REFUSAL_CODES has no consumer outside the package, and no i18n pack, docs catalogue, skill or eval names these codes.
  • A2 holds. Clause-② stays 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 a no declaration, as with earlier code additions.
  • Sweep budget. The sweep grew from 15 schemas to 16. Measured locally (4 vCPU, file alone): 192 to 225 ms with the new schema, 186 to 267 ms for the base 15 in the same session. The 16th schema stands down on every source but a date field's value, so the 16000 ms budget stands, and the docblock records the reading.
  • Seen, not fixed here: 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.

席位核对

  • Read first: packages/formula/src/validate.ts (dateArmFault, the value-run-may-fail branch; flowValueEnvelopeDateTextIssue), then packages/formula/src/expression-refusal.ts (the two new ledger rows).
  • Two-minute check: 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)
× refuses the measured expression under the value-run-may-fail arm, with the addDays shift
× refuses the bare call, a previous.FIELD read, and date-text arithmetic over record.FIELD
× an assignment value: the value arm's code and sentence, at the same grade, with the fix hint kept
× an update_record fields.* value: the value arm's code and sentence, at the same grade, with the fix hint kept
× has a pin for every code, and no pin for a code outside the set
AssertionError: expected [ 'date-text-call-run-may-fail' ] to deeply equal [ 'date-text-call-value-run-may-fail' ]
Test Files  2 failed (2) · Tests  5 failed | 134 passed (139)
os-verify-lock: VERDICT command-exit 1
Green leg and package suites (head 2cd098b)
vitest run src/validate-date-text-arithmetic.test.ts src/expression-refusal-codes.test.ts
Test Files  2 passed (2) · Tests  141 passed (141) · VERDICT command-exit 0
pnpm --filter @objectstack/formula test
Test Files  68 passed (68) · Tests  1888 passed (1888) · VERDICT command-exit 0
pnpm --filter @objectstack/formula typecheck
check:test-typecheck: OK · VERDICT command-exit 0
service-automation src/builtin/assignment-value-envelope.test.ts: Tests 76 passed (76)
lint src/validate-expressions.test.ts: Tests 515 passed (515) · VERDICT command-exit 0
Both doors, measured on the built packages (one-shot, not committed)
== assignment `timestamp(record.borrow_date)`
 lint: error flows[0].nodes[1].config.assignments.due
 lint clause: this faults wherever `record.borrow_date` holds 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).
 registerFlow clause: (identical)
== update_record `record.due_date - record.borrow_date`
 lint: error flows[0].nodes[1].config.fields.due_date
 registerFlow clause: (identical to lint)
Derived gates (head 2cd098b)
dispatch-gates --commands --repo objectstack-ai/objectstack: 65 commands derived (5 changed paths vs merge base 81c094779)
64 exit 0; 1 exit 3 PREREQUISITE NOT MET: pnpm check:dual-build-cjs-loads (workspace dist not built), NOT MEASURED locally, CI Lint & Repo Gates runs it
--ran: 65 derived famil(ies) accounted for — 64 run, 1 NOT-MEASURED (1 DERIVED from a recorded exit 3), 0 UNRUN
pnpm check:nul-bytes: exit 0 (in the derived set)
overlap-check --branch=claude/issue-34660-value-envelope-refusal-wording: origin/main merges cleanly, 0 PR heads share a file, VERDICT clean exit 0
test:repo (vitest repo project): not run locally, CI Test Core runs it

Generated by Claude Code

…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>
@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 Nov 19, 2026
@github-actions

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

8 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
  • the SDK route bridge reached 65 of 247 client-bound route-ledger rows — the other 182 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 182: 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; 123 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 — 12 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 3819afeca1307a2c1095ff4abe2eeaa6871d1b2a → packageMentionDocs.

Which tree this was computed on

This run read content/docs from e997e922bf2bf8d3f94c4f42087ca942c4c38b9f — the merge of head 2cd098bdec6ff2b8849856fd9725bf971a7dcebf into base 3819afeca1307a2c1095ff4abe2eeaa6871d1b2a, 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 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

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

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-bill · session_01Utp6CZiaBg6rk7dpy1s9Me

Final green head for L1: 2cd098bdec6ff2b8849856fd9725bf971a7dcebf · 2026-11-19T06:38Z

Checks at this head: 57 success, 11 skipped, 0 failed. Not governed (check-governed-merges.mjs --pr 35358: 0 of 5 paths, 213 lines). No packages/spec/src path, so no contract record is owed. Clause-②: no (same sources refused at the same grade; only the code and the outcome sentence at a value slot change; new codes follow the #32817 precedent) · Metadata-protocol: none. K = 12 (< 15). os-dev report on #34660 (7001256122); file /mnt/project-files/objectstack-seat5/area-ux/ux-3/report-34660.md.
Sent to the L1 thread; the area lands after its ACCEPT.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-bill · session_01Utp6CXsZsKmgG1EcKp5bY4

维护者速读

  • 用户能看到什么变化:流程里“给字段赋值”的那一步,如果把日期字段的文字直接拿去计算,校验给出的报错现在说“计算这个值时流程会失败、停在这一步”,不再错说成“条件运行时”。
  • 为什么做:赋值这一步根本没有条件,旧说法会让写流程的人找错地方。
  • 出错会怎样:拦下来的写法、严重程度和修改建议都没变,只是报错文字换了;靠报错编号做自动处理的人需要认新编号。
  • 要你做什么:不需要你做任何事,区域审完自己落地。

席位核对 — ACCEPT (L1-a) · repo:objectstack#5 · head 2cd098bdec6ff2b8849856fd9725bf971a7dcebf · 2026-11-19T06:39Z

  • 形态 — 5 files, +191/−22 (213 lines), all packages/formula/src/** plus one changeset. No packages/spec/src path. Base 81c09477, main moved K=12 first-parent commits (< 15, no merge needed). check-governed-merges.mjs --pr 35358: not governed, under the 3000-line limit. Clause-②: no, Metadata-protocol: none.
  • Fixes vs card flow value envelopes refuse with condition wording: the date-text verdicts say "when the condition runs … a flow condition" at an update_record / create_record / assignment value slot #34660 — flowValueEnvelopeDateTextIssue now passes the new value-run-may-fail arm (DateTextArm = DateArm | 'value-run-may-fail'). The code is built as date-text-{arithmetic,call}-${flowArm}, so the envelope gets date-text-arithmetic-value-run-may-fail / date-text-call-value-run-may-fail. dateArmFault gives that arm its own clause ("when the value is computed … the flow stops at this step …") and returns before the condition sentence, so flattened conditions keep -run-fails / -run-may-fail text byte for byte. Both codes are in ExpressionRefusalParams (with the params of the code each splits from) and in CODE_TABLE. The date-arithmetic family never reaches an envelope, so it has no new arm. All three "Done when" items are met: value wording, ledger registration, and one verdict for both doors (via the shared entry; see deviations).
  • Clause-② no — agreed — the accept set, grade (error), location, leading envelope sentence and fix hint are unchanged; only the code and the outcome sentence change on envelope sites. The changeset tells a consumer keyed to the old codes on an envelope to re-key. The dev found no consumer of these codes outside packages/formula beyond changelogs.
  • Changeset — @objectstack/formula patch, read sentence by sentence against the diff: both envelope kinds, both example sources, the quoted old and new sentences (the new one matches dateArmFault verbatim), the two codes and their params, ExprSchemaHint.flowValueEnvelope, and the "Unchanged" list all match.
  • Pins — expression-refusal-codes.test.ts: a PINS entry for each new code with its exact params and full message (the call pin carries the shift clause), and a 16th sweep schema (flowValueEnvelope: true, a date field) so the sweep's positive control reaches them. validate-date-text-arithmetic.test.ts moves the envelope cases to the new codes. The red leg is recorded at 240b77bf9c (5 failed, then green 141/141).
  • 门禁 — 68 check-runs on this head: 57 success, 11 skipped (path-filtered), 0 failure.
  • 接受的偏差 — (1) The "lint and registerFlow keep one verdict" pin sits on the shared validateExpression(..., { flowValueEnvelope: true }) entry that both doors call. Pinning through both callers would need test files in lint and service-automation, outside the fence. Both doors were measured once on built packages (PR Verification). Accepted. (2) The sweep grew from 15 to 16 schemas, with timing re-measured and recorded in the docblock (192–225 ms vs 186–267 ms), and the budget unchanged. Accepted.
  • 范围外去向 — the registerFlow refusal header always explains template braces, whatever refusal sits under it (service-automation/src/flow-registration-checks.ts ~:1047). This is pre-existing and misleading, but not a correctness, red-line or security issue, so it does not block. Route: ux-3 files its drafted card, nested under flow value envelopes refuse with condition wording: the date-text verdicts say "when the condition runs … a flow condition" at an update_record / create_record / assignment value slot #34660.
  • 落地条款 — not governed: ux-3 lands this head after this ACCEPT. A new push needs a fresh L1 only if it changes more than a main merge.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-bill · session_01Utp6CZiaBg6rk7dpy1s9Me

Landing · head 2cd098bdec · after L1-a ACCEPT 7001828368 · 2026-11-19T06:40Z

Probe Reading
Checks at head 2cd098bdec 57 success, 11 skipped, 0 failed
check-governed-merges.mjs --pr 35358 NOT governed, 0 of 5 paths, 213 lines
K 12 (< 15), no locale pack

Status: pr_ready + automerge_enable. On MERGED the area closes out #34660. The out-of-scope finding (the flow registration header names template braces for every refusal) is filed as its own card under #34660, as the ACCEPT routes it.

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 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

2 participants