Skip to content

[P2] Automated scope explosion detector (git hook) #944

@rjmurillo-bot

Description

@rjmurillo-bot

Context

PR #908 had 95 files changed (20× over healthy limit). Need early warning system for scope explosion.

Problem Statement

No visibility into PR size until creation:

  • File count grows incrementally
  • No alerts when crossing thresholds
  • Large PRs discovered too late
  • Splitting is harder after the fact

Proposed Solution

Create git hook that tracks cumulative PR size:

Thresholds:

  • 10 files: Warning (suggest reviewing scope)
  • 20 files: Strong warning (suggest split/commit)
  • 50 files: Block commit (hard limit)

Implementation:

  • Track files added since branch diverged from main
  • Check after each commit
  • Display current count: "PR size: X/10 files"
  • Suggest: Split PR or commit current work

Acceptance Criteria

  • Git hook created (pre-commit or post-commit)
  • Tracks cumulative file count
  • Warning at 10, 20 files
  • Block at 50 files (hard limit)
  • Clear remediation guidance
  • Bypass mechanism for justified large PRs (e.g., mass refactor)

Effort Estimate

4 hours

Priority

P2 - Normal (This Quarter)

Related

References

.agents/retrospective/2026-01-15-pr-908-comprehensive-retrospective.md (lines 1321-1327)

Metadata

Metadata

Assignees

Labels

agent-retrospectiveLearning extraction agentarea-infrastructureBuild, CI/CD, configurationarea-workflowsGitHub Actions workflowsautomationAutomated workflows and processesenhancementNew feature or requestpriority:P2Normal: Standard enhancement or bug fix, moderate impact

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions