export declare const SNAPSHOT_SCHEMA_VERSION = 1; export declare const SNAPSHOT_FILE = "SNAPSHOT.json"; export declare const MANAGED_SNAPSHOT_RE: RegExp; export type SnapshotStatus = "copying" | "ready" | "incomplete" | "completed-good" | "failed-pre-mutation" | "recovery-required"; /** A symlink is recorded as data so snapshot creation never needs link privilege. */ export interface SnapshotSymlink { path: string; target: string; /** A no-privilege Windows file link is preserved as copied file data. */ representation?: "file-copy"; } /** Why a snapshot stopped before rescue could mutate the HQ tree. */ export interface SnapshotCopyFailure { relativePath: string; operation: "read" | "write" | "metadata"; code: string; message: string; occurredAt: string; } export interface SnapshotManifest { schemaVersion: 1; status: SnapshotStatus; canonicalHqRoot: string; rootHash: string; runId: string; creatorPid: number; creatorStartedAt: string; source: string; ref: string; sourceSha: string; createdAt: string; completedAt?: string; includedRoots: string[]; /** Links use metadata by default; no-privilege Windows file links retain copied data. */ symlinks?: SnapshotSymlink[]; /** Present only when capture failed before the rescue mutation phase. */ copyFailure?: SnapshotCopyFailure; /** Files that were not captured and were protected from the following update. */ skippedEntries?: SnapshotCopyFailure[]; fileCount: number; byteCount: number; } export interface BackupEntry { name: string; manifest: SnapshotManifest; createdMs: number; completedMs: number; bytes: number; identity?: { dev: number; ino: number; }; copyingOwnerLive?: boolean; } export interface ProtectedEntry { entry: BackupEntry; reason: string; } export interface DeletionCandidate { entry: BackupEntry; reason: string; } export interface BackupPrunePlan { candidates: DeletionCandidate[]; protected: ProtectedEntry[]; unmanaged: { name: string; reason: string; }[]; } export interface RetentionConfig { keepGood: number; keepFailedPreMutation: number; maxAgeDays: number; } export declare const DEFAULT_RETENTION: RetentionConfig; export declare function canonicalRootHash(root: string): string; export declare function safeRetention(input?: Partial): RetentionConfig; /** Every managed entry receives either a retention reason or a deletion reason. */ export declare function planBackupPrune(entries: BackupEntry[], nowMs: number, input?: Partial): BackupPrunePlan; export declare function isManagedSnapshotManifest(value: unknown, canonicalRoot: string): value is SnapshotManifest; export declare function inventoryManagedSnapshots(backupRoot: string, canonicalRoot: string, isCopyingOwnerLive?: (m: SnapshotManifest) => boolean, retention?: Partial): BackupPrunePlan & { entries: BackupEntry[]; }; /** Revalidates strict identity then renames before recursively removing it. */ export declare function applyBackupPrune(backupRoot: string, canonicalRoot: string, plan: BackupPrunePlan, retention?: Partial): { deleted: string[]; failures: string[]; }; /** * Apply a bounded prefix of an already-inventoried prune plan. * * Each invocation takes and releases the backup-root lock around at most one * (by default) destructive unit. A chore scheduler can therefore submit the * next cursor position later, allowing realtime work to preempt between * entries instead of waiting for a large retention sweep. */ export declare function applyBackupPruneBounded(backupRoot: string, canonicalRoot: string, plan: BackupPrunePlan, options?: { startAt?: number; maxUnits?: number; retention?: Partial; }): { deleted: string[]; failures: string[]; nextIndex: number; complete: boolean; }; //# sourceMappingURL=backup-prune.d.ts.map