feat(repo): add gemini-cli-bot metrics and workflows#25888
Conversation
This commit establishes the foundational metrics and automation workflows for the new gemini-cli-bot (Cognitive Repository). It includes: - A new `tools/gemini-cli-bot` directory structure. - Several TypeScript metrics scripts (e.g., latency, throughput, open issues) that leverage the GitHub CLI. - A deterministic runner (`metrics/index.ts`) exposed via `npm run metrics`. - Two new GitHub Action workflows: `gemini-cli-bot-pulse.yml` (runs every 30m) and `gemini-cli-bot-brain.yml` (runs daily) to power the Reflex and Reasoning layers.
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request introduces the initial architecture for the gemini-cli-bot, designed to transform the repository into a proactive, agentic system. By implementing a dual-layer execution model—the Pulse for deterministic data collection and the Brain for strategic analysis—the system enables automated repository health monitoring and optimization using the GitHub CLI. Highlights
Ignored Files
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces the foundational architecture for the gemini-cli-bot, specifically implementing a metrics collection system. It adds a central runner and several TypeScript scripts to track repository health indicators such as PR latency, throughput, domain expertise, and review distribution. The review feedback identifies critical security vulnerabilities regarding command injection in index.ts and domain_expertise.ts, where file paths are interpolated into shell commands without proper sanitization.
|
Size Change: -4 B (0%) Total Size: 33.7 MB
ℹ️ View Unchanged
|
gundermanc
left a comment
There was a problem hiding this comment.
I've pushed updates to address the human review comments: added GitHub repository protection, fetch-depth 0, and pinned action versions in workflows. I also added explicit MetricOutput typing and removed any typing from the metrics scripts. Abstracted GITHUB_OWNER and GITHUB_REPO into constants. As requested, I left the bot comments unmodified.
gundermanc
left a comment
There was a problem hiding this comment.
I've additionally resolved the new TypeScript typings errors that were introduced in the 'tools/' directory during the last commit. All metrics scripts should now compile correctly.
gundermanc
left a comment
There was a problem hiding this comment.
I've gone ahead and fixed the two command injection vulnerabilities highlighted by the automated security bots as well, sanitizing the paths passed into execSync() using JSON.stringify().
| console.log(`Running metric script: ${script}`); | ||
| try { | ||
| const scriptPath = join(SCRIPTS_DIR, script); | ||
| const output = execSync(`npx tsx ${JSON.stringify(scriptPath)}`, { |
Summary
This PR introduces the foundation for the new
gemini-cli-bot(Cognitive Repository architecture). It sets up high-frequency "Pulse" maintenance workflows and daily "Brain" investigation workflows, supported by robust metrics collection using the GitHub CLI.Details
The
gemini-cli-bottransforms the repository into a proactive system using two primary layers:Changes in this PR:
tools/gemini-cli-bot/directory structure (metrics,processes/scripts,investigations,critique,history).tools/gemini-cli-bot/metrics/index.ts, an aggregation runner exposed vianpm run metrics..github/workflows/gemini-cli-bot-pulse.ymland.github/workflows/gemini-cli-bot-brain.yml.Related Issues
N/A (Implements PR 1 from
Plan.md)How to Validate
gh auth status).npm run metrics.metrics-before.csvis generated successfully and populated with valid JSON objects or CSV values representing the repository state.gemini-cli-bot-pulse.ymlandgemini-cli-bot-brain.yml) for structural correctness.Pre-Merge Checklist