export interface ControlSpec { /** Verify command(s) run after each task. GREEN (all exit 0) => keep. Empty => gate disabled. */ verify: string[]; /** Globs that must never be part of a kept edit. A task touching one is reverted. */ protected_files: string[]; /** What condition counts as "keep" — reserved; currently only 'green'. */ keep_on: string; /** Max fix re-dispatches on a red verify before the change is discarded+reverted. */ max_fix_rounds: number; /** Cheap auto-fix passes allowed for mechanical failures (type/import/syntax) before counting a real fix round. */ max_mechanical_fixes: number; /** Hard wall-clock budget per task; exceeding it discards+reverts. null => no budget. */ budget_seconds: number | null; /** Free-form conditions under which the agent should escalate instead of silently continuing. */ escalate_when: string[]; /** Free-form policy describing what to do when fix rounds are exhausted. */ exhaustion: string; } /** A spec with the verify gate active (verify has at least one command). */ export declare function isGateActive(spec: ControlSpec | null | undefined): spec is ControlSpec; /** * Extremely small YAML subset parser — enough for CONTROL.md. * Supports: `key: scalar`, `key: [a, b]`, and a `key:` header followed by * indented `- item` list lines. One level of nesting only. Comments (`#`) and * blank lines are ignored. Quotes are stripped from scalars. */ export declare function parseControlYaml(text: string): Record; /** * Load the control spec for a workspace, or null if none exists. * Reads `.autodev/CONTROL.md` (first ```yaml fenced block) or `.autodev/control.yml`. * Returns null on absence or parse failure — the caller then behaves as today. */ export declare function loadControlSpec(root: string): ControlSpec | null; export interface VerifyResult { /** All configured commands exited 0. */ ok: boolean; /** Combined tail of stdout/stderr across commands (capped). */ output: string; /** Exit code of the first failing command, or 0 if all passed. */ code: number; /** True when the run was killed by the timeout. */ timedOut: boolean; } /** * Run each verify command in sequence. GREEN only when every command exits 0. * Captures combined output (tail-capped) for the fix hint and journal notes. */ export declare function runVerify(commands: string[], cwd: string, timeoutMs: number): VerifyResult; /** * Does a failure output look MECHANICAL (a cheap, local fix — type error, missing * import, syntax error) rather than a genuine logic failure? Used to grant a cheap * extra auto-fix pass before counting a real fix round. */ export declare function isMechanicalFailure(output: string): boolean; /** True when `file` (repo-relative, forward slashes) matches any of the globs. */ export declare function matchesAnyGlob(file: string, globs: string[]): boolean;