Files
gemini-cli/tools/gemini-cli-bot/brain/metrics.md
T
Christian Gunderman 24b678be21 Fix PR workflow.
2026-04-24 16:55:13 -07:00

2.7 KiB

Phase: The Brain (Metrics & Root-Cause Analysis)

Goal

Analyze time-series repository metrics to identify trends and anomalies, formulate hypotheses, and rigorously investigate root causes to safely improve repository health.

Context

  • Time-series repository metrics are stored in tools/gemini-cli-bot/history/metrics-timeseries.csv.
  • Recent point-in-time metrics are in tools/gemini-cli-bot/history/metrics-before-prev.csv and the current run's metrics.
  • Findings and state are recorded in tools/gemini-cli-bot/lessons-learned.md.
  • Preservation Status: Check the ENABLE_PRS environment variable. If true, your proposed changes to reflexes/scripts/ or configuration may be automatically promoted to a Pull Request during the publish stage. If false, you are conducting a readonly investigation and findings will only be archived.

Repo Policy Priorities

... (rest of priorities) ...

Instructions

... (rest of step 1) ...

2. Hypothesis Testing & Deep Dive

... (rest of step 2) ...

3. Maintainer Workload Assessment

... (rest of step 3) ...

4. Actor-Aware Bottleneck Identification

... (rest of step 4) ...

5. Policy Critique & Evaluation

... (rest of step 5) ...

6. Record Findings & Propose Actions

  • Document your formulated hypotheses, the evidence gathered, and your final conclusions in tools/gemini-cli-bot/lessons-learned.md.
  • Memory Preservation: When updating lessons-learned.md, you MUST preserve relevant findings and lessons from previous sessions. Only remove information that is no longer accurate or has been superseded by new data.
  • Propose specific, data-backed actions or script updates to address the root cause and any identified policy gaps. Ensure proposed actions align with the Repo Policy Priorities and include concepts like graceful closures and terminal escalations to prevent spam.
  • Recommend specific changes to GitHub Workflows, Triage scripts, or repository CONTRIBUTING.md/GEMINI.md guidelines.
  • Pull Request Preparation: If the ENABLE_PRS environment variable is true and you are proposing script or configuration changes, you MUST generate a file named pr-description.md in the root directory. This file will be used as both the commit message and PR description. The file MUST include:
    1. What the change is.
    2. Why it is recommended.
    3. Which metric is expected to be improved.
    4. By how much the metric is expected to improve.

7. Execution Constraints

  • Do NOT use the invoke_agent tool.
  • Do NOT delegate tasks to subagents (like the generalist).
  • You must execute all steps, script writing, and data gathering directly within this main session.