Not a syntax error. Not a missing test. Not a type mismatch. A belief. Something a developer took for granted when they wrote the code six months ago, and something that quietly stopped being true in production last Tuesday at 2 AM.
Things like: “this API always responds in under 500 milliseconds.” Or: “the database connection pool will be available when we need it.” Or: “file uploads will never exceed 10 MB.” Or the classic: “payments always succeed on the first try.”
Linters do not catch these. Test suites do not flag them. Code reviews might, if the reviewer happens to think of the right edge case at the right time. But usually, nobody does. These assumptions sit quietly in the codebase, invisible and untested, until the environment changes and they all break at once.
I call this assumption debt. Every codebase carries it. It accumulates silently, sprint after sprint. And it is, by a wide margin, the number one source of incidents that begin with the phrase: “but it worked on my machine.”












I spent the last few weeks building a tool that finds these assumptions before your users do. It’s called Assumption Miner, and it runs as a GitLab Duo Agent.
What Assumption Miner Actually Does#
Assumption Miner is a GitLab Duo Agent that detects implicit assumptions in your code, tracks them over time, and helps you fix them before they cause outages.
It integrates seamlessly into your GitLab workflow and runs automatically whenever you create a merge request. You can also invoke it on demand from GitLab Duo Chat. Under the hood, it combines AST-level code analysis with AI-powered reasoning to spot patterns that static analysis tools miss entirely: unhandled failure modes, hardcoded thresholds, missing input validation, undocumented environmental dependencies, and silent type coercions.
Every assumption it finds gets a DNA fingerprint, a stable identity that survives renames, refactors, and branch merges. The agent doesn’t just find problems, it predicts which assumptions are most likely to break next, maps them to security frameworks, and auto-generates fix merge requests so your team can resolve issues in a single click.
The result: fewer surprises in production, clearer risk visibility for your team, and a codebase that documents its own blind spots.
Why This Is Different#
Most code quality tools focus on what your code does. Assumption Miner focuses on what your code believes.
There are plenty of tools that catch unused variables, enforce formatting rules, and flag unreachable branches. Those are solved problems. The unsolved problem is the gap between what a developer intended and what the code actually guarantees. That gap is where assumptions live, and it’s where production incidents are born.
A few things that make this different from anything else I have seen in the ecosystem:
- AST plus AI: The detection pipeline starts with a real AST parser that extracts structural information from the code. Then an LLM classifies and scores each candidate assumption. This hybrid approach catches things that pure static analysis cannot (contextual assumptions, implicit expectations about external services) while avoiding the hallucination problems you get from feeding raw source code to a language model.
- DNA fingerprinting: Each assumption gets a deterministic fingerprint based on its structural context, not its line number or file path. When someone renames a file, moves a function, or refactors a module, the assumption retains its identity. This is what makes tracking and trend analysis possible across sprints and branches.
- Predictive health scoring: The agent does not just tell you where you are. It tells you where you are headed. Using linear regression and weighted moving averages on historical snapshots, it forecasts your health score two to four sprints ahead. If the trajectory is negative, you know before anything breaks.
- Security mapping out of the box: Every assumption is automatically mapped to CWE entries, OWASP Top 10 categories, and compliance controls including SOC2, PCI-DSS, and GDPR. You do not need a separate security scanning step. The risk surface is visible from the moment the assumption is detected.
- One-click auto-fix: For the most common assumption patterns (missing error handling, null checks, hardcoded timeouts, missing input validation, absent type safety), the agent generates a fix patch from battle-tested templates, creates a branch, and opens a merge request. No context switching. No manual work.
Who This Is For#
Assumption Miner is built for teams that ship code to production and want fewer surprises when they do.
- Backend engineers working on API services, payment flows, database layers, and infrastructure code where implicit assumptions about availability, latency, and state are the primary source of production incidents.
- Tech leads and engineering managers who need visibility into the risk profile of their codebase without reading every line of every merge request. The health score and trend predictions give you a strategic view of where assumption debt is accumulating.
- Security teams that need to map code-level risks to compliance frameworks. The automatic CWE, OWASP, and SOC2 mapping means security reviews start from a structured baseline instead of a blank page.
- Platform teams managing shared libraries and microservice interfaces where assumptions in one service can silently break another. The cross-repo drift detection feature catches these divergences before they propagate.
If your team has ever had an incident where the postmortem concluded with something like “we assumed the upstream service would always return a 200,” this is the tool that catches that assumption before it becomes an incident.
When to Use It#
- On every merge request: The agent runs automatically when an MR is created. It scans the changed files, classifies assumptions, and posts a structured comment with findings, health grade, and priority fixes. This is the primary workflow and the one that catches issues earliest.
- On demand from GitLab Duo Chat: Open the Duo sidebar, type
@assumption-miner scan/src/api/payment.py, and get results in seconds. This is useful for targeted scans before a risky refactor or when investigating a production incident. - As a CI/CD quality gate: Include the quality gate template in your pipeline configuration. If the health score drops below your configured threshold, the merge gets blocked. This prevents assumption debt from accumulating past your team’s risk tolerance.
- During sprint planning: Pull up the predictions page and check where the health score is headed. If the forecast shows a downward trend, you know it’s time to allocate capacity for assumption cleanup before it becomes an emergency.
The Architecture#

The system is split into four layers, each handling a distinct responsibility in the detection and remediation pipeline.
- The detection layer combines an AST parser with custom pattern matching rules and an AI classification engine powered by Groq (Llama 3.3) and OpenRouter. The parser extracts structural candidates from the code, while the AI engine classifies each candidate, assigns a confidence score, and maps it to known vulnerability patterns. Every identified assumption gets a DNA fingerprint for persistent tracking.
- The scoring layer runs in Rust, compiled to WebAssembly. It performs Monte Carlo simulation to generate a health score (A+ through F) and runs sub-millisecond in the browser. The ML layer on top handles trend prediction using linear regression and weighted moving averages on historical snapshots, forecasting the health score two to four sprints ahead.
- The backend is a Python FastAPI service deployed on Google Cloud Run. It handles analysis requests, stores results in SQLite, serves the REST API, and manages the feedback learning loop. Google Cloud Run was chosen for its zero-infrastructure posture: it scales from zero when idle, scales up instantly when the GitLab agent pushes scan results, and runs identically to the local Docker environment.
- The frontend is a React and TypeScript application deployed on Vercel. It includes a system health dashboard, an interactive 3D dependency graph built with Three.js, a timeline view showing assumption evolution across sprints, a predictions page with trend forecasts, and a security page mapping assumptions to compliance frameworks. The 3D graph is particularly useful for visualizing how assumptions cluster and interact across modules.
Tech Stack#
The system is built using a variety of technologies across different layers:
- Orchestration: The GitLab Duo Agent + Flow enables native GitLab integration and triggers on merge request events, automating workflows.
- Backend: The backend utilizes Python and FastAPI for AST parsing, AI orchestration, and providing a REST API.
- Hosting (API): The API is hosted on Google Cloud Run, utilizing serverless containers that scale automatically, ensuring zero operational overhead.
- Scoring: The scoring layer is powered by Rust compiled to WebAssembly (WASM), allowing for sub-millisecond health scoring and Monte Carlo simulations.
- AI: Groq (Llama 3.3) and OpenRouter are used for pattern classification, risk assessment, and generating fixes based on the data processed.
- Machine Learning (ML): Python (including regression and weighted moving averages) handles trend prediction and confidence calibration.
- Frontend: The frontend is built with React, TypeScript, and Three.js, enabling a real-time, interactive dashboard and a 3D dependency graph.
- Hosting (UI): The UI is deployed on Vercel, leveraging a global CDN and enabling automatic deployment on each push.
- Storage: SQLite is used to store the assumption registry and feedback history, ensuring efficient storage management.
Google Cloud Run Integration#

The backend runs on Google Cloud Run in the asia-southeast1 region. The deployment model is straightforward: the FastAPI application is containerized with Docker, pushed to Google Container Registry, and deployed as a fully managed Cloud Run service.
There are several reasons why Cloud Run was the right choice for this project. First, it scales to zero, making it an ideal solution for a hackathon project with intermittent traffic. This means there is zero cost during idle periods and instant availability when the GitLab agent pushes scan results. Second, the container-native model ensures that the production environment is identical to local development, simplifying the setup. Third, environment variables for API keys (Groq, OpenRouter, GitLab token) are injected at the service level, ensuring no secrets are stored in the codebase.
The deployment is done with a single command:
gcloud run deploy assumption-miner-backend-image gcr.io/PROJECT_ID/assumption-miner-backend-platform managed-region asia-southeast1-allow-unauthenticated
The live backend also serves the Swagger API explorer, allowing any reviewer to test the endpoints directly in the browser.
The GitLab Duo Agent: Assumption Miner Agent V9#
The agent is published as Assumption Miner Agent V9 in the GitLab AI Hackathon group. It integrates with GitLab Duo both as an Agent (for on-demand analysis) and a Flow (for automated pipeline triggers).
In Agent mode, you interact with it directly in the GitLab Duo sidebar. You can ask it to scan a specific file, explain a risk score, or run a full repository scan. The built-in slash command makes targeted scans fast and simple:
scan-assumptions backend/python/services/scorer.py
In Flow mode, the agent triggers automatically on merge request events. It follows a three-step pipeline: it scans and classifies the changed files, saves the findings as structured JSON, and posts a formatted comment on the MR with the health grade, findings table, and priority fixes.
The results are synced to the React dashboard via a push script that reads the JSON output and posts it to the Cloud Run backend. This architecture keeps the agent lightweight, only needing to write a JSON file, while allowing the dashboard to handle visualization and trend analysis.
Features Worth Highlighting#
- The 3D dependency graph: Built with Three.js, this is a holographic visualization of how assumptions relate to each other across your codebase. Assumptions are rendered as spheres, colored and sized by severity. Edges show dependency relationships. It is not just a visual gimmick; it reveals clusters of related assumptions that should be addressed together and surfaces hidden coupling between modules that is not visible in a flat list.
- The feedback learning loop: Developers can react to findings with slash commands or emoji reactions. The agent tracks this feedback and adjusts its confidence weights accordingly. Over time, it learns what your team considers a real risk versus acceptable noise, and it calibrates its scoring to match. This is what separates a useful tool from an annoying one.
- Custom rules engine: Teams can define their own detection rules in YAML using regex patterns, AST matchers, literal string matching, function call detection, and context-aware matching. This lets you encode project-specific knowledge that the AI might not have. If your team knows that calling a particular internal API without a circuit breaker is always a mistake, you can codify that as a rule and the agent will enforce it.
- Cross-repo drift detection: For teams running microservices, this feature detects when shared assumptions diverge across repositories. If service A assumes a response schema that service B has quietly changed, the agent flags the drift before it reaches production.
- Time travel: The timeline view lets you navigate through the history of your assumption landscape. You can see exactly when a particular assumption was introduced, how it evolved, and what changed in the codebase around that time. This is invaluable during incident postmortems.
The Bigger Picture#
The core insight behind Assumption Miner is simple: the most dangerous things in your codebase are not the things that are wrong. They are the things that are accidentally right. Code that works today because an implicit assumption happens to be true, and will break tomorrow when it stops being true, with no warning and no documentation.
Every tool in the software quality ecosystem focuses on what is explicit: types, syntax, test coverage, dependency versions. Almost nothing focuses on what is implicit. That is the gap this project fills.
The agent, dashboard, and API are live. You can scan your own code against it right now.
Thank you for checking out Assumption Miner. If you’re interested in keeping up with updates or would like to collaborate, feel free to follow me on X for the latest news. You can also explore the live dashboard, dive into the backend API documentation, or take a look at the source code to see how it all works. For a detailed walkthrough, check out the video on YouTube.
I publish every article on Medium too. Follow me there to get new posts in your feed, or leave a clap if this one helped.
