Answer principles round 1: 0 🔴, 6 🟡; correct the interrupt's definition, show the judge the question beside the typed answer, ask in one call returning Talk, add a Talking state, give the worker its own question past the cap, assert the prompts' facts, and keep stepped_from as the step's one owner

This commit is contained in:
2026-10-17 23:32:21 +02:00
parent 44fa8a7fe6
commit 4b2d4a1734
14 changed files with 153 additions and 92 deletions
+7 -4
View File
@@ -130,17 +130,20 @@ def answered(question: str, answer: str, route: Route, anchor: Rung | None, step
def typed(question: str, answer: str, route: Route, anchor: Rung | None, stepped: bool) -> str:
"""Resumes the worker with the human's answer to an interrupt. answer is one line, as the terminal reads it."""
return f"{TYPED_HERE}\n{answer}\n\nYour question was: {question}\n\nContinue the task.{stepped_to(route, anchor, stepped)}"
return f"{TYPED_HERE}\n{answer}\n\nYour question was: {question}\n\nContinue the task. The chunk is finished only once {ANSWERS_RECORDED}.{stepped_to(route, anchor, stepped)}"
# Opens typed's prompt, and the answer is the line after it, so typed_answer reads the answer from the prompt's start alone.
TYPED_HERE = "The human answered your question at loop-claude's terminal:"
def typed_answer(prompt: str) -> str | None:
"""The answer typed put in prompt, so the judge reads it as the human's; None for any other prompt."""
def typed_answer(prompt: str) -> tuple[str, str] | None:
"""The rest of the prompt typed made, and the answer it put there, so the judge reads the answer as the human's; None for any other prompt."""
opening = f"{TYPED_HERE}\n"
return prompt.removeprefix(opening).split("\n", 1)[0] if prompt.startswith(opening) else None
if not prompt.startswith(opening):
return None
answer, _, rest = prompt.removeprefix(opening).partition("\n\n")
return rest, answer
def stepped_to(route: Route, anchor: Rung | None, stepped: bool) -> str: