/**
 * Inbound-queue boot sweep (Durable Inbound Message Queue spec §5.2/§5.3 +
 * the §3.4 crash table). Runs on the UNCONDITIONAL boot path — outside the
 * mesh-gated wiring — keyed on store-file existence alone, BEFORE
 * `recoverPendingInjects` (boot ordering, §3.4) and before any drain starts.
 *
 * Duties:
 *  - corrupt/locked store → quarantine-rename (main + -wal/-shm sidecars,
 *    0600 preserved) + ONE attention item; boot proceeds (fail-open);
 *  - expired quarantines (> 7 days) deleted via SafeFsExecutor (L12) — this
 *    sweep owns the gated-off case; the backstop tick is the steady-state
 *    second layer;
 *  - queue-will-NOT-run-this-boot (gate reasons: feature-disabled /
 *    pool-dark / no-mesh-identity / dry-run) → expire ALL non-terminal rows
 *    in one transaction, loss reason NAMES the gate, loss-reported;
 *  - queue WILL run → crash recovery per the §3.4 crash table:
 *      claimed + receipt + PIS record  → delivered (PIS replays the inject);
 *      claimed + receipt, no PIS       → delivered + "possibly not injected";
 *      claimed, no receipt             → released to queued (frozen when a
 *                                        pause is durably in effect);
 *    + PIS veto for operator-stop rows (STOP-scoped ONLY, round-9);
 *    + unflipped unreported receipts → "possibly not injected" report.
 */
import { PendingInboundStore } from './PendingInboundStore.js';
import type { LossItem } from './QueueDrainLoop.js';
export type QueueGateReason = 'feature-disabled' | 'pool-dark' | 'no-mesh-identity' | 'dry-run';
export interface BootSweepDeps {
    stateDir: string;
    agentId: string;
    /** Will the drain run this boot? false carries the NAMED gate (§5.3). */
    queueWillRun: {
        run: true;
    } | {
        run: false;
        gateReason: QueueGateReason;
    };
    /** Does a PendingInjectStore record exist for this session? (crash row 2 vs 3) */
    hasPisRecord(sessionKey: string): boolean;
    /** Delete the PIS record (stop veto — through the PIS clear API). */
    clearPisRecord(sessionKey: string): void;
    reportLoss(items: LossItem[], reason: string): void;
    reportPossiblyNotInjected(items: LossItem[]): void;
    raiseAttention(title: string, body: string): void;
    log(line: string): void;
    nowMs(): number;
}
export interface BootSweepResult {
    storePresent: boolean;
    quarantined: boolean;
    expiredQuarantinesDeleted: number;
    gateExpired: number;
    recoveredToQueued: number;
    settledDelivered: number;
    possiblyNotInjected: number;
    pisVetoed: number;
    /** The opened store when the queue will run (handed to the drain), else null. */
    store: PendingInboundStore | null;
}
export declare function quarantineDirFor(stateDir: string): string;
export declare function runInboundQueueBootSweep(deps: BootSweepDeps): BootSweepResult;
//# sourceMappingURL=inboundQueueBootSweep.d.ts.map