Answer architecture round 1: 2 🔴, 13 🟡; test the replay's main and report, share one judge run and the archive format, pin the reference judge, route only replayed models, and say why the judge climbs
This commit is contained in:
@@ -3,8 +3,14 @@ import re
|
||||
from markdown_text import quoted
|
||||
from utc_stamp import STAMPED
|
||||
|
||||
TASK = "Task: "
|
||||
FINISHED = "Verdict: finished"
|
||||
UNFINISHED = "Verdict: unfinished"
|
||||
INTERRUPTED = "Verdict: interrupt"
|
||||
ANSWERED = "Verdict: quoted answer"
|
||||
# The file opens with the task, then a blank line, then the first stamped outcome.
|
||||
TASK_AT = re.compile(rf"\A{re.escape(TASK)}(.*?)\n\n{STAMPED} ", re.DOTALL)
|
||||
ANY_VERDICT_AT = re.compile(rf"^({STAMPED}) ({'|'.join(re.escape(verdict) for verdict in (FINISHED, UNFINISHED, INTERRUPTED, ANSWERED))})$", re.MULTILINE)
|
||||
FINISHED_AT = re.compile(rf"^({STAMPED}) {re.escape(FINISHED)}$", re.MULTILINE)
|
||||
UNFINISHED_AT = re.compile(rf"^{STAMPED} {re.escape(UNFINISHED)}$", re.MULTILINE)
|
||||
# A verdict closes each cycle the judge ruled on; an interrupt or a stop closes none.
|
||||
@@ -24,11 +30,11 @@ def unfinished(worker: str, evidence: str) -> str:
|
||||
|
||||
|
||||
def interrupted(question: str, evidence: str) -> str:
|
||||
return f"Verdict: interrupt\n\n{question}\n\nEvidence:\n{quoted(evidence)}"
|
||||
return f"{INTERRUPTED}\n\n{question}\n\nEvidence:\n{quoted(evidence)}"
|
||||
|
||||
|
||||
def answered(question: str, sources: str, answer: str, evidence: str) -> str:
|
||||
return f"Verdict: quoted answer\n\n{question}\n\n{sources} says:\n{quoted(answer)}\n\nEvidence:\n{quoted(evidence)}"
|
||||
return f"{ANSWERED}\n\n{question}\n\n{sources} says:\n{quoted(answer)}\n\nEvidence:\n{quoted(evidence)}"
|
||||
|
||||
|
||||
def stepped_up(worker: str) -> str:
|
||||
@@ -50,3 +56,15 @@ def workers(outcomes: str) -> list[tuple[str, str]]:
|
||||
if outcome.startswith(NAMES_A_WORKER) and last.startswith(WORKER):
|
||||
found.append((start[1], last.removeprefix(WORKER)))
|
||||
return found
|
||||
|
||||
|
||||
def task_of(outcomes: str) -> str | None:
|
||||
"""The task an outcomes file opens with; None when it opens with none."""
|
||||
found = TASK_AT.match(outcomes)
|
||||
return found[1] if found else None
|
||||
|
||||
|
||||
def first_verdict(outcomes: str) -> tuple[str, str] | None:
|
||||
"""The UTC stamp and the verdict, such as FINISHED, of the first verdict in an outcomes file; None when it holds none."""
|
||||
found = ANY_VERDICT_AT.search(outcomes)
|
||||
return (found[1], found[2]) if found else None
|
||||
|
||||
Reference in New Issue
Block a user