/** * MECE Governance — 知识去重与覆盖度审计核心逻辑 (FR-N01) * * AC1: 入库前 BGE 向量语义查重 * AC2: 全库语义去重扫描 * AC3: 去重报告含合并建议 * AC4: --auto 模式自动合并 * AC5: 覆盖度审计 * AC6: 语义相似度必须用 BGE 向量 embedding * AC7: --domain 按域限定扫描范围 */ export interface DuplicatePair { entryA: { id: string; title: string; content: string; domain: string | null; }; entryB: { id: string; title: string; content: string; domain: string | null; }; similarity: number; } export interface MergeSuggestion { pair: DuplicatePair; keepId: string; removeId: string; strategy: 'keep_longer' | 'keep_newer' | 'merge_content'; mergedContentPreview: string; } export interface DeduplicateReport { totalEntries: number; scannedEntries: number; duplicatePairs: DuplicatePair[]; mergeSuggestions: MergeSuggestion[]; autoMerged: number; domain?: string; } export interface CoverageGap { keyQuestion: string; covered: boolean; coveringEntryIds: string[]; explanation: string; } export interface CoverageReport { domainId: string; purpose: string; totalQuestions: number; coveredQuestions: number; gaps: CoverageGap[]; } export interface PreIngestCheckResult { isDuplicate: boolean; similarity: number; matchedEntryId?: string; matchedEntryTitle?: string; matchedEntryContent?: string; } /** * Check if a new entry's embedding is a near-duplicate of existing entries. * Returns the best match if similarity > threshold (from kivo.config.json). */ export declare function checkPreIngestDuplicate(newVector: number[], dbPath?: string, threshold?: number): PreIngestCheckResult; export interface DeduplicateOptions { /** Similarity threshold for flagging duplicates (reads from kivo.config.json by default) */ threshold?: number; /** Auto-merge entries with similarity > 0.95 */ auto?: boolean; /** Limit scan to a specific domain */ domain?: string; } /** * Scan the entire knowledge base for semantic duplicates using BGE embeddings. * Returns a report with duplicate pairs and merge suggestions. */ export declare function runDeduplicateScan(options?: DeduplicateOptions): Promise; export interface CoverageAuditOptions { domain: string; } /** * Audit knowledge coverage against a domain's keyQuestions. * Uses LLM to judge whether each keyQuestion is covered by existing entries. */ export declare function runCoverageAudit(options: CoverageAuditOptions): Promise; /** * checkDuplicate — convenience wrapper for cmd-learn-from-badcase (FR-N02 AC6). * Embeds the content with BGE and checks against existing entries. */ export declare function checkDuplicate(content: string, options?: { cwd?: string; }): Promise<{ isDuplicate: boolean; matchId?: string; similarity?: number; }>; export declare function formatDeduplicateReport(report: DeduplicateReport): string; export declare function formatCoverageReport(report: CoverageReport): string; //# sourceMappingURL=mece-governance.d.ts.map