Answer the prose review's first round, ship under the floor, and plan giving the judge the decisions
This commit is contained in:
@@ -28,7 +28,6 @@ JUDGE_RULES = (
|
||||
"not yet run, CI not yet reported."
|
||||
)
|
||||
|
||||
# The reply's shape, which the schema below hands claude; verdict_from reads it into a Verdict.
|
||||
@dataclasses.dataclass(frozen=True)
|
||||
class Reply:
|
||||
evidence: str = dataclasses.field(metadata={"description": "A verbatim quote of the transcript line the verdict rests on: what triggers the interrupt, else what shows the chunk finished or the work remaining."})
|
||||
|
||||
@@ -5,7 +5,7 @@ from loop_claude.cycle.verdicts import Finished, Interrupt, Unfinished, Verdict
|
||||
|
||||
@dataclasses.dataclass(frozen=True)
|
||||
class Working:
|
||||
"""The worker runs: opening the session, or resuming it while its transcript exists."""
|
||||
"""The worker runs."""
|
||||
|
||||
|
||||
@dataclasses.dataclass(frozen=True)
|
||||
@@ -26,7 +26,7 @@ class Finishing:
|
||||
|
||||
@dataclasses.dataclass(frozen=True)
|
||||
class Ended:
|
||||
"""The cycle is over; the next one starts Working."""
|
||||
"""The cycle is over."""
|
||||
|
||||
|
||||
Active = Working | Judging | Interrupting | Finishing
|
||||
|
||||
@@ -52,7 +52,7 @@ def step(cycle, state: Active) -> Event | Stop:
|
||||
|
||||
|
||||
def work(cycle) -> WorkerRan | Stop:
|
||||
# Asked at each attempt: a failed one may have opened the session.
|
||||
# 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)), cycle.effects), cycle.effects):
|
||||
return stop
|
||||
path = transcript_file(cycle.session)
|
||||
@@ -68,7 +68,7 @@ def rule(cycle, transcript_path) -> Ruled | Stop:
|
||||
|
||||
|
||||
def ask(cycle, transcript_path, question) -> Answered | Stop:
|
||||
# The interrupt appends to this transcript, so it is archived at each question and judged anew after.
|
||||
# The interrupt appends to this transcript, so it is archived at each question.
|
||||
if failure := archive(cycle.project, transcript_path, f"Task: {cycle.task}\n\nVerdict: interrupt\n\n{question}", cycle.paths):
|
||||
return Stop(1, failure.reason)
|
||||
return interrupt(cycle.root, cycle.session.id, cycle.models.worker, transcript_path, question, cycle.paths, cycle.effects) or Answered()
|
||||
@@ -82,5 +82,4 @@ def close(cycle, transcript_path) -> Archived | Stop:
|
||||
|
||||
|
||||
def session_open(session) -> bool:
|
||||
"""A run resumes the session only while its transcript exists."""
|
||||
return bool(transcript_file(session))
|
||||
|
||||
@@ -12,7 +12,7 @@ Cycles continue until an exit below or Ctrl-C. Words: ~/.claude/CLAUDE.md → "V
|
||||
|
||||
Exit 1: no task, git cannot start or finds no checkout, no premises, a models file it cannot read or
|
||||
write, claude leaves no transcript or one it cannot read or archive, claude cannot start for an
|
||||
interrupt, python cannot start for a reload, a reload with unreadable state, or the worker or the
|
||||
interrupt, python cannot start for a reload, a reload whose loop run it cannot read, or the worker or the
|
||||
judge fails three times running, retried a minute apart within the cycle. A worker fails when claude
|
||||
cannot start, exits non-zero, is killed, or ends without a result event; a judge when claude cannot
|
||||
start or exits non-zero, or its verdict misses or mistypes a field, interrupts without a question,
|
||||
|
||||
Reference in New Issue
Block a user