Run every claude the loop starts in a Claude home generated outside the clone
CI / tests (pull_request) Successful in 4m45s

This commit is contained in:
2026-12-04 01:07:03 +01:00
parent 2460b9e132
commit 0203a8e0b3
48 changed files with 703 additions and 369 deletions
+3 -3
View File
@@ -122,9 +122,9 @@ def run(argv: list[str], env: typing.Mapping[str, str], paths: Paths, launcher:
return Stop(0 if words in (["-h"], ["--help"]) else 1, HELP)
if writes or closes:
return epic_written(words[0], writes, paths, env, backend, stdin)
# Before anything starts: a clone, a claude session or a tmux window.
if not dry_run_asked and (reason := tmux.unusable(effects.tmux, chunk_prompt.DRIVER)):
return Stop(1, reason)
# Before anything starts: a clone, a claude session or a tmux window. One stop names everything that is the person's to do. A dry run opens no window, but its planning runs claude.
if needs := [reason for reason in (None if dry_run_asked else tmux.unusable(effects.tmux, chunk_prompt.DRIVER), effects.claude_home()) if reason]:
return Stop(1, "\n".join(needs))
config = load(paths.home, env)
if isinstance(config, Failure):
return Stop(1, config.reason)
+18 -2
View File
@@ -139,6 +139,22 @@ class TheCommand(BuildEpicTest):
self.assertEqual(code, 1)
self.assertIn("build-epic runs each chunk in a tmux window, and needs tmux 3.2 or later; it found tmux 3.1", err)
def test_refuses_until_a_claude_can_run_in_the_loops_claude_home_and_names_all_that_is_the_persons_at_once(self) -> None:
fake = FakeEffects(tmux_version="tmux 3.1")
fake.home_unready = "nobody is signed in"
code, _, err = self.run_main(["ABC-12"], fake)
self.assertEqual(code, 1)
self.assertIn("it found tmux 3.1\nnobody is signed in\n", err)
self.assertEqual(fake.calls, [])
def test_a_dry_run_too_refuses_until_a_claude_can_run_in_the_loops_claude_home(self) -> None:
fake = FakeEffects(on_terminal=False, tmux_version="")
fake.home_unready = "nobody is signed in"
code, _, err = self.run_main(["ABC-12", "--dry-run"], fake)
self.assertEqual(code, 1)
self.assertIn("nobody is signed in\n", err)
self.assertNotIn("tmux", err)
def test_starts_the_chunks_and_says_why_each_other_issue_waits(self) -> None:
fake = FakeEffects(on_terminal=False)
code, out, _ = self.run_main(["ABC-12"], fake, {"BUILD_RELEASE_WORKER_MODEL": "m"})
@@ -247,8 +263,8 @@ class ACycleOfAChunkWithoutARepo(BuildEpicTest):
def test_the_records_are_the_epics_scoring_and_decisions_then_the_humans_rules(self) -> None:
self.description = DESCRIPTION + "\n## Scoring\nE + I, bar 4.\n\n## Decisions\n### Merges squash\nAlways.\n"
(self.home / ".claude").mkdir()
(self.home / ".claude/CLAUDE.md").write_text("# Global\n", encoding="utf-8")
(self.home / ".local" / "share" / "build-release" / "claude-home").mkdir(parents=True)
(self.home / ".local" / "share" / "build-release" / "claude-home" / "CLAUDE.md").write_text("# Global\n", encoding="utf-8")
self.assertEqual(self.cycle().records, "From the epic ABC-12's description, ## Scoring:\nE + I, bar 4.\n\nFrom the epic ABC-12's description, ## Decisions:\n### Merges squash\nAlways.\n\nFrom ~/.claude/CLAUDE.md:\n# Global")
def test_stops_where_a_section_of_the_epics_records_cannot_be_read(self) -> None: