# Project export: AutoFix Swarm

This document was generated by HackStack to give an AI agent context about a hackathon project. Sections are labeled with their provenance; content marked as truncated was cut to keep this document small.

## Project metadata

- Hackathon: OpenAI Build Week
- Tagline: A multi-agent system that autonomously diagnoses software failures, generates targeted fixes, and verifies every patch before delivery.
- Devpost: https://devpost.com/software/autofix-swarm
- GitHub: https://github.com/builtbyrehan/autofix-swarm
- Demo: https://autofix-awarm.netlify.app/
- Video: https://player.vimeo.com/video/000000000?byline=0&portrait=0&title=0#t=
- Team: 6 GitHub contributor(s) — 1ehtishamtahir (27 commits), Rehan (26 commits), nivas0006 (7 commits), gulglitch (6 commits), Neha Goyal (5 commits), Claude Sonnet 5 (1 commits)

## Devpost submission (written by the team)

### Inspiration

Developers spend a large amount of time finding bugs, writing patches, running tests, and explaining changes during code review. AI can generate code quickly, but an unverified patch is difficult to trust. We built AutoFix Swarm to close that gap: an autonomous, explainable bug-remediation pipeline that detects issues, writes targeted fixes, verifies them against real tests, and presents the result in a developer-friendly dashboard.

### What it does

AutoFix Swarm coordinates three specialized agents: Watcher Agent scans a repository using semantic analysis and static-analysis signals to identify security, logic, and code-quality issues. Codex Fixer Agent reads the affected code and generates a focused patch while preserving the repository’s existing conventions and behavioral contracts. Reviewer Agent runs deterministic tests against the patched code and produces a grounded explanation based on the actual diff and test results. The dashboard displays: detected issues with severity and confidence; affected files and line ranges; attempted and successful fixes; changed files and patch summaries; test-verification results; complete pipeline timing and activity. The system also supports pasted code and uploaded source files for analysis.

### How we built it

The backend is built with Python and FastAPI. A LangGraph-style orchestration flow coordinates the Watcher, Fixer, and Reviewer stages. We used: GPT-5.6 for semantic bug analysis and evidence-grounded explanations; OpenAI Codex for generating and applying code fixes; Semgrep for deterministic static-analysis signals; pytest for behavioral verification; Docker for isolated local fix execution; SQLite for run history and pipeline logs; Next.js, React, TypeScript, and Tailwind CSS for the dashboard. The frontend is deployed on Netlify, while the hosted API health service is deployed on Vercel. The complete Docker-powered remediation pipeline is available through the repository’s local setup because hosted serverless environments do not provide the same long-running Docker execution model. Challenges we faced The main challenge was making AI-generated fixes reliable rather than merely plausible. A generated patch can look correct while breaking an existing function contract. During testing, one SQL-injection fix correctly parameterized a query but initially used a placeholder convention different from what the repository and tests expected. This reinforced an important design decision: the Fixer must inspect nearby tests and preserve project-specific conventions before modifying code. We also had to handle: long-running pipeline requests without leaving the interface permanently stuck; clear separation between live, cached, and offline results; safe execution of generated code; frontend and backend deployment limitations; consistent result aggregation across issues, fixes, and verdicts.

### Accomplishments we're proud of

Built an end-to-end multi-agent bug lifecycle. Detected all seven intentionally seeded issues in our evaluation repository. Generated targeted fixes rather than replacing entire files. Verified patches using deterministic behavioral tests. Kept GPT-5.6 explanations grounded in the actual diff and test evidence. Added Docker isolation for local code execution. Created a polished dashboard for inspecting the complete reasoning trace. Deployed a public frontend for judges and reviewers. Designed an explicit cached-data fallback that is never presented as a live model run.

### What we learned

We learned that reliable AI developer tools need more than a strong model. They need: explicit agent responsibilities; repository-aware prompts; deterministic test gates; safe execution boundaries; transparent failure states; honest distinction between live and cached results. The most valuable lesson was that tests are not simply the final step. They are part of the context that the fixing agent should understand before generating a patch.

### What's next

Next, we plan to add: asynchronous background jobs for production pipeline runs; GitHub repository import; automatic pull-request generation; retry and repair loops for rejected patches; multi-language repository support; CI/CD integrations; persistent cloud storage for run artifacts; team approvals and audit trails.

## README (from the GitHub repository)

<div align="center">

<img src="https://capsule-render.vercel.app/api?type=waving&color=0:1E1B4B,50:412991,100:00A67E&height=220&section=header&text=AutoFix%20Swarm&fontSize=64&fontColor=FFFFFF&fontAlignY=38&animation=fadeIn&desc=Find%20the%20bug.%20Fix%20the%20bug.%20Explain%20the%20fix.&descAlignY=58&descSize=20&descAlign=50" alt="AutoFix Swarm banner" width="100%" />

<img src="https://readme-typing-svg.demolab.com/?font=Fira+Code&size=18&pause=1200&color=8B5CF6&center=true&vCenter=true&width=780&lines=Three+agents.+One+bug+lifecycle.+Zero+manual+patching.;GPT-5.6+detects+%E2%86%92+Codex+fixes+%E2%86%92+GPT-5.6+explains.;100%25+detection+rate+on+7+seeded+bugs.;Sandboxed+in+Docker.+Verified+by+pytest." alt="Typing animation" />

An autonomous, explainable bug-detection and remediation pipeline — three specialized agents that scan a codebase, patch real issues with Codex, verify the fix against tests, and generate a plain-English explanation a human can trust and merge.

<img src="https://skillicons.dev/icons?i=py,fastapi,nextjs,react,ts,tailwind,docker,sqlite&theme=dark" alt="Python, FastAPI, Next.js, React, TypeScript, Tailwind CSS, Docker and SQLite" />

<p>
  <a href="https://github.com/builtbyrehan/autofix-swarm">
    <img src="https://img.shields.io/badge/Source-GitHub-181717?style=for-the-badge&logo=github&logoColor=white" alt="GitHub repository">
  </a>
  <a href="https://github.com/builtbyrehan/autofix-swarm/blob/main/README.md">
    <img src="https://img.shields.io/badge/Status-Pipeline_Verified-00C853?style=for-the-badge&logoColor=white" alt="Pipeline verified">
  </a>
  <a href="https://autofix-awarm.netlify.app">
    <img src="https://img.shields.io/badge/Live_Demo-Netlify-00C7B7?style=for-the-badge&logo=netlify&logoColor=white" alt="Live Netlify demo">
  </a>
  <a href="https://autofix-swarm-api.vercel.app/health">
    <img src="https://img.shields.io/badge/API-Vercel-000000?style=for-the-badge&logo=vercel&logoColor=white" alt="Vercel API">
  </a>
</p>

<p>
  <img src="https://img.shields.io/github/stars/builtbyrehan/autofix-swarm?style=flat-square&logo=github&color=FFD21E&logoColor=white&label=Stars" alt="GitHub stars">
  <img src="https://img.shields.io/github/forks/builtbyrehan/autofix-swarm?style=flat-square&logo=github&color=58A6FF&logoColor=white&label=Forks" alt="GitHub forks">
  <img src="https://img.shields.io/badge/Track-Developer_Tools-FF6B35?style=flat-square&logo=devpost&logoColor=white" alt="Developer Tools track">
  <img src="https://img.shields.io/badge/Detection_Rate-100%25-00C853?style=flat-square&logoColor=white" alt="Detection rate">
  <img src="https://img.shields.io/badge/Sandboxed-Docker-2496ED?style=flat-square&logo=docker&logoColor=white" alt="Docker sandbox">
</p>

</div>

Built for OpenAI Build Week — Codex Challenge

<div align="center">
  <a href="https://openai.com">
    <img src="https://img.shields.io/badge/OpenAI-Build_Week-412991?style=for-the-badge&logo=openai&logoColor=74AA9C" alt="OpenAI Build Week">
  </a>
  &nbsp;
  <a href="https://openai.com">
    <img src="https://img.shields.io/badge/Codex-Challenge-000000?style=for-the-badge&logo=openai&logoColor=00A67E" alt="Codex Challenge">
  </a>
  &nbsp;
  <a href="https://devpost.com">
    <img src="https://img.shields.io/badge/Devpost-Developer_Tools-003E54?style=for-the-badge&logo=devpost&logoColor=FF6B35" alt="Devpost">
  </a>
</div>

<p align="center">
Built for the <strong>OpenAI Build Week (Codex Challenge)</strong>, Devpost <strong>Developer Tools</strong> track. Required technologies: <strong>Codex</strong> + <strong>GPT-5.6</strong>.
</p>

[!IMPORTANT]Runtime roles are documented transparently. GPT-5.6 performs semantic bug detection and produces the final review explanation. Codex (with an OpenRouter fallback when the Codex CLI is unavailable) writes and applies every code fix. The fallback is disclosed in the tech stack and is never presented as a live Codex or GPT-5.6 call when it is replaying cached results.

Quick Links

Resource

URL

🚀 Live dashboard

autofix-awarm.netlify.app

❤️ Hosted API health

autofix-swarm-api.vercel.app/health

📘 Hosted API docs

autofix-swarm-api.vercel.app/docs

💻 Source code

github.com/builtbyrehan/autofix-swarm

⚙️ Local API docs

http://localhost:8000/docs

🖥️ Local dashboard

http://localhost:3000

🏆 Hackathon

OpenAI Build Week — Codex Challenge

📅 Deadline

July 21, 2026, 5:00 PM PT / July 22, 2026, 5:00 AM PKT

Table of Contents

Why AutoFix Swarm

Build Week Delivery Requirements

Core Capabilities

Architecture Overview

How the Pipeline Works

Technology Stack

Repository Structure

Seeded Bug Repo & Eval Harness

Pipeline Test Results

Deployment

Setup & Run Instructions

Environment Variables

API Reference

Success Criteria

Reliability & Safety Design

Demo Script

Submission Checklist

Explicit Non-Goals

Key Technical Decisions

Known Limitations

Roadmap

Acknowledgements

License

Why AutoFix Swarm?

Software teams generate bugs and security issues faster than humans can review and fix them. Today the loop is: a human notices an issue → a human decides how to fix it → a human writes the fix → another human reviews it. This is slow and doesn't scale.

AutoFix Swarm automates that loop with a small team of specialized agents. It finds real issues in a codebase, uses Codex to write the actual fix, verifies the fix against tests, and produces a plain-English explanation of why the fix was made — so a human can trust and merge it quickly instead of redoing the work.

One-line pitch: A system that finds its own bugs, fixes them with Codex, and explains why — so developers don't have to.

Value in 30 Seconds

Challenge

AutoFix Swarm response

Bug review is a human bottleneck

Three agents run detection, fixing, and verification end to end

Static analysis misses semantic bugs

GPT-5.6 catches SQL injection, auth flaws, and logic errors static tools miss

AI-written fixes are hard to trust

Every fix runs against real tests before it's called done

Black-box AI patches

Reviewer generates a plain-English explanation grounded in the diff and test result

Unsafe code execution

Fix generation and testing run inside a network-disabled Docker sandbox

Live API failure during a demo

A cached successful run replays as an explicit fallback, never disguised as live

Build Week Delivery Requirements (Verified)

Requirement

Status

Project built with Codex + GPT-5.6 in the Developer Tools category

✅ Done

Public YouTube demo, under 3 minutes, covering both Codex & GPT-5.6 usage

⬜ Pending

Public repository with licensing (or private + shared with testing@devpost.com and build-week-event@openai.com)

✅ Done

README with setup, sample data, run instructions, Codex collaboration, key decisions, GPT-5.6 contribution

✅ Done

/feedback Codex Session ID from the core-build thread

⬜ Pending

Installation instructions, supported platforms, judge testing path

✅ Done

Public hosted dashboard and API health endpoint

✅ Deployed

Core Capabilities

Explainable Bug Findings

Every detected issue includes:

file and line range;

severity and confidence score;

plain description of the issue;

category (security, logic, code quality).

Grounded Fix Explanations

GPT-5.6 receives the diff and the deterministic pytest result, not free rein to narrate the fix however it likes. The Reviewer explanation is generated from that evidence and never rewrites or second-guesses the patch itself.

Sandboxed Fix Execution

All fix generation and test execution happens inside a Docker sandbox: no network access, writes confined to a scratch copy of the repository.

Resilient Fallback

If a live API call fails mid-demo, a cached successful run replays instead of the pipeline breaking — and it is always labeled as cached, never presented as a live result.

Interactive Dashboard

The Next.js dashboard shows live and cached pipeline runs, per-agent status, and the full reasoning trace for a bug's lifecycle from detection throug

[README truncated for size]

## Detected evidence (automated analysis)

Indexed codebase: 127 recognized source files, 672 KB.
- CSS (language) — detected in the code
- FastAPI (technology) — detected in the code
- Next.js (technology) — detected in the code
- OpenAI (technology) — detected in the code
- Python (language) — detected in the code
- React (technology) — detected in the code
- Tailwind CSS (technology) — detected in the code
- TypeScript (language) — detected in the code
- Docker (technology) — claimed on Devpost, not found in the code
- Vercel (technology) — claimed on Devpost, not found in the code
- AI coding agent: Claude Code — evidence: commit authorship or trailers

## Codebase structure (from repository index)

### Files (120 of 144)

```
_run_pipeline_test.py
.env.example
.gitattributes
.github/workflows/ci.yml
.gitignore
agents/__init__.py
agents/fixer_codex.py
agents/README.md
agents/reviewer.py
agents/tests/__init__.py
agents/tests/test_fixer_codex.py
agents/tests/test_watcher.py
agents/watcher.py
backend/__init__.py
backend/config.py
backend/database.py
backend/demo_cache.py
backend/main.py
backend/models.py
backend/tests/__init__.py
backend/tests/test_api.py
backend/tests/test_database.py
eval/__init__.py
eval/README.md
eval/run_eval.py
eval/schemas/issue.schema.json
eval/schemas/seeded_bugs.schema.json
eval/schemas/verdict.schema.json
eval/seeded_bugs.json
eval/tests/test_run_eval.py
frontend/.env.example
frontend/.gitignore
frontend/.vscode/settings.json
frontend/ANIMATIONS.md
frontend/next.config.mjs
frontend/package.json
frontend/postcss.config.mjs
frontend/README.md
frontend/src/app/dashboard/page.tsx
frontend/src/app/globals.css
frontend/src/app/layout.tsx
frontend/src/app/page.tsx
frontend/src/app/results/[runId]/page.tsx
frontend/src/app/results/latest/page.tsx
frontend/src/components/AgentSection.tsx
frontend/src/components/AnimatedBackground.tsx
frontend/src/components/AnimatedCard.tsx
frontend/src/components/CounterAnimation.tsx
frontend/src/components/dashboard/AgentLogStream.tsx
frontend/src/components/dashboard/ControlPanel.tsx
frontend/src/components/dashboard/index.ts
frontend/src/components/dashboard/LiveMetrics.tsx
frontend/src/components/dashboard/RepoSourceSelector.tsx
frontend/src/components/dashboard/RunProgressBar.tsx
frontend/src/components/dashboard/StatusRadar.tsx
frontend/src/components/Hero.tsx
frontend/src/components/InfiniteScroll.tsx
frontend/src/components/landing/AgentShowcase.tsx
frontend/src/components/landing/Hero.tsx
frontend/src/components/landing/HeroScene3D.tsx
frontend/src/components/landing/LiveStatsStrip.tsx
frontend/src/components/layout/CosmicBackground.tsx
frontend/src/components/layout/Footer.tsx
frontend/src/components/layout/Header.tsx
frontend/src/components/layout/HomeChrome.tsx
frontend/src/components/layout/RouteTransition.tsx
frontend/src/components/layout/Starfield2D.tsx
frontend/src/components/layout/Starfield3D.tsx
frontend/src/components/MagneticButton.tsx
frontend/src/components/pipeline/AgentNode3D.tsx
frontend/src/components/pipeline/FlowLine.tsx
frontend/src/components/pipeline/FlowParticles3D.tsx
frontend/src/components/pipeline/OrchestratorCore3D.tsx
frontend/src/components/pipeline/PipelineGraph.tsx
frontend/src/components/pipeline/PipelineRenderer.tsx
frontend/src/components/pipeline/PipelineScene.tsx
frontend/src/components/results/DiffViewer.tsx
frontend/src/components/results/EvalScores.tsx
frontend/src/components/results/index.ts
frontend/src/components/results/IssueTimeline.tsx
frontend/src/components/results/RunSummary.tsx
frontend/src/components/results/VerdictPanel.tsx
frontend/src/components/SplitText.tsx
frontend/src/components/ui/AnimatedNumber.tsx
frontend/src/components/ui/Badge.tsx
frontend/src/components/ui/Button.tsx
frontend/src/components/ui/Elevation.ts
frontend/src/components/ui/HudPanel.tsx
frontend/src/components/ui/index.ts
frontend/src/components/ui/SeverityBadge.tsx
frontend/src/components/ui/Skeleton.tsx
frontend/src/components/ui/Spinner.tsx
frontend/src/components/ui/StatusDot.tsx
frontend/src/components/ui/Tilt3DCard.tsx
frontend/src/hooks/useHealth.ts
frontend/src/hooks/useLatestRun.ts
frontend/src/hooks/useMousePosition.ts
frontend/src/hooks/usePipelineRun.ts
frontend/src/lib/api.ts
frontend/src/lib/capability.ts
frontend/src/lib/easing.ts
frontend/src/lib/format.ts
frontend/src/lib/mockData.ts
frontend/src/lib/pageTransition.ts
frontend/src/lib/runTimeline.ts
frontend/src/lib/utils.ts
frontend/src/types/index.ts
frontend/tailwind.config.ts
frontend/tsconfig.json
important files/architecture.md
important files/branding-colors.md
important files/color-implementation.md
important files/design.md
important files/logo-prompt.md
important files/NEW-COLOR-SCHEME.md
important files/phases.md
important files/prd.md
important files/quick-color-reference.md
important files/rules.md
orchestrator/__init__.py
[24 more files omitted for size]
```

### Dependencies

- frontend/package.json: @gsap/react@^2.1.2, @radix-ui/react-icons@^1.3.0, @radix-ui/react-slot@^1.1.0, @react-three/drei@^10.7.7, @react-three/fiber@^9.6.1, @react-three/postprocessing@^3.0.4, @types/node@^20.14.0, @types/react@^18.3.0, @types/react-dom@^18.3.0, @types/react-is@^19.2.0, @types/three@^0.185.1, autoprefixer@^10.4.19, class-variance-authority@^0.7.0, clsx@^2.1.1, framer-motion@^12.42.2, gsap@^3.15.0, hls.js@^1.6.16, lucide-react@^0.424.0, next@^14.2.0, postcss@^8.4.38, react@^18.3.1, react-dom@^18.3.1, react-is@^19.2.7, recharts@^3.9.2, swr@^2.4.2, tailwind-merge@^2.5.0, tailwindcss@^3.4.4, tailwindcss-animate@^1.0.7, three@^0.185.1, typescript@^5.5.0
- pyproject.toml: fastapi@>=0.115.0, httpx@>=0.27.0, langchain-core@>=0.3.15, langgraph@>=0.2.45, openai@>=1.54.0, pydantic@>=2.9.0, pydantic-settings@>=2.6.0, pytest@>=8.3, python-multipart@>=0.0.9, uvicorn[standard]@>=0.32.0

### Recent commits (newest first)

- Update README with live deployment links
- fix watcher response handling and restore seeded bug fixtures
- fix: prevent [Errno 22] crash when stderr stream is invalid on Windows
- fix: wire paste/upload endpoints into full scan-fix-verify pipeline
- Merge branch 'main' of https://github.com/builtbyrehan/autofix-swarm
- fix: rename docs/assests -> docs/assets
- Update README.md
- docs: add asset SVGs for eval stats and pipeline
- Update README.md
- Update README.md
- Update README.md
- Update README.md
- fix: same stale-fixture bug in test_second_file_change_rejected
- fix: resolve CI backend-suite failures (sandbox permissions, stale test fixture)
- Merge pull request #3 from builtbyrehan/fix/backend-setup
- fix: stop leaking exception details in global error handler
- Merge main into fix/backend-setup
- chore: add hls.js dependency
- fix: replace native select language with themed dropdown
- fix: add missing HLS landing page background video

## Key source files (fetched from GitHub, selected and truncated for size)

### important files/branding-colors.md

```markdown
# AutoFix Swarm - Branding Colors

## Primary Brand Colors (Modern Dark Palette)
```css
--black: #000000          /* Pure Black - Main background */
--navy: #14213D           /* Dark Navy - Cards, surfaces, containers */
--yellow: #FCA311         /* Vibrant Yellow - PRIMARY CTA color */
--light-gray: #E5E5E5     /* Light Gray - Body text */
--white: #FFFFFF          /* Pure White - Headings, primary text */
```

## Severity Colors (Semantic - Keep for Functionality)
```css
--critical: #DC2626      /* Red - Security, crashes, critical bugs */
--warning: #F59E0B       /* Amber - Performance, deprecated code */
--caution: #EAB308       /* Yellow - Code smells, potential issues */
--info: #FCA311          /* Vibrant Yellow - Suggestions, best practices */
--success: #10B981       /* Emerald - Fixed bugs, passing tests */
```

## Base Colors (Dark Theme)
```css
--background: #000000        /* Pure Black - Main background */
--surface: #14213D           /* Dark Navy - Cards, panels */
--surface-elevated: rgba(20, 33, 61, 0.8)  /* Elevated navy with transparency */

--text-primary: #FFFFFF      /* Pure White - Headings, primary text */
--text-secondary: #E5E5E5    /* Light Gray - Body text */
--text-muted: rgba(229, 229, 229, 0.6)  /* Muted - Hints, labels */

--border: rgba(20, 33, 61, 0.5)     /* Navy borders */
--accent: #FCA311            /* Vibrant Yellow - Primary actions, links */
```

## Branding Guidelines

**Theme:** Autonomous bug detection & remediation
**Tone:** Professional, technical, modern, clean
**Visual Identity:** Sleek, dark, high-contrast aesthetic

**Logo Color:** #FCA311 (Vibrant Yellow) - for maximum visibility and brand consistency

**Color Usage:**
- Use severity colors **only** for bug status indicators  
- Pure black background (#000000) with optional gradient to navy (#14213D)
- Vibrant yellow (#FCA311) for logo, CTAs, and all primary interactions
- Navy (#14213D) for cards, surfaces, and containers
- White/light gray for text hierarchy
- High contrast for accessibility (WCAG AAA compliance)


```

### important files/logo-prompt.md

```markdown
# Logo Generation Prompt for AutoFix Swarm

## Prompt for DALL-E / GPT Image Generation

```
Create a professional, minimalist logo icon for "AutoFix Swarm" - an autonomous bug detection and remediation developer tool for software teams.

DESIGN CONCEPT:
- Combine the concepts of: autonomous agents (swarm intelligence), bug detection (magnifying glass/scanner), and automated code fixing (healing/repair)
- The logo should represent a collaborative swarm of AI agents working together to detect and fix code issues
- Visual metaphor: interconnected nodes/agents scanning and healing code bugs

STYLE REQUIREMENTS:
- Modern, clean, geometric design suitable for a SaaS developer tool
- International enterprise-grade quality (comparable to GitHub, Sentry, CircleCI, DataDog)
- Minimalist and scalable - must work at 16x16px (favicon) and large sizes
- Sharp, crisp edges with professional execution
- Icon-only design (NO text, NO wordmark, NO letters)
- Transparent background (PNG format)

VISUAL ELEMENTS TO INCORPORATE:
- Abstract representation of a "swarm" - suggest multiple agents/nodes working in coordination
- Subtle bug/issue detection symbolism (scanning, identification)
- Technical/developer aesthetic - geometric, systematic, precise
- Movement or flow to imply automation and intelligence

PRIMARY COLOR:
Use #F6AA1C (vibrant golden mustard) as the main color. This warm, confident gold will stand out beautifully on dark backgrounds. You may optionally use #D9A441 (honey bronze) as a subtle accent for depth, but prioritize a clean single-color approach.

TONE & FEEL:
- Trustworthy and reliable (this tool touches production code)
- Intelligent and sophisticated (AI-powered)
- Professional and technical (developer audience)
- Modern and forward-thinking (autonomous systems)

AVOID:
- Literal bug illustrations (no insects)
- Cutesy or playful aesthetics
- Complex illustrations or detailed drawings
- Gradients or soft shadows (keep it flat/minimal)
- Text, letters, or typography
- Backgrounds or colored fills behind the icon

TECHNICAL SPECS:
- Output as high-resolution PNG with transparent background
- Clean vector-style appearance (even if raster)
- Centered composition with balanced negative space
- Should work in monochrome (single color) as well as full color

INSPIRATION REFERENCE:
Think of logos like: Linear (geometric precision), Vercel (simple triangle), Framer (bold F shape), Stripe (diagonal lines), Railway (rail symbol) - simple, recognizable, professional.

The final logo should be instantly recognizable, convey "intelligent automation for code quality," and feel like it belongs alongside top-tier developer tools.
```

---

## Alternative Shorter Version

```
Design a minimalist logo icon for AutoFix Swarm, an AI-powered bug detection and remediation tool for developers.

Concept: Autonomous swarm of AI agents scanning and fixing code bugs - represent this through interconnected geometric nodes or abstract scanning pattern.

Style: Modern Saa
[truncated — 585 more characters]
```

### pyproject.toml

```
[build-system]
requires = ["setuptools>=68"]
build-backend = "setuptools.build_meta"


[tool.setuptools.packages.find]
include = ["backend*", "agents*", "orchestrator*", "sandbox*", "eval*"]


[project]
name = "autofix-swarm"
version = "0.1.0"
description = "Evaluated, sandboxed bug detection and remediation agents"
readme = "README.md"
requires-python = ">=3.11"
dependencies = [
    "fastapi>=0.115.0",
    "uvicorn[standard]>=0.32.0",
    "pydantic>=2.9.0",
    "pydantic-settings>=2.6.0",
    "openai>=1.54.0",
    "langgraph>=0.2.45",
    "langchain-core>=0.3.15",
    "python-multipart>=0.0.9",
]

[project.optional-dependencies]
test = [
    "pytest>=8.3",
    "httpx>=0.27.0",
]

[tool.pytest.ini_options]
pythonpath = ["seeded_repo/src", "agents", "sandbox"]
testpaths = ["seeded_repo/tests", "agents/tests", "backend/tests", "eval/tests", "sandbox/tests"]
addopts = "-q"
markers = [
    "integration: tests that require a working Docker daemon",
]

```

### frontend/package.json

```
{
  "name": "autofix-swarm-frontend",
  "version": "0.1.0",
  "private": true,
  "scripts": {
    "dev": "next dev",
    "build": "next build",
    "start": "next start",
    "lint": "next lint"
  },
  "dependencies": {
    "@gsap/react": "^2.1.2",
    "@radix-ui/react-icons": "^1.3.0",
    "@radix-ui/react-slot": "^1.1.0",
    "@react-three/drei": "^10.7.7",
    "@react-three/fiber": "^9.6.1",
    "@react-three/postprocessing": "^3.0.4",
    "@types/react-is": "^19.2.0",
    "class-variance-authority": "^0.7.0",
    "clsx": "^2.1.1",
    "framer-motion": "^12.42.2",
    "gsap": "^3.15.0",
    "hls.js": "^1.6.16",
    "lucide-react": "^0.424.0",
    "next": "^14.2.0",
    "react": "^18.3.1",
    "react-dom": "^18.3.1",
    "react-is": "^19.2.7",
    "recharts": "^3.9.2",
    "swr": "^2.4.2",
    "tailwind-merge": "^2.5.0",
    "tailwindcss-animate": "^1.0.7",
    "three": "^0.185.1"
  },
  "devDependencies": {
    "@types/node": "^20.14.0",
    "@types/react": "^18.3.0",
    "@types/react-dom": "^18.3.0",
    "@types/three": "^0.185.1",
    "autoprefixer": "^10.4.19",
    "postcss": "^8.4.38",
    "tailwindcss": "^3.4.4",
    "typescript": "^5.5.0"
  }
}

```

### backend/main.py

```python
"""FastAPI backend for AutoFix Swarm.

This module provides the REST API for the AutoFix Swarm system, exposing
endpoints to trigger scans, fixes, verifications, and retrieve results.
"""

from __future__ import annotations

import shutil
import time
import uuid
from contextlib import asynccontextmanager
from datetime import datetime, timezone
from pathlib import Path
from typing import Any, AsyncGenerator, Optional

from fastapi import Body, FastAPI, File, HTTPException, UploadFile, status
from fastapi.middleware.cors import CORSMiddleware
from fastapi.responses import JSONResponse

from backend.config import settings
from backend.database import db
from backend.models import (
    AgentStatus,
    FixRequest,
    FixResponse,
    HealthResponse,
    PipelineResult,
    PipelineRunRequest,
    PipelineRunResponse,
    PipelineStatus,
    ScanRequest,
    ScanResponse,
    VerifyRequest,
    VerifyResponse,
)

# ---------------------------------------------------------------------------
# FastAPI App Initialization
# ---------------------------------------------------------------------------

@asynccontextmanager
async def lifespan(app: FastAPI) -> AsyncGenerator[None, None]:
    """Application lifespan: startup then shutdown."""
    print("[startup] AutoFix Swarm API starting...")
    print(f"[startup] Target repo: {settings.target_repo_path_resolved}")
    print(f"[startup] Database: {db.db_path}")
    print(f"[startup] Codex available: {_check_codex_available()}")
    print(f"[startup] GPT-5.6 configured: {_check_gpt_available()}")
    print(f"[startup] API docs: http://{settings.api_host}:{settings.api_port}/docs")
    yield
    print("[shutdown] AutoFix Swarm API shutting down...")


app = FastAPI(
    title="AutoFix Swarm API",
    description="Autonomous bug detection and remediation agents",
    version="0.1.0",
    docs_url="/docs",
    redoc_url="/redoc",
    lifespan=lifespan,
)

# Add CORS middleware
app.add_middleware(
    CORSMiddleware,
    allow_origins=settings.cors_origins,
    allow_credentials=True,
    allow_methods=["*"],
    allow_headers=["*"],
)


# ---------------------------------------------------------------------------
# Helper Functions
# ---------------------------------------------------------------------------


def _check_codex_available() -> bool:
    """Check if Codex CLI is available."""
    try:
        from agents.fixer_codex import CodexCliRunner

        runner = CodexCliRunner()
        return runner.is_available()
    except Exception:
        return False


def _check_gpt_available() -> bool:
    """Check if GPT-5.6 API is configured."""
    return bool(settings.openai_api_key)


def _get_repo_path(override: Optional[str] = None) -> Path:
    """Get repository path with optional override."""
    if override:
        return Path(override).resolve()
    return settings.target_repo_path_resolved


def _run_full_pipeline(
    *,
    repo_path: Path,
    run_id: str,
    use_semgrep: bool,
    use_gpt: bool,
    max_issues: Optional[int] = None,
    auto_fix_threshold: float = 0.7,
):
    """Run Watcher -> Codex Fixer -> Reviewer and persist all results.

    Shared by /run, /run/custom, /run/custom/upload, and /upload so every
    entry point produces fixes and a plain-English verdict explanation,
    not just a list of detected issues.

    Returns:
        The completed PipelineState (issues/fixes/verdicts already saved to db).
    """
    from orchestrator.graph import Pipeline, PipelineConfig

    pipeline_config = PipelineConfig(
        repo_path=repo_path,
        use_semgrep=use_semgrep,
        use_gpt=use_gpt,
        max_issues=max_issues,
        auto_fix_threshold=auto_fix_threshold,
        artifacts_dir=settings.artifacts_dir,
        openai_api_key=settings.openai_api_key,
        openai_base_url=settings.openai_base_url,
        openai_model=settings.openai_model,
    )

    pipeline = Pipeline()
    state = pipeline.run(pipeline_config, run_id=run_id)

    if state.watcher_result:
        for issue in state.watcher_result.issues:
            db.save_issue(
                issue_id=issue.id,
                run_id=run_id,
                file=issue.file,
                line_start=issue.line_range["start"],
                line_end=issue.line_range["end"],
                description=issue.description,
                severity=issue.severity,
                confidence=issue.confidence,
                detectors=issue.detectors,
            )

    issue_to_fix_id: dict[str, str] = {}
    for fix_result in state.fix_results:
        fix_id = str(uuid.uuid4())
        issue_to_fix_id[fix_result.issue_id] = fix_id
        db.save_fix(
            fix_id=fix_id,
            issue_id=fix_result.issue_id,
            run_id=run_id,
            status=fix_result.status,
            codex_live=fix_result.codex_live,
            summary=fix_result.summary,
            changed_files=fix_result.changed_files,
            diff_text=fix_result.diff,
            artifact_path=(
                str(fix_result.artifact_path) if fix_result.artifact_path else None
            ),
            duration_seconds=fix_result.duration_seconds,
            failure_reason=fix_result.failure_reason,
        )

    for review_result in state.review_results:
        fix_id = issue_to_fix_id.get(review_result.verdict.issue_id, "")
        db.save_verdict(
            verdict_id=str(uuid.uuid4()),
            fix_id=fix_id,
            issue_id=review_result.verdict.issue_id,
            run_id=run_id,
            status="succeeded",
            tests_passed=review_result.verdict.tests_passed,
            explanation=review_result.verdict.explanation,
            confidence=review_result.verdict.confidence,
            duration_seconds=review_result.duration_seconds,
        )

    db.update_pipeline_run(
        run_id=run_id,
        status=state.status,
        issues_found=state.issues_found,
        fixes_attempted=state.fixes_attempted,
        fixes_succee
[truncated — 32954 more characters]
```

### frontend/src/app/layout.tsx

```typescript
import type { Metadata } from "next";
import { Inter } from "next/font/google";
import "./globals.css";

const inter = Inter({
  subsets: ["latin"],
  variable: "--font-sans",
});

export const metadata: Metadata = {
  title: "AutoFix Swarm — Autonomous Bug Detection & Remediation",
  description:
    "Three agents. One pipeline. Watcher finds it, Codex fixes it, Reviewer proves it — with no human in the loop.",
};

export default function RootLayout({
  children,
}: Readonly<{
  children: React.ReactNode;
}>) {
  return (
    <html lang="en" className="dark">
      <body
        className={`${inter.variable} font-sans antialiased bg-[#050505] text-[#fafafa]`}
      >
        {children}
      </body>
    </html>
  );
}

```

### frontend/src/types/index.ts

```typescript
export interface HealthStatus {
  status: string;
  version: string;
  codex_available: boolean;
  gpt_available: boolean;
  database_connected: boolean;
  timestamp: string;
}

export interface Issue {
  id: string;
  file: string;
  line_range: {
    start: number;
    end: number;
  };
  description: string;
  severity: "critical" | "high" | "medium" | "low";
  confidence: number;
  detectors: string[];
  latency_ms?: number;
}

export interface Fix {
  fix_id: string;
  issue_id: string;
  status: "succeeded" | "failed" | "blocked" | "rejected";
  codex_live: boolean;
  summary: string;
  changed_files: string[];
  diff_preview?: string;
  artifact_path?: string;
  duration_seconds: number;
  failure_reason?: string;
  timestamp: string;
}

export interface Verdict {
  verdict_id: string;
  fix_id: string;
  issue_id: string;
  status: string;
  tests_passed: boolean;
  explanation: string;
  confidence: number;
  duration_seconds: number;
  timestamp: string;
}

export interface PipelineRun {
  run_id: string;
  status: "idle" | "scanning" | "fixing" | "verifying" | "completed" | "failed";
  issues_found: number;
  fixes_attempted: number;
  fixes_succeeded: number;
  verifications_passed: number;
  total_duration_seconds: number;
  message?: string;
  timestamp: string;
  started_at?: string;
  completed_at?: string;
}

export interface PipelineResult {
  run_id: string;
  status: string;
  scan_result?: {
    scan_id: string;
    status: string;
    issues_found: number;
    duration_seconds: number;
    message: string;
  };
  fix_results: Fix[];
  verify_results: Verdict[];
  total_duration_seconds: number;
  started_at: string;
  completed_at?: string;
}

export interface ScanRequest {
  repo_path?: string;
  use_semgrep?: boolean;
  use_gpt?: boolean;
  max_issues?: number;
}

export interface PipelineRunRequest {
  repo_path?: string;
  use_semgrep?: boolean;
  use_gpt?: boolean;
  max_issues?: number;
  auto_fix_threshold?: number;
}

export interface CustomCodeRunRequest {
  code?: string;
  repo_path?: string;
  use_semgrep?: boolean;
  use_gpt?: boolean;
  max_issues?: number;
  language?: string;
}

export type DataSource = "live" | "cached" | "mock" | "demo";
export type PipelineStage = "idle" | "scanning" | "fixing" | "verifying" | "completed";

export type SeverityLevel = "critical" | "high" | "medium" | "low";

export interface EvalScores {
  bugs_planted: number;
  bugs_found: number;
  detection_rate: number;
  verified_fixes_passed: number;
  fix_success_rate: number;
  false_positive_count: number;
  average_recorded_latency_ms: number;
}

export type AgentName = "watcher" | "codex" | "reviewer";

export interface AgentLogEntry {
  id: string;
  ts: string;
  timestamp?: string;
  level: "info" | "warn" | "error" | "debug" | "success";
  agent: AgentName;
  stage?: string;
  message: string;
}

```

### frontend/src/components/results/index.ts

```typescript
export { RunSummary } from "./RunSummary";
export { EvalScores } from "./EvalScores";
export { IssueTimeline } from "./IssueTimeline";
export { DiffViewer } from "./DiffViewer";
export { VerdictPanel } from "./VerdictPanel";

```

### frontend/src/components/dashboard/index.ts

```typescript
export { ControlPanel } from "./ControlPanel";
export { RunProgressBar } from "./RunProgressBar";
export { LiveMetrics } from "./LiveMetrics";
export { AgentLogStream } from "./AgentLogStream";
export { StatusRadar } from "./StatusRadar";
export { RepoSourceSelector } from "./RepoSourceSelector";
export type { CodeSource, CustomCodeState } from "./RepoSourceSelector";

```

### frontend/src/components/ui/index.ts

```typescript
// UI primitives barrel — import from "@/components/ui"
export { HudPanel } from "./HudPanel";
export type { HudPanelProps, GlowState } from "./HudPanel";

export { Tilt3DCard } from "./Tilt3DCard";
export type { Tilt3DCardProps } from "./Tilt3DCard";

export { Button, buttonVariants } from "./Button";
export type { ButtonProps } from "./Button";

export { Badge, badgeVariants } from "./Badge";
export type { BadgeProps } from "./Badge";

export { StatusDot } from "./StatusDot";
export type { StatusState } from "./StatusDot";

export { Spinner } from "./Spinner";

export { Skeleton } from "./Skeleton";

export { AnimatedNumber } from "./AnimatedNumber";

export { SeverityBadge } from "./SeverityBadge";

export { getElevationClass, getElevationZ, ELEVATION_CLASS, ELEVATION_BORDER_BRIGHTNESS, ELEVATION_Z } from "./Elevation";
export type { ElevationTier } from "./Elevation";

```

[112 more indexed source files omitted to keep this export small. The full file list is in the Codebase structure section above.]