Best-of-N
Give the LLM N valid attempts at the same parent before committing to the global best, then repeat.
"""Best-of-N Proposer component — the strict SEARCH/REPLACE diff operator (no full-rewrite fallback)."""
from __future__ import annotations
from ...components.proposer import DiffProposer
class BestOfNProposer(DiffProposer):
"""One LLM call -> a SEARCH/REPLACE diff applied to the parent (SkyDiscover's solution generator),
with mandatory no-op detection. Diffs apply by whole-line matching (SkyDiscover ``apply_diff``); a
response with no matching diff block is a NO_DIFF (retried/discarded), never a full rewrite or a
substring edit. Each valid call counts as one of the N attempts at the parent (failures are retried
free; see BestOfNPolicy)."""
diff_wholeline = True