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
+2 -2
View File
@@ -2,7 +2,7 @@
import json
def parse(raw: str | bytes) -> dict | None:
def parse_entry(raw: str | bytes) -> dict | None:
try:
entry = json.loads(raw)
except ValueError:
@@ -91,4 +91,4 @@ def ends_stream(event: dict) -> bool:
# {"type": "result", "structured_output": {"evidence": "...", ...}, ...}
def structured_output(stdout: str) -> object:
return (parse(stdout) or {}).get("structured_output")
return (parse_entry(stdout) or {}).get("structured_output")
+3 -3
View File
@@ -1,15 +1,15 @@
import json
from loop_claude.claude_code.entries import assistant_parts, human_text, parse, part_text, tool_call
from loop_claude.claude_code.entries import assistant_parts, human_text, parse_entry, part_text, tool_call
from loop_claude.failure import Failure
JUDGED_TOOL_INPUT = 400
def read(path: str) -> list[dict] | Failure:
def read_transcript(path: str) -> list[dict] | Failure:
try:
with open(path, "rb") as handle:
return [entry for raw in handle if (entry := parse(raw))]
return [entry for raw in handle if (entry := parse_entry(raw))]
except OSError as failure:
return Failure(f"could not read the transcript {path}: {failure.strerror}")