From a4b63e436e17e7b36334a250b22fef7b4d811ff5 Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Mon, 28 Sep 2026 17:00:41 +0200 Subject: [PATCH] Name the path an archive failed on --- bin/loop_claude/cycle.py | 4 ++-- bin/loop_claude/main.py | 4 ++-- bin/test_loop_claude_black_box.py | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/bin/loop_claude/cycle.py b/bin/loop_claude/cycle.py index 0554de54..6f763574 100644 --- a/bin/loop_claude/cycle.py +++ b/bin/loop_claude/cycle.py @@ -47,12 +47,12 @@ def archive(root, path, note, paths): raw = handle.read() make_private(folder) except OSError as failure: - return Failure(f"could not archive the transcript {path}: {failure.strerror}") + return Failure(f"could not archive the transcript: {failure.filename}: {failure.strerror}") copy = folder / f"{hashlib.sha256(raw).hexdigest()}.jsonl" # The copy lands last, so a copy on disk always has its verdict beside it. if not copy.exists(): for dest, data in ((copy.with_suffix(".verdict.md"), f"{note}\n".encode()), (copy, raw)): if failure := replace_file(dest, data): - return Failure(f"could not archive the transcript {path}: {failure.strerror}") + return Failure(f"could not archive the transcript: {failure.filename}: {failure.strerror}") print(f"transcript: {copy}", file=sys.stderr) return None diff --git a/bin/loop_claude/main.py b/bin/loop_claude/main.py index 848cb6e4..973307cc 100644 --- a/bin/loop_claude/main.py +++ b/bin/loop_claude/main.py @@ -14,8 +14,8 @@ Exit 1: no task, not inside a checkout, no premises, a models file it cannot rea leaves no transcript or one it cannot read or archive, claude cannot start for an interrupt, a reload with unreadable state, or the worker or the judge fails three times running. A worker fails when claude cannot start, exits non-zero, is killed, or ends without a result event; a judge when -claude cannot start or exits non-zero, or its verdict misses or mistypes a field, interrupts without a question, -or quotes nothing in the transcript. +claude cannot start or exits non-zero, or its verdict misses or mistypes a field, interrupts without a +question, or quotes nothing in the transcript. Exit 2: the human is needed, to pick the model or answer an interrupt, and stdin or stdout is not a terminal, the input ends, or the interrupt ended with nothing typed. Rerunning resumes any open session. diff --git a/bin/test_loop_claude_black_box.py b/bin/test_loop_claude_black_box.py index aaf9f0a2..8ca5735b 100644 --- a/bin/test_loop_claude_black_box.py +++ b/bin/test_loop_claude_black_box.py @@ -314,7 +314,7 @@ class Cycles(unittest.TestCase): checkout.archive().write_text("in the way") run = checkout.run([worker(say="landed-it"), judge(finished=True, evidence="landed-it")]) self.assertEqual((run.code, run.roles()), (1, ["worker", "judge"])) - self.assertRegex(run.stderr.strip().splitlines()[-1], r"^could not archive the transcript .*\.jsonl: ") + self.assertRegex(run.stderr.strip().splitlines()[-1], r"^could not archive the transcript: .*/loop-claude-transcripts/proj: Not a directory$") session = argument(run.calls[0], "--session-id") checkout.archive().unlink() run = checkout.run([worker(), judge(finished=True)])