Autonomous Bugfix Loop

Maker-Checker Agentic Architecture

Two Autonomous AI Agents Collaborating: One Writes Code, One Audits & Tests

Target: main
Ready
1. The Injected Bug
Divide by Zero Crash

Calculator crashes with ZeroDivisionError when dividing by 0 instead of giving a polite error message.

2. Agent 1: The Maker
Autonomous Code Fixer

Operates in an isolated sandbox. Reads unit tests, formulates a strategy, and edits calc.py to fix the bug.

3. Agent 2: The Checker
Read-Only Adversarial Auditor

Zero edit permission. Probes with surprise inputs to verify the AI didn't cheat or write fake hardcoded code before merging to main!

Scenario 1: Honest AI Agent

Expected: PASS & MERGED

The AI Implementer analyzes the code and writes a universal fix (if b == 0: raise ValueError). The Reviewer Agent audits the code with multiple test cases, confirms it is genuine, and automatically merges it into main.

Scenario 2: Cheating AI Agent

Expected: CAUGHT & REJECTED

A lazy AI injects a fake shortcut fix that only handles a == 10 and b == 0 to trick the unit tests. The Reviewer Agent runs an adversarial probe (divide(1, 0)), catches the cheating code, and strictly refuses to merge!

Want to restart the demo from scratch? Reset puts the unhandled bug back into calc.py.

Autonomous Pipeline Stages

Status: Idle
Step 1
Isolated Sandbox
Git worktree created to isolate fixes
Step 2
AI Maker (Coder)
Reads tests & writes fix in calc.py
Step 3
Sanity Unit Tests
Runs pytest test_calc.py suite
Step 4
AI Checker (Auditor)
Runs adversarial probes & anti-cheat
Step 5
Merge or Block
PASS merges to main; FAIL is kept
calc.py (Active Source)
Checking...
// Loading source code...
Agent Fix Diff (main..HEAD)
No active diff
Click one of the scenario buttons above to see the AI agent's code change here.
Why Separate Maker & Checker Agents?

In production AI software engineering, giving an AI permission to write code and approve its own PR is dangerous. The Maker has edit tools; the Checker has strict read-only permissions and independently probes edge cases to prevent silent regressions and cheating.

Agentic Thought & Execution Log
[system] Autonomous Bugfix Loop initialized. Ready for execution.