import { ModuleFilePath, PatchId } from "@valbuild/core"; /** * Replays a `val debug` snapshot: applies its patches the way /save does and * validates the result. * * A snapshot is a minimal Val project (the modules the patches touch plus the * ones they reference, a generated val.modules.ts, and the patch chain under * .val/patches), so replaying it is just a ValOpsFS pointed at the directory - * no snapshot-specific code paths, which is the point: if the replay reproduces * the bug, the bug is in the ordinary code. */ export type ReplayResult = { patches: { patchId: PatchId; moduleFilePath: ModuleFilePath; createdAt: string; authorId: string | null; /** The error, if this patch could not be applied. */ error?: string; }[]; unappliablePatches: Record; sourceFilePatchErrors: Record; binaryFilePatchErrors: Record; validationErrors: Record; /** What the source files look like with the appliable patches applied. */ patchedSourceFiles: Record; hasErrors: boolean; }; export type ReplayComparison = { /** Patch ids that failed at capture time and still fail. */ stillFailing: string[]; /** Patch ids that failed at capture time but apply now (a fix, or a drift). */ nowApplying: string[]; /** Patch ids that apply at capture time but fail now (a regression). */ newlyFailing: string[]; reproduced: boolean; }; export declare function replaySnapshot(snapshotDir: string): Promise; /** * Compares a replay against the report captured when the snapshot was taken, so * "reproduced the customer's bug" is distinguishable from "behaves differently * on this version". */ export declare function compareWithCapturedReport(result: ReplayResult, capturedReport: { unappliablePatches?: Record; }): ReplayComparison; export declare function readCapturedReport(snapshotDir: string): { unappliablePatches?: Record; } | null;