Component
API or orchestration, Agent runtime
Describe the feature
For #247 stacked child PRs (A4): when a lower child PR merges, its dependent PRs must be rebased onto the new base and force-pushed so the stack stays correct. Automate this so the human never hand-rebases.
The subtlety this issue exists to handle: GitHub auto-retargets a dependent PR's base pointer when the merged head branch is deleted, but it does not rewrite the dependent branch's commits. So an explicit restack is still required even though the base flips on its own.
Background — why a restack is needed (not just GitHub's auto-retarget)
With a stack A ← B ← C (B's branch cut from A's, C's from B's):
Net: the correct merge model is bottom-up, one PR at a time, delete the head branch to trigger retarget, then restack the dependents' commits. This issue automates the restack step.
Proposed solution
A restack reconciler triggered on a child PR closed+merged GitHub webhook:
- Find dependent child branches in the orchestration whose base was the merged branch.
git rebase --onto <new-base> <old-base> <dependent-branch> + force-push.
- Conflict-free → fully automatic (the common case when the lower PR merged unchanged).
- Conflict case → spawn an AGENT task to resolve it (ABCA-native; do NOT escalate to the human). The agent rebases, resolves conflicts preserving both intents, and pushes. The PR's normal human review remains the safety net for a mis-resolved semantic conflict — so the resolution is automated, the result is still reviewed before merge.
Acceptance criteria
Depends on
Out of scope
- Auto-MERGE of the stack (separate follow-up — gated on approvals + CI via merge queue).
Component
API or orchestration, Agent runtime
Describe the feature
For #247 stacked child PRs (A4): when a lower child PR merges, its dependent PRs must be rebased onto the new base and force-pushed so the stack stays correct. Automate this so the human never hand-rebases.
The subtlety this issue exists to handle: GitHub auto-retargets a dependent PR's base pointer when the merged head branch is deleted, but it does not rewrite the dependent branch's commits. So an explicit restack is still required even though the base flips on its own.
Background — why a restack is needed (not just GitHub's auto-retarget)
With a stack
A ← B ← C(B's branch cut from A's, C's from B's):So merging A →
mainand deletingfeat/Aflips B's base fromfeat/Atomainautomatically.ghstack(https://github.com/ezyang/ghstack) lands one PR and rewrites the rest of the stack's bases so it stays correct; Graphite automates the same restack-on-merge. This issue is the ABCA-native equivalent driven off a webhook instead of a developer CLI.Net: the correct merge model is bottom-up, one PR at a time, delete the head branch to trigger retarget, then restack the dependents' commits. This issue automates the restack step.
Proposed solution
A restack reconciler triggered on a child PR
closed+mergedGitHub webhook:git rebase --onto <new-base> <old-base> <dependent-branch>+ force-push.Acceptance criteria
max_sub_issuesstack depth.Depends on
Out of scope