Duo-Guardian / docs /idea.md
Daksh C Jain
built mcp and now moving on testing
2110b7e

GitLab Context Brain Here's something genuinely simple that every developer on the planet would want:

An agent that silently learns your project as you work, and surfaces the exact context you need β€” right when you open an MR, pick up an issue, or start a new task.

What it does, concretely: When you open a Merge Request, it posts one smart comment containing:

πŸ—ΊοΈ "What is this change touching?" β€” plain English summary of which systems, services, and team members own the affected code

πŸ•°οΈ "What happened here before?" β€” last 3 relevant incidents, past MRs, or bugs in these files (pulled from GitLab Issues + GCP Cloud Logging)

πŸ‘€ "Who should really review this?" β€” not just CODEOWNERS, but who actually knows this code based on recent commit history

⚠️ "What should I watch out for?" β€” known flaky tests, past deployment issues, open related issues

When you pick up a GitLab Issue, it posts:

All previous attempts at solving this

Related code files, last touched by whom, when

GCP service logs that are relevant to this issue's domain

That's it. No pipeline fixing. No cost analysis. Just: "Here is everything you need to know to do your job right now."

Why GCP Makes This Genuinely Powerful This is where GCP becomes the differentiator, not just a checkbox:

Context Source Where It Lives GCP Service Historical incidents GitLab Issues β€” Past deployment failures GitLab pipelines GCP Cloud Logging Service behavior at runtime β€” GCP Cloud Monitoring / Error Reporting Who owns what in production β€” GCP IAM / Resource Manager Summarization + reasoning GitLab Duo Gemini API / Vertex AI

Flow Developer opens MR ↓ GitLab Webhook fires β†’ Agent activated ↓ Agent collects context in parallel: β”œβ”€β”€ GitLab API β†’ changed files, commit history, CODEOWNERS, open related issues β”œβ”€β”€ GCP Cloud Logging β†’ past errors/incidents tied to affected services └── GCP Error Reporting β†’ recurring failures in production for these code paths ↓ Gemini API (Vertex AI) synthesizes all inputs ↓ Structured comment posted to MR containing: β”œβ”€β”€ πŸ—ΊοΈ What this change touches (services, modules, blast radius) β”œβ”€β”€ πŸ•°οΈ What happened here before (past bugs, incidents, relevant MRs) β”œβ”€β”€ πŸ‘€ Who actually knows this code (beyond CODEOWNERS β€” based on recency + frequency) └── ⚠️ Watch out for (flaky tests, known fragile paths, open related issues)

Flow Issue assigned to developer ↓ GitLab Webhook fires β†’ Agent activated ↓ Agent collects: β”œβ”€β”€ GitLab API β†’ past MRs/issues with similar labels or keywords β”œβ”€β”€ GitLab API β†’ code files most relevant to issue title/description └── GCP Cloud Logging β†’ runtime logs related to issue domain ↓ Gemini synthesizes ↓ Comment posted to Issue: β”œβ”€β”€ πŸ“ Likely files to look at β”œβ”€β”€ πŸ” Previous attempts at fixing this (linked MRs/issues) β”œβ”€β”€ πŸ‘€ Best person to ask └── πŸ“Š Live production signals related to this issue

Layer Tool
Trigger GitLab Webhooks
Agent runtime GitLab Duo Agent Platform
Code context GitLab REST API
Production signals GCP Cloud Logging + Error Reporting
Reasoning + summarization Gemini API via Vertex AI
Memory / history
Output GitLab MR / Issue comment via API