From ffc524975f490dda111a7c99472be79a5c7bf9ec Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Sun, 4 Oct 2026 17:12:42 +0200 Subject: [PATCH] Answer product-owner round 1: blockquote the judge's passage in the resume prompt; item 59 names the judge stating what remains --- bin/loop_claude/cycle/run.py | 2 +- bin/test_loop_claude.py | 2 +- bin/test_loop_claude_black_box.py | 2 +- todo.md | 2 ++ 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/bin/loop_claude/cycle/run.py b/bin/loop_claude/cycle/run.py index 5b88bec3..674b635b 100644 --- a/bin/loop_claude/cycle/run.py +++ b/bin/loop_claude/cycle/run.py @@ -73,7 +73,7 @@ def work(cycle: Cycle, answered: QuotedAnswer | None) -> WorkerRan | Stop: if stop := keep_answer(cycle, answered): return stop # session_open runs inside the lambda: a failed attempt may have opened the session. - if stop := retried("worker", lambda: run_worker(cycle.root, worker_args(cycle.task, cycle.session, cycle.models.worker, session_open(cycle.session), answered, cycle.remaining), cycle.effects), cycle.effects): + if stop := retried("worker", lambda: run_worker(cycle.root, worker_args(cycle.task, cycle.session, cycle.models.worker, session_open(cycle.session), answered, quoted(cycle.remaining)), cycle.effects), cycle.effects): return stop path = transcript_file(cycle.session) return WorkerRan(path) if path is not None else Stop(1, f"claude left no transcript for session {cycle.session.id}") diff --git a/bin/test_loop_claude.py b/bin/test_loop_claude.py index a4abc2b9..978edaba 100644 --- a/bin/test_loop_claude.py +++ b/bin/test_loop_claude.py @@ -196,7 +196,7 @@ class Cycles(unittest.TestCase): workers = fake.made("stream_claude") self.assertIn("--session-id", workers[0]) self.assertIn("--resume", workers[1]) - self.assertIn("as the work remaining:\n\nworking\n\nThe chunk is finished once", workers[1][workers[1].index("-p") + 1]) + self.assertIn("as the work remaining:\n\n> working\n\nThe chunk is finished once", workers[1][workers[1].index("-p") + 1]) self.assertEqual(self.archived_outcomes(), ["Task: Do it.\n\n2026-09-21T14:13:20Z Verdict: unfinished\n\nEvidence:\n> working\n"] * 2) def test_a_cycle_stopped_by_a_failure_or_ctrl_c_archives_what_its_session_holds(self): diff --git a/bin/test_loop_claude_black_box.py b/bin/test_loop_claude_black_box.py index 8f4c0611..e6db5120 100644 --- a/bin/test_loop_claude_black_box.py +++ b/bin/test_loop_claude_black_box.py @@ -345,7 +345,7 @@ class Cycles(unittest.TestCase): self.assertTrue(argument(workers[0], "-p").startswith(f"{TASK}\n\nContinue any open draft PR")) self.assertNotIn(TASK, argument(workers[1], "-p")) self.assertIn("Even then, it is finished only once every answer the human typed in it", argument(workers[1], "-p")) - self.assertIn("as the work remaining:\n\nstarted\n\n", argument(workers[1], "-p")) + self.assertIn("as the work remaining:\n\n> started\n\n", argument(workers[1], "-p")) self.assertEqual({call["cwd"] for call in run.calls}, {str(checkout.root)}) self.assertIn("1. Work.", run.calls[1]["stdin"]) self.assertIn("From docs/decisions.md:\n# Decisions\n\nFrom ~/.claude/CLAUDE.md:\n# Global instructions", run.calls[1]["stdin"]) diff --git a/todo.md b/todo.md index 7baef86c..8ffb7bc0 100644 --- a/todo.md +++ b/todo.md @@ -70,6 +70,8 @@ The repo has no CI, so larv-review's gate is the local run, and larv-review's Ga Raised by the product-owner review of PR #211. The resumed worker now gets the judge's quote of the work remaining, but a worker that still thinks the chunk done can answer each cycle the same way, and each cycle costs a worker and a judge run (goal 4.4). +The quote is the worker's own words, so it may not say why they fall short; the product-owner review of PR #214 suggests the judge also name what remains, which needs a check other than the transcript grounding the quote has. + ### 5. Key a project on its checkout's full path, and refuse to start while another session uses that key. The key names the project's session, archive folder and models entry. `project_key` drops the leading `/`, so `~/code/a` and `/a` share all three, and one loop can resume or delete the other's session.