Define worker and judge under Vocabulary and spell the interrupt one way
This commit is contained in:
+11
-11
@@ -59,7 +59,7 @@ RELOAD_FLAG = "--reloaded"
|
||||
SESSION_NAMESPACE = uuid.UUID("64fb586b-d926-4bb3-a44c-c903e86d3eec")
|
||||
|
||||
JUDGE_RULES = (
|
||||
"Decide whether the human must now be interrupted. ask=true when any of these appear:\n"
|
||||
"Decide whether the human must now be interrupted. interrupt=true when any of these appear:\n"
|
||||
"- the agent asks the human anything, seeks approval, or says a decision is the human's\n"
|
||||
"- it carried on under an assumption that decides the deliverable and that the human could "
|
||||
"reasonably reject; a caveat about transient state it then handled is not one\n"
|
||||
@@ -68,12 +68,12 @@ JUDGE_RULES = (
|
||||
"- it flags that the goals, the plan or the task itself is unclear, missing or in need of change\n"
|
||||
"- it chose between alternatives the README text does not discriminate between - it does not "
|
||||
"rule the rejected one out - and the choice materially changes the deliverable\n"
|
||||
"ask=false otherwise. A sensible preference is not a derivation. Bookkeeping the agent settled "
|
||||
"interrupt=false otherwise. A sensible preference is not a derivation. Bookkeeping the agent settled "
|
||||
"silently - what to document, wording, where a note goes - is not on its own a reason to "
|
||||
"interrupt. The human may have replied inside the transcript, on a [human] line: judge only what "
|
||||
"is still open, never a question they already answered there.\n"
|
||||
"The question must be one the agent itself raised. Never construct a question from facts the agent "
|
||||
"stated. When ask=true, quote the agent's own wording where it already framed the question.\n"
|
||||
"stated. When interrupt=true, quote the agent's own wording where it already framed the question.\n"
|
||||
"finished=true when the chunk is complete: merged, or nothing remains that the agent could do on "
|
||||
"its own. finished=false when work remains that a further run can continue: an open PR, a review "
|
||||
"not yet run, CI not yet reported."
|
||||
@@ -81,12 +81,12 @@ JUDGE_RULES = (
|
||||
|
||||
JUDGE_SCHEMA = {
|
||||
"properties": {
|
||||
"ask": {"type": "boolean"},
|
||||
"evidence": {"description": "A verbatim quote from the transcript of the line that raises the question. Empty when ask is false.", "type": "string"},
|
||||
"evidence": {"description": "A verbatim quote from the transcript of the line that raises the question. Empty when interrupt is false.", "type": "string"},
|
||||
"finished": {"type": "boolean"},
|
||||
"question": {"description": "The single question to put to the human. Empty when ask is false.", "type": "string"},
|
||||
"interrupt": {"type": "boolean"},
|
||||
"question": {"description": "The single question to put to the human. Empty when interrupt is false.", "type": "string"},
|
||||
},
|
||||
"required": ["ask", "evidence", "finished", "question"],
|
||||
"required": ["evidence", "finished", "interrupt", "question"],
|
||||
"type": "object",
|
||||
}
|
||||
|
||||
@@ -148,9 +148,9 @@ def run_cycle(root, task, premises, name, session_id, chosen):
|
||||
verdict = judge(root, task, premises, render(entries(path)), chosen)
|
||||
if isinstance(verdict, Stop):
|
||||
return verdict
|
||||
if not verdict["ask"]:
|
||||
if not verdict["interrupt"]:
|
||||
break
|
||||
archive(root, path, f"Task: {task}\n\nVerdict: needs input\n\n{verdict['question']}")
|
||||
archive(root, path, f"Task: {task}\n\nVerdict: interrupt\n\n{verdict['question']}")
|
||||
if failure := interrupt(root, session_id, chosen, path, verdict["question"]):
|
||||
return Stop(2, failure)
|
||||
if verdict["finished"]:
|
||||
@@ -512,7 +512,7 @@ def judge_prompt(task, premises, transcript):
|
||||
return (
|
||||
f"From README.md:\n{premises}\n\n"
|
||||
f"The task an agent was given:\n{task}\n\n"
|
||||
# The tail, where an ask or a finish lands; the session's transcript grows cycle over cycle.
|
||||
# The tail, where an interrupt or a finish lands; the session's transcript grows cycle over cycle.
|
||||
f"What the agent did and said, and what the human typed on [human] lines, latest last:\n{transcript[-40000:]}\n\n"
|
||||
f"{JUDGE_RULES}"
|
||||
)
|
||||
@@ -523,7 +523,7 @@ def complete(verdict):
|
||||
|
||||
|
||||
def grounded(verdict, transcript):
|
||||
if not verdict["ask"]:
|
||||
if not verdict["interrupt"]:
|
||||
return True
|
||||
evidence = verdict["evidence"]
|
||||
return evidence.strip() != "" and evidence in transcript
|
||||
|
||||
Reference in New Issue
Block a user