Answer architecture round 1: 0 🔴, 4 🟡; move verdicts out of cycle, derive RECORDED, type the archived worker as Record, drop stale help names

This commit is contained in:
2026-10-22 22:00:09 +02:00
parent c3ae228639
commit cb48719493
14 changed files with 53 additions and 48 deletions
+1 -1
View File
@@ -7,7 +7,7 @@ from loop_claude.cycle.prompts import ANSWER_DESTINATIONS, ANSWERS_RECORDED, typ
from claude_code.reply import claude_reply, Limited
from loop_claude.effects import Effects
from failure import Failure
from loop_claude.cycle.verdicts import Finished, Interrupt, QuotedAnswer, Unfinished, Verdict
from loop_claude.verdicts import Finished, Interrupt, QuotedAnswer, Unfinished, Verdict
from claude_code.entries import human_text, loop_text
from todo_table import LEVELS
from model_routing.route import on_its_scale
+1 -1
View File
@@ -8,7 +8,7 @@ from transcript_archive.write import archive
from claude_code.session import delete_session, Session, session_open, transcript_file
from loop_claude.effects import Effects
from failure import Failure
from loop_claude.cycle.verdicts import Finished, Interrupt, QuotedAnswer, Unfinished
from loop_claude.verdicts import Finished, Interrupt, QuotedAnswer, Unfinished
from loop_claude.cycle.judge import judge, Rejected
from transcript_archive import outcomes
from loop_claude.paths import Paths
+1 -1
View File
@@ -1,6 +1,6 @@
import dataclasses
from loop_claude.cycle.verdicts import Finished, Interrupt, QuotedAnswer, Unfinished, Verdict
from loop_claude.verdicts import Finished, Interrupt, QuotedAnswer, Unfinished, Verdict
# 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.
QUOTED_ANSWERS_PER_CYCLE = 3
-53
View File
@@ -1,53 +0,0 @@
"""What the judge rules on a cycle: the verdicts judge.verdict_from builds from its reply."""
import dataclasses
@dataclasses.dataclass(frozen=True)
class Interrupt:
evidence: str
question: str
# The judge's quote showing that the worker's cited escalation trigger fired; empty for none.
escalation: str = ""
# The highest L the judge saw the worker take into the chunk, 0 for none: an escalation steps up from the rung that L picks.
highest_likelihood_taken_in: int = 0
release_ready: bool = False
# How many transcript entries the judge read, which judge_once stamps. An escalation the verdict carries moves the route's mark there; one on a verdict never stamped, None, steps nothing.
entries_read: int | None = None
@dataclasses.dataclass(frozen=True)
class QuotedAnswer:
"""The worker asked a question that README.md or the records answer. The answer field quotes the passage."""
evidence: str
question: str
answer: str
# As on Interrupt.
escalation: str = ""
highest_likelihood_taken_in: int = 0
entries_read: int | None = None
@dataclasses.dataclass(frozen=True)
class Finished:
evidence: str
@dataclasses.dataclass(frozen=True)
class Unfinished:
evidence: str
# As on Interrupt; it raises the worker to the rung it picks.
highest_likelihood_taken_in: int = 0
# The judge's quote showing that the worker's cited escalation trigger fired; empty for none.
escalation: str = ""
# The highest E + I the judge saw the worker take into the chunk, 0 for none.
highest_escape_and_impact_taken_in: int = 0
# As on Interrupt.
entries_read: int | None = None
Verdict = Interrupt | QuotedAnswer | Finished | Unfinished
def escalation_mark(verdict: Interrupt | QuotedAnswer | Unfinished) -> int | None:
"""Where the verdict's escalation would move the route's mark, if it steps the worker; None where it carries none."""
return verdict.entries_read if verdict.escalation else None