Run the judge on the rung its chunk's item picks, never below the project's, as the replay found every cheaper rung missing verdicts

This commit is contained in:
2026-10-15 08:23:20 +02:00
parent 30f60c570d
commit 069b3814b9
12 changed files with 44 additions and 21 deletions
+11 -2
View File
@@ -1,8 +1,8 @@
"""Which ladder rung a chunk's worker runs on: docs/decisions.md → `routing:`."""
"""Which ladder rung a chunk's worker and judge run on: docs/decisions.md → `routing:`."""
import dataclasses
from failure import Failure
from model_routing.ladder import highest, LADDER, picked, Rung, stepped_up
from model_routing.ladder import highest, LADDER, picked, project_rung, Rung, stepped_up
from todo_table import Item, items
from model_routing.route import Route
@@ -39,3 +39,12 @@ def stepped(anchor: Rung, route: Route, bundled: int) -> Route:
if route.unfinished + 1 >= UNFINISHED_PER_STEP:
return dataclasses.replace(route, rung=stepped_up(rung), unfinished=0)
return dataclasses.replace(route, rung=rung, unfinished=route.unfinished + 1)
def judge_rung(judge_model: str, route: Route) -> Rung:
"""The rung the chunk's item picks from the judge model's cheapest rung, never below that rung, whatever rung the worker stepped to; the model alone, at its settings' effort, off the ladder."""
# judge-replay found every rung below Opus 5.5's cheapest one missing verdicts it returns.
anchor = project_rung(judge_model)
if anchor is None:
return Rung(judge_model)
return highest(anchor, picked(anchor, route.risk_and_complexity)) if route.item else anchor