Let a project's config name a working branch per epic that chunks branch off and merge into
CI / tests (pull_request) Successful in 5m4s

This commit is contained in:
Lilleman
2026-11-20 19:32:59 +01:00
parent 9531e5c337
commit 72a4d346d7
33 changed files with 991 additions and 56 deletions
+15
View File
@@ -20,6 +20,7 @@ Each project principle states one rule that the decisions below apply; their ent
- 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
- 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`
- do-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
- loop-claude: 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
- loop-claude: 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
- machine load: a heavy command waits for one of the machine's heavy slots, one for every 4 CPUs, which every session shares, and loop-claude starts a worker only while at least a quarter of the machine's memory is available
@@ -231,6 +232,20 @@ Valid while claude takes `--session-id` and resumes by it, and the human runs lo
`claude_reply` reads stream-json for every caller, so the judge's runs are streams too; the archive's `JudgeRun` stays as it was, since a judge has no tools and one turn. Valid while transcripts stay small enough to copy whole.
## 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 in item 472. Serves goals 1 and 1.6: a team that keeps each merge into its default branch with a person was asked 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 a team's no-merge rule covers its default and protected branches only.
- **The setting.** `epic-branch` in a project's config is a template with `{epic}` for the epic's key, such as `"{epic}"`. Left out, everything works as before. Under chunk-preflight the key is that of the Jira epic `plan` names, so a plan kept in a file has no epic branch. Under do-epic it is the key of the epic do-epic drives.
- **A chunk's base is recorded in git.** `git config branch.<chunk's branch>.chunk-base <epic's branch>`, in the checkout's shared config (`git_repo.CHUNK_BASE`). `git_repo.default_ref` answers `origin/<epic's branch>` on such a branch, so each tool that measures a chunk against its base reads the chunk's own commits. Deleting the branch removes the record. A file in the worktree would have been a second writer of the chunk's state.
- **The branch stays level by a merge commit, made without a checkout.** `epic_branch.levelled` makes the branch on origin off the default branch, or merges the default branch into it with `git merge-tree --write-tree` and `git commit-tree`, and pushes without force. That needs git 2.38. chunk-preflight runs it before it makes a chunk's worktree, do-epic as a chunk's window starts, and `chunk-pr open-epic` before it opens the epic's pull request. A conflict stops the chunk and asks a person to merge by hand: a resolution picks between two teams' changes, which is theirs to pick.
- **The chunk merges without a person.** `chunk-pr merge` into an epic's branch ignores `merge = "human"` and `wait-for-approval`, and do-epic parks no such chunk on a person's merge. lilleman's call: the team's rule against merging without a go-ahead covers the default branch and protected branches. The pull request from the epic's branch into the default branch is opened ready and never merged by the loop.
- **A review is asked for by a comment.** An auto-reviewer may review on its own only pull requests into the default branch. `review-request-comment` holds the comment that asks it, which `chunk-pr ready` and `chunk-pr push` post on a pull request into an epic's branch. The worker waits for the review as for any auto-reviewer.
- **do-epic moves the issue itself.** A team's automation fires only for pull requests into the default branch. `jira-pull-request-open-status` names the status of an issue whose chunk parks with its pull request open, and `jira-pull-request-merged-status` the one once it has merged. The first move is made as the chunk parks, since that is where do-epic learns of the pull request; one that opens and merges within a single run of the worker skips it. Each setting names a status, and do-epic takes whichever transition leads there.
- **An issue at the merged status counts as done for the epic's end.** The release reviews and the finishing chunk come before a person merges the epic's branch, and Jira counts the issues done only after. So `finish.landed` reads such an issue as done, wherever do-epic's config names the status. Without the setting, the finishing waits for Jira as before.
- **Sibling repos.** A chunk's worker tests each sibling repo at its branch of the same name where it has one, else at its default branch, and its summary names each sibling that ran at the default branch. A team's shared test harness needs an option to pick the branch; that is the team's change.
- **Spellings.** Three fresh readers, seated as those who write a project's config and run `chunk-pr`, picked each from three or four candidates: `epic-branch` 3-0, `review-request-comment` 3-0, `chunk-pr push` 3-0, `chunk-pr open-epic` 2-1 and `jira-pull-request-open-status` 2-1. `jira-pull-request-merged-status` is spelt to pair with the last.
## loop-claude: 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
2026-11-12, lilleman, todo item 305. Serves goals 1, 1.2 and 1.4. A change to the setup can be judged only by comparing chunks run before it with chunks run after, so each verdict, interrupt and quoted answer in loop-claude's archive records three things beside its judge lines.
+31
View File
@@ -3236,3 +3236,34 @@ Read most (opens and searches):
- `bin/do_epic/test_issue_scores.py` 1
- `bin/do_epic/test_repo_pick.py` 1
- `bin/model_routing/ladder.py` 1
## Reading cost, chunk 4fb66d10f849, finished 2026-11-20T17:43:35Z
54949 new input tokens before the first commit.
Read most (opens and searches):
- `workflow-bench/test_advisor_bench.py` 3
- `bin/repo_checks/test_no_patched_globals.py` 2
- `bin/repo_checks/test_trials_imports.py` 2
- `bin/repo_checks/__init__.py` 1
- `ci.sh` 1
- `reviewer-merge-trials/analyze.py` 1
- `workflow-bench/advisor_bench.py` 1
## Reading cost, chunk 79a2a453c4b8, finished 2026-11-20T18:02:46Z
248834 new input tokens before the first commit.
Read most (opens and searches):
- `bin/do_epic/test_main.py` 14
- `bin/do_epic/main.py` 6
- `bin/do_epic/backend/jira.py` 5
- `bin/do_epic/backend/test_jira.py` 5
- `bin/do_epic/test_do_epic.py` 4
- `README.md` 3
- `bin/do_epic/backend/contract.py` 3
- `bin/do_epic/config.py` 3
- `bin/atlassian/jira.py` 2
- `bin/do_epic/backend/fake.py` 2