Answer architecture round 1: 3 🔴, 8 🟡; have the judge quote the worker's record of the trigger word for word, name the worker's rung on resume, give kept and stepped one floor and name stepped's two conditions

This commit is contained in:
2026-10-15 22:04:13 +02:00
parent 2f5d7a469d
commit aa7529b03f
6 changed files with 47 additions and 34 deletions
+7 -10
View File
@@ -30,7 +30,8 @@ JUDGE_RULES = (
"- it chose between alternatives that neither README.md nor the records discriminate "
"between - neither rules the rejected one out - and the choice materially changes the deliverable\n"
"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 "
"where a note goes - is not on its own a reason to interrupt, nor is a run ending with a request for a higher rung, "
"which is for loop-claude. 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 records.\n\n"
"Where the agent asked or flagged something itself, the question is that one, in the agent's own "
@@ -45,11 +46,7 @@ JUDGE_RULES = (
f"where README.md or the records above hold it, {', '.join(HUMAN_RULE_NAMES)} included. It also counts where "
f"the transcript shows the agent writing it into {ANSWER_DESTINATIONS}; writing it into "
f"{either(HUMAN_RULE_NAMES)} 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.\n\n"
"The agent may end its run asking for a higher rung, citing an escalation trigger that ~/.claude/CLAUDE.md lists. "
"That request is for loop-claude, not a question for the human. Where the chunk is unfinished, quote in "
"escalation the passage that shows the trigger fired, such as the finding or the failing test. Leave "
"escalation empty where the agent asks for no higher rung, or where only its own claim shows the trigger."
"continue: an open PR, a review not yet run, CI not yet reported, an answer not yet recorded."
)
@@ -59,7 +56,7 @@ class Reply:
# Routes the next cycle's worker. Counting the item the chunk was routed on is harmless: loop-claude never steps the worker down.
bundled: int = dataclasses.field(metadata={"description": "The highest R + C the agent states for a todo.md item it took into this chunk; 0 when it states none."})
# Routes the next cycle's worker one rung up: docs/decisions.md → `routing: a worker that ends its run asking for a higher rung`.
escalation: str = dataclasses.field(metadata={"description": "Where the chunk is unfinished and the agent's run ends asking for a higher rung, citing an escalation trigger: a verbatim quote, without elisions, of the transcript passage that shows that trigger fired, other than the agent's own claim. Empty otherwise."})
escalation: str = dataclasses.field(metadata={"description": "Where the chunk is unfinished and the agent's run ends asking for a higher rung, citing an escalation trigger: a verbatim quote, without elisions, of an earlier transcript passage that shows that trigger fired, such as a review round's commit title or the agent's report of the finding or the failing test; never the request itself. Empty otherwise."})
evidence: str = dataclasses.field(metadata={"description": "A verbatim quote of the one transcript passage the verdict rests on, without elisions: what triggers the interrupt; for a quoted answer, the agent's question; else what shows the chunk finished or the work remaining."})
finished: bool = dataclasses.field(metadata={"description": "Whether the chunk is finished."})
interrupt: bool = dataclasses.field(metadata={"description": "Whether the human must now be interrupted."})
@@ -158,11 +155,11 @@ def run_judge(root: str, args: list[str], prompt: str, shown: str, quotable: str
return Failure(f"{verdict.reason}; it replied: {json.dumps(reply, ensure_ascii=False)}")
if not grounded(verdict.evidence, shown):
return Failure(f"the judge quoted {verdict.evidence!r}, which is not in the transcript" + (f", for the question: {verdict.question}" if isinstance(verdict, Interrupt | QuotedAnswer) else ""))
# Not a Failure: a misquote would otherwise exit an unattended loop. Never elided: stitched fragments can say what the records do not.
# A misquoted answer or escalation is no Failure, which would otherwise exit an unattended loop: the question goes to the human, and the worker's rung holds.
# Never elided: stitched fragments can say what the records or the transcript do not.
if isinstance(verdict, QuotedAnswer) and not verbatim(verdict.answer, quotable):
return Interrupt(verdict.evidence, verdict.question)
# Not a Failure either: the worker's rung then holds, which is safe.
if isinstance(verdict, Unfinished) and verdict.escalation and not grounded(verdict.escalation, shown):
if isinstance(verdict, Unfinished) and verdict.escalation and not verbatim(verdict.escalation, shown):
return dataclasses.replace(verdict, escalation="")
return verdict