You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit ae05f2e
Browse filesBrowse the repository at this point in the historyBrowse files
fix(spec): make what collectFlowGraphs RETURNS match its declared FlowNodeParsed[] (#16922)
* fix(spec): drop a non-record member from what collectFlowGraphs hands out
`collectFlowGraphs` declares each `FlowGraph.nodes` as `readonly
FlowNodeParsed[]`, then pushed the list verbatim. That list is one the walk
picks up ITSELF out of a container's open `z.record` config, after an
`Array.isArray` that proves the LIST and never its MEMBERS — so an empty YAML
list item under a `loop` body reached a returned graph as `null`, at every
depth, and no coercion at a call site could reach it.
Filter what is handed out and skip what is walked through one predicate
(`isRegionDict`), preserving array identity when nothing is dropped. The walk
runs inside `FlowSchema`'s parse, so this stays a drop and a skip: a throw here
would escape `safeParse` rather than become an issue. `path` stays indexed over
the raw list, so a Zod issue is still anchored where the author wrote the node.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016N6xmWt5hYm94ffVEwGH8x
* test(lint): retire the two graph-shaped RESIDUAL_THROWS rows the producer fix earned
Re-measured with all four rows still present: the two
`flows[].nodes[].config.body.nodes` rows went red demanding a throw that no
longer happens, while both `flows[].nodes` rows stayed green — those are
`lint-flow-patterns.ts` reading `flow.nodes` itself, untouched by a producer
repair. Remove the two that stopped being earned, keep the two that did not,
and correct the prose that described the retired pair as live.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016N6xmWt5hYm94ffVEwGH8x
* chore(changeset): declare the collectFlowGraphs return-contract repair
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016N6xmWt5hYm94ffVEwGH8x
---------
Co-authored-by: Claude <noreply@anthropic.com>
`collectFlowGraphs` now honours the `readonly FlowNodeParsed[]` it declares: a member of a region's node list that is not a record is dropped from the `FlowGraph` it hands out, instead of being passed through verbatim.
6
+
7
+
An ADR-0031 container keeps a whole sub-graph inside `FlowNodeSchema.config`, a deliberately open `z.record`, so `collectFlowGraphs` re-derives those inner node lists at run time and checks them with `Array.isArray` — which proves the LIST and never its MEMBERS. An empty item in a YAML `nodes:` list under a `loop` body deserialises to `null`, and that `null` reached `graph.nodes` on every returned graph, at every depth. No caller could prevent it: this is an array the walk picks up itself, so no coercion at a call site ever holds it. Filed as #16752.
8
+
9
+
-**What changed.** The walk filters what it hands out and skips what it descends into, through one predicate. Array identity is preserved when nothing is dropped, so a well-formed flow allocates nothing new.
10
+
-**What deliberately did NOT change.** The declared input type is untouched — widening it to tolerate malformed members was refused on the anti-AI-error axis, and this is the opposite move: the producer now keeps the promise it already made. The schema refusal that owns a malformed region still fires, unchanged; this walk runs inside `FlowSchema`'s parse, where a thrown `TypeError` would escape `safeParse`, so the repair is a drop and a skip and never a throw. `FlowGraph.path` still indexes the raw authored list, so a Zod issue stays anchored where the author wrote the node.
11
+
-**Visible consequence.** As with the sibling repairs that read their lists through a record filter, a dropped member renumbers the ones behind it *within*`graph.nodes` — a difference in the index, never in whether a node was judged, and only in a list that was already malformed.
0 commit comments