From 1b022f4505f470f9e57fb4e5b72d7b599805b2bf Mon Sep 17 00:00:00 2001 From: Lilleman Date: Fri, 20 Nov 2026 09:09:15 +0100 Subject: [PATCH 01/10] Add do-epic --dry-run, which prints the Jira writes planning would make and the chunks that would start, and makes none --- README.md | 2 +- bin/do_epic/backend/fake.py | 16 ++++++-- bin/do_epic/dry_run.py | 68 ++++++++++++++++++++++++++++++++ bin/do_epic/main.py | 61 ++++++++++++++++++++++------- bin/do_epic/test_dry_run.py | 78 +++++++++++++++++++++++++++++++++++++ bin/do_epic/test_finish.py | 2 +- bin/do_epic/test_main.py | 63 ++++++++++++++++++++++++++++++ 7 files changed, 271 insertions(+), 19 deletions(-) create mode 100644 bin/do_epic/dry_run.py create mode 100644 bin/do_epic/test_dry_run.py diff --git a/README.md b/README.md index b59f1447..cc73356e 100644 --- a/README.md +++ b/README.md @@ -198,7 +198,7 @@ Install puts only `loop-claude` on `PATH`; call the others by their path, such a - `command-patterns [] [--calls ]` prints a table of the shell command patterns a release's archived chunks ran, such as `tea pr create`, for an audit of the release, and with `--calls ` saves each call as a JSON line; `command-patterns --help` states the columns and the line's keys. - `compress-archives` gzips each transcript in loop-claude's archive and each file in the review folders 30 days after it last changed, keeping all of them; Install's crontab line runs it daily. - `deploy-release [--cut] []` moves `~/.claude`, or the checkout named, to the newest release, as Update says; with `--cut`, run in the development clone, it first cuts the next release, as Release says. -- `do-epic ` runs the chunks of one Jira epic whose items span repos, or have none, each in its own window of the tmux session `epic-`, on the same cycle, judge and interrupt as loop-claude. The epic's description is its record: goals, audience, scoring and decisions. Before it starts chunks, do-epic plans each open issue that no label places yet, as "Set up a project" says. It files a sub-task per repo where the issue changes several repos. Otherwise it labels the issue with where it is worked, and asks you where that is unclear. It plans no issue your team filed a sub-task under: those sub-tasks run instead, each under a label of its own, and your team closes the issue. Then it puts the scored issues that do-epic itself filed in order of score. An open issue runs once a label names its repo or marks it as Claude's, in Jira's backlog order, as many at once as a line such as `**Max parallel chunks:** 2` in the epic's description allows, 1 without it, and as each repo's `parallel-chunks` allows. A chunk whose pull request waits on a gate parks. An open task of yours that blocks another issue gets a window that DMs you once and reads the epic every minute; once you close the task, the issues it blocked may start. do-epic closes the epic only once you confirm every goal. Install → "Set up a project" says how to set it up; `do-epic --help` states the flags and the contract. +- `do-epic ` runs the chunks of one Jira epic whose items span repos, or have none, each in its own window of the tmux session `epic-`, on the same cycle, judge and interrupt as loop-claude. The epic's description is its record: goals, audience, scoring and decisions. Before it starts chunks, do-epic plans each open issue that no label places yet, as "Set up a project" says. It files a sub-task per repo where the issue changes several repos. Otherwise it labels the issue with where it is worked, and asks you where that is unclear. It plans no issue your team filed a sub-task under: those sub-tasks run instead, each under a label of its own, and your team closes the issue. Then it puts the scored issues that do-epic itself filed in order of score. An open issue runs once a label names its repo or marks it as Claude's, in Jira's backlog order, as many at once as a line such as `**Max parallel chunks:** 2` in the epic's description allows, 1 without it, and as each repo's `parallel-chunks` allows. A chunk whose pull request waits on a gate parks. An open task of yours that blocks another issue gets a window that DMs you once and reads the epic every minute; once you close the task, the issues it blocked may start. `do-epic --dry-run` runs the planning and the scheduling against the epic as Jira holds it, and prints each label, sub-task, comment and rank move planning would write, each chunk that would start and why each other issue waits, without writing to Jira, starting a window or asking a question; run it first on a team's epic. do-epic closes the epic only once you confirm every goal. Install → "Set up a project" says how to set it up; `do-epic --help` states the flags and the contract. - `do-epic-e2e` runs `do-epic` against a sandbox epic on a real Jira site, as Test says. - `judge-replay [--offline]` replays loop-claude's judge on archived verdicts of the projects run on the model. It prints what each rung a review climbs to misses, and the lowest rung below those that returns every verdict, as each candidate above it does. With `--offline` it doesn't call a judge: it counts what a "?" rule, a decision table and a classifier trained on the archive decide of each verdict's kind from the worker's final message, and how many interrupts each misses. `judge-replay --help` states both replays. - `larv-review ` holds larv-review's mechanical rules: the chunk's review folder, the paired ruling's base and vote count, each pass's round count and the opening of its round commit's title, the scoring run's trigger and setup; the comprehension history's format, its latest places and its count of how often seats agree; and each reviewer's prompt header. `larv-review --help` states them. `settings.json` → `hooks` runs `larv-review reviewer-context` as each subagent starts. A reviewer under `agents/` whose frontmatter has `omitClaudeMd: true` starts without `CLAUDE.md`, and the command hands it that file's "Shared goal", "Prose" and "Vocabulary" sections. diff --git a/bin/do_epic/backend/fake.py b/bin/do_epic/backend/fake.py index 567352a3..61cd83df 100644 --- a/bin/do_epic/backend/fake.py +++ b/bin/do_epic/backend/fake.py @@ -1,4 +1,4 @@ -"""An epic held in memory, for do-epic's tests, held to contract.py like every backend.""" +"""An epic held in memory, for do-epic's tests and its `--dry-run`, held to contract.py like every backend.""" import dataclasses from do_epic.backend.protocol import EpicIssue, no_blocker, no_child, no_parent, no_words, unfit, unfit_label @@ -7,12 +7,13 @@ from failure import Failure @dataclasses.dataclass class MemoryEpic: - """An epic whose issues rank in the order filed, until one is ranked. Where fails is set, every read, filing, label, comment, rank, issue finish and closing fails with it as the reason. comments holds each issue's comments, and the epic's, by key. done says whether the epic is closed.""" + """An epic whose issues rank in the order filed, until one is ranked. Where fails is set, every read, filing, label, comment, rank, issue finish and closing fails with it as the reason. comments holds each issue's comments, and the epic's, by key. done says whether the epic is closed. writes says each write that succeeded, in order.""" epic_key: str issues: list[EpicIssue] = dataclasses.field(default_factory=list) comments: dict[str, list[str]] = dataclasses.field(default_factory=dict) fails: str | None = None done: bool = False + writes: list[str] = dataclasses.field(default_factory=list) def read(self) -> list[EpicIssue] | Failure: if self.fails: @@ -29,10 +30,15 @@ class MemoryEpic: return no_parent(self.epic_key, parent) if blocked_by is not None and blocked_by not in {issue.key for issue in self.issues if issue.parent == self.epic_key or issue.parent in children}: return no_blocker(self.epic_key, blocked_by) - key = f"{self.epic_key.rpartition('-')[0]}-{len(self.issues) + 100}" + key = self.next_key() self.issues.append(EpicIssue(key, summary, detail.strip(), tuple(sorted(labels)), None, "To Do", False, parent, blockers=(blocked_by,) if blocked_by else (), by_loop=True)) + self.writes.append(f"file {key} under {parent}: {summary}" + (f", labelled {', '.join(sorted(labels))}" if labels else "") + (f", blocked by {blocked_by}" if blocked_by else "")) return key + def next_key(self) -> str: + """The key of the next issue filed.""" + return f"{self.epic_key.rpartition('-')[0]}-{len(self.issues) + 100}" + def add_label(self, key: str, label: str) -> None | Failure: if self.fails: return Failure(self.fails) @@ -52,6 +58,7 @@ class MemoryEpic: return Failure(f"{stray} is not one of the child issues of the epic {self.epic_key}, so {key} is not ranked") self.issues.remove(children[key]) self.issues.insert(self.issues.index(children[before]), children[key]) + self.writes.append(f"rank {key} before {before}") return None def comment(self, key: str, text: str) -> None | Failure: @@ -62,6 +69,7 @@ class MemoryEpic: if not any(issue.key == key and issue.parent == self.epic_key for issue in self.issues): return no_child(self.epic_key, key, "commented on") self.comments.setdefault(key, []).append(text.strip()) + self.writes.append(f"comment on {key}: {text.strip()}") return None def closed(self) -> bool | Failure: @@ -74,6 +82,7 @@ class MemoryEpic: return refused self.comments.setdefault(self.epic_key, []).append(summary.strip()) self.done = True + self.writes.append(f"close the epic: {summary.strip()}") return None def finish_issue(self, key: str) -> None | Failure: @@ -85,6 +94,7 @@ class MemoryEpic: return no_child(self.epic_key, key, "finished") if not child.done: self.change(key, status="Done", done=True) + self.writes.append(f"finish {key}") return None def change(self, key: str, **fields: object) -> None: diff --git a/bin/do_epic/dry_run.py b/bin/do_epic/dry_run.py new file mode 100644 index 00000000..703c9dfd --- /dev/null +++ b/bin/do_epic/dry_run.py @@ -0,0 +1,68 @@ +"""What `do-epic --dry-run` runs planning and the scheduler on, in place of Jira and tmux: an in-memory copy of the epic that records each write, and a tmux that starts no window. Reads of the epic and of tmux's windows are real, so the run sees the epic and the chunks as they are now.""" +import dataclasses +import subprocess + +from agent_cycle.tmux import Tmux +from do_epic.backend.fake import MemoryEpic +from do_epic.backend.protocol import EpicStore +from failure import Failure +from git_cli.git_repo import Git + +# The tmux commands that only read. Each other command makes or changes a session or a window. +READS = ("list-windows", "show-options") +# The commands that start a window, which a later listing shows. +STARTS = ("new-session", "new-window") + + +@dataclasses.dataclass +class DryEpic(MemoryEpic): + """The epic as `store` holds it. A sub-task it files gets a key no Jira issue has, such as ABC-new1, since Jira alone gives the next number.""" + filed: int = 0 + + def next_key(self) -> str: + self.filed += 1 + return f"{self.epic_key.rpartition('-')[0]}-new{self.filed}" + + +def seeded(store: EpicStore) -> DryEpic | Failure: + """A DryEpic with the issues and the closed state that store holds now, or why they cannot be read.""" + issues = store.read() + done = store.closed() + if isinstance(issues, Failure): + return issues + return done if isinstance(done, Failure) else DryEpic(store.epic_key, list(issues), done=done) + + +def recording(real: Tmux) -> Tmux: + """real for each read; a command that starts a window is answered as if it had, and the window shows in every later listing, as a window that runs. Any other command, which would change a window, is answered as done.""" + started: list[tuple[str, str, str]] = [] + + def run(args: list[str]) -> subprocess.CompletedProcess[str]: + if args[0] in STARTS: + named = "-s" if "-s" in args else "-t" + session = args[args.index(named) + 1].strip("=:") + started.append((session, args[args.index("-n") + 1], args[args.index("-c") + 1])) + return subprocess.CompletedProcess(args, 0, f"@dry{len(started)}\n", "") + if args[0] not in READS: + return subprocess.CompletedProcess(args, 0, "", "") + done = real(args) + if args[0] != "list-windows": + return done + rows = done.stdout if done.returncode == 0 else "" + if "-a" in args: + rows += "".join(f"{session}\t{name}\t0\t@dry{at}\t{cwd}\n" for at, (session, name, cwd) in enumerate(started, 1)) + else: + rows += "".join(f"{name}\t0\t@dry{at}\n" for at, (session, name, _) in enumerate(started, 1) if f"={session}" == args[args.index("-t") + 1]) + return subprocess.CompletedProcess(args, 0, rows, "") + + return run + + +def without_clones(real: Git) -> Git: + """real, except that a command with `clone` among its words fails, so that no repo is cloned.""" + def run(*args: str, cwd: str | None = None, timeout: float | None = None, guarded: bool = False, errors: str = "strict") -> str | Failure: + if "clone" in args: + return Failure("a dry run clones nothing") + return real(*args, cwd=cwd, timeout=timeout, guarded=guarded, errors=errors) + + return run diff --git a/bin/do_epic/main.py b/bin/do_epic/main.py index 29f75396..a609f760 100644 --- a/bin/do_epic/main.py +++ b/bin/do_epic/main.py @@ -10,7 +10,7 @@ import typing from chunk_driver.cycle_start import announced_route, cycle_of, project_routing, routing_on from chunk_driver.claims import CHUNK_FLAG -from do_epic import chunk_prompt, findings, finish, gates, human_tasks, parked, planning, scheduler, split, status +from do_epic import chunk_prompt, dry_run, findings, finish, gates, human_tasks, parked, planning, scheduler, split, status from chunk_driver.chunk_run import ChunkRun, closed_cycle from do_epic.repo_pick import ClaudeWork, HumanTask, recorded, Repo from project_config.main import located as config_located @@ -40,7 +40,7 @@ from agent_cycle.stop import Stop from agent_cycle.direct_message import tell from agent_cycle import tmux -HELP = f"""usage: do-epic [--status] +HELP = f"""usage: do-epic [--status | --dry-run] {findings.USAGE} {finish.USAGE} @@ -62,6 +62,7 @@ on once the checks pass, the approval comes or a reviewer comments, and a place name says `awaits a slot`. In a repo whose config sets `merge = "human"`, a chunk never merges: once its pull request is ready, with nothing else to wait on, the window's name says `awaits your merge`, and its worker goes on once you merged it. A parked chunk survives a reboot: run do-epic again to go on polling. --status doesn't start any chunk. It prints a line per open issue: that its chunk runs or asks you a question, or why it waits, such as the gate a parked chunk awaits and since when. +--dry-run runs the planning and the scheduling against the epic as Jira holds it, and writes nothing to Jira, starts no window and asks no question. It prints each label, sub-task, comment and rank move that planning would write, each chunk that would start and why each other issue waits. Planning's claude calls still run, and a repo that is missing isn't cloned. A question planning would ask is printed instead. {findings.HELP} {finish.HELP} The Jira site and its credentials are set in ~/.claude-projects/do-epic/config.toml.""" @@ -69,6 +70,8 @@ The Jira site and its credentials are set in ~/.claude-projects/do-epic/config.t ARCHIVE = ".claude/do-epic-transcripts" # The flag that prints what each open issue does. STATUS_FLAG = "--status" +# The flag that prints what planning and the scheduler would do, and does none of it. +DRY_RUN_FLAG = "--dry-run" # How often a parked chunk reads its pull request's gate, and a human task's window reads the epic: a person answers in hours, and each read is a few calls. POLL_SECONDS = 60 @@ -119,7 +122,8 @@ def main(argv: list[str], env: typing.Mapping[str, str], paths: Paths, launcher: def run(argv: list[str], env: typing.Mapping[str, str], paths: Paths, launcher: pathlib.Path, effects: Effects, backend: Backend, stdin: typing.TextIO, forge_at: typing.Callable[[str], Run]) -> Stop: chunk, words = (argv[1], argv[2:]) if len(argv) >= 2 and argv[0] == CHUNK_FLAG else (None, argv) status_asked = chunk is None and words[1:] == [STATUS_FLAG] - words = words[:1] if status_asked else words + dry_run_asked = chunk is None and words[1:] == [DRY_RUN_FLAG] + words = words[:1] if status_asked or dry_run_asked else words # What the words after the epic's key write into the epic, where they are a filing or a decision. writes = findings.parsed(words[1:]) if chunk is None else None closes = chunk is None and words[1:] == [finish.CLOSE] @@ -128,12 +132,14 @@ def run(argv: list[str], env: typing.Mapping[str, str], paths: Paths, launcher: if writes or closes: return epic_written(words[0], writes, paths, backend, stdin) # Before anything starts: a clone, a claude session or a tmux window. - if reason := tmux.unusable(effects.tmux, chunk_prompt.DRIVER): + if not dry_run_asked and (reason := tmux.unusable(effects.tmux, chunk_prompt.DRIVER)): return Stop(1, reason) config = load(paths.home) if isinstance(config, Failure): return Stop(1, config.reason) store, record = backend(config, words[0]) + if dry_run_asked: + return dry_run_printed(EpicRun(words[0], config, store, record, paths, env, launcher, effects, forge_at)) epic = EpicRun(words[0], config, store, record, paths, env, launcher, effects, forge_at) if status_asked: return status_printed(epic) @@ -159,6 +165,21 @@ def epic_written(key: str, writes: findings.Write | None, paths: Paths, backend: def windows_opened(epic: EpicRun) -> Stop: """What the do-epic the human runs does: plans the open issues (`planning`), starts each chunk that may start now, says why each other open issue waits, then puts the epic's session on the terminal until the human detaches.""" + started = planned_and_started(epic) + if isinstance(started, Stop): + return started + chunks_said(epic, started, "started", f" in the tmux session {epic.session}") + if not tmux.listed(epic.session, epic.effects.tmux): + return Stop(0, "") + if not epic.effects.on_terminal(): + say(f"not on a terminal; see the chunks with `tmux attach -t ={epic.session}`", epic.effects, stdout=True) + return Stop(0, "") + shown = tmux.show(epic.session, "TMUX" in epic.env) + return Stop(1, f"`tmux {' '.join(shown)}` failed; the chunks go on in the tmux session") if epic.effects.tmux_on_terminal(shown) else Stop(0, "") + + +def planned_and_started(epic: EpicRun) -> scheduler.Started | Stop: + """Plans the epic's open issues, then starts each chunk that may start now.""" read = epic.store.read() if isinstance(read, Failure): return Stop(1, read.reason) @@ -169,20 +190,32 @@ def windows_opened(epic: EpicRun) -> Stop: # One issue or repo that cannot be planned holds back only itself: each chunk that may start still does. say(f"the epic {epic.key} is not planned in full: {stopped.reason}", epic.effects) started = chunks_started(epic, issues, None) - if isinstance(started, Failure): - return Stop(1, started.reason) - say(f"started {', '.join(started.started)} in the tmux session {epic.session}" if started.started else "started no chunk", epic.effects, stdout=True) + return Stop(1, started.reason) if isinstance(started, Failure) else started + + +def chunks_said(epic: EpicRun, started: scheduler.Started, verb: str, where: str) -> None: + """Prints each chunk that started, after verb and before where, else that none did, then why each other open issue waits, and whether the epic is closed.""" + say(f"{verb} {', '.join(started.started)}{where}" if started.started else f"{verb} no chunk", epic.effects, stdout=True) for wait in started.waits: say(f"{wait.issue} waits: {wait.reason}", epic.effects, stdout=True) if started.closed: say(f"the epic {epic.key} is closed", epic.effects, stdout=True) - if not tmux.listed(epic.session, epic.effects.tmux): - return Stop(0, "") - if not epic.effects.on_terminal(): - say(f"not on a terminal; see the chunks with `tmux attach -t ={epic.session}`", epic.effects, stdout=True) - return Stop(0, "") - shown = tmux.show(epic.session, "TMUX" in epic.env) - return Stop(1, f"`tmux {' '.join(shown)}` failed; the chunks go on in the tmux session") if epic.effects.tmux_on_terminal(shown) else Stop(0, "") + + +def dry_run_printed(epic: EpicRun) -> Stop: + """What `do-epic --dry-run` does: runs windows_opened's planning and scheduling on a copy of the epic and a tmux that starts nothing, then prints each Jira write planning made there. It never puts the session on the terminal or asks a question.""" + dry = dry_run.seeded(epic.store) + if isinstance(dry, Failure): + return Stop(1, dry.reason) + effects = dataclasses.replace(epic.effects, tmux=dry_run.recording(epic.effects.tmux), git=dry_run.without_clones(epic.effects.git), on_terminal=lambda: False) + rehearsal = dataclasses.replace(epic, store=dry, effects=effects) + say("dry run: nothing is written to Jira and no window starts", effects, stdout=True) + started = planned_and_started(rehearsal) + say("planning would write to Jira:\n" + "\n".join(f"- {write}" for write in dry.writes) if dry.writes else "planning would write nothing to Jira", effects, stdout=True) + if isinstance(started, Stop): + return started + chunks_said(rehearsal, started, "would start", "") + return Stop(0, "") def chunks_started(epic: EpicRun, issues: list[EpicIssue], own: str | None) -> scheduler.Started | Failure: diff --git a/bin/do_epic/test_dry_run.py b/bin/do_epic/test_dry_run.py new file mode 100644 index 00000000..e18a26da --- /dev/null +++ b/bin/do_epic/test_dry_run.py @@ -0,0 +1,78 @@ +import pathlib +import subprocess +import sys +import unittest + +sys.path.insert(0, str(pathlib.Path(__file__).resolve().parents[1])) + +from do_epic import dry_run +from do_epic.backend.fake import MemoryEpic +from do_epic.test_scheduler import issue +from failure import Failure + +LISTED = "-t", "=epic-ABC-12", "-F", "#{window_name}\t#{pane_dead}\t#{window_id}" +START = ["new-window", "-d", "-t", "=epic-ABC-12:", "-n", "ABC-21", "-c", "/code/api", "-P", "-F", "#{window_id}", "--", "do-epic"] + + +def tmux(calls: list[list[str]], shown: str = "ABC-20\t0\t@1\n"): + def run(args: list[str]) -> subprocess.CompletedProcess[str]: + calls.append(args) + return subprocess.CompletedProcess(args, 0, shown, "") + return run + + +class TheRecordingTmux(unittest.TestCase): + def test_starts_no_window_and_lists_the_one_it_would_start_beside_the_real_ones(self) -> None: + calls: list[list[str]] = [] + run = dry_run.recording(tmux(calls)) + self.assertEqual(run(START).stdout, "@dry1\n") + self.assertEqual(run(["list-windows", *LISTED]).stdout, "ABC-20\t0\t@1\nABC-21\t0\t@dry1\n") + everywhere = run(["list-windows", "-a", "-F", "x"]).stdout + self.assertEqual(everywhere, "ABC-20\t0\t@1\nepic-ABC-12\tABC-21\t0\t@dry1\t/code/api\n") + self.assertEqual([call[0] for call in calls], ["list-windows", "list-windows"]) + + def test_lists_the_window_it_would_start_where_tmux_finds_no_session(self) -> None: + def none(args: list[str]) -> subprocess.CompletedProcess[str]: + return subprocess.CompletedProcess(args, 1, "", "no server running") + run = dry_run.recording(none) + run(["new-session", "-d", "-s", "epic-ABC-12", "-n", "ABC-21", "-c", "/code/api"]) + self.assertEqual(run(["list-windows", *LISTED]).stdout, "ABC-21\t0\t@dry1\n") + self.assertEqual(run(["list-windows", "-t", "=epic-ABC-99", "-F", "x"]).stdout, "") + + def test_answers_a_change_as_done_and_reads_the_real_tmux_for_a_read(self) -> None: + calls: list[list[str]] = [] + run = dry_run.recording(tmux(calls)) + self.assertEqual(run(["kill-window", "-t", "@1"]).returncode, 0) + self.assertEqual(run(["show-options", "-qv", "-t", "=s:", "@loop-root"]).stdout, "ABC-20\t0\t@1\n") + self.assertEqual(calls, [["show-options", "-qv", "-t", "=s:", "@loop-root"]]) + + +class TheGitThatClonesNothing(unittest.TestCase): + def test_fails_a_clone_and_runs_any_other_command(self) -> None: + ran: list[tuple[str, ...]] = [] + + def real(*args: str, cwd: str | None = None, timeout: float | None = None, guarded: bool = False, errors: str = "strict") -> str | Failure: + ran.append(args) + return "ok" + git = dry_run.without_clones(real) + self.assertEqual(git("-c", "a=b", "clone", "--", "url", "dir"), Failure("a dry run clones nothing")) + self.assertEqual(git("remote", cwd="/c"), "ok") + self.assertEqual(ran, [("remote",)]) + + +class TheEpicItCopies(unittest.TestCase): + def test_copies_the_issues_and_the_closed_state_and_files_under_keys_jira_never_gives(self) -> None: + real = MemoryEpic("ABC-12", [issue("ABC-20"), issue("ABC-21")], done=True) + copy = dry_run.seeded(real) + assert not isinstance(copy, Failure) + self.assertEqual((copy.closed(), [each.key for each in copy.read()]), (True, ["ABC-20", "ABC-21"])) # type: ignore[union-attr] + self.assertEqual([copy.file("ABC-20", "A", "d", ()), copy.file("ABC-20", "B", "d", ())], ["ABC-new1", "ABC-new2"]) + self.assertEqual((real.writes, [each.key for each in real.issues]), ([], ["ABC-20", "ABC-21"])) + self.assertEqual(copy.writes, ["file ABC-new1 under ABC-20: A", "file ABC-new2 under ABC-20: B"]) + + def test_fails_where_the_real_epic_cannot_be_read(self) -> None: + self.assertEqual(dry_run.seeded(MemoryEpic("ABC-12", [], fails="Jira answered 503")), Failure("Jira answered 503")) + + +if __name__ == "__main__": + unittest.main() diff --git a/bin/do_epic/test_finish.py b/bin/do_epic/test_finish.py index bd248984..5022bdf6 100644 --- a/bin/do_epic/test_finish.py +++ b/bin/do_epic/test_finish.py @@ -150,7 +150,7 @@ class ClosingTheEpic(DoEpicTest): for argv in (["ABC-12", "--close-epic", "now"], ["--close-epic", "ABC-12"], ["--close-epic"]): code, out, err = self.run_main(argv, FakeEffects()) self.assertEqual((code, out), (1, ""), argv) - self.assertIn("usage: do-epic [--status]\n", err) + self.assertIn("usage: do-epic [--status | --dry-run]\n", err) self.assertIn("do-epic --close-epic <<'EOF' summary EOF", err) diff --git a/bin/do_epic/test_main.py b/bin/do_epic/test_main.py index 6f18542d..ba50a967 100644 --- a/bin/do_epic/test_main.py +++ b/bin/do_epic/test_main.py @@ -968,6 +968,69 @@ class TheStatus(DoEpicTest): self.assertIn("Jira answered 503\n", err) +class TheDryRun(DoEpicTest): + def setUp(self) -> None: + super().setUp() + for repo in ("api", "web"): + configured(self, self.home / "code" / repo, home=self.home) + (self.home / "code" / repo / "README.md").write_text("## Goals\nServe the API.\n\n## Audience\nIts callers.\n", encoding="utf-8") + self.stores: list[MemoryEpic] = [] + made = self.backend + self.backend = lambda config, key: (self.stores.append(made(config, key)[0]) or self.stores[-1], EpicRecord(Description(self.description))) # type: ignore[method-assign,assignment] + + def test_prints_each_write_and_each_chunk_it_would_start_and_makes_none_of_them(self) -> None: + self.issues = [issue("ABC-20"), issue("ABC-21", "do-epic-claude")] + parts = structured({"parts": [{"repo": "api", "change": "Add the endpoint."}, {"repo": "web", "change": "Call it."}], "comment": "Split by repo: api and web."}) + fake = FakeEffects(on_terminal=True, claude=[parts]) + code, out, err = self.run_main(["ABC-12", "--dry-run"], fake) + self.assertEqual((code, err), (0, "")) + shown = out.replace("<1790000000> ", "") + self.assertIn("planning would write to Jira:\n- file ABC-new1 under ABC-20: [api] Do ABC-20, labelled repo:api\n- file ABC-new2 under ABC-20: [web] Do ABC-20, labelled repo:web\n- comment on ABC-20: Split by repo: api and web.\n", shown) + self.assertIn("would start ABC-new1, ABC-new2\nABC-21 waits: the epic runs as many chunks as its `**Max parallel chunks:**` line allows: 2\n", shown) + self.assertEqual(self.stores[0].writes, []) + self.assertEqual([each.key for each in self.stores[0].issues], ["ABC-20", "ABC-21"]) + changing = {"new-session", "new-window", "kill-window", "set-option", "rename-window"} + self.assertEqual([args for args in fake.tmux_calls if args[0] in changing], []) + + def test_counts_the_chunks_it_would_start_against_the_epics_cap_and_a_repos_limit(self) -> None: + self.issues = [issue("ABC-21", "do-epic-claude"), issue("ABC-22", "do-epic-claude"), issue("ABC-23", "do-epic-claude")] + self.description = DESCRIPTION.replace("2", "1") + code, out, _ = self.run_main(["ABC-12", "--dry-run"], FakeEffects(on_terminal=True)) + self.assertEqual(code, 0) + shown = out.replace("<1790000000> ", "") + self.assertIn("planning would write nothing to Jira\nwould start ABC-21\n", shown) + self.assertIn("ABC-22 waits: the epic runs as many chunks as its `**Max parallel chunks:**` line allows: 1\n", shown) + + def test_prints_the_question_planning_would_ask_and_asks_none(self) -> None: + self.issues = [issue("ABC-20")] + unclear = structured({"pick": "unclear", "question": "Is the importer in api or in web?"}) + fake = FakeEffects(on_terminal=True, claude=[structured({"parts": []}), unclear], inputs=["api"]) + code, out, _ = self.run_main(["ABC-12", "--dry-run"], fake) + self.assertEqual(code, 0) + self.assertIn("ABC-20 waits for your answer: Is the importer in api or in web?", out) + self.assertEqual([seam for seam, _ in fake.calls if seam == "input"], []) + self.assertIn("planning would write nothing to Jira\n", out) + + def test_works_without_tmux_and_a_chunk_in_a_missing_repo_waits(self) -> None: + self.issues = [issue("ABC-20", "repo:missing"), issue("ABC-21", "do-epic-claude")] + fake = FakeEffects(on_terminal=False, tmux_version="") + code, out, _ = self.run_main(["ABC-12", "--dry-run"], fake) + self.assertEqual(code, 0) + self.assertIn("would start ABC-21\n", out) + self.assertIn("ABC-20 waits:", out) + self.assertIn("ABC-20 waits: missing is missing", out) + self.assertEqual([what for seam, what in fake.calls if seam == "git" and "clone" in what], []) + + def test_stops_where_the_epic_cannot_be_read(self) -> None: + store = MemoryEpic("ABC-12", [], fails="Jira answered 503") + self.backend = lambda config, key: (store, EpicRecord(Description(self.description))) # type: ignore[method-assign,arg-type] + code, _, err = self.run_main(["ABC-12", "--dry-run"], FakeEffects()) + self.assertEqual((code, "Jira answered 503\n" in err), (1, True)) + + def test_is_in_the_help(self) -> None: + self.assertIn("--dry-run", main.HELP) + self.assertEqual(self.run_main(["ABC-12", "--dry-run", "--status"], FakeEffects())[0], 1) + if __name__ == "__main__": unittest.main() -- 2.52.0 From af2593370a17f8fca5a7b405915b4853b29ae0e2 Mon Sep 17 00:00:00 2001 From: Lilleman Date: Fri, 20 Nov 2026 09:13:36 +0100 Subject: [PATCH 02/10] Log a label among the writes a dry run prints --- bin/do_epic/backend/fake.py | 1 + bin/do_epic/test_dry_run.py | 17 +++++++++++++++++ bin/do_epic/test_main.py | 6 ++++++ 3 files changed, 24 insertions(+) diff --git a/bin/do_epic/backend/fake.py b/bin/do_epic/backend/fake.py index 61cd83df..6f2defcb 100644 --- a/bin/do_epic/backend/fake.py +++ b/bin/do_epic/backend/fake.py @@ -48,6 +48,7 @@ class MemoryEpic: if child is None: return no_child(self.epic_key, key, "labelled") self.change(key, labels=tuple(sorted({*child.labels, label}))) + self.writes.append(f"label {key} with {label}") return None def rank(self, key: str, before: str) -> None | Failure: diff --git a/bin/do_epic/test_dry_run.py b/bin/do_epic/test_dry_run.py index e18a26da..e641cf11 100644 --- a/bin/do_epic/test_dry_run.py +++ b/bin/do_epic/test_dry_run.py @@ -70,6 +70,23 @@ class TheEpicItCopies(unittest.TestCase): self.assertEqual((real.writes, [each.key for each in real.issues]), ([], ["ABC-20", "ABC-21"])) self.assertEqual(copy.writes, ["file ABC-new1 under ABC-20: A", "file ABC-new2 under ABC-20: B"]) + def test_notes_each_kind_of_write_in_order(self) -> None: + epic = MemoryEpic("ABC-12", [issue("ABC-20"), issue("ABC-21")]) + epic.file("ABC-20", "Sub", "d", ("repo:api",), "ABC-21") + epic.add_label("ABC-21", "do-epic-claude") + epic.rank("ABC-21", "ABC-20") + epic.comment("ABC-20", " Why. ") + epic.finish_issue("ABC-21") + epic.close("All done") + self.assertEqual(epic.writes, ["file ABC-102 under ABC-20: Sub, labelled repo:api, blocked by ABC-21", "label ABC-21 with do-epic-claude", "rank ABC-21 before ABC-20", "comment on ABC-20: Why.", "finish ABC-21", "close the epic: All done"]) + + def test_notes_no_write_that_fails(self) -> None: + epic = MemoryEpic("ABC-12", [issue("ABC-20")]) + epic.add_label("ABC-99", "x") + epic.comment("ABC-20", " ") + epic.finish_issue("ABC-99") + self.assertEqual(epic.writes, []) + def test_fails_where_the_real_epic_cannot_be_read(self) -> None: self.assertEqual(dry_run.seeded(MemoryEpic("ABC-12", [], fails="Jira answered 503")), Failure("Jira answered 503")) diff --git a/bin/do_epic/test_main.py b/bin/do_epic/test_main.py index ba50a967..6e6dd988 100644 --- a/bin/do_epic/test_main.py +++ b/bin/do_epic/test_main.py @@ -992,6 +992,12 @@ class TheDryRun(DoEpicTest): changing = {"new-session", "new-window", "kill-window", "set-option", "rename-window"} self.assertEqual([args for args in fake.tmux_calls if args[0] in changing], []) + def test_prints_the_label_a_pick_would_give_an_issue(self) -> None: + self.issues = [issue("ABC-20")] + code, out, _ = self.run_main(["ABC-12", "--dry-run"], FakeEffects(claude=[structured({"parts": []}), structured({"pick": "claude"})])) + self.assertEqual(code, 0) + self.assertIn("planning would write to Jira:\n- label ABC-20 with do-epic-claude\nwould start ABC-20\n", out.replace("<1790000000> ", "")) + def test_counts_the_chunks_it_would_start_against_the_epics_cap_and_a_repos_limit(self) -> None: self.issues = [issue("ABC-21", "do-epic-claude"), issue("ABC-22", "do-epic-claude"), issue("ABC-23", "do-epic-claude")] self.description = DESCRIPTION.replace("2", "1") -- 2.52.0 From 2c0673f5bfee198707bb66685034b704aa4fcfc2 Mon Sep 17 00:00:00 2001 From: Lilleman Date: Fri, 20 Nov 2026 09:24:49 +0100 Subject: [PATCH 03/10] Kill the surviving mutants of the dry run: pin the tmux and git wrappers, the write log and the printed output --- bin/do_epic/main.py | 4 ++-- bin/do_epic/test_dry_run.py | 40 +++++++++++++++++++++++++++++++++++-- bin/do_epic/test_main.py | 17 +++++++++++++--- 3 files changed, 54 insertions(+), 7 deletions(-) diff --git a/bin/do_epic/main.py b/bin/do_epic/main.py index a609f760..16c8998d 100644 --- a/bin/do_epic/main.py +++ b/bin/do_epic/main.py @@ -138,9 +138,9 @@ def run(argv: list[str], env: typing.Mapping[str, str], paths: Paths, launcher: if isinstance(config, Failure): return Stop(1, config.reason) store, record = backend(config, words[0]) - if dry_run_asked: - return dry_run_printed(EpicRun(words[0], config, store, record, paths, env, launcher, effects, forge_at)) epic = EpicRun(words[0], config, store, record, paths, env, launcher, effects, forge_at) + if dry_run_asked: + return dry_run_printed(epic) if status_asked: return status_printed(epic) return windows_opened(epic) if chunk is None else chunk_run(chunk, epic) diff --git a/bin/do_epic/test_dry_run.py b/bin/do_epic/test_dry_run.py index e641cf11..86ddd9f1 100644 --- a/bin/do_epic/test_dry_run.py +++ b/bin/do_epic/test_dry_run.py @@ -39,6 +39,25 @@ class TheRecordingTmux(unittest.TestCase): self.assertEqual(run(["list-windows", *LISTED]).stdout, "ABC-21\t0\t@dry1\n") self.assertEqual(run(["list-windows", "-t", "=epic-ABC-99", "-F", "x"]).stdout, "") + def test_answers_each_command_with_its_own_words_and_no_error(self) -> None: + def refused(args: list[str]) -> subprocess.CompletedProcess[str]: + return subprocess.CompletedProcess(args, 1, "junk", "no server") + def fields(done: subprocess.CompletedProcess[str]) -> tuple[object, int, str, str]: + return done.args, done.returncode, done.stdout, done.stderr + run = dry_run.recording(refused) + self.assertEqual(fields(run(START)), (START, 0, "@dry1\n", "")) + self.assertEqual(fields(run(["kill-window", "-t", "@1"])), (["kill-window", "-t", "@1"], 0, "", "")) + self.assertEqual(fields(run(["list-windows", *LISTED])), (["list-windows", *LISTED], 0, "ABC-21\t0\t@dry1\n", "")) + self.assertEqual(fields(dry_run.recording(refused)(["list-windows", *LISTED])), (["list-windows", *LISTED], 0, "", "")) + + def test_lists_every_window_it_would_start(self) -> None: + run = dry_run.recording(tmux([], "")) + run(START) + run(["new-window", "-d", "-t", "=epic-ABC-12:", "-n", "ABC-22", "-c", "/code/web", "-P"]) + run(["new-window", "-d", "-t", "=epic-ABC-99:", "-n", "ABC-23", "-c", "/code/web", "-P"]) + self.assertEqual(run(["list-windows", *LISTED]).stdout, "ABC-21\t0\t@dry1\nABC-22\t0\t@dry2\n") + self.assertEqual(run(["list-windows", "-a", "-F", "x"]).stdout, "epic-ABC-12\tABC-21\t0\t@dry1\t/code/api\nepic-ABC-12\tABC-22\t0\t@dry2\t/code/web\nepic-ABC-99\tABC-23\t0\t@dry3\t/code/web\n") + def test_answers_a_change_as_done_and_reads_the_real_tmux_for_a_read(self) -> None: calls: list[list[str]] = [] run = dry_run.recording(tmux(calls)) @@ -59,6 +78,17 @@ class TheGitThatClonesNothing(unittest.TestCase): self.assertEqual(git("remote", cwd="/c"), "ok") self.assertEqual(ran, [("remote",)]) + def test_passes_every_option_on(self) -> None: + seen: list[tuple[tuple[str, ...], dict[str, object]]] = [] + + def real(*args: str, **options: object) -> str | Failure: + seen.append((args, options)) + return "ok" + git = dry_run.without_clones(real) # type: ignore[arg-type] + git("log", cwd="/c", timeout=5.0, guarded=True, errors="replace") + git("log") + self.assertEqual(seen, [(("log",), {"cwd": "/c", "timeout": 5.0, "guarded": True, "errors": "replace"}), (("log",), {"cwd": None, "timeout": None, "guarded": False, "errors": "strict"})]) + class TheEpicItCopies(unittest.TestCase): def test_copies_the_issues_and_the_closed_state_and_files_under_keys_jira_never_gives(self) -> None: @@ -72,13 +102,13 @@ class TheEpicItCopies(unittest.TestCase): def test_notes_each_kind_of_write_in_order(self) -> None: epic = MemoryEpic("ABC-12", [issue("ABC-20"), issue("ABC-21")]) - epic.file("ABC-20", "Sub", "d", ("repo:api",), "ABC-21") + epic.file("ABC-20", "Sub", "d", ("repo:api", "do-epic-claude"), "ABC-21") epic.add_label("ABC-21", "do-epic-claude") epic.rank("ABC-21", "ABC-20") epic.comment("ABC-20", " Why. ") epic.finish_issue("ABC-21") epic.close("All done") - self.assertEqual(epic.writes, ["file ABC-102 under ABC-20: Sub, labelled repo:api, blocked by ABC-21", "label ABC-21 with do-epic-claude", "rank ABC-21 before ABC-20", "comment on ABC-20: Why.", "finish ABC-21", "close the epic: All done"]) + self.assertEqual(epic.writes, ["file ABC-102 under ABC-20: Sub, labelled do-epic-claude, repo:api, blocked by ABC-21", "label ABC-21 with do-epic-claude", "rank ABC-21 before ABC-20", "comment on ABC-20: Why.", "finish ABC-21", "close the epic: All done"]) def test_notes_no_write_that_fails(self) -> None: epic = MemoryEpic("ABC-12", [issue("ABC-20")]) @@ -90,6 +120,12 @@ class TheEpicItCopies(unittest.TestCase): def test_fails_where_the_real_epic_cannot_be_read(self) -> None: self.assertEqual(dry_run.seeded(MemoryEpic("ABC-12", [], fails="Jira answered 503")), Failure("Jira answered 503")) + def test_fails_where_only_the_closed_state_cannot_be_read(self) -> None: + class Unclosed(MemoryEpic): + def closed(self) -> bool | Failure: + return Failure("no state") + self.assertEqual(dry_run.seeded(Unclosed("ABC-12", [issue("ABC-20")])), Failure("no state")) + if __name__ == "__main__": unittest.main() diff --git a/bin/do_epic/test_main.py b/bin/do_epic/test_main.py index 6e6dd988..19cf14e2 100644 --- a/bin/do_epic/test_main.py +++ b/bin/do_epic/test_main.py @@ -267,7 +267,9 @@ MODELS = {"LOOP_CLAUDE_JUDGE_MODEL": "claude-opus-5-5", "LOOP_CLAUDE_WORKER_MODE class TheHumansRun(DoEpicTest): def test_shows_the_session_on_a_terminal_and_says_when_tmux_cannot(self) -> None: fake = FakeEffects(windows="ABC-21\t0\t@9\n") - self.assertEqual(self.run_main(["ABC-12"], fake)[0], 0) + code, out, err = self.run_main(["ABC-12"], fake) + self.assertEqual((code, err), (0, "")) + self.assertEqual(out, "<1790000000> started no chunk\n<1790000000> ABC-20 waits: it is a human's task\n") self.assertEqual(fake.tmux_calls[-1], ["attach-session", "-t", "=epic-ABC-12"]) fake.effects = lambda made=fake.effects(): dataclasses.replace(made, tmux_on_terminal=lambda args: 1) # type: ignore[method-assign] code, _, err = self.run_main(["ABC-12"], fake, {"TMUX": "/tmp/tmux"}) @@ -284,14 +286,14 @@ class TheHumansRun(DoEpicTest): def test_off_a_terminal_it_says_how_to_see_the_chunks(self) -> None: code, out, err = self.run_main(["ABC-12"], FakeEffects(on_terminal=False, windows="ABC-21\t0\t@9\n")) self.assertEqual((code, err), (0, "")) - self.assertIn("not on a terminal; see the chunks with `tmux attach -t =epic-ABC-12`\n", out) + self.assertTrue(out.endswith("not on a terminal; see the chunks with `tmux attach -t =epic-ABC-12`\n")) def test_with_no_window_in_the_session_it_shows_none(self) -> None: self.issues = self.issues[:1] fake = FakeEffects() code, out, _ = self.run_main(["ABC-12"], fake) self.assertEqual(code, 0) - self.assertIn("started no chunk\n", out) + self.assertEqual(out, "<1790000000> started no chunk\n<1790000000> ABC-20 waits: it is a human's task\n") self.assertNotIn("attach-session", [args[0] for args in fake.tmux_calls]) def test_stops_without_its_settings_or_on_a_cap_it_cannot_read(self) -> None: @@ -1027,6 +1029,15 @@ class TheDryRun(DoEpicTest): self.assertIn("ABC-20 waits: missing is missing", out) self.assertEqual([what for seam, what in fake.calls if seam == "git" and "clone" in what], []) + def test_clones_no_missing_repo_and_says_so(self) -> None: + shutil.rmtree(self.home / "code/web") + self.issues = [issue("ABC-20", "repo:api"), issue("ABC-22", "repo:web")] + fake = FakeEffects(on_terminal=False, git=["git@host.example:team/api.git", ""]) + code, out, err = self.run_main(["ABC-12", "--dry-run"], fake) + self.assertEqual((code, err), (0, "")) + self.assertEqual(out.replace("<1790000000> ", ""), f"dry run: nothing is written to Jira and no window starts\nplanning would write nothing to Jira\nwould start ABC-20\nABC-22 waits: cannot clone git@host.example:team/web to {self.home / 'code/web'}: a dry run clones nothing. Where does web live?\n") + self.assertEqual([what for seam, what in fake.calls if seam == "git" and "clone" in what], []) + def test_stops_where_the_epic_cannot_be_read(self) -> None: store = MemoryEpic("ABC-12", [], fails="Jira answered 503") self.backend = lambda config, key: (store, EpicRecord(Description(self.description))) # type: ignore[method-assign,arg-type] -- 2.52.0 From 5630c3ba2e46fbcb75cdd09f5860c56a9896e440 Mon Sep 17 00:00:00 2001 From: Lilleman Date: Fri, 20 Nov 2026 09:53:06 +0100 Subject: [PATCH 04/10] =?UTF-8?q?Answer=20product-owner=20round=201:=201?= =?UTF-8?q?=20=F0=9F=94=B4,=201=20=F0=9F=9F=A1=20(0=20misread);=20say=20wh?= =?UTF-8?q?en=20planning=20stops=20at=20a=20missing=20repo,=20mark=20what?= =?UTF-8?q?=20the=20dry=20run=20would=20do,=20and=20reword=20its=20text=20?= =?UTF-8?q?and=20docs=20(the=20stability=20and=20prose=20answers=20are=20i?= =?UTF-8?q?n=20this=20commit=20too)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- bin/do_epic/dry_run.py | 8 ++++---- bin/do_epic/main.py | 22 ++++++++++++---------- bin/do_epic/test_dry_run.py | 2 +- bin/do_epic/test_main.py | 27 +++++++++++++++++++++++---- 5 files changed, 41 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index cc73356e..5a3150ec 100644 --- a/README.md +++ b/README.md @@ -198,7 +198,7 @@ Install puts only `loop-claude` on `PATH`; call the others by their path, such a - `command-patterns [] [--calls ]` prints a table of the shell command patterns a release's archived chunks ran, such as `tea pr create`, for an audit of the release, and with `--calls ` saves each call as a JSON line; `command-patterns --help` states the columns and the line's keys. - `compress-archives` gzips each transcript in loop-claude's archive and each file in the review folders 30 days after it last changed, keeping all of them; Install's crontab line runs it daily. - `deploy-release [--cut] []` moves `~/.claude`, or the checkout named, to the newest release, as Update says; with `--cut`, run in the development clone, it first cuts the next release, as Release says. -- `do-epic ` runs the chunks of one Jira epic whose items span repos, or have none, each in its own window of the tmux session `epic-`, on the same cycle, judge and interrupt as loop-claude. The epic's description is its record: goals, audience, scoring and decisions. Before it starts chunks, do-epic plans each open issue that no label places yet, as "Set up a project" says. It files a sub-task per repo where the issue changes several repos. Otherwise it labels the issue with where it is worked, and asks you where that is unclear. It plans no issue your team filed a sub-task under: those sub-tasks run instead, each under a label of its own, and your team closes the issue. Then it puts the scored issues that do-epic itself filed in order of score. An open issue runs once a label names its repo or marks it as Claude's, in Jira's backlog order, as many at once as a line such as `**Max parallel chunks:** 2` in the epic's description allows, 1 without it, and as each repo's `parallel-chunks` allows. A chunk whose pull request waits on a gate parks. An open task of yours that blocks another issue gets a window that DMs you once and reads the epic every minute; once you close the task, the issues it blocked may start. `do-epic --dry-run` runs the planning and the scheduling against the epic as Jira holds it, and prints each label, sub-task, comment and rank move planning would write, each chunk that would start and why each other issue waits, without writing to Jira, starting a window or asking a question; run it first on a team's epic. do-epic closes the epic only once you confirm every goal. Install → "Set up a project" says how to set it up; `do-epic --help` states the flags and the contract. +- `do-epic ` runs the chunks of one Jira epic whose items span repos, or have none, each in its own window of the tmux session `epic-`, on the same cycle, judge and interrupt as loop-claude. The epic's description is its record: goals, audience, scoring and decisions. Before it starts chunks, do-epic plans each open issue that no label places yet, as "Set up a project" says. It files a sub-task per repo where the issue changes several repos. Otherwise it labels the issue with where it is worked, and asks you where that is unclear. It plans no issue your team filed a sub-task under: those sub-tasks run instead, each under a label of its own, and your team closes the issue. Then it puts the scored issues that do-epic itself filed in order of score. An open issue runs once a label names its repo or marks it as Claude's, in Jira's backlog order, as many at once as a line such as `**Max parallel chunks:** 2` in the epic's description allows, 1 without it, and as each repo's `parallel-chunks` allows. A chunk whose pull request waits on a gate parks. An open task of yours that blocks another issue gets a window that DMs you once and reads the epic every minute; once you close the task, the issues it blocked may start. `do-epic --dry-run` prints what `do-epic ` would write to Jira and which chunks it would start, and does neither; run it before the first real run on a team's epic. `--help` lists what it prints and leaves out. do-epic closes the epic only once you confirm every goal. Install → "Set up a project" says how to set it up; `do-epic --help` states the flags and the contract. - `do-epic-e2e` runs `do-epic` against a sandbox epic on a real Jira site, as Test says. - `judge-replay [--offline]` replays loop-claude's judge on archived verdicts of the projects run on the model. It prints what each rung a review climbs to misses, and the lowest rung below those that returns every verdict, as each candidate above it does. With `--offline` it doesn't call a judge: it counts what a "?" rule, a decision table and a classifier trained on the archive decide of each verdict's kind from the worker's final message, and how many interrupts each misses. `judge-replay --help` states both replays. - `larv-review ` holds larv-review's mechanical rules: the chunk's review folder, the paired ruling's base and vote count, each pass's round count and the opening of its round commit's title, the scoring run's trigger and setup; the comprehension history's format, its latest places and its count of how often seats agree; and each reviewer's prompt header. `larv-review --help` states them. `settings.json` → `hooks` runs `larv-review reviewer-context` as each subagent starts. A reviewer under `agents/` whose frontmatter has `omitClaudeMd: true` starts without `CLAUDE.md`, and the command hands it that file's "Shared goal", "Prose" and "Vocabulary" sections. diff --git a/bin/do_epic/dry_run.py b/bin/do_epic/dry_run.py index 703c9dfd..6b1f3a4c 100644 --- a/bin/do_epic/dry_run.py +++ b/bin/do_epic/dry_run.py @@ -1,4 +1,4 @@ -"""What `do-epic --dry-run` runs planning and the scheduler on, in place of Jira and tmux: an in-memory copy of the epic that records each write, and a tmux that starts no window. Reads of the epic and of tmux's windows are real, so the run sees the epic and the chunks as they are now.""" +"""What `do-epic --dry-run` runs planning and the scheduler on, in place of Jira, tmux and git: an in-memory copy of the epic that records each write, a tmux that starts no window and a git that clones no repo. The copy starts as the epic is in Jira, and tmux's windows are read as they are, so the run sees the epic and the chunks as they are now.""" import dataclasses import subprocess @@ -16,7 +16,7 @@ STARTS = ("new-session", "new-window") @dataclasses.dataclass class DryEpic(MemoryEpic): - """The epic as `store` holds it. A sub-task it files gets a key no Jira issue has, such as ABC-new1, since Jira alone gives the next number.""" + """An in-memory epic. A sub-task it files gets a key no Jira issue has, such as ABC-new1, since Jira alone gives the next number.""" filed: int = 0 def next_key(self) -> str: @@ -34,7 +34,7 @@ def seeded(store: EpicStore) -> DryEpic | Failure: def recording(real: Tmux) -> Tmux: - """real for each read; a command that starts a window is answered as if it had, and the window shows in every later listing, as a window that runs. Any other command, which would change a window, is answered as done.""" + """real for each read. A command that starts a window is answered as if it had, and the window then shows in each later listing as a window that runs. Any other command, which would change a session or a window, is answered as done.""" started: list[tuple[str, str, str]] = [] def run(args: list[str]) -> subprocess.CompletedProcess[str]: @@ -62,7 +62,7 @@ def without_clones(real: Git) -> Git: """real, except that a command with `clone` among its words fails, so that no repo is cloned.""" def run(*args: str, cwd: str | None = None, timeout: float | None = None, guarded: bool = False, errors: str = "strict") -> str | Failure: if "clone" in args: - return Failure("a dry run clones nothing") + return Failure("a dry run doesn't clone a repo, but a real run would") return real(*args, cwd=cwd, timeout=timeout, guarded=guarded, errors=errors) return run diff --git a/bin/do_epic/main.py b/bin/do_epic/main.py index 16c8998d..75249101 100644 --- a/bin/do_epic/main.py +++ b/bin/do_epic/main.py @@ -62,7 +62,8 @@ on once the checks pass, the approval comes or a reviewer comments, and a place name says `awaits a slot`. In a repo whose config sets `merge = "human"`, a chunk never merges: once its pull request is ready, with nothing else to wait on, the window's name says `awaits your merge`, and its worker goes on once you merged it. A parked chunk survives a reboot: run do-epic again to go on polling. --status doesn't start any chunk. It prints a line per open issue: that its chunk runs or asks you a question, or why it waits, such as the gate a parked chunk awaits and since when. ---dry-run runs the planning and the scheduling against the epic as Jira holds it, and writes nothing to Jira, starts no window and asks no question. It prints each label, sub-task, comment and rank move that planning would write, each chunk that would start and why each other issue waits. Planning's claude calls still run, and a repo that is missing isn't cloned. A question planning would ask is printed instead. +--dry-run runs the planning and the scheduling against the epic as Jira holds it. It doesn't write anything to Jira, start a window or ask a question. It prints each label, sub-task, comment and rank move that planning would write, each chunk that would start and why each other issue waits. A sub-task not yet filed shows a key such as ABC-new1. A question planning would ask is printed instead of asked. Planning's claude calls still run. +A repo that is missing isn't cloned. Planning then stops there, so its writes are only those made before it, and the issues of that repo wait; a real run would clone it and go on. {findings.HELP} {finish.HELP} The Jira site and its credentials are set in ~/.claude-projects/do-epic/config.toml.""" @@ -70,7 +71,7 @@ The Jira site and its credentials are set in ~/.claude-projects/do-epic/config.t ARCHIVE = ".claude/do-epic-transcripts" # The flag that prints what each open issue does. STATUS_FLAG = "--status" -# The flag that prints what planning and the scheduler would do, and does none of it. +# The flag that prints what planning and the scheduler would do, without doing it. DRY_RUN_FLAG = "--dry-run" # How often a parked chunk reads its pull request's gate, and a human task's window reads the epic: a person answers in hours, and each read is a few calls. POLL_SECONDS = 60 @@ -178,8 +179,8 @@ def windows_opened(epic: EpicRun) -> Stop: return Stop(1, f"`tmux {' '.join(shown)}` failed; the chunks go on in the tmux session") if epic.effects.tmux_on_terminal(shown) else Stop(0, "") -def planned_and_started(epic: EpicRun) -> scheduler.Started | Stop: - """Plans the epic's open issues, then starts each chunk that may start now.""" +def planned_and_started(epic: EpicRun, dry: bool = False) -> scheduler.Started | Stop: + """Plans the epic's open issues, then starts each chunk that may start now. Where dry, a planning that stops early says so on stdout, and that the writes shown are those made before it stopped.""" read = epic.store.read() if isinstance(read, Failure): return Stop(1, read.reason) @@ -188,13 +189,13 @@ def planned_and_started(epic: EpicRun) -> scheduler.Started | Stop: return Stop(1, f"the epic is not planned, so no chunk started: {stopped.said}") if stopped is not None: # One issue or repo that cannot be planned holds back only itself: each chunk that may start still does. - say(f"the epic {epic.key} is not planned in full: {stopped.reason}", epic.effects) + say(f"the epic {epic.key} is not planned in full: {stopped.reason}" + (", so the writes below are those it made before it stopped" if dry else ""), epic.effects, stdout=dry) started = chunks_started(epic, issues, None) return Stop(1, started.reason) if isinstance(started, Failure) else started def chunks_said(epic: EpicRun, started: scheduler.Started, verb: str, where: str) -> None: - """Prints each chunk that started, after verb and before where, else that none did, then why each other open issue waits, and whether the epic is closed.""" + """Prints ` ` and where, or ` no chunk`, then why each other open issue waits, and that the epic is closed where it is.""" say(f"{verb} {', '.join(started.started)}{where}" if started.started else f"{verb} no chunk", epic.effects, stdout=True) for wait in started.waits: say(f"{wait.issue} waits: {wait.reason}", epic.effects, stdout=True) @@ -203,15 +204,16 @@ def chunks_said(epic: EpicRun, started: scheduler.Started, verb: str, where: str def dry_run_printed(epic: EpicRun) -> Stop: - """What `do-epic --dry-run` does: runs windows_opened's planning and scheduling on a copy of the epic and a tmux that starts nothing, then prints each Jira write planning made there. It never puts the session on the terminal or asks a question.""" + """What `do-epic --dry-run` does: plans and starts as `windows_opened` does, on a copy of the epic, a tmux that starts no window and a git that clones no repo, then prints each Jira write planning made on the copy, each chunk that would start and why each other issue waits. It doesn't put the session on the terminal or ask a question.""" dry = dry_run.seeded(epic.store) if isinstance(dry, Failure): return Stop(1, dry.reason) effects = dataclasses.replace(epic.effects, tmux=dry_run.recording(epic.effects.tmux), git=dry_run.without_clones(epic.effects.git), on_terminal=lambda: False) rehearsal = dataclasses.replace(epic, store=dry, effects=effects) - say("dry run: nothing is written to Jira and no window starts", effects, stdout=True) - started = planned_and_started(rehearsal) - say("planning would write to Jira:\n" + "\n".join(f"- {write}" for write in dry.writes) if dry.writes else "planning would write nothing to Jira", effects, stdout=True) + say("dry run: nothing is written to Jira and no window starts, so a line below that says an issue is labelled or split shows what a real run would do", effects, stdout=True) + started = planned_and_started(rehearsal, dry=True) + writes = "".join("\n- " + write.replace("\n", "\n ") for write in dry.writes) + say(f"planning would write to Jira:{writes}" if dry.writes else "planning wouldn't write anything to Jira", effects, stdout=True) if isinstance(started, Stop): return started chunks_said(rehearsal, started, "would start", "") diff --git a/bin/do_epic/test_dry_run.py b/bin/do_epic/test_dry_run.py index 86ddd9f1..f54cd342 100644 --- a/bin/do_epic/test_dry_run.py +++ b/bin/do_epic/test_dry_run.py @@ -74,7 +74,7 @@ class TheGitThatClonesNothing(unittest.TestCase): ran.append(args) return "ok" git = dry_run.without_clones(real) - self.assertEqual(git("-c", "a=b", "clone", "--", "url", "dir"), Failure("a dry run clones nothing")) + self.assertEqual(git("-c", "a=b", "clone", "--", "url", "dir"), Failure("a dry run doesn't clone a repo, but a real run would")) self.assertEqual(git("remote", cwd="/c"), "ok") self.assertEqual(ran, [("remote",)]) diff --git a/bin/do_epic/test_main.py b/bin/do_epic/test_main.py index 19cf14e2..7f48f925 100644 --- a/bin/do_epic/test_main.py +++ b/bin/do_epic/test_main.py @@ -970,6 +970,9 @@ class TheStatus(DoEpicTest): self.assertIn("Jira answered 503\n", err) +BANNER = "dry run: nothing is written to Jira and no window starts, so a line below that says an issue is labelled or split shows what a real run would do" + + class TheDryRun(DoEpicTest): def setUp(self) -> None: super().setUp() @@ -1006,7 +1009,7 @@ class TheDryRun(DoEpicTest): code, out, _ = self.run_main(["ABC-12", "--dry-run"], FakeEffects(on_terminal=True)) self.assertEqual(code, 0) shown = out.replace("<1790000000> ", "") - self.assertIn("planning would write nothing to Jira\nwould start ABC-21\n", shown) + self.assertIn("planning wouldn't write anything to Jira\nwould start ABC-21\n", shown) self.assertIn("ABC-22 waits: the epic runs as many chunks as its `**Max parallel chunks:**` line allows: 1\n", shown) def test_prints_the_question_planning_would_ask_and_asks_none(self) -> None: @@ -1017,7 +1020,7 @@ class TheDryRun(DoEpicTest): self.assertEqual(code, 0) self.assertIn("ABC-20 waits for your answer: Is the importer in api or in web?", out) self.assertEqual([seam for seam, _ in fake.calls if seam == "input"], []) - self.assertIn("planning would write nothing to Jira\n", out) + self.assertIn("planning wouldn't write anything to Jira\n", out) def test_works_without_tmux_and_a_chunk_in_a_missing_repo_waits(self) -> None: self.issues = [issue("ABC-20", "repo:missing"), issue("ABC-21", "do-epic-claude")] @@ -1025,7 +1028,6 @@ class TheDryRun(DoEpicTest): code, out, _ = self.run_main(["ABC-12", "--dry-run"], fake) self.assertEqual(code, 0) self.assertIn("would start ABC-21\n", out) - self.assertIn("ABC-20 waits:", out) self.assertIn("ABC-20 waits: missing is missing", out) self.assertEqual([what for seam, what in fake.calls if seam == "git" and "clone" in what], []) @@ -1035,9 +1037,26 @@ class TheDryRun(DoEpicTest): fake = FakeEffects(on_terminal=False, git=["git@host.example:team/api.git", ""]) code, out, err = self.run_main(["ABC-12", "--dry-run"], fake) self.assertEqual((code, err), (0, "")) - self.assertEqual(out.replace("<1790000000> ", ""), f"dry run: nothing is written to Jira and no window starts\nplanning would write nothing to Jira\nwould start ABC-20\nABC-22 waits: cannot clone git@host.example:team/web to {self.home / 'code/web'}: a dry run clones nothing. Where does web live?\n") + self.assertEqual(out.replace("<1790000000> ", ""), f"{BANNER}\nplanning wouldn't write anything to Jira\nwould start ABC-20\nABC-22 waits: cannot clone git@host.example:team/web to {self.home / 'code/web'}: a dry run doesn't clone a repo, but a real run would. Where does web live?\n") self.assertEqual([what for seam, what in fake.calls if seam == "git" and "clone" in what], []) + def test_says_on_stdout_that_planning_stopped_at_a_missing_repo_and_what_the_writes_are(self) -> None: + shutil.rmtree(self.home / "code/web") + self.issues = [issue("ABC-20"), issue("ABC-22", "repo:api"), issue("ABC-23", "repo:web")] + fake = FakeEffects(on_terminal=False, git=["git@host.example:team/api.git", ""]) + code, out, err = self.run_main(["ABC-12", "--dry-run"], fake) + self.assertEqual((code, err), (0, "")) + stopped = f"the epic ABC-12 is not planned in full: cannot clone git@host.example:team/web to {self.home / 'code/web'}: a dry run doesn't clone a repo, but a real run would. Where does web live?, so the writes below are those it made before it stopped\n" + self.assertIn(stopped, out.replace("<1790000000> ", "")) + self.assertIn("planning wouldn't write anything to Jira\n", out) + + def test_indents_the_lines_after_the_first_of_a_comment_under_its_bullet(self) -> None: + self.issues = [issue("ABC-20")] + parts = structured({"parts": [{"repo": "api", "change": "Add it."}, {"repo": "web", "change": "Call it."}], "comment": "Split by repo.\nSecond line."}) + code, out, _ = self.run_main(["ABC-12", "--dry-run"], FakeEffects(claude=[parts])) + self.assertEqual(code, 0) + self.assertIn("\n- comment on ABC-20: Split by repo.\n Second line.\n", out) + def test_stops_where_the_epic_cannot_be_read(self) -> None: store = MemoryEpic("ABC-12", [], fails="Jira answered 503") self.backend = lambda config, key: (store, EpicRecord(Description(self.description))) # type: ignore[method-assign,arg-type] -- 2.52.0 From 4853922d55820748720293cbb55f536f31c3c621 Mon Sep 17 00:00:00 2001 From: Lilleman Date: Fri, 20 Nov 2026 09:53:07 +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);=20the=20dry?= =?UTF-8?q?=20run=20says=20what=20a=20missing=20repo=20does,=20in=20the=20?= =?UTF-8?q?previous=20commit?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -- 2.52.0 From ec2779ad1c165306c66fe0691d47d913df73cb28 Mon Sep 17 00:00:00 2001 From: Lilleman Date: Fri, 20 Nov 2026 09:53:07 +0100 Subject: [PATCH 06/10] =?UTF-8?q?Answer=20prose=20round=201:=200=20?= =?UTF-8?q?=F0=9F=94=B4,=208=20=F0=9F=9F=A1=20(0=20misread);=20the=20prose?= =?UTF-8?q?=20fixes=20are=20in=20the=20product-owner=20commit?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -- 2.52.0 From 388f7266134b80cf052ebd4833acd01e9f9bde75 Mon Sep 17 00:00:00 2001 From: Lilleman Date: Fri, 20 Nov 2026 10:14:53 +0100 Subject: [PATCH 07/10] Pin the real run's not-planned-in-full line, which carries no dry-run note --- bin/do_epic/test_main.py | 1 + 1 file changed, 1 insertion(+) diff --git a/bin/do_epic/test_main.py b/bin/do_epic/test_main.py index 7f48f925..c00b9372 100644 --- a/bin/do_epic/test_main.py +++ b/bin/do_epic/test_main.py @@ -158,6 +158,7 @@ class TheCommand(DoEpicTest): code, out, err = self.run_main(["ABC-12"], FakeEffects()) self.assertEqual(code, 0, err) self.assertIn("the epic ABC-12 is not planned in full: the epic ABC-12's description states `Score = ...` 0 times under ## Scoring", err) + self.assertTrue(err.endswith("(2**S + 32)`\n")) self.assertIn("started ABC-20, ABC-21 in the tmux session epic-ABC-12\n", out) def test_stops_on_an_epic_it_cannot_read(self) -> None: -- 2.52.0 From 7639933f993181a04fc370e46f3c2e1ba9b9e177 Mon Sep 17 00:00:00 2001 From: Lilleman Date: Fri, 20 Nov 2026 10:16:54 +0100 Subject: [PATCH 08/10] =?UTF-8?q?Answer=20stability=20round=202:=200=20?= =?UTF-8?q?=F0=9F=94=B4,=201=20=F0=9F=9F=A1=20(0=20misread);=20put=20the?= =?UTF-8?q?=20dry-run=20note=20before=20the=20reason=20and=20warn=20in=20-?= =?UTF-8?q?-help=20that=20another=20repo's=20chunk=20may=20take=20a=20plac?= =?UTF-8?q?e?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bin/do_epic/main.py | 4 ++-- bin/do_epic/test_main.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/do_epic/main.py b/bin/do_epic/main.py index 75249101..4b31cd36 100644 --- a/bin/do_epic/main.py +++ b/bin/do_epic/main.py @@ -63,7 +63,7 @@ name says `awaits a slot`. In a repo whose config sets `merge = "human"`, a chun request is ready, with nothing else to wait on, the window's name says `awaits your merge`, and its worker goes on once you merged it. A parked chunk survives a reboot: run do-epic again to go on polling. --status doesn't start any chunk. It prints a line per open issue: that its chunk runs or asks you a question, or why it waits, such as the gate a parked chunk awaits and since when. --dry-run runs the planning and the scheduling against the epic as Jira holds it. It doesn't write anything to Jira, start a window or ask a question. It prints each label, sub-task, comment and rank move that planning would write, each chunk that would start and why each other issue waits. A sub-task not yet filed shows a key such as ABC-new1. A question planning would ask is printed instead of asked. Planning's claude calls still run. -A repo that is missing isn't cloned. Planning then stops there, so its writes are only those made before it, and the issues of that repo wait; a real run would clone it and go on. +A repo that is missing isn't cloned. Planning then stops there, so its writes are only those made before it, and the issues of that repo wait, and a chunk of another repo may start in the place a real run gives them; a real run would clone it and go on. {findings.HELP} {finish.HELP} The Jira site and its credentials are set in ~/.claude-projects/do-epic/config.toml.""" @@ -189,7 +189,7 @@ def planned_and_started(epic: EpicRun, dry: bool = False) -> scheduler.Started | return Stop(1, f"the epic is not planned, so no chunk started: {stopped.said}") if stopped is not None: # One issue or repo that cannot be planned holds back only itself: each chunk that may start still does. - say(f"the epic {epic.key} is not planned in full: {stopped.reason}" + (", so the writes below are those it made before it stopped" if dry else ""), epic.effects, stdout=dry) + say(f"the epic {epic.key} is not planned in full" + (", so the writes below are those it made before it stopped" if dry else "") + f": {stopped.reason}", epic.effects, stdout=dry) started = chunks_started(epic, issues, None) return Stop(1, started.reason) if isinstance(started, Failure) else started diff --git a/bin/do_epic/test_main.py b/bin/do_epic/test_main.py index c00b9372..2728d3eb 100644 --- a/bin/do_epic/test_main.py +++ b/bin/do_epic/test_main.py @@ -1047,7 +1047,7 @@ class TheDryRun(DoEpicTest): fake = FakeEffects(on_terminal=False, git=["git@host.example:team/api.git", ""]) code, out, err = self.run_main(["ABC-12", "--dry-run"], fake) self.assertEqual((code, err), (0, "")) - stopped = f"the epic ABC-12 is not planned in full: cannot clone git@host.example:team/web to {self.home / 'code/web'}: a dry run doesn't clone a repo, but a real run would. Where does web live?, so the writes below are those it made before it stopped\n" + stopped = f"the epic ABC-12 is not planned in full, so the writes below are those it made before it stopped: cannot clone git@host.example:team/web to {self.home / 'code/web'}: a dry run doesn't clone a repo, but a real run would. Where does web live?\n" self.assertIn(stopped, out.replace("<1790000000> ", "")) self.assertIn("planning wouldn't write anything to Jira\n", out) -- 2.52.0 From 12ace75f15c5539a818c8c4f8abbd25b71408015 Mon Sep 17 00:00:00 2001 From: Lilleman Date: Fri, 20 Nov 2026 10:43:14 +0100 Subject: [PATCH 09/10] Sort the dry run's imports by their first binding --- bin/do_epic/dry_run.py | 4 ++-- bin/do_epic/test_dry_run.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/bin/do_epic/dry_run.py b/bin/do_epic/dry_run.py index 6b1f3a4c..cc27a052 100644 --- a/bin/do_epic/dry_run.py +++ b/bin/do_epic/dry_run.py @@ -2,11 +2,11 @@ import dataclasses import subprocess -from agent_cycle.tmux import Tmux -from do_epic.backend.fake import MemoryEpic from do_epic.backend.protocol import EpicStore from failure import Failure from git_cli.git_repo import Git +from do_epic.backend.fake import MemoryEpic +from agent_cycle.tmux import Tmux # The tmux commands that only read. Each other command makes or changes a session or a window. READS = ("list-windows", "show-options") diff --git a/bin/do_epic/test_dry_run.py b/bin/do_epic/test_dry_run.py index f54cd342..ecce1ad0 100644 --- a/bin/do_epic/test_dry_run.py +++ b/bin/do_epic/test_dry_run.py @@ -6,9 +6,9 @@ import unittest sys.path.insert(0, str(pathlib.Path(__file__).resolve().parents[1])) from do_epic import dry_run -from do_epic.backend.fake import MemoryEpic -from do_epic.test_scheduler import issue from failure import Failure +from do_epic.test_scheduler import issue +from do_epic.backend.fake import MemoryEpic LISTED = "-t", "=epic-ABC-12", "-F", "#{window_name}\t#{pane_dead}\t#{window_id}" START = ["new-window", "-d", "-t", "=epic-ABC-12:", "-n", "ABC-21", "-c", "/code/api", "-P", "-F", "#{window_id}", "--", "do-epic"] -- 2.52.0 From 4a8b8b3e9df773e1beb6878125149eebf367b668 Mon Sep 17 00:00:00 2001 From: Lilleman Date: Fri, 20 Nov 2026 10:52:00 +0100 Subject: [PATCH 10/10] Finish item 450 in the plan --- CHANGELOG.md | 1 + todo.md | 21 +-------------------- 2 files changed, 2 insertions(+), 20 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0048cb2e..038438fb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ## Unreleased +- Add `do-epic --dry-run`, which prints every Jira write planning would make and each chunk that would start, and makes none of them. - The stability reviewer checks each parser that splits text on a separator or strips a suffix against a value that holds the separator, and reports a row the parse misplaces or drops. ## 0.14.0 diff --git a/todo.md b/todo.md index 935c6b14..246ca5ef 100644 --- a/todo.md +++ b/todo.md @@ -14,9 +14,8 @@ |---|---|---|---|---|---|---|---|---|---|---|---| | 449 | 0.15.0 | | | **Record do-epic's repo picks and sub-task summaries in the team's own spelling, such as `core-4` and `core-4: Bygg …`, as its config sets them.** | 2 | 2 | 2 | 4 | 3 | 1.6 by 6 | 2.0 | | 453 | 0.15.0 | | | **Make the issue types that do-epic and `todo-item add` file in Jira settings, since a Jira project such as TW has no Task type.** | 2 | 2 | 1 | 3 | 2 | 1.6 by 5 | 1.8 | -| 450 | 0.15.0 | | | **Add `do-epic --dry-run`, which prints every Jira write planning would make and each chunk that would start, and makes none of them.** | 2 | 2 | 2 | 4 | 3 | 1.6 by 5 | 1.6 | | 454 | 0.15.0 | | | **Start a do-epic chunk's issue as the team's board expects, by settings: assigned to the account do-epic works as, moved by a start transition and added to a board's active sprint.** | 3 | 2 | 2 | 5 | 4 | 1.6 by 4 | 1.1 | -| 467 | 0.15.0 | 449, 450, 453, 454 | question | **Cut 0.15.0 as soon as items 449, 450, 453 and 454 have merged, before its release review, and run that review in 0.15.1.** | 1 | 1 | 1 | 1 | 1 | | 0.0 | +| 467 | 0.15.0 | 449, 453, 454 | question | **Cut 0.15.0 as soon as items 449, 450, 453 and 454 have merged, before its release review, and run that review in 0.15.1.** | 1 | 1 | 1 | 1 | 1 | | 0.0 | | 446 | 0.16.0 | | question | **Kill the process a stuck check names where its verdict is `stuck`, once the human says the recorded verdicts match what they would have done.** | 2 | 2 | 3 | 5 | 3 | 1.5 by 3 | 1.0 | | 462 | 0.16.0 | | | **Run under `mutate-changes` the tests that today fail in mutmut's copy of the tree, so a mutant of a line only they cover is killed.** | 2 | 1 | 2 | 3 | 3 | code health by 3 | 4.7 | | 77 | 0.16.0 | | | **Teach `bin/metric-bench` Go and TypeScript, rerun it once two projects' comprehension histories name places, and bring into review only a metric that tracks the panel.** | 4 | 2 | 1 | 5 | 6 | 1.1 by 7, 1.4 by 7 | 2.1 | @@ -112,24 +111,6 @@ Touches: - `bin/do_epic/backend/test_jira.py` - `README.md`: `### Set up a project` (small) -### 450. Add `do-epic --dry-run`, which prints every Jira write planning would make and each chunk that would start, and makes none of them. - -`do-epic ` writes to Jira before it starts any chunk: labels, sub-tasks, comments on a team's issues and a new backlog order. A person has no way to see those writes before they happen, so the first run on a team's epic is a gamble, and the writes can't be taken back in one step. On TW-13503 the first run would have filed duplicate sub-tasks and posted comments to the team. - -- `do-epic --dry-run` runs planning and the scheduler against the epic as Jira holds it, through a store that records each write in place of making it. It prints each label, sub-task with its summary and labels, comment and rank move it would write, then each chunk that would start and why each other open issue waits, as `--status` words it. -- It writes nothing to Jira, starts no window and asks no question; where planning would ask, it prints the question. -- `do-epic --help` and README → Tools describe the flag. - -Touches: - -- `bin/do_epic/main.py`: `run`, `windows_opened` -- `bin/do_epic/planning.py`: `planned` (small), `answered` (small) -- `bin/do_epic/backend/fake.py` -- `bin/do_epic/backend/protocol.py`: `EpicStore` (small) -- `bin/do_epic/test_main.py` -- `bin/do_epic/test_planning.py` -- `README.md`: `## Tools` (small) - ### 454. Start a do-epic chunk's issue as the team's board expects, by settings: assigned to the account do-epic works as, moved by a start transition and added to a board's active sprint. When a do-epic chunk starts, its issue stays as Jira holds it: unassigned, in New and outside the sprint. A team whose board shows who works on what, such as TW, where an issue being worked is assigned to the person, In Progress and in the active sprint, then sees nothing of the loop's work. Today each worker would have to do this by hand, from rules only some machines hold. -- 2.52.0