## 📊 Summary
This PR optimizes the repository's automated issue lifecycle to address a growing backlog of over 2,000 open issues and nearly 500 "zombie" issues (those with no activity for >30 days).
## 🚀 Changes
- **Lowered Stale Threshold**: Reduced `STALE_DAYS` from 60 to 30. This aligns the stale bot with the repository's "Zombie" health metric and ensures inactive issues are flagged sooner.
- **Tightened "Needs Info" Grace Period**: Reduced `NO_RESPONSE_DAYS` from 14 to 7 for issues labeled `status/need-information`. This encourages faster turnaround from contributors or earlier closure of incomplete reports, freeing up maintainer bandwidth.
## 📈 Expected Impact
- **Reduced Backlog Age**: By flagging and closing inactive issues sooner, the average age of the open backlog will decrease.
- **Improved Focus**: Maintainers can focus on the ~1,500 active issues rather than the 500+ inactive ones.
- **Metric Alignment**: The `bottleneck_zombie_issues_count` metric (30d threshold) will now be directly addressed by the stale bot.
## 🛠️ Verification
- Validated script logic locally.
- Verified that exempt labels (pinned, security, help wanted) are preserved.
- Mandate the use of `gh run view` for empirical log verification rather than static code inspection.
- Update interactive mode prompt to allow the agent to retain task context and run the unblocking protocol when following up on its own PRs.
This update resolves the bot's persistent focus on already-completed tasks:
- Moves and syncs lessons-learned.md to tools/gemini-cli-bot/ to ensure persistent memory.
- Marks metrics fixes, prompt hardenings, and user rejection signals as DONE in the ledger.
- Implements the CI matrix optimization (Node 20.x for PRs) the bot was re-attempting.
- This forces the bot to rotate to a new domain in the next run by satisfying its current goals.
This update hardens the bot's reasoning and validation layers to stop thrashing and ensure technical quality:
- Mandates local validation (lint, build, test) in Brain and Critique prompts.
- Uncaps bottleneck metrics (zombie issues, priority distribution) to 1000 items.
- Enhances PR awareness to handle multiple bot identities and exclude release PRs.
- Formally defines closed (unmerged) PRs as explicit user rejection signals.
- Strengthens domain rotation and anti-pigeonholing enforcement.
Fixes the throughput metrics script and introduces new visibility into backlog bottlenecks and priority distribution.
### Changes
- **Throughput Fixes**: Resolved a `ReferenceError` where `isMaintainer` was not correctly scoped, fixed a malformed license header, and added a new metric for `issue_arrival_rate_per_day` to enable growth-vs-closure analysis.
- **Backlog Bottlenecks**: Introduced `bottlenecks.ts` to identify "Zombie" issues (no activity > 30 days) and "Hot" issues (high activity).
- **Priority Distribution**: Introduced `priority_distribution.ts` to track the count of open issues by priority level (P0-P3).
### Impact
These metrics will provide the necessary data to confirm if the repository is experiencing systemic backlog growth (Arrival Rate > Throughput) and help identify which segments of the backlog require urgent triage.