wiqilee.dev
← All writing
7 April 202612 min readAssumption Miner

Assumption Miner: The Tool That Finds What Linters, Tests, and Code Reviews Miss

Every production incident has a root cause. But if you trace the chain far enough, you almost always end up at the same place: an assumption nobody ever wrote down.

Code analysisGitLab DuoAI agents

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.”

Assumption Miner: Identifying critical assumptions in your code and providing automatic fixes in real time.
Assumption Miner: Identifying critical assumptions in your code and providing automatic fixes in real time.
Assumption Miner Dashboard: Real-time health score, assumptions detection, and critical items overview. Track implicit assumptions, their severity, and estimated time to resolve them directly from your CI/CD pipeline.
Assumption Miner Dashboard: Real-time health score, assumptions detection, and critical items overview. Track implicit assumptions, their severity, and estimated time to resolve them directly from your CI/CD pipeline.
Assumption Miner Dependency Graph: Visualize the relationships between detected assumptions in your codebase. Critical and high-risk assumptions are clearly marked, and connections highlight dependencies across different categories for more efficient risk management.
Assumption Miner Dependency Graph: Visualize the relationships between detected assumptions in your codebase. Critical and high-risk assumptions are clearly marked, and connections highlight dependencies across different categories for more efficient risk management.
Assumption Miner Timeline: Track the lifecycle of assumptions across your codebase. View detected issues, incidents, resolutions, and the creation of auto-fix merge requests, all in one place. Stay informed on the status of critical assumptions and incidents.
Assumption Miner Timeline: Track the lifecycle of assumptions across your codebase. View detected issues, incidents, resolutions, and the creation of auto-fix merge requests, all in one place. Stay informed on the status of critical assumptions and incidents.
Assumption Miner Trend Prediction: Monitor your codebase health with AI-powered predictions for the next 3 sprints. Visualize the impact of critical assumptions and get recommended actions to prevent future issues.
Assumption Miner Trend Prediction: Monitor your codebase health with AI-powered predictions for the next 3 sprints. Visualize the impact of critical assumptions and get recommended actions to prevent future issues.
Assumption Miner Security Impact: Visualize how assumptions affect security compliance with real-time status on SOC2, PCI-DSS, and GDPR controls. Get detailed insights into each security issue, including CWE mappings, OWASP risks, and potential attack vectors.
Assumption Miner Security Impact: Visualize how assumptions affect security compliance with real-time status on SOC2, PCI-DSS, and GDPR controls. Get detailed insights into each security issue, including CWE mappings, OWASP risks, and potential attack vectors.

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:

Who This Is For#

Assumption Miner is built for teams that ship code to production and want fewer surprises when they do.

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#

The Architecture#

System Architecture of Assumption Miner: This diagram illustrates the flow from GitLab integration to scoring, persistence, and output, showcasing how assumptions are detected, classified, and remediated within the Assumption Miner platform.
System Architecture of Assumption Miner: This diagram illustrates the flow from GitLab integration to scoring, persistence, and output, showcasing how assumptions are detected, classified, and remediated within the Assumption Miner platform.

The system is split into four layers, each handling a distinct responsibility in the detection and remediation pipeline.

Tech Stack#

The system is built using a variety of technologies across different layers:

Google Cloud Run Integration#

Assumption Miner Logs in Google Cloud: Monitor real-time logs from the backend service running on Google Cloud Run. Track system events, server processes, and API interactions for better observability and debugging.
Assumption Miner Logs in Google Cloud: Monitor real-time logs from the backend service running on Google Cloud Run. Track system events, server processes, and API interactions for better observability and debugging.

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 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.

Also on Medium

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.

Wiqi LeeData scientist, AI/ML researcher and software engineer. More about me.