Merge remote-tracking branch 'origin/main' into item-417
CI / tests (pull_request) Has been cancelled

# Conflicts:
#	README.md
#	docs/reading-cost.md
This commit is contained in:
2026-11-19 05:22:54 +01:00
14 changed files with 642 additions and 36 deletions
+1
View File
@@ -2,6 +2,7 @@
## Unreleased
- `do-epic <EPIC-KEY>` plans the epic before it starts chunks: it files a sub-task per repo under an open issue that changes several repos, labels each other unlabelled issue with where it is worked, asking on the terminal where the repo rule leaves that unclear, and puts the scored issues it filed in order of score.
- loop-claude compacts a waiting worker's session 10 minutes before its hour-long prompt cache expires, where no answer to an interrupt has come and the context holds at least 60k tokens, so the resume doesn't write the whole context again.
- do-epic gives a `do-epic-human` issue that blocks another its own window: it DMs you once through the notifier of one of the epic's repos, takes no running slot, and polls until you close the issue in Jira, when the issues it held up may start.
- do-epic tells an epic chunk's worker how its repo ships the change: a bullet under the repo's changelog where the repo publishes something, none where its plan is in Jira, and no `--finish` for `chunk-pr merge`.
+5 -3
View File
@@ -153,7 +153,9 @@ The last line prints each setting's path once the config is complete.
`do-epic` keeps its settings per machine, not per project, in `~/.claude-projects/do-epic/`, two files for every epic:
- `config.toml` sets `jira-url`, the site, such as `https://acme.atlassian.net`; `env-file`, the file holding `ATLASSIAN_EMAIL` and `ATLASSIAN_API_TOKEN`, a path that starts with `/` or `~/`, outside the clone folder and every folder of `~/.claude-projects`; and `repoless-model`, the model that works an item with no repo. It may also set `clone-folder`, where a missing repo is cloned, `~/code` if left out; `language`, the language of Jira text, English if left out; and `jira-finish-transition` with `jira-finish-status`, which name the workflow transition that moves a finished chunk's issue, and closes a finished epic, and the status it leads to, such as `"Mark as done"` and `"Done"`. Set both or neither: without them do-epic moves no issue to done and closes no epic, and a chunk that finishes stops with that reason.
- `repo-rule.md` is prose that says how to tell an item's repo, such as "a label that equals a repo's name names that repo". It may not be blank. do-epic doesn't read it yet: until it picks each item's repo from the rule, an issue runs once a label `repo:<name>` records its repo, `do-epic-claude` marks work of Claude's that changes no repo, and `do-epic-human` a task of yours.
- `repo-rule.md` is prose that says how to tell an item's repo, such as "a label that equals a repo's name names that repo". It may not be blank. `do-epic <EPIC-KEY>` uses it to pick where each open issue without such a label is worked, and records the pick as a label: `repo:<name>` for its repo, `do-epic-claude` for work of Claude's that changes no repo, and `do-epic-human` for a task of yours. Where the rule leaves an issue unclear, do-epic asks you on the terminal. Answer with the label, or with Enter alone to leave the issue waiting. Change a pick by editing the label in Jira.
An epic's description states the formula that ranks the issues do-epic files in it: once under `## Scoring`, on a line of its own and inside backticks, such as `` `Score = 100 * V / (2**S + 32)` ``. Without that line do-epic says so and leaves the backlog's order as it is.
Each repo an epic changes has a project config of its own, as in the rest of this section. `do-epic` fails and names each setting or file that is missing or invalid.
@@ -190,7 +192,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. An open issue runs once a label names its repo, 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. 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-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.
@@ -225,7 +227,7 @@ Install puts only `loop-claude` on `PATH`; call the others by their path, such a
- `branch_chunks/` cuts a default branch into chunks and finds, for each, the items it shipped and the later chunks that fixed its code, for `score_outcomes` and `routing_figures`. It imports `reading_cost`'s record path.
- `command_lines/` reads a shell command: its simple commands, and a docker call's subcommand and memory limits, for `command_patterns`, `reading_cost`, `routing_figures`, `rule_hook` and `run_heavy`.
- `deploy_release` imports `release_plan`'s `release_standing`.
- `do_epic/` holds `do-epic`, the tool that drives one Jira epic. `main.py` starts the epic's chunks and runs one chunk's cycles in its window, through `agent_cycle`. `scheduler.py` says which issues run now: as many as the epic's cap and each repo's `parallel-chunks` allow, and none in a repo where loop-claude runs chunks. `gates.py` reads once whether a chunk's pull request waits on its checks, an approval or a new review, and `parked.py` keeps each chunk that does in a state file, so it takes no running slot while it waits and goes on waiting after a reboot. `chunk_prompt.py` words what a chunk's worker reads. Through `findings.py` that worker files a finding as an issue of the epic, with `--file`, and appends a decision to its description, with `--record-decision`. `finish.py` ends an epic that holds no open issue: its finishing chunk files a release review of each repo the epic changed, has the human confirm each goal, and with `--close-epic` posts the summary on the epic and closes it. `config.py` reads its machine-wide settings, importing `project_config`'s settings and `model_routing`'s ladder file, and `epic_record.py` reads and writes an epic's description by section, language line and cap line, through `record_store`'s `EpicDescription`. `repos.py` finds a repo's checkout and project config by its name, and clones a missing checkout from the host and owner of the epic's other repos, through `forge`'s `url_beside`. `repo_pick.py` asks claude, by `repo-rule.md`, where an epic item is worked, and records the answer as a label on the issue. `split.py` has claude predict from the code which repos an item changes, and files a sub-task per repo under it where there are several. `ranking.py` orders an epic's items by score over one chain of goals, the epic's, then code health, then the item's repo's, through `plan`'s ranking, and re-ranks the tracker's backlog to that order through `backend/`. `backend/` reads, files and ranks the epic's issues, adds the labels `repo_pick.py` and `split.py` record, posts comments, moves a finished chunk's issue to done, and closes the epic. `e2e/` holds `do-epic-e2e`.
- `do_epic/` holds `do-epic`, the tool that drives one Jira epic. `main.py` starts the epic's chunks and runs one chunk's cycles in its window, through `agent_cycle`. `planning.py` settles, before the chunks start, where each open issue is worked and the order of the issues do-epic filed, through `split.py`, `repo_pick.py` and `ranking.py`. `scheduler.py` says which issues run now: as many as the epic's cap and each repo's `parallel-chunks` allow, and none in a repo where loop-claude runs chunks. `gates.py` reads once whether a chunk's pull request waits on its checks, an approval or a new review, and `parked.py` keeps each chunk that does in a state file, so it takes no running slot while it waits and goes on waiting after a reboot. `chunk_prompt.py` words what a chunk's worker reads. Through `findings.py` that worker files a finding as an issue of the epic, with `--file`, and appends a decision to its description, with `--record-decision`. `finish.py` ends an epic that holds no open issue: its finishing chunk files a release review of each repo the epic changed, has the human confirm each goal, and with `--close-epic` posts the summary on the epic and closes it. `config.py` reads its machine-wide settings, importing `project_config`'s settings and `model_routing`'s ladder file, and `epic_record.py` reads and writes an epic's description by section, language line and cap line, through `record_store`'s `EpicDescription`. `repos.py` finds a repo's checkout and project config by its name, and clones a missing checkout from the host and owner of the epic's other repos, through `forge`'s `url_beside`. `repo_pick.py` asks claude, by `repo-rule.md`, where an epic item is worked, and records the answer as a label on the issue. `split.py` has claude predict from the code which repos an item changes, and files a sub-task per repo under it where there are several. `ranking.py` orders an epic's items by score over one chain of goals, the epic's, then code health, then the item's repo's, through `plan`'s ranking, and re-ranks the tracker's backlog to that order through `backend/`. `backend/` reads, files and ranks the epic's issues, adds the labels `repo_pick.py` and `split.py` record, posts comments, moves a finished chunk's issue to done, and closes the epic. `e2e/` holds `do-epic-e2e`.
- `forge/` tells a GitHub origin from a Gitea one, names a repo beside an origin's and runs that forge's CLI (`commands.py`), and finds a pull request and reads its checks, once or until they settle (`pulls.py`), for `chunk_preflight`, `chunk_pr`, `deploy_release`, `do_epic` and `larv_review`.
- `git_cli/` runs git for every tool (`git_repo.py`), and reads the git calls in a shell command (`git_command.py`).
- `judge_replay` imports `agent_cycle`'s judge and verdicts, and `loop_claude`'s premises, records and `ANSWER_DESTINATIONS`.
+3 -3
View File
@@ -24,7 +24,7 @@ DECISIONS_LOCK = "decisions.lock"
USAGE = f"""do-epic <EPIC-KEY> {FILE} <summary> [{LABEL} <label>]... [<<'EOF' detail EOF]
do-epic <EPIC-KEY> {RECORD_DECISION} <title> <<'EOF' entry EOF"""
HELP = f"""{FILE} files a finding about one of the epic's goals as an open issue of the epic, with the markdown piped in as its description.
{LABEL} is {LABELS}; without one the issue waits until someone labels it.
{LABEL} is {LABELS}; without one, the next `do-epic <EPIC-KEY>` you run picks where the issue is worked.
A second {LABEL}, `{REVIEW_LABEL}`, marks the issue as a repo's release review, which the epic's finishing files.
A finding about a repo's own goals goes into that repo's plan instead.
{RECORD_DECISION} appends a decision that governs the epic to its description's ## Decisions, under the title, with the markdown piped in as its text."""
@@ -34,7 +34,7 @@ def instructions(epic: str, launcher: pathlib.Path, language: str) -> str:
"""What a chunk's first prompt says about filing a finding and recording a decision in the epic with the key epic. launcher is the do-epic that runs the chunk, and language the one the epic's Jira text is in."""
return (
f"File a finding about one of the epic's goals in the epic, with `{launcher} {epic} {FILE} \"<summary>\" {LABEL} <label>` and its detail on stdin. "
f"The label is {LABELS}; leave it out where you cannot tell, and the issue waits for the human. "
f"The label is {LABELS}; leave it out where you cannot tell, and the next `do-epic` the human runs picks it. "
"Where filing fails and says the issue may exist, ask the human to look before you file it again. "
"File a finding about a repo's goals by that repo's rules. Where unsure which, ask the human. "
f"Record a decision that governs the epic, such as an answer the human typed, with `{launcher} {epic} {RECORD_DECISION} \"<title>\"` and its text on stdin. "
@@ -79,7 +79,7 @@ def written(epic: str, flag: str, value: str, labels: tuple[str, ...], store: Ep
key = store.file(epic, value, text, labels)
if isinstance(key, Failure):
return Failure(f"cannot file the finding in the epic {epic}: {key.reason}")
return f"Filed {key} in the epic {epic}." + ("" if any(of_label(label) for label in labels) else f" It waits until someone labels it: {LABELS}.")
return f"Filed {key} in the epic {epic}." + ("" if any(of_label(label) for label in labels) else f" It has no label that says where it is worked, so the next `do-epic {epic}` picks one: {LABELS}.")
try:
with decisions_locked(folder):
added = record.append_decision(value, text)
+20 -7
View File
@@ -1,6 +1,6 @@
"""The do-epic command (docs/decisions.md → `do-epic: drives one Jira epic …`).
`do-epic <EPIC-KEY>` starts each of the epic's chunks that may start now, each in a window of the epic's tmux session, as `scheduler` picks them, and puts that session on the terminal. Each window runs `do-epic --chunk <ISSUE-KEY> <EPIC-KEY>`: the cycles of one issue's chunk, run by the code that runs loop-claude's (`agent_cycle`), until the judge rules it finished. Then it starts the chunks that may start now, and its window closes. The window of a human's task runs no cycle: it waits until the task no longer holds up an issue (`human_tasks`), then does the same.
`do-epic <EPIC-KEY>` first plans the epic's open issues (`planning`): each that no label places is split by repo or gets its pick, and the scored issues do-epic filed are re-ranked. Then it starts each of the epic's chunks that may start now, each in a window of the epic's tmux session, as `scheduler` picks them, and puts that session on the terminal. Each window runs `do-epic --chunk <ISSUE-KEY> <EPIC-KEY>`: the cycles of one issue's chunk, run by the code that runs loop-claude's (`agent_cycle`), until the judge rules it finished. Then it starts the chunks that may start now, and its window closes. The window of a human's task runs no cycle: it waits until the task no longer holds up an issue (`human_tasks`), then does the same.
After each cycle of a chunk in a repo, the window reads what the chunk's pull request waits on (`gates`). While that is a gate only time or a person passes, the chunk is parked (`parked`): the window frees its running slot and polls the forge, and the chunk's next cycle starts once the worker has something to do and a slot is free. `do-epic <EPIC-KEY> --status` prints what each open issue does."""
import dataclasses
@@ -9,7 +9,7 @@ import sys
import typing
from loop_claude.loop.chunk_start import archived_route, routed
from do_epic import chunk_prompt, findings, finish, gates, human_tasks, parked, scheduler, split, status
from do_epic import chunk_prompt, findings, finish, gates, human_tasks, parked, planning, scheduler, split, status
from do_epic.repo_pick import ClaudeWork, HumanTask, recorded, Repo
from loop_claude.loop.close import closed_cycle
from project_config.main import located as config_located
@@ -27,6 +27,7 @@ from loop_claude.project.model_choice import get_or_ask_models, Models
from plan_store.jira_epic import ISSUE_KEY
from do_epic.backend.jira import JiraEpic
from agent_cycle.routing import judge_rung
from claude_code.reply import Limited
from do_epic.repos import locate
from loop_claude.loop.this_loop import Loop
from loop_claude.loop.reload import LoopRun
@@ -46,8 +47,12 @@ HELP = f"""usage: do-epic <EPIC-KEY> [--status]
{finish.USAGE}
Runs the chunks of one Jira epic, such as ABC-12, each in its own window of the tmux session epic-<EPIC-KEY>.
An open issue of the epic runs as a chunk once it has a label and no issue blocks it.
The label names the issue's repo, or says the work changes no repo.
Before it starts chunks, do-epic <EPIC-KEY> plans each open issue that has none of these labels:
`repo:<name>` for its repo, `do-epic-claude` for work of Claude's that changes no repo, `do-epic-human` for a task of yours.
Where such an issue changes several repos, it files a sub-task per repo. Otherwise it gives the issue its label, as repo-rule.md says.
Where the rule leaves the label unclear, it asks you on the terminal. Answer with the label, or with Enter alone to leave the issue waiting.
It then puts the scored issues that do-epic itself filed in order of score, by the `Score = ...` line under the epic's ## Scoring.
An open issue labelled `repo:<name>` or `do-epic-claude` runs as a chunk once no issue blocks it.
A `do-epic-human` issue that blocks another gets a window too. The window DMs you once, then waits without taking a place until you close the issue in Jira.
As many run at once as the epic's description allows with a line such as `**Max parallel chunks:** 2`, one where it has none.
A repo takes as many chunks as its `parallel-chunks`, and none while loop-claude runs chunks in it.
@@ -152,9 +157,17 @@ def epic_written(key: str, writes: tuple[str, str, tuple[str, ...]] | None, path
def windows_opened(epic: EpicRun) -> Stop:
"""What the do-epic the human runs does: 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."""
issues = epic.store.read()
started = issues if isinstance(issues, Failure) else chunks_started(epic, issues, None)
"""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."""
read = epic.store.read()
if isinstance(read, Failure):
return Stop(1, read.reason)
issues, stopped = planning.planned(planning.Planned(epic.key, epic.config, epic.store, epic.record, epic.paths.home, epic.effects), read)
if isinstance(stopped, Limited):
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)
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)
+187
View File
@@ -0,0 +1,187 @@
"""What `do-epic <EPIC-KEY>` settles before it starts chunks: where each open issue is worked, and the order the loop's issues come in (docs/decisions.md → `do-epic: drives one Jira epic …`).
An open child issue that no label places is first split by repo (`split`), and where it changes one repo or none, its repo is picked (`repo_pick`). Each is a headless claude call on `repoless-model`'s rung of the shipped ladder. Where the repo rule leaves a pick unclear, the human answers on the terminal. Then the issues do-epic filed are scored and Jira's backlog re-ranked to match (`ranking`).
Planning runs only in the `do-epic <EPIC-KEY>` the human starts. A chunk that finishes starts the next chunks from the labels and the order it finds, so no window waits on a question.
Planning holds no lock: one `do-epic <EPIC-KEY>` at a time is assumed. A second one started meanwhile finds the sub-tasks the first filed, since `split` reads them before it files, unless Jira's search lags."""
import dataclasses
import pathlib
import re
from do_epic.config import DoEpicConfig
from loop_effects.effects import Effects, say
from do_epic.backend.protocol import EpicIssue, EpicStore
from do_epic.epic_record import EpicRecord
from failure import Failure
from record_store.stores import goals_store, store as record_store
from plan.todo_table import Item
from claude_code.reply import Limited
from plan_store.jira_epic import number
from do_epic import ranking, repo_pick, repos, split
from model_routing.ladder_file import read_ladder, SHIPPED
from model_routing.ladder import Rung
from do_epic.scheduler import STATE
from plan_store.scoring import weighing_texts
# The epic's formula, stated under its `## Scoring` as a todo.md states its own.
FORMULA = re.compile(r"^`Score = ([^`]+)`$", re.M)
# An epic item has no release, and ranking wants every item of one epic in the same one.
NO_RELEASE = (0, 0, 0)
@dataclasses.dataclass(frozen=True)
class Planned:
"""The epic whose open issues are planned."""
key: str
config: DoEpicConfig
store: EpicStore
record: EpicRecord
home: pathlib.Path
effects: Effects
def planned(epic: Planned, issues: list[EpicIssue]) -> tuple[list[EpicIssue], Failure | Limited | None]:
"""The epic's issues as far as they are planned, and why the planning stopped early, None where it didn't. issues are the epic's, as just read.
Each open child issue that no label places is split or gets its pick. Then the issues do-epic filed are re-ranked. What was labelled, filed or ranked before a Failure or a Limited stays, and the issues returned show it."""
unplaced = [issue for issue in issues if issue.parent == epic.key and not issue.done and split.SPLIT_LABEL not in issue.labels and repo_pick.recorded(issue) is None]
added: dict[str, str] = {}
stopped = placed(epic, issues, unplaced, added) if unplaced else None
if added:
read = epic.store.read()
# A search may not show a label added a moment ago, so each label added here counts whatever the read says. A sub-task the search doesn't show yet starts on the next run.
issues = [labelled(each, added.get(each.key)) for each in (issues if isinstance(read, Failure) else read)]
stopped = stopped or (read if isinstance(read, Failure) else None)
if stopped is not None:
return issues, stopped
order = ranked_keys(epic, issues)
if isinstance(order, Failure):
return issues, order
if [issue.key for issue in issues if issue.key in order] == order:
return issues, None
say(f"re-ranking the issues do-epic filed in {epic.key}'s backlog", epic.effects, stdout=True)
refused = ranking.reranked(epic.store, order)
if refused:
return issues, refused
# A search may not show the new order yet, so the issues are put in it here, as `reranked` put them in Jira: each ranked issue in a position a ranked issue held.
by_key, ranked = {issue.key: issue for issue in issues}, iter(order)
return [by_key[next(ranked)] if issue.key in order else issue for issue in issues], None
def labelled(issue: EpicIssue, label: str | None) -> EpicIssue:
"""issue with label among its labels; issue itself where label is None."""
return issue if label is None or label in issue.labels else dataclasses.replace(issue, labels=tuple(sorted((*issue.labels, label))))
def placed(epic: Planned, issues: list[EpicIssue], unplaced: list[EpicIssue], added: dict[str, str]) -> None | Failure | Limited:
"""Splits each of unplaced by repo, or labels it with its pick, and notes in added the label each got, by its key. An issue that claude or the tracker fails on is named and left for the next run, as is one whose question the human doesn't answer; a usage limit ends the planning."""
rung = planning_rung(epic.config.repoless_model)
language = epic.record.language()
# Claude reads every repo a label of the epic names, a finished issue's too, to predict which of them an issue changes.
places = located(epic, [repo for issue in issues if isinstance(repo := repo_pick.recorded(issue), repo_pick.Repo)])
if failed := next((each for each in (rung, language, places) if isinstance(each, Failure)), None):
return failed
assert isinstance(rung, Rung) and not isinstance(language, Failure) and isinstance(places, dict)
folder = epic.home / STATE / epic.key
folder.mkdir(parents=True, exist_ok=True)
checkouts = tuple(str(place.checkout) for place in places.values())
for issue in unplaced:
say(f"planning {issue.key}", epic.effects, stdout=True)
parts = split.split(epic.store, issue, not issue.by_loop, epic.config.repo_rule, language or epic.config.language, checkouts, rung, epic.effects.claude, str(folder))
if isinstance(parts, split.Split) and parts.repos:
added[issue.key] = split.SPLIT_LABEL
say(f"{issue.key} is split into a sub-task for each of {', '.join(parts.repos)}", epic.effects, stdout=True)
continue
pick: repo_pick.Pick | repo_pick.Unclear | Failure | Limited | None = parts if not isinstance(parts, split.Split) else repo_pick.picked(epic.store, issue, epic.config.repo_rule, rung, epic.effects.claude, str(folder))
if isinstance(pick, repo_pick.Unclear):
pick = answered(epic, issue, pick.question)
if isinstance(pick, Limited):
return pick
if isinstance(pick, Failure):
say(f"{issue.key} is not planned: {pick.reason}", epic.effects, stdout=True)
elif pick is not None and not isinstance(pick, repo_pick.Unclear):
added[issue.key] = repo_pick.label_of(pick)
say(f"{issue.key} is labelled {added[issue.key]}", epic.effects, stdout=True)
return None
def planning_rung(model: str) -> Rung | Failure:
"""The rung each planning call runs on: the model's cheapest on the shipped ladder."""
ladder = read_ladder(SHIPPED)
if isinstance(ladder, Failure):
return ladder
project = ladder.project_rung(model)
return project.rung if project else Failure(f"`repoless-model` names {model}, which is not on the routing ladder {SHIPPED}")
def answered(epic: Planned, issue: EpicIssue, question: str) -> repo_pick.Pick | None | Failure:
"""The pick the human types for an issue the repo rule leaves unclear, once it is recorded; None where nobody is at a terminal to answer, or the human answers with Enter alone, so the issue waits for the next run. The answer is the label to give the issue, so that it is spelt as a person would spell it in Jira.
A repo's name is not checked against the repos do-epic knows: an epic's first issue in a repo names one it has not seen."""
if not epic.effects.on_terminal():
say(f"{issue.key} waits for your answer: {question} Run `do-epic {epic.key}` on a terminal to answer, or label the issue in Jira.", epic.effects, stdout=True)
return None
say(f"\n{issue.key}, {issue.summary}: {question}", epic.effects)
while True:
try:
typed = epic.effects.input(f"The label that says where {issue.key} is worked, `{repo_pick.REPO_PREFIX}<name>`, `{repo_pick.CLAUDE_LABEL}` or `{repo_pick.HUMAN_LABEL}`, or Enter alone to leave it waiting: ")
except EOFError:
return None
label = typed.strip()
if not label:
return None
pick = repo_pick.of_label(label)
if pick is not None:
return repo_pick.record(epic.store, issue, pick)
named = f"; the repo {label}'s label is `{repo_pick.REPO_PREFIX}{label}`" if repo_pick.of_label(repo_pick.REPO_PREFIX + label) else ""
say(f"`{label}` is none of those labels{named}", epic.effects)
def located(epic: Planned, picks: list[repo_pick.Repo]) -> dict[str, repos.Located] | Failure:
"""Each picked repo's checkout and project config, by the repo's name."""
places: dict[str, repos.Located] = {}
for name in sorted({pick.name for pick in picks}):
place = repos.locate(name, [each.checkout for each in places.values()], epic.config, epic.home, epic.effects.git)
if isinstance(place, Failure):
return place
places[name] = place
return places
def ranked_keys(epic: Planned, issues: list[EpicIssue]) -> list[str] | Failure:
"""The keys of the open child issues do-epic filed that hold scores and one pick, in the order ranking gives them; empty where fewer than two do, since one issue has no order.
Every other issue keeps its position: a person's issue, one nobody scored, one with no pick yet or with two, and an item split by repo, since several repos' goals would score it."""
ours = [issue for issue in issues if issue.parent == epic.key and issue.by_loop and not issue.done and split.SPLIT_LABEL not in issue.labels and (pick := repo_pick.recorded(issue)) is not None and not isinstance(pick, Failure) and not ranking.unscored(item_of(issue, {}), issue.key)]
if len(ours) < 2:
return []
numbers = {issue.key: number(issue.key) for issue in ours}
keys = {id_: key for key, id_ in numbers.items()}
if clash := next(((key, keys[id_]) for key, id_ in numbers.items() if keys[id_] != key), None):
return Failure(f"{clash[0]} and {clash[1]} share a number in different Jira projects, so the issues do-epic filed in the epic {epic.key} cannot be ranked; move one of the two to the other's Jira project")
scoring, goals = epic.record.section("Scoring"), epic.record.section("Goals")
if failed := next((each for each in (scoring, goals) if isinstance(each, Failure)), None):
return Failure(f"the epic {epic.key}'s description: {failed.reason}")
assert isinstance(scoring, str) and isinstance(goals, str)
formulas = FORMULA.findall(scoring)
if len(formulas) != 1:
return Failure(f"the epic {epic.key}'s description states `Score = ...` {len(formulas)} times under ## Scoring; state the formula that ranks its issues once, on a line of its own and inside backticks, such as `Score = 100 * V / (2**S + 32)`")
picks = {issue.key: repo_pick.recorded(issue) for issue in ours}
places = located(epic, [pick for pick in picks.values() if isinstance(pick, repo_pick.Repo)])
if isinstance(places, Failure):
return places
rankings: dict[str, ranking.RepoRanking] = {}
for name, place in places.items():
texts = weighing_texts(goals_store(place.config), record_store(place.config, "decisions"), record_store(place.config, "comprehension-history"))
if isinstance(texts, Failure):
return Failure(f"{name}: {texts.reason}")
rankings[name] = ranking.RepoRanking(*texts, place.config.readability_floor)
items = [ranking.EpicItem(item_of(issue, numbers), pick.name if isinstance(pick := picks[issue.key], repo_pick.Repo) else None) for issue in ours]
scored = ranking.ranked(items, formulas[0], goals, rankings)
return scored if isinstance(scored, Failure) else [keys[item.id] for item, _ in scored]
def item_of(issue: EpicIssue, numbers: dict[str, int]) -> Item:
"""The issue as ranking scores it. numbers holds the number of each issue ranked with it, by key; the item is blocked by those of them that block the issue."""
return Item(numbers.get(issue.key, 0), NO_RELEASE, issue.exempt, issue.summary, issue.scores, issue.moves, tuple(sorted(numbers[key] for key in issue.blockers if key in numbers)))
+3 -3
View File
@@ -84,14 +84,14 @@ def split(store: EpicStore, issue: EpicIssue, by_person: bool, rule: str, langua
continue
key = store.file(issue.key, task_summary(part.repo, issue.summary), part.change, (label_of(Repo(part.repo)),))
if isinstance(key, Failure):
return Failure(f"cannot file the sub-task for {part.repo} under {issue.key}: {key.reason}; {sub_tasks_filed(filed)}; run split again to file the rest")
return Failure(f"cannot file the sub-task for {part.repo} under {issue.key}: {key.reason}; {sub_tasks_filed(filed)}; run do-epic again to file the rest")
filed.append(key)
posted = store.comment(issue.key, predicted.comment) if by_person else None
if isinstance(posted, Failure):
return Failure(f"cannot comment on {issue.key}: {posted.reason}; {sub_tasks_filed(filed)}; run split again to post it")
return Failure(f"cannot comment on {issue.key}: {posted.reason}; {sub_tasks_filed(filed)}; run do-epic again to post it")
marked = store.add_label(issue.key, SPLIT_LABEL)
if isinstance(marked, Failure):
return Failure(f"cannot mark {issue.key} as split: {marked.reason}; {sub_tasks_filed(filed)}; run split again to mark it")
return Failure(f"cannot mark {issue.key} as split: {marked.reason}; {sub_tasks_filed(filed)}; run do-epic again to mark it")
return Split(repos, tuple(filed))
+2 -2
View File
@@ -70,7 +70,7 @@ class FindingsTest(DoEpicTest):
class FilingAFinding(FindingsTest):
def test_files_an_issue_under_the_epic_with_the_detail_piped_in_and_doesnt_start_anything(self) -> None:
code, out, err, fake = self.run_with(["ABC-12", "--file", "Retry the import on a 503"], "The client times out.\n")
self.assertEqual((code, out, err), (0, "Filed ABC-102 in the epic ABC-12. It waits until someone labels it: `repo:<name>` for the repo that works it, `do-epic-claude` for work of Claude's that changes no repo, or `do-epic-human` for a task of the human's.\n", ""))
self.assertEqual((code, out, err), (0, "Filed ABC-102 in the epic ABC-12. It has no label that says where it is worked, so the next `do-epic ABC-12` picks one: `repo:<name>` for the repo that works it, `do-epic-claude` for work of Claude's that changes no repo, or `do-epic-human` for a task of the human's.\n", ""))
self.assertEqual(self.keys, ["ABC-12"])
filed = self.store.issues[-1]
self.assertEqual((filed.key, filed.summary, filed.detail, filed.labels, filed.parent, filed.by_loop), ("ABC-102", "Retry the import on a 503", "The client times out.", (), "ABC-12", True))
@@ -88,7 +88,7 @@ class FilingAFinding(FindingsTest):
filed = self.store.issues[-1]
self.assertEqual((code, out, filed.labels), (0, f"Filed {filed.key} in the epic ABC-12.\n", ("do-epic-release-review", "repo:api")))
code, out, _, _ = self.run_with(["ABC-12", "--file", "Review api", "--label", "do-epic-release-review"])
self.assertEqual((code, out), (0, f"Filed {self.store.issues[-1].key} in the epic ABC-12. It waits until someone labels it: `repo:<name>` for the repo that works it, `do-epic-claude` for work of Claude's that changes no repo, or `do-epic-human` for a task of the human's.\n"))
self.assertEqual((code, out), (0, f"Filed {self.store.issues[-1].key} in the epic ABC-12. It has no label that says where it is worked, so the next `do-epic ABC-12` picks one: `repo:<name>` for the repo that works it, `do-epic-claude` for work of Claude's that changes no repo, or `do-epic-human` for a task of the human's.\n"))
def test_refuses_a_label_the_scheduler_doesnt_read(self) -> None:
for label in ("api", "repo:", "repo:a b"):
+1 -1
View File
@@ -168,7 +168,7 @@ class TheFinishingChunk(DoEpicTest):
self.assertIn(["/b/do-epic", "--chunk", "ABC-12", "ABC-12"], [args[-4:] for args in fake.tmux_calls])
def test_doesnt_start_while_an_issue_is_open_or_in_an_epic_without_issues(self) -> None:
for issues in ([issue("ABC-20", "do-epic-claude", done=True), issue("ABC-21")], []):
for issues in ([issue("ABC-20", "do-epic-claude", done=True), issue("ABC-21", "do-epic-human")], []):
self.issues = issues
fake = FakeEffects(on_terminal=False)
code, out, _ = self.run_main(["ABC-12"], fake)
+39 -2
View File
@@ -34,6 +34,11 @@ from do_epic.test_do_epic import SETTINGS
DESCRIPTION = "**Max parallel chunks:** 2\n\n## Goals\nShip the import.\n\n## Audience\nThe client's team.\n"
def structured(output: object, key: str | None = "structured_output") -> subprocess.CompletedProcess[str]:
"""claude's reply that holds output as its structured answer. Where key is None, output is the whole result event."""
return subprocess.CompletedProcess([], 0, json.dumps({"type": "result", key: output} if key else output), "")
@dataclasses.dataclass(frozen=True)
class Description:
"""Stands in for an epic's description in Jira."""
@@ -52,7 +57,7 @@ class DoEpicTest(unittest.TestCase):
folder.mkdir(parents=True)
(folder / "config.toml").write_text(SETTINGS, encoding="utf-8")
(folder / "repo-rule.md").write_text("A label that equals a repo's name names that repo.\n", encoding="utf-8")
self.issues = [issue("ABC-20"), dataclasses.replace(issue("ABC-21", "do-epic-claude"), detail="Tidy the docs.", scores={"L": 3, "E": 2, "I": 3})]
self.issues = [issue("ABC-20", "do-epic-human"), dataclasses.replace(issue("ABC-21", "do-epic-claude"), detail="Tidy the docs.", scores={"L": 3, "E": 2, "I": 3})]
self.description: str | Failure = DESCRIPTION
# What the forge answers each read of a chunk's gate, in turn; the last answers every later read. No worktree has the chunk's branch, so no chunk parks.
self.forges = [Forge(worktrees="worktree /code/api\nbranch refs/heads/main\n")]
@@ -126,12 +131,35 @@ class TheCommand(DoEpicTest):
code, out, _ = self.run_main(["ABC-12"], fake, {"LOOP_CLAUDE_WORKER_MODEL": "m"})
self.assertEqual(code, 0)
self.assertIn("started ABC-21 in the tmux session epic-ABC-12\n", out)
self.assertIn("ABC-20 waits: no label names its repo\n", out)
self.assertIn("ABC-20 waits: it is a human's task\n", out)
started = [args for args in fake.tmux_calls if args[0] == "new-session"]
self.assertEqual(started, [["new-session", "-d", "-s", "epic-ABC-12", "-n", "ABC-21", "-c", str(self.home / ".local/state/do-epic/ABC-12"), "-e", "LOOP_CLAUDE_WORKER_MODEL=m", "-e", "CHUNK_PR_PARKS=1", "-P", "-F", "#{window_id}", "--", "/b/do-epic", "--chunk", "ABC-21", "ABC-12"]])
# The session is no checkout's, so nothing marks it as one's.
self.assertNotIn(tmux.OWNER, [args[3] for args in fake.tmux_calls if args[0] == "set-option"])
def test_plans_an_issue_no_label_places_before_it_starts_the_chunks(self) -> None:
self.issues = [issue("ABC-20")]
fake = FakeEffects(on_terminal=False, claude=[structured({"parts": []}), structured({"pick": "claude"})])
code, out, err = self.run_main(["ABC-12"], fake)
self.assertEqual(code, 0, err)
self.assertLess(out.index("ABC-20 is labelled do-epic-claude\n"), out.index("started ABC-20 in the tmux session epic-ABC-12\n"))
def test_starts_no_chunk_where_a_usage_limit_ends_the_planning(self) -> None:
self.issues.append(issue("ABC-22"))
limit = {"type": "result", "is_error": True, "api_error_status": 429, "result": "You've hit your limit"}
fake = FakeEffects(claude=[structured(limit, None)])
code, _, err = self.run_main(["ABC-12"], fake)
self.assertEqual(code, 1)
self.assertIn("the epic is not planned, so no chunk started: You've hit your limit\n", err)
self.assertEqual([args for args in fake.tmux_calls if args[0] == "new-session"], [])
def test_says_why_the_epic_is_not_planned_in_full_and_starts_the_chunks_that_may_start(self) -> None:
self.issues = [dataclasses.replace(issue(key, "do-epic-claude"), scores={"L": 1, "E": 1, "I": 1, "S": 1}, by_loop=True) for key in ("ABC-20", "ABC-21")]
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.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:
self.description = Failure("Jira answered 401")
code, _, err = self.run_main(["ABC-12"], FakeEffects())
@@ -298,6 +326,15 @@ class TheHumansRun(DoEpicTest):
class AChunksRun(DoEpicTest):
def test_a_finished_chunk_starts_the_next_without_planning_again(self) -> None:
self.issues.append(issue("ABC-22"))
fake = FakeEffects(streams=[self.worker()], claude=[judged("finished")], git=UNREAD, windows="ABC-21\t0\t@9\n")
code, out, err = self.run_main(["--chunk", "ABC-21", "ABC-12"], fake, MODELS)
self.assertEqual(code, 0, err)
self.assertIn("the chunk finished; started no other\n", out)
# The one claude call is the judge's: ABC-22, which no label places, waits for the human's do-epic.
self.assertEqual(len(fake.made("claude")), 1)
def test_runs_cycles_until_the_judge_rules_it_finished_then_starts_the_next_chunk(self) -> None:
self.issues.append(issue("ABC-22", "do-epic-claude"))
self.description = DESCRIPTION.replace("2", "1")
+334
View File
@@ -0,0 +1,334 @@
import contextlib
import dataclasses
import io
import json
import pathlib
import shutil
import subprocess
import sys
sys.path.insert(0, str(pathlib.Path(__file__).resolve().parents[1]))
from project_config.test_project_config import configured
from do_epic.test_main import Description, DoEpicTest, structured as says
from do_epic.backend.protocol import EpicIssue
from do_epic.epic_record import EpicRecord
from failure import Failure
from loop_claude.test_loop_claude import FakeEffects
from do_epic.test_scheduler import issue
from claude_code.reply import Limited
from do_epic.config import load
from do_epic.backend.fake import MemoryEpic
from plan.todo_table import parse_moves
from do_epic import planning
RANKED = "## Goals\n1. **Achieve:** Ship the import.\n\n## Audience\nThe client's team.\n\n## Scoring\n`Score = V`\n"
LIMIT = {"type": "result", "is_error": True, "api_error_status": 429, "result": "You've hit your limit"}
def scored(key: str, moves: str, *labels: str, blockers: tuple[str, ...] = (), by_loop: bool = True) -> EpicIssue:
"""An open issue the loop filed, holding scores and moving the goals moves names."""
parsed = parse_moves(key, moves)
assert not isinstance(parsed, Failure), parsed
return dataclasses.replace(issue(key, *labels, blockers=blockers), scores={"L": 1, "E": 1, "I": 1, "S": 1}, moves=parsed, by_loop=by_loop)
class Planning(DoEpicTest):
def plan(self, fake: FakeEffects) -> tuple[list[EpicIssue] | Failure | Limited, MemoryEpic, str]:
"""What planning answers for self.issues, the store it changed and what it printed on stdout. self.asked holds what it asked the human, on stderr."""
config = load(self.home)
assert not isinstance(config, Failure), config
store = MemoryEpic("ABC-12", list(self.issues))
epic = planning.Planned("ABC-12", config, store, EpicRecord(Description(self.description)), self.home, fake.effects()) # type: ignore[arg-type]
out, self.asked = io.StringIO(), io.StringIO()
with contextlib.redirect_stdout(out), contextlib.redirect_stderr(self.asked):
read = store.read()
assert not isinstance(read, Failure)
issues, stopped = planning.planned(epic, read)
return issues if stopped is None else stopped, store, out.getvalue()
def labels(self, store: MemoryEpic) -> dict[str, tuple[str, ...]]:
return {each.key: each.labels for each in store.issues}
def test_an_issue_a_label_places_is_planned_without_claude(self) -> None:
self.issues = [issue("ABC-20", "repo:api"), issue("ABC-21", "do-epic-claude"), issue("ABC-22", "split-by-repo"), issue("ABC-23", done=True)]
fake = FakeEffects()
found, _, out = self.plan(fake)
self.assertEqual((found, out, fake.made("claude")), (self.issues, "", []))
def test_labels_an_unplaced_issue_with_the_repo_claude_picks_on_the_repoless_models_rung(self) -> None:
self.issues = [issue("ABC-20")]
fake = FakeEffects(claude=[says({"parts": [{"repo": "api", "change": "Add the endpoint."}]}), says({"pick": "repo", "repo": "api"})])
found, store, out = self.plan(fake)
self.assertEqual(found, [issue("ABC-20", "repo:api")])
self.assertEqual(self.labels(store), {"ABC-20": ("repo:api",)})
self.assertIn("planning ABC-20\n", out)
self.assertIn("ABC-20 is labelled repo:api\n", out)
for args, _ in fake.made("claude"):
self.assertEqual(args[args.index("--model") + 1], "claude-opus-5-5")
self.assertIn("A label that equals a repo's name names that repo.", fake.made("claude")[1][1])
def test_labels_work_without_a_repo_as_claudes_or_a_humans(self) -> None:
for pick, label in (("claude", "do-epic-claude"), ("human", "do-epic-human")):
with self.subTest(pick=pick):
self.issues = [issue("ABC-20")]
_, store, _ = self.plan(FakeEffects(claude=[says({"parts": []}), says({"pick": pick})]))
self.assertEqual(self.labels(store), {"ABC-20": (label,)})
def test_splits_an_issue_that_changes_several_repos_into_a_sub_task_for_each_and_picks_no_repo_for_it(self) -> None:
self.issues = [issue("ABC-20")]
fake = FakeEffects(claude=[says({"parts": [{"repo": "api", "change": "Add the endpoint."}, {"repo": "web", "change": "Call it."}], "comment": "Split by repo: api and web."})])
found, store, out = self.plan(fake)
assert not isinstance(found, Failure | Limited), found
self.assertEqual([(each.key, each.parent, each.labels) for each in found], [("ABC-20", "ABC-12", ("split-by-repo",)), ("ABC-101", "ABC-20", ("repo:api",)), ("ABC-102", "ABC-20", ("repo:web",))])
# A person filed ABC-20, so the team is told.
self.assertEqual(store.comments, {"ABC-20": ["Split by repo: api and web."]})
self.assertIn("ABC-20 is split into a sub-task for each of api, web\n", out)
self.assertIn("in English, that tells the team why it is split by repo", fake.made("claude")[0][1])
def test_plans_the_issue_after_one_that_is_split(self) -> None:
self.issues = [issue("ABC-20"), issue("ABC-21")]
parts = says({"parts": [{"repo": "api", "change": "Add the endpoint."}, {"repo": "web", "change": "Call it."}], "comment": "Split by repo: api and web."})
_, store, _ = self.plan(FakeEffects(claude=[parts, says({"parts": []}), says({"pick": "human"})]))
self.assertEqual(self.labels(store)["ABC-21"], ("do-epic-human",))
def test_writes_to_the_team_in_the_epics_language(self) -> None:
self.description = "**Language:** Swedish\n"
self.issues = [issue("ABC-20")]
fake = FakeEffects(claude=[says({"parts": []}), says({"pick": "claude"})])
self.plan(fake)
self.assertIn("in Swedish, that tells the team why it is split by repo", fake.made("claude")[0][1])
def test_each_claude_call_runs_in_the_epics_state_folder(self) -> None:
self.issues = [issue("ABC-20")]
fake = FakeEffects(claude=[says({"parts": []}), says({"pick": "claude"})])
effects, folders = fake.effects(), []
def claude(args: object, cwd: str, stdin: object) -> object:
folders.append(cwd)
return effects.claude(args, cwd, stdin) # type: ignore[arg-type]
config = load(self.home)
epic = planning.Planned("ABC-12", config, MemoryEpic("ABC-12", list(self.issues)), EpicRecord(Description("")), self.home, dataclasses.replace(effects, claude=claude)) # type: ignore[arg-type]
with contextlib.redirect_stdout(io.StringIO()):
planning.planned(epic, list(self.issues))
folder = self.home / ".local" / "state" / "do-epic" / "ABC-12"
self.assertEqual((folders, folder.is_dir()), ([str(folder)] * 2, True))
def test_a_model_off_the_routing_ladder_has_no_rung(self) -> None:
found = planning.planning_rung("claude-nope-1")
assert isinstance(found, Failure), found
self.assertIn("`repoless-model` names claude-nope-1, which is not on the routing ladder ", found.reason)
def test_fails_where_a_labelled_repo_has_no_checkout_to_read(self) -> None:
self.issues = [issue("ABC-19", "repo:ghost"), issue("ABC-20")]
fake = FakeEffects()
found, _, _ = self.plan(fake)
assert isinstance(found, Failure), found
self.assertIn("ghost", found.reason)
self.assertEqual(fake.made("claude"), [])
def test_the_split_reads_the_checkout_of_each_repo_a_label_of_the_epic_names(self) -> None:
checkout = self.home / "code" / "api"
configured(self, checkout, home=self.home)
self.issues = [issue("ABC-19", "repo:api", done=True), issue("ABC-20")]
fake = FakeEffects(claude=[says({"parts": []}), says({"pick": "claude"})])
self.plan(fake)
args = fake.made("claude")[0][0]
self.assertEqual(args[args.index("--add-dir") + 1], str(checkout))
def test_asks_the_human_for_the_label_of_an_issue_the_rule_leaves_unclear_until_one_is_typed(self) -> None:
self.issues = [issue("ABC-20")]
fake = FakeEffects(claude=[says({"parts": []}), says({"pick": "unclear", "question": "Is the importer in api or in web?"})], inputs=["api", "a b", " repo:web "])
found, store, out = self.plan(fake)
self.assertEqual(found, [issue("ABC-20", "repo:web")])
self.assertIn("ABC-20, Do ABC-20: Is the importer in api or in web?\n", self.asked.getvalue())
self.assertIn("`api` is none of those labels; the repo api's label is `repo:api`\n", self.asked.getvalue())
self.assertIn("`a b` is none of those labels\n", self.asked.getvalue())
self.assertEqual(fake.made("input"), ["The label that says where ABC-20 is worked, `repo:<name>`, `do-epic-claude` or `do-epic-human`, or Enter alone to leave it waiting: "] * 3)
def unclear_then_claudes(self, **fake: object) -> tuple[dict[str, tuple[str, ...]], str]:
"""The labels and the output after planning ABC-20, which the rule leaves unclear, and ABC-21, which is Claude's, on a FakeEffects made with fake."""
self.issues = [issue("ABC-20"), issue("ABC-21")]
unclear = says({"pick": "unclear", "question": "Is the importer in api or in web?"})
_, store, out = self.plan(FakeEffects(claude=[says({"parts": []}), unclear, says({"parts": []}), says({"pick": "claude"})], **fake)) # type: ignore[arg-type]
return self.labels(store), out
def test_an_unclear_issue_waits_off_a_terminal_and_the_next_is_planned(self) -> None:
labels, out = self.unclear_then_claudes(on_terminal=False)
self.assertEqual(labels, {"ABC-20": (), "ABC-21": ("do-epic-claude",)})
self.assertNotIn("ABC-20 is labelled", out)
self.assertIn("ABC-20 waits for your answer: Is the importer in api or in web? Run `do-epic ABC-12` on a terminal to answer, or label the issue in Jira.\n", out)
def test_an_unclear_issue_waits_where_the_human_answers_with_enter_alone(self) -> None:
labels, out = self.unclear_then_claudes(inputs=[" "])
self.assertEqual((labels, "ABC-20 is labelled" in out), ({"ABC-20": (), "ABC-21": ("do-epic-claude",)}, False))
def test_an_unclear_issue_waits_where_the_terminals_input_ends(self) -> None:
labels, out = self.unclear_then_claudes(inputs=[EOFError()])
self.assertEqual((labels, "ABC-20 is labelled" in out), ({"ABC-20": (), "ABC-21": ("do-epic-claude",)}, False))
def test_clones_a_labelled_repo_without_a_checkout_beside_the_origin_of_the_others(self) -> None:
configured(self, self.home / "code" / "api", home=self.home)
configured(self, self.home / "code" / "web", home=self.home)
shutil.rmtree(self.home / "code" / "web")
self.issues = [issue("ABC-18", "repo:api", done=True), issue("ABC-19", "repo:web", done=True), issue("ABC-20")]
fake = FakeEffects(git=["https://git.example/acme/api.git\n", ""], claude=[says({"parts": []}), says({"pick": "claude"})])
self.plan(fake)
origin, clone = fake.made("git")
self.assertEqual((origin, clone[-4:]), (["remote", "get-url", "origin"], ["clone", "--", "https://git.example/acme/web", str(self.home / "code" / "web")]))
def health_first(self, floor: str) -> list[str]:
"""The order of ABC-20, which moves the epic's goal by 9, and ABC-21, which moves code health by 3 in a repo that scored 7.5 and whose config ends with the line floor."""
checkout = self.home / "code" / "api"
folder = configured(self, checkout, home=self.home)
with (folder / "config.toml").open("a", encoding="utf-8") as config:
config.write(floor)
(checkout / "README.md").write_text("## Goals\n\n1. **Achieve:** Serve the API.\n\n## Audience\nIts callers.\n", encoding="utf-8")
(checkout / "docs").mkdir()
(checkout / "docs" / "comprehension-history.md").write_text("# Comprehension history\n\n## 2026-10-08T12:00:00Z, PR #1 at aaaaaaa\n\n| Seat | Overall |\n|---|---|\n| Mid A | 6 |\n| Mean | 7.5 |\n", encoding="utf-8")
self.description = RANKED
self.issues = [scored("ABC-20", "epic 1 by 9", "do-epic-claude"), scored("ABC-21", "code health by 3", "repo:api")]
found = self.plan(FakeEffects())[0]
assert not isinstance(found, Failure | Limited), found
return [each.key for each in found]
def test_code_health_weighs_four_times_in_a_repo_under_the_floor_its_config_sets(self) -> None:
# 4 * 3 * 0.97 is above the 9 of the epic's first goal.
self.assertEqual(self.health_first("readability-floor = 8.0\n"), ["ABC-21", "ABC-20"])
def test_code_health_weighs_once_in_a_repo_at_its_floor(self) -> None:
# 3 * 0.97 is under the 9 of the epic's first goal.
self.assertEqual(self.health_first(""), ["ABC-20", "ABC-21"])
def test_an_issue_claude_fails_on_is_named_and_the_next_is_planned(self) -> None:
self.issues = [issue("ABC-20"), issue("ABC-21")]
fake = FakeEffects(claude=[subprocess.CompletedProcess([], 1, "", ""), says({"parts": []}), says({"pick": "claude"})])
_, store, out = self.plan(fake)
self.assertEqual(self.labels(store), {"ABC-20": (), "ABC-21": ("do-epic-claude",)})
self.assertIn("ABC-20 is not planned: the repo split exited 1\n", out)
def test_a_usage_limit_ends_the_planning(self) -> None:
self.issues = [issue("ABC-20"), issue("ABC-21")]
fake = FakeEffects(claude=[subprocess.CompletedProcess([], 0, json.dumps(LIMIT), "")])
found, _, _ = self.plan(fake)
self.assertIsInstance(found, Limited)
self.assertEqual(len(fake.made("claude")), 1)
def test_re_ranks_the_loops_scored_issues_by_score_with_a_blocker_first_and_leaves_every_other_issue_in_place(self) -> None:
self.description = RANKED
self.issues = [scored("ABC-20", "epic 1 by 2", "do-epic-claude"), scored("ABC-21", "epic 1 by 9", "do-epic-claude", by_loop=False), scored("ABC-22", "epic 1 by 5", "do-epic-claude", blockers=("ABC-24",)), dataclasses.replace(issue("ABC-23", "do-epic-claude"), by_loop=True), scored("ABC-24", "epic 1 by 3", "do-epic-claude")]
found, store, out = self.plan(FakeEffects())
assert not isinstance(found, Failure | Limited), found
# ABC-22 scores highest, and ABC-24 blocks it. ABC-21 is a person's, and nobody scored ABC-23.
self.assertEqual([each.key for each in found], ["ABC-24", "ABC-21", "ABC-22", "ABC-23", "ABC-20"])
self.assertIn("re-ranking the issues do-epic filed in ABC-12's backlog\n", out)
def test_ranks_an_issue_in_a_repo_by_that_repos_goals_after_the_epics(self) -> None:
checkout = self.home / "code" / "api"
configured(self, checkout, home=self.home)
(checkout / "README.md").write_text("## Goals\n\n**Void:** code health, since it is a one-off script.\n\n1. **Achieve:** Serve the API.\n\n## Audience\nIts callers.\n", encoding="utf-8")
self.description = RANKED
self.issues = [scored("ABC-20", "repo 1 by 9", "repo:api"), scored("ABC-21", "epic 1 by 9", "do-epic-claude")]
found, _, _ = self.plan(FakeEffects())
assert not isinstance(found, Failure | Limited), found
self.assertEqual([each.key for each in found], ["ABC-21", "ABC-20"])
def test_issues_already_in_their_order_are_not_ranked_again(self) -> None:
self.description = RANKED
self.issues = [scored("ABC-20", "epic 1 by 9", "do-epic-claude"), scored("ABC-21", "epic 1 by 2", "do-epic-claude")]
found, _, out = self.plan(FakeEffects())
self.assertEqual((found, out), (self.issues, ""))
def test_fails_where_the_epic_states_no_formula_to_rank_two_scored_issues_by(self) -> None:
self.issues = [scored("ABC-20", "epic 1 by 2", "do-epic-claude"), scored("ABC-21", "epic 1 by 9", "do-epic-claude")]
found, store, _ = self.plan(FakeEffects())
self.assertEqual(found, Failure("the epic ABC-12's description states `Score = ...` 0 times under ## Scoring; state the formula that ranks its issues once, on a line of its own and inside backticks, such as `Score = 100 * V / (2**S + 32)`"))
self.assertEqual([each.key for each in store.issues], ["ABC-20", "ABC-21"])
def test_fails_where_the_formula_names_a_score_no_issue_holds(self) -> None:
self.description = RANKED.replace("Score = V", "Score = Q")
self.issues = [scored("ABC-20", "epic 1 by 2", "do-epic-claude"), scored("ABC-21", "epic 1 by 9", "do-epic-claude")]
self.assertIsInstance(self.plan(FakeEffects())[0], Failure)
def test_fails_where_two_issues_to_rank_share_a_number(self) -> None:
self.description = RANKED
self.issues = [scored("ABC-20", "epic 1 by 2", "do-epic-claude"), scored("XYZ-20", "epic 1 by 9", "do-epic-claude")]
self.assertEqual(self.plan(FakeEffects())[0], Failure("ABC-20 and XYZ-20 share a number in different Jira projects, so the issues do-epic filed in the epic ABC-12 cannot be ranked; move one of the two to the other's Jira project"))
def test_fails_where_the_description_cannot_be_read_to_rank_by(self) -> None:
self.description = Failure("Jira answered 503")
self.issues = [scored("ABC-20", "epic 1 by 2", "do-epic-claude"), scored("ABC-21", "epic 1 by 9", "do-epic-claude")]
self.assertEqual(self.plan(FakeEffects())[0], Failure("the epic ABC-12's description: Jira answered 503"))
def test_fails_naming_the_repo_whose_goals_cannot_be_read(self) -> None:
checkout = self.home / "code" / "api"
configured(self, checkout, home=self.home)
(checkout / "README.md").unlink(missing_ok=True)
self.description = RANKED
self.issues = [scored("ABC-20", "repo 1 by 9", "repo:api"), scored("ABC-21", "epic 1 by 9", "do-epic-claude")]
found = self.plan(FakeEffects())[0]
assert isinstance(found, Failure), found
self.assertRegex(found.reason, r"^api: .*missing or empty")
def test_ranks_a_security_issue_first(self) -> None:
self.description = RANKED
self.issues = [scored("ABC-20", "epic 1 by 9", "do-epic-claude"), dataclasses.replace(scored("ABC-21", "epic 1 by 2", "do-epic-claude"), exempt="security")]
found = self.plan(FakeEffects())[0]
assert not isinstance(found, Failure | Limited), found
self.assertEqual([each.key for each in found], ["ABC-21", "ABC-20"])
def test_one_scored_issue_needs_no_formula(self) -> None:
self.issues = [scored("ABC-20", "epic 1 by 2", "do-epic-claude"), issue("ABC-21", "do-epic-claude")]
self.assertEqual(self.plan(FakeEffects())[0], self.issues)
def planned_on(self, store: MemoryEpic, fake: FakeEffects) -> tuple[list[EpicIssue], Failure | Limited | None]:
"""What planning answers for self.issues on a store that doesn't read as MemoryEpic does."""
config = load(self.home)
assert not isinstance(config, Failure), config
epic = planning.Planned("ABC-12", config, store, EpicRecord(Description(self.description)), self.home, fake.effects()) # type: ignore[arg-type]
with contextlib.redirect_stdout(io.StringIO()):
return planning.planned(epic, list(self.issues))
def test_a_label_it_added_counts_where_the_tracker_cannot_be_read_afterwards(self) -> None:
self.issues = [issue("ABC-20")]
found = self.planned_on(Unreadable("ABC-12", list(self.issues)), FakeEffects(claude=[says({"parts": []}), says({"pick": "claude"})]))
self.assertEqual(found, ([issue("ABC-20", "do-epic-claude")], Failure("Jira answered 503")))
def test_a_label_and_an_order_it_wrote_count_where_the_trackers_search_lags(self) -> None:
self.description = RANKED
self.issues = [scored("ABC-20", "epic 1 by 2", "do-epic-claude"), scored("ABC-21", "epic 1 by 9"), issue("ABC-22")]
parts = says({"parts": [{"repo": "api", "change": "Add the endpoint."}, {"repo": "web", "change": "Call it."}], "comment": "Split by repo: api and web."})
found, stopped = self.planned_on(Lagging("ABC-12", list(self.issues)), FakeEffects(claude=[says({"parts": []}), says({"pick": "claude"}), parts]))
self.assertEqual(([(each.key, each.labels) for each in found], stopped), ([("ABC-21", ("do-epic-claude",)), ("ABC-20", ("do-epic-claude",)), ("ABC-22", ("split-by-repo",))], None))
def test_keeps_the_order_and_says_why_where_the_tracker_refuses_the_ranking(self) -> None:
self.description = RANKED
self.issues = [scored("ABC-20", "epic 1 by 2", "do-epic-claude"), scored("ABC-21", "epic 1 by 9", "do-epic-claude")]
store = MemoryEpic("ABC-12", list(self.issues))
store.fails = "Jira answered 503"
found, stopped = self.planned_on(store, FakeEffects())
assert isinstance(stopped, Failure), stopped
self.assertEqual(([each.key for each in found], "Jira answered 503" in stopped.reason), (["ABC-20", "ABC-21"], True))
def test_an_issue_without_a_pick_is_not_ranked(self) -> None:
self.description = RANKED
self.issues = [scored("ABC-20", "epic 1 by 2", "do-epic-claude"), scored("ABC-21", "code health by 9")]
found, _, out = self.plan(FakeEffects(claude=[subprocess.CompletedProcess([], 1, "", "")]))
self.assertEqual((found, "re-ranking" in out), (self.issues, False))
class Unreadable(MemoryEpic):
"""A tracker that fails each read once an issue is labelled."""
def add_label(self, key: str, label: str) -> None | Failure:
self.fails = "Jira answered 503"
return None
class Lagging(MemoryEpic):
"""A tracker whose search shows the issues as they were before any write."""
def read(self) -> list[EpicIssue] | Failure:
return list(self.before)
def __init__(self, key: str, issues: list[EpicIssue]) -> None:
super().__init__(key, issues)
self.before = list(issues)
+1 -1
View File
@@ -322,7 +322,7 @@ class TheFirstPrompt(unittest.TestCase):
def test_the_task_names_the_checkout_and_branch_and_quotes_a_description_only_where_there_is_one(self) -> None:
labels = "`repo:<name>` for the repo that works it, `do-epic-claude` for work of Claude's that changes no repo, or `do-epic-human` for a task of the human's"
told = (
f"File a finding about one of the epic's goals in the epic, with `/b/do-epic ABC-12 --file \"<summary>\" --label <label>` and its detail on stdin. The label is {labels}; leave it out where you cannot tell, and the issue waits for the human. "
f"File a finding about one of the epic's goals in the epic, with `/b/do-epic ABC-12 --file \"<summary>\" --label <label>` and its detail on stdin. The label is {labels}; leave it out where you cannot tell, and the next `do-epic` the human runs picks it. "
"Where filing fails and says the issue may exist, ask the human to look before you file it again. File a finding about a repo's goals by that repo's rules. Where unsure which, ask the human. "
"Record a decision that governs the epic, such as an answer the human typed, with `/b/do-epic ABC-12 --record-decision \"<title>\"` and its text on stdin. Write the issue and the decision in Swedish, the epic's language."
)
+4 -4
View File
@@ -72,13 +72,13 @@ class Split_(unittest.TestCase):
def test_a_first_filing_that_fails_says_the_run_filed_no_sub_task(self) -> None:
self.store.fails_files = True
self.assertEqual(self.run_split(says(TWO)), Failure(f"cannot file the sub-task for api under {self.key}: Jira answered 500; this run filed no sub-task; run split again to file the rest"))
self.assertEqual(self.run_split(says(TWO)), Failure(f"cannot file the sub-task for api under {self.key}: Jira answered 500; this run filed no sub-task; run do-epic again to file the rest"))
def test_a_comment_that_fails_leaves_the_item_unmarked_and_the_next_run_files_nothing_again(self) -> None:
self.store.fails_comments = True
failed = self.run_split(says(TWO), by_person=True)
first, second = (task.key for task in self.tasks())
self.assertEqual(failed, Failure(f"cannot comment on {self.key}: Jira answered 500; this run filed {first}, {second}; run split again to post it"))
self.assertEqual(failed, Failure(f"cannot comment on {self.key}: Jira answered 500; this run filed {first}, {second}; run do-epic again to post it"))
self.assertEqual(self.issue().labels, ("api",))
self.store.fails_comments = False
done = self.run_split(says(TWO), by_person=True)
@@ -116,7 +116,7 @@ class Split_(unittest.TestCase):
self.store.jammed = True
failed = self.run_split(says(TWO), by_person=True)
first = self.tasks()[0].key
self.assertEqual(failed, Failure(f"cannot file the sub-task for web under {self.key}: Jira answered 500; this run filed {first}; run split again to file the rest"))
self.assertEqual(failed, Failure(f"cannot file the sub-task for web under {self.key}: Jira answered 500; this run filed {first}; run do-epic again to file the rest"))
self.assertEqual(self.issue().labels, ("api",))
self.store.jammed = False
done = self.run_split(says(TWO), by_person=True)
@@ -176,7 +176,7 @@ class Split_(unittest.TestCase):
self.store.add_label = lambda key, label: Failure("Jira answered 500") if label == SPLIT_LABEL else None # type: ignore[method-assign]
failed = self.run_split(says(TWO))
first, second = (task.key for task in self.tasks())
self.assertEqual(failed, Failure(f"cannot mark {self.key} as split: Jira answered 500; this run filed {first}, {second}; run split again to mark it"))
self.assertEqual(failed, Failure(f"cannot mark {self.key} as split: Jira answered 500; this run filed {first}, {second}; run do-epic again to mark it"))
def test_passes_on_a_failed_or_limited_claude(self) -> None:
self.assertEqual(self.run_split(Claude("", 1)), Failure("the repo split exited 1"))
+17
View File
@@ -3003,3 +3003,20 @@ Read most (opens and searches):
- `bin/agent_cycle/interrupt.py` 1
- `bin/do_epic/parked.py` 1
- `bin/do_epic/status.py` 1
## Reading cost, chunk ce3296c9c012, finished 2026-11-19T02:25:43Z
87939 new input tokens before the first commit.
Read most (opens and searches):
- `bin/do_epic/main.py` 8
- `bin/do_epic/test_main.py` 6
- `bin/project_config/settings.py` 6
- `bin/do_epic/chunk_prompt.py` 3
- `bin/do_epic/test_scheduler.py` 2
- `skills/larv-review/SKILL.md` 2
- `README.md` 1
- `bin/chunk_pr/main.py` 1
- `bin/do_epic/findings.py` 1
- `bin/do_epic/repos.py` 1
+25 -10
View File
@@ -6,7 +6,7 @@
`Bar = 0.1`
`Next ID = 444`
`Next ID = 445`
## Items
@@ -14,12 +14,13 @@
|---|---|---|---|---|---|---|---|---|---|---|---|
| 420 | 0.12.0 | | | **End a worker that printed its final result and lingers, by killing the background shells it left, after a few minutes, and print each kill with its evidence on loop-claude's terminal.** | 2 | 2 | 2 | 4 | 3 | 1.5 by 6 | 2.0 |
| 417 | 0.12.0 | | | **Run do-epic end to end against a sandbox epic on a real Jira site with a command of its own, outside `run-tests`.** | 2 | 1 | 1 | 2 | 3 | 1 by 5 | 1.9 |
| 442 | 0.12.0 | | | **Have `do-epic <EPIC-KEY>` split each open issue by repo, pick the repo of each issue that no label names one for, asking the human where unclear, and re-rank the epic, before it starts chunks.** | 3 | 2 | 3 | 6 | 5 | 1 by 5 | 1.2 |
| 310 | 0.12.0 | | | **Compact a waiting worker's session shortly before its prompt cache expires, only when the human has not answered an interrupt by then.** | 3 | 2 | 3 | 6 | 4 | 1.4 by 3 | 0.9 |
| 422 | 0.12.0 | 420 | | **Check every 5 minutes whether a tmux window of the loop looks stuck by other signs than a lingering worker, investigate it with a headless claude, and kill only the process the investigation names.** | 3 | 2 | 3 | 6 | 5 | 1.5 by 4 | 0.8 |
| 365 | 0.13.0 | | | **Have `score-outcomes` read the finished and dropped items of a plan outside the checkout, from the project repo's history or from Jira's issue changelogs.** | 3 | 2 | 2 | 5 | 4 | 1.6 by 2, 1.1 by 2 | 1.2 |
| 368 | 0.13.0 | | | **Call a release review due, call a release ready to cut, and tell whether a chunk owes a scoring run, for a plan outside the checkout, from the project repo's history or from Jira.** | 3 | 2 | 2 | 5 | 4 | 1.6 by 2, 1.1 by 2 | 1.2 |
| 309 | 0.13.0 | | | **Run a scoring run's second pass on one head with two seats in place of four, once `larv-review agreement` shows the seats agree with each other more than a run agrees with its rerun.** | 2 | 2 | 2 | 4 | 2 | 1.4 by 3 | 1.2 |
| 419 | 0.13.0 | | | **Run the external auto-reviewer until its review of the PR's head has no findings, and answer each of its threads on the PR.** | 3 | 2 | 3 | 6 | 5 | 1.1 by 5 | 1.1 |
| 444 | 0.13.0 | | | **Rank an epic item that is split by repo, by the goals of each repo its sub-tasks name.** | 2 | 2 | 2 | 4 | 3 | 1 by 3 | 1.1 |
| 366 | 0.13.0 | | | **Count the chunks of a project whose plan sits outside the checkout in the routing figures, from the project repo's history or from Jira.** | 3 | 2 | 2 | 5 | 4 | 1.6 by 2, 1.4 by 2 | 1.1 |
| 339 | 0.13.0 | | | **Lower the reading cost of the files a chunk reads most before its first commit.** | 2 | 2 | 1 | 3 | 3 | 1.4 by 3 | 1.0 |
| 341 | 0.13.0 | | | **Hand each worker's claude a lower Read limit through `CLAUDE_CODE_FILE_READ_MAX_OUTPUT_TOKENS`, kept only where replays of the archived review rounds find what two unchanged replays find.** | 2 | 2 | 3 | 5 | 3 | 1.4 by 3 | 1.0 |
@@ -97,18 +98,22 @@ Touches:
- `bin/do-epic-e2e`
- `bin/do_epic/e2e/`
### 442. Have `do-epic <EPIC-KEY>` split each open issue by repo, pick the repo of each issue that no label names one for, asking the human where unclear, and re-rank the epic, before it starts chunks.
### 310. Compact a waiting worker's session shortly before its prompt cache expires, only when the human has not answered an interrupt by then.
Today `do-epic <EPIC-KEY>` starts only an issue whose label already records its repo, and prints that every other one waits (`bin/do_epic/scheduler.py` → `chunks`). `split.split`, `repo_pick.picked` and `ranking` exist and nothing calls them. Each is a headless claude call on a rung: route it on `repoless-model`'s rung of the shipped ladder. An `Unclear` pick is an interrupt on the terminal of the `do-epic <EPIC-KEY>` the human runs. A chunk that finishes starts the next chunks without planning again, so no window waits on a question.
281 worker resumes after the 1-hour cache expired rewrote a whole context, $379 of the $9,154 measured from 2026-09-30 to 2026-11-11 (4.1%). A compaction while the cache is warm reads the context at a twentieth of the input price and leaves about 20k tokens to rewrite later.
The README says today that do-epic doesn't pick or rank by itself (`README.md` → `## Tools`, `### Set up a project`); this item makes both true, so it rewords those two passages.
lilleman, 2026-11-11: do it on a timer, so an answer that comes in time doesn't cost anything. When loop-claude interrupts, start a timer a margin short of the cache lifetime (about 50 minutes of a 1-hour cache; read the lifetime from the session's last `cache_creation` usage). If no answer has come when it fires, compact the session, then keep waiting. Skip it below about 60k tokens of context, where the rewrite costs less than the compaction. A wait for a usage limit can't be helped this way.
Probe first that `claude -p "/compact" --resume <id>` compacts a session: the Agent SDK documents `/compact` as a prompt, the CLI pages don't show it. Claude Code compacts idle interactive sessions itself ("Compacted while idle"), but not `-p` runs. Check: the cost entries of 20 chunks with an interrupt, before and after.
Touches:
- `bin/do_epic/main.py`: `windows_opened`, `chunks_started`
- `bin/do_epic/planning.py`
- `bin/do_epic/test_main.py`
- `README.md`: `## Tools`, `### Set up a project` (small)
- `bin/agent_cycle/interrupt.py`: `interrupt`, `answered`, `typed_answer`, `WorkerSession`
- `bin/loop_effects/effects.py`: `Effects`, `system_effects`
- `bin/claude_code/tokens.py`: `tokens_of` (small)
- `bin/claude_code/reply.py`: `claude_reply` (small)
- `bin/loop_claude/loop/usage.py`: `HELP` (small)
- `bin/loop_claude/test_loop_claude.py`: `FakeEffects`, `Interrupts`
- `bin/loop_effects/test_effects.py`
### 422. Check every 5 minutes whether a tmux window of the loop looks stuck by other signs than a lingering worker, investigate it with a headless claude, and kill only the process the investigation names.
@@ -174,6 +179,16 @@ Today `larv-review` §3 → "Round cap" stops the auto-reviewer after two review
The change touches `skills/larv-review/SKILL.md` "Re-entry", which the comprehension seats found hard to follow (Locality): make it easier to read while editing it.
### 444. Rank an epic item that is split by repo, by the goals of each repo its sub-tasks name.
Today `bin/do_epic/planning.py` → `ranked_keys` leaves an item marked `split-by-repo` at its position in the backlog, as it leaves a person's issue: `ranking.ranked` scores an item in one repo's chain of goals, and a split item has several repos. Its sub-tasks follow it, so the whole change keeps whatever rank the item had when it was filed.
Touches:
- `bin/do_epic/planning.py`: `ranked_keys`
- `bin/do_epic/ranking.py`: `ranked`
- `bin/do_epic/test_planning.py`
### 366. Count the chunks of a project whose plan sits outside the checkout in the routing figures, from the project repo's history or from Jira.
One of 0.13.0's history ports, per lilleman's call of 2026-11-12.