/** Directory-relative location of the receipt, for messages and gitignores. */
export declare const APPLY_RECEIPT_DISPLAY_PATH = ".lisa/apply-receipt.json";
/**
 * Receipt schema version. Bump only alongside a reader change — an unknown
 * version is treated as no receipt at all rather than being misread.
 */
export declare const APPLY_RECEIPT_SCHEMA_VERSION = 1;
/**
 * How complete the recorded apply was.
 *
 * `postinstall-safe` is the `--skip-git-check` path a package manager runs. It
 * deliberately skips every agent emit (Codex, Claude, agy, Copilot, OpenCode)
 * and the Sonar integration, because those rewrite host-owned files that must
 * not change under an install. That is the right behaviour and the wrong
 * silence: it means no `bun install` at any version can migrate `.codex/config.toml`
 * — including the deprecated `codex_hooks` key — so a repo can sit on the
 * newest Lisa and still be missing work only a full `lisa apply` performs.
 * Recording the mode is what lets doctor say so.
 *
 * `unknown` covers receipts written before this field existed.
 */
export type ApplyMode = "full" | "postinstall-safe" | "unknown";
/** The persisted `.lisa/apply-receipt.json` shape. */
export interface ApplyReceipt {
    readonly schema_version: number;
    /** Lisa version that completed the apply. */
    readonly lisa_version: string;
    /** ISO timestamp of that apply. */
    readonly applied_at: string;
    /** Harness the apply emitted artifacts for. */
    readonly harness: string;
    /** Whether that apply was a full one or the postinstall-safe subset. */
    readonly apply_mode: ApplyMode;
    /**
     * Managed files that apply found changed upstream and deliberately did not
     * replace.
     *
     * The apply already names these, in the install output — which is scroll-back
     * nobody reads, and which is gone by the time anyone asks why a guard stopped
     * tracking upstream. Recording them is what turns a sentence in a `bun
     * install` into something `lisa doctor` can still report months later
     * (CodySwannGT/lisa#3033).
     *
     * Written by every apply, including the ones that leave nothing stale: an
     * empty array is the assertion "this apply looked, and found none", which is
     * different from a receipt that predates the field and cannot say.
     */
    readonly stale_paths: readonly string[];
}
/**
 * Resolve the single path every reader and writer uses.
 * @param root - Project root
 * @returns Absolute path to the receipt
 */
export declare function resolveApplyReceiptPath(root: string): string;
/**
 * Read the receipt, returning null when it is missing, unparseable, or written
 * by a schema this build does not understand.
 * @param root - Project root
 * @returns The receipt, or null when there is no usable one
 */
export declare function readApplyReceipt(root: string): Promise<ApplyReceipt | null>;
/**
 * Record that an apply completed successfully.
 *
 * Written atomically (temp file plus rename) so a reader never sees a partial
 * document, and never throws: a receipt that could not be written must not turn
 * a successful apply into a failed one. The cost of a silently missing receipt
 * is one spurious doctor warning; the cost of throwing here is breaking installs.
 * @param root - Project root that was applied to
 * @param details - What completed
 * @param details.lisaVersion - Lisa version that ran the apply
 * @param details.harness - Harness the apply emitted for
 * @param details.applyMode - Whether this was a full or postinstall-safe apply
 * @param details.stalePaths - Managed files the apply left out of date
 * @param now - Clock, injectable for tests
 * @returns True when the receipt was persisted
 */
export declare function recordSuccessfulApply(root: string, details: {
    readonly lisaVersion: string;
    readonly harness: string;
    readonly applyMode: ApplyMode;
    readonly stalePaths: readonly string[];
}, now?: () => Date): Promise<boolean>;
//# sourceMappingURL=apply-receipt.d.ts.map