# peetuvu/thesis-agent-benchmark architecture

> Architecture diagram of the GitHub repository peetuvu/thesis-agent-benchmark, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/peetuvu/thesis-agent-benchmark
- Repository: https://github.com/peetuvu/thesis-agent-benchmark

## Overview

This repository is an LLM coding-task benchmark harness. A user selects a task, architecture, and model; the runner builds a task context, runs the architecture through a provider, applies generated edits in a temporary task copy, evaluates them, and records run results. Separate analysis tools aggregate, rescore, and inspect benchmark outcomes. The graph reflects documented workflow and sampled call sites; some executor internals and provider implementations were not excerpted, so their links are omitted or marked unverified.

Main entry points: [`runner/executor.py`](https://github.com/peetuvu/thesis-agent-benchmark/blob/main/runner/executor.py) (Run executor), [`runner/cli.py`](https://github.com/peetuvu/thesis-agent-benchmark/blob/main/runner/cli.py) (Command interface), [`providers/base.py`](https://github.com/peetuvu/thesis-agent-benchmark/blob/main/providers/base.py) (Provider interface), [`scripts/rescored.py`](https://github.com/peetuvu/thesis-agent-benchmark/blob/main/scripts/rescored.py) (Rescored data)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_run["Run orchestration"]
  node_cli["Command interface<br/>[cli.py]"]
  node_config["Run and task config<br/>[config.py]"]
  node_executor["Run executor<br/>[executor.py]"]
  node_sandbox["Task sandbox<br/>[sandbox.py]"]
  node_logger[("Run logger<br/>[logger.py]")]
end

subgraph group_strategy["Agent strategies"]
  node_archbase["Architecture contract<br/>[base.py]"]
  node_single["Single agent<br/>[single_agent.py]"]
  node_sequential["Sequential pipeline<br/>[sequential.py]"]
  node_archutils["Prompt and code parsing<br/>[utils.py]"]
end

subgraph group_models["Model access"]
  node_providerbase["Provider interface<br/>[base.py]"]
  node_modelsregistry["Model registry<br/>[models.py]"]
  node_pricing["Model pricing<br/>[pricing.py]"]
  node_anthropic["Anthropic adapter<br/>[anthropic.py]"]
  node_openai["OpenAI adapter<br/>[openai.py]"]
end

subgraph group_tasks["Benchmark tasks"]
  node_calculator["Calculator task"]
  node_diffapply["Diff apply task<br/>[applier.py]"]
  node_mdtable["Markdown table task<br/>[formatter.py]"]
  node_snake["Snake game task<br/>[game.py]"]
  node_urlshort["URL shortener task"]
end

subgraph group_insights["Result analysis"]
  node_aggregate["Result aggregation"]
  node_stageanalysis["Stage analysis<br/>[analyze_stages.py]"]
  node_failureclass["Failure classification"]
  node_rescore["Run rescoring<br/>[rescore_runs.py]"]
  node_rescored["Rescored data<br/>[rescored.py]"]
end

node_user(("Benchmark user"))
node_anthropicapi{{"Anthropic API"}}
node_openaiapi{{"OpenAI API"}}

node_user -->|"starts run"| node_cli
node_cli -->|"builds config"| node_config
node_cli -->|"starts run"| node_executor
node_executor -->|"resolves task"| node_config
node_executor -->|"runs architecture"| node_archbase
node_executor -.->|"uses sandbox"| node_sandbox
node_executor -->|"records results"| node_logger
node_archbase -->|"uses provider"| node_providerbase
node_single -->|"parses output"| node_archutils
node_sequential -->|"builds prompts"| node_archutils
node_sequential -->|"requests completions"| node_providerbase
node_providerbase -.->|"implemented by"| node_anthropic
node_providerbase -.->|"implemented by"| node_openai
node_anthropic -.->|"calls API"| node_anthropicapi
node_openai -.->|"calls API"| node_openaiapi
node_cli -->|"resolves model"| node_modelsregistry
node_executor -->|"estimates cost"| node_pricing
node_executor -->|"benchmarks task"| node_calculator
node_executor -->|"benchmarks task"| node_diffapply
node_executor -->|"benchmarks task"| node_mdtable
node_executor -->|"benchmarks task"| node_snake
node_executor -->|"benchmarks task"| node_urlshort
node_aggregate -->|"reads rescored data"| node_rescored
node_stageanalysis -->|"reads run data"| node_rescored
node_failureclass -->|"uses analysis"| node_stageanalysis
node_rescore -->|"produces scores"| node_rescored

click node_cli "https://github.com/peetuvu/thesis-agent-benchmark/blob/main/runner/cli.py"
click node_config "https://github.com/peetuvu/thesis-agent-benchmark/blob/main/runner/config.py"
click node_executor "https://github.com/peetuvu/thesis-agent-benchmark/blob/main/runner/executor.py"
click node_sandbox "https://github.com/peetuvu/thesis-agent-benchmark/blob/main/runner/sandbox.py"
click node_logger "https://github.com/peetuvu/thesis-agent-benchmark/blob/main/runner/logger.py"
click node_archbase "https://github.com/peetuvu/thesis-agent-benchmark/blob/main/architectures/base.py"
click node_single "https://github.com/peetuvu/thesis-agent-benchmark/blob/main/architectures/single_agent.py"
click node_sequential "https://github.com/peetuvu/thesis-agent-benchmark/blob/main/architectures/sequential.py"
click node_archutils "https://github.com/peetuvu/thesis-agent-benchmark/blob/main/architectures/utils.py"
click node_providerbase "https://github.com/peetuvu/thesis-agent-benchmark/blob/main/providers/base.py"
click node_modelsregistry "https://github.com/peetuvu/thesis-agent-benchmark/blob/main/providers/models.py"
click node_pricing "https://github.com/peetuvu/thesis-agent-benchmark/blob/main/providers/pricing.py"
click node_anthropic "https://github.com/peetuvu/thesis-agent-benchmark/blob/main/providers/anthropic.py"
click node_openai "https://github.com/peetuvu/thesis-agent-benchmark/blob/main/providers/openai.py"
click node_calculator "https://github.com/peetuvu/thesis-agent-benchmark/tree/main/agent-bench/tasks/calculator/calculator"
click node_diffapply "https://github.com/peetuvu/thesis-agent-benchmark/blob/main/agent-bench/tasks/diffapply/diffapply/applier.py"
click node_mdtable "https://github.com/peetuvu/thesis-agent-benchmark/blob/main/agent-bench/tasks/mdtable/mdtable/formatter.py"
click node_snake "https://github.com/peetuvu/thesis-agent-benchmark/blob/main/agent-bench/tasks/snake/snake/game.py"
click node_urlshort "https://github.com/peetuvu/thesis-agent-benchmark/tree/main/agent-bench/tasks/urlshort/urlshort"
click node_aggregate "https://github.com/peetuvu/thesis-agent-benchmark/blob/main/scripts/aggregate_results.py"
click node_stageanalysis "https://github.com/peetuvu/thesis-agent-benchmark/blob/main/scripts/analyze_stages.py"
click node_failureclass "https://github.com/peetuvu/thesis-agent-benchmark/blob/main/scripts/classify_failures.py"
click node_rescore "https://github.com/peetuvu/thesis-agent-benchmark/blob/main/scripts/rescore_runs.py"
click node_rescored "https://github.com/peetuvu/thesis-agent-benchmark/blob/main/scripts/rescored.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_cli,node_config,node_executor,node_sandbox,node_logger,node_user toneBlue
class node_archbase,node_single,node_sequential,node_archutils toneAmber
class node_providerbase,node_modelsregistry,node_pricing,node_anthropic,node_openai,node_anthropicapi,node_openaiapi toneMint
class node_calculator,node_diffapply,node_mdtable,node_snake,node_urlshort toneRose
class node_aggregate,node_stageanalysis,node_failureclass,node_rescore,node_rescored toneIndigo
```

## Components

### Run orchestration

- [Command interface](https://github.com/peetuvu/thesis-agent-benchmark/blob/main/runner/cli.py): `runner/cli.py`
- [Run and task config](https://github.com/peetuvu/thesis-agent-benchmark/blob/main/runner/config.py): `runner/config.py`
- [Run executor](https://github.com/peetuvu/thesis-agent-benchmark/blob/main/runner/executor.py): `runner/executor.py`
- [Task sandbox](https://github.com/peetuvu/thesis-agent-benchmark/blob/main/runner/sandbox.py): `runner/sandbox.py`
- [Run logger](https://github.com/peetuvu/thesis-agent-benchmark/blob/main/runner/logger.py): `runner/logger.py`

### Agent strategies

- [Architecture contract](https://github.com/peetuvu/thesis-agent-benchmark/blob/main/architectures/base.py): `architectures/base.py`
- [Single agent](https://github.com/peetuvu/thesis-agent-benchmark/blob/main/architectures/single_agent.py): `architectures/single_agent.py`
- [Sequential pipeline](https://github.com/peetuvu/thesis-agent-benchmark/blob/main/architectures/sequential.py): `architectures/sequential.py`
- [Prompt and code parsing](https://github.com/peetuvu/thesis-agent-benchmark/blob/main/architectures/utils.py): `architectures/utils.py`

### Model access

- [Provider interface](https://github.com/peetuvu/thesis-agent-benchmark/blob/main/providers/base.py): `providers/base.py`
- [Model registry](https://github.com/peetuvu/thesis-agent-benchmark/blob/main/providers/models.py): `providers/models.py`
- [Model pricing](https://github.com/peetuvu/thesis-agent-benchmark/blob/main/providers/pricing.py): `providers/pricing.py`
- [Anthropic adapter](https://github.com/peetuvu/thesis-agent-benchmark/blob/main/providers/anthropic.py): `providers/anthropic.py`
- [OpenAI adapter](https://github.com/peetuvu/thesis-agent-benchmark/blob/main/providers/openai.py): `providers/openai.py`

### Benchmark tasks

- [Calculator task](https://github.com/peetuvu/thesis-agent-benchmark/tree/main/agent-bench/tasks/calculator/calculator): `agent-bench/tasks/calculator/calculator`
- [Diff apply task](https://github.com/peetuvu/thesis-agent-benchmark/blob/main/agent-bench/tasks/diffapply/diffapply/applier.py): `agent-bench/tasks/diffapply/diffapply/applier.py`
- [Markdown table task](https://github.com/peetuvu/thesis-agent-benchmark/blob/main/agent-bench/tasks/mdtable/mdtable/formatter.py): `agent-bench/tasks/mdtable/mdtable/formatter.py`
- [Snake game task](https://github.com/peetuvu/thesis-agent-benchmark/blob/main/agent-bench/tasks/snake/snake/game.py): `agent-bench/tasks/snake/snake/game.py`
- [URL shortener task](https://github.com/peetuvu/thesis-agent-benchmark/tree/main/agent-bench/tasks/urlshort/urlshort): `agent-bench/tasks/urlshort/urlshort`

### Result analysis

- [Result aggregation](https://github.com/peetuvu/thesis-agent-benchmark/blob/main/scripts/aggregate_results.py): `scripts/aggregate_results.py`
- [Stage analysis](https://github.com/peetuvu/thesis-agent-benchmark/blob/main/scripts/analyze_stages.py): `scripts/analyze_stages.py`
- [Failure classification](https://github.com/peetuvu/thesis-agent-benchmark/blob/main/scripts/classify_failures.py): `scripts/classify_failures.py`
- [Run rescoring](https://github.com/peetuvu/thesis-agent-benchmark/blob/main/scripts/rescore_runs.py): `scripts/rescore_runs.py`
- [Rescored data](https://github.com/peetuvu/thesis-agent-benchmark/blob/main/scripts/rescored.py): `scripts/rescored.py`

### Other components

- **Benchmark user**
- **Anthropic API**
- **OpenAI API**

## Connections

- Benchmark user → Command interface: starts run (evidence: `README.md`)
- Command interface → Run and task config: builds config (evidence: `runner/cli.py`)
- Command interface → Run executor: starts run (evidence: `runner/cli.py`)
- Run executor → Run and task config: resolves task (evidence: `runner/executor.py`)
- Run executor → Architecture contract: runs architecture (evidence: `runner/executor.py`)
- Run executor → Task sandbox: uses sandbox (evidence: `runner/executor.py`)
- Run executor → Run logger: records results (evidence: `README.md`)
- Architecture contract → Provider interface: uses provider (evidence: `architectures/base.py`)
- Single agent → Prompt and code parsing: parses output (evidence: `architectures/single_agent.py`)
- Sequential pipeline → Prompt and code parsing: builds prompts (evidence: `architectures/sequential.py`)
- Sequential pipeline → Provider interface: requests completions (evidence: `architectures/sequential.py`)
- Provider interface → Anthropic adapter: implemented by (evidence: `providers/anthropic.py`)
- Provider interface → OpenAI adapter: implemented by (evidence: `providers/openai.py`)
- Anthropic adapter → Anthropic API: calls API
- OpenAI adapter → OpenAI API: calls API
- Command interface → Model registry: resolves model (evidence: `runner/cli.py`)
- Run executor → Model pricing: estimates cost (evidence: `runner/executor.py`)
- Run executor → Calculator task: benchmarks task (evidence: `README.md`)
- Run executor → Diff apply task: benchmarks task (evidence: `README.md`)
- Run executor → Markdown table task: benchmarks task (evidence: `README.md`)
- Run executor → Snake game task: benchmarks task (evidence: `README.md`)
- Run executor → URL shortener task: benchmarks task (evidence: `README.md`)
- Result aggregation → Rescored data: reads rescored data (evidence: `scripts/aggregate_results.py`)
- Stage analysis → Rescored data: reads run data (evidence: `scripts/analyze_stages.py`)
- Failure classification → Stage analysis: uses analysis (evidence: `scripts/classify_failures.py`)
- Run rescoring → Rescored data: produces scores (evidence: `scripts/rescore_runs.py`)
