diff --git a/bin/loop_claude/cycle/judge_reply.py b/bin/loop_claude/cycle/judge_reply.py index ecc2d378..12cd1507 100644 --- a/bin/loop_claude/cycle/judge_reply.py +++ b/bin/loop_claude/cycle/judge_reply.py @@ -30,8 +30,9 @@ JUDGE_RULES = ( "The chunk is the piece of work the agent is on, shipped as one pull request. " "finished=true when the chunk is complete: merged, or nothing remains that the agent could do on " f"its own. Even then, it is finished only once {ANSWERS_RECORDED}. An answer counts as recorded " - "where README.md or the records above hold it, or where the transcript shows the agent writing it " - "into one of the places just listed, never ~/.claude/CLAUDE.md. finished=false when work remains that a further run can continue: an open PR, a review " + "where README.md or the records above hold it, ~/.claude/CLAUDE.md included. It also counts where " + "the transcript shows the agent writing it into one of the places just listed; writing it into " + "~/.claude/CLAUDE.md does not count. finished=false when work remains that a further run can continue: an open PR, a review " "not yet run, CI not yet reported, an answer not yet recorded." ) diff --git a/bin/loop_claude/cycle/worker.py b/bin/loop_claude/cycle/worker.py index 5fb19187..c4f2961d 100644 --- a/bin/loop_claude/cycle/worker.py +++ b/bin/loop_claude/cycle/worker.py @@ -43,7 +43,7 @@ def worker_args(task: str, session: Session, model: str, resuming: bool, answere if answered is not None: start = ["-p", f"Your question: {answered.question}\n\n{QUOTE_SOURCES} answers it:\n\n{answered.answer}\n\nContinue the task.", "--resume", str(session.id)] elif resuming: - start = ["-p", f"Continue the task; the previous run stopped before it was finished. The chunk is finished once it is merged, or nothing remains that you could do on your own, and {ANSWERS_RECORDED}.", "--resume", str(session.id)] + start = ["-p", f"Continue the task; the previous run stopped before it was finished. The chunk is finished once it is merged, or nothing remains that you could do on your own. Even then, it is finished only once {ANSWERS_RECORDED}.", "--resume", str(session.id)] else: # --session-id creates the session under the id loop-claude keeps; --resume continues that session. start = ["-p", f"{task}\n\nContinue any open draft PR or worktree for the chunk before creating a new one.", "--name", session.name, "--session-id", str(session.id)] diff --git a/bin/test_loop_claude_black_box.py b/bin/test_loop_claude_black_box.py index 088168fd..0297e37f 100644 --- a/bin/test_loop_claude_black_box.py +++ b/bin/test_loop_claude_black_box.py @@ -344,7 +344,7 @@ class Cycles(unittest.TestCase): self.assertEqual(argument(workers[2], "--session-id"), session) self.assertTrue(argument(workers[0], "-p").startswith(f"{TASK}\n\nContinue any open draft PR")) self.assertNotIn(TASK, argument(workers[1], "-p")) - self.assertIn("The chunk is finished once it is merged, or nothing remains that you could do on your own, and every answer the human typed in it", 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.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"])