Repository navigation
Description
Overview
The batch planner admits one task per library repo per plan, and the watcher keeps a task the shift already picked in every later tick's plan. So a shift's first PyAutoGalaxy task holds PyAutoGalaxy until review-at:, even after its glance close-out has merged it, and a brief naming five PyAutoGalaxy bugs runs only one. The rule exists because concurrent library PRs collide at merge; a task whose PR has already merged collides with nothing. This frees the library slot at merge, so named tasks on one library run one after another.
Plan
- Hold a library only while the earlier task on it could still collide at merge: running, PR open, or parked on a question.
- Release the library once that task is done and every PR it opened has merged, or it ended with no PR and no open question.
- The released task stays in the plan, so it is never re-dispatched and the digest still counts it.
- The next task on that library starts on a later tick, from a worktree cut from the merged
main. - Never two tasks on one library at once; judge PRs and PRs past
merge-cap:keep holding. - Tier + merge mode: effective level: supervised; merge mode: human /prm
Detailed implementation plan
Affected Repositories
- PyAutoBrain (primary)
Branch Survey
| Repository | Current Branch | Dirty? |
|---|---|---|
| ./organs/PyAutoBrain | main | clean |
Suggested branch: feature/shift-library-slot-frees-after-merge
Worktree: ~/Code/PyAutoLabs-wt/shift-library-slot-frees-after-merge/
Implementation Steps
agents/conductors/batch/_orchestrator.pyplan()(~line 1841): computereleased— this shift's own picks incounters["done"](orabandoned) whoseoutcomes[task]has everyprsURL inmerged, or no PRs and noquestions— and pass_batch.plan(..., released=released).agents/conductors/batch/_batch.pyplan()(~line 514): new keywordreleased: set[str] | None = None; a member whosetask_idis in it stays inmembersbut does notlibs.update(...). Callers that do not pass it behave exactly as today.- Rejection wording names the holder:
"<repo> held by <task> until its PR merges", surfaced bybrief --check. - Docs:
agents/conductors/batch/AGENTS.md("The watcher", the caps/plan paragraph) and one line inskills/batch/batch.md. - Tests (
tests/test_batch_plan.py/tests/test_batch_named_tasks.py), per the prompt'sWitness:: (1) second same-library task held while the first is live or its PR open; (2) admitted once the first's PRs have all merged; (3) open/refused PR or parked question still holds; (4) abandoned with no PR frees it. - Run
tests/test_batch_*.pyandtests/test_orchestrator_*.py.
Key Files
agents/conductors/batch/_batch.py—plan(), the one-per-library clashagents/conductors/batch/_orchestrator.py—plan()per tick,on_originkeeps own picksagents/conductors/batch/AGENTS.md,skills/batch/batch.md— the rule in prose
Original Prompt
Click to expand starting prompt
M3.6i A shift's library slot frees once its task's PR has merged
Type: feature
Target: PyAutoBrain
Repos:
- PyAutoBrain
Difficulty: small
Autonomy: supervised
Priority: high
Status: draft
Filed: 2026-11-18
Epic: autonomous-orchestrators
Consequence: judge
Witness:python -m pytest tests/test_batch_plan.py tests/test_batch_named_tasks.py -qpasses with new tests that fail on today's main: (1) a brief naming two glance tasks on PyAutoGalaxy plans only the first while the first is live or its PR is open; (2) once the watcher's counters record the first as done with every PR in itsmergedlist, the next tick's plan admits the second; (3) a first task done with an open (unmerged or refused) PR, or parked on a question, still holds the library; (4) a first task abandoned with no PR frees it
Lane: any
Unattended: ready
Request (verbatim)
Human, 2026-11-18, while launching shift 2026-11-18-pm (7 named glance bugs: 5 on PyAutoGalaxy,
2 on PyAutoFit): "but we can do the shift it does one task per library but over the shift it
will do all 7 in the end right one after another?" — then, told it does not: "do B".
Option B as offered: change the rule so a library's next named task starts once the previous
one on that library has merged.
Why
_batch.plan admits one task per LIBRARY_REPOS repo per plan (" already claimed this
shift"). The watcher re-plans every tick, and on_origin keeps a task the shift already picked
in every later plan ("A task this shift already picked stays"). So the first PyAutoGalaxy pick
holds PyAutoGalaxy until review-at:, even after its glance close-out has merged it. A brief
naming five PyAutoGalaxy bugs runs one of them; the rest sit idle for hours.
The rule exists because concurrent library PRs collide at merge: the first merge moves main
and stales the others' test and smoke evidence. A task whose PR has already merged collides
with nothing, so holding its library past the merge serves no purpose.
What to change
- The watcher tells the planner which of this shift's own picks no longer hold their
libraries: done, with at least one PR and every PR in itsoutcomes[task].merged; or done or
abandoned with no PR and no open question. _batch.plankeeps such a pick in the plan (so it is still known, counted and never
re-dispatched) but does not add its repos to the claimed-library set.- Anything else still holds: live, parked on a question, done with an open or refused PR (a
judge PR waiting for/prm, a glance PR pastmerge-cap:). - The next task on that library starts on a later tick, from a worktree cut from the merged
main(start_library already branches from origin/main). - AGENTS.md "The watcher" and batch.md say the slot frees at merge;
brief --checkwording
stays ("will not start yet — PyAutoGalaxy held by until its PR merges" is a nicer
message than "already claimed this shift", if cheap).
Not in scope
- Running two tasks on one library at once.
- Raising
merge-cap:or changing close-out guards.
Activity
Jammy2211 commentedon Nov 18, 2026
Library PR opened: #680 (commit 0221a70). Tests: batch + orchestrator 665 passed / 1 skipped; full suite 2380 passed / 1 skipped. Heart dev-ship gate GREEN for PyAutoBrain. Tier judge → stops at PR-open for human /prm. No workspace impact (organ repo). After merge: fast-forward the watcher's Brain checkout, then launch shift 2026-11-18-pm.
docs(batch): keep skills/batch within the 200-line budget (#679)
test(batch): name the library by its key, not its repo name (tenant f…
Jammy2211 commentedon Nov 18, 2026
Shipped: #680 merged 2026-11-18T14:43Z (merge 6c804c6). A shift's library slot now frees once the task holding it has all its PRs merged (or ended with no PR and no open question); the next named task on that library starts on a later tick. CI green on 75258ef after two follow-up commits (skill line budget; tenant-firewall-neutral test names).