Answer prose round 1: 0 🔴, 7 🟡 (0 misread); rename Record to Annotation, and reword the decision, the help and the changelog
CI / tests (pull_request) Successful in 2m37s

This commit was merged in pull request #504.
This commit is contained in:
2026-11-12 10:25:30 +01:00
parent 72d9a9f652
commit fa54ed46b1
8 changed files with 47 additions and 47 deletions
+13 -13
View File
@@ -163,16 +163,16 @@ def rule(cycle: Cycle, transcript_path: str, quoted_answers: int) -> Ruled | Sto
verdict = dataclasses.replace(verdict, taken_in=chunk_items.taken_in(entries, cycle.todo))
if not isinstance(verdict, Interrupt | QuotedAnswer):
return Ruled(verdict)
record = record_of(cycle, transcript_path, entries, verdict.judged)
if isinstance(record, Failure):
return Stop(1, record.reason)
annotation = annotation_of(cycle, transcript_path, entries, verdict.judged)
if isinstance(annotation, Failure):
return Stop(1, annotation.reason)
stepped = ruling_step_up(cycle, verdict)
if failure := archive_stepped(cycle, transcript_path, ruling_outcome(cycle, verdict, quoted_answers, record), stepped):
if failure := archive_stepped(cycle, transcript_path, ruling_outcome(cycle, verdict, quoted_answers, annotation), stepped):
return Stop(1, failure.reason)
return Ruled(verdict, stepped.after if stepped else None)
def record_of(cycle: Cycle, transcript_path: str, entries: list[Entry], judged: Judged) -> outcomes.Record | Failure:
def annotation_of(cycle: Cycle, transcript_path: str, entries: list[Entry], judged: Judged) -> outcomes.Annotation | Failure:
"""What a verdict, an interrupt or a quoted answer records beside its judge lines: the setup, the stretch's spend as spend.py counts it, and the reversal the judge found."""
since = last_spent(cycle.project_archive, transcript_path)
if isinstance(since, Failure):
@@ -181,14 +181,14 @@ def record_of(cycle: Cycle, transcript_path: str, entries: list[Entry], judged:
if isinstance(subagents, Failure):
return subagents
spent = spend.spent(since, entries, subagents, judge_of(cycle).model, judged.tokens)
return outcomes.Record(cycle.config, spend.spent_block(since, spent), judged.reversed)
return outcomes.Annotation(cycle.config, spend.spent_block(since, spent), judged.reversed)
def ruling_outcome(cycle: Cycle, ruling: Interrupt | QuotedAnswer, quoted_answers: int, record: outcomes.Record) -> str:
def ruling_outcome(cycle: Cycle, ruling: Interrupt | QuotedAnswer, quoted_answers: int, annotation: outcomes.Annotation) -> str:
"""The archive's outcome for a ruling: interrupted where it goes to the human, with the question put to them, and else answered from README.md or the records."""
if isinstance(ruling, QuotedAnswer) and not to_the_human(ruling, quoted_answers):
return outcomes.answered(question=ruling.question, sources=prompts.QUOTE_SOURCES, answer=ruling.answer, evidence=ruling.evidence, escalation=ruling.escalation, judge=str(judge_of(cycle)), worker=cycle.route.worker_line(), judge_cost=ruling.judged.cost, record=record)
return outcomes.interrupted(question_for(ruling), ruling.evidence, str(judge_of(cycle)), ruling.escalation, cycle.route.worker_line(), ruling.judged.cost, record)
return outcomes.answered(question=ruling.question, sources=prompts.QUOTE_SOURCES, answer=ruling.answer, evidence=ruling.evidence, escalation=ruling.escalation, judge=str(judge_of(cycle)), worker=cycle.route.worker_line(), judge_cost=ruling.judged.cost, annotation=annotation)
return outcomes.interrupted(question_for(ruling), ruling.evidence, str(judge_of(cycle)), ruling.escalation, cycle.route.worker_line(), ruling.judged.cost, annotation)
def keep_rejection(cycle: Cycle, transcript_path: str, rejected: Rejected) -> Stop | None:
@@ -233,10 +233,10 @@ def question_for(ruling: Interrupt | QuotedAnswer) -> str:
def close(cycle: Cycle, transcript_path: str, verdict: Finished | Unfinished) -> Archived | Stop:
entries = read_transcript(transcript_path)
record = entries if isinstance(entries, Failure) else record_of(cycle, transcript_path, entries, verdict.judged)
if isinstance(record, Failure):
return Stop(1, record.reason)
outcome = outcomes.finished(cycle.route.worker_line(), verdict.evidence, str(judge_of(cycle)), verdict.judged.cost, record) if isinstance(verdict, Finished) else outcomes.unfinished(cycle.route.worker_line(), verdict.evidence, str(judge_of(cycle)), verdict.escalation, verdict.judged.cost, record)
annotation = entries if isinstance(entries, Failure) else annotation_of(cycle, transcript_path, entries, verdict.judged)
if isinstance(annotation, Failure):
return Stop(1, annotation.reason)
outcome = outcomes.finished(cycle.route.worker_line(), verdict.evidence, str(judge_of(cycle)), verdict.judged.cost, annotation) if isinstance(verdict, Finished) else outcomes.unfinished(cycle.route.worker_line(), verdict.evidence, str(judge_of(cycle)), verdict.escalation, verdict.judged.cost, annotation)
if failure := archived(cycle.project_archive, transcript_path, cycle.task, outcome, cycle.effects):
return Stop(1, failure.reason)
if isinstance(verdict, Finished) and (failure := delete_session(cycle.session)):
+1 -1
View File
@@ -22,7 +22,7 @@ class Judged:
cost: float = 0.0
# Its reply's usage, on the judge's model.
tokens: Tokens = Tokens()
# A typed answer of the human's that reversed a choice the worker took itself, as the judge quoted it; empty for none, and where the quote isn't in the transcript.
# The human's whole typed answer that holds the judge's quote of a reversal of a choice the worker took on its own recommendation; empty for none, and where no typed answer holds the quote.
reversed: str = ""