Answer stability round 1: 1 🔴, 6 🟡 (2 misread); read the scoring rule from the clone, hand windows XDG_DATA_HOME, retry the home check where nobody watches, tell an unreadable sign-in status and settings file apart, and bound the claude commands that build the home
CI / tests (pull_request) Successful in 4m35s

This commit is contained in:
2026-12-04 02:45:02 +01:00
parent 71865e0479
commit 3519922f01
19 changed files with 153 additions and 69 deletions
+12
View File
@@ -263,6 +263,18 @@ class WindowStarts(unittest.TestCase):
self.assertEqual(self.run_loop(["--chunk", "item-3", "do it"], fake)[0], Stop(1, "--chunk is how build-release starts itself in a tmux window; run build-release <task>"))
self.assertEqual(self.asked, [])
def test_a_window_loop_retries_a_failed_check_of_the_loops_claude_home_as_a_failed_worker_run_is(self):
# Nobody watches a window, and a claude that Claude Code's updater repoints fails for a moment.
for answers, stop in ((["could not build it", None], Stop(1, "--chunk is how build-release starts itself in a tmux window; run build-release <task>")), (["could not build it"] * 3, Stop(1, "the check of the loop's Claude home failed three times running: could not build it"))):
with self.subTest(stop=stop):
fake = FakeEffects(git=["/r\n"])
effects = dataclasses.replace(fake.effects(), claude_home=lambda: answers.pop(0))
with contextlib.redirect_stdout(io.StringIO()), contextlib.redirect_stderr(io.StringIO()) as said:
self.assertEqual(main.run_loop(["--chunk", "item-3", "do it"], {}, paths.paths_from(self.HOME, {}), pathlib.Path("/b/build-release"), CWD, effects, steps(self.fail)), stop)
self.assertEqual(answers, [])
self.assertIn(f"{STAMP} retrying the check of the loop's Claude home in a minute: could not build it\n", said.getvalue())
self.assertIn(("sleep", 60), fake.calls)
def test_reads_the_chunk_a_window_loop_is_started_with(self):
self.assertEqual(main.loop_run_from(["--chunk", "item-3", "do", "it"], CWD, FakeEffects(git=["/r\n"]).effects()), main.LoopRun(0, "/r", "do it", "", chunk="item-3"))
self.assertEqual(main.loop_run_from(["do", "it"], CWD, FakeEffects(git=["/r\n"]).effects()), main.LoopRun(0, "/r", "do it", ""))