/**
 * FailureEpisodeLatch — the generic failure-episode accountant behind the
 * "No Unbounded Loops" (P19) Eternal Sentinel condition 4: a loop that retries
 * forever must (a) log state CHANGES, not attempts, and (b) raise ONE
 * sustained-failure signal per episode, then stay quiet while retrying.
 *
 * Third night-of-2026-06-05 incarnation of the episode-latch shape
 * (SlowRetrySentinelEscalation in lifeline; the inline live-tail stale latch)
 * — extracted to core as the canonical reusable form so future loops stop
 * re-implementing it <!-- tracked: CMT-1109 -->. Pure: injectable clock, three
 * fields of state, no I/O.
 *
 * Usage per attempt:
 *   const f = latch.recordFailure();         // on a failed attempt
 *   if (f.firstOfEpisode) log("X became failing: ...");
 *   if (f.shouldSignal)  reportDegradationOnce(...);   // fires ONCE per episode
 *   ...
 *   const s = latch.recordSuccess();         // on a successful attempt
 *   if (s.recovered) log(`X recovered after ${s.failures} failures`);
 */
export interface FailureEpisodeLatchOpts {
    /** Sustained-failure threshold before the one-per-episode signal. */
    signalAfterMs: number;
    now?: () => number;
}
export interface FailureRecord {
    /** True exactly once — the attempt that started this episode. */
    firstOfEpisode: boolean;
    /** True exactly once per episode — the first failed attempt at/after the threshold. */
    shouldSignal: boolean;
    /** Episode duration so far (ms). */
    failingForMs: number;
    /** Consecutive failures including this one. */
    failures: number;
}
export declare class FailureEpisodeLatch {
    private readonly signalAfterMs;
    private readonly now;
    private failingSince;
    private failures;
    /** Episode key (failingSince value) the signal already fired for — null = armed. */
    private signaledFor;
    constructor(opts: FailureEpisodeLatchOpts);
    recordFailure(): FailureRecord;
    recordSuccess(): {
        recovered: boolean;
        failures: number;
    };
}
//# sourceMappingURL=FailureEpisodeLatch.d.ts.map