import type { FailureLedger } from './FailureLedger.js';
export interface RevertInitiativeRef {
    id: string;
    projectId?: string;
    specPath?: string;
    origin?: string;
}
export interface RevertDetectorOptions {
    ledger: FailureLedger;
    /** Resolve the initiative owning a commit OID (InitiativeTracker.findByMergeCommit). */
    resolveByCommit: (oid: string) => RevertInitiativeRef | undefined;
    /** Repo dir for git reads. */
    cwd: string;
    /** Injectable git runner (args → stdout). Default: SafeGitExecutor.readSync. */
    git?: (args: string[]) => string;
    isLeaseHolder?: () => boolean;
    intervalMs?: number;
    /** How many recent commits to scan per tick. Default 100. */
    scanWindow?: number;
    onError?: (err: unknown) => void;
}
interface RevertCommit {
    hash: string;
    subject: string;
    revertedOid: string;
}
export declare class RevertDetector {
    private readonly ledger;
    private readonly resolveByCommit;
    private readonly cwd;
    private readonly git;
    private readonly isLeaseHolder;
    private readonly intervalMs;
    private readonly scanWindow;
    private readonly onError;
    private timer;
    private running;
    constructor(opts: RevertDetectorOptions);
    start(): void;
    stop(): void;
    /** Parse `git log` output into revert commits with a reverted OID. Pure (testable). */
    parseReverts(logOut: string): RevertCommit[];
    private touchedFiles;
    private isReachable;
    private isRevertCommit;
    /** One scan. Public for tests. Returns # ledger writes (opens + closes). */
    tick(): number;
    /** Mark a record resolved with a bounded ifMatch CAS retry (update() requires ifMatch). */
    private closeWithRetry;
}
export {};
//# sourceMappingURL=RevertDetector.d.ts.map