/** * Contradiction Detection (ADR-043, L5) * * 신규/갱신 메모리가 기존 메모리와 의미적으로 모순될 때 LLM 4-way 분류 → * confidence≥threshold 후보를 review queue(contradiction_reviews)에 등재한다. * * 기존 consolidation.ts:detectConflict(negation 단어 휴리스틱)의 LLM 의미 레이어 확장. * detectConflict는 cosine>0.9 병합 후보 안에서만 동작하나, 본 모듈은 cosine≥0.8 * 유사쌍을 LLM이 4-way 분류하여 부정어 없는 모순(metric 갱신/결정 번복)까지 포착한다. * * 트리거: SessionEnd batch (session-end.ts). config.contradiction.enabled 가드. * NoOpLLMClient(LLM key 미설정) 시 graceful skip. */ import type { MemoryDatabase } from '../db/database.js'; import type { LLMClient } from '../llm/client.js'; import type { ContradictionConfig, ContradictionResult, Memory } from '../types/index.js'; /** * 두 메모리 내용의 모순 관계를 gpt-4o-mini 등으로 4-way 분류. * 파싱 실패/빈 응답(NoOp) 시 no_conflict + confidence 0 반환 (graceful). */ export declare function classifyContradiction(client: LLMClient, newContent: string, existingContent: string): Promise; export interface ContradictionDetectionResult { skipped: boolean; candidatesChecked: number; llmCalls: number; reviewsCreated: number; } /** * SessionEnd batch — 신규 메모리 × cosine≥threshold 유사 기존 메모리를 4-way 분류 → * classification≠no_conflict && confidence≥threshold면 review queue 등재. */ export declare function detectContradictions(db: MemoryDatabase, client: LLMClient, config: ContradictionConfig, newMemories: Memory[]): Promise; //# sourceMappingURL=contradiction.d.ts.map