Answer architecture round 1: 1 🔴, 6 🟡 (0 misread); open claude through one hand_over, route loop-inbox's /talk through the Talking state, give Ask one state

This commit is contained in:
2026-10-28 23:57:33 +01:00
parent a7fe878631
commit 3409ab3d07
17 changed files with 374 additions and 258 deletions
+15 -8
View File
@@ -1,5 +1,6 @@
import dataclasses
from loop_claude.waiting import Ask, OpenInInbox, OpenOnTerminal
from loop_claude.verdicts import Finished, Interrupt, QuotedAnswer, Unfinished, Verdict
from loop_claude.escalation_mark import StepUp
@@ -40,11 +41,17 @@ class Interrupting:
step_up: StepUp | None = None
@dataclasses.dataclass(frozen=True)
class Talk:
"""The human answers in the worker's claude session, open on loop-claude's terminal or in loop-inbox, as where says. ask is the question they were asked, which loop-inbox lists as open there."""
ask: Ask
where: OpenOnTerminal | OpenInInbox
@dataclasses.dataclass(frozen=True)
class Talking:
"""The human answers in the worker's claude session, on the terminal; question is what they were asked."""
transcript_path: str
question: str
talk: Talk
quoted_answers: int = 0
@@ -82,13 +89,13 @@ class HumanTyped:
@dataclasses.dataclass(frozen=True)
class TalkChosen:
"""The human typed /talk at loop-claude's terminal, or the interrupt is for a release ready to cut."""
question: str
"""The human typed /talk, at loop-claude's terminal or in loop-inbox, or the interrupt is for a release ready to cut."""
talk: Talk
@dataclasses.dataclass(frozen=True)
class HumanTalked:
"""The human typed in the worker's claude session, opened on loop-claude's terminal or in loop-inbox."""
"""The human typed in the worker's claude session."""
@dataclasses.dataclass(frozen=True)
@@ -113,10 +120,10 @@ def transition(state: State, event: Event) -> State:
return Closing(transcript_path, verdict)
case Interrupting(_, _, quoted_answers, step_up), HumanTyped(typed):
return Working(typed, quoted_answers, step_up)
case Interrupting(transcript_path, _, quoted_answers), TalkChosen(question):
return Talking(transcript_path, question, quoted_answers)
case Interrupting(transcript_path, _, quoted_answers), TalkChosen(talk):
return Talking(transcript_path, talk, quoted_answers)
# The human worked in the worker's claude session, so the judge rules again on the transcript it leaves.
case Talking(transcript_path, _, quoted_answers) | Interrupting(transcript_path, _, quoted_answers), HumanTalked():
case Talking(transcript_path, _, quoted_answers), HumanTalked():
return Judging(transcript_path, quoted_answers)
case Closing(_, verdict), Archived():
return Ended(verdict)