/** * Bounded stall detector. * * Detects no-progress at strategy/phase level using structured progress * observations (and call-level no-progress evidence from the 1.4.0 Tool Storm * Breaker). Proceeds through bounded stages: * * none → warning → strategy_review → pivot_required → blocked * * It never permits infinite self-reflection. Legitimate waiting for a changing * external condition is not counted as stall when a bounded polling policy * exists. */ import type { ProgressAccumulator } from "./progress.js"; import type { StallLevel, StallState } from "./types.js"; export interface StallConfig { /** Turns without structured progress before a warning. */ warningAfterNoProgressTurns: number; /** Calls without structured progress before a warning. */ warningAfterNoProgressCalls: number; /** ... before strategy_review. */ reviewAfterNoProgressTurns: number; reviewAfterNoProgressCalls: number; /** ... before pivot_required. */ pivotAfterNoProgressTurns: number; pivotAfterNoProgressCalls: number; /** ... before blocked. */ blockedAfterNoProgressTurns: number; blockedAfterNoProgressCalls: number; } export declare const DEFAULT_STALL_CONFIG: StallConfig; export interface StallInput { progress: ProgressAccumulator; noProgressTurns: number; noProgressToolCalls: number; repeatedFailureFingerprint?: string; evidenceIds?: string[]; oscillationCount?: number; config?: StallConfig; } export interface StallEvaluation { state: StallState; previousLevel?: StallLevel; } /** * Deterministically evaluate stall level from no-progress counts and the * structured progress accumulator. The accumulator is the authority on progress: * prose never resets stall. */ export declare function evaluateStall(input: StallInput): StallEvaluation; /** * Poll-gating helper: a bounded polling policy counts as legitimate waiting, * not stall, when the poll observes a state change. */ export declare function pollProgress(previousHash: string | undefined, currentHash: string | undefined, hasStructure: boolean): boolean; /** Stage the next action after a stall level. */ export declare function stallNextAction(level: StallLevel): "continue" | "self_review" | "review" | "pivot" | "escalate" | "block"; //# sourceMappingURL=stall-detector.d.ts.map