/** * decay-detector — 知识衰减检测 * * 对比上次完整性快照(integrity.json)与当前文件状态, * 检测哪些文件已变更但其关联索引/下游引用未更新 */ import { KnowledgeGraph } from './knowledge-graph'; export interface DecayReport { generated: string; iteration: string; decayedFiles: DecayItem[]; summary: { total: number; decayed: number; healthy: number; }; } export interface DecayItem { entityId: string; title: string; file: string; type: 'content_changed' | 'downstream_stale' | 'orphaned' | 'code_ahead_of_spec'; severity: 'info' | 'warning' | 'critical'; detail: string; affectedDownstream?: string[]; } /** * 检测知识衰减 * * 检测规则: * 1. content_changed: 文件 hash 与上次快照不同 → 内容已变更 * 2. downstream_stale: 上游需求变更了,但关联的 spec/task 未同步更新 * 3. orphaned: 图谱中有引用但文件已不存在 */ export declare function detectDecay(cwd: string, graph: KnowledgeGraph): Promise; /** 格式化衰减报告为 Markdown */ export declare function formatDecayReport(report: DecayReport): string; //# sourceMappingURL=decay-detector.d.ts.map