/** * Pure decision logic for auto-consolidation strategy selection. * * Extracted from drive-handler.ts so the gating rules are dependency-free and * unit-testable. The caller supplies the current signals (idle time, * unconsolidated backlog size, time since last consolidation); this module * decides which single strategy — if any — should fire. */ /** Minimum unconsolidated episodes before the episode-count strategy fires. */ export declare const EPISODE_COUNT_CONSOLIDATION_THRESHOLD = 15; /** Idle window (ms) before the idle strategy fires. */ export declare const IDLE_CONSOLIDATION_MS: number; /** Shared cooldown (ms) so consolidation runs at most once per window. */ export declare const CONSOLIDATION_COOLDOWN_MS: number; /** Interval (ms) after which the time-based strategy fires regardless of activity. */ export declare const TIME_CONSOLIDATION_INTERVAL_MS: number; export type ConsolidationStrategy = "episode-count" | "idle" | "time"; /** Human-readable labels used for log lines, keyed by strategy. */ export declare const STRATEGY_LABELS: Record; export interface ConsolidationSignals { /** Time since the last operator message (ms). */ idleMs: number; /** Count of unconsolidated episodes for the current thread. */ unconsolidatedCount: number; /** Time since the last consolidation fired (ms). */ sinceLastConsolidationMs: number; } /** * Selects which consolidation strategy should fire, or `null` if none apply. * * Priority order (only one fires per call, all sharing the same cooldown): * 1. episode-count — a large backlog is the most urgent signal, so it is * checked first. Checking idle first would starve this strategy: idle * shares the cooldown and (because auto-consolidation is only ever invoked * from idle code paths) its window is essentially always satisfied, so it * would reset the cooldown before episode-count ever got a turn. * 2. idle — consolidate after the operator has been quiet for a while. * 3. time — a floor guarantee so stale knowledge is cleaned up even during * low-activity periods. */ export declare function selectConsolidationStrategy(signals: ConsolidationSignals): ConsolidationStrategy | null; //# sourceMappingURL=consolidation-strategy.d.ts.map