# tejashiv/agentic-test-repair-system architecture

> Architecture diagram of the GitHub repository tejashiv/agentic-test-repair-system, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-02). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/tejashiv/agentic-test-repair-system
- Repository: https://github.com/tejashiv/agentic-test-repair-system

## Overview

This is an agentic test-repair tool: a developer points it at a project, the tool selects failing tests and their source files, asks a model for a repair, applies it, and reruns tests until they pass or attempts run out. The main entry point also supports explicit file pairs, dry runs, and reporting; a separate script runs the QuixBugs benchmark. The excerpts show the core calls and reporting/template wiring. Discovery details and some report-generation links rely on README documentation; unsampled implementation is not inferred beyond that evidence.

Main entry points: [`agent.py`](https://github.com/tejashiv/agentic-test-repair-system/blob/main/agent.py) (Repair agent), [`repair.py`](https://github.com/tejashiv/agentic-test-repair-system/blob/main/repair.py) (Repair entry point), [`quixbugs_runner.py`](https://github.com/tejashiv/agentic-test-repair-system/blob/main/quixbugs_runner.py) (QuixBugs benchmark), [`runner.py`](https://github.com/tejashiv/agentic-test-repair-system/blob/main/runner.py) (Test runner)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflow["Repair workflow"]
  node_repair_cli["Repair entry point<br/>[repair.py]"]
  node_test_selection["Test discovery and pairing<br/>[repair.py]"]
end

subgraph group_repair["Repair engine"]
  node_agent["Repair agent<br/>[agent.py]"]
  node_repair_prompt["Repair instructions<br/>[prompt.txt]"]
  node_test_runner["Test runner<br/>[runner.py]"]
end

subgraph group_reporting["Reports"]
  node_report_builder["Report generation<br/>[repair.py]"]
  node_dashboard_template["Dashboard template"]
end

subgraph group_benchmark["Benchmark"]
  node_benchmark_runner["QuixBugs benchmark<br/>[quixbugs_runner.py]"]
  node_benchmark_results["Benchmark summary<br/>[quixbugs_runner.py]"]
end

node_developer(("Developer"))
node_project["Target project"]
node_pytest["pytest"]
node_gemini{{"Gemini model"}}

node_developer -->|"starts repair"| node_repair_cli
node_repair_cli -->|"discovers or accepts"| node_test_selection
node_test_selection -->|"selects files"| node_project
node_repair_cli -->|"runs tests"| node_test_runner
node_repair_cli -->|"repairs failures"| node_agent
node_agent -->|"runs tests"| node_test_runner
node_agent -->|"loads instructions"| node_repair_prompt
node_agent -->|"reads and writes source"| node_project
node_agent -->|"requests repair"| node_gemini
node_test_runner -->|"invokes"| node_pytest
node_test_runner -->|"tests in directory"| node_project
node_repair_cli -->|"builds summary"| node_report_builder
node_report_builder -->|"uses template"| node_dashboard_template
node_developer -->|"starts benchmark"| node_benchmark_runner
node_benchmark_runner -->|"repairs benchmark cases"| node_agent
node_benchmark_runner -->|"summarizes outcomes"| node_benchmark_results
node_benchmark_runner -->|"uses template"| node_dashboard_template

click node_repair_cli "https://github.com/tejashiv/agentic-test-repair-system/blob/main/repair.py"
click node_test_selection "https://github.com/tejashiv/agentic-test-repair-system/blob/main/repair.py"
click node_agent "https://github.com/tejashiv/agentic-test-repair-system/blob/main/agent.py"
click node_repair_prompt "https://github.com/tejashiv/agentic-test-repair-system/blob/main/prompt.txt"
click node_test_runner "https://github.com/tejashiv/agentic-test-repair-system/blob/main/runner.py"
click node_report_builder "https://github.com/tejashiv/agentic-test-repair-system/blob/main/repair.py"
click node_dashboard_template "https://github.com/tejashiv/agentic-test-repair-system/blob/main/dashboard_template.py"
click node_benchmark_runner "https://github.com/tejashiv/agentic-test-repair-system/blob/main/quixbugs_runner.py"
click node_benchmark_results "https://github.com/tejashiv/agentic-test-repair-system/blob/main/quixbugs_runner.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_repair_cli,node_test_selection toneBlue
class node_agent,node_repair_prompt,node_test_runner toneAmber
class node_report_builder,node_dashboard_template toneMint
class node_benchmark_runner,node_benchmark_results toneRose
class node_developer,node_project,node_pytest,node_gemini toneIndigo
```

## Components

### Repair workflow

- [Repair entry point](https://github.com/tejashiv/agentic-test-repair-system/blob/main/repair.py): `repair.py`
- [Test discovery and pairing](https://github.com/tejashiv/agentic-test-repair-system/blob/main/repair.py): `repair.py`

### Repair engine

- [Repair agent](https://github.com/tejashiv/agentic-test-repair-system/blob/main/agent.py): `agent.py`
- [Repair instructions](https://github.com/tejashiv/agentic-test-repair-system/blob/main/prompt.txt): `prompt.txt`
- [Test runner](https://github.com/tejashiv/agentic-test-repair-system/blob/main/runner.py): `runner.py`

### Reports

- [Report generation](https://github.com/tejashiv/agentic-test-repair-system/blob/main/repair.py): `repair.py`
- [Dashboard template](https://github.com/tejashiv/agentic-test-repair-system/blob/main/dashboard_template.py): `dashboard_template.py`

### Benchmark

- [QuixBugs benchmark](https://github.com/tejashiv/agentic-test-repair-system/blob/main/quixbugs_runner.py): `quixbugs_runner.py`
- [Benchmark summary](https://github.com/tejashiv/agentic-test-repair-system/blob/main/quixbugs_runner.py): `quixbugs_runner.py`

### Other components

- **Developer**
- **Target project**
- **pytest**
- **Gemini model**

## Connections

- Developer → Repair entry point: starts repair (evidence: `README.md`)
- Repair entry point → Test discovery and pairing: discovers or accepts (evidence: `README.md`)
- Test discovery and pairing → Target project: selects files (evidence: `README.md`)
- Repair entry point → Test runner: runs tests (evidence: `repair.py`)
- Repair entry point → Repair agent: repairs failures (evidence: `repair.py`)
- Repair agent → Test runner: runs tests (evidence: `agent.py`)
- Repair agent → Repair instructions: loads instructions (evidence: `agent.py`)
- Repair agent → Target project: reads and writes source (evidence: `agent.py`)
- Repair agent → Gemini model: requests repair (evidence: `agent.py`)
- Test runner → pytest: invokes (evidence: `runner.py`)
- Test runner → Target project: tests in directory (evidence: `runner.py`)
- Repair entry point → Report generation: builds summary (evidence: `repair.py`)
- Report generation → Dashboard template: uses template (evidence: `repair.py`)
- Developer → QuixBugs benchmark: starts benchmark (evidence: `README.md`)
- QuixBugs benchmark → Repair agent: repairs benchmark cases (evidence: `quixbugs_runner.py`)
- QuixBugs benchmark → Benchmark summary: summarizes outcomes (evidence: `quixbugs_runner.py`)
- QuixBugs benchmark → Dashboard template: uses template (evidence: `quixbugs_runner.py`)
