/**
 * ReapLog — durable, JSON-encoded audit of every session reap and every
 * skipped-reap (UNIFIED-SESSION-LIFECYCLE §P4).
 *
 * The pull-surface answer to "why did my session vanish?": one line per reap
 * (`sessionReaped`) and one per refused/skipped terminate (`reapBlocked`), so a
 * dropped kill (not-lease-holder / protected / a KEEP / in-flight) is never
 * invisible. Mirrors `sentinel-events.jsonl`: append-only JSONL under
 * `logs/`, written with JSON.stringify (never raw concat — closes
 * newline-injection of user-controlled session names / reasons).
 *
 * Read-only from the API (`GET /sessions/reap-log`, Bearer-auth). The log never
 * gates or mutates a session — it only records.
 */
/**
 * Terminal + initial outcomes of a reap-notice delivery attempt
 * (reap-notify spec R1.3). Records are APPENDED as pairs: one at enqueue
 * (`enqueued`) and one at terminal state — append-only JSONL, latest record
 * per noticeId wins on read.
 */
export type ReapNotifyOutcome = 'enqueued' | 'sent' | 'send-failed-escalated' | 'no-topic' | 'enqueue-failed';
export interface ReapLogEntry {
    ts: string;
    /** 'reaped' = a kill happened; 'skipped' = a terminate was refused/no-op;
     *  'notify' = a reap-notice delivery outcome record (reap-notify spec R1.3). */
    type: 'reaped' | 'skipped' | 'notify';
    session: string;
    tmuxSession: string;
    /** The reason the killer requested (e.g. 'idle-zombie', 'age-limit'). */
    reason: string;
    /** What actually happened: terminal/recovery-bounce, skipped:<authority-reason>,
     *  or notify:<outcome>. */
    disposition: 'terminal' | 'recovery-bounce' | `skipped:${string}` | `notify:${string}`;
    origin?: 'operator' | 'autonomous';
    /** UNTRUSTED caller-supplied provenance claim (REMOTE-SESSION-CLOSE-SPEC §2.3)
     *  — e.g. 'remote-dashboard' from a relayed close. A label any token holder
     *  could set; recorded as a signal for the audit trail, NEVER consulted in
     *  authority decisions (those read `origin`, which is route-stamped). */
    viaClaim?: string;
    /** For 'skipped': why the authority refused (protected / not-lease-holder / a KEEP / in-flight). */
    skipped?: string;
    machine?: string;
    /** Which billing lane the reaped session ran on (june15-headless-spawn-reroute
     *  PR2, finding O4). 'rerouted-interactive' = the subscription lane;
     *  'headless' = the legacy `claude -p` SDK-pot lane. Absent on legacy records /
     *  non-claude spawns where the field was never stamped. */
    launchLane?: 'headless' | 'rerouted-interactive';
    /** Reaped entries: true when the kill interrupted evidenced work
     *  (reap-notify spec R2.1 — any non-marker work evidence). */
    midWork?: boolean;
    /** Reaped entries: the clamped work-evidence names that drove midWork. */
    workEvidence?: string[];
    /**
     * Reaped entries: which evidence SOURCE drove the revival-eligibility tag
     * (autonomous-registration-guarantee spec, GAP-B D3). Default (absent) ⇒
     * `'state-file'` — the registered-run path, back-compat for older rows.
     * `'commitment'` ⇒ the GAP-B backstop fired (a fresh qualifying open
     * commitment + recent-user-message corroboration on an UNregistered run).
     * PII constraint (D3): this field + at most the commitment id may be logged —
     * NEVER userRequest/agentResponse (this JSONL is world-readable).
     */
    evidenceSource?: 'state-file' | 'commitment';
    /** Notify entries: the notice this outcome record belongs to. */
    noticeId?: string;
    /** Notify entries: the topic the notice targets (absent for lifeline-only). */
    topicId?: number;
    /** Notify entries: the outcome this record asserts. */
    outcome?: ReapNotifyOutcome;
}
export declare class ReapLog {
    private readonly logPath;
    private readonly machineId?;
    constructor(stateDir: string, machineId?: () => string | undefined);
    recordReaped(e: {
        session: string;
        tmuxSession: string;
        reason: string;
        disposition?: 'terminal' | 'recovery-bounce';
        origin?: 'operator' | 'autonomous';
        viaClaim?: string;
        launchLane?: 'headless' | 'rerouted-interactive';
        midWork?: boolean;
        workEvidence?: string[];
        evidenceSource?: 'state-file' | 'commitment';
    }): void;
    /**
     * Append one reap-notice delivery outcome record (reap-notify spec R1.3).
     * Written as PAIRS by the notify path: once at enqueue (`enqueued`) and
     * once at terminal state. Append-only; consumers take the latest record
     * per noticeId as the current state.
     */
    recordNotify(e: {
        noticeId: string;
        topicId: number | null;
        outcome: ReapNotifyOutcome;
        /** Plain detail for the audit trail (e.g. the send error class). */
        detail?: string;
    }): void;
    recordSkipped(e: {
        session: string;
        tmuxSession: string;
        reason: string;
        skipped: string;
        origin?: 'operator' | 'autonomous';
    }): void;
    private append;
    /** Read the most-recent `limit` entries (newest last), tolerating partial/corrupt lines. */
    read(limit?: number): ReapLogEntry[];
    private normalizeEntry;
}
//# sourceMappingURL=ReapLog.d.ts.map