Skip to main content

Module flow

Module flow 

Source
Expand description

Flow definitions and the pure walk over them. Parsing turns a committed YAML file into a validated Flow; next_step then replays the run’s ordered evidence log over that flow to derive the next stage to run or a terminal reading. Neither half touches a clock, a process, or the store, so policy can be tested without a daemon.

The halves live in their own files and meet only here. This file is the vocabulary: the types a stage is written in, and nothing that reads or replays them. parse holds the YAML grammar and the Raw* wire types that are its only readers; walk holds the replay, which reads exactly three things from the vocabulary and never mentions the rest; panel holds the panel slice — its types, its parse validation, and its aggregation — which the walk does not know exists.

Structs§

Flow
Panel
A panel of independent reviewers.
PanelOutcome
A panel’s derived reading: every seat filled, and the verdict the count over them yields.
Reported
A worker’s self-reported verdict for the stage it is running, gated to at most one report per stage.
Reviewer
One seat on a panel. Only the target and its model/effort vary: the point of a panel is decorrelated failure modes, and the cheapest way to buy them is to seat different vendors.
ReviewerReport
One reviewer’s report, as the aggregation reads it back from evidence.
Stage
One stage: an untrusted action, an independent result_check that judges it, and what to do when the reading is Fail.
StageEvidence
One stage execution’s recorded result, and one entry in a run’s evidence log. Rows persist as they are produced and callers must supply them in log order, because the walk is a replay of that order rather than a lookup over a set: the same stage may hold several rows once a return_to edge sends the walk back through it.

Enums§

Actor
Something that can be run within a stage. The same vocabulary serves both positions: an Actor is either the stage’s action or the independent judge in its result_check.
Builtin
The actors Sloop implements internally.
Check
How a stage’s action is judged.
Confidence
How sure a reviewer says it is. Recorded evidence only: v1 aggregation counts reports and never weights them, so a confident wrong reviewer outvotes nobody. Floats are deliberately absent — a scalar invites a weighting rule that has not been designed.
FailAction
What the walk does when a stage’s reading is Fail.
HaltReason
Why a replay stopped short of the end of the flow.
Step
What the walk does next, given a flow and the evidence log so far.
Verdict
A stage’s pass/fail reading. Richer verdicts (e.g. changes-requested) are a later phase; v1 is strictly binary.
VerdictSource
Where a stage’s verdict came from.

Constants§

DEFAULT_FLOW_NAME
MAX_FLOW_EXECUTIONS
The worst-case number of stage executions a flow may imply once every return_to budget is spent. A flow that could exceed it is rejected at parse time rather than discovered at runtime.
MAX_PANEL_REVIEWERS
MAX_RETURN_ATTEMPTS
The inclusive upper bound on a return_to edge’s attempt budget.
MIN_PANEL_REVIEWERS
A panel smaller than this is not a panel, and one larger than this costs more tokens than any v1 quorum rule can justify.
NO_VERDICT_REPORTED
The reason a reviewer that never reported is credited with.
PANEL_PROMPT_ROOT
The directory a panel’s prompt path is resolved against. Panel prompts are committed files like every other piece of flow configuration, so the path is repository-relative under the Sloop directory rather than absolute or relative to whatever the daemon’s working directory happens to be.

Functions§

aggregate
Derives a panel’s verdict from its reviewers’ reports.
next_step
The pure decision at the heart of a flow: a left fold over the run’s ordered evidence log. A cursor starts at stage 0 and consumes rows in sequence: a Pass advances it, a Fail applies the failed stage’s fail_actionHalt stops, Continue advances, ReturnTo moves the cursor back if that edge’s budget is not yet spent. Wherever the cursor stands once the log is exhausted is what runs next.
parse
resolve_verdict
Resolves a stage’s verdict, source, and reason from the evidence selected by its result check. Reports are authoritative only for Reported; every other check ignores them.
return_trigger
The failure that most recently sent the walk backwards, as the (stage index, attempt) key of its evidence row — the row a re-entered stage is being re-run because of.