How I Built a Closed-Loop Engineering System That Saved 840 Hours in 30 Days 

Written by Nicholas Geil

Over the last 30 days, this system resolved 1,088 Sentry issues tied to 20,792 production events, opened 472 agent-generated pull requests, merged 410 of them, and saved an estimated ~840 engineering hours. 

The interesting part is not that AI wrote code. 

The interesting part is that I built a closed-loop engineering system that can observe failures, group and analyze them, reproduce them in real application environments, implement fixes, validate those fixes through end-to-end interaction, and hand humans a reviewed candidate change instead of a raw incident. 

That distinction matters. Because the goal isn’t replacing engineering judgment. It’s removing the enormous amount of repetitive human effort spent moving a bug through the same mechanical lifecycle over and over again: detection, triage, investigation, reproduction, patching, testing, documenting, and Protect (PR) creation. 

That is the work this system absorbs. 

The Problem With Traditional Incident Resolution 

Most teams don’t actually lose time because any one debugging step is especially hard. They lose time because the full chain is expensive. 

When a production issue appears in Sentry, someone has to read the breadcrumbs and stack trace. Someone has to decide whether it is a duplicate or part of a broader issue group. Someone has to form a root cause hypothesis. Someone has to reproduce it. Someone has to implement a fix. Someone has to test it. Then someone has to explain the entire story all over again in a pull request so a reviewer can reconstruct what happened. 

None of that is wasted work. But it is very often work that is deterministic, repetitive, and highly automatable. 

I wanted a system that could perform the expensive middle of that lifecycle overnight, when application usage was low, and deliver something much more valuable by morning: a tested proposed fix with evidence. 

The Architecture 

At a high level, the system has three layers: observability, execution, and control. 

Observability 

I integrated Sentry across the Cyclotron Beam ecosystem for live error tracking, then enabled Seer to generate pre-processed root cause analysis for issue groups. The orchestration flow operates only against unresolved issues, queries them across Beam projects, groups duplicates, triggers Seer Root Cause Analysis (RCA) where needed, monitors completion, and prepares each surviving issue group for dispatch. 

That gave me something much better than raw error intake. It gave me a structured incident stream with grouping, prioritization, and machine-generated investigative context. 

The next layer is where things get much more interesting. 

Execution 

Inside Cursor, I created private environments for every repository involved in the Beam ecosystem, loaded with the shared secrets and environment variables required to build and run the applications safely. Those environments let cloud agents do more than static reasoning over source code. They can pull branches, compile applications, run services, authenticate into development environments, and interact with the actual UI for true human-style end-to-end testing. 

That changes the nature of the agent entirely. 

It is no longer just reading a stack trace and guessing. It can actually use the software. 

The core orchestration flow dispatches one Cursor cloud agent per issue group after RCA is available, passing the Sentry issue context, issue metadata, and Seer analysis into a dedicated triage workflow. The agent is explicitly instructed to pursue a holistic fix, not a quick patch, and to validate the result before creating a PR. 

Control 

This is not a “YOLO merge to production” system, and I would never design it that way. 

Humans remain in control of the decision points that matter. 

The agent creates a PR for review. That PR includes the issue context, root cause, resolution details, and testing evidence. After approval, additional GitHub Actions-based automation extends the loop: CI failures on agent branches can dispatch a new agent to fix the problem, and reviewer feedback can dispatch a new agent to address requested changes on the same PR branch. 

On top of that, both Sentry Seer and Cursor Bugbot review approved PRs before merge to catch potential bugs introduced by the changes. Only after CI passes does the change move into a pre-production environment for final human review before release. 

That is the right balance: aggressive automation in the repetitive middle and human control at the release boundary. 

How the Closed Loop Works 

The full overnight workflow looks like this: 

A time-based automation kicks off when Beam usage is low. It reads unresolved Sentry issues across the ecosystem, filters aggressively to unresolved work only, groups duplicates where appropriate, and merges duplicate issue groups within the same project when they are clearly the same underlying problem. 

For each surviving issue, it checks whether Seer RCA already exists. If it does not, the system triggers Seer to perform root cause analysis and waits for completion with monitored polling and timeout handling. Even if RCA fails, the system can still dispatch an issue agent to investigate from scratch rather than stalling the workflow entirely. 

Once enough context exists, the flow launches a dedicated Cursor cloud agent for each issue group, targeting the correct repository for the affected project. The agent receives the Sentry issue metadata, the RCA summary (if available), and instructions to follow the triage skill end-to-end. 

From there, the issue agent reads the issue data, stack trace, breadcrumbs, and RCA, forms a remediation plan, and then attempts to reproduce the issue in the application itself. If necessary, it adds temporary instrumentation to confirm the suspected root cause. Once the cause is validated, it implements a fix, returns to the app, and performs end-to-end testing through the same kinds of interactions a human would use. 

If the fix holds, the agent opens a GitHub pull request with an exhaustive description of the issue, the confirmed root cause, the implemented resolution, and the test evidence that supports the change. 

That changes the economics of review dramatically. 

The reviewer no longer has to start with a vague exception and reconstruct the entire incident manually. The reviewer can focus on whether the diagnosis is sane, whether the resolution is appropriate, and whether the resulting change belongs in the product. 

That saves a shocking amount of time. 

Why Private Environments Were the Real Unlock 

The private environments in Cursor ended up being one of the most important parts of the system. 

Most people think about secret management as a security or convenience feature. In this case, it became a scaling primitive. 

Because those environments can hold dozens of shared secrets across the Beam ecosystem, agents can work inside real execution contexts without exposing those values to humans. The team can share the environments, the variables remain redacted when viewed, and the runtime still has what it needs to authenticate, build, instrument, and test applications at scale. 

That means I can create horizontally scalable private environments that give agents the power to behave like real operators inside dev contexts without turning secret distribution into a disaster. 

That is what made true end-to-end reproduction and validation practical. 

Without that layer, you mostly get code-generation theatre. With it, you get a system that can actually interact with the application and provide a fix. 

What This Looked Like Over the Last 30 Days 

This system was not a toy experiment. It operated against real production issues. 

In the last 30 days, it resolved 188 issue groups and 1,088 Sentry issues tied to 20,792 Sentry events. 

Each of those numbers is important because they describe different truths. 

Events show the scale of operational noise and impact. 
Issues show the actual engineering work surfaced from that noise. 
Issue groups show how much of that work can be intelligently compressed before anyone spends time on it. 

During that same period, the system reduced 188 issue groups into 116 real work items, a 38.3% reduction in redundant work before remediation even began. 

On the delivery side, agents opened 472 pull requests and 410 of those were merged. Out of 608 total merged PRs in the period, 55.9% were agent-generated. 

That is the point where this stops being an interesting side project and starts becoming real engineering throughput. 

The quality profile mattered even more than the volume. 

Agent-generated PRs achieved: 

  • 86.9% merge rate 
  • 95.7% Continuous Integration (CI) pass rate on first submission 
  • 16.5% of agent PRs required follow-up agent comments 
  • 0% regression rate after merge 

And the single most important metric of all: the system saved an estimated ~840 engineering hours in 30 days. 

That is roughly 27 engineering hours returned to the team every day. 

Not theoretical productivity. Not story-point math. Time that would otherwise have been spent manually dragging issues through triage, reproduction, remediation, validation, and PR preparation. 

The median time from issue detection to PR creation was 8.4 hours, and the median time from PR creation to merge was 9.9 hours. 

Those numbers are especially meaningful in context. This system is designed to run largely during low-traffic windows and preserve human approval gates. So, the value is not simply that it is fast. The value is that it turns idle overnight time into completed investigation and ready-for-review engineering work. 

Engineers do not wake up to a queue of raw incidents. They wake up to candidate solutions. 

Why the Quality Metrics Matter More Than the Volume Metrics 

Whenever someone hears about agentic automation in software engineering, the first reaction is usually some variation of: “Sure, but how much garbage does it create?” 

That is the right question. 

High volume is not impressive if it produces noisy PRs, flaky tests, or regressions that humans have to clean up later. In fact, that kind of automation is worse than useless. It externalizes cost onto reviewers and future maintainers. 

What I cared about when creating this closed-loop engineering system was constrained autonomy with measurable quality. 

A 95.7% first-pass CI success rate says the generated changes are generally coherent and operationally sound. 

A 0% regression rate after merge says the end-to-end validation loop and post-PR review mechanisms are doing real work. 

An 86.9% merge rate says these are not speculative drafts that humans routinely throw away. They are often legitimate solutions that survive review and become shipped product changes. 

That is the standard that matters. 

What This Changed About Human Review 

This system did not eliminate human review. It made human review more effective and valuable. 

The old model forces humans to do too much mechanical reconstruction. Reviewers are asked to infer what happened from logs, code changes, and incomplete descriptions. A lot of engineering time gets consumed by rebuilding context. 

In the closed-loop model, the agent performs the repetitive middle: 

  • collect evidence 
  • group duplicates 
  • request RCA 
  • reproduce the issue 
  • confirm the root cause 
  • implement the fix 
  • run validation 
  • document the work 
  • raise the PR 

That lets the human focus on what humans are best at: Determining… 

  • does this diagnosis make sense? 
  • is this the right fix? 
  • is there a better architectural direction? 
  • should this change be released now? 

That is the real gain. It’s not “AI replacing engineers,” it’s better allocation of engineering judgment. 

The Bigger Pattern 

After seeing how effective this was for error resolution, the broader opportunity became obvious. 

This pattern extends well beyond Sentry-driven remediation. The same closed-loop architecture can be applied to: 

  • CI failure remediation 
  • reviewer-driven PR iteration 
  • regression follow-up 
  • environment drift detection 
  • quality enforcement workflows 
  • repetitive operational debugging across distributed systems 

Anywhere the cost is dominated by repetitive validation, evidence gathering, context transfer, and mechanical execution, there is an opportunity to build the same kind of loop: observe, reason, reproduce, fix, validate, escalate only where judgment is needed. 

That is where agentic automation becomes operational leverage instead of a demo. 

Final Thought 

The most valuable part of this system is not that it writes code. It is that it removes the human tax on moving evidence through the system. 

Engineers should spend their time making decisions, designing better systems, and applying judgment where it matters. They should not spend disproportionate time replaying the same incident workflow by hand because the tooling around them is too passive to help. 

Once agents can observe failures, reason about them, reproduce them in real environments, validate fixes through actual application interaction, and return structured work for human approval, the software delivery pipeline starts to look very different. 

That is the shift that matters. 

And after watching this system save roughly 840 engineering hours in 30 days, I do not think this is a novelty. I think it is an early version of how a meaningful amount of engineering work will operate going forward.

If you’re exploring how agentic systems can deliver real production outcomes, with the right validation, control, and guardrails, Cyclotron is here to help. Get in touch to discuss how closed‑loop engineering can fit into your environment. 

Topics covered in this blog include:

You might also like: