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
CI / tests (pull_request) Successful in 2m37s
This commit was merged in pull request #504.
This commit is contained in:
@@ -31,26 +31,26 @@ JUDGE_COST_AT = re.compile(rf"^{re.escape(JUDGE)}(.+)\n{re.escape(JUDGE_COST)}([
|
||||
|
||||
# The claude-config release and commit that ran the cycle, on the line before JUDGE, such as `Config: v0.8.0 (<sha>)`.
|
||||
CONFIG = "Config: "
|
||||
# Opens the block of what the stretch of work since the previous record spent; a record that spent nothing has none.
|
||||
# Opens the block of what the work since the previous outcome that recorded a spend spent; an outcome that spent nothing has none.
|
||||
SPENT = "Spent since "
|
||||
# Opens the quote of a typed answer of the human's that reversed a choice the worker took itself.
|
||||
# Opens the quote of a typed answer of the human's that reversed a choice the worker took on its own recommendation.
|
||||
REVERSED = "Reversed:"
|
||||
REVERSED_AT = re.compile(rf"^{re.escape(REVERSED)}\n((?:> .*\n)*> .*)", re.MULTILINE)
|
||||
|
||||
|
||||
class Record(typing.NamedTuple):
|
||||
"""What a verdict, an interrupt or a quoted answer records beside its judge lines, so a change to the setup can be judged before and after: docs/decisions.md → `loop-claude: each verdict records the setup, the spend and the reversals…`. Each part is left out where empty; the cycle always gives config."""
|
||||
class Annotation(typing.NamedTuple):
|
||||
"""What a verdict, an interrupt or a quoted answer records beside its judge lines, so a change to the setup can be judged before and after: docs/decisions.md → `loop-claude: each verdict records the claude-config release and commit that ran it…`. Each part is left out where empty; the cycle always gives config."""
|
||||
config: str = ""
|
||||
# The block spend.spent_block renders.
|
||||
spent: str = ""
|
||||
# The judge's quote of the human's reversing answer, as the judge checked it.
|
||||
# The human's whole typed answer that holds the judge's quote of the reversal, as loop-claude checked it.
|
||||
reversed: str = ""
|
||||
|
||||
|
||||
def record_lines(record: Record) -> str:
|
||||
reversed_block = f"{REVERSED}\n{quoted(record.reversed)}\n\n" if record.reversed else ""
|
||||
spent_block = f"{record.spent}\n\n" if record.spent else ""
|
||||
config_line = f"{CONFIG}{record.config}\n" if record.config else ""
|
||||
def annotation_lines(annotation: Annotation) -> str:
|
||||
reversed_block = f"{REVERSED}\n{quoted(annotation.reversed)}\n\n" if annotation.reversed else ""
|
||||
spent_block = f"{annotation.spent}\n\n" if annotation.spent else ""
|
||||
config_line = f"{CONFIG}{annotation.config}\n" if annotation.config else ""
|
||||
return f"{reversed_block}{spent_block}{config_line}"
|
||||
|
||||
|
||||
@@ -74,7 +74,7 @@ def judge_lines(judge: str, judge_cost: float) -> str:
|
||||
|
||||
|
||||
def judge_costs(outcomes: str) -> list[tuple[str, float]]:
|
||||
"""The rung and cost of each judge run the outcomes record a cost for."""
|
||||
"""The rung and cost of each judge run the outcomes annotation a cost for."""
|
||||
return [(found[1], float(found[2])) for found in JUDGE_COST_AT.finditer(outcomes)]
|
||||
|
||||
|
||||
@@ -82,26 +82,26 @@ def escalation_block(escalation: str) -> str:
|
||||
return f"Escalation:\n{quoted(escalation)}\n\n" if escalation else ""
|
||||
|
||||
|
||||
def finished(worker: WorkerLine, evidence: str, judge: str, judge_cost: float = 0.0, record: Record = Record()) -> str:
|
||||
return f"{FINISHED}\n\nEvidence:\n{quoted(evidence)}\n\n{record_lines(record)}{judge_lines(judge, judge_cost)}\n{WORKER}{worker}"
|
||||
def finished(worker: WorkerLine, evidence: str, judge: str, judge_cost: float = 0.0, annotation: Annotation = Annotation()) -> str:
|
||||
return f"{FINISHED}\n\nEvidence:\n{quoted(evidence)}\n\n{annotation_lines(annotation)}{judge_lines(judge, judge_cost)}\n{WORKER}{worker}"
|
||||
|
||||
|
||||
def unfinished(worker: WorkerLine, evidence: str, judge: str, escalation: str, judge_cost: float = 0.0, record: Record = Record()) -> str:
|
||||
def unfinished(worker: WorkerLine, evidence: str, judge: str, escalation: str, judge_cost: float = 0.0, annotation: Annotation = Annotation()) -> 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}{record_lines(record)}{judge_lines(judge, judge_cost)}\n{WORKER}{worker}"
|
||||
return f"{UNFINISHED}\n\nEvidence:\n{quoted(evidence)}\n\n{escalated}{annotation_lines(annotation)}{judge_lines(judge, judge_cost)}\n{WORKER}{worker}"
|
||||
|
||||
|
||||
def interrupted(question: str, evidence: str, judge: str, escalation: str, worker: WorkerLine, judge_cost: float = 0.0, record: Record = Record()) -> str:
|
||||
def interrupted(question: str, evidence: str, judge: str, escalation: str, worker: WorkerLine, judge_cost: float = 0.0, annotation: Annotation = Annotation()) -> 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}{record_lines(record)}{judge_lines(judge, judge_cost)}\n{WORKER}{worker}"
|
||||
return f"{INTERRUPTED}\n\n{question}\n\nEvidence:\n{quoted(evidence)}\n\n{escalated}{annotation_lines(annotation)}{judge_lines(judge, judge_cost)}\n{WORKER}{worker}"
|
||||
|
||||
|
||||
def answered(*, question: str, sources: str, answer: str, evidence: str, escalation: str, judge: str, worker: WorkerLine, judge_cost: float = 0.0, record: Record = Record()) -> str:
|
||||
def answered(*, question: str, sources: str, answer: str, evidence: str, escalation: str, judge: str, worker: WorkerLine, judge_cost: float = 0.0, annotation: Annotation = Annotation()) -> str:
|
||||
"""escalation and worker are as on interrupted. Every parameter is keyword-only, since a swap of two str ones would still type-check."""
|
||||
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}{record_lines(record)}{judge_lines(judge, judge_cost)}\n{WORKER}{worker}"
|
||||
return f"{ANSWERED}\n\n{question}\n\n{sources} says:\n{quoted(answer)}\n\nEvidence:\n{quoted(evidence)}\n\n{escalated}{annotation_lines(annotation)}{judge_lines(judge, judge_cost)}\n{WORKER}{worker}"
|
||||
|
||||
|
||||
def rejected(why: str, reply: str, judge: str, judge_cost: float = 0.0) -> str:
|
||||
|
||||
Reference in New Issue
Block a user