/** * Thread Vitality Scoring (Phase 2) + Lifecycle State Machine (Phase 6) * * Computes vitality from recency + frequency (two of four eventual components). * Importance and relevance deferred to Phases 3-4 (knowledge graph + per-session embeddings). * * Formula: vitality = W_recency * recency + W_frequency * frequency * * Phase 2 weights (renormalized from 4-component to 2-component): * recency: 0.55 (original 0.30 / 0.55 total) * frequency: 0.45 (original 0.25 / 0.55 total) * * Recency: exponential decay based on thread_class half-life * operational: 3-day half-life (short-lived tasks) * backlog: 21-day half-life (long-running concerns) * * Frequency: log-scaled touch count normalized against thread age * log(touch_count + 1) / log(max(days_alive, 0.01) + 1) * * Status thresholds: * vitality > 0.5 → "active" * 0.2 <= v <= 0.5 → "cooling" * vitality < 0.2 → "dormant" * * Phase 6 Lifecycle: * EMERGING (< 24h old) → ACTIVE → COOLING → DORMANT → ARCHIVED (30+ days dormant) * Any state → RESOLVED (explicit resolve) */ export type ThreadClass = "operational" | "backlog"; export type VitalityStatus = "emerging" | "active" | "cooling" | "dormant"; export interface VitalityInput { last_touched_at: string; touch_count: number; created_at: string; thread_class: ThreadClass; } export interface VitalityResult { vitality_score: number; status: VitalityStatus; recency_component: number; frequency_component: number; } export type LifecycleStatus = "emerging" | "active" | "cooling" | "dormant" | "archived"; export interface LifecycleInput extends VitalityInput { current_status: string; dormant_since?: string; } export declare const EMERGING_WINDOW_HOURS = 24; export declare const ARCHIVAL_DORMANT_DAYS = 30; export declare function computeVitality(input: VitalityInput, now?: Date): VitalityResult; /** * Compute the full lifecycle status for a thread. * Wraps vitality scoring with age-based emerging window and archival logic. * * State machine: * EMERGING (< 24h) → ACTIVE → COOLING → DORMANT → ARCHIVED (30+ days dormant) * Any state → RESOLVED (handled externally by resolve_thread) */ export declare function computeLifecycleStatus(input: LifecycleInput, now?: Date): { lifecycle_status: LifecycleStatus; vitality: VitalityResult; }; export declare function vitalityToStatus(score: number): VitalityStatus; export declare function detectThreadClass(text: string): ThreadClass; //# sourceMappingURL=thread-vitality.d.ts.map