/**
 * InstinctSystem -- Continuous learning with confidence-scored behavioral patterns.
 *
 * Agents build up "instincts" -- patterns they've learned work well.
 * Unlike memory (facts), instincts are behavioral with confidence scores.
 *
 * Confidence lifecycle:
 *   New: 0.3 -> Success: +0.1 -> Auto-promote at >= 0.8 across 2+ projects
 *   Failure: -0.15 -> Decay: -0.05 per 7 days idle -> Prune at < 0.2
 *
 * @connexum/ai-governance
 */
export interface Instinct {
    id: string;
    pattern: string;
    context: string;
    confidence: number;
    source: 'learned' | 'imported' | 'promoted';
    learnedFrom: string[];
    appliedCount: number;
    successCount: number;
    failureCount: number;
    lastApplied: string | null;
    createdAt: string;
    ttlDays: number;
    projects: string[];
    tags: string[];
}
export interface InstinctConfig {
    /** Directory to store instinct data */
    dataDir: string;
    /** Agent name */
    agentName: string;
    /** Current project name */
    projectName: string;
    /** Initial confidence for new instincts (default: 0.3) */
    initialConfidence?: number;
    /** Confidence boost on success (default: 0.1) */
    successBoost?: number;
    /** Confidence penalty on failure (default: 0.15) */
    failurePenalty?: number;
    /** Days of inactivity before decay starts (default: 7) */
    decayAfterDays?: number;
    /** Confidence decay per decay period (default: 0.05) */
    decayRate?: number;
    /** Minimum confidence before pruning (default: 0.2) */
    pruneThreshold?: number;
    /** Maximum age in days before pruning (default: 30) */
    maxAgeDays?: number;
    /** Confidence threshold for global promotion (default: 0.8) */
    promotionThreshold?: number;
    /** Minimum projects for global promotion (default: 2) */
    promotionMinProjects?: number;
    /** Maximum number of instincts per agent (default: 100) */
    maxInstincts?: number;
}
export interface InstinctStatus {
    total: number;
    active: number;
    highConfidence: number;
    lowConfidence: number;
    promotable: number;
    stale: number;
    byProject: Record<string, number>;
    bySource: Record<string, number>;
    avgConfidence: number;
}
export declare class InstinctSystem {
    private instinctsFile;
    private logFile;
    private config;
    constructor(config: InstinctConfig);
    /**
     * Learn a new instinct from experience.
     */
    learn(pattern: string, context: string, sessionId: string, tags?: string[]): Instinct;
    /**
     * Record successful application of an instinct.
     */
    recordSuccess(instinctId: string): Instinct | null;
    /**
     * Record failed application of an instinct.
     */
    recordFailure(instinctId: string, reason?: string): Instinct | null;
    /**
     * Find instincts relevant to a given context.
     * Returns instincts sorted by confidence (highest first).
     */
    findRelevant(contextKeywords: string[], minConfidence?: number): Instinct[];
    /**
     * Apply confidence decay to stale instincts.
     * Call this periodically (e.g., on session start).
     */
    applyDecay(): {
        decayed: number;
        pruned: number;
    };
    /**
     * Find instincts eligible for global promotion.
     * Criteria: confidence >= threshold AND used in >= N projects.
     */
    findPromotable(): Instinct[];
    /**
     * Promote an instinct to global scope.
     */
    promote(instinctId: string): Instinct | null;
    /**
     * Export instincts for sharing between agents/projects.
     */
    exportInstincts(minConfidence?: number): Instinct[];
    /**
     * Import instincts from another agent/project.
     */
    importInstincts(instincts: Instinct[]): {
        imported: number;
        skipped: number;
    };
    /**
     * Get comprehensive status of all instincts.
     */
    getStatus(): InstinctStatus;
    /**
     * Force re-evaluation of all instincts.
     * Recalculates confidence based on success/failure ratios.
     */
    evolve(): {
        evolved: number;
    };
    /**
     * Get all instincts (read-only).
     */
    getAll(): Instinct[];
    /**
     * Remove a specific instinct.
     */
    remove(instinctId: string): boolean;
    private loadInstincts;
    private saveInstincts;
    private log;
}
//# sourceMappingURL=instinct-system.d.ts.map