Skip to main content

Module stage_test

Module stage_test 

Source
Expand description

Behavioral verification of a stage against its own examples.

Every stage ships with examples: [{input, output}, ...] used for semantic search, documentation, and — in this module — as a minimal behavioral test suite. verify_stage runs each example through an executor and compares the actual output against the declared output via canonical JSON hashing.

§What gets tested

The StageSkipReason enum identifies stages whose example outputs are illustrative, not reproducible: network calls, LLM inference, explicitly non-deterministic effects, and time-sensitive stages. For those, a hash comparison would fail spuriously; callers receive a Skipped { reason } outcome instead of Failed so CI gates can be set accordingly.

For everything else (Pure, plain Fallible) the comparison is exact — if the implementation returns the wrong shape or the wrong value, the test fails.

Structs§

StageReport
Verification report for a single stage.

Enums§

ExampleOutcome
Per-example verification outcome.
ReportOutcome
StageSkipReason
Why a stage’s behavioral verification is not meaningful.

Functions§

verify_stage
Run every example through the executor and return a report.