pub fn is_simple_chain(graph: &NodeGraph, branches: &Branches) -> boolExpand description
Whether a graph is a strict linear chain — a single strand where node
i’s sole input (if any) is FromNode of node i-1, nothing more:
branchesmust be empty (no conditional dispatch to encode).- No node declares
repeat_until(no loop to encode). - No node’s
inputisRecord/Listfan-in. - Beyond per-node checks: the whole graph must be one strand, not
just individually-simple nodes that still fan out or fan in as a
group. Concretely: the first declared node has no input; every
subsequent declared node’s input must be exactly
FromNodeof the node declared immediately before it; and no node may be referenced by more than one other node’sFromNode(that would be fan-out — two nodes both reading nodek’s output — which individually satisfies every per-node check above while still not being a chain).
cuttlefish build‘s bundle format only knows how to encode this exact
shape, walked in spec.nodes’ declaration order.