import type { AuditHistoryEntry } from './audit-history'; /** * 配置建议——从根因分析生成的可操作建议 */ export interface ConfigSuggestion { /** 建议类型:阈值调整 / 白名单 / 规则开关 */ type: 'threshold' | 'whitelist' | 'rule-toggle'; /** 相关规则名 */ ruleName: string; /** 当前值 */ currentValue: string; /** 建议值 */ suggestedValue: string; /** 建议理由 */ reason: string; /** 置信度 0-1 */ confidence: number; } /** * 按规则聚合的结果 */ export interface RuleAggregation { /** 规则名 */ ruleName: string; /** 总触发次数(WARN + FAIL) */ triggerCount: number; /** FAIL 次数 */ failCount: number; /** WARN 次数 */ warnCount: number; /** 最近 10 次的趋势 */ recentTrend: 'up' | 'down' | 'stable'; } /** * 按文件聚合的结果 */ export interface FileAggregation { /** 文件路径 */ filePath: string; /** 被标记次数 */ flaggedCount: number; /** 被哪些规则标记过 */ rules: string[]; } /** * 根因分析报告 */ export interface RootCauseReport { /** 维度 1:按规则聚合 */ byRule: RuleAggregation[]; /** 维度 2:按文件聚合 */ byFile: FileAggregation[]; /** 维度 3:配置建议 */ suggestions: ConfigSuggestion[]; } /** * 分析根因——三维度聚合历史数据 * @param history 审计历史条目数组(按时间正序或倒序均可,内部排序) * @returns 根因分析报告 */ export declare function analyzeRootCause(history: AuditHistoryEntry[]): RootCauseReport; //# sourceMappingURL=audit-root-cause.d.ts.map