Answer principles round 1: 1 🔴, 6 🟡 (0 misread); end the AGENTS.md decision with item 585, send the routing calls once where no development clone exists, and file five principle findings as items 591 to 595
This commit is contained in:
@@ -55,22 +55,27 @@ def new_calls(root: pathlib.Path, paths: Paths, env: Mapping[str, str], effects:
|
||||
|
||||
|
||||
def raise_calls(root: pathlib.Path, new: list[Call], rung: Rung, loop: Loop) -> Stop | None:
|
||||
"""Puts the calls to the human through a claude in this setup's development clone, where the routing decision is changed. Off a terminal, or on a machine without that clone, they are only said, and stay in the figures, raised at the next measurement that has both."""
|
||||
"""Puts the calls to the human through a claude in this setup's development clone, where the routing decision is changed. Off a terminal they are only said, and stay in the figures, raised at the next measurement on one. On a machine without that clone they are said and sent as the DM, the only way that machine has to put them to the human, and marked raised, so they are not sent again every measurement."""
|
||||
bullets = "".join(f"- {call.sentence()}\n" for call in new)
|
||||
question = f"build-release's routing figures call for a routing change:\n{bullets}The figures: {root / archive.FIGURES}"
|
||||
say(f"\n{question}", loop.effects)
|
||||
tell(f"build-release in {loop.root} asks:\n\n{question}", loop.effects)
|
||||
if not loop.paths.config_clone.is_dir():
|
||||
say(f"No development clone at {loop.paths.config_clone}, where the routing decision is changed: the calls stay in the figures.", loop.effects)
|
||||
keep_raised(root, new, loop)
|
||||
return None
|
||||
if not loop.effects.on_terminal():
|
||||
say("Not on a terminal: the calls are raised again at the next measurement.", loop.effects)
|
||||
return None
|
||||
if not loop.paths.config_clone.is_dir():
|
||||
say(f"No development clone at {loop.paths.config_clone}: the calls are raised again at the next measurement.", loop.effects)
|
||||
return None
|
||||
prompt = f"Put these calls for a routing change from build-release's figures to the human, and don't change anything until they answer:\n{bullets}The figures are in {root / archive.FIGURES}. The ladder, its steps and the delegation rule are docs/decisions.md → `routing:`, and a change to them is the human's. Record what they decide in this checkout, the development clone, as the setup's CLAUDE.md says; the next chunk of this repo files the plan item for these calls."
|
||||
unstarted = hand_over(ClaudeCommand(claude_args(rung, [prompt]), str(loop.paths.config_clone), {}), loop.effects)
|
||||
if unstarted:
|
||||
return Stop(1, f"could not start claude for the routing calls in {loop.paths.config_clone}, the setup's development clone: {unstarted.reason}")
|
||||
# Raised once the human has seen them, answered or not: an unanswered call reaches the plan through docs/decisions.md → "Working rules", so it is not asked twice.
|
||||
keep_raised(root, new, loop)
|
||||
return None
|
||||
|
||||
|
||||
def keep_raised(root: pathlib.Path, new: list[Call], loop: Loop) -> None:
|
||||
"""Raised once the human has seen them, answered or not: an unanswered call reaches the plan through docs/decisions.md → "Working rules", so it is not asked twice. Without a development clone the DM is how they saw them."""
|
||||
if unmarked := state.mark_raised(root, new, utc(loop.effects.now()), loop.effects.replace_file):
|
||||
say(f"routing figures: {unmarked.reason}", loop.effects)
|
||||
return None
|
||||
|
||||
@@ -117,17 +117,22 @@ class RoutingCheck(unittest.TestCase):
|
||||
self.assertIsNone(state.mark_measured(self.root, 0))
|
||||
self.assertIn("Not on a terminal", self.check(FakeEffects(on_terminal=False, git=[UNREAD] * 3))[1])
|
||||
|
||||
def test_goes_on_where_the_machine_has_no_development_clone_and_raises_the_call_again_next_time(self):
|
||||
"""A release's clone holds only a release, so a machine without `~/code/dev-factory` has nowhere to change the routing decision."""
|
||||
def test_sends_the_calls_once_where_the_machine_has_no_development_clone_even_off_a_terminal(self):
|
||||
"""A release's clone holds only a release, so a machine without `~/code/dev-factory` has nowhere to change the routing decision: the DM is how the human sees the calls, and they are not sent again at each measurement."""
|
||||
self.chunks(5, 4)
|
||||
shutil.rmtree(self.paths.config_clone)
|
||||
fake = FakeEffects(on_terminal_claude=[0], git=[UNREAD] * 3)
|
||||
fake = FakeEffects(on_terminal=False, git=[UNREAD] * 3)
|
||||
stop, said = self.check(fake)
|
||||
self.assertIsNone(stop)
|
||||
self.assertEqual(fake.made("claude_on_terminal"), [])
|
||||
self.assertIn(f"No development clone at {self.paths.config_clone}: the calls are raised again at the next measurement.", said)
|
||||
self.assertIn(f"No development clone at {self.paths.config_clone}, where the routing decision is changed: the calls stay in the figures.", said)
|
||||
self.assertEqual(len(fake.dms), 1)
|
||||
self.assertIn("Explore subagents' reports took more of the worker's context", (self.root / "routing-figures.md").read_text())
|
||||
self.assertFalse((self.root / "routing-calls-raised.md").exists())
|
||||
self.assertIn(f"- {utc(NOW)} Explore subagents'", (self.root / "routing-calls-raised.md").read_text())
|
||||
self.assertIsNone(state.mark_measured(self.root, 0))
|
||||
again = FakeEffects(on_terminal=False, git=[UNREAD] * 3)
|
||||
self.assertEqual(self.check(again), (None, ""))
|
||||
self.assertEqual(again.dms, [])
|
||||
|
||||
def test_leaves_the_measuring_to_a_loop_holding_the_lock(self):
|
||||
self.chunks(5, 4)
|
||||
|
||||
Reference in New Issue
Block a user