Multi-Agent Coding: Reducing Regression in Multi-Turn Builds (3,500+ LOC in 22m 58s Active Time, 14/14 CI)

Following up on my previous 12-run ablation study on test integrity and read-only subagent isolation, I wanted to share another engineering result from today.

One recurring problem with AI-assisted frontend development is regression across multiple turns. Adding a modal in one iteration or a scroll listener in the next can unintentionally break existing layouts, event bindings, or application state.

To examine this problem, I used my three-agent closed-loop governance architecture—Orchestrator, Sandbox Worker, and Read-Only Auditor—to build and incrementally extend an interactive, SCADA-style technical portfolio.

The objective was not simply to generate code faster. It was to see whether explicit pre-execution contracts, isolated implementation, and independent verification could keep incremental changes from destabilizing existing functionality.


:bar_chart: What the Build Delivered

  • Active agent coding time: 22 minutes, 58 seconds across three incremental tasks.
  • End-to-end elapsed time: 1 hour, 11 minutes (including independent audit passes and cloud CI/CD deployment).
  • Code output: 3,500+ LOC across semantic HTML5, custom CSS (1,543 LOC), vanilla JavaScript state machines, automated integrity gates, and three self-hosted technical papers.
  • Observed regression and rollback rate: 0% during this three-task build.

:stopwatch: Three Incremental Tasks (Verifiable via Git History)

Turn 1 — Setpoint Freezing & Initial Build

  • Commit: 889a594 | Agent coding time: 10m 39s (+2,671 LOC)
  • The initial build started with seven predefined structural sections, explicit DOM ID contracts, and negative constraints established before implementation.
  • The delivery included the main interface, custom styling, application logic, and six zero-bare-assert structural integrity checks (test_portfolio_integrity.py).

Turn 2 — Additive Extension (Strangler Pattern)

  • Commit: 9c4d8e3 | Agent coding time: 9m 36s (+843 LOC)
  • Added a self-hosted technical paper reader with a modal interface and three full markdown papers.
  • The extension was strictly constrained to preserve the existing Q1–Q4 simulator logic. The resulting diff confirmed 0-Diff impact on existing simulator bindings.

Turn 3 — ScrollSpy Telemetry & Cloud CI Verification

  • Commit: 2d81995 | Agent coding time: 2m 43s
  • The final increment added scroll-position radar indicators and triggered a 14-job GitHub Actions workflow (including 11 CVE differential reproductions and negative tampering checks).
  • All 14/14 CI jobs passed on the first push.

:shield: Why This Matters for Multi-Agent IDE Design

The important result is not the volume of generated code, but how the workflow was controlled. My approach separates three responsibilities:

  1. Orchestration: Defines task boundaries, file-level contracts, and acceptance conditions prior to execution.
  2. Implementation: Operates strictly within a constrained workspace.
  3. Independent Verification: Audits the resulting changes via physical read-only isolation and deterministic AST/DOM gates without relying on the implementer’s self-assessment.

This does not prove that regressions are impossible—three successful increments are a bounded sample, and passing CI gates only establishes what those gates explicitly test. However, the build provides a concrete, inspectable example of how external governance can control incremental AI-generated changes.

Instead of asking an AI agent to “be more careful” via prompts, we can engineer the workflow so that contract violations and regressions are deterministically blocked before state transitions occur.


:link: Inspect the Public Evidence

(Note: The public repository contains the delivered artifacts and deterministic verification gates for public reproduction, while the external orchestration engine is maintained separately.)

I am particularly interested in how these fail-closed principles could be integrated into IDE-native subagent workflows without sacrificing implementation speed or verification independence.

Hey, thanks for sharing this. It’s good that everything can be checked through commits and CI, and that you’re being upfront about the sample size being small.

You can build most of this setup with what Cursor already has:

  • Orchestrator is the parent agent. It makes sense to define the contracts there, like task boundaries, DOM IDs, and negative constraints, in Plan mode and in rules before implementation starts.
  • Sandbox Worker is a subagent running in a separate worktree. That keeps changes isolated from the main tree until review: Worktrees | Cursor Docs
  • Read-Only Auditor is a subagent in .cursor/agents/ with readonly: true in the frontmatter. You can call it directly, for example /auditor verify the diff against the contract: Subagents | Cursor Docs
  • Deterministic gates are better handled with hooks, not prompts: Hooks | Cursor Docs. afterFileEdit and subagentStop can run your AST or DOM checks, preToolUse can block writes to files outside the contract, and stop with loop_limit can send the agent back for fixes until the gate passes. That’s basically fail-closed behavior at the harness level, without relying on the model to be more careful.

One note though. If you plan to ship the auditor through a plugin, readonly: true does not apply there right now. For plugin-shipped agents, you need permissionMode: readonly. Details are here: `readonly: true` is not applied to plugin-shipped subagents (works in .cursor/agents/)

If you try moving part of your external orchestration engine into hooks and subagents, it’d be interesting to hear where you hit limits. That kind of feedback would be worth posting in a separate thread in Feature Requests.