export declare const STATE_FILE = "pipeline.json"; export declare const COPY_FILE = "pipeline.yml"; export declare const SESSIONS_DIR = ".sessions"; /** The npm packages from `packages:`, installed for the run. */ export declare const PACKAGES_DIR = ".packages"; export declare const CHANGES_FILE = "changes.txt"; /** The last round's files, kept so the next round updates them. */ export declare const LAST_DIR = ".last"; /** * `pipeline.json` in the pipeline folder: the round, each stage's result, and * the rounds before. The next run reads it to retry or start a new round, the * summary reads it to explain the run, and `--json` prints it. */ export declare class PipelineState { private readonly dir; readonly record: PipelineRecord; /** A round in one of these did not finish, so the same commit retries it. */ static readonly STOPPED: Status[]; private existing; private createdBefore; constructor(dir: string, record: PipelineRecord); static read(dir: string): PipelineRecord | null; /** The worst status wins. An optional stage does not count. */ static verdict(records: Array<{ status: Status; optional?: boolean; }>): Status; stage(id: string): StageRecord | undefined; /** Remember what is in the folder now, so `created` lists only what the stages add. */ trackFiles(): void; /** Close the round in the history, replacing a run of the same round. */ finishRound(): void; save(): void; toJSON(): PipelineRecord; } export type Status = "pass" | "fail" | "broken" | "timeout" | "skipped" | "interrupted" | "not-run" | "running"; export interface PipelineRecord { name: string; round: number; commit: string | null; since: string | null; status: Status; reason?: string; stages: StageRecord[]; rounds: Array<{ round: number; commit: string | null; status: Status; }>; /** What this round wrote into the folder, cleared when the next round starts. */ created?: string[]; } export interface StageRecord extends StageResult { id: string; /** The stage is optional: its status does not count in the verdict. */ optional?: boolean; seconds?: number; items?: ItemRecord[]; } export interface ItemRecord extends StageResult { item: string; } export interface StageResult { status: Status; reason?: string; report?: string; log?: string; }