/** * ConflictDetector — Write-time conflict detection for ingest pipeline (FR-C01). * * Before a new entry is written to the DB, this module: * 1. Embeds the new entry content via BGE * 2. Retrieves top-K semantically similar existing entries (cosine > 0.75) * 3. Uses LLM to classify the relationship (equivalent/complementary/contradictory/unrelated) * 4. Decides whether to block the write based on the relationship * * Degraded mode (LLM unavailable): only blocks on cosine > 0.90 (assumed equivalent). */ export interface ConflictResult { relation: 'equivalent' | 'complementary' | 'contradictory' | 'unrelated'; confidence: number; existingEntryId: string; explanation: string; } export interface ConflictDetectionResult { shouldBlock: boolean; blockReason?: string; conflicts: ConflictResult[]; suggestedAction?: 'merge' | 'resolve_contradiction' | 'link' | 'proceed'; } export interface ConflictDetectorOptions { /** Minimum cosine similarity to consider as candidate (default 0.75) */ similarityThreshold?: number; /** Maximum number of similar entries to evaluate (default 5) */ topK?: number; /** Cosine threshold for degraded-mode equivalent detection (default 0.90) */ degradedEquivalentThreshold?: number; } /** * Detect conflicts between a new entry and existing entries in the knowledge base. * * @param newEntry - The entry about to be ingested (needs title, content) * @param newVector - BGE embedding vector of the new entry's content * @param dbPath - Path to the SQLite database * @param options - Detection options (thresholds, topK) */ export declare function detectConflicts(newEntry: { title: string; content: string; }, newVector: number[], dbPath: string, options?: ConflictDetectorOptions): Promise; //# sourceMappingURL=conflict-detector.d.ts.map