Files
freemo bd5238f705 fix(agents): add critical safeguards to issue-implementor PR-first priority logic
Adds comprehensive bug prevention safeguards to the issue-implementor agent
definition to prevent critical failure where PR priority gate logic was not
correctly implemented, resulting in 37 PRs being incorrectly skipped.

Changes made:
- Added explicit warnings never to use `limit` parameter when fetching PRs
- Added comprehensive logging during PR analysis with progress indicators
- Added mandatory verification that total analyzed PRs equals total fetched
- Added PR-first rule enforcement logging showing when issue work blocked/allowed  
- Added error detection for violations of absolute PR priority rule
- Added historical bug documentation section with prevention measures

This ensures future instances will:
- Always fetch ALL open PRs (never use sampling/limits)
- Log verification counts during analysis
- Explicitly enforce the absolute PR-first priority rule
- Detect and report any violations of the priority rule

The bug caused the supervisor to incorrectly conclude "no PRs need work" 
when 37 out of 50 open PRs actually required automated attention, violating
the fundamental PR-FIRST rule that blocks all issue work until every PR
has an active worker.

ISSUES CLOSED: #3377
2026-04-05 15:50:37 -04:00
..