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:
@@ -22,21 +22,31 @@ class Round:
|
||||
root: str
|
||||
branch: str
|
||||
at: str
|
||||
seconds: float
|
||||
began: float
|
||||
prompt: str
|
||||
findings: tuple[str, ...]
|
||||
|
||||
@property
|
||||
def seconds(self) -> float:
|
||||
return stamp_seconds(self.at)
|
||||
|
||||
|
||||
def round_from(root: str, began: float, entries: list[dict]) -> Round | None:
|
||||
"""The round a stability reviewer's transcript holds: its first entry's prompt, and its last text. None without a 🔴 or 🟡 finding to hold a rung to."""
|
||||
reports = [text for found in entries for part in assistant_parts(found) if (text := part_text(part))]
|
||||
first = entries[0] if entries else {}
|
||||
if not isinstance(first.get("timestamp"), str) or not reports or not (findings := recorded_findings(reports[-1])):
|
||||
if not stamped(first) or not reports or not (findings := recorded_findings(reports[-1])):
|
||||
return None
|
||||
prompt = content(first)
|
||||
prompt = prompt if isinstance(prompt, str) else "".join(part_text(part) or "" for part in parts(first))
|
||||
return Round(root, first.get("gitBranch", ""), first["timestamp"], stamp_seconds(first["timestamp"]), began, prompt, tuple(findings))
|
||||
return Round(root, first.get("gitBranch", ""), first["timestamp"], began, prompt, tuple(findings))
|
||||
|
||||
|
||||
def stamped(entry: dict) -> bool:
|
||||
try:
|
||||
return isinstance(entry.get("timestamp"), str) and bool(stamp_seconds(entry["timestamp"]))
|
||||
except ValueError:
|
||||
return False
|
||||
|
||||
|
||||
def stamp_seconds(stamp: str) -> float:
|
||||
|
||||
Reference in New Issue
Block a user