Answer the architecture pass's first round

This commit is contained in:
2026-10-02 08:52:20 +02:00
parent 211524196b
commit d42c99c37d
15 changed files with 97 additions and 72 deletions
+5 -5
View File
@@ -1,12 +1,12 @@
import sys
import uuid
from loop_claude.claude_code.transcript import human_turns, read
from loop_claude.claude_code.transcript import human_turns, read_transcript
from loop_claude.claude_code.trust import trust
from loop_claude.effects import Effects
from loop_claude.failure import Failure
from loop_claude.paths import Paths
from loop_claude.project.checkout import checkouts
from loop_claude.project.checkout import worktrees
from loop_claude.stop import Stop, needs_human, needs_terminal
ANSWER_QUESTION = "answer the question above"
@@ -16,8 +16,8 @@ def interrupt(root: str, session_id: uuid.UUID, model: str, path: str, question:
print(f"\n{question}", file=sys.stderr)
if stop := needs_terminal(ANSWER_QUESTION, effects.on_terminal()):
return stop
trust(paths.claude_json, checkouts(root, effects))
entries = read(path)
trust(paths.claude_json, worktrees(root, effects))
entries = read_transcript(path)
if isinstance(entries, Failure):
return Stop(1, entries.reason)
before = human_turns(entries)
@@ -25,7 +25,7 @@ def interrupt(root: str, session_id: uuid.UUID, model: str, path: str, question:
effects.claude_on_terminal(["--model", model, "--permission-mode", "bypassPermissions", "--resume", str(session_id)], root)
except OSError as failure:
return Stop(1, f"could not start claude for the interrupt: {failure.strerror}")
entries = read(path)
entries = read_transcript(path)
if isinstance(entries, Failure):
return Stop(1, f"could not tell whether you typed anything: {entries.reason}")
return None if human_turns(entries) > before else needs_human(ANSWER_QUESTION, "the interrupt ended with nothing typed")