/** Write-time consolidation options for {@link persistConsolidatedLearning}. */
export interface ConsolidatedLearningOptions {
    /** Ids of existing entries the new entry merges or replaces. */
    readonly supersede?: readonly string[];
    /**
     * Called when a supersede target was already absent at write time — almost
     * always because a concurrent pass consolidated it first. The write still
     * succeeds; this is a diagnostic, not a failure hook.
     */
    readonly onAbsentSupersede?: (ids: readonly string[]) => void;
    /**
     * Called when a `supersedes:` alias reference did not fit inside the entry's
     * provenance cap and was dropped. A reference that is about to stop resolving
     * must never disappear silently; the write still succeeds.
     */
    readonly onAliasesDropped?: (references: readonly string[]) => void;
}
/**
 * Persist one already-selected learning without generating or truncating it.
 * Append-only: a duplicate id always throws. Kept as the stable back-compat
 * entry point; consolidation-aware writers use
 * {@link persistConsolidatedLearning} instead.
 * @param projectRoot - Absolute path to the host project root
 * @param candidate - Untrusted seven-field learning entry
 * @returns Absolute path to the persisted learnings file
 */
export declare function persistLearningEntry(projectRoot: string, candidate: unknown): Promise<string>;
/**
 * Persist one learning with mandatory write-time consolidation semantics:
 * entries named in `supersede` are dropped from the document in the same
 * atomic write that adds the new entry, so a related existing entry is merged
 * or replaced instead of gaining a near-duplicate sibling. The rendered
 * document is re-validated against the shared entry and file budgets after
 * consolidation. Without `supersede` this is exactly the append-only
 * {@link persistLearningEntry} behavior, including the duplicate-id throw.
 * @param projectRoot - Absolute path to the host project root
 * @param candidate - Untrusted seven-field learning entry
 * @param options - Optional consolidation directives
 * @returns Absolute path to the persisted learnings file
 */
export declare function persistConsolidatedLearning(projectRoot: string, candidate: unknown, options?: ConsolidatedLearningOptions): Promise<string>;
/** Outcome vocabulary for {@link confirmLearningEntry}. */
export type ConfirmLearningStatus = "confirmed" | "unchanged" | "not-found";
/** Structured no-throw outcome of a surgical `last_confirmed` bump. */
export interface ConfirmLearningResult {
    /** What happened: written, already-current no-op, or missing-target no-op. */
    readonly status: ConfirmLearningStatus;
    /** The entry id the caller asked to confirm. */
    readonly id: string;
    /**
     * Absolute learnings file path whenever the file exists — including an
     * in-file `not-found` id — so callers can report a consistent target.
     * Absent only when the learnings file itself does not exist.
     */
    readonly file?: string;
    /** Previous `last_confirmed` value when the entry was advanced. */
    readonly previous?: string;
}
/**
 * Surgically advance ONLY one entry's `last_confirmed` timestamp — the
 * claim-time "this rule demonstrably applied" confirmation (#1579). Uses the
 * same lock/safety/atomic machinery as the persist writers, but is monotonic
 * and non-blocking by design: a missing file or unknown id returns a
 * structured no-op result instead of throwing, and a date at or before the
 * stored `last_confirmed` never rewrites the file (idempotent within a claim,
 * never regresses). Every other entry field is preserved byte-for-byte; the
 * updated entry is re-validated so the `last_confirmed >= first_learned`
 * invariant and all budgets still hold.
 * @param projectRoot - Absolute path to the host project root
 * @param id - Stable id of the entry to confirm
 * @param date - Confirmation date (real ISO `YYYY-MM-DD`)
 * @returns Structured outcome; never throws for a missing entry or file
 */
export declare function confirmLearningEntry(projectRoot: string, id: string, date: string): Promise<ConfirmLearningResult>;
export { parseLearningsFile, renderLearningsFile, } from "./learnings-document.js";
export { validateLearningEntry } from "./learnings-entry.js";
//# sourceMappingURL=learnings-writer.d.ts.map