Suppose an agent’s prompt scores 0.63 on a task. You ask for a rewrite, run the agent again, and keep the rewrite only if its score is higher. Repeat from the best prompt so far. That is hill-climbing: a cheap, single-threaded search that turns a measurement into a series of local changes. section 3.4.2 section 1.4.2
The ratchet has one decision per round:
- Propose one rewrite of the current best artifact, using its score and feedback. section 3.4.2
- Measure the candidate and record its result and lineage. section 3.4.1
- Advance the current best only when the candidate’s score is strictly higher; otherwise, try another rewrite from the existing best. section 3.4.2
When the ratchet does not move
On a revenue-policy task, the starting prompt scored 0.63. Ten proposed rewrites failed to beat it, leaving a net gain of zero. Improving all six rules required accepting a worse intermediate prompt, but this hill-climber could not take that step. It had reached a local peak, not necessarily the best prompt available. section 3.4.2
Listing 3.7 The ratchet inside HillClimb (`helix/search/hillclimb.py`)
for round_idx in range(self.rounds):
new_content, _ = await self._generate(current_best, current_score,
current_feedback) #A
variant = Variant(
artifact=current_best.mutate(new_content=new_content, ...), #B
parent=current_best,
search_method=self.kind.value,
)
yield variant #C
if variant.measurement is not None:
score = variant.measurement.score
if score is not None and (current_score is None
or score > current_score): #D
current_best = variant.artifact #E
current_score = score
current_feedback = variant.measurement.feedbackThe implementation shows the acceptance gate: a measured variant replaces the current best only when its score is strictly greater. section 3.4.2
Hill-climbing is a search component, not the whole improvement system. The surrounding loop can still measure a starting artifact, record rejected variants, and apply a separate deployment gate. A pairwise judge can supply the accept-or-reject signal instead of an absolute score, as in SPO. Neither version can cross a valley by retaining a worse candidate as its new best; an archive search can preserve those candidates for later exploration. section 3.4.1 section 2.3.4 section 4.3.4


