Skip to main content

Module cli

Module cli 

Source
Expand description

CLI surfaces for the firstpass binary (SPEC §7.3/§7.4): doctor validates a setup before you route real traffic through it, and trace reads recent audit records from the store. Both are kept here (not in the binary) so the judgment is unit-tested.

Structs§

Check
One line of the doctor report.
DoctorReport
The result of firstpass doctor.
EvalsSummary
Per-gate and per-rung evaluation summary computed from receipts — the operator’s live eval suite: how each gate is verdict-ing, how often routing escalates, where serves land.
SavingsSummary
Aggregated spend/savings over a set of traces — the number the operator screenshots. Pure so it’s unit-testable; firstpass savings feeds it the trace store.

Enums§

CheckStatus
A single doctor check outcome.

Functions§

command_on_path
Whether program is runnable: an explicit path (contains a separator) that exists, or a bare name found in one of PATH’s directories.
doctor
Validate a loaded config against the environment: routing sanity, provider key presence, and that every configured gate’s command actually exists. env looks up environment variables (injected so this is testable).
format_evals
Render an EvalsSummary for humans (--json callers serialize the struct instead).
format_savings
Render a SavingsSummary for humans (--json callers serialize the struct instead).
format_traces
Render the most recent limit traces as JSON lines — machine-first (SPEC §0.2): each line is a full Trace, newest last.
summarize_evals
Aggregate gate verdicts + routing behavior over traces (enforce only).
summarize_savings
Aggregate spend vs the always-top counterfactual over traces.