/** * Shared call-count + wall-clock cap tracker (docs/specs/20260723-codebase-refactor-plan.md §1a). * * Reconciles the byte-identical `GatekeeperRunTracker` (src/distill/gatekeeper.ts), * `AtomTriageRunTracker` (src/distill/atom-triage.ts), and `DupJudgeRunTracker` * (src/consolidate/dup-judge.ts) — same fields, same shouldStop/recordCall/state * shape, same fail-open contract (a tripped cap means the caller's remaining * un-processed items fall through un-gated/un-triaged/un-judged, never an * auto-resolve-by-timeout — the FEAT-482 lesson each of the three classes * used to restate independently). The only per-site variance was the log * message: a bracketed tag plus two prose fragments naming what's being * skipped and what happens to the fallthrough items. `RunCapMessages` carries * that variance; everything else lives here once. * * Deliberately excludes `DistillCostCapTracker` (src/distill/cost-cap.ts — * has an extra `enabled` toggle and a different contract), the * contradiction-judge inline tracker (src/consolidate/consolidate.ts), and * `groundAtomDates`'s inline loop (src/distill/ground-dates.ts) — none of * those share this exact shape. */ export interface RunCap { maxPerRun: number; maxWallClockMs: number; } export interface RunCapMessages { /** Bracketed log tag, e.g. `'gatekeeper'` -> `[gatekeeper] ...`. */ tag: string; /** What further calls are being skipped, e.g. `'further gate calls for this job'`. */ skipping: string; /** What happens to the un-processed remainder — a full sentence, own trailing period. */ fallthrough: string; } export declare class RunCapTracker { private readonly caps; private readonly messages; private readonly log; private callsThisRun; private readonly startedAt; private capReached; private wallClockCapReached; private loggedTrip; constructor(caps: RunCap, messages: RunCapMessages, log?: (message: string) => void); shouldStop(): boolean; recordCall(): void; state(): { callsExecuted: number; capReached: boolean; wallClockCapReached: boolean; }; private logTripOnce; }