Skip to content

Add hard PR scope gates: LOC ceiling, files-touched ceiling, do-not-auto-merge path list #17

Closed

Description

@dmccoystephenson

Problem

Empirical evidence: PRs authored by autonomous coding agents fail at high rates when they are large, touch many files, or modify sensitive paths. The current template has the 0–3 issue batch ceiling but no structural gates on the resulting diff.

Motivation

Per RESEARCH.md §2 — Agent-authored PRs fail in characteristic ways:

  • Where Do AI Coding Agents Fail? 2026 (arXiv:2601.15195): 33k agent-authored PRs — unmerged PRs are larger, touch more files, and fail CI.
  • Code Review Agents in PRs 2026 (arXiv:2604.03196): CRA-only PRs merge at 45% vs. 68% human-only.

Confidence: high.

Proposal

Add to the generated skill template:

  1. LOC ceiling in Phase 3 (Implementation): if the cumulative net diff exceeds ~400 LOC, stop and either (a) drop one of the batched issues or (b) split into multiple PRs. Hard stop at ~800.
  2. Files-touched ceiling in Phase 3: if files modified exceeds ~10, same response.
  3. Do-not-auto-merge path list in Phase 8 (Merge): paths whose modification requires human review before merging. Universal defaults: .github/workflows/*, files in any security/ directory, deletion of >50 lines. A new {{DO_NOT_AUTO_MERGE}} placeholder lets generated skills add repo-specific paths (e.g. plugin.yml, pom.xml).
  4. Bug-fix-requires-test gate in Phase 8: for any issue labeled or described as a bug fix, require an added/modified test in the diff. Already implied by the Tests-fix rubric item in Phase 4 but should be an explicit merge gate, not just a rubric line.

Acceptance criteria

  • Phase 3 has a ceiling check (LOC + files) with explicit "what to do if exceeded" language
  • Phase 8 has a do-not-auto-merge path check before invoking gh pr merge
  • New {{DO_NOT_AUTO_MERGE}} placeholder added to Step 4 substitution table
  • Test plan in the PR: try running on a fixture issue that intentionally would produce a too-large diff; verify the skill stops at the gate

Retrofit

Per CLAUDE.md's promotion rule, retrofit PRs needed for example-l-dev-loop, example-q-dev-loop, example-a-dev-loop, example-h-dev-loop.

Related


drafted by Claude on behalf of Daniel Stephenson

Activity

  1. added a commit that references this issue on May 25, 2026
    a6b749e
  2. added a commit that references this issue on Aug 3, 2026
    d44bfd7
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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions