Autonomous Software QA & Surgical Refactoring Agent
"Give it a broken repository. It finds, fixes, tests, and verifies the solution."
AutoFixer AI takes a repository with failing tests, discovers structure, executes tests in an isolated sandbox, diagnoses root causes, generates surgical git diffs, reflects on partial failures, and self-corrects until all tests pass with 98β99% precision.
- π€ Autonomous Dynamic Agent Loop: No chatbot wrappers or hardcoded flows. The agent inspects real sandbox test outputs, searches code, reads files, and formulates AST-guided hypotheses.
- π Visible Reflection & Self-Correction: Implements structured reflections on partial failures (
Observation β Hypothesis β Why Failed β Corrected Plan) to self-recover and achieve 100% test pass. - π‘οΈ 98β99% Precision & Codebase Integrity:
- AST Pre-Patch Syntax Validation (
ast.parse()): Eliminates 100% of syntax errors before writing to disk. - Automated Regression Detection & Rollback: Detects worsening test failures and automatically reverts changes to protect codebase stability.
- Traceback-Guided Error Localization: Pinpoints exact failing methods and line slices.
- AST Pre-Patch Syntax Validation (
- π Flexible Repo Modes & Auto-Detection:
- β¨ Demo Repo Mode: 1-click evaluation of seeded multi-stage defects with zero setup.
- π Custom Repo Mode: Accepts any GitHub URL (
https://github.com/username/project) with Automatic Test Framework Detection (Pythonpytest/unittest, Node.jsnpm test, Javamvn test) or optional custom command overrides.
- π‘οΈ Reconciled Sandbox Security: Process-level isolation with secret stripping, directory scoping, hard wall-clock timeouts, and process tree termination.
- π» Real-Time Developer Dashboard: Dark developer-tool UI featuring live state badges, chronological event timeline, monospace raw terminal stream, interactive git diff visualizer, insights panel, and downloadable post-mortem audit reports.
GOAL (Broken Repository)
β
PLAN
β
USE TOOLS
β
EXECUTE
β
OBSERVE
β
REFLECT
β
CORRECT
β
RETEST
β
VERIFIED β
graph TD
User([Developer / Judge UI]) -->|1. Submit Repo / Demo Repo| API[FastAPI Backend]
API -->|2. Launch Orchestrator| Agent[Agent Orchestrator Loop]
subgraph Sandbox Isolation Layer
ProcBox[Process-Level Sandbox<br/>- Secret Stripping<br/>- Directory Scoping<br/>- Hard Timeout]
end
Agent -->|Tool Calls| Tools[17 Explicit Tools]
Tools -->|Execute| ProcBox
ProcBox -->|Exit Code, Stdout, Stderr| Tools
Tools -->|Tool Results| Agent
Agent -->|WebSocket Streaming| UIStream[Real-Time WebSocket Stream]
UIStream -->|Events, Diffs, Terminal, State| User
| Category | Tools | Description |
|---|---|---|
| Git Operations | clone_repository, git_diff, git_status, rollback_changes |
Safe repo clone, working branch (autofixer/attempt-N), diff inspection, automated regression rollback. |
| File Operations | list_files, read_file, write_file, search_code, inspect_project |
Directory traversal, slice-based reading, regex grep, structure inspection. |
| Testing | detect_test_framework, install_dependencies, run_tests, run_specific_test |
Auto-detects pytest/unittest/npm/maven, dependency installer, parsed pass/fail counts and stack traces. |
| Analysis & Patches | run_linter, run_static_analysis, apply_patch |
Flake8/AST syntax validation, surgical diff application. |
| Reporting | create_report |
Compiles structured post-mortem summary and downloadable markdown/JSON. |
- Python 3.10+
- Node.js 18+
- Git
git clone https://github.com/autofixer/autofixer-ai.git
cd autofixer-ai
cp .env.example .envcd backend
python -m pip install -r requirements.txt
python -m uvicorn app.main:app --host 0.0.0.0 --port 8000 --reloadcd ../frontend
npm install
npm run devOpen http://localhost:5180 in your browser.
- Import your repository on Vercel.
- Set Root Directory to
frontend. - In Environment Variables, configure:
VITE_API_URL: URL of your deployed backend (e.g.https://autofixer-api.onrender.com).
- Click Deploy.
The backend executes dynamic test suites in sandboxes and requires a persistent container service with WebSocket support:
- Render / Railway: Deploy as a Web Service from the repo using
docker/Dockerfile.backend(or Python rootbackend, command:uvicorn app.main:app --host 0.0.0.0 --port $PORT). - Environment Variables:
GEMINI_API_KEY: Your Gemini API key.LLM_PROVIDER:gemini(oropenai/anthropic).
To launch the complete stack with a single command:
docker-compose up --build- Frontend UI:
http://localhost:3000 - Backend API & Docs:
http://localhost:8000/docs
Run backend unit and integration tests:
cd backend
python -m pytest tests -vBuild verification for frontend:
cd frontend
npm run build- Open the UI at
http://localhost:5180(orhttp://localhost:3000). - Mode is set to "Demo Repo" by default. Click "Start Agent".
- Observe the live autonomous loop:
- Step 1: Clones repo and runs baseline tests: reports 4 Passed, 2 Failed.
- Step 2: Formulates hypothesis for arithmetic operator bug and applies Patch 1.
- Step 3: Retests: reports 5 Passed, 1 Failed.
- Step 4 (Reflection): Reflection panel activates, explaining that Patch 1 was partial and outlining the corrective plan for tokenizer delimiters.
- Step 5: Applies Patch 2 and retests: reports 6 Passed, 0 Failed (100% Pass!).
- Step 6: Post-Mortem banner appears with downloadable Markdown and JSON reports.
- Secret Stripping: All child processes have API keys, tokens, and credentials scrubbed from their environment variables.
- Directory Jailing: Child executions are strictly confined within temporary workspace directories.
- Hard Execution Limits: Non-responsive test runs are killed via process tree termination after 60 seconds.
MIT License. See LICENSE for details.