Answer the prose pass: name README.md beside the records, one idea per sentence in --help and the judge's rules, date the decision's revision

This commit is contained in:
2026-10-03 01:49:33 +02:00
parent 80f1cc2dc9
commit 0eb97e9e88
9 changed files with 35 additions and 34 deletions
+5 -5
View File
@@ -14,8 +14,8 @@ from loop_claude.stop import Stop
JUDGE_PROMPT_CHARS = 400000
JUDGE_RULES = (
"Decide whether the agent has something open that the human, or README.md and the project's records, "
"must answer. interrupt=true when any of these appear:\n"
"Decide whether the agent has something open that the human must answer, or that README.md or the "
"project's records answer. interrupt=true when any of these appear:\n"
"- the agent asks the human anything, seeks approval, or says a decision is the human's\n"
"- it carried on under an assumption that decides the deliverable, that the human could "
"reasonably reject and that neither README.md nor the project's records settle; a caveat about "
@@ -28,12 +28,12 @@ JUDGE_RULES = (
"interrupt=false otherwise. Bookkeeping the agent settled silently - what to document, wording, "
"where a note goes - is not on its own a reason to interrupt. The human may have replied inside the transcript, on a [human] line: judge only what "
"is still open, never a question they already answered there. A [loop] line is what loop-claude told "
"the agent, such as an answer quoted from README.md or the project's records; a question it answered "
"is no longer open, unless the agent asks it again: then it is the human's, with answer empty.\n"
"the agent, such as an answer quoted from README.md or the project's records. A question a [loop] "
"line answered is no longer open. If the agent asks it again, put it to the human, with answer empty.\n"
"Where the agent asked or flagged something itself, the question is that one, in the agent's own "
"wording; never construct another from facts it stated.\n"
"Where README.md or the project's records answer that question, quote the passage that answers it "
"in answer, verbatim; the agent is then given that passage in place of the human's reply.\n"
"in answer, verbatim, with interrupt=true; the agent is then given that passage in place of the human's reply.\n"
"finished=true when the chunk is complete: merged, or nothing remains that the agent could do on "
"its own. finished=false when work remains that a further run can continue: an open PR, a review "
"not yet run, CI not yet reported."
+1 -1
View File
@@ -66,7 +66,7 @@ def step(cycle: Cycle, state: Active) -> Event | Stop:
def work(cycle: Cycle, answered: AnsweredFromRecords | None) -> WorkerRan | Stop:
if answered is not None:
print(f"\n=== the records answered: {answered.question} ===\n{answered.answer}", flush=True)
print(f"\n=== README.md or the records answered: {answered.question} ===\n{answered.answer}", flush=True)
# 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.effects), cycle.effects):
return stop
+4 -4
View File
@@ -2,20 +2,20 @@ import dataclasses
from loop_claude.cycle.verdicts import AnsweredFromRecords, Finished, Interrupt, Unfinished, Verdict
# A backstop for what the judge misses, such as a reworded repeat, so the worker cannot loop unattended on the records' answers.
# A backstop for what the judge misses, such as a reworded repeat, so the worker cannot loop unattended on answers quoted from README.md or the records.
RECORDS_ANSWERS_PER_CYCLE = 3
@dataclasses.dataclass(frozen=True)
class Working:
"""The worker runs, resumed with the records' answer when there is one."""
"""The worker runs, resumed with an answer quoted from README.md or the records when there is one."""
answered: AnsweredFromRecords | None = None
records_answers: int = 0
@dataclasses.dataclass(frozen=True)
class Judging:
"""The judge rules; records_answers counts the questions the records answered this cycle."""
"""The judge rules; records_answers counts the questions README.md or the records answered this cycle."""
transcript_path: str
records_answers: int = 0
@@ -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 or the project's records say:\n{answer}\n\nThe records answered {records_answers} questions this cycle, so this one comes to you.", records_answers)
return Interrupting(transcript_path, f"{question}\n\nREADME.md or the project's records say:\n{answer}\n\nREADME.md or the records 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):