/**
 * Explorer — best-of-N candidate exploration (Phase 2)
 *
 * Instead of committing to a single attempt per turn, the explorer:
 *  1. generates N candidates concurrently, each steered by a distinct
 *     strategy seed (diversity by prompt, not temperature — small-model
 *     profiles pin temperature low for stability)
 *  2. evaluates each candidate against the real gates on the same baseline
 *     tree via apply → verify → rollback
 *  3. ranks objectively (gates passed, then score); a judge tie-breaks
 *     candidates tied at the top
 *  4. commits only the winner to the tree
 *
 * Candidate verification is sequential by design: gates (npm test, builds)
 * cannot safely run concurrently in one tree. Worktree-isolated parallel
 * verification is a planned optimization (inject via `revertibleApplier` +
 * a per-candidate workspace), not a Phase 2 requirement.
 *
 * Fairness caveat: rollback reverts files the model wrote, but gate commands
 * also mutate the tree (dist/ output, snapshots, caches). Candidate N+1 may
 * therefore see candidate N's gate side effects. The committed winner is
 * re-verified after commit so its reported ladder reflects real on-disk
 * state. Full per-candidate isolation requires the workspace seam above.
 */
import type { GateRung, LadderResult, LadderOptions } from './verifier-ladder.js';
import type { LadderRunner, LoopExecutor } from './convergence-loop.js';
import type { Applier, ApplyOptions, ApplyResult, RevertibleApply } from './applier.js';
import type { Judge } from './judge.js';
/** Hard ceiling on candidates per turn — guards direct library callers
 * (the CLI caps lower); each candidate costs a model call + a full gate run. */
export declare const MAX_CANDIDATES = 8;
export interface StrategySeed {
    id: string;
    hint: string;
}
export declare const DEFAULT_STRATEGY_SEEDS: StrategySeed[];
export interface CandidateResult {
    id: string;
    strategy: string;
    output: string;
    applyResult: ApplyResult | null;
    ladder: LadderResult | null;
    /** Executor failure for this candidate, if any */
    error?: string;
    passed: boolean;
    score: number;
}
export interface ExplorationResult {
    winner: CandidateResult | null;
    candidates: CandidateResult[];
    /** Judge rationale when a tie-break occurred */
    judgeRationale?: string;
    /** Ladder result of the committed winner (from its evaluation run) */
    ladder: LadderResult | null;
}
export interface ExplorerConfig {
    /** Number of candidates per turn (default 3) */
    candidates?: number;
    seeds?: StrategySeed[];
    judge?: Judge;
    projectRoot: string;
    rungs: GateRung[];
    ladderOptions?: LadderOptions;
    ladderRunner?: LadderRunner;
    /** Override the commit applier (defaults to applyFileBlocks) */
    applier?: Applier;
    /** Override the per-candidate revertible applier (defaults to applyFileBlocksWithRollback) */
    revertibleApplier?: (output: string, projectRoot: string, options?: ApplyOptions) => RevertibleApply;
    /** Apply-stage options (e.g. protected pre-existing test files) */
    applyOptions?: ApplyOptions;
    onCandidate?: (candidate: CandidateResult) => void;
}
/**
 * Generate, evaluate, and commit the best candidate for one loop turn.
 * The base prompt comes from the loop's prompt builder; each candidate
 * appends its strategy seed.
 */
export declare function exploreAndCommit(task: string, basePrompt: string, executor: LoopExecutor, config: ExplorerConfig): Promise<ExplorationResult>;
//# sourceMappingURL=explorer.d.ts.map