/** * Memory Journal MCP Server - Auto-Prune * * Importance-based garbage collector that soft-deletes old, low-importance * journal entries on server startup. Configurable via CLI flags / env vars. * * Algorithm: * 1. Create a safety backup before any mutations. * 2. Use the adapter's executeDataLifecycle() to identify and transition * candidate entries older than `olderThanDays` with an importance * score below `importanceThreshold` (computed entirely in SQL). * 3. Clean up stale vector embeddings. */ import type { IDatabaseAdapter } from '../database/core/interfaces.js'; export interface AutoPruneOptions { /** Archive active entries older than this many days */ archiveOlderThanDays: number; /** Soft-delete entries older than this many days */ pruneOlderThanDays: number; /** Hard-delete soft-deleted entries older than this many days */ hardDeleteOlderThanDays: number; /** Importance score threshold — entries scoring below this are archived/pruned */ importanceThreshold: number; /** If true, return candidates but do not soft-delete or create backups */ dryRun?: boolean; /** Tags to exclude from auto-prune */ excludeTags?: string[]; } export interface AutoPruneResult { archivedCount: number; prunedCount: number; hardDeletedCount: number; backupFile: string | null; archiveOlderThanDays: number; pruneOlderThanDays: number; hardDeleteOlderThanDays: number; importanceThreshold: number; } /** * Run the auto-prune sweep against the database. * * Delegates the importance-based candidate selection and soft-delete to the * adapter's `executeDataLifecycle()` method, which uses the same SQL CTE and * expression as `calculateImportance()`. This avoids per-entry round-trips * and keeps all raw SQL inside the adapter layer. */ export declare function runAutoPrune(db: IDatabaseAdapter, options: AutoPruneOptions): Promise; //# sourceMappingURL=auto-prune.d.ts.map