|
|
|
@@ -568,7 +568,7 @@ Spent since 2026-09-21T14:13:20Z, in tokens of input, cache write 5m, cache writ
|
|
|
|
|
self.assertEqual(concluded.route, Route(Routing.OPUS, 179, 2, 5, escalated_at=3))
|
|
|
|
|
first, resumed = fake.made("stream_claude")
|
|
|
|
|
self.assertEqual([args[args.index("--effort") + 1] for args in (first, resumed)], ["high", "medium"])
|
|
|
|
|
self.assertTrue(resumed[resumed.index("-p") + 1].endswith(f"Continue the task. Your request for a higher rung went through: loop-claude runs you on {Routing.OPUS}. The escalation triggers that fired before this step are spent.{prompts.rungs_held(concluded.route, OPUS_PROJECT)}"))
|
|
|
|
|
self.assertTrue(resumed[resumed.index("-p") + 1].endswith(f"Continue the task. Your request for a higher rung went through: loop-claude runs you on {Routing.OPUS}. The escalation triggers that fired before this step are spent.{prompts.WORKER.rungs_held(concluded.route, OPUS_PROJECT)}"))
|
|
|
|
|
self.assertNotIn("went through", first[first.index("-p") + 1])
|
|
|
|
|
answered = f"Verdict: quoted answer\n\nWhich one?\n\n{prompts.QUOTE_SOURCES} says:\n> Use A.\n\nEvidence:\n> working\n\nEscalation:\n> working\n\nConfig: {CONFIG}\nJudge: judge-model\nWorker: {SONNET_179}\n"
|
|
|
|
|
stepped = f"Stepped up\n\nWorker: {OPUS_179_AT_3}\n"
|
|
|
|
@@ -795,7 +795,7 @@ class Interrupts(unittest.TestCase):
|
|
|
|
|
def put(self, fake, answer_here=True, effects=None, question="Which one?"):
|
|
|
|
|
"""interrupt's answer and what it said, without the bell it rang, which self.bells counts."""
|
|
|
|
|
with contextlib.redirect_stderr(io.StringIO()) as said:
|
|
|
|
|
answer = interrupt.interrupt(question, answer_here, self.session, WINDOW, effects or fake.effects())
|
|
|
|
|
answer = interrupt.interrupt(question, answer_here, self.session, WINDOW, prompts.DRIVER, effects or fake.effects())
|
|
|
|
|
self.bells = said.getvalue().count(tmux.BELL)
|
|
|
|
|
return answer, said.getvalue().replace(tmux.BELL, "")
|
|
|
|
|
|
|
|
|
@@ -1004,10 +1004,10 @@ class ModelPrompt(unittest.TestCase):
|
|
|
|
|
def test_asks_again_until_an_answer_picks_a_model(self):
|
|
|
|
|
with tempfile.TemporaryDirectory() as empty:
|
|
|
|
|
fake = FakeEffects(inputs=["", "my-model"])
|
|
|
|
|
self.assertEqual(model_choice.ask_for_model("proj", pathlib.Path("/m.json"), pathlib.Path(empty), fake.effects()), "my-model")
|
|
|
|
|
self.assertEqual(model_choice.ask_for_model("proj", pathlib.Path("/m.json"), pathlib.Path(empty), prompts.DRIVER, fake.effects()), "my-model")
|
|
|
|
|
self.assertEqual(len(fake.made("input")), 2)
|
|
|
|
|
fake = FakeEffects(inputs=[EOFError()])
|
|
|
|
|
self.assertEqual(model_choice.ask_for_model("proj", pathlib.Path("/m.json"), pathlib.Path(empty), fake.effects()), Stop(2, "the human is needed to pick proj's model, but the input ended"))
|
|
|
|
|
self.assertEqual(model_choice.ask_for_model("proj", pathlib.Path("/m.json"), pathlib.Path(empty), prompts.DRIVER, fake.effects()), Stop(2, "the human is needed to pick proj's model, but the input ended"))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# A plan read with no release cut yet.
|
|
|
|
@@ -1308,14 +1308,14 @@ class TmuxCommands(unittest.TestCase):
|
|
|
|
|
("", "loop-claude runs each chunk in a tmux window, and needs tmux 3.2 or later; it found no tmux")):
|
|
|
|
|
with self.subTest(found=found):
|
|
|
|
|
fake = FakeEffects(tmux_version=found)
|
|
|
|
|
self.assertEqual(tmux.unusable(fake.tmux), reason)
|
|
|
|
|
self.assertEqual(tmux.unusable(fake.tmux, prompts.DRIVER), reason)
|
|
|
|
|
self.assertEqual(fake.tmux_calls, [["-V"]])
|
|
|
|
|
|
|
|
|
|
def test_names_the_session_for_the_project(self):
|
|
|
|
|
self.assertEqual(tmux.session_name("claude-config"), "loop-claude-config")
|
|
|
|
|
self.assertEqual(tmux.session_name(tmux.LOOP, "claude-config"), "loop-claude-config")
|
|
|
|
|
# tmux reads `.` and `:` in a target as separators.
|
|
|
|
|
self.assertEqual(tmux.session_name("my.site:2 x"), "loop-my-site-2-x")
|
|
|
|
|
self.assertEqual(tmux.session_name("Acme/Billing"), "loop-Acme-Billing")
|
|
|
|
|
self.assertEqual(tmux.session_name(tmux.LOOP, "my.site:2 x"), "loop-my-site-2-x")
|
|
|
|
|
self.assertEqual(tmux.session_name(tmux.LOOP, "Acme/Billing"), "loop-Acme-Billing")
|
|
|
|
|
|
|
|
|
|
def test_lists_the_windows_without_the_waiting_mark(self):
|
|
|
|
|
fake = FakeEffects(windows="item-372 ?\t0\t@1\nitem-380\t1\t@2\nno-item\t0\t@5\n")
|
|
|
|
@@ -1722,7 +1722,7 @@ class TypedAnswers(unittest.TestCase):
|
|
|
|
|
self.assertEqual(worker_prompts.typed_answer(prompts.WORKER.typed(f"Which one?\n{marked}", "Use B.", route, None, False)).answer, "Use B.")
|
|
|
|
|
self.assertEqual(worker_prompts.typed_answer(prompts.WORKER.typed("Which one?", "Use B.", Route(Routing.SONNET, 179, 2, 5), OPUS_PROJECT, True)).answer, "Use B.")
|
|
|
|
|
self.assertIsNone(worker_prompts.typed_answer(prompts.WORKER.answered("Which one?", marked, route, None, False)))
|
|
|
|
|
self.assertIsNone(worker_prompts.typed_answer(prompts.resumed(marked, route, None)))
|
|
|
|
|
self.assertIsNone(worker_prompts.typed_answer(prompts.WORKER.resumed(marked, route, None)))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class WorkerArgs(unittest.TestCase):
|
|
|
|
@@ -1733,24 +1733,24 @@ class WorkerArgs(unittest.TestCase):
|
|
|
|
|
FACTS = "- A preflight fact."
|
|
|
|
|
|
|
|
|
|
def test_names_the_route_in_a_fresh_prompt_only_where_an_item_routed_it(self):
|
|
|
|
|
routed = prompts.fresh("Do it.", "## Goals", Route(Rung("m", "high"), 3, 4, 5), None, self.FACTS)
|
|
|
|
|
routed = prompts.WORKER.fresh("Do it.", "## Goals", Route(Rung("m", "high"), 3, 4, 5), None, self.FACTS)
|
|
|
|
|
self.assertIn(f"Continue any open draft PR or worktree for the chunk before creating a new one. {prompts.READING_RULE} {prompts.NAME_THE_ITEMS}\n\nloop-claude runs you on m at high effort, routed by item 3's L of 4.", routed)
|
|
|
|
|
unrouted = prompts.fresh("Do it.", "## Goals", Route(Rung("m")), None, self.FACTS)
|
|
|
|
|
unrouted = prompts.WORKER.fresh("Do it.", "## Goals", Route(Rung("m")), None, self.FACTS)
|
|
|
|
|
self.assertIn(f"before creating a new one. {prompts.READING_RULE} {prompts.NAME_THE_ITEMS}\n\n{self.FACTS}\n\nThe chunk's", unrouted)
|
|
|
|
|
self.assertNotIn("loop-claude runs you on", unrouted)
|
|
|
|
|
|
|
|
|
|
def test_has_the_routed_worker_count_its_items_size_again_and_puts_the_facts_before_the_scope(self):
|
|
|
|
|
routed = prompts.fresh("Do it.", "## Goals", Route(Rung("m", "high"), 3, 4, 5), None, self.FACTS)
|
|
|
|
|
routed = prompts.WORKER.fresh("Do it.", "## Goals", Route(Rung("m", "high"), 3, 4, 5), None, self.FACTS)
|
|
|
|
|
self.assertIn("item 3's size again", routed)
|
|
|
|
|
self.assertIn("escalation trigger 1", routed)
|
|
|
|
|
self.assertIn(f"\n\n{self.FACTS}\n\nThe chunk's", routed)
|
|
|
|
|
self.assertNotIn("size again", prompts.fresh("Do it.", "## Goals", Route(Rung("m")), None, self.FACTS))
|
|
|
|
|
self.assertNotIn("size again", prompts.WORKER.fresh("Do it.", "## Goals", Route(Rung("m")), None, self.FACTS))
|
|
|
|
|
|
|
|
|
|
def test_gives_each_fresh_worker_the_reading_rule_once(self):
|
|
|
|
|
rule = "never read more than 80 lines of a file at once, nor take a tool output over 3,000 characters into your context"
|
|
|
|
|
for route in (Route(Rung("m", "high"), 3, 4, 5), Route(Rung("m"))):
|
|
|
|
|
with self.subTest(route=route):
|
|
|
|
|
self.assertEqual(prompts.fresh("Do it.", "## Goals", route, None, self.FACTS).count(rule), 1)
|
|
|
|
|
self.assertEqual(prompts.WORKER.fresh("Do it.", "## Goals", route, None, self.FACTS).count(rule), 1)
|
|
|
|
|
|
|
|
|
|
def test_quotes_what_the_preflight_printed_or_has_the_worker_find_the_facts_itself(self):
|
|
|
|
|
self.assertIn("\n\n- A fact.", prompts.preflight_facts("- A fact."))
|
|
|
|
@@ -1761,95 +1761,95 @@ class WorkerArgs(unittest.TestCase):
|
|
|
|
|
def test_has_each_fresh_worker_continue_an_open_draft_pr_or_worktree_once_whatever_the_preflight_found(self):
|
|
|
|
|
for facts in (prompts.preflight_facts("- A fact."), prompts.preflight_failed("git could not start")):
|
|
|
|
|
with self.subTest(facts=facts):
|
|
|
|
|
self.assertEqual(prompts.fresh("Do it.", "## Goals", Route(Rung("m")), None, facts).count("Continue any open draft PR or worktree"), 1)
|
|
|
|
|
self.assertEqual(prompts.WORKER.fresh("Do it.", "## Goals", Route(Rung("m")), None, facts).count("Continue any open draft PR or worktree"), 1)
|
|
|
|
|
|
|
|
|
|
def test_keeps_every_review_on_the_projects_rung_while_the_worker_runs_below_it(self):
|
|
|
|
|
opus = Rung("claude-opus-5-5", "medium")
|
|
|
|
|
below = prompts.fresh("Do it.", "## Goals", Route(Rung("claude-sonnet-5-5", "high"), 3, 2, 4), OPUS_PROJECT, self.FACTS)
|
|
|
|
|
below = prompts.WORKER.fresh("Do it.", "## Goals", Route(Rung("claude-sonnet-5-5", "high"), 3, 2, 4), OPUS_PROJECT, self.FACTS)
|
|
|
|
|
self.assertIn(f"item 3's L of 2. Launch each reviewer, each comprehension seat and the security pass's subagent with the Agent tool set to model opus, effort medium, the project's rung.{self.SCAN} Your rung is below the project's: launch each subagent that files or scores plan items on the rung `~/.claude/bin/subagent-rung --plan claude-opus-5-5 <L>` prints. Where an item you take into the chunk has an E + I of 5 or more, launch each reviewer with the Agent tool set to `model fable, effort low` from 5, `model fable, effort medium` from 6, `model opus, effort xhigh` from 7 and `model fable, effort high` from 8. When an escalation trigger", below)
|
|
|
|
|
self.assertNotIn("Launch each", prompts.fresh("Do it.", "## Goals", Route(opus, 3, 2, 4), OPUS_PROJECT, self.FACTS))
|
|
|
|
|
self.assertNotIn("Launch each", prompts.WORKER.fresh("Do it.", "## Goals", Route(opus, 3, 2, 4), OPUS_PROJECT, self.FACTS))
|
|
|
|
|
|
|
|
|
|
def test_launches_reviewers_on_the_rung_the_items_e_plus_i_picks_above_the_workers(self):
|
|
|
|
|
opus = Rung("claude-opus-5-5", "medium")
|
|
|
|
|
level = prompts.fresh("Do it.", "## Goals", Route(opus, 3, 2, 6), OPUS_PROJECT, self.FACTS)
|
|
|
|
|
level = prompts.WORKER.fresh("Do it.", "## Goals", Route(opus, 3, 2, 6), OPUS_PROJECT, self.FACTS)
|
|
|
|
|
self.assertIn(f"item 3's L of 2. Launch each reviewer with the Agent tool set to model fable, effort medium, the rung item 3's E + I of 6 picks. Where an item you take into the chunk has an E + I of 7 or more, launch each reviewer with the Agent tool set to `model opus, effort xhigh` from 7 and `model fable, effort high` from 8.{self.MARKDOWN} When an escalation trigger", level)
|
|
|
|
|
below = prompts.fresh("Do it.", "## Goals", Route(Rung("claude-sonnet-5-5", "high"), 3, 2, 5), OPUS_PROJECT, self.FACTS)
|
|
|
|
|
below = prompts.WORKER.fresh("Do it.", "## Goals", Route(Rung("claude-sonnet-5-5", "high"), 3, 2, 5), OPUS_PROJECT, self.FACTS)
|
|
|
|
|
self.assertIn(f"item 3's L of 2. Launch each reviewer with the Agent tool set to model fable, effort low, the rung item 3's E + I of 5 picks.{self.SEATS}{self.SCAN} Your rung is below the project's:", below)
|
|
|
|
|
self.assertNotIn("Launch each reviewer", prompts.resumed("", Route(Rung("claude-fable-5-2", "medium"), 3, 4, 6), OPUS_PROJECT))
|
|
|
|
|
self.assertNotIn("Launch each reviewer", prompts.WORKER.resumed("", Route(Rung("claude-fable-5-2", "medium"), 3, 4, 6), OPUS_PROJECT))
|
|
|
|
|
|
|
|
|
|
def test_names_the_reviewers_rung_each_higher_e_plus_i_an_item_taken_in_picks(self):
|
|
|
|
|
opus = Rung("claude-opus-5-5", "medium")
|
|
|
|
|
taking_in = " Where an item you take into the chunk has an E + I of 5 or more, launch each reviewer with the Agent tool set to `model fable, effort low` from 5, `model fable, effort medium` from 6, `model opus, effort xhigh` from 7 and `model fable, effort high` from 8."
|
|
|
|
|
self.assertIn(f"item 3's L of 2.{taking_in} When an escalation trigger", prompts.fresh("Do it.", "## Goals", Route(opus, 3, 2, 4), OPUS_PROJECT, self.FACTS))
|
|
|
|
|
self.assertIn(" Where an item you take into the chunk has an E + I of 7 or more, launch each reviewer with the Agent tool set to `model opus, effort xhigh` from 7 and `model fable, effort high` from 8.", prompts.resumed("", Route(opus, 3, 2, 6), OPUS_PROJECT))
|
|
|
|
|
self.assertIn(" Where an item you take into the chunk has an E + I of 7 or more, launch each reviewer with the Agent tool set to `model opus, effort xhigh` from 7 and `model fable, effort high` from 8.", prompts.resumed("", Route(Rung("claude-fable-5-2", "medium"), 3, 4, 4), OPUS_PROJECT))
|
|
|
|
|
self.assertNotIn("Where an item you take into", prompts.resumed("", Route(opus, 3, 2, 8), OPUS_PROJECT))
|
|
|
|
|
self.assertNotIn("Where an item you take into", prompts.resumed("", Route(Rung("m")), None))
|
|
|
|
|
self.assertIn(f"item 3's L of 2.{taking_in} When an escalation trigger", prompts.WORKER.fresh("Do it.", "## Goals", Route(opus, 3, 2, 4), OPUS_PROJECT, self.FACTS))
|
|
|
|
|
self.assertIn(" Where an item you take into the chunk has an E + I of 7 or more, launch each reviewer with the Agent tool set to `model opus, effort xhigh` from 7 and `model fable, effort high` from 8.", prompts.WORKER.resumed("", Route(opus, 3, 2, 6), OPUS_PROJECT))
|
|
|
|
|
self.assertIn(" Where an item you take into the chunk has an E + I of 7 or more, launch each reviewer with the Agent tool set to `model opus, effort xhigh` from 7 and `model fable, effort high` from 8.", prompts.WORKER.resumed("", Route(Rung("claude-fable-5-2", "medium"), 3, 4, 4), OPUS_PROJECT))
|
|
|
|
|
self.assertNotIn("Where an item you take into", prompts.WORKER.resumed("", Route(opus, 3, 2, 8), OPUS_PROJECT))
|
|
|
|
|
self.assertNotIn("Where an item you take into", prompts.WORKER.resumed("", Route(Rung("m")), None))
|
|
|
|
|
|
|
|
|
|
def test_launches_reviewers_on_the_rung_the_highest_e_plus_i_taken_in_picks(self):
|
|
|
|
|
opus = Rung("claude-opus-5-5", "medium")
|
|
|
|
|
self.assertIn(f"loop-claude runs you on claude-opus-5-5 at medium effort. Launch each reviewer with the Agent tool set to model opus, effort xhigh, the rung picked by an item of E + I 7 taken into the chunk. Where an item you take into the chunk has an E + I of 8 or more, launch each reviewer with the Agent tool set to `model fable, effort high` from 8.{self.MARKDOWN} When an escalation trigger", prompts.resumed("", Route(opus, 3, 2, 5, escape_and_impact_taken_in=7), OPUS_PROJECT))
|
|
|
|
|
self.assertIn(" Launch each reviewer with the Agent tool set to model fable, effort low, the rung picked by an item of E + I 5 taken into the chunk.", prompts.resumed("", Route(opus, escape_and_impact_taken_in=5), OPUS_PROJECT))
|
|
|
|
|
self.assertIn(f"loop-claude runs you on claude-opus-5-5 at medium effort. Launch each reviewer with the Agent tool set to model opus, effort xhigh, the rung picked by an item of E + I 7 taken into the chunk. Where an item you take into the chunk has an E + I of 8 or more, launch each reviewer with the Agent tool set to `model fable, effort high` from 8.{self.MARKDOWN} When an escalation trigger", prompts.WORKER.resumed("", Route(opus, 3, 2, 5, escape_and_impact_taken_in=7), OPUS_PROJECT))
|
|
|
|
|
self.assertIn(" Launch each reviewer with the Agent tool set to model fable, effort low, the rung picked by an item of E + I 5 taken into the chunk.", prompts.WORKER.resumed("", Route(opus, escape_and_impact_taken_in=5), OPUS_PROJECT))
|
|
|
|
|
|
|
|
|
|
def test_keeps_seats_and_the_security_pass_on_the_projects_rung_while_the_worker_runs_above_it(self):
|
|
|
|
|
opus = Rung("claude-opus-5-5", "medium")
|
|
|
|
|
above = prompts.fresh("Do it.", "## Goals", Route(Rung("claude-fable-5-2", "low"), 3, 3, 4), OPUS_PROJECT, self.FACTS)
|
|
|
|
|
stepped_up = prompts.resumed("", Route(Rung("claude-fable-5-2", "low"), 3, 3, 4), OPUS_PROJECT)
|
|
|
|
|
above = prompts.WORKER.fresh("Do it.", "## Goals", Route(Rung("claude-fable-5-2", "low"), 3, 3, 4), OPUS_PROJECT, self.FACTS)
|
|
|
|
|
stepped_up = prompts.WORKER.resumed("", Route(Rung("claude-fable-5-2", "low"), 3, 3, 4), OPUS_PROJECT)
|
|
|
|
|
self.assertIn(f"{prompts.ANSWERS_RECORDED}. {prompts.NAME_THE_ITEMS} loop-claude runs you on claude-fable-5-2 at low effort.{self.SEATS}{self.SCAN} Where an item you take into the chunk has an E + I of 6 or more, launch each reviewer with the Agent tool set to `model fable, effort medium` from 6, `model opus, effort xhigh` from 7 and `model fable, effort high` from 8.{self.MARKDOWN} When an escalation trigger", stepped_up)
|
|
|
|
|
self.assertNotIn("the project's", prompts.resumed("", Route(opus, 3, 2, 4), OPUS_PROJECT))
|
|
|
|
|
self.assertNotIn("runs you on", prompts.resumed("", Route(Rung("m")), None))
|
|
|
|
|
self.assertNotIn("the project's", prompts.WORKER.resumed("", Route(opus, 3, 2, 4), OPUS_PROJECT))
|
|
|
|
|
self.assertNotIn("runs you on", prompts.WORKER.resumed("", Route(Rung("m")), None))
|
|
|
|
|
self.assertIn(f"item 3's L of 3.{self.SEATS}{self.SCAN} Where an item you take into the chunk has an E + I of 6 or more, launch each reviewer with the Agent tool set to `model fable, effort medium` from 6, `model opus, effort xhigh` from 7 and `model fable, effort high` from 8.{self.MARKDOWN} When an escalation trigger", above)
|
|
|
|
|
|
|
|
|
|
def test_names_the_rungs_an_escalation_trigger_lets_the_worker_hand_a_task_to_at_most_two_above_its_items(self):
|
|
|
|
|
opus = Rung("claude-opus-5-5", "medium")
|
|
|
|
|
fresh = prompts.fresh("Do it.", "## Goals", Route(opus, 3, 2, 4), OPUS_PROJECT, self.FACTS)
|
|
|
|
|
fresh = prompts.WORKER.fresh("Do it.", "## Goals", Route(opus, 3, 2, 4), OPUS_PROJECT, self.FACTS)
|
|
|
|
|
self.assertIn("item 3's L of 2. Where an item you take into the chunk has an E + I of 5 or more, launch each reviewer with the Agent tool set to `model fable, effort low` from 5, `model fable, effort medium` from 6, `model opus, effort xhigh` from 7 and `model fable, effort high` from 8. When an escalation trigger in `~/.claude/CLAUDE.md` fires, hand the hard part of the task to a subagent with the Agent tool set to `model fable, effort low`, one rung above yours; above that, ask the human first. Open the subagent's prompt with `Escalation trigger <n>:`, n the trigger's number.", fresh)
|
|
|
|
|
self.assertIn(" When an escalation trigger in `~/.claude/CLAUDE.md` fires, hand the hard part of the task to a subagent with the Agent tool set to `model fable, effort medium`, one rung above yours, and on each further trigger one rung higher, up to `model opus, effort xhigh`; above that, ask the human first. Open the subagent's prompt with `Escalation trigger <n>:`, n the trigger's number.", prompts.resumed("", Route(Rung("claude-fable-5-2", "low"), 3, 3, 4), OPUS_PROJECT))
|
|
|
|
|
self.assertIn(" When an escalation trigger in `~/.claude/CLAUDE.md` fires, hand the hard part of the task to a subagent with the Agent tool set to `model opus, effort xhigh`, one rung above yours; above that, ask the human first. Open the subagent's prompt with `Escalation trigger <n>:`, n the trigger's number.", prompts.resumed("", Route(Rung("claude-fable-5-2", "medium"), 3, 3, 4), OPUS_PROJECT))
|
|
|
|
|
self.assertNotIn("escalation", prompts.resumed("", Route(Rung("claude-fable-5-2", "max"), 3, 4, 8), OPUS_PROJECT))
|
|
|
|
|
self.assertIn(" An escalation trigger in `~/.claude/CLAUDE.md` lets you hand the hard part of a task to a subagent with the Agent tool set to `model fable, effort high`, one rung above yours, only once the human agrees;", prompts.resumed("", Route(Rung("claude-opus-5-5", "xhigh"), 3, 3, 4), OPUS_PROJECT))
|
|
|
|
|
self.assertIn("set to `model fable, effort max`, one rung above yours, only once the human agrees;", prompts.resumed("", Route(Rung("claude-fable-5-2", "high"), 3, 4, 5), OPUS_PROJECT), "one rung below the top still names the rung above")
|
|
|
|
|
self.assertNotIn("rerun", prompts.resumed("", Route(Rung("claude-opus-5-5", "low"), 3, 3, 4), OPUS_PROJECT), "a worker off the ladder is told no rerun rung")
|
|
|
|
|
self.assertIn("hand the hard part of the task to a subagent with the Agent tool set to `model fable, effort high`, one rung above yours;", prompts.resumed("", Route(Rung("claude-opus-5-5", "xhigh"), 3, 4, 5), OPUS_PROJECT))
|
|
|
|
|
self.assertNotIn("escalation", prompts.resumed("", Route(Rung("m")), None))
|
|
|
|
|
self.assertNotIn("escalation", prompts.resumed("", Route(Rung("claude-opus-5-5", "low"), 3, 3, 4), OPUS_PROJECT))
|
|
|
|
|
self.assertIn(f"{prompts.READING_RULE} {prompts.NAME_THE_ITEMS}\n\nWhere an item you take into the chunk has an E + I of 5 or more, launch each reviewer with the Agent tool set to `model fable, effort low` from 5, `model fable, effort medium` from 6, `model opus, effort xhigh` from 7 and `model fable, effort high` from 8. When an escalation trigger in `~/.claude/CLAUDE.md` fires, hand the hard part of the task to a subagent with the Agent tool set to `model fable, effort low`, one rung above yours, and on each further trigger one rung higher, up to `model fable, effort medium`; above that, ask the human first. Open the subagent's prompt with `Escalation trigger <n>:`, n the trigger's number. Where the hard part is the rest of the chunk, end your run instead, asking loop-claude for a higher rung and naming a trigger that fired since your last step-up, if any: once the judge finds it in your transcript, the next cycle resumes you one rung up, up to `model fable, effort medium`. A reviewer", prompts.fresh("Do it.", "## Goals", Route(opus), OPUS_PROJECT, self.FACTS))
|
|
|
|
|
self.assertIn(" When an escalation trigger in `~/.claude/CLAUDE.md` fires, hand the hard part of the task to a subagent with the Agent tool set to `model fable, effort medium`, one rung above yours, and on each further trigger one rung higher, up to `model opus, effort xhigh`; above that, ask the human first. Open the subagent's prompt with `Escalation trigger <n>:`, n the trigger's number.", prompts.WORKER.resumed("", Route(Rung("claude-fable-5-2", "low"), 3, 3, 4), OPUS_PROJECT))
|
|
|
|
|
self.assertIn(" When an escalation trigger in `~/.claude/CLAUDE.md` fires, hand the hard part of the task to a subagent with the Agent tool set to `model opus, effort xhigh`, one rung above yours; above that, ask the human first. Open the subagent's prompt with `Escalation trigger <n>:`, n the trigger's number.", prompts.WORKER.resumed("", Route(Rung("claude-fable-5-2", "medium"), 3, 3, 4), OPUS_PROJECT))
|
|
|
|
|
self.assertNotIn("escalation", prompts.WORKER.resumed("", Route(Rung("claude-fable-5-2", "max"), 3, 4, 8), OPUS_PROJECT))
|
|
|
|
|
self.assertIn(" An escalation trigger in `~/.claude/CLAUDE.md` lets you hand the hard part of a task to a subagent with the Agent tool set to `model fable, effort high`, one rung above yours, only once the human agrees;", prompts.WORKER.resumed("", Route(Rung("claude-opus-5-5", "xhigh"), 3, 3, 4), OPUS_PROJECT))
|
|
|
|
|
self.assertIn("set to `model fable, effort max`, one rung above yours, only once the human agrees;", prompts.WORKER.resumed("", Route(Rung("claude-fable-5-2", "high"), 3, 4, 5), OPUS_PROJECT), "one rung below the top still names the rung above")
|
|
|
|
|
self.assertNotIn("rerun", prompts.WORKER.resumed("", Route(Rung("claude-opus-5-5", "low"), 3, 3, 4), OPUS_PROJECT), "a worker off the ladder is told no rerun rung")
|
|
|
|
|
self.assertIn("hand the hard part of the task to a subagent with the Agent tool set to `model fable, effort high`, one rung above yours;", prompts.WORKER.resumed("", Route(Rung("claude-opus-5-5", "xhigh"), 3, 4, 5), OPUS_PROJECT))
|
|
|
|
|
self.assertNotIn("escalation", prompts.WORKER.resumed("", Route(Rung("m")), None))
|
|
|
|
|
self.assertNotIn("escalation", prompts.WORKER.resumed("", Route(Rung("claude-opus-5-5", "low"), 3, 3, 4), OPUS_PROJECT))
|
|
|
|
|
self.assertIn(f"{prompts.READING_RULE} {prompts.NAME_THE_ITEMS}\n\nWhere an item you take into the chunk has an E + I of 5 or more, launch each reviewer with the Agent tool set to `model fable, effort low` from 5, `model fable, effort medium` from 6, `model opus, effort xhigh` from 7 and `model fable, effort high` from 8. When an escalation trigger in `~/.claude/CLAUDE.md` fires, hand the hard part of the task to a subagent with the Agent tool set to `model fable, effort low`, one rung above yours, and on each further trigger one rung higher, up to `model fable, effort medium`; above that, ask the human first. Open the subagent's prompt with `Escalation trigger <n>:`, n the trigger's number. Where the hard part is the rest of the chunk, end your run instead, asking loop-claude for a higher rung and naming a trigger that fired since your last step-up, if any: once the judge finds it in your transcript, the next cycle resumes you one rung up, up to `model fable, effort medium`. A reviewer", prompts.WORKER.fresh("Do it.", "## Goals", Route(opus), OPUS_PROJECT, self.FACTS))
|
|
|
|
|
|
|
|
|
|
def test_offers_the_worker_a_higher_rung_for_the_rest_of_the_chunk_up_to_the_escalation_cap(self):
|
|
|
|
|
opus = Rung("claude-opus-5-5", "medium")
|
|
|
|
|
offer = lambda cap: f" Where the hard part is the rest of the chunk, end your run instead, asking loop-claude for a higher rung and naming a trigger that fired since your last step-up, if any: once the judge finds it in your transcript, the next cycle resumes you one rung up, up to `{cap}`."
|
|
|
|
|
self.assertIn(f"`Escalation trigger <n>:`, n the trigger's number.{offer('model fable, effort low')}", prompts.fresh("Do it.", "## Goals", Route(opus, 3, 2, 4), OPUS_PROJECT, self.FACTS))
|
|
|
|
|
self.assertIn(f"`Escalation trigger <n>:`, n the trigger's number.{offer('model opus, effort xhigh')}", prompts.resumed("", Route(Rung("claude-fable-5-2", "low"), 3, 3, 4), OPUS_PROJECT))
|
|
|
|
|
self.assertNotIn("Where the hard part", prompts.resumed("", Route(Rung("claude-opus-5-5", "xhigh"), 3, 3, 4), OPUS_PROJECT))
|
|
|
|
|
self.assertIn(f"`Escalation trigger <n>:`, n the trigger's number.{offer('model fable, effort low')}", prompts.WORKER.fresh("Do it.", "## Goals", Route(opus, 3, 2, 4), OPUS_PROJECT, self.FACTS))
|
|
|
|
|
self.assertIn(f"`Escalation trigger <n>:`, n the trigger's number.{offer('model opus, effort xhigh')}", prompts.WORKER.resumed("", Route(Rung("claude-fable-5-2", "low"), 3, 3, 4), OPUS_PROJECT))
|
|
|
|
|
self.assertNotIn("Where the hard part", prompts.WORKER.resumed("", Route(Rung("claude-opus-5-5", "xhigh"), 3, 3, 4), OPUS_PROJECT))
|
|
|
|
|
|
|
|
|
|
def test_lets_a_markdown_only_branch_review_on_the_projects_rung_where_the_reviewers_run_above_it(self):
|
|
|
|
|
opus = Rung("claude-opus-5-5", "medium")
|
|
|
|
|
markdown = " Where your branch changes only Markdown, none of it `CLAUDE.md`, `AGENTS.md`, `workflow-bench/*-prompt.md` or under `agents/`, `principles/`, `rules/` or `skills/`, launch each reviewer on the project's rung instead, with the Agent tool set to model opus, effort medium."
|
|
|
|
|
self.assertIn(markdown, prompts.fresh("Do it.", "## Goals", Route(opus, 3, 2, 7), OPUS_PROJECT, self.FACTS))
|
|
|
|
|
self.assertIn(markdown, prompts.resumed("", Route(Rung("claude-fable-5-2", "low"), 3, 3, 4), OPUS_PROJECT))
|
|
|
|
|
self.assertNotIn("only Markdown", prompts.fresh("Do it.", "## Goals", Route(opus, 3, 2, 4), OPUS_PROJECT, self.FACTS))
|
|
|
|
|
self.assertIn(markdown, prompts.WORKER.fresh("Do it.", "## Goals", Route(opus, 3, 2, 7), OPUS_PROJECT, self.FACTS))
|
|
|
|
|
self.assertIn(markdown, prompts.WORKER.resumed("", Route(Rung("claude-fable-5-2", "low"), 3, 3, 4), OPUS_PROJECT))
|
|
|
|
|
self.assertNotIn("only Markdown", prompts.WORKER.fresh("Do it.", "## Goals", Route(opus, 3, 2, 4), OPUS_PROJECT, self.FACTS))
|
|
|
|
|
|
|
|
|
|
def test_names_the_rung_a_reviewer_or_seat_reruns_on_one_above_its_own(self):
|
|
|
|
|
opus = Rung("claude-opus-5-5", "medium")
|
|
|
|
|
both = " A reviewer or comprehension seat that asks for a rerun one rung up reruns with the Agent tool set to `model fable, effort low`."
|
|
|
|
|
self.assertTrue(prompts.resumed("", Route(opus, 3, 2, 4), OPUS_PROJECT).endswith(both))
|
|
|
|
|
self.assertTrue(prompts.resumed("", Route(Rung("claude-sonnet-5-5", "high"), 3, 2, 4), OPUS_PROJECT).endswith(both))
|
|
|
|
|
self.assertTrue(prompts.fresh("Do it.", "## Goals", Route(opus), OPUS_PROJECT, self.FACTS).split(f"\n\n{self.FACTS}")[0].endswith(both))
|
|
|
|
|
self.assertTrue(prompts.resumed("", Route(Rung("claude-fable-5-2", "low"), 3, 3, 4), OPUS_PROJECT).endswith(" A reviewer that asks for a rerun one rung up reruns with the Agent tool set to `model fable, effort medium`, and a comprehension seat with `model fable, effort low`."))
|
|
|
|
|
self.assertTrue(prompts.resumed("", Route(opus, 3, 2, 7), OPUS_PROJECT).endswith(" A reviewer that asks for a rerun one rung up reruns with the Agent tool set to `model fable, effort high`, and a comprehension seat with `model fable, effort low`."))
|
|
|
|
|
self.assertTrue(prompts.resumed("", Route(Rung("claude-fable-5-2", "max"), 3, 4, 8), OPUS_PROJECT).endswith(" A comprehension seat that asks for a rerun one rung up reruns with the Agent tool set to `model fable, effort low`."))
|
|
|
|
|
self.assertNotIn("rerun", prompts.resumed("", Route(Rung("m")), None))
|
|
|
|
|
self.assertNotIn("rerun", prompts.fresh("Do it.", "## Goals", Route(Rung("m", "high"), 3, 4, 5), None, self.FACTS))
|
|
|
|
|
self.assertIn(f"{both} After your first read", prompts.fresh("Do it.", "## Goals", Route(opus, 3, 2, 4), OPUS_PROJECT, self.FACTS))
|
|
|
|
|
self.assertTrue(prompts.WORKER.resumed("", Route(opus, 3, 2, 4), OPUS_PROJECT).endswith(both))
|
|
|
|
|
self.assertTrue(prompts.WORKER.resumed("", Route(Rung("claude-sonnet-5-5", "high"), 3, 2, 4), OPUS_PROJECT).endswith(both))
|
|
|
|
|
self.assertTrue(prompts.WORKER.fresh("Do it.", "## Goals", Route(opus), OPUS_PROJECT, self.FACTS).split(f"\n\n{self.FACTS}")[0].endswith(both))
|
|
|
|
|
self.assertTrue(prompts.WORKER.resumed("", Route(Rung("claude-fable-5-2", "low"), 3, 3, 4), OPUS_PROJECT).endswith(" A reviewer that asks for a rerun one rung up reruns with the Agent tool set to `model fable, effort medium`, and a comprehension seat with `model fable, effort low`."))
|
|
|
|
|
self.assertTrue(prompts.WORKER.resumed("", Route(opus, 3, 2, 7), OPUS_PROJECT).endswith(" A reviewer that asks for a rerun one rung up reruns with the Agent tool set to `model fable, effort high`, and a comprehension seat with `model fable, effort low`."))
|
|
|
|
|
self.assertTrue(prompts.WORKER.resumed("", Route(Rung("claude-fable-5-2", "max"), 3, 4, 8), OPUS_PROJECT).endswith(" A comprehension seat that asks for a rerun one rung up reruns with the Agent tool set to `model fable, effort low`."))
|
|
|
|
|
self.assertNotIn("rerun", prompts.WORKER.resumed("", Route(Rung("m")), None))
|
|
|
|
|
self.assertNotIn("rerun", prompts.WORKER.fresh("Do it.", "## Goals", Route(Rung("m", "high"), 3, 4, 5), None, self.FACTS))
|
|
|
|
|
self.assertIn(f"{both} After your first read", prompts.WORKER.fresh("Do it.", "## Goals", Route(opus, 3, 2, 4), OPUS_PROJECT, self.FACTS))
|
|
|
|
|
fable = Rung("claude-fable-5-2", "max")
|
|
|
|
|
self.assertNotIn("rerun", prompts.resumed("", Route(fable), ProjectRung(LADDER, fable)))
|
|
|
|
|
self.assertNotIn("rerun", prompts.WORKER.resumed("", Route(fable), ProjectRung(LADDER, fable)))
|
|
|
|
|
|
|
|
|
|
def test_opens_a_fresh_session_by_name_and_resumes_an_open_one(self):
|
|
|
|
|
opened = session.session_named("A proj loop-claude", pathlib.Path("/h/.claude/projects"))
|
|
|
|
|
fresh = worker.worker_args(opened, Rung("m"), prompts.fresh("Do it.", "## Goals\n1. g\n\n## Audience\nme", Route(Rung("m")), None, self.FACTS), resume=False)
|
|
|
|
|
fresh = worker.worker_args(opened, Rung("m"), prompts.WORKER.fresh("Do it.", "## Goals\n1. g\n\n## Audience\nme", Route(Rung("m")), None, self.FACTS), resume=False)
|
|
|
|
|
self.assertEqual(fresh[fresh.index("--session-id") + 1], str(opened.id))
|
|
|
|
|
self.assertEqual(fresh[fresh.index("--name") + 1], "A proj loop-claude")
|
|
|
|
|
resumed = worker.worker_args(opened, Rung("m"), prompts.resumed("", Route(Rung("m")), None), resume=True)
|
|
|
|
|
resumed = worker.worker_args(opened, Rung("m"), prompts.WORKER.resumed("", Route(Rung("m")), None), resume=True)
|
|
|
|
|
self.assertEqual(resumed[resumed.index("--resume") + 1], str(opened.id))
|
|
|
|
|
self.assertNotIn("--session-id", resumed)
|
|
|
|
|
self.assertTrue(resumed[resumed.index("-p") + 1].startswith("Continue the task; the previous run ended before the chunk was finished. The chunk is finished once"))
|
|
|
|
@@ -1924,7 +1924,7 @@ class Records(unittest.TestCase):
|
|
|
|
|
class JudgePrompt(unittest.TestCase):
|
|
|
|
|
def test_shows_the_transcripts_tail_and_returns_what_it_showed(self):
|
|
|
|
|
entries = [assistant({"type": "text", "text": "old " + "x" * judge.JUDGE_PROMPT_CHARS}), assistant({"type": "text", "text": "new"})]
|
|
|
|
|
prompt, grounds = judge.judge_prompt(judge.Brief("Do it.", "## Goals", "", prompts.ANSWER_DESTINATIONS, kinds(*entries), 0))
|
|
|
|
|
prompt, grounds = judge.judge_prompt(judge.Brief("Do it.", "## Goals", "", prompts.ANSWER_DESTINATIONS, kinds(*entries), 0, prompts.DRIVER))
|
|
|
|
|
self.assertTrue(grounds.shown.endswith("\n\nnew"))
|
|
|
|
|
self.assertNotIn("old", grounds.shown)
|
|
|
|
|
self.assertIn(grounds.shown, prompt)
|
|
|
|
@@ -1933,11 +1933,11 @@ class JudgePrompt(unittest.TestCase):
|
|
|
|
|
self.assertEqual(grounds.quotable, "## Goals\n\n")
|
|
|
|
|
|
|
|
|
|
def test_the_judge_prompt_and_schema_call_the_worker_the_worker(self):
|
|
|
|
|
prompt, _ = judge.judge_prompt(judge.Brief("Do it.", "## Goals", "", prompts.ANSWER_DESTINATIONS, kinds(assistant({"type": "text", "text": "done"})), 1))
|
|
|
|
|
self.assertNotRegex(prompt + json.dumps(judge.JUDGE_SCHEMA), r"\b[Aa]gent")
|
|
|
|
|
prompt, _ = judge.judge_prompt(judge.Brief("Do it.", "## Goals", "", prompts.ANSWER_DESTINATIONS, kinds(assistant({"type": "text", "text": "done"})), 1, prompts.DRIVER))
|
|
|
|
|
self.assertNotRegex(prompt + json.dumps(judge.judge_schema(prompts.DRIVER)), r"\b[Aa]gent")
|
|
|
|
|
|
|
|
|
|
def test_the_judge_prompt_names_the_entry_points_answer_destinations_in_both_rules_on_a_recorded_answer(self):
|
|
|
|
|
prompt, _ = judge.judge_prompt(judge.Brief("Do it.", "## Goals", "", "the ledger", kinds(assistant({"type": "text", "text": "done"})), 0))
|
|
|
|
|
prompt, _ = judge.judge_prompt(judge.Brief("Do it.", "## Goals", "", "the ledger", kinds(assistant({"type": "text", "text": "done"})), 0, prompts.DRIVER))
|
|
|
|
|
self.assertIn("is recorded in the ledger at the one place it governs", prompt)
|
|
|
|
|
self.assertIn("the worker writing it into the ledger, but not into one of the human's rules", prompt)
|
|
|
|
|
|
|
|
|
@@ -1946,28 +1946,28 @@ class JudgePrompt(unittest.TestCase):
|
|
|
|
|
self.assertIn("is recorded in the ledger at the one place it governs.", ledger.typed("Which one?", "Use B.", Route(Rung("worker-model")), None, False))
|
|
|
|
|
|
|
|
|
|
def test_the_judge_prompt_names_every_rule_the_judge_reads_from_the_human(self):
|
|
|
|
|
self.assertEqual([name for name in records.HUMAN_RULE_NAMES if name not in judge.judge_rules(prompts.ANSWER_DESTINATIONS)], [])
|
|
|
|
|
self.assertEqual([name for name in records.HUMAN_RULE_NAMES if name not in judge.judge_rules(prompts.ANSWER_DESTINATIONS, prompts.DRIVER)], [])
|
|
|
|
|
|
|
|
|
|
def test_shows_the_judge_where_the_worker_last_stepped_up_and_checks_an_escalation_only_after_it(self):
|
|
|
|
|
entries = [assistant({"type": "text", "text": "round 2: 🔴"}), assistant({"type": "text", "text": "round 3: 🔴"})]
|
|
|
|
|
prompt, grounds = judge.judge_prompt(judge.Brief("Do it.", "## Goals", "", prompts.ANSWER_DESTINATIONS, kinds(*entries), 1))
|
|
|
|
|
prompt, grounds = judge.judge_prompt(judge.Brief("Do it.", "## Goals", "", prompts.ANSWER_DESTINATIONS, kinds(*entries), 1, prompts.DRIVER))
|
|
|
|
|
self.assertRegex(prompt, "round 2: 🔴\n\n\\[step\\] [^\n]+\n\nround 3: 🔴\n\n")
|
|
|
|
|
self.assertEqual(grounds.after_mark, "round 3: 🔴")
|
|
|
|
|
prompt, grounds = judge.judge_prompt(judge.Brief("Do it.", "## Goals", "", prompts.ANSWER_DESTINATIONS, kinds(*entries), 0))
|
|
|
|
|
prompt, grounds = judge.judge_prompt(judge.Brief("Do it.", "## Goals", "", prompts.ANSWER_DESTINATIONS, kinds(*entries), 0, prompts.DRIVER))
|
|
|
|
|
self.assertNotIn("stepped the worker up", prompt)
|
|
|
|
|
self.assertEqual(grounds.shown, "round 2: 🔴\n\nround 3: 🔴")
|
|
|
|
|
self.assertEqual(grounds.after_mark, "round 2: 🔴\n\nround 3: 🔴")
|
|
|
|
|
|
|
|
|
|
def test_drops_an_escalation_quote_from_after_the_step_up_that_the_tail_it_shows_cuts_off(self):
|
|
|
|
|
entries = [assistant({"type": "text", "text": "round 2: 🔴"}), assistant({"type": "text", "text": "old " + "x" * judge.JUDGE_PROMPT_CHARS}), assistant({"type": "text", "text": "new"})]
|
|
|
|
|
_, grounds = judge.judge_prompt(judge.Brief("Do it.", "## Goals", "", prompts.ANSWER_DESTINATIONS, kinds(*entries), 1))
|
|
|
|
|
_, grounds = judge.judge_prompt(judge.Brief("Do it.", "## Goals", "", prompts.ANSWER_DESTINATIONS, kinds(*entries), 1, prompts.DRIVER))
|
|
|
|
|
self.assertEqual(judge.quotes_checked(Unfinished("e", "old x", entries_read=3), grounds), Unfinished("e", entries_read=3))
|
|
|
|
|
self.assertEqual(judge.quotes_checked(Unfinished("e", "new", entries_read=3), grounds), Unfinished("e", "new", entries_read=3))
|
|
|
|
|
|
|
|
|
|
def test_shows_a_typed_answer_before_the_step_up_as_the_humans(self):
|
|
|
|
|
typed = prompts.WORKER.typed("Which one?", "Use B.", Route(Rung("worker-model")), None, False)
|
|
|
|
|
entries = [{**human(typed), "promptSource": "sdk"}, assistant({"type": "text", "text": "round 3: 🔴"})]
|
|
|
|
|
_, grounds = judge.judge_prompt(judge.Brief("Do it.", "## Goals", "", prompts.ANSWER_DESTINATIONS, kinds(*entries), 1))
|
|
|
|
|
_, grounds = judge.judge_prompt(judge.Brief("Do it.", "## Goals", "", prompts.ANSWER_DESTINATIONS, kinds(*entries), 1, prompts.DRIVER))
|
|
|
|
|
self.assertIn("\n\n[human] Use B.\n\n[step] ", grounds.shown)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -2105,7 +2105,7 @@ class ChunkItems(unittest.TestCase):
|
|
|
|
|
self.assertEqual(chunk_items.named([said(example)]), (297, 298))
|
|
|
|
|
|
|
|
|
|
def test_every_prompt_that_starts_or_resumes_a_chunk_asks_for_the_line(self):
|
|
|
|
|
self.assertIn("on one line, as in `Chunk items: ", prompts.resumed("", Route(Rung("m")), None))
|
|
|
|
|
self.assertIn("on one line, as in `Chunk items: ", prompts.WORKER.resumed("", Route(Rung("m")), None))
|
|
|
|
|
|
|
|
|
|
def test_reads_only_a_line_the_worker_opens_with_the_label_in_its_own_text(self):
|
|
|
|
|
prompt = entries.LoopPrompt(text="Chunk items: 297 (L 3, E + I 5)")
|
|
|
|
@@ -2194,7 +2194,7 @@ class Verdict(unittest.TestCase):
|
|
|
|
|
def test_drops_an_escalation_quote_found_only_in_the_transcript_entries_before_the_workers_last_step_up(self):
|
|
|
|
|
entries = [assistant({"type": "text", "text": "round 2: 🔴"}), assistant({"type": "text", "text": "round 3: 🔴"}), assistant({"type": "text", "text": "working"})]
|
|
|
|
|
def judged_on(mark, escalation):
|
|
|
|
|
return judge.judge_once("/r", judge.Brief("Do it.", "## Goals", "", prompts.ANSWER_DESTINATIONS, kinds(*entries), mark), Rung("judge-model"), FakeEffects(claude=[judged("unfinished", escalation=escalation)]).effects())
|
|
|
|
|
return judge.judge_once("/r", judge.Brief("Do it.", "## Goals", "", prompts.ANSWER_DESTINATIONS, kinds(*entries), mark, prompts.DRIVER), Rung("judge-model"), FakeEffects(claude=[judged("unfinished", escalation=escalation)]).effects())
|
|
|
|
|
self.assertEqual(judged_on(0, "round 2: 🔴"), Unfinished("working", "round 2: 🔴", entries_read=3))
|
|
|
|
|
self.assertEqual(judged_on(1, "round 2: 🔴"), Unfinished("working", entries_read=3))
|
|
|
|
|
self.assertEqual(judged_on(1, "round 3: 🔴"), Unfinished("working", "round 3: 🔴", entries_read=3))
|
|
|
|
@@ -2203,12 +2203,12 @@ class Verdict(unittest.TestCase):
|
|
|
|
|
|
|
|
|
|
def test_drops_an_escalation_quote_that_only_loop_claudes_prompts_or_the_humans_lines_repeat_after_the_step_up(self):
|
|
|
|
|
entries = [assistant({"type": "text", "text": "round 2: 🔴"}), {**human("as the work remaining: round 2: 🔴"), "promptSource": "sdk"}, human("round 2: 🔴 again"), assistant({"type": "text", "text": "working"})]
|
|
|
|
|
verdict = judge.judge_once("/r", judge.Brief("Do it.", "## Goals", "", prompts.ANSWER_DESTINATIONS, kinds(*entries), 1), Rung("judge-model"), FakeEffects(claude=[judged("unfinished", escalation="round 2: 🔴")]).effects())
|
|
|
|
|
verdict = judge.judge_once("/r", judge.Brief("Do it.", "## Goals", "", prompts.ANSWER_DESTINATIONS, kinds(*entries), 1, prompts.DRIVER), Rung("judge-model"), FakeEffects(claude=[judged("unfinished", escalation="round 2: 🔴")]).effects())
|
|
|
|
|
self.assertEqual(verdict, Unfinished("working", entries_read=4))
|
|
|
|
|
|
|
|
|
|
def test_takes_evidence_from_before_the_workers_last_step_up(self):
|
|
|
|
|
entries = [assistant({"type": "text", "text": "round 2: 🔴"}), assistant({"type": "text", "text": "working"})]
|
|
|
|
|
verdict = judge.judge_once("/r", judge.Brief("Do it.", "## Goals", "", prompts.ANSWER_DESTINATIONS, kinds(*entries), 1), Rung("judge-model"), FakeEffects(claude=[judged("unfinished", evidence="round 2: 🔴")]).effects())
|
|
|
|
|
verdict = judge.judge_once("/r", judge.Brief("Do it.", "## Goals", "", prompts.ANSWER_DESTINATIONS, kinds(*entries), 1, prompts.DRIVER), Rung("judge-model"), FakeEffects(claude=[judged("unfinished", evidence="round 2: 🔴")]).effects())
|
|
|
|
|
self.assertEqual(verdict, Unfinished("round 2: 🔴", entries_read=2))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|