From 6f2d22dff6ba75a9077a1c58838120ac660b0499 Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Fri, 4 Dec 2026 10:57:50 +0100 Subject: [PATCH] =?UTF-8?q?Answer=20stability=20round=201:=200=20?= =?UTF-8?q?=F0=9F=94=B4,=201=20=F0=9F=9F=A1=20(0=20misread);=20mark=20the?= =?UTF-8?q?=20routing=20calls=20raised=20only=20where=20the=20DM=20went=20?= =?UTF-8?q?out?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bin/build_release/loop/routing_check.py | 13 ++++++++----- bin/build_release/loop/test_routing_check.py | 11 ++++++++++- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/bin/build_release/loop/routing_check.py b/bin/build_release/loop/routing_check.py index 87ac395c..c393310e 100644 --- a/bin/build_release/loop/routing_check.py +++ b/bin/build_release/loop/routing_check.py @@ -55,14 +55,17 @@ 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 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.""" + """Says each call on stderr and DMs it, then puts it to the human through a claude in this setup's development clone, where the routing decision is changed. Off a terminal it stays unraised and comes again at the next measurement on one. A machine without that clone has no way to change the decision, so a DM that went out is the last word there and marks the calls raised; one that didn't go out leaves them to come again.""" 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) + sent = 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) + if sent: + say(f"No development clone at {loop.paths.config_clone}, where the routing decision is changed: the calls above are all this machine puts to you, and they are not raised again.", loop.effects) + keep_raised(root, new, loop) + else: + say(f"No development clone at {loop.paths.config_clone}, where the routing decision is changed, and the DM didn't go out: the calls are raised again at the next measurement.", loop.effects) return None if not loop.effects.on_terminal(): say("Not on a terminal: the calls are raised again at the next measurement.", loop.effects) @@ -76,6 +79,6 @@ def raise_calls(root: pathlib.Path, new: list[Call], rung: Rung, loop: Loop) -> 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.""" + """Marks the calls raised once they have been put to the human, answered or not: an unanswered call reaches the plan through docs/decisions.md → "Working rules", so it is not asked twice.""" if unmarked := state.mark_raised(root, new, utc(loop.effects.now()), loop.effects.replace_file): say(f"routing figures: {unmarked.reason}", loop.effects) diff --git a/bin/build_release/loop/test_routing_check.py b/bin/build_release/loop/test_routing_check.py index 141fc329..8a35e41b 100644 --- a/bin/build_release/loop/test_routing_check.py +++ b/bin/build_release/loop/test_routing_check.py @@ -125,7 +125,7 @@ class RoutingCheck(unittest.TestCase): 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}, where the routing decision is changed: the calls stay in the figures.", said) + self.assertIn(f"No development clone at {self.paths.config_clone}, where the routing decision is changed: the calls above are all this machine puts to you, and they are not raised again.", 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.assertIn(f"- {utc(NOW)} Explore subagents'", (self.root / "routing-calls-raised.md").read_text()) @@ -134,6 +134,15 @@ class RoutingCheck(unittest.TestCase): self.assertEqual(self.check(again), (None, "")) self.assertEqual(again.dms, []) + def test_raises_the_calls_again_where_there_is_no_development_clone_and_the_dm_did_not_go_out(self): + self.chunks(5, 4) + shutil.rmtree(self.paths.config_clone) + stop, said = self.check(FakeEffects(git=[UNREAD] * 3, dm_failures=[Failure("no route")])) + self.assertIsNone(stop) + self.assertIn("could not DM you: no route", said) + self.assertIn("and the DM didn't go out: the calls are raised again at the next measurement.", said) + self.assertFalse((self.root / "routing-calls-raised.md").exists()) + def test_leaves_the_measuring_to_a_loop_holding_the_lock(self): self.chunks(5, 4) with archive.locked(self.root):