Answer stability round 1: 0 🔴, 7 🟡; archive each step up as it happens, leave the bundled rule to the judge's schema, and test the routing edges mutants survived
This commit is contained in:
@@ -48,9 +48,9 @@ model's cheapest rung. The worker's first prompt names the rung and the item, an
|
||||
each other item the chunk takes in, with its R + C. The judge reports the highest R + C it sees the
|
||||
worker state, and the next cycle steps up to the rung that picks, never down. Every second
|
||||
unfinished verdict on a chunk steps it up one rung. A rung an edit took off the ladder counts as
|
||||
the model's cheapest. Each verdict and each stop archived names the worker's rung, with the item
|
||||
and R + C that routed the chunk; a rerun resumes an open chunk on the latest rung named there, while
|
||||
that is at or above the model's cheapest. A todo.md that cannot be read or parsed is said on stderr,
|
||||
the model's cheapest. Each verdict, stop and step up archived names the worker's rung, with the
|
||||
item and R + C that routed the chunk; a rerun resumes an open chunk on the latest rung named there,
|
||||
while that is at or above the model's cheapest, and counts its unfinished verdicts afresh. A todo.md that cannot be read or parsed is said on stderr,
|
||||
and the chunk runs on the model's cheapest rung.
|
||||
|
||||
A change to bin/loop-claude or any bin/**/*.py takes effect at the next cycle boundary, once
|
||||
@@ -93,6 +93,7 @@ import pathlib
|
||||
import sys
|
||||
import typing
|
||||
|
||||
from transcript_archive.write import archive
|
||||
from loop_claude.project.checkout import checkout_root
|
||||
from loop_claude.cycle.run import Cycle, run_cycle
|
||||
from loop_claude.loop.reload import decode_handed, exec_if_edited, fingerprint, LoopRun, RELOAD_FLAG
|
||||
@@ -103,6 +104,7 @@ from loop_claude.routing import first_route, kept, Route, route_from, routed_ite
|
||||
from loop_claude.project.model_choice import get_or_ask_models
|
||||
from todo_table import Item
|
||||
from transcript_archive.read import latest_worker
|
||||
from transcript_archive import outcomes
|
||||
from loop_claude.paths import Paths
|
||||
from transcript_archive.location import project_archive
|
||||
from project_key import project_key
|
||||
@@ -153,7 +155,9 @@ def run_loop(argv: list[str], env: typing.Mapping[str, str], paths: Paths, launc
|
||||
verdict = run_cycle(Cycle(effects=effects, judge_model=models.judge, paths=paths, premises=premises, project_archive=archive, records=records, root=loop_run.root, route=route, session=session, task=loop_run.task, unfinished_evidence=loop_run.unfinished_evidence))
|
||||
if isinstance(verdict, Stop):
|
||||
return verdict
|
||||
loop_run = after_verdict(loop_run, anchor, verdict)
|
||||
before, loop_run = loop_run.route, after_verdict(loop_run, anchor, verdict)
|
||||
if stop := archive_step(archive, session, loop_run, before, effects):
|
||||
return stop
|
||||
|
||||
|
||||
def routed(loop_run: LoopRun, anchor: Rung | None, archived: typing.Callable[[], Route | None], item: typing.Callable[[], Item | None]) -> LoopRun:
|
||||
@@ -172,6 +176,15 @@ def after_verdict(loop_run: LoopRun, anchor: Rung | None, verdict: Finished | Un
|
||||
return dataclasses.replace(loop_run, route=route, unfinished_evidence=verdict.evidence)
|
||||
|
||||
|
||||
def archive_step(project_archive: pathlib.Path, session: Session, loop_run: LoopRun, before: Route | None, effects: Effects) -> Stop | None:
|
||||
"""Archives the rung an unfinished verdict stepped the chunk up to; the verdict itself names the rung its cycle ran on."""
|
||||
if not (before and loop_run.route) or loop_run.route.rung == before.rung:
|
||||
return None
|
||||
path = transcript_file(session)
|
||||
failure = archive(project_archive, path, loop_run.task, outcomes.stepped_up(str(loop_run.route)), effects.now()) if path else None
|
||||
return Stop(1, failure.reason) if failure else None
|
||||
|
||||
|
||||
def archived_route(archive: pathlib.Path, session: Session) -> Route | None:
|
||||
"""The route the latest verdict archived for the session's open chunk names; None for a chunk not yet judged."""
|
||||
transcript = transcript_file(session)
|
||||
|
||||
Reference in New Issue
Block a user