/** * Shadow Evaluator -- runs experimental rules without affecting verdict. * * Experimental rules evaluate against every event but don't influence * the real verdict. Their match/no-match results are tracked to measure * false positive rates. Rules with FP < threshold get promoted. * * @module agent-threat-rules/shadow-evaluator */ import type { ATRRule, ATRMatch, AgentEvent } from './types.js'; interface ShadowRuleStats { readonly ruleId: string; totalEvaluations: number; totalMatches: number; confirmedTruePositives: number; confirmedFalsePositives: number; firstSeen: number; lastSeen: number; } export interface PromotionCandidate { readonly rule: ATRRule; readonly stats: Readonly; readonly fpRate: number; } export declare class ShadowEvaluator { private readonly rules; private readonly stats; private readonly compiledPatterns; /** Add an experimental rule for shadow evaluation */ addRule(rule: ATRRule): void; /** Evaluate all shadow rules against an event (does NOT affect verdict) */ evaluate(event: AgentEvent): readonly ATRMatch[]; /** Record user feedback on a shadow match */ recordFeedback(ruleId: string, isTruePositive: boolean): void; /** * Get rules ready for promotion. * Criteria: FP rate < maxFPRate AND minimum evaluations reached. */ getPromotionCandidates(maxFPRate?: number, minEvaluations?: number): readonly PromotionCandidate[]; /** Get stats for a specific rule */ getStats(ruleId: string): Readonly | undefined; /** Get all shadow rule stats */ getAllStats(): ReadonlyMap>; /** Number of shadow rules */ size(): number; } export {}; //# sourceMappingURL=shadow-evaluator.d.ts.map