Skip to content

Read Branch Rules Before the Hand-Form Merged Branch Delete, or Report It Instead #2983

Closed

Description

@ptr727

Context

#2970 added pr_review.py cleanup, which refuses a merged branch that any ruleset or classic branch protection covers before deleting it. drive-pr step 4 and merge-and-release step 8 keep the hand form as the fallback on a host without the Bash(python3 scripts/pr_review.py:*) allow rule. That fallback is the verify-then-delete both skills carried before #2970: it checks the remote tip against headRefOid and then runs git push origin --delete -- "<branch>", with no rules read. CodeRabbit raised the difference on the #2980 promotion.

The Gap

Where a ruleset or protection covers a feature branch and still permits deletion, cleanup refuses and the hand form deletes it. A rule that forbids deletion is refused by GitHub itself, so the gap is the permitted-deletion case only, and it exists on main already.

Possible Direction

Either have the hand form read rules/branches/<branch> and branches/<branch> first and stop and report on any rule or an unread answer, as cleanup does, or drop the hand form's direct delete and report the delete to the maintainer whenever cleanup cannot run. The second keeps one place that holds the check. The edit lands in .agents/skills/drive-pr/SKILL.md and .agents/skills/merge-and-release/SKILL.md, followed by scripts/build_dist.py.

Activity

  1. added a commit that references this issue on Oct 14, 2026
    4ae7240
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions