mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-05-15 06:12:50 -07:00
70f523ffb0
This change refactors the `open_issues.ts` and `open_prs.ts` metric scripts to use the GitHub GraphQL API instead of the `gh` CLI's list commands with hardcoded limits. **Why it is recommended:** The previous implementation used `gh issue list --limit 1000`, which caused the metrics to cap at 1000 items. As the repository now has approximately 2400 open issues, the metrics were reporting inaccurate data, hiding the true scale of the backlog and potentially misleading repository health analysis. **Expected metric improvement:** The `open_issues` and `open_prs` metrics will now report accurate total counts, regardless of the 1000-item CLI limit. This will result in an immediate correction of the `open_issues` metric from 1000 to approximately 2400. **Productivity Impact:** Accurate metrics enable better data-backed decisions regarding maintainer workload and triage prioritization.
Gemini CLI Bot (Cognitive Repository)
This directory contains the foundational architecture for the gemini-cli-bot,
transforming the repository into a proactive, evolutionary system.
It implements a dual-layer approach to balance immediate responsiveness with long-term strategic optimization.
Layered Execution Model
1. System 1: The Pulse (Reflex Layer)
- Purpose: High-frequency, deterministic maintenance and data collection.
- Frequency: 30-minute cron (
.github/workflows/gemini-cli-bot-pulse.yml). - Implementation: Pure TypeScript/JavaScript scripts.
- Role: Currently focuses on gathering repository metrics
(
tools/gemini-cli-bot/metrics/scripts). - Output: Action execution and
metrics-before.csvartifact generation.
2. System 2: The Brain (Reasoning Layer)
- Purpose: Strategic investigation, policy refinement, and self-optimization.
- Frequency: 24-hour cron (
.github/workflows/gemini-cli-bot-brain.yml). - Implementation: Agentic Gemini CLI phases.
- Role: Analyzing metric trends and running deeper repository health investigations.
Directory Structure
metrics/: Contains the deterministic runner (index.ts) and individual TypeScript scripts (scripts/) that use the GitHub CLI to track metrics like open issues, PR latency, throughput, and reviewer domain expertise.processes/scripts/: Placeholder directory for future deterministic triage and routing scripts.investigations/: Placeholder directory for agentic root-cause analysis phases.critique/: Placeholder directory for policy evaluation.history/: Storage for downloaded metrics artifacts from previous runs.
Usage
To manually collect repository metrics locally, run the following command from the workspace root:
npm run metrics
This will execute all scripts within metrics/scripts/ and output the results
to a metrics-before.csv file in the root directory.