/** * Orphan quarantine protocol. * * Moves orphan session directories to `.hivemind/session-tracker/quarantine/` * instead of deleting them. Supports manifest verification (skip sessions * registered in hierarchy-manifest.json) and auto-cleanup of old entries. * * @module session-tracker/persistence/orphan-quarantine */ /** * Manages quarantine of orphan session directories. * * Orphans are session directories that exist on disk but are classified * as child sessions (they should not have their own directory). Instead * of deleting them, they are moved to quarantine for auditability. */ export declare class OrphanQuarantine { private trackerRoot; private quarantineDir; /** * @param deps - Injected dependencies. * @param deps.trackerRoot - Absolute path to `.hivemind/session-tracker/`. */ constructor(deps: { trackerRoot: string; }); /** * Moves an orphan session directory to quarantine. * * Creates the quarantine directory if it does not exist. Records a * `.quarantined-at` timestamp file for cleanup eligibility. * * Best-effort: if the source directory does not exist, silently returns. * * @param sessionID - The orphan session directory name to quarantine. * @returns Promise that resolves when the move is complete. */ quarantineOrphan(sessionID: string): Promise; /** * Checks if a session ID is registered in the hierarchy manifest * of a given root main session. * * @param rootMainSessionID - The root main session directory name. * @param childSessionID - The child session ID to check. * @returns `true` if the child is registered in the manifest. */ isInManifest(rootMainSessionID: string, childSessionID: string): Promise; /** * Removes quarantined entries older than the specified number of days. * * Entries must have a `.quarantined-at` timestamp file to be eligible * for cleanup. Entries without a timestamp are preserved (safety). * * @param daysThreshold - Number of days before an entry is considered stale. * @returns Array of session IDs that were removed. */ cleanupOld(daysThreshold: number): Promise; /** * Safely writes content to a file, creating parent directories if needed. * * @param filePath - Absolute path to the file. * @param content - Content to write. */ private writeFileSafe; } //# sourceMappingURL=orphan-quarantine.d.ts.map