Answer the prose pass's third round: name the three files in the worker's prompt, say They once named

This commit is contained in:
2026-10-03 01:53:58 +02:00
parent 45b4030347
commit fdc3bc38d4
4 changed files with 6 additions and 6 deletions
+1 -1
View File
@@ -72,7 +72,7 @@ def transition(state: State, event: Event) -> State:
case Judging(_, records_answers), Ruled(AnsweredFromRecords() as answered) if records_answers < RECORDS_ANSWERS_PER_CYCLE:
return Working(answered, records_answers + 1)
case Judging(transcript_path, records_answers), Ruled(AnsweredFromRecords(question=question, answer=answer)):
return Interrupting(transcript_path, f"{question}\n\nREADME.md, AGENTS.md or docs/decisions.md say:\n{answer}\n\nREADME.md, AGENTS.md or docs/decisions.md answered {records_answers} questions this cycle, so this one comes to you.", records_answers)
return Interrupting(transcript_path, f"{question}\n\nREADME.md, AGENTS.md or docs/decisions.md say:\n{answer}\n\nThey answered {records_answers} questions this cycle, so this one comes to you.", records_answers)
case Judging(transcript_path, records_answers), Ruled(Interrupt(question=question)):
return Interrupting(transcript_path, question, records_answers)
case Judging(transcript_path, _), Ruled(Finished() | Unfinished() as verdict):
+1 -1
View File
@@ -40,7 +40,7 @@ def worker_outcome(code: int, result: dict | None, resets: list[int]) -> Failure
def worker_args(task: str, session: Session, model: str, resuming: bool, answered: AnsweredFromRecords | None = None) -> list[str]:
if answered is not None:
start = ["-p", f"Your question: {answered.question}\n\nREADME.md or the project's records answer it:\n\n{answered.answer}\n\nContinue the task.", "--resume", str(session.id)]
start = ["-p", f"Your question: {answered.question}\n\nREADME.md, AGENTS.md or docs/decisions.md answer it:\n\n{answered.answer}\n\nContinue the task.", "--resume", str(session.id)]
elif resuming:
start = ["-p", "Continue the task; the previous run stopped before it was finished.", "--resume", str(session.id)]
else:
+3 -3
View File
@@ -135,7 +135,7 @@ class Transitions(unittest.TestCase):
(states.Judging("/t", 3), states.Ruled(Interrupt("e", "Which one?")), states.Interrupting("/t", "Which one?", 3)),
(states.Judging("/t"), answered, states.Working(AnsweredFromRecords("e", "Which one?", "A."), 1)),
(states.Judging("/t", 2), answered, states.Working(AnsweredFromRecords("e", "Which one?", "A."), 3)),
(states.Judging("/t", 3), answered, states.Interrupting("/t", "Which one?\n\nREADME.md, AGENTS.md or docs/decisions.md say:\nA.\n\nREADME.md, AGENTS.md or docs/decisions.md answered 3 questions this cycle, so this one comes to you.", 3)),
(states.Judging("/t", 3), answered, states.Interrupting("/t", "Which one?\n\nREADME.md, AGENTS.md or docs/decisions.md say:\nA.\n\nThey answered 3 questions this cycle, so this one comes to you.", 3)),
(states.Judging("/t"), states.Ruled(Finished("e")), states.Closing("/t", Finished("e"))),
(states.Judging("/t", 3), states.Ruled(Finished("e")), states.Closing("/t", Finished("e"))),
(states.Judging("/t"), states.Ruled(Unfinished("e")), states.Closing("/t", Unfinished("e"))),
@@ -250,10 +250,10 @@ class Cycles(unittest.TestCase):
with contextlib.redirect_stderr(io.StringIO()) as said, contextlib.redirect_stdout(io.StringIO()) as printed:
self.assertEqual(run.run_cycle(self.cycle(fake, records="From AGENTS.md:\nUse A.")), Stop(2, "the human is needed to answer the question above, but the interrupt ended with nothing typed"))
resumed = fake.made("stream_claude")[1]
self.assertEqual(resumed[resumed.index("-p") + 1], "Your question: Which one?\n\nREADME.md or the project's records answer it:\n\nUse *A*.\n\nContinue the task.")
self.assertEqual(resumed[resumed.index("-p") + 1], "Your question: Which one?\n\nREADME.md, AGENTS.md or docs/decisions.md answer it:\n\nUse *A*.\n\nContinue the task.")
self.assertEqual(len(fake.made("stream_claude")), 4)
self.assertEqual(printed.getvalue().count("=== README.md, AGENTS.md or docs/decisions.md answered: Which one? ===\nUse *A*."), 3)
self.assertIn("Which one?\n\nREADME.md, AGENTS.md or docs/decisions.md say:\nUse *A*.\n\nREADME.md, AGENTS.md or docs/decisions.md answered 3 questions this cycle", said.getvalue())
self.assertIn("Which one?\n\nREADME.md, AGENTS.md or docs/decisions.md say:\nUse *A*.\n\nThey answered 3 questions this cycle", said.getvalue())
def test_an_answer_the_records_do_not_hold_is_dropped_and_the_question_goes_to_the_human(self):
fake = FakeEffects(streams=[Worker(self.paths.claude_code_transcripts.parent)], claude=[judged("interrupt", answer="Use B.")], on_terminal_claude=[0], git=[ran()])
+1 -1
View File
@@ -8,7 +8,7 @@
2026-09-21, lilleman. Serves goal 4. Asked to name the goal behind each choice, the worker cites a real goal for a choice that goal does not settle, and under-reports its own decisions; the judge's bar is whether the README discriminates between the alternatives. Valid while the worker's self-report stays unreliable.
2026-10-01, lilleman: the judge reads `docs/decisions.md` and `AGENTS.md` too, so an answer recorded there is not asked again (goal 4.2); its bar becomes whether the README or those files discriminate. 2026-10-03, implemented: when README.md or those files answer the worker's question, the judge quotes the answer verbatim and the worker resumes with it. The judge then sees the quote as a `[loop]` line. The worker asking it again shows the quote did not settle it, and the judge sends it to the human. A backstop of three quoted answers per cycle bounds what the judge misses, such as a reworded repeat or a worker asking without end, so the worker cannot loop unattended (goal 4.4); the fourth question they answer in one cycle goes to the human with the judge's quote, so the cost is one interrupt.
2026-10-01, lilleman: the judge reads `docs/decisions.md` and `AGENTS.md` too, so an answer recorded there is not asked again (goal 4.2); its bar becomes whether the README or those files discriminate. 2026-10-03, implemented: when README.md or those files answer the worker's question, the judge quotes the answer verbatim and the worker resumes with it. The judge then sees the quote as a `[loop]` line. The worker asking it again shows the quote did not settle it, and the judge sends it to the human. A backstop of three quoted answers per cycle bounds what the judge misses, such as a reworded repeat or a worker asking without end, so the worker cannot loop unattended (goal 4.4); the fourth question README.md or those files answer in one cycle goes to the human with the judge's quote, so the cost is one interrupt.
## loop-claude: one session per project, its id derived from the checkout's path relative to `~/code`, or to `/` outside it