Parse each transcript entry once into a typed value naming its kind, and have every consumer read those types

This commit is contained in:
2026-11-09 00:12:13 +01:00
parent bc2d7d6d5e
commit b83c1ddf19
20 changed files with 408 additions and 254 deletions
+2 -2
View File
@@ -134,7 +134,7 @@ def archived_rounds(reviewer: str, model: str, root: pathlib.Path, home: pathlib
def chunk_rounds(reviewer: str, checkout: str, chunk: pathlib.Path) -> list[Round]:
copies = sorted(chunk.glob("*.jsonl"))
began = parse_entry(first_timestamped_line(copies[0].read_bytes())) if copies else None
if not began or not isinstance(began.get("timestamp"), str):
if not began or not began.timestamp:
return []
found = []
for meta in sorted(chunk.glob("session/*/subagents/*.meta.json")):
@@ -142,7 +142,7 @@ def chunk_rounds(reviewer: str, checkout: str, chunk: pathlib.Path) -> list[Roun
if not isinstance(described, dict) or described.get("agentType") != reviewer:
continue
entries = read_transcript(str(meta.with_name(meta.name.removesuffix(".meta.json") + ".jsonl")))
if not isinstance(entries, Failure) and (one := round_from(reviewer, checkout, stamp_seconds(began["timestamp"]), entries)):
if not isinstance(entries, Failure) and (one := round_from(reviewer, checkout, stamp_seconds(began.timestamp), entries)):
found.append(one)
return found