Module graph
Expand description
Blueprint graph projection of a Sop.
Projects the linear step list plus routing metadata into a node/wire graph for visual editors (web node canvas, zerocode SOP pane) and text renderers. Pure projection: building a graph never mutates the SOP.
Structs§
- Graph
Diagnostic - A validation finding anchored to a step. Errors block saving
(
validate_sop_strict); warnings render but do not block. - Graph
Layout - Deterministic auto-layout so every surface renders the same picture without a client-side layout engine.
- Graph
Legend - The canonical legend for the SOP canvas: flow-wire roles, pin classes, and run states. The single authority a surface reads to render a legend and per-handle/per-wire hover context, so no surface hardcodes these lists.
- Graph
Node - A node in the projected graph: one SOP step, or one synthetic trigger
entry (
step >= TRIGGER_NODE_BASE,trigger_indexset). - Graph
Pin - One connection point on a node. Flow pins order execution; data pins carry the step’s declared input/output schema type.
- Graph
Wire - A directed edge between two nodes.
flow_roleis set for flow wires; data wires carry the producer/consumer pin names instead. - Layout
Geometry - Canvas geometry carried on every serialized graph so the web canvas reads
placement pitch from the wire instead of a local literal. The values are
fixed by
LayoutGeometry::CANONICAL; the struct rides onGraphLayoutonly to expose them to non-Rust surfaces. - Legend
Entry - One legend row: a graph concept plus its human description. The stable
keyis the snake_case wire value the canvas maps tones/handles against. - Node
Position - Grid placement for one node: column = longest flow path from an entry,
row = order of insertion within that column.
x/ycarry a persisted canvas coordinate when the node has been dragged; absent otherwise. - Node
RunOverlay - Run state for one step node. Trigger nodes carry no run state and are omitted from overlays.
- RunOverlay
- Live run state layered over a
SopGraph, letting a canvas animate an execution without re-fetching the graph. Served bysops/run-overlay. - SopGraph
- The full projected graph: nodes, wires, validation diagnostics, and a
precomputed layout. Serialized as-is over RPC (
sops/graph) and HTTP.
Enums§
- Flow
Role - Why a flow wire exists. Mirrors the
StepRouting/StepFailurefield it was derived from, so an editor can write edits back to the right place. - Graph
Severity - Node
Kind - Node
RunState - Per-node execution state projected from a run’s step results.
- PinClass
- Text
Graph Format - Rendering style for
render_graph_text.
Constants§
- TRIGGER_
NODE_ BASE - Node-id offset for synthetic trigger nodes, keeping them disjoint from
real step numbers. Trigger
igets node idTRIGGER_NODE_BASE + i.
Traits§
- SopGraph
Ext - Projection constructors for the shared
SopGraphtype.SopGraphlives inzeroclaw-sop-graph, so the build logic that needs the runtime’sSop/ToolSpechangs off this extension trait instead of an inherent impl. Call sites keep usingSopGraph::from_sop(..)with the trait in scope.
Functions§
- render_
graph_ text - Render a graph as plain text for CLI output and agent-readable summaries. Diagnostics are appended as a trailing block in non-JSON formats.