flow/run/dry-run¶
Source: src/flow/run/dry-run.ts
dryRunFlow: runFlow itself, with every agent turn, every check, every
commit and every question answered by a script.
The same walk, the same spawn, the same events. Only the session under
each subagent and the check port are scripted, so a typed answer goes
through the real submit tool, a verdict through the real verdict tool
and its ledger, and a failure takes its real path, retries and fail-fast
included. Nothing of the world is touched: it takes a CheckedFlow, no
working directory is given, no script is read, no model is reached and git
is never run. diff reads as an empty text, since no agent wrote anything,
and a copies: true block makes no copy: each of its branches reads as
landed, and its copy is a journal fact alone. Given from, it resumes that
journal through the same resumePoint a real resume takes.
DryRun¶
type
export type DryRun =
| (FlowResult & { readonly journal: readonly JournalEntry[] })
| { readonly ok: false; readonly unscripted: string; readonly journal: readonly JournalEntry[]; readonly usage: Usage }
| { readonly ok: false; readonly faults: readonly AnswerFault[] }
| { readonly ok: false; readonly refused: string };
How a dry run ended: as the flow did, or at the first visit its script did
not answer, which is no outcome of the flow’s; or refused before the start,
with every fault of the script, or a journal from a resume would refuse,
with why. The journal holds every fact a run would
write, in order, the run’s end last. Its tokens and cost are zero, since a
script spends nothing; the time is measured, like any run’s.
dryRunFlow¶
function
export async function dryRunFlow(checked: CheckedFlow, input: unknown, answers: Answers, options: DryRunOptions = {}): Promise<DryRun> { /* … */ }
Runs checked on input, each agent turn, check, commit and question answered from answers.
DryRunOptions¶
type
export type DryRunOptions = Pick<RunFlowOptions, "signal" | "onEvent" | "model" | "timeoutMs"> & {
/** A journal to resume, as `resumeFlow` resumes a run directory's: its facts come first in the one handed back. */
readonly from?: readonly JournalEntry[];
};
What a dry run varies: what a run does, short of reaching the world.