Answer stability round 1: 1 🔴, 7 🟡; check an escalation against the worker's own lines after the mark, cover the escalated and capped steps
This commit is contained in:
@@ -64,14 +64,12 @@ def escalation_cap(anchor: Rung, route: Route) -> Rung:
|
||||
def stepped(anchor: Rung, route: Route, bundled: int, escalated_at: int | None) -> Route:
|
||||
"""The route after one more unfinished verdict. Its rung never falls below taken_in's. It steps up one rung on every second unfinished verdict, or on an escalation the judge found while the rung is below escalation_cap; where both fall on one verdict, it steps once.
|
||||
|
||||
The mark, Route.escalated_at, moves only on a step whose verdict carries an escalation: to escalated_at, how many transcript entries the judge read. A step on the count of unfinished verdicts alone keeps it.
|
||||
|
||||
bundled and escalated_at are the verdict's bundled and judge.escalation_mark, None where the verdict carries no escalation; not the verdict, since loop_claude.cycle.judge imports this module through prompts.
|
||||
bundled is the highest L the judge saw the worker take in, 0 for none. escalated_at is how many transcript entries the judge read where the verdict carries an escalation, None where it carries none. A step moves the route's mark, Route.escalated_at, to escalated_at; a step on the count of unfinished verdicts alone keeps the mark. They are passed in place of the verdict, since loop_claude.cycle.judge imports this module through prompts.
|
||||
"""
|
||||
rung = taken_in(anchor, route, bundled)
|
||||
unfinished = route.unfinished + 1
|
||||
if unfinished >= UNFINISHED_PER_STEP or (escalated_at is not None and below_cap(anchor, route, rung)):
|
||||
return one_rung_up(route, rung, escalated_at)
|
||||
return one_rung_up(route, rung, route.escalated_at if escalated_at is None else escalated_at)
|
||||
return dataclasses.replace(route, rung=rung, unfinished=unfinished)
|
||||
|
||||
|
||||
@@ -83,9 +81,9 @@ def stepped_by_ruling(anchor: Rung, route: Route, bundled: int, escalated_at: in
|
||||
return one_rung_up(route, rung, escalated_at) if below_cap(anchor, route, rung) else dataclasses.replace(route, rung=rung)
|
||||
|
||||
|
||||
def one_rung_up(route: Route, rung: Rung, escalated_at: int | None) -> Route:
|
||||
"""The route one rung above rung, with the count of unfinished verdicts restarted and the mark moved as stepped says."""
|
||||
return dataclasses.replace(route, rung=stepped_up(rung), unfinished=0, escalated_at=route.escalated_at if escalated_at is None else escalated_at)
|
||||
def one_rung_up(route: Route, rung: Rung, escalated_at: int) -> Route:
|
||||
"""The route one rung above rung, with the count of unfinished verdicts restarted and the mark at escalated_at."""
|
||||
return dataclasses.replace(route, rung=stepped_up(rung), unfinished=0, escalated_at=escalated_at)
|
||||
|
||||
|
||||
def below_cap(anchor: Rung, route: Route, rung: Rung) -> bool:
|
||||
|
||||
Reference in New Issue
Block a user