pub enum Node {
Step {
ref_: String,
in_: Expr,
out: Expr,
},
Seq {
children: Vec<Node>,
},
Branch {
cond: Expr,
then_: Box<Node>,
else_: Box<Node>,
},
Fanout {
items: Expr,
bind: Expr,
body: Box<Node>,
join: JoinMode,
out: Expr,
},
Loop {
counter: Expr,
cond: Expr,
body: Box<Node>,
max: u32,
},
Try {
body: Box<Node>,
catch: Box<Node>,
err_at: Option<Expr>,
},
Assign {
at: Expr,
value: Expr,
},
}Expand description
flow.ir Node kind.
Discriminated with kind tag, deny_unknown_fields (open=false),
rename_all = "snake_case". Parser-side coverage: Step / Seq / Branch +
Fanout (canonical schema の fanout Node、 4 join mode)。 残り Node kind
(let / loop / call / switch / try / map / reduce / etc) は別 turn carry。
Variants§
Step
Step — dispatch a referenced operation with in input, write result to out.
Seq
Seq — evaluate children in order, threading the context value through.
Branch
Branch — eval cond; if true run then, else run else.
Fanout
Fanout — eval items to an array, run body per item against a
branch-local ctx (caller ctx + item written to bind), join results
per join mode into out. Async parallel runner uses
futures::future::{try_join_all|select_ok|join_all} (executor-agnostic).
Loop
Loop — counter を 0 から、 cond が truthy かつ counter < max の間
body を eval。 各 iter 後 counter を increment して counter path に書く。
VerdictLoop 等の retry/poll パターン primitive (canonical schema 整合)。
Try
Try — body を eval、 raise した場合 catch を eval。
err_at が Some なら catch 開始前に error message を ctx に書く。
Assign
Assign — pure transform Node。 value Expr を ctx snapshot 上で評価し、
結果を at (Path Expr) に write する。 dispatcher 不要、 副作用は
CtxStorage.write 1 回のみ。 Seq の中で Step 間の Adhoc update 表現に
使う (= IR primitive、 Command 履歴は CtxStorage の write hook 経由で取得)。