Metadata-Version: 2.4
Name: repo-surgeon
Version: 1.0.0
Summary: Autonomous Code Operating Theater & Self-Healing Swarm
Home-page: https://github.com/reposurgeon/repo-surgeon
Author: Antigravity Swarm
Author-email: Antigravity Swarm <contact@reposurgeon.dev>
License: MIT
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Requires-Dist: fastapi>=0.115.0
Requires-Dist: uvicorn[standard]>=0.30.0
Requires-Dist: pydantic>=2.8.0
Requires-Dist: pytest>=8.3.0
Requires-Dist: gitpython>=3.1.43
Requires-Dist: websockets>=13.0
Requires-Dist: aiofiles>=24.1.0
Requires-Dist: httpx>=0.27.0
Dynamic: author
Dynamic: home-page
Dynamic: requires-python

# 🩺 Repo Surgeon (Autonomous Bug-Hunter & Self-Healing Swarm)

> An autonomous agent that ingests crash traces and bug reports, boots up an isolated sandbox, writes reproducing regression tests, diagnoses the root cause, patches the codebase, and submits verified Pull Requests.

---

## ⚡ What it Does

1. **Bug Ingestion**: Hooks into GitHub Issues, Sentry alerts, or Datadog trace logs.
2. **Containerized Sandbox**: Clones repo at the exact failing commit and runs within an isolated environment.
3. **Reproduction Test Generator**: Synthesizes a minimal failing test (Pytest/Jest/Mocha) proving the presence of the bug.
4. **AST & Call Stack Diagnostician**: Traces the execution path to pinpoint buggy modules and logical flaws.
5. **Patch & Verification Agent**: Generates a clean code fix, runs the test suite to confirm the failing test now passes and regressions are 0.
6. **PR Publisher**: Automatically submits a GitHub PR with reproduction proof, root-cause explanation, and test diffs.

---

## 📁 Project Structure

```
repo-surgeon/
├── src/
│   ├── listener/
│   │   └── webhook_receiver.py    # Sentry & GitHub webhook ingestion
│   ├── sandbox/
│   │   └── docker_runner.py       # Sandboxed isolated reproduction runner
│   ├── agents/
│   │   ├── triage_agent.py        # Error trace & issue extractor
│   │   ├── repro_agent.py         # Failing test synthesizer
│   │   ├── patcher_agent.py       # Code diff generator & fixer
│   │   └── verifier_agent.py      # Test validation & PR author
│   └── orchestrator.py            # End-to-end swarm coordinator
├── tests/
└── README.md
```
