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.
- Panel
Outcome - 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.
- Reviewer
Report - One reviewer’s report, as the aggregation reads it back from evidence.
- Stage
- One stage: an untrusted
action, an independentresult_checkthat judges it, and what to do when the reading isFail. - Stage
Evidence - 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_toedge sends the walk back through it.
Enums§
- Actor
- Something that can be run within a stage. The same vocabulary serves
both positions: an
Actoris either the stage’s action or the independent judge in itsresult_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.
- Fail
Action - What the walk does when a stage’s reading is
Fail. - Halt
Reason - 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. - Verdict
Source - 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_tobudget 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_toedge’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
promptpath 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
Passadvances it, aFailapplies the failed stage’sfail_action—Haltstops,Continueadvances,ReturnTomoves 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.