Skip to content

P2 (#860 follow-up): keep agent branches rebased/squashed instead of merge-stacked #949

Description

@don-petry

Context

Part of the #860 runaway remediation (tracker: #926). A contributing factor: PR #860's branch carried a stale April base and was repeatedly merge main-d rather than rebased, inflating it to 378 commits for a net 18-file diff and generating recurring merge-conflict resolution work that itself triggered more fixup cycles (related to the #655 stale-base hazard).

Problem

Agent branches accumulate Merge branch 'main' into … commits instead of staying rebased, so commit count diverges from real change, conflict churn compounds, and a long-lived PR drifts further from a clean, reviewable state.

Fix (choose/scope during planning)

  • Prefer rebase/squash over repeated merge main for agent branches — ideally via the existing auto-rebase path rather than merge commits.
  • Optionally add a lint/health smell: flag PRs whose commit count vastly exceeds their changed-file count (e.g. >50 commits with <20 files) as a candidate for rebase/squash — complements the detection in the runaway-health issue.

Respect AGENTS.md: auto-rebase.yml stays pinned to @auto-rebase/stable (do not repoint), and the #655 guards (test-deletion-guard + "require branches up to date before merging") must remain intact.

Acceptance criteria

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    dev-leadFor dev-lead agent pickupenhancementFeature requests

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions