/** * Contradiction Resolution Strategies * * Provides different ways to resolve contradictions between frames: * - Supersede: Mark old frame as outdated * - Scope: Add scope clarification to both frames * - Keep both: Acknowledge contradiction but keep both * - Cancel: Don't store the new frame */ import type { Frame } from "./frames/types.js"; import type { ContradictionResult } from "./contradictions.js"; /** * Resolution strategy types */ export type ResolutionType = "supersede" | "scope" | "keep-both" | "cancel"; /** * Metadata about how a contradiction was resolved */ export interface ContradictionResolution { /** Type of resolution applied */ type: ResolutionType; /** ID of the contradicting frame */ contradictsFrameId: string; /** Optional note about the resolution */ note?: string; /** Scope clarification (for scope resolution) */ scope?: string; } /** * Extended Frame type with contradiction metadata */ export interface FrameWithContradiction extends Frame { /** Contradiction resolution metadata */ contradictionResolution?: ContradictionResolution; } /** * Apply supersede resolution * Marks the existing frame as superseded by the new frame * * @param newFrame - New frame that supersedes the old one * @param existingFrame - Existing frame to be marked as superseded * @returns Tuple of [newFrame, updatedExistingFrame] */ export declare function applySupersede(newFrame: Frame, existingFrame: Frame): [FrameWithContradiction, FrameWithContradiction]; /** * Apply scope resolution * Adds scope clarification to both frames * * @param newFrame - New frame with scope clarification * @param existingFrame - Existing frame with scope clarification * @param newScope - Scope for new frame (e.g., "database/hot-paths") * @param existingScope - Scope for existing frame (e.g., "database/queries") * @returns Tuple of [newFrame, updatedExistingFrame] */ export declare function applyScope(newFrame: Frame, existingFrame: Frame, newScope: string, existingScope: string): [FrameWithContradiction, FrameWithContradiction]; /** * Apply keep-both resolution * Acknowledges contradiction but keeps both frames * * @param newFrame - New frame * @param existingFrame - Existing frame * @returns Tuple of [newFrame, updatedExistingFrame] */ export declare function applyKeepBoth(newFrame: Frame, existingFrame: Frame): [FrameWithContradiction, FrameWithContradiction]; /** * Format contradiction for display */ export declare function formatContradiction(contradiction: ContradictionResult, frameA: Frame, frameB: Frame): string;