/** * What a resume keeps of a run's journal, as the walk asks for it: each * visit that ended and survives, each `carry` and frozen `map` list, each * ledger's obligations, each copy, and the run's branch. * * A visit survives when it ended with a value the flow read on: `ok`, or * failed under `on-fail: continue`. One stopped or cut from above ran to no * end of its own, and a failure that travelled up was the run's: both run * again, which is how a failed run replays its failure chain, each visit * with a fresh `retry:` budget. A resume appends to the same journal, so the * last entry of a path is the one that counts, and a `copy_lost` forgets * every fact under its branch written before it. */ import type { Obligation } from "../../review/index.ts"; import type { CheckedFlow } from "../checked.ts"; import type { Ended } from "./ended.ts"; import type { JournalEntry } from "./journal.ts"; /** A copy the journal left open: where it is, its git branch and its base; none of them in a dry run. */ export type OpenCopy = { readonly dir?: string; readonly branch?: string; readonly base?: string; }; /** What the journal says of a branch's copy: still open, or landed, its work in the tree or not. */ export type CopyState = { readonly open: OpenCopy; } | { readonly landed: boolean; }; /** A run's journal, folded for a resume. Only `Replay.of` makes one. */ export declare class Replay { private readonly survivors; /** Every visit that ended, surviving or not: where the run has been. */ private readonly seen; private readonly carries; private readonly lists; private readonly copies; private obligationsWritten; private runBranch; private last; private constructor(); /** `journal` folded against `flow`, or the first visit it names that `flow` has not. */ static of(flow: CheckedFlow, journal: readonly JournalEntry[]): Replay | string; /** How the run last ended, when an earlier process saw it end. */ get runEnd(): Extract | undefined; /** The run's branch, once its first commit opened it. */ get branch(): string | undefined; /** How the visit `path` ended, when it survives. */ ended(path: string): Ended | undefined; /** Whether any visit at or under `path` ended. */ touched(path: string): boolean; /** The `carry` the iteration `path` read. */ carry(path: string): { readonly ok: true; readonly value: unknown; } | undefined; /** The list the `map` visit `path` froze. */ items(path: string): readonly unknown[] | undefined; /** The obligations of the ledger kept at `at`, as the visits that survive left them. */ obligations(at: string): Obligation[]; /** What the journal says of the copy of the branch `path`. */ copy(path: string): CopyState | undefined; /** Forgets every fact at or under the branch `path`: its copy was lost, so it starts over. */ forget(path: string): void; private fold; } //# sourceMappingURL=replay.d.ts.map