import type { GeneratedFile } from './file-writer.js'; export interface StateArtifactResult { /** State-dir-relative paths removed because the compiler dropped them. */ removed: string[]; /** On-disk files left alone because the compiler never saw them. */ preserved: number; /** Where the pre-existing tree was copied, when anything was removed. */ archivePath?: string; } /** * Sync the compiler-owned state tree without destroying history. * * This used to archive-and-wipe `quickback/drizzle/` wholesale, on the premise * that the tree "should mirror the compiler manifest exactly". That premise is * false: the CLI deliberately uploads only the newest `NNNN_snapshot.json` per * meta directory (`selectDrizzleMetaFilesForUpload`), so the compiler's * returned manifest is a PARTIAL view by construction. Wiping the tree and * rewriting only what came back therefore deleted every historical snapshot on * every compile — the exact hazard #166 said a payload fix had to be paired * with, and #201 observed in the field (28 snapshots down to 2). * * The distinction that makes deletion safe is whether the compiler could see * the file at all: * * - Uploaded AND returned → rewritten by the caller (current state). * - Uploaded, NOT returned → genuinely stale; the compiler considered it and * dropped it, so remove it. * - NEVER uploaded → invisible to the compiler. Its absence from the * manifest carries no information, so it must be preserved. * * A file's absence from the manifest only means "delete" when the compiler was * given the chance to keep it. */ export declare function prepareStateArtifacts(stateDir: string, files: GeneratedFile[], options?: { uploadedPaths?: Iterable; }): Promise; //# sourceMappingURL=prepare-state-output.d.ts.map