import type { DatabaseAdapter } from '../db-manager.js'; export type CaseFreshnessState = 'fresh' | 'stale' | 'drifted' | 'unknown'; export interface CaseFreshnessReason { code: 'missing_compile' | 'activity_after_compile' | 'state_update_after_compile' | 'wiki_index_missing' | 'timestamps_absent'; penalty: number; detail?: string; } export interface CaseFreshnessCalculation { freshness_score: number; freshness_state: CaseFreshnessState; freshness_score_is_drifted: 0 | 1; freshness_drift_threshold: number; reasons: CaseFreshnessReason[]; freshness_reason_json: string; } export interface CaseFreshnessResult extends CaseFreshnessCalculation { case_id: string; terminal_case_id: string; resolved_via_case_id: string | null; chain: string[]; freshness_checked_at: string; changed: boolean; } export interface SweepCaseFreshnessInput { case_ids?: string[]; now?: string; drift_threshold?: number; } export interface SweepCaseFreshnessResult { checked: number; fresh: number; stale: number; drifted: number; drifted_case_ids: string[]; results: CaseFreshnessResult[]; rejected?: Array<{ case_id: string; code: 'case.terminal_status'; message: string; }>; } export declare function calculateCaseFreshness(input: { last_activity_at?: string | null; state_updated_at?: string | null; compiled_at?: string | null; wiki_index_updated_at?: string | null; current_wiki_path?: string | null; drift_threshold?: number; now?: string; }): CaseFreshnessCalculation; export declare function sweepCaseFreshness(adapter: DatabaseAdapter, input?: SweepCaseFreshnessInput): SweepCaseFreshnessResult; export declare function listDriftedCases(adapter: DatabaseAdapter): Array<{ case_id: string; freshness_score: number; freshness_checked_at: string | null; }>; //# sourceMappingURL=freshness.d.ts.map