Fix under the floor's Shape: interrupt means only the human, QuotedAnswer names the verdict, one owner for the record files, Limited beside its cycle

This commit is contained in:
2026-10-03 11:33:34 +02:00
parent fdc3bc38d4
commit 2d46aa3b8f
10 changed files with 68 additions and 59 deletions
+4 -3
View File
@@ -8,12 +8,13 @@ from loop_claude.cycle.interrupt import interrupt
from loop_claude.cycle.judge import judge
from loop_claude.cycle.retry import retried
from loop_claude.cycle.states import Active, Archived, Closing, Ended, Event, HumanAnswered, Interrupting, Judging, Ruled, State, WorkerRan, Working, transition
from loop_claude.cycle.verdicts import AnsweredFromRecords, Finished, Unfinished
from loop_claude.cycle.verdicts import Finished, QuotedAnswer, Unfinished
from loop_claude.cycle.worker import run_worker, worker_args
from loop_claude.effects import Effects
from loop_claude.failure import Failure
from loop_claude.paths import Paths
from loop_claude.project.model_choice import Models
from loop_claude.project.records import QUOTE_SOURCES
from loop_claude.stop import Stop
@@ -64,9 +65,9 @@ def step(cycle: Cycle, state: Active) -> Event | Stop:
typing.assert_never(state)
def work(cycle: Cycle, answered: AnsweredFromRecords | None) -> WorkerRan | Stop:
def work(cycle: Cycle, answered: QuotedAnswer | None) -> WorkerRan | Stop:
if answered is not None:
print(f"\n=== README.md, AGENTS.md or docs/decisions.md answered: {answered.question} ===\n{answered.answer}", flush=True)
print(f"\n=== {QUOTE_SOURCES} answered: {answered.question} ===\n{answered.answer}", flush=True)
# session_open runs inside the lambda: a failed attempt may have opened the session.
if stop := retried("worker", lambda: run_worker(cycle.root, worker_args(cycle.task, cycle.session, cycle.models.worker, session_open(cycle.session), answered), cycle.effects), cycle.effects):
return stop