Answer principles round 1: 0 🔴, 2 🟡; block item 218 on item 170, name record_fields and RECORD_FIELDS, say an unreadable Worker line on stderr

This commit is contained in:
2026-10-22 22:12:29 +02:00
parent c5fdaf43f6
commit f6594bc048
9 changed files with 63 additions and 42 deletions
+13 -7
View File
@@ -108,8 +108,9 @@ Routing: the archive and reruns
Each finished or unfinished verdict, interrupt, quoted answer, stop and step-up in the archive ends
with a Worker: line, the route's JSON record (Route.record in bin/model_routing/route.py). A rerun
resumes an open chunk on the latest route named there, and counts its unfinished verdicts afresh; it
also reads the prose lines written before the record. A rung no longer on the ladder, or below the
resumes an open chunk on the latest route named there, and counts its unfinished verdicts afresh.
It also reads a Worker: line an older loop-claude wrote as a sentence, such as "claude-opus-5-5 at
high effort, routed by item 3's L of 4 and E + I of 5". A rung no longer on the ladder, or below the
one its item's L picks, is dropped, and the chunk is routed afresh from todo.md. So is a chunk whose
archived line names an R + C, as loop-claude wrote before it routed on L. A todo.md or an archive
that cannot be read or parsed is said on stderr, and the chunk is routed without it.
@@ -260,8 +261,10 @@ def run_loop(argv: list[str], env: typing.Mapping[str, str], paths: Paths, launc
def routed(route: Route | None, anchor: Rung | None, model: str, archived: typing.Callable[[], Route | None], item: typing.Callable[[], Item | None]) -> Route:
"""The route the cycle runs on. Off the ladder, where anchor, the project's rung, is None, the worker runs on model, the project's.
On it, a chunk keeps route, or on a rerun the one its archive last names, while that is at or above the rung its item's L picks from anchor; else the plan item routes it afresh."""
"""The route the cycle runs on. anchor is the project's rung, and model the project's model.
Where anchor is None, the model is off the ladder, and the worker runs on it. Otherwise the chunk keeps route, or on a rerun the route its archive last names, while that route's rung is at or above the one its item's L picks from anchor. Else the plan item routes the chunk afresh.
"""
if anchor is None:
return Route(Rung(model))
route = route or archived()
@@ -269,7 +272,7 @@ def routed(route: Route | None, anchor: Rung | None, model: str, archived: typin
def after_verdict(loop_run: LoopRun, anchor: Rung | None, concluded: Concluded) -> LoopRun:
"""The loop run the next cycle starts from. A finished chunk drops its route. An unfinished one steps from the route its cycle ended on, which an interrupt's or a quoted answer's escalation may have raised; off the ladder, it keeps that route."""
"""The loop run the next cycle starts from. A finished chunk drops its route. An unfinished one takes the route after_unfinished makes of the route its cycle ended on, which an interrupt's or a quoted answer's escalation may have raised; off the ladder, it keeps that route."""
verdict = concluded.verdict
if isinstance(verdict, Finished):
return dataclasses.replace(loop_run, route=None, unfinished_evidence="")
@@ -278,7 +281,7 @@ def after_verdict(loop_run: LoopRun, anchor: Rung | None, concluded: Concluded)
def archive_step(archive_folder: pathlib.Path, session: Session, task: str, before: Route, after: Route | None, effects: Effects) -> Stop | None:
"""Archives after, the route an unfinished verdict moved the chunk to from before, where its record differs: a rung up, or a higher E + I taken in. The verdict itself names before, the route its cycle ran on."""
"""Archives the route after an unfinished verdict as a step-up, where its record differs from the route before it: a higher rung, or a higher E + I taken in. The verdict itself names the route before, which its cycle ran on."""
if after is None or after.record() == before.record():
return None
path = transcript_file(session)
@@ -293,7 +296,10 @@ def archived_route(archive_folder: pathlib.Path, session: Session) -> Route | No
if isinstance(worker, Failure):
print(f"routing the chunk afresh: {worker.reason}", file=sys.stderr)
return None
return route_from(worker) if worker else None
route = route_from(worker) if worker else None
if worker and route is None:
print(f"routing the chunk afresh: the archive's latest Worker: line names no route loop-claude can read: {worker}", file=sys.stderr)
return route
def chunk_start(session: Session, preflight: pathlib.Path, root: str, effects: Effects) -> tuple[str, typing.Callable[[], Item | None]]: