Answer architecture round 1: 0 🔴, 2 🟡; keep stepped_from through the typed answer, name the events HumanTyped and HumanTalked, parse the answer from the prompt's start, and say why the judge decides release_ready

This commit is contained in:
2026-10-17 23:16:34 +02:00
parent 831b9c63b6
commit 96834412c7
7 changed files with 90 additions and 96 deletions
+11 -8
View File
@@ -8,10 +8,9 @@ QUOTED_ANSWERS_PER_CYCLE = 3
@dataclasses.dataclass(frozen=True)
class TypedAnswer:
"""The human's answer to an interrupt, typed at loop-claude's terminal; stepped is whether the interrupt stepped the worker up."""
"""The human's answer to an interrupt, typed at loop-claude's terminal."""
question: str
answer: str
stepped: bool
@dataclasses.dataclass(frozen=True)
@@ -62,9 +61,13 @@ class Ruled:
@dataclasses.dataclass(frozen=True)
class HumanAnswered:
"""typed is None where the human answered in the interrupt's claude session."""
typed: TypedAnswer | None = None
class HumanTyped:
typed: TypedAnswer
@dataclasses.dataclass(frozen=True)
class HumanTalked:
"""The human typed in the interrupt's claude session."""
@dataclasses.dataclass(frozen=True)
@@ -72,7 +75,7 @@ class Archived:
pass
Event = WorkerRan | Ruled | HumanAnswered | Archived
Event = WorkerRan | Ruled | HumanTyped | HumanTalked | Archived
def transition(state: State, event: Event) -> State:
@@ -87,10 +90,10 @@ def transition(state: State, event: Event) -> State:
return Interrupting(transcript_path, ruling, quoted_answers)
case Judging(transcript_path, _), Ruled(Finished() | Unfinished() as verdict):
return Closing(transcript_path, verdict)
case Interrupting(_, _, quoted_answers), HumanAnswered(TypedAnswer() as typed):
case Interrupting(_, _, quoted_answers), HumanTyped(typed):
return Working(typed, quoted_answers)
# The human worked in the interrupt's claude session, so the judge rules again on the transcript it leaves.
case Interrupting(transcript_path, _, quoted_answers), HumanAnswered(None):
case Interrupting(transcript_path, _, quoted_answers), HumanTalked():
return Judging(transcript_path, quoted_answers)
case Closing(_, verdict), Archived():
return Ended(verdict)