Repository navigation
feat(batch): a shift's library slot frees once its task's PR has merged - #680
Merged
Merged
Conversation
…ed (#679) The planner admits one task per library repo per plan, and the watcher keeps a shift's own picks in every later plan, so the first pick on a library held it until review-at even after its PR merged. Now a pick that is done (or abandoned) with every PR merged, or with no PR and no open question, is passed to _batch.plan as `released`: it stays a member (never re-dispatched) but holds no library. A claim such a pick left in Mind origin/main active.md, written by this shift's own worker, no longer holds its repo either. The rejection names the holder: "<repo> held by <task> until its PR merges". Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…irewall, #679) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
A shift's library slot now frees once the task holding it has merged. Before this, the planner admitted one task per library repo per plan, and the watcher kept every task the shift had picked in each later plan, so the first PyAutoGalaxy pick held PyAutoGalaxy until
review-at:even after its glance close-out had merged it. A brief naming five PyAutoGalaxy bugs ran one.The rule exists because concurrent library PRs collide at merge. A task whose PRs have all merged collides with nothing, so its library is released and the next named task on it starts on a later tick, from a worktree cut from the merged
main. Two tasks never run on one library at once.A pick is released when it is done or abandoned and either every PR it opened is in its
mergedoutcome, or it ended with no PR and no open question. It still holds while live, parked, pending re-dispatch, or with any PR open or refused (a judge PR awaiting/prm, a glance PR pastmerge-cap:).Closes #679
API Changes
None to the public API — internal changes only.
_batch.plan()gains an optional keywordreleased; callers that omit it plan as before. The one-per-library rejection now names its holder.See full details below.
Test Plan
pytest tests/test_batch_*.py tests/test_orchestrator_*.py— 665 passed, 1 skipped (re-run at 0221a70)pytest tests— 2380 passed, 1 skippedtest_679_*tests drive real watcher ticks with two named glance tasks on PyAutoGalaxy: second waits while the first is live or its PR open; starts once the first's PRs are all merged; open/refused PR, parked question, one-of-two PRs merged all still hold; abandoned with no PR frees. The release and claim tests fail on unmodified main; the hold tests pass on main (regression guards).batch brief --checkon PyAutoMindbatches/2026-11-18-pm.md(7 named glance bugs: 5 PyAutoGalaxy, 2 PyAutoFit) — later same-library tasks should read "will start after 's PR merges".Full API Changes (for automation & release notes)
Added
agents.conductors.batch._batch.plan(..., released: set[str] | None = None)— task ids that stay members but claim no library.agents.conductors.batch._orchestrator.released_picks(counters)— this shift's picks that no longer hold their libraries.Changed Signature
_orchestrator.on_origin(..., released=None, slot_name="")— a released pick's leftoveractive.mdclaim holds nothing, only when its- session:is this slot's own shift worker._orchestrator._held_for(..., ignore=frozenset()).Changed Behaviour
"<repo> already claimed this shift"→"<repo> held by <task> — will start after <task>'s PR merges"(named tasks) /"<repo> held by <task> until its PR merges"(others).Notes for review
drop-section active.md <slug>before the next plan, but a set-aside op, failed push, missing.closeoutor an in-turn worker merge can leave the section. Only this slot's own released picks' claims are ignored; every other claim still holds..doneis abandoned with no recorded PR and frees its library. That PR gets no close-out, so it waits for a human/prm; at worst it needs a rebase.Heart (dev-ship gate GREEN for PyAutoBrain; shown, not blocking)
Generated by the PyAutoLabs agent workflow.
🤖 Generated with Claude Code