Repository navigation
fix(lint)!: os validate refuses an option label in a flow filter, edge condition or decision branch - #37491
Conversation
…ion branches Claude-Session: https://claude.ai/code/session_01Utp6CY2uhJ1AYNPw5TUSVS Co-authored-by: Claude <noreply@anthropic.com>
…ision branches Claude-Session: https://claude.ai/code/session_01Utp6CY2uhJ1AYNPw5TUSVS Co-authored-by: Claude <noreply@anthropic.com>
…itions and decision branches Claude-Session: https://claude.ai/code/session_01Utp6CY2uhJ1AYNPw5TUSVS Co-authored-by: Claude <noreply@anthropic.com>
📓 Docs Drift CheckThis PR changes 2 package(s): 13 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:
⛔ 7 release-owned page(s) also name something this change touched. These are read-only:
What this run could not see
Coarse fallback — 176 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 019095fdff731f7e957d2116ffe4df874509056e && git checkout 019095fdff731f7e957d2116ffe4df874509056e
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 0b1411d4a7aa6eb5880625a7cfa42276d8626824 7093e465ece700be57375a8a77bb37deec69cb5c && git checkout -B drift-repro 0b1411d4a7aa6eb5880625a7cfa42276d8626824 && git merge --no-ff 7093e465ece700be57375a8a77bb37deec69cb5c
node scripts/docs-audit/affected-docs.mjs --json 0b1411d4a7aa6eb5880625a7cfa42276d8626824
|
|
repo:objectstack#5 · os-bill · session_01Utp6CYtTDvfPQDzMbZnN5X Contract-review-claim: session_01Utp6CYtTDvfPQDzMbZnN5X · head 4e9c077 · 2026-11-26T09:26Z |
|
repo:objectstack#5 · os-bill · session_01Utp6CYtTDvfPQDzMbZnN5X Contract reviewServed-tier: PR #37491 (card #36964), declaration face. Read: the card body and its four comments (two triage notes, the claim 7186576390, the os-dev report 7187822605), follow-up card #37504, the PR body, the net diff against ① Derived judgments
Findings:
② Semver levelClause-②: the PR body and the changeset both read Two consequences for the seat:
③ Boundary flags
Implemented-by: VERDICT: FAIL |
|
repo:objectstack#5 · os-bill · session_01Utp6CYtTDvfPQDzMbZnN5X 席位核对Head-sha:
|
…r row; pin regions, operators and shadows Claude-Session: https://claude.ai/code/session_01Utp6CY2uhJ1AYNPw5TUSVS Co-authored-by: Claude <noreply@anthropic.com>
…ositions Claude-Session: https://claude.ai/code/session_01Utp6CY2uhJ1AYNPw5TUSVS Co-authored-by: Claude <noreply@anthropic.com>
|
repo:objectstack#5 · os-bill · session_01Utp6CYtTDvfPQDzMbZnN5X Contract reviewServed-tier: Delta round on PR #37491 (card #36964), after record 7188130381 (FAIL at No must-fix, no should-fix. Earlier findings:
① Derived judgments
② Semver levelClause-②:
③ Boundary flags
④ Design judgmentThe entry (
The narrowing itself. It makes a silent no-op loud; it takes no working capability away.
The rebound-root fix (
The other implementing files. Nits, none with an effect on correctness or the contract:
Implemented-by: VERDICT: PASS |
|
repo:objectstack#5 · os-bill · session_01Utp6CYtTDvfPQDzMbZnN5X 席位核对Head-sha:
|
|
repo:objectstack#5 · os-bill · session_01Utp6CY2uhJ1AYNPw5TUSVS Re-run reason (zone o5-P) · 2026-11-26T11:10Z · head |
|
repo:objectstack#5 · os-bill · session_01Utp6CY2uhJ1AYNPw5TUSVS Landing (zone o5-P) · 2026-11-26T11:12Z · ACCEPT 7190384001 at
Stale red, stated: |
|
repo:objectstack#5 · os-bill · session_01Utp6CYtTDvfPQDzMbZnN5X 维护者速读
席位意见:ACCEPT。收窄是有意的、已声明的,迁移路径是一行。剩下的 N1、N4 两条 nit 不影响正确性;skills 文案由 #37504 跟进。 |
Fixes #36964
Clause-②: no (narrowing)
Metadata-protocol: narrowed
Skills-docs: follow-up #37504
维护者速读
What changes
flow-condition-option-labelused to read one position: a record-change start condition. The same mistake, a select field compared with an option's label while the row stores the option's value, also sits in three other places, and nothing reported it there. A flow filter is handed to the data engine as written (ADR-0061 D4 resolves labels on the query surfaces, never inside an authored flow), so the label matches no row and the run still reports success.The rule now also reads, at
error(its existing severity):config.filterthe spec's expression ledger marksfilterOperands(get_record,update_record,delete_record), at any region depth, plus a time-relative start'stimeRelative.filter. An operand counts when it is a field's implicit equality, its$eq/$necomparand or a member of its$in/$ninlist, at the top level or under$and/$or/$not. The walk is the spec's ownflowFilterOperands. The finding sits at the operand's path (flows[0].nodes[1].config.filter.$or[0].stage.$in[1]) and says "matches no record", or "excludes no record" for an excluding operand.decisionbranches (conditions[].expression), in every graph of the flow, against the rows the condition can name: the trigger record on a record-change or time-relative flow (record.F,previous.F, and a bareFonly when no flow variable, node id or screen field of that name shadows it), and the row a single-rowget_recordstep (limitabsent or 1, literalobjectName) bound to itsoutputVariable(deal.F). A variable that anything else in the flow also binds is not judged.Not judged: a CEL value envelope, a variable or
{{ }}comparand, a string carrying a brace (a template or a query placeholder), a picklist field, a nested-relation condition, ordering and text operators.BREAKING: accept-set narrowing, shipped as
minor. A flow that validated and published onmainwith one of these shapes is refused now, byos validate/lint/compile/buildand at its next active publish. The schema is unchanged and stored flows are not rewritten or refused at boot. FROM → TO:filter: { stage: 'Closed Lost' }→filter: { stage: 'closed_lost' };deal.stage == 'Closed Lost'→deal.stage == 'closed_lost'. A filter operand that really means the label writes a CEL value envelope (filters only; an edge or decision condition has no escape). ADR-0087:not-required (already-registered publish-refuses-flows-that-save-and-do-not-run), and that entry'ssurfacenow names the edge condition, the decision branch and the filter operand beside the start condition.A rebound trigger root is not the trigger row. When the flow itself binds
recordorprevious(a step'soutputVariable, a loop'siteratorVariable, an assignment target, a declared variable), that root is dropped from the trigger reader:record.Fafter the binding is another row's field.Rule id. One existing id, no new one. The filter operand goes to
flow-condition-option-labeland not toflow-node-write-unknown-option, because the write rule's verdict is "the record validator refuses the write (invalid_option) and the step fails". That is false for a filter: nothing refuses a filter operand, the step succeeds on nothing.validate-flow-node-writes.tsgains a comment that says so and no code.authoring-rules.ts,rule-explanations.tsandindex.tsare untouched, so no registry or wiring change is needed.Severity.
errorat every new position, the start condition's severity, decided by the #5762 question in the trigger-readiness header: is this stack enough to know? It is. The label, the field's inline options and the object are all in the stack, and nothing installed changes what the row stores. A filter that really means to find rows still holding a label (a clean-up after the options changed) writes the operand as a CEL value envelope, which is not judged. The changeset says this.flow-select-options.ts:optionLabelComparisonstakes an optionalFieldReads(the roots a read is spelled under, whether a bare read counts, and which names shadow it). Its default builds the same regular expression as before, so the start condition reads exactly what it read. A newoptionLabelOperands(filter, options)reads filters.Tests
New describe in flow-publish-checks-second-batch.test.ts (the shared harness for these ids), 14 cases, head 7093e46
get_recordfilter (path, severity, exact hint);update_record$eq;delete_record$orwith an$inmember and a multiselect;$nesays "excludes no record"; a filter inside aloopbody; a time-relativetimeRelative.filter.deal.stage == 'Closed Lost'over aget_recordoutputVariable: 'deal'(a string, and a CEL envelope within [...]); an edge on a record-change flow readingrecord.stage; adecisionnode'sconditions[0].expression; a barestageon a record-change flow.'{{wanted_stage}}'operand; an envelope$inmember; a picklist field; a nested relation;$gt; a variable comparand; a{{ }}comparand; aget_recordwithlimit: 5; a templatedobjectName; an output variable also declared invariables; a bare read on a manual flow; a bare read shadowed by a variable.$notover$ne(matches no record),$nin(excludes no record),$and.loopbody (flows[0].nodes[5].config.body.edges[0].condition) and adecisionbranch inside aparallelbranch (...config.branches[0].nodes[0].config.conditions[0].expression).record.stage, andprevious.stageon a record-change flow.recordrebound by aget_recordoutputVariable, a loopiteratorVariableand an assignment, where'Closed Lost'is a label on the trigger object'sstageand a value on the other object'sstage(control with an unrelated binder: reported); a variable twoget_recordsteps bind to different objects; a variable shadowed by a node id and by a screen field; a bare read shadowed by a node id and by a screen field.os validate(runAuthoringRules('validate')) reports it, and the runtime publish gate refuses both an edge flow and a filter flow write.Ablations: one per new read site, through scripts/ablation-replace.mjs (anchor hit, blob moved, restored blob equals HEAD)
FILTER_NODE_TYPESguard turned into an unconditionalcontinuetimeRelative.filterbranch made unreachableholder.edgesloop made unreachabledecisionguard made always-skipreaders.pushfor a bound row removedrootsno longer filtered by the bound namesrecordcaseThe first attempt at the CRUD-filter ablation replaced the guard with a bare
continue;, which already appeared in the file 17 times. The tool refused it because the replacement count did not rise by one, and nothing ran. It was redone with a distinct replacement, and that run is the row above.Acceptance notes
os explain flow-condition-option-labelstill says "why a start condition compares option values" and describes the start condition only.rule-explanations.tsis held by an open PR and fenced off this card. Follow-up reported to the seat.skills/objectstack-automation/SKILL.md§4 says "A label in afilteror an edgeconditionis never checked: it silently matches nothing". This PR makes that sentence false.skills/**is governed and fenced off this card. Follow-up reported to the seat.config.condition, a node-levelconfig.conditionon non-start nodes,NODE_ID.record.Freads, a loop iterator over a listget_record, and a field of a related object (nested relation). Each needs its own row-typing decision.readonlyselect is judged here, as the start-condition half already judges it (the changeset says so too). The write rule skipsreadonlybecause the validator judges such a value by shape only. A row of a readonly select could hold a non-option code, but an option label is not something the platform writes.Read first
packages/lint/src/validate-flow-trigger-readiness.ts,optionLabelsBeyondStart: the row-variable typing (single-rowget_record, ambiguity drop, bare-read shadowing). This is where a false positive would come from.packages/lint/src/flow-select-options.ts,optionLabelOperands: the operand path parsing (combinators, operator set, list members).packages/lint/src/flow-select-options.ts,readOf: the default must stay byte-identical to the old start-condition expression.Verification
Two minutes:
pnpm --filter @objectstack/lint exec vitest run --maxWorkers=2 src/flow-publish-checks-second-batch.test.ts. ExpectTests 49 passed (49), with the 14 cases under "flow-condition-option-label past the start condition (#36964)" green.Generated by Claude Code