Answer architecture round 1: 0 🔴, 2 🟡; finish "record", record the three meanings as a decision, name rule-hook's check once

This commit is contained in:
2026-10-23 10:54:24 +02:00
parent 8d2a1cf9fd
commit 387a5ce506
23 changed files with 113 additions and 102 deletions
+8 -8
View File
@@ -1,8 +1,8 @@
import re
from markdown_text import quoted
from model_routing.route import Record
from utc_stamp import STAMPED
from model_routing.route import WorkerLine
TASK = "Task: "
FINISHED = "Verdict: finished"
@@ -29,23 +29,23 @@ def escalation_block(escalation: str) -> str:
return f"Escalation:\n{quoted(escalation)}\n\n" if escalation else ""
def finished(worker: Record, evidence: str, judge: str) -> str:
def finished(worker: WorkerLine, evidence: str, judge: str) -> str:
return f"{FINISHED}\n\nEvidence:\n{quoted(evidence)}\n\n{JUDGE}{judge}\n{WORKER}{worker}"
def unfinished(worker: Record, evidence: str, judge: str, escalation: str) -> str:
def unfinished(worker: WorkerLine, evidence: str, judge: str, escalation: str) -> str:
"""escalation is the judge's quote showing that the worker's cited escalation trigger fired; empty for none."""
escalated = escalation_block(escalation)
return f"{UNFINISHED}\n\nEvidence:\n{quoted(evidence)}\n\n{escalated}{JUDGE}{judge}\n{WORKER}{worker}"
def interrupted(question: str, evidence: str, judge: str, escalation: str, worker: Record) -> str:
"""escalation is the judge's quote showing that the worker's cited escalation trigger fired; empty for none. worker is the record of the route the worker ran on until the interrupt."""
def interrupted(question: str, evidence: str, judge: str, escalation: str, worker: WorkerLine) -> str:
"""escalation is the judge's quote showing that the worker's cited escalation trigger fired; empty for none. worker is the line naming the route the worker ran on until the interrupt."""
escalated = escalation_block(escalation)
return f"{INTERRUPTED}\n\n{question}\n\nEvidence:\n{quoted(evidence)}\n\n{escalated}{JUDGE}{judge}\n{WORKER}{worker}"
def answered(question: str, sources: str, answer: str, evidence: str, escalation: str, judge: str, worker: Record) -> str:
def answered(question: str, sources: str, answer: str, evidence: str, escalation: str, judge: str, worker: WorkerLine) -> str:
"""escalation and worker are as on interrupted."""
escalated = escalation_block(escalation)
return f"{ANSWERED}\n\n{question}\n\n{sources} says:\n{quoted(answer)}\n\nEvidence:\n{quoted(evidence)}\n\n{escalated}{JUDGE}{judge}\n{WORKER}{worker}"
@@ -56,12 +56,12 @@ def rejected(why: str, reply: str, judge: str) -> str:
return f"{REJECTED}: {why}\n\nReply:\n{quoted(reply)}\n\n{JUDGE}{judge}"
def stepped_up(worker: Record) -> str:
def stepped_up(worker: WorkerLine) -> str:
"""The rung the next cycle steps up to, archived as it steps, so a rerun after any exit resumes on it."""
return f"Stepped up\n\n{WORKER}{worker}"
def stopped(worker: Record, why: str) -> str:
def stopped(worker: WorkerLine, why: str) -> str:
return f"Stopped: {why}\n\n{WORKER}{worker}"