/** * Memory TTL / archival tiers policy pass (FEAT-404, W4.4). * * Runs on the cleanup job's cadence (src/pipeline/handlers/cleanup.ts). * Both conditions are required to archive an atom (AC-2/AC-3): * - older than config.archival.ageThresholdDays (measured from created_at) * - trailing-7-day usefulness rate at/below config.archival.usefulnessFloor * * Non-destructive (AC-5): every archived row survives — MemoryEventRepo.archive * sets valid_to + archived/archived_at in the same transaction supersede()/ * invalidate() already established, restorable via MemoryEventRepo.restore(). * Off by default (AC-1): config.archival.enabled === false is a hard no-op. */ import type { DB } from './db.js'; import type { Config } from '../config/config.js'; export interface ArchivalRunResult { /** Number of memories archived by this pass. */ archived: number; /** Number of memories that met the age threshold and were evaluated * against the usefulness floor (archived + age-eligible-but-protected). */ candidates: number; } /** * Select every currently-valid, not-yet-archived memory older than the age * threshold, evaluate each against the usefulness floor, and archive the * ones that clear both bars. Returns { archived: 0, candidates: 0 } * immediately when the policy is disabled (AC-1). */ export declare function runArchivalPass(db: DB, config: Config, now?: number): ArchivalRunResult;