Make stacking the default, with a push-to-main override Depends on: ABA-302. What…
- User
Make stacking the default, with a push-to-main override
Depends on: ABA-302.
What
Stacked PRs become the default for every drained issue. A repo opts out via
push_to_main_reposinrepos.yml, and a whole run opts out via--no-stack; opted-out issues keep today's push-to-main behavior.Why
The owner wants stacking as the norm, but some repos —
drain-cycleitself, whoseAGENTS.mdmandates push-to-main — must keep landing onmain. The override keeps that path intact and the rollout reversible.How (mechanical)
- Add an optional top-level
push_to_main_repos: [<name>]torepos.yml, following the backward-compatibleworktree_config_pathspattern; parse and validate it inrepos.load(reuse the validation style ofrepos._parse_worktree_config_paths) and surface it on theReposdataclass (drain_cycle/repos.py:65). - Add
--no-stacktodrain_cycle/cli.py. - In the orchestrator, compute
stack = repo.name not in push_to_main_repos and not cli_no_stack; thread it intoprompt.build(stack=…); skip the Ticket-302 stack-assembly step whenstackis false.
Acceptance criteria
- A repo listed in
push_to_main_reposreproduces today's behavior exactly — agent pushes tomain, no PR, no handoff. (test) -
--no-stackdisables stacking for the whole run. (test) - With no config and no flag, stacking runs by default. (test)
-
docs/repos.example.ymlshows the newpush_to_main_reposkey. -
pytestpasses.
Execution instructions:
- Working directory: /Users/anton/src/drain-cycle/.worktrees/ABA-303
- Base branch: main
- Completion sequence for issue ABA-303 (run in this order, before marking Done):
- Add an optional top-level
Assistant
I'll implement stacked PRs as the default behavior with a push-to-main override. Let me start by understanding the current codebase structure.
Assistant
Now let me check for any existing tests and understand the complete picture:
Assistant
I'll implement the stacked PR default with push-to-main override. Let me start with a focused plan:
Changes needed:
- Add
push_to_main_reposparsing torepos.py(followingworktree_config_pathspattern) - Add
--no-stackCLI flag - Update
prompt.build()to accept astackparameter - Thread
stackthrough the orchestrator toprompt.build() - Update example YAML and tests
Let me start:
- Add
- User
Execution instructions:
- Working directory: /Users/anton/src/drain-cycle/.worktrees/ABA-303
- Base branch: main
- Completion sequence for issue ABA-303 (run in this order, before marking Done):
- Run
/code-review-and-qualityagainst the working-tree changes. - Fix any Critical or Required findings. Lower-severity findings are at your discretion.
- Commit and push to main.
- Post a short review-summary comment on the Linear issue via
mcp__claude_ai_Linear__save_comment(count of findings by severity, fixed vs deferred). - Transition issue to Done via
mcp__claude_ai_Linear__save_issue(state: "Done").
- Run
before marking Done: run /code-review-and-quality on the working-tree changes, fix Critical/Required findings, commit + push, then post a review-summary comment on the issue and transition to Done.
Assistant
I'll conduct a multi-axis code review of the changes. Let me examine each dimension:
Assistant