flow/run/snapshot

Source: src/flow/run/snapshot.ts

The snapshot of a run: what its validation read, kept in its run directory at the first start with the input and the settings, so that a resume runs the flow the run started with, whatever the disk says by then.

snapshot.json holds every flow file reached, each agent named, each check script’s content, the input and the settings. The skills an agent names are copied under agents/<agent>/skills/, where a definition keeps its own: read back, the agent lives there, so its skills resolve to the copies at the check and at the spawn alike.

readSnapshot

function

export function readSnapshot(runDir: string): Snapshot { /* … */ }

The snapshot in runDir. Throws when there is none, or one of another version.

Settings

type

export type Settings = {
	/** The working tree it was checked against. */
	readonly cwd: string;
	/** Whether a person could answer when it started. */
	readonly somebodyThere: boolean;
	/** The model it was started with, over the flow's and each agent's own. */
	readonly model?: string;
	/** The bound of every agent turn it was started with. */
	readonly timeoutMs?: number;
};

What a run was started with, beside its flow: frozen, so a resume is the same run.

Snapshot

type

export type Snapshot = {
	/** The flow's name. */
	readonly flow: string;
	/** Exactly what the check read: the flow's file, the files it reaches, the agents it names. */
	readonly catalogue: FlowCatalogue;
	/** Each check script's content, by its path. */
	readonly scripts: ReadonlyMap<string, string>;
	/** What the run was started on. */
	readonly input: unknown;
	/** What it was started with, beside its flow. */
	readonly settings: Settings;
};

A snapshot read back: the flow’s name, a catalogue holding exactly what its check read, and what the run was started with.