/** * Text-similarity conflict detection for store() — the sibling of findOutcomeConflicts * (TheBrainV2.ts) for memories that carry no symbolRefs. * * findOutcomeConflicts only fires when two memories share a tracked symbol and disagree on * outcome — it has nothing to say about a generic Q&A memory (no code, no symbol) that * near-duplicates an existing one with a different answer. Below dupThreshold (~0.92) those * two entries silently coexist: search() and smarter_cache then return an arbitrary mix of * both for the same question. This module closes that gap without opening a new one — it * only warns (mirrors the "not a block, just a warning" contract findOutcomeConflicts already * uses), it never deletes or downvotes anything itself. * * Kept as a pure function file, not a TheBrainV2 method: it only needs candidates the caller * already fetched via search(), never touches private state, and is easy to test and extend * on its own. */ export interface TextConflictCandidate { id: string; query: string; response: string; similarity: number; /** Entries already flagged wrong by a caller should not also gate new writes. */ demerits?: number; } export interface TextConflict { id: string; query: string; similarity: number; } export interface TextConflictOptions { /** Lower bound of the band this checks — below it, two memories are unrelated enough to coexist. */ floor?: number; /** Upper bound — at/above this, store()'s own exact-duplicate check already handles it. */ dupThreshold?: number; /** * Response-body Jaccard similarity at/above which two answers count as "the same claim, * differently worded" rather than a conflict — near 1.0 the new response says the same * thing as the old one, so there is nothing to warn about. */ maxResponseSimilarity?: number; } /** * Candidates whose query is a near-duplicate of the one being stored, but whose answer * substantially disagrees with it. `candidates` is expected to come from a query-similarity * search (any minSimilarity floor at or below `floor` works; this only filters the band). */ export declare function findTextConflicts(candidates: TextConflictCandidate[], newResponse: string, opts?: TextConflictOptions): TextConflict[]; //# sourceMappingURL=BrainConflicts.d.ts.map