Skip to main content

Module validate

Module validate 

Source
Expand description

Strict, versioned validation of a graph document.

validate runs a set of INDEPENDENT checks and collects EVERY error rather than stopping at the first, so an author sees the whole picture in one pass. Each check is its own function that reads the graph and pushes any failures onto a shared list, so a check can be added, relaxed, or removed without touching the others. The acyclic check in particular is isolated on purpose: the current design leans acyclic, and a future change that admits some cycles can drop that one function and leave the rest untouched.

The errors are structured (GraphError): each names the offending node or edge and carries a clear message, so the CLI can print node/edge-level diagnostics rather than a bare “invalid”.

Structs§

GraphSummary
A successful validation’s summary of the graph’s shape.

Enums§

GraphError
A single validation failure, naming the node or edge at fault.

Constants§

MAX_NODE_NAME_LEN
The longest an optional node name may be, in characters. Mirrors the agent definition’s own name bound (salvor_cli::agent_config::MAX_NAME_LEN); see crate::document’s “The optional node display name” section for why the two fields, though bounded alike, differ in whether they hash.

Functions§

validate
Validates a graph document, returning a summary on success or EVERY error on failure.