## What the change is
- Refactored `gemini-lifecycle-manager.cjs` to include strict batch limits:
- Global limit of 300 items per execution.
- Per-query limit of 50 items.
- Optimized N+1 query vulnerability by checking `item.comments` before calling `listComments`.
- Switched PR lifecycle to a state-based approach:
- **Nudge**: Applied to PRs older than 7 days without the `status/pr-nudge-sent` label.
- **Closure**: Applied to PRs with the `status/pr-nudge-sent` label that have not been updated in at least 7 days.
- Switched search to use `github.paginate.iterator` for efficient, limit-aware processing.
## Why it is recommended
- **Scale Safety**: Prevents the script from making unbounded sequential API calls, which would hit GitHub rate limits and cause workflow timeouts in large repositories.
- **Graceful Closure**: Ensures that every PR contributor receives a full 7-day grace period after a nudge, regardless of how often the automation script runs.
- **Efficiency**: Reduces unnecessary API calls for items with no comments, saving GitHub Actions minutes and API quota.
## Expected impact
- Improved reliability of the lifecycle automation.
- Guaranteed 7-day grace period for PR contributors.
- Safe backlog processing without hitting secondary rate limits.
- Reduced noise from ungraceful PR closures.