From 3d4de11a955f53ff044b410501ba3abad126eb36 Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Thu, 19 Nov 2026 02:17:33 +0100 Subject: [PATCH 01/10] Record the reading cost of the last chunks --- docs/reading-cost.md | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/docs/reading-cost.md b/docs/reading-cost.md index 75c80cc7..3c0fa85b 100644 --- a/docs/reading-cost.md +++ b/docs/reading-cost.md @@ -2958,3 +2958,31 @@ Read most (opens and searches): - `bin/do_epic/scheduler.py` 1 - `bin/plan_store/jira_epic.py` 1 - `bin/release_plan/release_standing.py` 1 + +## Reading cost, chunk 9d8a10bb5ed7, finished 2026-11-19T00:37:04Z + +53622 new input tokens before the first commit. + +Read most (opens and searches): + +- `README.md` 7 +- `bin/do_epic/config.py` 1 +- `bin/do_epic/repo_pick.py` 1 +- `docs/decisions.md` 1 + +## Reading cost, chunk e4c3a22f3b31, finished 2026-11-19T01:15:27Z + +106760 new input tokens before the first commit. + +Read most (opens and searches): + +- `bin/do_epic/test_main.py` 7 +- `bin/do_epic/main.py` 4 +- `README.md` 3 +- `bin/do_epic/backend/contract.py` 3 +- `bin/do_epic/backend/test_jira.py` 3 +- `CHANGELOG.md` 2 +- `bin/do_epic/backend/jira.py` 2 +- `bin/do_epic/backend/test_fake.py` 2 +- `bin/do_epic/chunk_prompt.py` 2 +- `bin/plan_store/jira_epic.py` 2 -- 2.52.0 From b845d80ac7e50998fead9a50ea3b1bd7b26c06ea Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Thu, 19 Nov 2026 02:17:33 +0100 Subject: [PATCH 02/10] Tell an epic chunk's worker how its repo ships a change, and bound the interrupt test's helper shell --- bin/do_epic/chunk_prompt.py | 15 ++++++++++++--- bin/do_epic/main.py | 6 +++++- bin/do_epic/test_main.py | 1 + bin/do_epic/test_scheduler.py | 11 ++++++++++- bin/mutate_changes/test_mutate_changes.py | 3 ++- 5 files changed, 30 insertions(+), 6 deletions(-) diff --git a/bin/do_epic/chunk_prompt.py b/bin/do_epic/chunk_prompt.py index 2d1f08fa..a94f7adf 100644 --- a/bin/do_epic/chunk_prompt.py +++ b/bin/do_epic/chunk_prompt.py @@ -7,6 +7,7 @@ from loop_claude.project.records import HUMAN_RULE_NAMES, RECORD_FILES from text_files.markdown_text import listed import pathlib from model_routing.ladder import ProjectRung +from project_config.settings import ProjectConfig from loop_claude.cycle import prompts from model_routing.route import Route from agent_cycle.worker_prompts import WorkerPrompts @@ -15,10 +16,18 @@ from agent_cycle.worker_prompts import WorkerPrompts DRIVER = "do-epic" -def task(issue: EpicIssue, epic: str, checkout: str | None, launcher: pathlib.Path, language: str) -> str: - """The task of the chunk that works issue, of the epic with the key epic: in checkout, or without a repo where it is None. launcher is the do-epic that runs the chunk, and language the one the epic's Jira text is in.""" +def shipping(config: ProjectConfig) -> str: + """How a chunk in the repo that config names ships its change. An epic's issue is no item of the repo's plan, so the worker finishes none: its bullet, where the repo has a changelog to put one in, is its own to write (docs/decisions.md → `do-epic: drives one Jira epic …`, "Releases").""" + opening = "The issue is no item of the repo's plan, so give `chunk-pr merge` no `--finish`." + if config.epic: + return f"{opening} The repo's plan is a Jira epic, whose issues' history is its changelog, so write no changelog bullet." + return f"{opening} Where the repo publishes something others consume, ship the change with one bullet for its users under `## Unreleased` in {config.places['changelog']}, added in the branch; otherwise write none." + + +def task(issue: EpicIssue, epic: str, checkout: str | None, launcher: pathlib.Path, language: str, shipped: str) -> str: + """The task of the chunk that works issue, of the epic with the key epic: in checkout, or without a repo where it is None. launcher is the do-epic that runs the chunk, language the one the epic's Jira text is in, and shipped how the chunk ships its change, which `shipping` words for a chunk in a repo and is empty without one.""" where = f"in the checkout {checkout}, on the branch {issue.key}" if checkout else "which changes no repo: work in the folder you start in" - return f"Work the Jira issue {issue.key} of the epic {epic} as one chunk, {where}. {findings.instructions(epic, launcher, language)} Its summary: {issue.summary}" + (f"\n\nIts description:\n\n{issue.detail}" if issue.detail else "") + return f"Work the Jira issue {issue.key} of the epic {epic} as one chunk, {where}. {findings.instructions(epic, launcher, language)}{f' {shipped}' if shipped else ''} Its summary: {issue.summary}" + (f"\n\nIts description:\n\n{issue.detail}" if issue.detail else "") CODE_HEALTH = '~/.claude/CLAUDE.md → "Shared goal"' diff --git a/bin/do_epic/main.py b/bin/do_epic/main.py index 8a0e928c..741f2cbe 100644 --- a/bin/do_epic/main.py +++ b/bin/do_epic/main.py @@ -16,6 +16,7 @@ from loop_claude.project.records import CONSEQUENCE, read_records from agent_cycle.run import Cycle, run_cycle from do_epic.config import DoEpicConfig, load from loop_effects.effects import Effects, say +from project_config.main import located as config_located from project_config.settings import Epic from record_store.jira_description import EpicDescription from do_epic.backend.protocol import EpicIssue, EpicStore @@ -417,7 +418,10 @@ def chunk_work(key: str, checkout: str | None, language: str, epic: EpicRun) -> issue = issue_read(key, epic) if isinstance(issue, Stop): return issue - return chunk_prompt.task(issue, epic.key, checkout, epic.launcher, language), RoutingIssue(issue) if "L" in issue.scores else None + config = config_located(checkout, epic.paths.home) if checkout else None + if isinstance(config, Failure): + return Stop(1, config.reason) + return chunk_prompt.task(issue, epic.key, checkout, epic.launcher, language, chunk_prompt.shipping(config) if config else ""), RoutingIssue(issue) if "L" in issue.scores else None issues = epic.store.read() if isinstance(issues, Failure): return Stop(1, issues.reason) diff --git a/bin/do_epic/test_main.py b/bin/do_epic/test_main.py index 6213a9db..62bf5f6b 100644 --- a/bin/do_epic/test_main.py +++ b/bin/do_epic/test_main.py @@ -424,6 +424,7 @@ class AChunksRun(DoEpicTest): self.assertIn("Ship the import.", prompt) self.assertIn("The repo's goals, which rank after the epic's and after code health, are from", prompt) self.assertIn("Serve the API.", prompt) + self.assertIn(f"give `chunk-pr merge` no `--finish`. Where the repo publishes something others consume, ship the change with one bullet for its users under `## Unreleased` in {checkout}/CHANGELOG.md", prompt) self.assertIn("the chunk finished; started ABC-12\n", out) judge_prompt = [what[1] for seam, what in fake.calls if seam == "claude"][0] self.assertIn("The records: the epic's scoring and decisions, then the repo's working rules and decisions, then the human's rules for every project:\nFrom the epic ABC-12's description, ## Decisions:\nKeep the v1 endpoints.\n\nFrom AGENTS.md:\nSquash every merge.", judge_prompt) diff --git a/bin/do_epic/test_scheduler.py b/bin/do_epic/test_scheduler.py index 72a9c990..8ab9bd56 100644 --- a/bin/do_epic/test_scheduler.py +++ b/bin/do_epic/test_scheduler.py @@ -8,6 +8,7 @@ sys.path.insert(0, str(pathlib.Path(__file__).resolve().parents[1])) from do_epic.scheduler import Chunk, CHUNK_FLAG, chunks, Epic, refusal, RepoRoom, resume, start_chunks, Started, Waits from do_epic import chunk_prompt +from project_config import settings from do_epic.backend.protocol import EpicIssue from failure import Failure from do_epic.parked import file_of, park, Parked @@ -299,7 +300,15 @@ class TheFirstPrompt(unittest.TestCase): "Where filing fails and says the issue may exist, ask the human to look before you file it again. File a finding about a repo's goals by that repo's rules. Where unsure which, ask the human. " "Record a decision that governs the epic, such as an answer the human typed, with `/b/do-epic ABC-12 --record-decision \"\"` and its text on stdin. Write the issue and the decision in Swedish, the epic's language." ) - self.assertEqual(chunk_prompt.task(issue("ABC-20"), "ABC-12", "/code/api", pathlib.Path("/b/do-epic"), "Swedish"), f"Work the Jira issue ABC-20 of the epic ABC-12 as one chunk, in the checkout /code/api, on the branch ABC-20. {told} Its summary: Do ABC-20") + self.assertEqual(chunk_prompt.task(issue("ABC-20"), "ABC-12", "/code/api", pathlib.Path("/b/do-epic"), "Swedish", "Ship it so."), f"Work the Jira issue ABC-20 of the epic ABC-12 as one chunk, in the checkout /code/api, on the branch ABC-20. {told} Ship it so. Its summary: Do ABC-20") + + def test_a_repo_with_a_plan_file_ships_the_chunk_with_a_bullet_in_its_changelog(self) -> None: + config = settings.ProjectConfig("api", pathlib.Path("/c/api"), pathlib.Path("/code/api"), {"changelog": pathlib.Path("/code/api/CHANGELOG.md")}) + self.assertEqual(chunk_prompt.shipping(config), "The issue is no item of the repo's plan, so give `chunk-pr merge` no `--finish`. Where the repo publishes something others consume, ship the change with one bullet for its users under `## Unreleased` in /code/api/CHANGELOG.md, added in the branch; otherwise write none.") + + def test_a_repo_with_its_plan_in_jira_ships_the_chunk_with_no_bullet(self) -> None: + config = settings.ProjectConfig("api", pathlib.Path("/c/api"), pathlib.Path("/code/api"), {"changelog": pathlib.Path("/code/api/CHANGELOG.md")}, epic=settings.Epic("https://acme.atlassian.net", "API-1")) + self.assertEqual(chunk_prompt.shipping(config), "The issue is no item of the repo's plan, so give `chunk-pr merge` no `--finish`. The repo's plan is a Jira epic, whose issues' history is its changelog, so write no changelog bullet.") def test_an_answer_the_judge_quoted_names_the_epics_description_first(self) -> None: self.assertTrue(chunk_prompt.WORKER.answered("Q", "A", Route(Rung("off-the-ladder")), None, False).startswith("Your question: Q\n\nthe epic's description, ")) diff --git a/bin/mutate_changes/test_mutate_changes.py b/bin/mutate_changes/test_mutate_changes.py index 13129299..a8f63d8b 100644 --- a/bin/mutate_changes/test_mutate_changes.py +++ b/bin/mutate_changes/test_mutate_changes.py @@ -220,8 +220,9 @@ class ToolProcess(unittest.TestCase): def test_an_interrupt_reaches_the_tool_before_the_run_kills_it(self): # A container's CLI, such as docker compose, stops its container on the SIGINT it is passed, and can't once killed. + # The loop ends by itself after about 40 seconds: under mutmut, the interrupt doesn't reach this shell, and an endless one hung the run. with tempfile.TemporaryDirectory() as folder: - self.interrupted(folder, "trap 'echo > stopped; exit 130' INT; echo $$ > started; while :; do sleep 0.1; done;") + self.interrupted(folder, "trap 'echo > stopped; exit 130' INT; echo $$ > started; n=0; while [ $n -lt 400 ]; do sleep 0.1; n=$((n+1)); done;") self.assertTrue(pathlib.Path(folder, "stopped").is_file()) def test_an_interrupted_tool_that_ignores_sigint_is_killed_after_the_grace_period(self): -- 2.52.0 From 36c0ed9bfa844c2e2adacf13f6a54181f35778e9 Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv <lilleman@larvit.se> Date: Thu, 19 Nov 2026 02:28:36 +0100 Subject: [PATCH 03/10] Kill the surviving mutants of the shipping sentence --- bin/do_epic/test_main.py | 17 +++++++++++++---- bin/do_epic/test_scheduler.py | 4 ++++ 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/bin/do_epic/test_main.py b/bin/do_epic/test_main.py index 62bf5f6b..d9acdd0a 100644 --- a/bin/do_epic/test_main.py +++ b/bin/do_epic/test_main.py @@ -79,6 +79,12 @@ class DoEpicTest(unittest.TestCase): self.issues = [issue("ABC-20", "repo:api")] return folder + def epic_run(self, fake: FakeEffects, env: dict[str, str] | None = None) -> main.EpicRun: + config = main.load(self.home) + assert not isinstance(config, Failure) + store, record = self.backend(config, "ABC-12") + return main.EpicRun("ABC-12", config, store, record, paths_from(self.home), env or {}, pathlib.Path("/b/do-epic"), fake.effects()) + def run_main(self, argv: list[str], fake: FakeEffects, env: dict[str, str] | None = None) -> tuple[int, str, str]: out, err = io.StringIO(), io.StringIO() with contextlib.redirect_stdout(out), contextlib.redirect_stderr(err): @@ -146,13 +152,16 @@ class TheCommand(DoEpicTest): class ACycleOfAChunkWithoutARepo(DoEpicTest): + def test_a_chunk_in_a_folder_no_project_config_names_stops_with_the_reason(self) -> None: + stopped = main.chunk_work("ABC-21", str(self.home), "English", self.epic_run(FakeEffects())) + assert isinstance(stopped, main.Stop) + self.assertEqual(stopped.code, 1) + self.assertIn("rev-parse", stopped.reason) + def cycle(self, env: dict[str, str] | None = None) -> main.Cycle: fake = FakeEffects(git=[Failure("no git"), Failure("no git")]) paths = paths_from(self.home) - config = main.load(self.home) - assert not isinstance(config, Failure) - store, record = self.backend(config, "ABC-12") - epic = main.EpicRun("ABC-12", config, store, record, paths, env or {}, pathlib.Path("/b/do-epic"), fake.effects()) + epic = self.epic_run(fake, env) place = main.chunk_root("ABC-21", epic) assert isinstance(place, tuple) root, repo = place diff --git a/bin/do_epic/test_scheduler.py b/bin/do_epic/test_scheduler.py index 8ab9bd56..c583ebea 100644 --- a/bin/do_epic/test_scheduler.py +++ b/bin/do_epic/test_scheduler.py @@ -302,6 +302,10 @@ class TheFirstPrompt(unittest.TestCase): ) self.assertEqual(chunk_prompt.task(issue("ABC-20"), "ABC-12", "/code/api", pathlib.Path("/b/do-epic"), "Swedish", "Ship it so."), f"Work the Jira issue ABC-20 of the epic ABC-12 as one chunk, in the checkout /code/api, on the branch ABC-20. {told} Ship it so. Its summary: Do ABC-20") + def test_a_chunk_without_a_repo_has_no_shipping_sentence(self) -> None: + self.assertEqual(chunk_prompt.task(issue("ABC-20"), "ABC-12", None, pathlib.Path("/b/do-epic"), "Swedish", "").count(" "), 0) + self.assertTrue(chunk_prompt.task(issue("ABC-20"), "ABC-12", None, pathlib.Path("/b/do-epic"), "Swedish", "").endswith("Swedish, the epic's language. Its summary: Do ABC-20")) + def test_a_repo_with_a_plan_file_ships_the_chunk_with_a_bullet_in_its_changelog(self) -> None: config = settings.ProjectConfig("api", pathlib.Path("/c/api"), pathlib.Path("/code/api"), {"changelog": pathlib.Path("/code/api/CHANGELOG.md")}) self.assertEqual(chunk_prompt.shipping(config), "The issue is no item of the repo's plan, so give `chunk-pr merge` no `--finish`. Where the repo publishes something others consume, ship the change with one bullet for its users under `## Unreleased` in /code/api/CHANGELOG.md, added in the branch; otherwise write none.") -- 2.52.0 From a2c9d2150d30d4c895d696ae1dddb87944976578 Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv <lilleman@larvit.se> Date: Thu, 19 Nov 2026 02:42:20 +0100 Subject: [PATCH 04/10] Pass the repo's config to the task, so the no-repo case is tested where mutants run --- bin/do_epic/chunk_prompt.py | 5 +++-- bin/do_epic/main.py | 2 +- bin/do_epic/test_scheduler.py | 12 +++++++----- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/bin/do_epic/chunk_prompt.py b/bin/do_epic/chunk_prompt.py index a94f7adf..6045c569 100644 --- a/bin/do_epic/chunk_prompt.py +++ b/bin/do_epic/chunk_prompt.py @@ -24,8 +24,9 @@ def shipping(config: ProjectConfig) -> str: return f"{opening} Where the repo publishes something others consume, ship the change with one bullet for its users under `## Unreleased` in {config.places['changelog']}, added in the branch; otherwise write none." -def task(issue: EpicIssue, epic: str, checkout: str | None, launcher: pathlib.Path, language: str, shipped: str) -> str: - """The task of the chunk that works issue, of the epic with the key epic: in checkout, or without a repo where it is None. launcher is the do-epic that runs the chunk, language the one the epic's Jira text is in, and shipped how the chunk ships its change, which `shipping` words for a chunk in a repo and is empty without one.""" +def task(issue: EpicIssue, epic: str, checkout: str | None, launcher: pathlib.Path, language: str, config: ProjectConfig | None) -> str: + """The task of the chunk that works issue, of the epic with the key epic: in checkout, or without a repo where it is None. launcher is the do-epic that runs the chunk, language the one the epic's Jira text is in, and config the project config of the repo's checkout, None without a repo.""" + shipped = shipping(config) if config else "" where = f"in the checkout {checkout}, on the branch {issue.key}" if checkout else "which changes no repo: work in the folder you start in" return f"Work the Jira issue {issue.key} of the epic {epic} as one chunk, {where}. {findings.instructions(epic, launcher, language)}{f' {shipped}' if shipped else ''} Its summary: {issue.summary}" + (f"\n\nIts description:\n\n{issue.detail}" if issue.detail else "") diff --git a/bin/do_epic/main.py b/bin/do_epic/main.py index 741f2cbe..0a73680a 100644 --- a/bin/do_epic/main.py +++ b/bin/do_epic/main.py @@ -421,7 +421,7 @@ def chunk_work(key: str, checkout: str | None, language: str, epic: EpicRun) -> config = config_located(checkout, epic.paths.home) if checkout else None if isinstance(config, Failure): return Stop(1, config.reason) - return chunk_prompt.task(issue, epic.key, checkout, epic.launcher, language, chunk_prompt.shipping(config) if config else ""), RoutingIssue(issue) if "L" in issue.scores else None + return chunk_prompt.task(issue, epic.key, checkout, epic.launcher, language, config), RoutingIssue(issue) if "L" in issue.scores else None issues = epic.store.read() if isinstance(issues, Failure): return Stop(1, issues.reason) diff --git a/bin/do_epic/test_scheduler.py b/bin/do_epic/test_scheduler.py index c583ebea..0cecf43e 100644 --- a/bin/do_epic/test_scheduler.py +++ b/bin/do_epic/test_scheduler.py @@ -292,6 +292,9 @@ class StartingAnEpicsChunks(unittest.TestCase): self.assertRegex(found.reason, f"^cannot lock {self.home}/.local/state/do-epic/ABC-12: \\w") +CONFIG = settings.ProjectConfig("api", pathlib.Path("/c/api"), pathlib.Path("/code/api"), {"changelog": pathlib.Path("/code/api/CHANGELOG.md")}, epic=settings.Epic("https://acme.atlassian.net", "API-1")) + + class TheFirstPrompt(unittest.TestCase): def test_the_task_names_the_checkout_and_branch_and_quotes_a_description_only_where_there_is_one(self) -> None: labels = "`repo:<name>` for the repo that works it, `do-epic-claude` for work of Claude's that changes no repo, or `do-epic-human` for a task of the human's" @@ -300,19 +303,18 @@ class TheFirstPrompt(unittest.TestCase): "Where filing fails and says the issue may exist, ask the human to look before you file it again. File a finding about a repo's goals by that repo's rules. Where unsure which, ask the human. " "Record a decision that governs the epic, such as an answer the human typed, with `/b/do-epic ABC-12 --record-decision \"<title>\"` and its text on stdin. Write the issue and the decision in Swedish, the epic's language." ) - self.assertEqual(chunk_prompt.task(issue("ABC-20"), "ABC-12", "/code/api", pathlib.Path("/b/do-epic"), "Swedish", "Ship it so."), f"Work the Jira issue ABC-20 of the epic ABC-12 as one chunk, in the checkout /code/api, on the branch ABC-20. {told} Ship it so. Its summary: Do ABC-20") + self.assertEqual(chunk_prompt.task(issue("ABC-20"), "ABC-12", "/code/api", pathlib.Path("/b/do-epic"), "Swedish", CONFIG), f"Work the Jira issue ABC-20 of the epic ABC-12 as one chunk, in the checkout /code/api, on the branch ABC-20. {told} The issue is no item of the repo's plan, so give `chunk-pr merge` no `--finish`. The repo's plan is a Jira epic, whose issues' history is its changelog, so write no changelog bullet. Its summary: Do ABC-20") def test_a_chunk_without_a_repo_has_no_shipping_sentence(self) -> None: - self.assertEqual(chunk_prompt.task(issue("ABC-20"), "ABC-12", None, pathlib.Path("/b/do-epic"), "Swedish", "").count(" "), 0) - self.assertTrue(chunk_prompt.task(issue("ABC-20"), "ABC-12", None, pathlib.Path("/b/do-epic"), "Swedish", "").endswith("Swedish, the epic's language. Its summary: Do ABC-20")) + self.assertEqual(chunk_prompt.task(issue("ABC-20"), "ABC-12", None, pathlib.Path("/b/do-epic"), "Swedish", None).count(" "), 0) + self.assertTrue(chunk_prompt.task(issue("ABC-20"), "ABC-12", None, pathlib.Path("/b/do-epic"), "Swedish", None).endswith("Swedish, the epic's language. Its summary: Do ABC-20")) def test_a_repo_with_a_plan_file_ships_the_chunk_with_a_bullet_in_its_changelog(self) -> None: config = settings.ProjectConfig("api", pathlib.Path("/c/api"), pathlib.Path("/code/api"), {"changelog": pathlib.Path("/code/api/CHANGELOG.md")}) self.assertEqual(chunk_prompt.shipping(config), "The issue is no item of the repo's plan, so give `chunk-pr merge` no `--finish`. Where the repo publishes something others consume, ship the change with one bullet for its users under `## Unreleased` in /code/api/CHANGELOG.md, added in the branch; otherwise write none.") def test_a_repo_with_its_plan_in_jira_ships_the_chunk_with_no_bullet(self) -> None: - config = settings.ProjectConfig("api", pathlib.Path("/c/api"), pathlib.Path("/code/api"), {"changelog": pathlib.Path("/code/api/CHANGELOG.md")}, epic=settings.Epic("https://acme.atlassian.net", "API-1")) - self.assertEqual(chunk_prompt.shipping(config), "The issue is no item of the repo's plan, so give `chunk-pr merge` no `--finish`. The repo's plan is a Jira epic, whose issues' history is its changelog, so write no changelog bullet.") + self.assertEqual(chunk_prompt.shipping(CONFIG), "The issue is no item of the repo's plan, so give `chunk-pr merge` no `--finish`. The repo's plan is a Jira epic, whose issues' history is its changelog, so write no changelog bullet.") def test_an_answer_the_judge_quoted_names_the_epics_description_first(self) -> None: self.assertTrue(chunk_prompt.WORKER.answered("Q", "A", Route(Rung("off-the-ladder")), None, False).startswith("Your question: Q\n\nthe epic's description, ")) -- 2.52.0 From 414ecfa2a09f46b8fcae7331d2c94938f0f088dd Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv <lilleman@larvit.se> Date: Thu, 19 Nov 2026 02:57:24 +0100 Subject: [PATCH 05/10] =?UTF-8?q?Answer=20stability=20round=201:=200=20?= =?UTF-8?q?=F0=9F=94=B4,=202=20=F0=9F=9F=A1=20(0=20misread);=20name=20the?= =?UTF-8?q?=20changelog=20as=20the=20repo=20spells=20it,=20test=20facts=20?= =?UTF-8?q?not=20sentences?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bin/do_epic/chunk_prompt.py | 11 +++++---- bin/do_epic/test_main.py | 15 ++++++------ bin/do_epic/test_scheduler.py | 30 +++++++++++++++++------ bin/mutate_changes/test_mutate_changes.py | 2 +- docs/decisions.md | 2 +- 5 files changed, 38 insertions(+), 22 deletions(-) diff --git a/bin/do_epic/chunk_prompt.py b/bin/do_epic/chunk_prompt.py index 6045c569..dce8a282 100644 --- a/bin/do_epic/chunk_prompt.py +++ b/bin/do_epic/chunk_prompt.py @@ -17,18 +17,19 @@ DRIVER = "do-epic" def shipping(config: ProjectConfig) -> str: - """How a chunk in the repo that config names ships its change. An epic's issue is no item of the repo's plan, so the worker finishes none: its bullet, where the repo has a changelog to put one in, is its own to write (docs/decisions.md → `do-epic: drives one Jira epic …`, "Releases").""" - opening = "The issue is no item of the repo's plan, so give `chunk-pr merge` no `--finish`." + """How a chunk in the repo that config names ships its change. An epic's issue isn't an item of the repo's plan, so `chunk-pr merge --finish`, which adds a finished item's changelog bullet, doesn't apply: the worker writes the bullet itself, where the repo publishes something others consume (docs/decisions.md → `do-epic: drives one Jira epic …`, "Releases").""" + opening = "The issue isn't an item of the repo's plan, so run `chunk-pr merge` without `--finish`." if config.epic: - return f"{opening} The repo's plan is a Jira epic, whose issues' history is its changelog, so write no changelog bullet." - return f"{opening} Where the repo publishes something others consume, ship the change with one bullet for its users under `## Unreleased` in {config.places['changelog']}, added in the branch; otherwise write none." + return f"{opening} The repo's plan is a Jira epic, and the history of its issues serves as the changelog, so leave the changelog as it is." + changelog = config.paths["changelog"].relative_to(config.top) if "changelog" in config.paths and config.paths["changelog"].is_relative_to(config.top) else config.places["changelog"] + return f"{opening} Where the repo publishes something others consume, add one bullet to `## Unreleased` in `{changelog}` that tells the repo's consumers what changed; otherwise leave the changelog as it is." def task(issue: EpicIssue, epic: str, checkout: str | None, launcher: pathlib.Path, language: str, config: ProjectConfig | None) -> str: """The task of the chunk that works issue, of the epic with the key epic: in checkout, or without a repo where it is None. launcher is the do-epic that runs the chunk, language the one the epic's Jira text is in, and config the project config of the repo's checkout, None without a repo.""" shipped = shipping(config) if config else "" where = f"in the checkout {checkout}, on the branch {issue.key}" if checkout else "which changes no repo: work in the folder you start in" - return f"Work the Jira issue {issue.key} of the epic {epic} as one chunk, {where}. {findings.instructions(epic, launcher, language)}{f' {shipped}' if shipped else ''} Its summary: {issue.summary}" + (f"\n\nIts description:\n\n{issue.detail}" if issue.detail else "") + return f"Work the Jira issue {issue.key} of the epic {epic} as one chunk, {where}. {" ".join(filter(None, [findings.instructions(epic, launcher, language), shipped]))} Its summary: {issue.summary}" + (f"\n\nIts description:\n\n{issue.detail}" if issue.detail else "") CODE_HEALTH = '~/.claude/CLAUDE.md → "Shared goal"' diff --git a/bin/do_epic/test_main.py b/bin/do_epic/test_main.py index d9acdd0a..7b5ee7e6 100644 --- a/bin/do_epic/test_main.py +++ b/bin/do_epic/test_main.py @@ -152,12 +152,6 @@ class TheCommand(DoEpicTest): class ACycleOfAChunkWithoutARepo(DoEpicTest): - def test_a_chunk_in_a_folder_no_project_config_names_stops_with_the_reason(self) -> None: - stopped = main.chunk_work("ABC-21", str(self.home), "English", self.epic_run(FakeEffects())) - assert isinstance(stopped, main.Stop) - self.assertEqual(stopped.code, 1) - self.assertIn("rev-parse", stopped.reason) - def cycle(self, env: dict[str, str] | None = None) -> main.Cycle: fake = FakeEffects(git=[Failure("no git"), Failure("no git")]) paths = paths_from(self.home) @@ -418,6 +412,12 @@ class AChunksRun(DoEpicTest): self.assertEqual(code, 1) self.assertIn("the chunk finished, but the next could not start: Jira answered 503\n", err) + def test_a_chunk_in_a_folder_no_project_config_names_stops_with_gits_reason(self) -> None: + stopped = main.chunk_work("ABC-21", str(self.home), "English", self.epic_run(FakeEffects())) + assert isinstance(stopped, main.Stop) + self.assertEqual(stopped.code, 1) + self.assertIn("rev-parse", stopped.reason) # git's reason, since no project config can be found without a checkout + def test_a_chunk_in_a_repo_works_in_its_checkout_on_the_repos_premises_and_records(self) -> None: checkout = self.home / "code" / "api" configured(self, checkout, home=self.home) @@ -433,7 +433,8 @@ class AChunksRun(DoEpicTest): self.assertIn("Ship the import.", prompt) self.assertIn("The repo's goals, which rank after the epic's and after code health, are from", prompt) self.assertIn("Serve the API.", prompt) - self.assertIn(f"give `chunk-pr merge` no `--finish`. Where the repo publishes something others consume, ship the change with one bullet for its users under `## Unreleased` in {checkout}/CHANGELOG.md", prompt) + self.assertIn("without `--finish`", prompt) + self.assertIn("add one bullet to `## Unreleased` in `CHANGELOG.md`", prompt) self.assertIn("the chunk finished; started ABC-12\n", out) judge_prompt = [what[1] for seam, what in fake.calls if seam == "claude"][0] self.assertIn("The records: the epic's scoring and decisions, then the repo's working rules and decisions, then the human's rules for every project:\nFrom the epic ABC-12's description, ## Decisions:\nKeep the v1 endpoints.\n\nFrom AGENTS.md:\nSquash every merge.", judge_prompt) diff --git a/bin/do_epic/test_scheduler.py b/bin/do_epic/test_scheduler.py index 0cecf43e..033718ed 100644 --- a/bin/do_epic/test_scheduler.py +++ b/bin/do_epic/test_scheduler.py @@ -303,18 +303,32 @@ class TheFirstPrompt(unittest.TestCase): "Where filing fails and says the issue may exist, ask the human to look before you file it again. File a finding about a repo's goals by that repo's rules. Where unsure which, ask the human. " "Record a decision that governs the epic, such as an answer the human typed, with `/b/do-epic ABC-12 --record-decision \"<title>\"` and its text on stdin. Write the issue and the decision in Swedish, the epic's language." ) - self.assertEqual(chunk_prompt.task(issue("ABC-20"), "ABC-12", "/code/api", pathlib.Path("/b/do-epic"), "Swedish", CONFIG), f"Work the Jira issue ABC-20 of the epic ABC-12 as one chunk, in the checkout /code/api, on the branch ABC-20. {told} The issue is no item of the repo's plan, so give `chunk-pr merge` no `--finish`. The repo's plan is a Jira epic, whose issues' history is its changelog, so write no changelog bullet. Its summary: Do ABC-20") + task = chunk_prompt.task(issue("ABC-20"), "ABC-12", "/code/api", pathlib.Path("/b/do-epic"), "Swedish", CONFIG) + self.assertTrue(task.startswith(f"Work the Jira issue ABC-20 of the epic ABC-12 as one chunk, in the checkout /code/api, on the branch ABC-20. {told} ")) + self.assertTrue(task.endswith(" Its summary: Do ABC-20")) - def test_a_chunk_without_a_repo_has_no_shipping_sentence(self) -> None: - self.assertEqual(chunk_prompt.task(issue("ABC-20"), "ABC-12", None, pathlib.Path("/b/do-epic"), "Swedish", None).count(" "), 0) - self.assertTrue(chunk_prompt.task(issue("ABC-20"), "ABC-12", None, pathlib.Path("/b/do-epic"), "Swedish", None).endswith("Swedish, the epic's language. Its summary: Do ABC-20")) + def test_a_chunk_without_a_repo_is_told_nothing_of_shipping(self) -> None: + task = chunk_prompt.task(issue("ABC-20"), "ABC-12", None, pathlib.Path("/b/do-epic"), "Swedish", None) + self.assertTrue(task.endswith("Swedish, the epic's language. Its summary: Do ABC-20")) + self.assertNotIn("--finish", task) - def test_a_repo_with_a_plan_file_ships_the_chunk_with_a_bullet_in_its_changelog(self) -> None: + def test_a_repo_with_a_plan_file_is_told_to_add_a_bullet_to_its_changelog_where_it_publishes(self) -> None: config = settings.ProjectConfig("api", pathlib.Path("/c/api"), pathlib.Path("/code/api"), {"changelog": pathlib.Path("/code/api/CHANGELOG.md")}) - self.assertEqual(chunk_prompt.shipping(config), "The issue is no item of the repo's plan, so give `chunk-pr merge` no `--finish`. Where the repo publishes something others consume, ship the change with one bullet for its users under `## Unreleased` in /code/api/CHANGELOG.md, added in the branch; otherwise write none.") + told = chunk_prompt.shipping(config) + self.assertIn("without `--finish`", told) + self.assertIn("Where the repo publishes something others consume, add one bullet to `## Unreleased` in `CHANGELOG.md`", told) - def test_a_repo_with_its_plan_in_jira_ships_the_chunk_with_no_bullet(self) -> None: - self.assertEqual(chunk_prompt.shipping(CONFIG), "The issue is no item of the repo's plan, so give `chunk-pr merge` no `--finish`. The repo's plan is a Jira epic, whose issues' history is its changelog, so write no changelog bullet.") + def test_a_changelog_outside_the_checkout_or_on_a_page_is_named_as_the_config_spells_it(self) -> None: + config = settings.ProjectConfig("api", pathlib.Path("/c/api"), pathlib.Path("/code/api"), {"changelog": pathlib.Path("/c/api/CHANGELOG.md")}) + self.assertIn("in `/c/api/CHANGELOG.md`", chunk_prompt.shipping(config)) + paged = settings.ProjectConfig("api", pathlib.Path("/c/api"), pathlib.Path("/code/api"), {}, pages={"changelog": settings.Page("https://acme.atlassian.net", "7", "confluence:https://acme.atlassian.net/wiki/pages/7")}) + self.assertIn("in `confluence:https://acme.atlassian.net/wiki/pages/7`", chunk_prompt.shipping(paged)) + + def test_a_repo_with_its_plan_in_jira_is_told_to_leave_the_changelog_as_it_is(self) -> None: + told = chunk_prompt.shipping(CONFIG) + self.assertIn("without `--finish`", told) + self.assertIn("leave the changelog as it is", told) + self.assertNotIn("## Unreleased", told) def test_an_answer_the_judge_quoted_names_the_epics_description_first(self) -> None: self.assertTrue(chunk_prompt.WORKER.answered("Q", "A", Route(Rung("off-the-ladder")), None, False).startswith("Your question: Q\n\nthe epic's description, ")) diff --git a/bin/mutate_changes/test_mutate_changes.py b/bin/mutate_changes/test_mutate_changes.py index a8f63d8b..3e9eeb68 100644 --- a/bin/mutate_changes/test_mutate_changes.py +++ b/bin/mutate_changes/test_mutate_changes.py @@ -220,7 +220,7 @@ class ToolProcess(unittest.TestCase): def test_an_interrupt_reaches_the_tool_before_the_run_kills_it(self): # A container's CLI, such as docker compose, stops its container on the SIGINT it is passed, and can't once killed. - # The loop ends by itself after about 40 seconds: under mutmut, the interrupt doesn't reach this shell, and an endless one hung the run. + # The loop ends by itself after about 40 seconds: under mutmut, the interrupt doesn't reach this shell, and a shell that looped for ever hung the run. with tempfile.TemporaryDirectory() as folder: self.interrupted(folder, "trap 'echo > stopped; exit 130' INT; echo $$ > started; n=0; while [ $n -lt 400 ]; do sleep 0.1; n=$((n+1)); done;") self.assertTrue(pathlib.Path(folder, "stopped").is_file()) diff --git a/docs/decisions.md b/docs/decisions.md index 9e4a697c..0e4418e2 100644 --- a/docs/decisions.md +++ b/docs/decisions.md @@ -150,7 +150,7 @@ Valid while `~/.claude` is a checkout of this repo. - **Items live only in the epic.** A repo's own plan never mirrors them. Where `repo-rule.md` leaves an item's repo unclear, do-epic asks. An item without a repo is either Claude's work, done without a PR, or a human task; where the item doesn't say which, do-epic asks. - **One item, several repos.** do-epic splits such an item when it plans it, into one Jira sub-task per repo, each labelled for its repo. The parent tracks the whole change. A person's issue is split too, with a comment for the team. - **Ranking.** Score, then Blocked by, in one weight chain: the epic's achieve goals, then code health, then the repo's goals. Where the epic and a repo disagree, the epic wins. do-epic re-ranks Jira's backlog to match, and people's issues keep their rank. -- **Releases.** An epic item has no release. It ships into its repo's unreleased work: a bullet under `CHANGELOG.md` → `## Unreleased`, or nothing where the repo's plan is in Jira. +- **Releases.** An epic item has no release. It ships into its repo's unreleased work: where the repo publishes something others consume, a bullet under `CHANGELOG.md` → `## Unreleased`, or nothing where the repo's plan is in Jira. The issue is no item of the repo's plan, so the chunk's worker writes the bullet in its branch and runs `chunk-pr merge` without `--finish`. - **Repos.** A repo's name is its main checkout's folder name, and a project config names that checkout. A missing checkout is cloned from the host of the epic's other repos; where unsure, do-epic asks. Unsure means the other repos don't all sit under one host and owner (the same host spelt as https and as ssh counts as two), an origin can't be read or isn't an https, ssh or scp-style address, the folder to clone into holds something else, or the clone fails. A repo no config names is cloned into the clone folder, and the human is asked to write its config. Each chunk uses its repo's model, routing, and language for commits and PRs. Jira text is in the epic's language, or else the machine's default. - **Running.** The epic caps the chunks running at once, and each repo's `parallel-chunks` still applies. do-epic and loop-claude never run chunks in the same repo at once. The cap is a line of the epic's description, `**Max parallel chunks:** 2`, and 1 without it, as `parallel-chunks` is. A repo's `parallel-chunks` counts the chunks of every epic in its checkout. Each window is named for its issue's key, and a tmux window option, `@chunk-root`, names the folder its chunk works in, which is how loop-claude sees do-epic's chunks in a checkout. do-epic and loop-claude each hold the checkout's `starting` lock from checking the checkout's chunks to starting a window there. A chunk without a repo works in `~/.local/state/do-epic/<EPIC-KEY>/`. do-epic archives its cycles under `~/.claude/do-epic-transcripts/`, not in loop-claude's archive, whose readers parse loop-claude's prompts. An open issue runs once a label records its repo; until do-epic picks repos itself, an issue without one waits, and `do-epic <EPIC-KEY>` says so. - **Long gates.** A chunk whose PR waits on a gate, such as a human approval, parks. It keeps its worktree, PR and session, and its state is in a file that survives a reboot. A parked chunk takes no running slot, and the items it blocks wait. do-epic polls the forge and resumes the chunk's session when the gate passes or a reviewer comments. It fixes reasonable feedback, replies to the rest, and changes the setup so review would have caught it. `do-epic <key> --status` and the tmux window names show what each chunk waits on. A gate is a pull request's pending checks or, on GitHub, the approval its branch protection requires; a draft waits on neither, since its worker has yet to mark it ready. On Gitea a draft is a pull request whose title opens with `WIP:` or `[WIP]`, Gitea's default `WORK_IN_PROGRESS_PREFIXES`. Changes a reviewer requested resume the chunk only while that review was made on the pull request's head commit and the pull request's author has not commented or replied after it; once the worker pushed or replied, the chunk parks on a new review, since GitHub keeps the decision until the reviewer reviews again. The chunk's window reads the forge once a minute, which no forge's rate limit notices. A chunk resumes only into a free slot, under the limits a starting chunk meets, and stays parked until then. `do-epic <key>` starts a parked chunk's window again whatever the limits, since the chunk stays parked. do-epic sets `CHUNK_PR_PARKS=1` for each worker, so `chunk-pr merge` fails at once where the pull request awaits an approval, and the worker's run doesn't hold a slot while the pull request waits. -- 2.52.0 From 01e1dece736757298b286cc5974c02bee8ff3802 Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv <lilleman@larvit.se> Date: Thu, 19 Nov 2026 02:57:24 +0100 Subject: [PATCH 06/10] =?UTF-8?q?Answer=20prose=20round=201:=200=20?= =?UTF-8?q?=F0=9F=94=B4,=203=20=F0=9F=9F=A1=20(0=20misread);=20reword=20th?= =?UTF-8?q?e=20shipping=20sentence,=20record=20the=20rule=20in=20the=20dec?= =?UTF-8?q?ision?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -- 2.52.0 From f905c797cbf84964c4bfd292f651be9b0b6050f6 Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv <lilleman@larvit.se> Date: Thu, 19 Nov 2026 03:08:39 +0100 Subject: [PATCH 07/10] Pin the opening of the shipping sentence in both tests --- bin/do_epic/test_scheduler.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/do_epic/test_scheduler.py b/bin/do_epic/test_scheduler.py index 033718ed..c7d4027a 100644 --- a/bin/do_epic/test_scheduler.py +++ b/bin/do_epic/test_scheduler.py @@ -315,7 +315,7 @@ class TheFirstPrompt(unittest.TestCase): def test_a_repo_with_a_plan_file_is_told_to_add_a_bullet_to_its_changelog_where_it_publishes(self) -> None: config = settings.ProjectConfig("api", pathlib.Path("/c/api"), pathlib.Path("/code/api"), {"changelog": pathlib.Path("/code/api/CHANGELOG.md")}) told = chunk_prompt.shipping(config) - self.assertIn("without `--finish`", told) + self.assertTrue(told.startswith("The issue isn't an item of the repo's plan, so run `chunk-pr merge` without `--finish`.")) self.assertIn("Where the repo publishes something others consume, add one bullet to `## Unreleased` in `CHANGELOG.md`", told) def test_a_changelog_outside_the_checkout_or_on_a_page_is_named_as_the_config_spells_it(self) -> None: @@ -326,7 +326,7 @@ class TheFirstPrompt(unittest.TestCase): def test_a_repo_with_its_plan_in_jira_is_told_to_leave_the_changelog_as_it_is(self) -> None: told = chunk_prompt.shipping(CONFIG) - self.assertIn("without `--finish`", told) + self.assertTrue(told.startswith("The issue isn't an item of the repo's plan, so run `chunk-pr merge` without `--finish`.")) self.assertIn("leave the changelog as it is", told) self.assertNotIn("## Unreleased", told) -- 2.52.0 From 10c068c4e5ce7980511c726e30143bc27933b40a Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv <lilleman@larvit.se> Date: Thu, 19 Nov 2026 03:08:56 +0100 Subject: [PATCH 08/10] Finish item 416 in the plan --- CHANGELOG.md | 1 + todo.md | 9 --------- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3ccaa546..997c1d97 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ## Unreleased +- do-epic tells an epic chunk's worker how its repo ships the change: a bullet under the repo's changelog where the repo publishes something, none where its plan is in Jira, and no `--finish` for `chunk-pr merge`. - `do-epic <EPIC-KEY> --status` says which chunk asks you a question, and since when each parked chunk has awaited its gate. - do-epic moves a chunk's issue to done in Jira when the chunk finishes, and the split item it belongs to once its last sub-task is done, so no finished chunk starts again and the chunks it blocks start. It moves them by the transition `jira-finish-transition` and `jira-finish-status` name, so set both; without them a finishing chunk stops with that reason. - Describe do-epic in the README: its entry under Tools, and its machine settings and `repo-rule.md` under Set up a project. diff --git a/todo.md b/todo.md index 2dd1b389..3c5da2be 100644 --- a/todo.md +++ b/todo.md @@ -12,7 +12,6 @@ | ID | Release | Blocked by | Exempt | Item | L | E | I | R | S | Moves | Score | |---|---|---|---|---|---|---|---|---|---|---|---| -| 416 | 0.12.0 | | | **Finish an epic's repo item with a bullet under its repo's `CHANGELOG.md` → `## Unreleased`, or with none where the repo's plan is in Jira.** | 1 | 1 | 1 | 1 | 2 | 1 by 5 | 2.1 | | 420 | 0.12.0 | | | **End a worker that printed its final result and lingers, by killing the background shells it left, after a few minutes, and print each kill with its evidence on loop-claude's terminal.** | 2 | 2 | 2 | 4 | 3 | 1.5 by 6 | 2.0 | | 414 | 0.12.0 | | | **DM the human through the notifier when a human-task issue blocks the epic's next item, and poll until it closes.** | 2 | 2 | 2 | 4 | 3 | 1 by 5 | 1.9 | | 417 | 0.12.0 | | | **Run do-epic end to end against a sandbox epic on a real Jira site with a command of its own, outside `run-tests`.** | 2 | 1 | 1 | 2 | 3 | 1 by 5 | 1.9 | @@ -72,14 +71,6 @@ ## Details -### 416. Finish an epic's repo item with a bullet under its repo's `CHANGELOG.md` → `## Unreleased`, or with none where the repo's plan is in Jira. - -An epic item has no release (`docs/decisions.md` → `do-epic: drives one Jira epic …`). do-epic runs `chunk-pr merge --finish` in the repo's checkout, and picks the flag by the repo's plan type. - -Touches: - -- `bin/do_epic/main.py` - ### 420. End a worker that printed its final result and lingers, by killing the background shells it left, after a few minutes, and print each kill with its evidence on loop-claude's terminal. On 2026-11-18 the worker of the item 402 chunk merged its pull request at about 11:47, printed its summary and then waited 95 minutes: it had started `until [ -s /tmp/merge-402.log ] && ! pgrep -f "chunk-pr merg"; do sleep 15; done` in the background, and `pgrep -f` matched the loop's own command line, so the condition never held. Its `claude -p` stayed alive ("Waiting for background work to finish"), `loop-claude` waited for it to exit, and the window's slot started no new chunk until the human found it and killed the shell. -- 2.52.0 From a2afc03454eeccf441e498eafe52cf4e120b404d Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv <lilleman@larvit.se> Date: Thu, 19 Nov 2026 03:08:57 +0100 Subject: [PATCH 09/10] Finish item 440 in the plan --- todo.md | 8 -------- 1 file changed, 8 deletions(-) diff --git a/todo.md b/todo.md index 3c5da2be..1a0f3271 100644 --- a/todo.md +++ b/todo.md @@ -15,7 +15,6 @@ | 420 | 0.12.0 | | | **End a worker that printed its final result and lingers, by killing the background shells it left, after a few minutes, and print each kill with its evidence on loop-claude's terminal.** | 2 | 2 | 2 | 4 | 3 | 1.5 by 6 | 2.0 | | 414 | 0.12.0 | | | **DM the human through the notifier when a human-task issue blocks the epic's next item, and poll until it closes.** | 2 | 2 | 2 | 4 | 3 | 1 by 5 | 1.9 | | 417 | 0.12.0 | | | **Run do-epic end to end against a sandbox epic on a real Jira site with a command of its own, outside `run-tests`.** | 2 | 1 | 1 | 2 | 3 | 1 by 5 | 1.9 | -| 440 | 0.12.0 | | | **End the shell that the interrupt test of `mutate-changes` starts within a minute, so a mutation run of this repo never waits on it for ever.** | 1 | 1 | 2 | 2 | 2 | 1 by 4 | 1.7 | | 442 | 0.12.0 | | | **Have `do-epic <EPIC-KEY>` split each open issue by repo, pick the repo of each issue that no label names one for, asking the human where unclear, and re-rank the epic, before it starts chunks.** | 3 | 2 | 3 | 6 | 5 | 1 by 5 | 1.2 | | 310 | 0.12.0 | | | **Compact a waiting worker's session shortly before its prompt cache expires, only when the human has not answered an interrupt by then.** | 3 | 2 | 3 | 6 | 4 | 1.4 by 3 | 0.9 | | 422 | 0.12.0 | 420 | | **Check every 5 minutes whether a tmux window of the loop looks stuck by other signs than a lingering worker, investigate it with a headless claude, and kill only the process the investigation names.** | 3 | 2 | 3 | 6 | 5 | 1.5 by 4 | 0.8 | @@ -108,13 +107,6 @@ Touches: - `bin/do-epic-e2e` - `bin/do_epic/e2e/` -### 440. End the shell that the interrupt test of `mutate-changes` starts within a minute, so a mutation run of this repo never waits on it for ever. - -Today a `mutate-changes` run on this repo can wait for ever: mutmut runs `bin/mutate_changes/test_mutate_changes.py` → `test_an_interrupt_reaches_the_tool_before_the_run_kills_it` inside its own process, where the test's SIGINT doesn't reach the `sh -c "trap … while :; do sleep 0.1; done"` it started. The shell then loops for good as mutmut's child, and mutmut waits for it. Three runs of two chunks hung this way on 2026-11-18, one for over two hours, each holding a heavy slot until someone killed the shell. Give the helper shell a deadline of its own, so it ends where no signal arrives, or leave the test out of what mutmut runs. - -Touches: -- `bin/mutate_changes/test_mutate_changes.py`: `test_an_interrupt_reaches_the_tool_before_the_run_kills_it` (small) - ### 442. Have `do-epic <EPIC-KEY>` split each open issue by repo, pick the repo of each issue that no label names one for, asking the human where unclear, and re-rank the epic, before it starts chunks. Today `do-epic <EPIC-KEY>` starts only an issue whose label already records its repo, and prints that every other one waits (`bin/do_epic/scheduler.py` → `chunks`). `split.split`, `repo_pick.picked` and `ranking` exist and nothing calls them. Each is a headless claude call on a rung: route it on `repoless-model`'s rung of the shipped ladder. An `Unclear` pick is an interrupt on the terminal of the `do-epic <EPIC-KEY>` the human runs. A chunk that finishes starts the next chunks without planning again, so no window waits on a question. -- 2.52.0 From 13a22a994a96c09544bf821f7e061fc0ca5f9b25 Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv <lilleman@larvit.se> Date: Thu, 19 Nov 2026 03:20:11 +0100 Subject: [PATCH 10/10] Sort the new imports by their first binding --- bin/do_epic/chunk_prompt.py | 2 +- bin/do_epic/main.py | 2 +- bin/do_epic/test_scheduler.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/do_epic/chunk_prompt.py b/bin/do_epic/chunk_prompt.py index dce8a282..cea698dc 100644 --- a/bin/do_epic/chunk_prompt.py +++ b/bin/do_epic/chunk_prompt.py @@ -6,8 +6,8 @@ from do_epic import findings from loop_claude.project.records import HUMAN_RULE_NAMES, RECORD_FILES from text_files.markdown_text import listed import pathlib -from model_routing.ladder import ProjectRung from project_config.settings import ProjectConfig +from model_routing.ladder import ProjectRung from loop_claude.cycle import prompts from model_routing.route import Route from agent_cycle.worker_prompts import WorkerPrompts diff --git a/bin/do_epic/main.py b/bin/do_epic/main.py index 0586491b..51649a69 100644 --- a/bin/do_epic/main.py +++ b/bin/do_epic/main.py @@ -12,11 +12,11 @@ from loop_claude.loop.chunk_start import archived_route, routed from do_epic import chunk_prompt, findings, finish, gates, parked, scheduler, split, status from do_epic.repo_pick import ClaudeWork, HumanTask, recorded, Repo from loop_claude.loop.close import closed_cycle +from project_config.main import located as config_located from loop_claude.project.records import CONSEQUENCE, read_records from agent_cycle.run import Cycle, run_cycle from do_epic.config import DoEpicConfig, load from loop_effects.effects import Effects, say -from project_config.main import located as config_located from project_config.settings import Epic from record_store.jira_description import EpicDescription from do_epic.backend.protocol import EpicIssue, EpicStore diff --git a/bin/do_epic/test_scheduler.py b/bin/do_epic/test_scheduler.py index b8bfb573..a049d497 100644 --- a/bin/do_epic/test_scheduler.py +++ b/bin/do_epic/test_scheduler.py @@ -8,7 +8,6 @@ sys.path.insert(0, str(pathlib.Path(__file__).resolve().parents[1])) from do_epic.scheduler import Chunk, CHUNK_FLAG, chunks, Epic, refusal, RepoRoom, resume, start_chunks, Started, Waits from do_epic import chunk_prompt -from project_config import settings from do_epic.backend.protocol import EpicIssue from failure import Failure from do_epic.parked import file_of, park, Parked @@ -16,6 +15,7 @@ from do_epic.epic_record import parallel_chunks_in from loop_claude.cycle import prompts from model_routing.route import Route from model_routing.ladder import Rung +from project_config import settings from agent_cycle import tmux -- 2.52.0