From 7254f229a501621bb70372ab5d9ce6f86029cc97 Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Thu, 3 Dec 2026 23:00:45 +0100 Subject: [PATCH] =?UTF-8?q?Answer=20prose=20round=201:=200=20=F0=9F=94=B4,?= =?UTF-8?q?=208=20=F0=9F=9F=A1=20(1=20misread);=20reword=20the=20names=20d?= =?UTF-8?q?ecision,=20keep=20the=20alphabetical=20lists=20sorted,=20restor?= =?UTF-8?q?e=20two=20past=20quotes,=20decline=20the=20candidate=20lists=20?= =?UTF-8?q?in=20repo=5Fpick.py=20and=20split.py,=20which=20name=20the=20la?= =?UTF-8?q?bels=20now=20in=20use?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 12 +++++------ bin/todo_item/doubles.py | 2 +- docs/decisions.md | 46 ++++++++++++++++++++-------------------- todo.md | 2 +- 4 files changed, 31 insertions(+), 31 deletions(-) diff --git a/README.md b/README.md index 9b2366d6..13379450 100644 --- a/README.md +++ b/README.md @@ -229,14 +229,14 @@ It applies only those commits on the newest tag, tests them with `ci.sh`, tags a build-release, build-epic and `task-bench gather` put the release's tools first on the `PATH` of every claude they start, so this README and the rules name each tool bare, as in `metric-bench`. Install puts only `build-release` on your shell's `PATH`: there, and in a claude you start from it yourself, call another by its path, `~/.claude/bin/`, from the project's checkout. The tools under `~/.claude` are the release's; test a change to one from `~/code/claude-config/bin`. The tools are listed in alphabetical order, and the packages under `bin/` follow under their own heading. +- `build-epic ` runs the chunks of one Jira epic whose items span repos, or have none, each in its own window of the tmux session `epic-`, on the same cycle, judge and interrupt as build-release. The epic's description is its record: goals, audience, scoring and decisions. Before it starts chunks, build-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, where two or more issues may start, it scores each of them that holds no scores, and moves the issues that build-epic itself filed into order of score on the board. An open issue runs once a label names its repo or marks it as Claude's, in order of score, 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. `build-epic --dry-run` prints what `build-epic ` would write to Jira and which chunks it would start, and does neither; run it before the first real run on a team's epic. `--help` lists what it prints and leaves out. build-epic closes the epic only once you confirm every goal. Install → "Set up a project" says how to set it up; `build-epic --help` states the flags and the contract. +- `build-epic-e2e` runs `build-epic` against a sandbox epic on a real Jira site, as Test says. - `build-release ` runs a project's next chunks, each in its own tmux window, cycle after cycle; `build-release --help` states its contract. - `chunk-pr open|sync|ready|push|merge|clean|open-epic` opens a chunk's pull request as a draft, brings its branch level with origin's default branch, marks it ready and merges it once its checks pass, with `gh` on a GitHub origin and `tea` elsewhere. Where the project's config sets `epic-branch`, the pull request goes into the epic's working branch instead, `push` pushes later commits and asks the auto-reviewer for a review, and `open-epic` opens the pull request from that branch into the default branch. The chunks of one project merge one at a time: in its turn, `merge` brings the branch level again, finishes the plan items its `--finish` flags name, and waits for the checks. Under `merge = "human"` it then marks the pull request ready and leaves the merge to a person. Once the pull request is merged, `clean` removes the chunk's worktree and branch and fast-forwards the main checkout. `chunk-pr --help` states the steps. - `chunk-preflight` finds the mechanical facts a chunk starts from, and with `--worktree` makes its worktree; `build-release` runs it with `--worktree` before it routes each chunk, and `chunk-preflight --help` lists the facts. - `command-patterns [] [--calls ]` prints a table of the shell command patterns a release's archived chunks ran, such as `tea pr create`, for an audit of the release, and with `--calls ` saves each call as a JSON line; `command-patterns --help` states the columns and the line's keys. - `compress-archives` gzips each transcript in build-release'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 | --cut-patch ] []` 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, and with `--cut-patch`, a patch release of only the commits named, as Release says. -- `build-epic ` runs the chunks of one Jira epic whose items span repos, or have none, each in its own window of the tmux session `epic-`, on the same cycle, judge and interrupt as build-release. The epic's description is its record: goals, audience, scoring and decisions. Before it starts chunks, build-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, where two or more issues may start, it scores each of them that holds no scores, and moves the issues that build-epic itself filed into order of score on the board. An open issue runs once a label names its repo or marks it as Claude's, in order of score, 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. `build-epic --dry-run` prints what `build-epic ` would write to Jira and which chunks it would start, and does neither; run it before the first real run on a team's epic. `--help` lists what it prints and leaves out. build-epic closes the epic only once you confirm every goal. Install → "Set up a project" says how to set it up; `build-epic --help` states the flags and the contract. -- `build-epic-e2e` runs `build-epic` against a sandbox epic on a real Jira site, as Test says. - `judge-replay [--offline]` replays build-release's judge on archived verdicts of the projects run on the model. It prints what each rung a review climbs to misses, and the lowest rung below those that returns every verdict, as each candidate above it does. With `--offline` it doesn't call a judge: it counts what a "?" rule, a decision table and a classifier trained on the archive decide of each verdict's kind from the worker's final message, and how many interrupts each misses. `judge-replay --help` states both replays. - `larv-review ` holds larv-review's mechanical rules: the chunk's review folder, the paired ruling's base and vote count, each pass's round count and the opening of its round commit's title, the scoring run's trigger and setup; the comprehension history's format, its latest places and its count of how often seats agree; and each reviewer's prompt header. `larv-review --help` states them. `settings.json` → `hooks` runs `larv-review reviewer-context` as each subagent starts. A reviewer under `agents/` whose frontmatter has `omitClaudeMd: true` starts without `CLAUDE.md`, and the command hands it that file's "Shared goal", "Prose" and "Vocabulary" sections. - `markdown-section ` prints the section of a markdown file under the first heading that holds the fragment, to the next heading of its level or a higher one, instead of a `grep -n` and a guessed `sed -n` range; `markdown-section --help` says what it does where several headings match. @@ -267,8 +267,6 @@ build-release, build-epic and `task-bench gather` put the release's tools first #### Driving chunks - `agent_cycle/` runs one cycle (`run.py`): a headless claude worker, then the judge of its transcript. It also holds the interrupt, the tmux window and the routing of the worker's rung. The entry point that runs the cycles supplies the prompts and file names of its own workflow (`worker_prompts.py`), and reads which items a worker took in. `build_release` and `build_epic` drive it; `agent_cycle` doesn't import either. -- `build_release` runs `chunk-preflight` as a process of its own. -- `chunk_driver/` holds what the entry points share. An entry point is a tool that drives chunks through `agent_cycle`: `build_release` and `build_epic` are the two. They share how a cycle starts (`cycle_start.py`) and closes (`chunk_run.py`), the claim on a checkout before a chunk starts in it (`claims.py`), the prompts every worker gets (`prompts.py`), and a checkout's premises, records and saved models (`project/`). It imports neither entry point, and `repo_checks` fails any package that imports one of the two. `agent_cycle` is the layer below it, and `repo_checks` fails `agent_cycle` where it imports `chunk_driver`, tests included. - `build_epic/` holds `build-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`. `epic_run.py` holds what stays the same through one run of build-epic, such as its config, its Jira store and its paths, and starts the chunks that may start now. - `planning.py` settles, before the chunks start, where each open issue is worked, its scores and the order the issues start in, through `split.py`, `repo_pick.py`, `issue_scores.py` and `ranking.py`. @@ -284,9 +282,11 @@ build-release, build-epic and `task-bench gather` put the release's tools first - `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 `build-epic-e2e`. +- `build_release` runs `chunk-preflight` as a process of its own. +- `chunk_driver/` holds what the entry points share. An entry point is a tool that drives chunks through `agent_cycle`: `build_epic` and `build_release` are the two. They share how a cycle starts (`cycle_start.py`) and closes (`chunk_run.py`), the claim on a checkout before a chunk starts in it (`claims.py`), the prompts every worker gets (`prompts.py`), and a checkout's premises, records and saved models (`project/`). It imports neither entry point, and `repo_checks` fails any package that imports one of the two. `agent_cycle` is the layer below it, and `repo_checks` fails `agent_cycle` where it imports `chunk_driver`, tests included. - `loop_effects/` holds `Effects`: the processes, terminal, clock and git a tool reaches, injected so its tests can script them. build-release, build-epic, both replay tools and `reviewer-merge-trials`' driver use it. - `loop_state/` holds `paths.py`, the one module under `bin/` that resolves the setup's folders: the release root, which is the folder the running code ships in, the Claude home, the config folder and the state folder. `repo_checks` fails another module under `bin/`, tests aside, that names one as a quoted path part, such as `".claude"`, or finds the release root from `__file__`. -- `model_routing/` holds the shipped routing ladder (`routing-ladder.json`) and its steps (`ladder.py`), and reads a ladder from that file or a project's own (`ladder_file.py`), for build-release, `rule_hook`, `build_epic`, both replay tools and `subagent-rung`. It finds a project's config folder through `project_config`. It also holds the list prices, which `routing_figures` and `transcript_archive` read. +- `model_routing/` holds the shipped routing ladder (`routing-ladder.json`) and its steps (`ladder.py`), and reads a ladder from that file or a project's own (`ladder_file.py`), for build-release, `build_epic`, `rule_hook`, both replay tools and `subagent-rung`. It finds a project's config folder through `project_config`. It also holds the list prices, which `routing_figures` and `transcript_archive` read. - `notifier/` sends the human a DM through the notifier a project's config names, for `notify` and for build-release through `loop_effects`. Its backends are `mattermost.py` and `slack.py`. - `transcript_archive/` stores build-release's transcripts. Its `project_key.py` names each project's archive folder, build-release session and models-file entry. @@ -303,7 +303,7 @@ build-release, build-epic and `task-bench gather` put the release's tools first - `adf_codec/` converts markdown to ADF, the rich text of Jira Cloud and Confluence, and back, in a throwaway container running a pinned `@larvit/adf-codec`. It builds the container's image inside a heavy slot. - `atlassian/` holds what the Jira and Confluence backends share (`client.py`): one Atlassian account's credentials, the request both backends send, and each service's error messages. `jira.py` holds what every reader of Jira shares: a search read page by page, the key, fields, links and property of each issue it finds, checked for their shape, and the transition that finishes an issue, for `plan_store` and `build_epic`. -- `forge/` tells a GitHub origin from a Gitea one, names a repo beside an origin's and runs that forge's CLI (`commands.py`), finds a pull request, lists the ready ones and reads its checks, once or until they settle (`pulls.py`), and reads a pull request's review state (`reviews.py`), for `chunk_preflight`, `chunk_pr`, `deploy_release`, `build_epic` and `larv_review`. +- `forge/` tells a GitHub origin from a Gitea one, names a repo beside an origin's and runs that forge's CLI (`commands.py`), finds a pull request, lists the ready ones and reads its checks, once or until they settle (`pulls.py`), and reads a pull request's review state (`reviews.py`), for `build_epic`, `chunk_preflight`, `chunk_pr`, `deploy_release` and `larv_review`. - `git_cli/` runs git for every tool (`git_repo.py`), reads the git calls in a shell command (`git_command.py`), and keeps an epic's working branch level with the default branch (`epic_branch.py`). - `rest_client/` sends a JSON request to a REST API and reads its credentials from an env file, for `notifier`, `atlassian` and `record_store`. diff --git a/bin/todo_item/doubles.py b/bin/todo_item/doubles.py index c5e5ab9f..bc6a03bf 100644 --- a/bin/todo_item/doubles.py +++ b/bin/todo_item/doubles.py @@ -3,7 +3,7 @@ # The bullets six items held on 2026-11-18, which touch-predictions cannot read: `(small)` after a bare path, and a part not in backticks. UNREADABLE_BULLETS = ( "- `bin/judge_replay/main.py` (small)", - "- `bin/build_epic/main.py` (small)", + "- `bin/do_epic/main.py` (small)", "- `principles/technical-principles.md`: the tests bullet group, `A valuable test checks behaviour` (small)", "- `README.md`: build-release's section (small)", "- `bin/rule_hook/rules.py`: the rule table (small)", diff --git a/docs/decisions.md b/docs/decisions.md index 3fab80b6..2f311e61 100644 --- a/docs/decisions.md +++ b/docs/decisions.md @@ -17,15 +17,15 @@ Each project principle states one rule that the decisions below apply; their ent - bin/: the tools run on the host's Python, with no container, and so do their tests outside CI - bin/: the tools send no OTLP traces, logs or metrics, and build-release's archive holds the trace of each cycle - bin/: the tools support only the latest stable Python, and the tests, written in plain unittest, run on it in four pytest-xdist workers +- build-epic: drives one Jira epic whose items span repos, or have none, ranked by the epic's goals, then code health, then each repo's goals, and closes the epic only once the human confirms every goal - build-release: each verdict records the claude-config release and commit that ran it, the raw tokens each thread spent by model and kind since the previous outcome that recorded a spend, and the human's typed answer the judge quotes as reversing a choice the worker took on its own recommendation - build-release: each chunk runs in its own tmux window, of one tmux session per project, up to `parallel-chunks` at once, and needs tmux 3.2; its claude session is named after its window, its id derived from that name; a chunk's commit in the config's folder takes only the file it changed - chunk-pr: the chunks of a project merge one at a time on a machine, each finishing its plan items in its turn, and a pull request that waits for an approval leaves the queue while it waits - Claude Code in a home of its own: a `CLAUDE_CONFIG_DIR` home loads `CLAUDE.md`, rules, agents, skills, hooks and plugins, and `CLAUDE_CODE_OAUTH_TOKEN` signs in there, but never under `--bare` - deploy: this repo keeps no `AGENTS.md`, since `~/.claude` is its checkout; its principles and decision titles head `docs/decisions.md`, its working rules follow them there, and its `.claude/settings.json` excludes every `.claude/CLAUDE.md`, so a session in the clone loads only the clone's `CLAUDE.md` -- build-epic: drives one Jira epic whose items span repos, or have none, ranked by the epic's goals, then code health, then each repo's goals, and closes the epic only once the human confirms every goal - epic-branch: an epic's chunks branch off and merge into a working branch its project's config names, without a person, and a person merges that branch into the default branch in one pull request - machine load: a heavy command waits for one of the machine's heavy slots, one for every 4 CPUs, which every session shares, and build-release starts a worker only while at least a quarter of the machine's memory is available -- names: the plan calls the project and its repo `dev-factory`, and loop-claude and do-epic are renamed `build-release` and `build-epic` with no alias, and the code keeps today's other names until their planned items ship +- names: the project and its repo are `dev-factory`, its commands `build-release` and `build-epic` keep no old name as an alias, and the code keeps its other names until their planned items ship - principles: about seven things per level, four or five where they act on each other, more where a reader finds them by name; crossing a limit asks for a grouping or a recorded reason - project config: a record may name a Confluence Cloud page as `confluence:` and its address, the loop reads and writes it as markdown, and a write never overwrites a save made since the loop's read - project config: a tool that reads a file's commits says where it does not support that file, and the work goes on @@ -160,25 +160,6 @@ Valid while `~/.claude` is a checkout of this repo. 2026-11-27, lilleman, the release review of 0.16.0. A release review on `main` counts only for the release its title names, which must be exactly the next release, as `chunk-preflight --help` states. So the patch's own review, which the merge leaves on `main` after the tag, doesn't review any later release, and neither does a review opened under a release name todo.md has since changed. Where todo.md names no next release, a review of any release after the last cut counts. -## build-epic: drives one Jira epic whose items span repos, or have none, ranked by the epic's goals, then code health, then each repo's goals, and closes the epic only once the human confirms every goal - -2026-11-18, lilleman's answers to claude's questions while planning release 0.12.0. Serves goal 1, so development scales past one repo, and goal 1.6, since the epic stays in the client's Jira. Valid while Jira is the only backend; another backend goes behind the same interface. - -- **What it is.** `build-epic ` is a sibling of build-release, built on the same cycle, judge, interrupt, tmux and routing packages, not a copy (goal 1.3). It runs one tmux session per epic. -- **Machine settings.** `~/.config/build-release/build-epic/` holds `config.toml` (the Jira site, env-file, the folder repos are cloned into, the default language, and the model for a no-repo item) and `repo-rule.md`. `repo-rule.md` is a prose instruction that says how to tell an item's repo. It is the same for every epic on the machine. On the first machine, an item's label that equals a repo's name names that repo. A `[label-repos]` table in `config.toml` maps a team's own label to a repo, so build-epic reads that label as a pick without a claude call. -- **The epic's description is its record.** It holds `## Goals`, `## Audience`, `## Scoring` (formula and bar), `## Decisions` and a language line. build-epic writes all of it, but it changes Goals or Audience only after the human approves in an interrupt. -- **Items live only in the epic.** A repo's own plan never mirrors them. Where `repo-rule.md` leaves an item's repo unclear, build-epic asks. An item without a repo is either Claude's work, done without a PR, or a human task; where the item doesn't say which, build-epic asks. -- **One item, several repos.** build-epic splits such an item when it plans it, into one Jira sub-task per repo, each labelled for its repo. The parent tracks the whole change. A person's issue is split too, with a comment for the team. An item a person filed a sub-task under counts as split already: build-epic works it through the team's own sub-tasks and doesn't file any of its own. It plans no such sub-task, so one without a label waits for the team's. It moves such an item itself (lilleman's call of 2026-11-20), since every issue the item blocks waits until the item moves, and the team's automation sees a pull request only on the sub-task that carries it. Once every sub-task is done, the item moves to done. Once every sub-task has landed, each done or in one of `jira-unblocking-statuses`, the item moves by the transition `jira-sub-tasks-landed-transition` names, which must lead to one of those statuses. A move that is not made is said, and the run goes on. -- **Ranking.** Score, then Blocked by, in one weight chain: the epic's achieve goals, then code health, then the repo's goals. Where the epic and a repo disagree, the epic wins. build-epic re-ranks the issues it filed in Jira's backlog to match. A person's issue keeps its rank there: goal 1.6 has the loop plug in without changing what the owners keep. On 2026-11-20 the human chose that the order the issues start in is build-epic's, while the board's order stays the team's: build-epic starts the open issues by score. Where two or more may start, it scores each of them that holds no scores, a person's included but not a human's task, and tells the team the scores in a comment. It never overwrites scores an issue holds. An issue that cannot be scored starts after those that can, in the backlog's order; where no order of score can be made at all, such as without the epic's formula, every issue starts in the backlog's order and build-epic says why. -- **Releases.** An epic item has no release. It ships into its repo's unreleased work: where the repo publishes something others consume, a bullet under `CHANGELOG.md` → `## Unreleased`, or nothing where the repo's plan is in Jira. The issue is no item of the repo's plan, so the chunk's worker writes the bullet in its branch and runs `chunk-pr merge` without `--finish`. -- **Repos.** A repo's name is its main checkout's folder name, and a project config names that checkout. A missing checkout is cloned from the host of the epic's other repos; where unsure, build-epic asks. Unsure means the other repos don't all sit under one host and owner (the same host spelt as https and as ssh counts as two), an origin can't be read or isn't an https, ssh or scp-style address, the folder to clone into holds something else, or the clone fails. A repo no config names is cloned into the clone folder, and the human is asked to write its config. Each chunk uses its repo's model, routing, and language for commits and PRs. Jira text is in the epic's language, or else the machine's default. -- **Running.** The epic caps the chunks running at once, and each repo's `parallel-chunks` still applies. build-epic and build-release never run chunks in the same repo at once. The cap is a line of the epic's description, `**Max parallel chunks:** 2`, and 1 without it, as `parallel-chunks` is. A repo's `parallel-chunks` counts the chunks of every epic in its checkout. Each window is named for its issue's key, and a tmux window option, `@chunk-root`, names the folder its chunk works in, which is how build-release sees build-epic's chunks in a checkout. build-epic and build-release each hold the checkout's `starting` lock from checking the checkout's chunks to starting a window there. A chunk without a repo works in `~/.local/state/build-release/build-epic//`. build-epic archives its cycles under `~/.local/state/build-release/build-epic-transcripts/`, not in build-release's archive, whose readers parse build-release's prompts. An open issue runs once a label records its repo; until build-epic picks repos itself, an issue without one waits, and `build-epic ` says so. -- **Long gates.** A chunk whose PR waits on a gate, such as a human approval, parks. It keeps its worktree, PR and session, and its state is in a file that survives a reboot. A parked chunk takes no running slot, and the items it blocks wait. build-epic polls the forge and resumes the chunk's session when the gate passes or a reviewer comments. It fixes reasonable feedback, replies to the rest, and changes the setup so review would have caught it. `build-epic --status` and the tmux window names show what each chunk waits on. A gate is a pull request's pending checks or, on GitHub, the approval its branch protection requires; a draft waits on neither, since its worker has yet to mark it ready. On Gitea a draft is a pull request whose title opens with `WIP:` or `[WIP]`, Gitea's default `WORK_IN_PROGRESS_PREFIXES`. Changes a reviewer requested resume the chunk only while that review was made on the pull request's head commit and the pull request's author has not commented or replied after it; once the worker pushed or replied, the chunk parks on a new review, since GitHub keeps the decision until the reviewer reviews again. The chunk's window reads the forge once a minute, which no forge's rate limit notices. A chunk resumes only into a free slot, under the limits a starting chunk meets, and stays parked until then. `build-epic ` starts a parked chunk's window again whatever the limits, since the chunk stays parked. build-epic sets `CHUNK_PR_PARKS=1` for each worker, so `chunk-pr merge` fails at once where the pull request awaits an approval, and the worker's run doesn't hold a slot while the pull request waits. In a repo whose config sets `merge = "human"`, the merge itself is a gate: `chunk-pr merge` leaves the pull request ready, the chunk parks on `your merge` once nothing else holds the pull request, and it gets its gate read again when the forge no longer reports the pull request open, so that its worktree is removed and the chunk finishes. It resumes too once the pull request conflicts with its base branch, or is behind it where GitHub's branch protection requires an up-to-date branch, so the person finds a pull request they can merge. The worker then runs `chunk-pr merge` again, which levels the branch, waits for the checks and leaves the pull request ready. A chunk whose cycle ends on such a pull request is not handed on: its worker is told after each cycle until the pull request merges into its base. While GitHub still computes whether the pull request merges, the chunk stays parked until the next read. Gitea also reports a pull request as not mergeable for the seconds it checks for conflicts. A read in those seconds resumes the chunk for a run that doesn't change anything, which costs less than reading every gate twice to tell the two apart. The judge may rule such a chunk finished while its pull request is open, since its worker ends each run there. So build-epic reads a gate it could not read again before it hands the chunk on, and does the removal itself where it can. For a chunk whose pull request is no longer open, build-epic runs `chunk-pr clean` in the chunk's worktree. That command acts only on a pull request the forge reports merged at the worktree's head, and refuses a worktree with uncommitted or untracked files. Where it removed the worktree, the chunk finishes without a worker and, where it was parked, without a running slot, even if the command then failed on the main checkout, whose reason build-epic says. Where it left the worktree, as for a pull request closed unmerged, build-epic tells the worker once to remove it, and a parked chunk waits for a slot as for any other news. -- **Human tasks.** build-epic leaves a human task's issue as the team filed it. The task gets a window of its own while it is open, no issue blocks it, and it blocks another open issue. The window DMs the human once, through the notifier of the first repo whose project config names one (the repos of the issues it holds up come first, then those of the epic's other issues; where none does, the window says so), shows as parked (`awaits a human's task`) so that it doesn't take a running slot, and polls the epic every minute until the task no longer holds up an open issue. Then the issues it held up may start. A window that starts again, as after a reboot, DMs again. -- **Findings.** A finding about the epic's goals is filed in the epic. A finding about a repo's goals follows that repo's rules. Where unsure which, build-epic asks. A set of new items toward an epic goal needs the human's approval before work starts; a finding filed during a chunk doesn't. -- **Finishing.** When the epic holds no open item: release-review passes on each repo the epic changed, then the items they file, then the human confirms each achieve goal and that no maintain goal has a defect. For a goal that isn't met, build-epic proposes items for approval. Then a summary comment on the epic, and closing the epic in Jira, as the very last step. -- **Tests.** Black-box tests run against a fake Jira backend. An opt-in e2e test runs as its own command against a sandbox epic on a real Jira site. - ## epic-branch: an epic's chunks branch off and merge into a working branch its project's config names, without a person, and a person merges that branch into the default branch in one pull request 2026-11-20, lilleman's call. Serves goals 1 and 1.6: a team may rule that only a person merges into its default branch. Such a team was asked to merge once per chunk, and reviewed an epic as many small pull requests. With `epic-branch` set, the loop asks once per epic, and the team keeps its rule. Valid while that rule covers only a team's default and protected branches. @@ -201,6 +182,25 @@ Valid while `~/.claude` is a checkout of this repo. 2026-11-08, claude, item 230: the floor item that larv-review files (`skills/larv-review/SKILL.md` → "Floor item") keeps the move by 9 and competes like any item, though its R, likely above 5, makes it ship alone. +## build-epic: drives one Jira epic whose items span repos, or have none, ranked by the epic's goals, then code health, then each repo's goals, and closes the epic only once the human confirms every goal + +2026-11-18, lilleman's answers to claude's questions while planning release 0.12.0. Serves goal 1, so development scales past one repo, and goal 1.6, since the epic stays in the client's Jira. Valid while Jira is the only backend; another backend goes behind the same interface. + +- **What it is.** `build-epic ` is a sibling of build-release, built on the same cycle, judge, interrupt, tmux and routing packages, not a copy (goal 1.3). It runs one tmux session per epic. +- **Machine settings.** `~/.config/build-release/build-epic/` holds `config.toml` (the Jira site, env-file, the folder repos are cloned into, the default language, and the model for a no-repo item) and `repo-rule.md`. `repo-rule.md` is a prose instruction that says how to tell an item's repo. It is the same for every epic on the machine. On the first machine, an item's label that equals a repo's name names that repo. A `[label-repos]` table in `config.toml` maps a team's own label to a repo, so build-epic reads that label as a pick without a claude call. +- **The epic's description is its record.** It holds `## Goals`, `## Audience`, `## Scoring` (formula and bar), `## Decisions` and a language line. build-epic writes all of it, but it changes Goals or Audience only after the human approves in an interrupt. +- **Items live only in the epic.** A repo's own plan never mirrors them. Where `repo-rule.md` leaves an item's repo unclear, build-epic asks. An item without a repo is either Claude's work, done without a PR, or a human task; where the item doesn't say which, build-epic asks. +- **One item, several repos.** build-epic splits such an item when it plans it, into one Jira sub-task per repo, each labelled for its repo. The parent tracks the whole change. A person's issue is split too, with a comment for the team. An item a person filed a sub-task under counts as split already: build-epic works it through the team's own sub-tasks and doesn't file any of its own. It plans no such sub-task, so one without a label waits for the team's. It moves such an item itself (lilleman's call of 2026-11-20), since every issue the item blocks waits until the item moves, and the team's automation sees a pull request only on the sub-task that carries it. Once every sub-task is done, the item moves to done. Once every sub-task has landed, each done or in one of `jira-unblocking-statuses`, the item moves by the transition `jira-sub-tasks-landed-transition` names, which must lead to one of those statuses. A move that is not made is said, and the run goes on. +- **Ranking.** Score, then Blocked by, in one weight chain: the epic's achieve goals, then code health, then the repo's goals. Where the epic and a repo disagree, the epic wins. build-epic re-ranks the issues it filed in Jira's backlog to match. A person's issue keeps its rank there: goal 1.6 has the loop plug in without changing what the owners keep. On 2026-11-20 the human chose that the order the issues start in is build-epic's, while the board's order stays the team's: build-epic starts the open issues by score. Where two or more may start, it scores each of them that holds no scores, a person's included but not a human's task, and tells the team the scores in a comment. It never overwrites scores an issue holds. An issue that cannot be scored starts after those that can, in the backlog's order; where no order of score can be made at all, such as without the epic's formula, every issue starts in the backlog's order and build-epic says why. +- **Releases.** An epic item has no release. It ships into its repo's unreleased work: where the repo publishes something others consume, a bullet under `CHANGELOG.md` → `## Unreleased`, or nothing where the repo's plan is in Jira. The issue is no item of the repo's plan, so the chunk's worker writes the bullet in its branch and runs `chunk-pr merge` without `--finish`. +- **Repos.** A repo's name is its main checkout's folder name, and a project config names that checkout. A missing checkout is cloned from the host of the epic's other repos; where unsure, build-epic asks. Unsure means the other repos don't all sit under one host and owner (the same host spelt as https and as ssh counts as two), an origin can't be read or isn't an https, ssh or scp-style address, the folder to clone into holds something else, or the clone fails. A repo no config names is cloned into the clone folder, and the human is asked to write its config. Each chunk uses its repo's model, routing, and language for commits and PRs. Jira text is in the epic's language, or else the machine's default. +- **Running.** The epic caps the chunks running at once, and each repo's `parallel-chunks` still applies. build-epic and build-release never run chunks in the same repo at once. The cap is a line of the epic's description, `**Max parallel chunks:** 2`, and 1 without it, as `parallel-chunks` is. A repo's `parallel-chunks` counts the chunks of every epic in its checkout. Each window is named for its issue's key, and a tmux window option, `@chunk-root`, names the folder its chunk works in, which is how build-release sees build-epic's chunks in a checkout. build-epic and build-release each hold the checkout's `starting` lock from checking the checkout's chunks to starting a window there. A chunk without a repo works in `~/.local/state/build-release/build-epic//`. build-epic archives its cycles under `~/.local/state/build-release/build-epic-transcripts/`, not in build-release's archive, whose readers parse build-release's prompts. An open issue runs once a label records its repo; until build-epic picks repos itself, an issue without one waits, and `build-epic ` says so. +- **Long gates.** A chunk whose PR waits on a gate, such as a human approval, parks. It keeps its worktree, PR and session, and its state is in a file that survives a reboot. A parked chunk takes no running slot, and the items it blocks wait. build-epic polls the forge and resumes the chunk's session when the gate passes or a reviewer comments. It fixes reasonable feedback, replies to the rest, and changes the setup so review would have caught it. `build-epic --status` and the tmux window names show what each chunk waits on. A gate is a pull request's pending checks or, on GitHub, the approval its branch protection requires; a draft waits on neither, since its worker has yet to mark it ready. On Gitea a draft is a pull request whose title opens with `WIP:` or `[WIP]`, Gitea's default `WORK_IN_PROGRESS_PREFIXES`. Changes a reviewer requested resume the chunk only while that review was made on the pull request's head commit and the pull request's author has not commented or replied after it; once the worker pushed or replied, the chunk parks on a new review, since GitHub keeps the decision until the reviewer reviews again. The chunk's window reads the forge once a minute, which no forge's rate limit notices. A chunk resumes only into a free slot, under the limits a starting chunk meets, and stays parked until then. `build-epic ` starts a parked chunk's window again whatever the limits, since the chunk stays parked. build-epic sets `CHUNK_PR_PARKS=1` for each worker, so `chunk-pr merge` fails at once where the pull request awaits an approval, and the worker's run doesn't hold a slot while the pull request waits. In a repo whose config sets `merge = "human"`, the merge itself is a gate: `chunk-pr merge` leaves the pull request ready, the chunk parks on `your merge` once nothing else holds the pull request, and it gets its gate read again when the forge no longer reports the pull request open, so that its worktree is removed and the chunk finishes. It resumes too once the pull request conflicts with its base branch, or is behind it where GitHub's branch protection requires an up-to-date branch, so the person finds a pull request they can merge. The worker then runs `chunk-pr merge` again, which levels the branch, waits for the checks and leaves the pull request ready. A chunk whose cycle ends on such a pull request is not handed on: its worker is told after each cycle until the pull request merges into its base. While GitHub still computes whether the pull request merges, the chunk stays parked until the next read. Gitea also reports a pull request as not mergeable for the seconds it checks for conflicts. A read in those seconds resumes the chunk for a run that doesn't change anything, which costs less than reading every gate twice to tell the two apart. The judge may rule such a chunk finished while its pull request is open, since its worker ends each run there. So build-epic reads a gate it could not read again before it hands the chunk on, and does the removal itself where it can. For a chunk whose pull request is no longer open, build-epic runs `chunk-pr clean` in the chunk's worktree. That command acts only on a pull request the forge reports merged at the worktree's head, and refuses a worktree with uncommitted or untracked files. Where it removed the worktree, the chunk finishes without a worker and, where it was parked, without a running slot, even if the command then failed on the main checkout, whose reason build-epic says. Where it left the worktree, as for a pull request closed unmerged, build-epic tells the worker once to remove it, and a parked chunk waits for a slot as for any other news. +- **Human tasks.** build-epic leaves a human task's issue as the team filed it. The task gets a window of its own while it is open, no issue blocks it, and it blocks another open issue. The window DMs the human once, through the notifier of the first repo whose project config names one (the repos of the issues it holds up come first, then those of the epic's other issues; where none does, the window says so), shows as parked (`awaits a human's task`) so that it doesn't take a running slot, and polls the epic every minute until the task no longer holds up an open issue. Then the issues it held up may start. A window that starts again, as after a reboot, DMs again. +- **Findings.** A finding about the epic's goals is filed in the epic. A finding about a repo's goals follows that repo's rules. Where unsure which, build-epic asks. A set of new items toward an epic goal needs the human's approval before work starts; a finding filed during a chunk doesn't. +- **Finishing.** When the epic holds no open item: release-review passes on each repo the epic changed, then the items they file, then the human confirms each achieve goal and that no maintain goal has a defect. For a goal that isn't met, build-epic proposes items for approval. Then a summary comment on the epic, and closing the epic in Jira, as the very last step. +- **Tests.** Black-box tests run against a fake Jira backend. An opt-in e2e test runs as its own command against a sandbox epic on a real Jira site. + ## build-release: a `claude` that cannot start is a failed worker run, retried 2026-09-28, larv-review, declining a product-owner nit to exit at once when `claude` is missing. Serves goal 1. Claude Code's updater repoints `~/.local/bin/claude` at each new version under running loops, and a start that meets it mid-update fails with the same error as a broken install; the retry costs two minutes on the second and saves an unattended loop on the first. Valid while Claude Code updates by repointing its link. @@ -334,9 +334,9 @@ The heavy command in that hang started its container from the project's own scri A daemon-wide cap would see every container: dockerd's `cgroup-parent`, given a memory limit. lilleman turned it down, since it is host config and would cap a project's heavy work too. Valid while sessions start their work in containers on a machine they share. -## names: the plan calls the project and its repo `dev-factory`, and loop-claude and do-epic are renamed `build-release` and `build-epic` with no alias, and the code keeps today's other names until their planned items ship +## names: the project and its repo are `dev-factory`, its commands `build-release` and `build-epic` keep no old name as an alias, and the code keeps its other names until their planned items ship -2026-11-28, lilleman, part of the standalone-install plan approved on 2026-11-20. Serves goal 2: a person who clones a release meets commands named for what they make. The names set the install folders, such as `~/.config/build-release/`. lilleman chose `build-release` over the proposed `do-release` because "do" reads as if the command cuts the release, which stays the human's. "Build" says it makes what the release holds, and `build-epic` follows it for an epic. Neither name has "claude" in it, which fits goal 6, a setup that doesn't depend on Claude Code. `loop-claude` has been renamed `build-release` and `do-epic` `build-epic`; the code keeps today's other names until item 576 ships, in 0.18.0. On 2026-12-03 lilleman chose a hard break for those three renames: no old name stays as an alias, and the issue labels, the transcripts folder and the `BUILD_EPIC_E2E_*` variables take the new name too. Renaming the repo on the forge is the human's. Valid while the install folders are named for `build-release`. +2026-11-28, lilleman, part of the standalone-install plan approved on 2026-11-20. Serves goal 2: a person who clones a release meets commands named for what they make. The names set the install folders, such as `~/.config/build-release/`. lilleman chose `build-release` over the proposed `do-release` because "do" reads as if the command cuts the release, which stays the human's. "Build" says it makes what the release holds, and `build-epic` follows it for an epic. Neither name has "claude" in it, which fits goal 6, a setup that doesn't depend on Claude Code. `loop-claude` has been renamed `build-release` and `do-epic` `build-epic`; the code keeps its other names until item 576 ships, in 0.18.0. On 2026-12-03 lilleman chose a hard break for the renames to `build-release`, `build-epic` and `dev-factory`: no old name stays as an alias. Item 575 applied that to `build-epic`'s own names too, so a name from the old tool doesn't linger in a client's Jira: its issue labels, its config, state and transcripts folders and its `BUILD_EPIC_E2E_*` variables take the new name. Renaming the repo on the forge is the human's. Valid while the install folders are named for `build-release`. ## principles: about seven things per level, four or five where they act on each other, more where a reader finds them by name; crossing a limit asks for a grouping or a recorded reason diff --git a/todo.md b/todo.md index 745b7029..c33cfbb5 100644 --- a/todo.md +++ b/todo.md @@ -418,7 +418,7 @@ Name the entry and the Dockerfile line. Source the secret-name list from a widel ### 462. 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. -Found while shipping item 461: `mutate-changes` printed `23 mutants on changed lines, 18 not killed. Left out the tests that fail without a mutant, in build_epic/test_main.py, larv_review/test_larv_review.py, larv_review/test_scoring_setup.py, plan/test_ranking.py, repo_checks/…, review_rules/test_review_passes.py, review_rules/test_reviewer_context.py, rule_hook/test_rule_hook.py, test_settings_filter.py`. All 18 survivors were in `bin/larv_review/scoring_setup.py`: `prepare_scoring`, whose tests are among those left out, so the chunk checked four of them by hand and left 14 unchecked. Find why each left-out test fails in mutmut's copy, such as a path to `skills/` or a git checkout it expects, and make it pass there, or report under the count which changed lines no remaining test covers. +Found while shipping item 461: `mutate-changes` printed `23 mutants on changed lines, 18 not killed. Left out the tests that fail without a mutant, in do_epic/test_main.py, larv_review/test_larv_review.py, larv_review/test_scoring_setup.py, plan/test_ranking.py, repo_checks/…, review_rules/test_review_passes.py, review_rules/test_reviewer_context.py, rule_hook/test_rule_hook.py, test_settings_filter.py`. All 18 survivors were in `bin/larv_review/scoring_setup.py`: `prepare_scoring`, whose tests are among those left out, so the chunk checked four of them by hand and left 14 unchecked. Find why each left-out test fails in mutmut's copy, such as a path to `skills/` or a git checkout it expects, and make it pass there, or report under the count which changed lines no remaining test covers. Item 536 met the same gap: `deploy_release/test_deploy_release.py` runs `deploy-release` as a subprocess, and those tests fail in mutmut's copy, so only its in-process tests ran, and 530 of 590 mutants of `bin/deploy_release/` went unchecked.