/** * Contradiction Detection for Memory Frames * * Detects when a new frame contradicts an existing one based on: * - Opposite keywords (e.g., "always" vs "never", "enable" vs "disable") * - Negation patterns (e.g., "Don't use X" vs "Use X") * - Same module scope (contradictions only matter in the same context) */ import type { Frame } from "./frames/types.js"; /** * Types of contradiction signals */ export type ContradictionType = "opposite-keywords" | "negation-pattern" | "temporal-supersede"; /** * Signal indicating a potential contradiction between frames */ export interface ContradictionSignal { type: ContradictionType; confidence: number; explanation: string; } /** * Result of checking for contradictions */ export interface ContradictionResult { frameA: string; frameB: string; signal: ContradictionSignal | null; moduleOverlap: string[]; } /** * Pairs of opposite keywords that signal potential contradiction * Format: [positive, negative] */ export declare const OPPOSITE_KEYWORD_PAIRS: [string, string][]; /** * Negation words that can signal contradiction */ export declare const NEGATION_WORDS: string[]; /** * Detect if a new frame contradicts an existing frame * * Contradictions are only detected if frames share the same module scope * (or have overlapping modules). * * @param newFrame - New frame being added * @param existingFrame - Existing frame to compare against * @returns Contradiction signal if detected, null otherwise */ export declare function detectContradiction(newFrame: Frame, existingFrame: Frame): ContradictionSignal | null; /** * Find all contradictions for a new frame among existing frames * * @param newFrame - Frame to check for contradictions * @param existingFrames - Existing frames to compare against * @returns Array of contradiction results (only frames with contradictions) */ export declare function findContradictions(newFrame: Frame, existingFrames: Frame[]): ContradictionResult[]; /** * Scan all frames for contradictions * * @param frames - All frames to scan * @param moduleFilter - Optional module ID to filter by * @returns Array of contradiction results */ export declare function scanForContradictions(frames: Frame[], moduleFilter?: string): ContradictionResult[];