import type { HorizonCore } from './core.js'; export interface HaltConfig { /** Hard cap on observed steps within a turn. */ maxIterations: number; /** Halt after this many consecutive observes with an UNCHANGED progress signature. */ noProgressLimit: number; /** Halt after this many consecutive observes with the SAME failure signature. */ repeatedFailureLimit: number; } export interface HaltState { iteration: number; lastProgress: string | null; staleCount: number; lastFailure: string | null; failureRepeat: number; pending: HaltReason | null; } export type HaltReason = 'iteration-budget' | 'no-progress' | 'repeated-failure'; export interface HaltDecision { halt: boolean; reason: HaltReason | null; } export declare const DEFAULT_HALT_CONFIG: HaltConfig; export declare class HaltController { private readonly core; readonly config: HaltConfig; private state; constructor(core: HorizonCore, config?: HaltConfig); /** Rehydrate a controller from a persisted snapshot (session resume). */ static restore(core: HorizonCore, config: HaltConfig, state: HaltState): HaltController; private reduce; /** * Record one step. `progress` is a signature of forward state (e.g. a hash of * files-changed + tests-passing); if it does not change for `noProgressLimit` * observes, a no-progress halt is armed. `failure` is a signature of an error * (null = the step succeeded, which breaks any failure streak); the same * failure `repeatedFailureLimit` times arms a repeated-failure halt. Observing * NEVER halts — it only arms; the next `beforeModel()` consumes. */ observe(opts?: { progress?: string; failure?: string | null; }): void; /** Consume any armed halt. Call once per turn before invoking the model. */ beforeModel(): HaltDecision; /** Reset all counters at a turn boundary (ADK resets halts between turns). */ turnBoundary(): void; /** Current serializable state (persist this to resume later). */ snapshot(): HaltState; } //# sourceMappingURL=halt.d.ts.map