import { type MemorySection } from './memoryIntelligence';
export type { MemorySection } from './memoryIntelligence';
export type ConflictType = 'negation' | 'supersession' | 'contradiction' | 'duplicate';
export type StalenessLevel = 'fresh' | 'aging' | 'stale' | 'very_stale' | 'unknown';
export interface ConflictResult {
    /** The existing section that the candidate conflicts with. */
    existingSection: MemorySection;
    /** Human-readable explanation of why this is flagged as a conflict. */
    reason: string;
    /** Category of conflict. */
    conflictType: ConflictType;
    /**
     * 0.0–1.0 confidence that this is a genuine conflict.
     * Values below 0.4 are indicative only.
     */
    confidence: number;
    /**
     * Shared topic words that linked the two entries together.
     * Empty for `duplicate` conflicts.
     */
    sharedTopics: string[];
}
export interface StalenessResult {
    section: MemorySection;
    level: StalenessLevel;
    /** Age in milliseconds; 0 when `createdAt` is absent. */
    ageMs: number;
    /** ISO date string from the section metadata, or undefined. */
    createdAt: string | undefined;
}
export interface StalenessThresholds {
    /** < this → fresh (default: 7 days). */
    agingMs?: number;
    /** < this → aging (default: 30 days). */
    staleMs?: number;
    /** < this → stale (default: 90 days). */
    veryStaleMs?: number;
}
/**
 * Compare a candidate `newBody` against a list of existing sections.
 * Returns one `ConflictResult` for each section that appears to conflict.
 */
export declare function detectConflicts(existingSections: MemorySection[], newBody: string): ConflictResult[];
/**
 * Classify a single section by age.
 * When `createdAt` is absent the level is `'unknown'`.
 */
export declare function detectStaleness(section: MemorySection, opts?: StalenessThresholds, now?: number): StalenessResult;
/**
 * Read `<projectDir>/.harness/memory/<fileName>` and return every conflict
 * between `newBody` and existing sections.
 */
export declare function scanFileForConflicts(projectDir: string, fileName: string, newBody: string): Promise<ConflictResult[]>;
/**
 * Read `<projectDir>/.harness/memory/<fileName>` and return all sections
 * whose `createdAt` puts them in the `stale` or `very_stale` tier.
 */
export declare function findStaleEntries(projectDir: string, fileName: string, opts?: StalenessThresholds): Promise<StalenessResult[]>;
/**
 * Scan all markdown files in the memory directory and return stale entries
 * grouped by file name.
 */
export declare function findAllStaleEntries(projectDir: string, opts?: StalenessThresholds): Promise<Record<string, StalenessResult[]>>;
/** Extract meaningful content words from text (min 4 chars, non-stopword). */
export declare function extractContentWords(text: string): Set<string>;
/**
 * Extract words that appear near a negation token in the text.
 * Returns the content words that are semantically negated.
 */
export declare function extractNegatedWords(text: string): Set<string>;
//# sourceMappingURL=memoryConflictDetector.d.ts.map