/**
 * BurnDetector — emits a structured signal when a single attribution_key
 * crosses configured spend thresholds.
 *
 * Phase 3 of docs/specs/token-burn-detection-and-self-heal.md.
 *
 * Signal-only (per umbrella spec §"Signal-vs-Authority Decomposition"): the
 * detector emits to the existing DegradationReporter. The Phase 4 runbook
 * (Tier-2 Remediator surface) is the only authority that decides whether
 * to alert / throttle / both. The BurnDetector cannot decide anything.
 *
 * Triggers (OR'd):
 *   1. Absolute share — a single attribution_key consumed > absoluteShareThreshold
 *      of total 24h spend.
 *   2. Baseline divergence — the key's last-1h rate is > rollingBaselineMultiplier ×
 *      its trailing-7-day median rate, AND the 1h rate exceeds rollingBaselineFloor
 *      tokens/h.
 *
 * Cold-start (per umbrella spec §"Threshold logic"): the baseline-divergence
 * trigger only fires after a key has been observed for 7 days. Until then,
 * absolute-share is the only signal — that's the trigger that would have
 * caught the 2026-05-15 incident.
 *
 * Polling cadence: 60s, decoupled from the ledger writer. The detector does
 * its own clock (injected `now`) so tests don't need to fake timers globally.
 */
import type { TokenLedger } from './TokenLedger.js';
import type { DegradationReporter } from './DegradationReporter.js';
export interface BurnDetectionConfig {
    enabled: boolean;
    /** Default 0.25 (25%). */
    absoluteShareThreshold: number;
    /**
     * Minimum last-1h tokens for the ABSOLUTE-SHARE trigger to fire. A key whose
     * trailing-24h share is high but whose CURRENT (last-1h) spend is at or below
     * this floor is not actively burning — it is a finished burst still sitting
     * inside the 24h window. Gating on it closes the "consumed 67% of 24h spend …
     * Projected 0 tokens in next 24h" false alarm that otherwise re-fires every
     * cooldown for a full day after one heavy session ends. Default 0 → require
     * strictly positive recent activity. (The baseline-divergence trigger already
     * has its own activity floor, `rollingBaselineFloor`.)
     */
    absoluteShareActivityFloorTokens: number;
    /** Default 2 (2x). */
    rollingBaselineMultiplier: number;
    /** Default 10_000_000 tokens/hour. */
    rollingBaselineFloor: number;
    /** Per-key alert cooldown (default 3_600_000ms = 1h). */
    perKeyAlertCooldownMs: number;
    /** Poll interval (default 60_000ms = 60s). */
    pollIntervalMs: number;
    /** Cold-start duration (default 7d). Baseline-divergence trigger disabled until elapsed. */
    coldStartMs: number;
}
export declare const DEFAULT_BURN_DETECTION_CONFIG: BurnDetectionConfig;
export interface BurnSignal {
    attributionKey: string;
    trigger: 'absolute-share' | 'baseline-divergence';
    emittedAt: string;
    observed: {
        tokens24h: number;
        share24h: number;
        tokensLast1h: number;
        projectedDaily: number;
    };
    /** Trailing-7d median tokens/h. Only populated for `baseline-divergence`. */
    baselineMedian7d?: number;
}
export interface BurnDetectorDeps {
    ledger: Pick<TokenLedger, 'byAttributionKey' | 'summary'>;
    reporter: Pick<DegradationReporter, 'report'>;
    config?: Partial<BurnDetectionConfig>;
    /** Injectable clock for tests. Defaults to `Date.now`. */
    now?: () => number;
    /**
     * Model-tier escalation §8 mid-run cap monitor (UltraSessionCapMonitor).
     * Rides THIS detector's tick cadence so no new poller exists
     * (FABLE-MODEL-ESCALATION-SPEC round-3 Integration-NEW-2). Its tick()
     * never throws. Optional — absent on agents without the feature wired.
     */
    ultraCapMonitor?: {
        tick(): void;
    };
}
export declare class BurnDetector {
    private readonly ledger;
    private readonly reporter;
    private readonly config;
    private readonly now;
    private readonly ultraCapMonitor?;
    /** First time a given attribution_key was seen. Used for cold-start cutoff. */
    private readonly firstSeen;
    /** Last alert emit time per key — gates per-key alert cooldown. */
    private readonly lastAlertAt;
    private timer;
    constructor(deps: BurnDetectorDeps);
    start(): void;
    stop(): void;
    /**
     * One detector cycle. Returns the signals emitted on this tick — useful
     * for tests, and the production loop ignores the return.
     */
    tick(): BurnSignal[];
}
//# sourceMappingURL=BurnDetector.d.ts.map