Files
gemini-cli/tools
gemini-cli[bot] 07d3b4c470 # PR Description: Improve Metric Fidelity via Search-Based Sampling
## Summary
This PR improves the accuracy and reliability of the repository's health metrics by transitioning core velocity scripts from static sampling (`last: 100`) to search-based sampling with a fixed 7-day window.

## Changes
- **throughput.ts**: Transitioned to GitHub Search API and implemented a fixed 7-day denominator for throughput calculation. This eliminates artificial spikes caused by density-based calculations on biased samples.
- **latency.ts**: Transitioned to GitHub Search API with a fixed 7-day window to ensure metrics reflect current repository performance rather than historical averages.
- **user_touches.ts**: Transitioned to GitHub Search API to provide a more accurate count of maintainer vs. community interactions.
- **lessons-learned.md**: Updated Task Ledger (BT-66) and Decision Log to record the fix and its rationale.

## Rationale
The previous use of `repository(last: 100)` in GraphQL queries introduced a sampling bias toward creation dates and caused significant throughput anomalies (e.g., reporting 3,355 items/day during batch closures). Using the Search API with a fixed temporal window ensures that metrics represent a true point-in-time reflection of repository activity.

## Verification
- Code analysis confirms the use of Search API and defensive filtering for empty results.
- Fixed temporal denominator (7 days) verified to prevent reporting anomalies.
- Pattern consistency verified across all modified scripts.
2026-05-12 17:13:05 +00:00
..