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 againstdist/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§
- Input
Spec - A single named pipe input.
type:is required; other fields optional. Defaults to non-required so simpleinputs: { x: { type: string } }works. - Loop
Body - Loop body. Exactly one of
command/promptmust be populated (validator-enforced).untilis the sentinel that terminates the loop cleanly;max_iterationsis a hard cap. - Node
- One DAG node. Exactly one of
command/prompt/bash/loop_must be populated — enforced byvalidate_structure, not by serde, so we can produce a typed error rather than a generic deserialization failure.loop_carries the YAML field nameloopvia serde rename. - Pipe
- Top-level pipe definition. Deserialized from the markdown
frontmatter in
dist/pipes/<name>.md.
Enums§
- Execution
Kind - Which one-of execution kind a node carries.
- Load
Error - Combined error returned by
load. Either the markdown didn’t parse, or the parsed pipe failed validation (with one or more issues). - Parse
Error - Errors produced while parsing the markdown frontmatter into a
Pipe. Validator errors live inValidationErrorso the parse surface is small and unambiguous. - Trigger
Rule - How a node with multiple
depends_onpredecessors is triggered. - Validation
Error - 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. - Validation
Warning - Non-fatal advisories about a pipe. Distinct from
ValidationErrorso a warning does not blockomne validate— the run can still start. Theomne validatecommand 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 unboundedmax_iterationscombined 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.untilmay not name it.
Functions§
- collect_
warnings - Collect non-fatal advisories from a parsed
Pipe. Callable independently ofvalidate_structureso 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.