/** * Self-healing replay (Phase 3.1). * * After a failed replay, scan stderr for known missing-dependency patterns * (Node ModuleNotFoundError, Python ModuleNotFoundError, etc.), install * them inside the sandbox working directory, and retry the replay. * * Design constraints: * - Off by default. Only fires when --self-heal is explicitly requested. * - Only installs npm + pip dependencies. Other ecosystems require manual * intervention because their installs can require root, custom flags, * or persistent state (gem, cargo, go modules, etc.). * - Only acts on `high` confidence detections to avoid false positives. * - Caps healing at MAX_HEAL_ROUNDS to prevent infinite loops. * - Installs are scoped to the sandbox `working_directory` (npm install, * pip install --user / venv) so the host environment is not polluted. */ import { ReplayOptions, ReplayResult } from './engine.js'; import { RunConfig } from '../types/artifact.js'; import { FailureRecord } from '../types/failure.js'; import { MissingDependency } from '../utils/dependencies.js'; import { VerdictStatus } from './verdict.js'; export declare const MAX_HEAL_ROUNDS = 3; interface HealAttempt { round: number; dependencies: MissingDependency[]; installed: string[]; failedToInstall: string[]; /** Verdict after retrying replay with the deps installed */ verdictStatus: VerdictStatus; } export interface SelfHealResult { /** Last replay result (after all heal attempts) */ finalResult: ReplayResult; /** Healing trail — empty if no healing was needed */ attempts: HealAttempt[]; /** Whether self-heal eventually succeeded in changing the outcome */ healed: boolean; } /** * Run a replay with self-healing enabled. * * Strategy: * 1. Replay once via `replayArtifact`. * 2. If the verdict is `confirmed`, return immediately — there's nothing to heal. * (The bug *did* reproduce, which is the success case for a bug artifact.) * 3. Otherwise scan stderr for high-confidence missing dependencies. If any * installable (npm/pip) deps are found, install them in the sandbox cwd * and replay again. * 4. Repeat until either: verdict becomes `confirmed`, no new installable * deps are detected, or MAX_HEAL_ROUNDS is reached. */ export declare function selfHealReplay(runConfig: RunConfig, expectedFailure: FailureRecord, options: ReplayOptions): Promise; export {}; //# sourceMappingURL=self-heal.d.ts.map