/**
 * BRAIN lifecycle operations — temporal decay, memory consolidation, and tier promotion.
 *
 * Reduces confidence of stale learnings based on age, following an
 * exponential decay model: new_confidence = confidence * (decayRate ^ daysSinceUpdate).
 *
 * Consolidation groups old observations by keyword overlap and merges
 * clusters into summary observations, archiving the originals.
 *
 * Wave 3 additions (T549):
 * - runTierPromotion — promotes entries through short→medium→long based on citation count,
 *   age, and verification; soft-evicts stale short-term entries.
 * - runConsolidation — orchestrates all consolidation steps (dedup, quality recompute,
 *   tier promotion, contradiction detection, soft eviction, graph strengthening, summaries).
 *
 * @task T5394 T5395 T549
 * @epic T5149
 */
/** Result from applying temporal decay. */
export interface DecayResult {
    updated: number;
    tablesProcessed: string[];
}
/**
 * Apply temporal decay to brain_learnings confidence values.
 *
 * Entries older than `olderThanDays` have their confidence reduced
 * by an exponential decay factor based on the number of days since
 * their last update (or creation if never updated).
 *
 * Formula: new_confidence = confidence * (decayRate ^ daysSinceUpdate)
 *
 * @param projectRoot - Project root directory for brain.db resolution
 * @param options - Decay configuration
 * @returns Count of updated rows and tables processed
 */
export declare function applyTemporalDecay(projectRoot: string, options?: {
    decayRate?: number;
    olderThanDays?: number;
}): Promise<DecayResult>;
/** Result from consolidating memories. */
export interface ConsolidationResult {
    grouped: number;
    merged: number;
    archived: number;
}
/**
 * Consolidate old observations by keyword similarity.
 *
 * Groups observations older than `olderThanDays` by FTS5 keyword overlap.
 * For groups with at least `minClusterSize` entries, creates one summary
 * observation and marks originals as archived (updated_at set, narrative
 * prefixed with [ARCHIVED]).
 *
 * @param projectRoot - Project root directory for brain.db resolution
 * @param options - Consolidation configuration
 * @returns Counts of grouped, merged, and archived observations
 */
export declare function consolidateMemories(projectRoot: string, options?: {
    olderThanDays?: number;
    minClusterSize?: number;
}): Promise<ConsolidationResult>;
/** A single promoted or evicted entry record. */
export interface PromotionRecord {
    id: string;
    table: string;
    fromTier: string;
    toTier: string;
    reason: string;
}
/** Eviction record for soft-evicted entries. */
export interface EvictionRecord {
    id: string;
    table: string;
    tier: string;
    reason: string;
}
/** Result from runTierPromotion. */
export interface PromotionResult {
    promoted: PromotionRecord[];
    evicted: EvictionRecord[];
}
/**
 * Run tier promotion for all memory tables.
 *
 * Promotion rules (per spec §1.1–§1.3):
 * - short → medium: citationCount >= 3 AND age > 24h AND verified = true
 *   OR qualityScore >= 0.7 AND verified = true (fast-track)
 * - medium → long:  citationCount >= 5 AND age > 7 days AND verified = true
 *
 * Eviction rules:
 * - short-term entries older than shortTermEvictionDays (default 7) with no
 *   promotion eligibility are soft-evicted (invalidAt = now).
 * - long-term entries are NEVER auto-evicted.
 *
 * @param projectRoot - Project root directory for brain.db resolution
 * @returns Lists of promoted and evicted entries
 */
export declare function runTierPromotion(projectRoot: string): Promise<PromotionResult>;
/** Extended result returned by runConsolidation. */
export interface RunConsolidationResult {
    /** Entries merged by dedup pass. */
    deduplicated: number;
    /** Entries whose quality score was recomputed. */
    qualityRecomputed: number;
    /** Tier promotions applied. */
    tierPromotions: PromotionResult;
    /** Contradiction pairs found. */
    contradictions: number;
    /** Entries soft-evicted (low quality medium-term). */
    softEvicted: number;
    /** Graph edges strengthened. */
    edgesStrengthened: number;
    /** Summary nodes generated. */
    summariesGenerated: number;
    /** Code↔memory graph links created. */
    graphLinksCreated?: number;
}
/**
 * Run the full sleep-time consolidation pipeline.
 *
 * This is the "Letta OS sleep-time compute" pattern — consolidation runs
 * during idle time (after session end), never during active work.
 *
 * Steps (in order):
 *   1. Deduplication — merge entries with >0.85 content similarity
 *   2. Quality recompute — recalculate scores with current age/citations
 *   3. Tier promotion — runTierPromotion()
 *   4. Contradiction detection — from brain-consolidator
 *   5. Soft eviction — invalidate low-quality medium-term entries
 *   6. Graph edge strengthening — increment weight on frequently-traversed edges
 *   7. Summary generation — existing consolidateMemories() for large clusters
 *
 * All steps are BEST-EFFORT — any step failure is caught and logged to console.warn.
 *
 * @param projectRoot - Project root directory for brain.db resolution
 * @returns Aggregated counts from each consolidation step
 */
export declare function runConsolidation(projectRoot: string): Promise<RunConsolidationResult>;
//# sourceMappingURL=brain-lifecycle.d.ts.map