Merge remote-tracking branch 'origin/main' into item-449
CI / tests (pull_request) Successful in 3m26s
CI / tests (pull_request) Successful in 3m26s
# Conflicts: # todo.md
This commit is contained in:
@@ -1,5 +1,10 @@
|
||||
# Changelog
|
||||
|
||||
## Unreleased
|
||||
|
||||
- Add `do-epic <EPIC-KEY> --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
|
||||
|
||||
- `loop-claude`'s judge stops, naming how much to cut the records by, rather than judge a prompt that leaves it less than the transcript's last 50,000 characters. A file the project's config names for two records is read once.
|
||||
|
||||
@@ -199,7 +199,7 @@ Install puts only `loop-claude` on `PATH`; call the others by their path, such a
|
||||
- `command-patterns [<version>] [--calls <file>]` 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 <file>` 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] [<checkout>]` 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 <EPIC-KEY>` runs the chunks of one Jira epic whose items span repos, or have none, each in its own window of the tmux session `epic-<EPIC-KEY>`, 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 <EPIC-KEY>` runs the chunks of one Jira epic whose items span repos, or have none, each in its own window of the tmux session `epic-<EPIC-KEY>`, 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 <EPIC-KEY> --dry-run` prints what `do-epic <EPIC-KEY>` 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 <model> [--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 <command>` 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.
|
||||
|
||||
@@ -72,6 +72,7 @@ Catch behavior that is unclear or under-specified — "building in ambiguousness
|
||||
- Are there potential off-by-one errors?
|
||||
- Zero and absent are different values: `empty('0')`, `if ($amount)`, `$x ?: $default`, JS `||` conflate them one way; null coerced to `'0'` conflates them the other (a past prod bug: phantom 0-amount reversals). Both directions are findings.
|
||||
- Multibyte text (åäö): truncation, length checks, and comparisons must be mb-safe; encoding consistent end-to-end.
|
||||
- Where the change splits text on a separator or strips a suffix, look in the fixtures and a sample of the source data for a value where the separator or suffix also occurs as data, such as an address split on `,` whose last part holds a comma. Report a row the parse then misplaces or drops, silently or with only a log line.
|
||||
- Are payload and collection sizes bounded at the boundary?
|
||||
|
||||
### 6. Concurrency & State Management
|
||||
|
||||
@@ -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)
|
||||
@@ -42,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:
|
||||
@@ -52,6 +59,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 +70,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 +83,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 +95,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:
|
||||
|
||||
@@ -0,0 +1,68 @@
|
||||
"""What `do-epic <EPIC-KEY> --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
|
||||
|
||||
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")
|
||||
# The commands that start a window, which a later listing shows.
|
||||
STARTS = ("new-session", "new-window")
|
||||
|
||||
|
||||
@dataclasses.dataclass
|
||||
class DryEpic(MemoryEpic):
|
||||
"""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:
|
||||
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 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]:
|
||||
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 doesn't clone a repo, but a real run would")
|
||||
return real(*args, cwd=cwd, timeout=timeout, guarded=guarded, errors=errors)
|
||||
|
||||
return run
|
||||
+50
-15
@@ -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 <EPIC-KEY> [--status]
|
||||
HELP = f"""usage: do-epic <EPIC-KEY> [--status | --dry-run]
|
||||
{findings.USAGE}
|
||||
{finish.USAGE}
|
||||
|
||||
@@ -62,6 +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 <EPIC-KEY> 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, 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."""
|
||||
@@ -69,6 +71,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, 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
|
||||
|
||||
@@ -119,7 +123,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,13 +133,15 @@ 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])
|
||||
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)
|
||||
@@ -159,6 +166,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, 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)
|
||||
@@ -167,22 +189,35 @@ def windows_opened(epic: EpicRun) -> 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" + (", 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)
|
||||
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 `<verb> <the chunks>` and where, or `<verb> 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)
|
||||
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 <EPIC-KEY> --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, 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", "")
|
||||
return Stop(0, "")
|
||||
|
||||
|
||||
def chunks_started(epic: EpicRun, issues: list[EpicIssue], own: str | None) -> scheduler.Started | Failure:
|
||||
|
||||
@@ -0,0 +1,131 @@
|
||||
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 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"]
|
||||
|
||||
|
||||
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_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))
|
||||
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 doesn't clone a repo, but a real run would"))
|
||||
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:
|
||||
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_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", "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 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")])
|
||||
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"))
|
||||
|
||||
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()
|
||||
@@ -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 <EPIC-KEY> [--status]\n", err)
|
||||
self.assertIn("usage: do-epic <EPIC-KEY> [--status | --dry-run]\n", err)
|
||||
self.assertIn("do-epic <EPIC-KEY> --close-epic <<'EOF' summary EOF", err)
|
||||
|
||||
|
||||
|
||||
+103
-3
@@ -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:
|
||||
@@ -267,7 +268,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 +287,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:
|
||||
@@ -968,6 +971,103 @@ 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()
|
||||
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_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")
|
||||
code, out, _ = self.run_main(["ABC-12", "--dry-run"], FakeEffects(on_terminal=True))
|
||||
self.assertEqual(code, 0)
|
||||
shown = out.replace("<1790000000> ", "")
|
||||
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:
|
||||
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 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")]
|
||||
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: 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"{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, 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)
|
||||
|
||||
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]
|
||||
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()
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
`Bar = 0.1`
|
||||
|
||||
`Next ID = 468`
|
||||
`Next ID = 469`
|
||||
|
||||
## Items
|
||||
|
||||
@@ -14,10 +14,9 @@
|
||||
|---|---|---|---|---|---|---|---|---|---|---|---|
|
||||
| 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 <EPIC-KEY> --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 |
|
||||
| 467 | 0.15.0 | | | **Tell a do-epic worker the team's own label for each repo when it files a finding or a release-review issue, so those issues carry the label the team's board uses.** | 2 | 2 | 2 | 4 | 2 | 1.6 by 4 | 1.4 |
|
||||
| 466 | 0.15.0 | | | **Have stability-reviewer check each parser that splits a field on a separator against a value that holds the separator.** | 1 | 2 | 2 | 3 | 2 | 1.1 by 3 | 1.2 |
|
||||
| 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, 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 |
|
||||
| 468 | 0.15.0 | | | **Tell a do-epic worker the team's own label for each repo when it files a finding or a release-review issue, so those issues carry the label the team's board uses.** | 2 | 2 | 2 | 4 | 2 | 1.6 by 4 | 1.4 |
|
||||
| 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 |
|
||||
@@ -113,43 +112,6 @@ Touches:
|
||||
- `bin/do_epic/backend/test_jira.py`
|
||||
- `README.md`: `### Set up a project` (small)
|
||||
|
||||
### 450. Add `do-epic <EPIC-KEY> --dry-run`, which prints every Jira write planning would make and each chunk that would start, and makes none of them.
|
||||
|
||||
`do-epic <EPIC-KEY>` 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 <EPIC-KEY> --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)
|
||||
|
||||
### 467. Tell a do-epic worker the team's own label for each repo when it files a finding or a release-review issue, so those issues carry the label the team's board uses.
|
||||
|
||||
Item 449 makes do-epic record a repo pick, and each sub-task it files, under the team's own label from the `[label-repos]` table (`repo_pick.label_of(pick, team)`). The instructions do-epic gives a chunk's worker still name only `repo:<name>`: `LABELS` in `bin/do_epic/findings.py` (used in `HELP` at findings.py:31, in `instructions` at :48, and in `written`'s refusal at :99 and its reply at :105) and the `--file ... --label repo:<name> --label do-epic-release-review` command in `finish.task` at `bin/do_epic/finish.py:60`. A team whose board uses its own labels therefore still gets a finding or a release review labelled `repo:core-4` where it expects `core-4`.
|
||||
|
||||
Give both prompts the team's label for each repo of the table where the table names it (`repo_pick.team_label`, `also`), and keep `repo:<name>` for a repo the table doesn't name. `finish.task` already knows each repo that lacks its review, so it can name each one's label outright, as `label_of(Repo(name), team)` gives it. The README states the pick's spelling (`repo-rule.md`'s bullet) but not the finding's, so it needs no change.
|
||||
|
||||
Touches:
|
||||
- `bin/do_epic/findings.py`: `LABELS`, `instructions` (small), `written` (small)
|
||||
- `bin/do_epic/finish.py`: `task` (small)
|
||||
- `bin/do_epic/test_findings.py`: `Instructions`
|
||||
- `bin/do_epic/test_finish.py`: `TheFinishingChunksTask`
|
||||
|
||||
### 466. Have stability-reviewer check each parser that splits a field on a separator against a value that holds the separator.
|
||||
|
||||
An outside reviewer found that an importer split a full address on its separator and took the last part as the leaf, though the leaf itself may hold the separator; the importer's own test fixture held such a value, and each such row was dropped with only a log line. Our stability pass read the function and its tests and didn't raise it, and no deterministic tool covers it: the mutation tool does not mutate that language, and a mutant would not show a wrong split. Add one line to the stability reviewer's checks: where the change splits text on a separator or strips a suffix, look in the fixtures and a sample of the source data for a field that holds the separator, and report a row the parse then misplaces or drops.
|
||||
|
||||
Touches:
|
||||
- `agents/stability-reviewer.md`: `### 5. Edge Cases & Input Validation` (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.
|
||||
@@ -169,6 +131,26 @@ Touches:
|
||||
- `bin/do_epic/backend/test_jira.py`
|
||||
- `README.md`: `### Set up a project` (small)
|
||||
|
||||
### 467. 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.
|
||||
|
||||
lilleman's call on 2026-11-20: they need what 0.15.0 holds to work, so 0.15.0 is cut without a release review. This item holds the loop back from starting 0.15.0's release review once its last item merges: it waits as a question, so the human, or the session that cuts, drops it at the cut. At the cut, an item in 0.15.1 runs the release review, and the review's follow-ups land in 0.15.1.
|
||||
|
||||
Touches:
|
||||
|
||||
- `CHANGELOG.md`: `## Unreleased` (small)
|
||||
|
||||
### 468. Tell a do-epic worker the team's own label for each repo when it files a finding or a release-review issue, so those issues carry the label the team's board uses.
|
||||
|
||||
Item 449 makes do-epic record a repo pick, and each sub-task it files, under the team's own label from the `[label-repos]` table (`repo_pick.label_of(pick, team)`). The instructions do-epic gives a chunk's worker still name only `repo:<name>`: `LABELS` in `bin/do_epic/findings.py` (used in `HELP` at findings.py:31, in `instructions` at :48, and in `written`'s refusal at :99 and its reply at :105) and the `--file ... --label repo:<name> --label do-epic-release-review` command in `finish.task` at `bin/do_epic/finish.py:60`. A team whose board uses its own labels therefore still gets a finding or a release review labelled `repo:core-4` where it expects `core-4`.
|
||||
|
||||
Give both prompts the team's label for each repo of the table where the table names it (`repo_pick.team_label`, `also`), and keep `repo:<name>` for a repo the table doesn't name. `finish.task` already knows each repo that lacks its review, so it can name each one's label outright, as `label_of(Repo(name), team)` gives it. The README states the pick's spelling (`repo-rule.md`'s bullet) but not the finding's, so it needs no change.
|
||||
|
||||
Touches:
|
||||
- `bin/do_epic/findings.py`: `LABELS`, `instructions` (small), `written` (small)
|
||||
- `bin/do_epic/finish.py`: `task` (small)
|
||||
- `bin/do_epic/test_findings.py`: `Instructions`
|
||||
- `bin/do_epic/test_finish.py`: `TheFinishingChunksTask`
|
||||
|
||||
### 446. 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.
|
||||
|
||||
Item 422 judges a worker that stalls before its result, but only reports: each verdict goes to the terminal and to `stuck-workers.md` in the project's transcript archive. Question for the human: after a few days of verdicts there, do they match what you would have done? Once you say yes, kill only the process a `stuck` verdict names, and only where the pid is below the worker's claude, never the worker or the loop, and record the call in a decision.
|
||||
|
||||
Reference in New Issue
Block a user