import { BaseOptimizer, type BaseOptimizerDeps } from "../baseOptimizer.js"; import { type ProposeMutationArgs } from "../mutator.js"; import type { Input } from "../grading/types.js"; import type { BaseOptimizerConfig } from "../optimizer.js"; import { type OptimizeMutationOperation, type OptimizeMutationPreview } from "../sourceMutator.js"; import { type OptimizeTargetSet } from "../targets.js"; import type { MutationProposal, OptimizeResult } from "../types.js"; /** Test seams: inject proposal / preview so the loop can run without real LLM or AST work. * (Target discovery is injected via BaseOptimizerDeps.discover.) */ export type GreedyDeps = BaseOptimizerDeps & { propose?: (args: ProposeMutationArgs) => Promise; preview?: (targetSet: OptimizeTargetSet, operations: OptimizeMutationOperation[]) => OptimizeMutationPreview; }; /** Champion–challenger hill-climb with pointwise grading (replaces the pairwise judge). */ export declare class GreedyReflective extends BaseOptimizer { private readonly greedyDeps; readonly name = "greedy"; constructor(config: BaseOptimizerConfig, greedyDeps?: GreedyDeps); protected optimizeTargets(source: OptimizeTargetSet, inputs: Input[]): Promise; /** The one place the champion is threaded across iterations. */ private hillClimb; /** Propose → apply → evaluate one candidate, deciding accept/reject against the champion. */ private attempt; /** Grade a candidate `files` map (the overlay) on `inputs`. */ private makeCandidate; /** Greedy's acceptance policy: pass every gate AND beat the champion's objective. */ private beats; }