Answer architecture round 2: 1 🔴, 5 🟡; return a gone checkout's git failure as a value, derive a round's seconds from its stamp, let claude_reply own the flags it parses, test the uncovered paths, warn to sandbox the replay, decline injecting the shell's filesystem

This commit is contained in:
2026-10-15 20:57:22 +02:00
parent 4f722d94f4
commit c2a4757d56
8 changed files with 84 additions and 19 deletions
+6 -2
View File
@@ -17,10 +17,14 @@ class Limited:
said: str
# The json reply claude_reply parses; no persistence, so its runs stay out of the session picker; no permission prompt, as no one answers it.
HEADLESS = ["--no-session-persistence", "--output-format", "json", "--permission-mode", "bypassPermissions"]
def claude_reply(claude: Claude, args: list[str], cwd: str, prompt: str, who: str) -> dict | Failure | Limited:
"""claude's json reply, or why there is none; who names the run in the message for a non-zero exit, such as the judge."""
"""claude's json reply to `claude -p <args>` and HEADLESS, or why there is none; who names the run in the message for a non-zero exit, such as the judge."""
try:
proc = claude(args, cwd, prompt)
proc = claude(["-p", *args, *HEADLESS], cwd, prompt)
except OSError as failure:
return Failure(f"could not start claude: {failure.strerror}")
reply = parse_entry(proc.stdout) or {}