Skip to main content

Module pipe

Module pipe 

Source
Expand description

Pipe YAML loader + validator.

Parses pipe definitions from dist/pipes/<name>.md — markdown files whose YAML frontmatter holds the DAG schema described in the v2 design doc. The runner consumes the parsed Pipe for DAG dispatch (Unit 6) and node execution (Unit 11).

Two layers:

  • parse_str / load_from_str — pure YAML→struct deserialization.
  • validate_structure — pure structural rules (exactly-one-of, cycle detection, loop body shape, scope rules on bash/AI nodes).
  • validate_with_volume — adds filesystem-aware checks (command resolution against dist/skills/ + core/skills/, gate hook existence at the platform-current variant).

load(md_path, volume_root) is the high-level entry that runs all three in sequence. commands::validate calls it for every dist/pipes/*.md it finds.

Error grain: every variant carries the offending node id (or pipe name + path) so omne validate can surface actionable messages without re-scanning the YAML.

Structs§

InputSpec
A single named pipe input. type: is required; other fields optional. Defaults to non-required so simple inputs: { x: { type: string } } works.
LoopBody
Loop body. Exactly one of command / prompt must be populated (validator-enforced). until is the sentinel that terminates the loop cleanly; max_iterations is a hard cap.
Node
One DAG node. Exactly one of command / prompt / bash / loop_ must be populated — enforced by validate_structure, not by serde, so we can produce a typed error rather than a generic deserialization failure. loop_ carries the YAML field name loop via serde rename.
Pipe
Top-level pipe definition. Deserialized from the markdown frontmatter in dist/pipes/<name>.md.

Enums§

ExecutionKind
Which one-of execution kind a node carries.
LoadError
Combined error returned by load. Either the markdown didn’t parse, or the parsed pipe failed validation (with one or more issues).
ParseError
Errors produced while parsing the markdown frontmatter into a Pipe. Validator errors live in ValidationError so the parse surface is small and unambiguous.
TriggerRule
How a node with multiple depends_on predecessors is triggered.
ValidationError
Validation issues. Plural Vec<ValidationError> is the public return shape so the validator can surface every issue in one pass instead of forcing the user to fix-and-rerun.
ValidationWarning
Non-fatal advisories about a pipe. Distinct from ValidationError so a warning does not block omne validate — the run can still start. The omne validate command surfaces these as yellow lines without exiting non-zero.

Constants§

MAX_ITERATIONS_CAP
Upper bound on loop.max_iterations. The claude subprocess can be fast (1ms per invocation in tests) so an unbounded max_iterations combined with the default 1800s wall-clock budget could attempt millions of iterations and grow the capture file past available disk space before the deadline fires. 1000 is picked so a well-tuned loop can still run many iterations while impossible pipe definitions get rejected at validate time.
RESERVED_BLOCKED
Sentinel reserved by the runner. loop.until may not name it.

Functions§

collect_warnings
Collect non-fatal advisories from a parsed Pipe. Callable independently of validate_structure so consumers that only want warnings (e.g. IDE integrations) do not pay for the full validation pass.
load
High-level entry: read + parse + structural validation + volume validation. Surfaces all validation errors in one shot.
load_from_path
Read a pipe file, extract frontmatter, and parse into a Pipe.
parse_str
Parse a markdown document containing pipe frontmatter into a Pipe. Body content after the frontmatter is ignored.
validate_structure
Structural validation: every check that does not need a volume root. Pure function over the parsed Pipe.
validate_with_volume
Volume-aware validation: command resolution against the volume’s dist/skills/ + core/skills/; gate hook existence at the platform-current variant.