From 6e481939bf59e082d19e3b35ba393ce8ea39b111 Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Thu, 22 Oct 2026 22:18:33 +0200 Subject: [PATCH] =?UTF-8?q?Answer=20stability=20round=202:=200=20?= =?UTF-8?q?=F0=9F=94=B4,=201=20=F0=9F=9F=A1;=20assert=20archived=5Froute?= =?UTF-8?q?=20says=20nothing=20when=20it=20reads=20a=20route=20or=20finds?= =?UTF-8?q?=20none?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bin/loop_claude/cycle/judge.py | 2 +- bin/loop_claude/test_loop_claude.py | 13 ++++++++----- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/bin/loop_claude/cycle/judge.py b/bin/loop_claude/cycle/judge.py index 4e50ccf9..ef339931 100644 --- a/bin/loop_claude/cycle/judge.py +++ b/bin/loop_claude/cycle/judge.py @@ -168,7 +168,7 @@ def run_judge(root: str, args: list[str], prompt: str, grounds: Grounds, effects def quotes_checked(verdict: Verdict, grounds: Grounds) -> Verdict: """The verdict with its quoted answer and its escalation checked, as Grounds says; a quoted answer put to the human keeps the escalation it carried.""" if isinstance(verdict, QuotedAnswer) and not verbatim(verdict.answer, grounds.quotable): - verdict = Interrupt(verdict.evidence, verdict.question, verdict.escalation, verdict.highest_likelihood_taken_in) + verdict = Interrupt(verdict.evidence, verdict.question, escalation=verdict.escalation, highest_likelihood_taken_in=verdict.highest_likelihood_taken_in) if isinstance(verdict, Interrupt | QuotedAnswer | Unfinished) and verdict.escalation and not (verbatim(verdict.escalation, grounds.since_step) and verbatim(verdict.escalation, grounds.shown)): return dataclasses.replace(verdict, escalation="") return verdict diff --git a/bin/loop_claude/test_loop_claude.py b/bin/loop_claude/test_loop_claude.py index ca79bb40..66c1b5e1 100644 --- a/bin/loop_claude/test_loop_claude.py +++ b/bin/loop_claude/test_loop_claude.py @@ -941,15 +941,18 @@ class RouteSources(unittest.TestCase): with tempfile.TemporaryDirectory() as home: opened = session.session_named("A proj loop-claude", pathlib.Path(home, "projects")) archive = pathlib.Path(home, "archive") - self.assertIsNone(main.archived_route(archive, opened)) transcript = pathlib.Path(home, "projects", "-fake", f"{opened.id}.jsonl") - transcript.parent.mkdir(parents=True) - transcript.write_text(json.dumps({"type": "queue-operation", "timestamp": "1"}) + "\n") - self.assertIsNone(main.archived_route(archive, opened)) route = Route(Rung("claude-opus-5-5", "high"), 3, 4, 5) + with contextlib.redirect_stderr(io.StringIO()) as stderr: + self.assertIsNone(main.archived_route(archive, opened)) + transcript.parent.mkdir(parents=True) + transcript.write_text(json.dumps({"type": "queue-operation", "timestamp": "1"}) + "\n") + self.assertIsNone(main.archived_route(archive, opened)) with contextlib.redirect_stderr(io.StringIO()): self.assertIsNone(write.archive(archive, str(transcript), "Do it.", outcomes.unfinished(route.record(), "working", "j", ""), NOW)) - self.assertEqual(main.archived_route(archive, opened), route) + with contextlib.redirect_stderr(stderr): + self.assertEqual(main.archived_route(archive, opened), route) + self.assertEqual(stderr.getvalue(), "") with contextlib.redirect_stderr(io.StringIO()): self.assertIsNone(write.archive(archive, str(transcript), "Do it.", outcomes.stepped_up(Record('{"model": "claude-opus-5-5", "rung": 3}')), NOW + 1)) with contextlib.redirect_stderr(io.StringIO()) as stderr: