Answer stability round 1: 0 🔴, 1 🟡; test the exit 1 a rejected reply that cannot be archived causes, and tidy keep's type and docstrings

This commit is contained in:
2026-10-16 23:22:41 +02:00
parent 13672afc26
commit 49004f22a2
4 changed files with 19 additions and 9 deletions
+3 -3
View File
@@ -115,13 +115,13 @@ def rule(cycle: Cycle, transcript_path: str) -> Ruled | Stop:
entries = read_transcript(transcript_path)
if isinstance(entries, Failure):
return Stop(1, entries.reason)
verdict = judge(cycle.root, cycle.task, cycle.premises, cycle.records, render(entries), judge_of(cycle), cycle.effects, lambda failure: keep_rejection(cycle, transcript_path, failure))
verdict = judge(cycle.root, cycle.task, cycle.premises, cycle.records, render(entries), judge_of(cycle), cycle.effects, lambda rejected: keep_rejection(cycle, transcript_path, rejected))
return verdict if isinstance(verdict, Stop) else Ruled(verdict)
def keep_rejection(cycle: Cycle, transcript_path: str, failure: Failure) -> Stop | None:
def keep_rejection(cycle: Cycle, transcript_path: str, rejected: Rejected) -> Stop | None:
"""Archives a judge reply that loop-claude refused, so the archive answers why a run exited 1 or a verdict took a retry."""
if isinstance(failure, Rejected) and (unkept := archive(cycle.project_archive, transcript_path, cycle.task, outcomes.rejected(failure.reason, failure.reply, str(judge_of(cycle))), cycle.effects.now())):
if unkept := archive(cycle.project_archive, transcript_path, cycle.task, outcomes.rejected(rejected.reason, rejected.reply, str(judge_of(cycle))), cycle.effects.now()):
return Stop(1, unkept.reason)
return None