Skip to content

fix(ci): the same-scope batching gate counts Refs, so any umbrella reference exempts a single-issue PR #16795

Description

@mrveiss

What happens

scripts/check_pr_issue_batching.py exists because the batching rule "was documented in CLAUDE.md and checked by nothing" (.github/workflows/pr-issue-validation.yml). Its stated intent: "This is not a ban on single-issue PRs; it requires the author to say why one stands alone."

It does not require that in practice. check() returns early:

issues = referenced_issues(body)
if len(issues) >= 2:
    return True, f"Batched: references {len(issues)} issues (...)."

and _REFERENCE counts refs and part of alongside the closing keywords:

r"(?:resolves|closes|fixes|refs|references|part of)\s+..."

So a PR with Closes #A plus Refs #B scores as two issues and is reported as "Batched", with no rationale ever required. That is not an edge case: linking the umbrella is exactly what ~/.claude/docs/issue-decomposition.md tells every child PR to do, so the common, correct shape silently exempts itself from the gate.

Evidence

Why it matters

The gate reads as enforcing something it does not, which is worse than an absent check: a reviewer seeing "Check same-scope batching ✓" reasonably concludes the author justified standing alone. Guards must distinguish satisfied from not examined.

Options

  1. Count only the closing keywords (resolves|closes|fixes) toward "batched" — a Refs/part of link is context, not a second delivered issue. Most precise, and matches what "batched" means everywhere else in the process (Closes #A, #B).
  2. Keep counting them, but require the rationale whenever a PR closes exactly one issue, regardless of how many it references.

Both fixes are in one function. (1) also makes the check's own message truthful: #16788 is not "batched", and saying so is the defect.

Acceptance criteria

  • A PR closing one issue and referencing an umbrella requires a Single-issue rationale: line.
  • A genuinely batched PR (Closes #A, #B) still passes with no rationale.
  • The script's unit tests cover the umbrella-reference shape, which is the one that regressed.

Found during

Cross-checking my own PRs after autobot-ai-01 mentioned adding a rationale line that mine had passed without.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions