# datacurve-ai/deep-swe architecture

> Architecture diagram of the GitHub repository datacurve-ai/deep-swe, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-07-15). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/datacurve-ai/deep-swe
- Repository: https://github.com/datacurve-ai/deep-swe

## Overview

#### Purpose and Entry Points
DeepSWE is a Harbor-format benchmark corpus for evaluating coding agents on 113 long-horizon changes in active open-source projects. It is not an application: its consumable entry point is the task collection at `tasks/`, executed by the external Pier runner. Dataset-level discovery is defined by `tasks/manifest.json`, `tasks/manifest.schema.json`, and `tasks/dataset.toml`.

#### Dataset and Task Selection
Each immediate child of `tasks/` is an independently runnable task, identified by its directory name and declared through its own metadata. Pier can target the complete collection or a single task directory. The manifest/dataset metadata provides the collection boundary; individual `task.toml` files provide task-specific source repository, base revision, language, container image, and execution limits. Examples: `tasks/fastapi-implicit-head-options/task.toml`, `tasks/kcp-go-multiplexed-kcp-streams/task.toml`.

#### Per-Task Contract
Every task follows the same portable layout:
- Agent-facing requirement: `instruction.md`.
- Reproducible work environment: `environment/Dockerfile`.
- Submission extraction: `pre_artifacts.sh`.
- Independent verifier: `tests/`.
- Offline reviewer reference: `solution/`.
This standardized contract allows heterogeneous target ecosystems to be evaluated by one orchestration framework. See `tasks/README.md` and representative paths `tasks/httpx-streaming-json-iteration/instruction.md`, `tasks/httpx-streaming-json-iteration/task.toml`.

#### Agent Execution and Submission Boundary
Pier launches an agent in the task’s isolated environment, where it modifies the checked-out upstream project and commits its work. The key trust boundary is `pre_artifacts.sh`: after the agent finishes, Pier invokes it to convert committed work into a patch artifact. That patch, rather than the mutable agent container, crosses into grading. Representative paths: `tasks/bandit-interprocedural-taint-checks/pre_artifacts.sh`, `tasks/bandit-interprocedural-taint-checks/environment/Dockerfile`.

#### Verification Pipeline
The extracted patch is applied in a pristine, separate verifier container. The verifier entry script and Python grader execute held-out behavioral checks and emit structured scoring/reporting artifacts. This isolates test execution from agent-side state and prevents reference-solution leakage. Main paths: `tasks/fastapi-deprecation-response-headers/tests/Dockerfile`, `tasks/fastapi-deprecation-response-headers/tests/test.sh`, `tasks/fastapi-deprecation-response-headers/tests/grader.py`, `tasks/fastapi-deprecation-response-headers/tests/config.json`.

#### Reference Solutions and Evaluation Semantics
`solution/solution.patch` and `solution/solve.sh` document a canonical implementation for human spot checks, but are explicitly outside the runtime grading path. Grading accepts any patch with correct observable behavior, not a particular implementation structure. Paths: `tasks/prometheus-transactional-reload-status/solution/solution.patch`, `tasks/prometheus-transactional-reload-status/solution/solve.sh`.

#### Runtimes and Infrastructure
Task environments span TypeScript/JavaScript, Go, Python, Rust, and related ecosystem tooling, selected per task Dockerfile; there is no shared application runtime in this repository. Required infrastructure is Docker-compatible sandboxing plus Pier (Harbor-compatible); Pier may run sandboxes locally or on Modal. External LLM providers are used by the runner/agent layer (for example Anthropic or OpenAI), while task isolation can restrict outbound network access. The benchmark itself contains no service implementation or persistent datastore.

Main entry points: [`tasks`](https://github.com/datacurve-ai/deep-swe/tree/main/tasks) (Task directories), [`tasks/bandit-interprocedural-taint-checks/environment/Dockerfile`](https://github.com/datacurve-ai/deep-swe/tree/main/tasks/bandit-interprocedural-taint-checks/environment/Dockerfile) (Agent environment), [`tasks/fastapi-deprecation-response-headers/tests/Dockerfile`](https://github.com/datacurve-ai/deep-swe/tree/main/tasks/fastapi-deprecation-response-headers/tests/Dockerfile) (Verifier container), [`tasks/bandit-interprocedural-taint-checks/pre_artifacts.sh`](https://github.com/datacurve-ai/deep-swe/blob/main/tasks/bandit-interprocedural-taint-checks/pre_artifacts.sh) (Patch extractor)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_collection["Dataset collection"]
  node_dataset_metadata["Dataset metadata<br/>collection index<br/>[manifest.json]"]
  node_tasks["Task directories<br/>benchmark corpus"]
end

subgraph group_task["Portable task contract"]
  node_task_metadata["Task metadata<br/>task declaration<br/>[task.toml]"]
  node_instruction["Agent instruction<br/>requirement<br/>[instruction.md]"]
  node_agent_environment["Agent environment<br/>Docker sandbox"]
  node_artifact_extractor["Patch extractor<br/>submission boundary<br/>[pre_artifacts.sh]"]
  node_verifier_image["Verifier container<br/>Docker sandbox"]
  node_verifier_entry["Verifier entry script<br/>test runner<br/>[test.sh]"]
  node_grader["Python grader<br/>behavioral verifier<br/>[grader.py]"]
  node_reference_solution["Reference solution<br/>offline review aid<br/>[solution.patch]"]
end

subgraph group_execution["Execution and grading"]
  node_pier{{"Pier runner<br/>external orchestrator"}}
  node_agent{{"Coding agent<br/>external agent"}}
  node_patch["Submission patch<br/>artifact"]
  node_score_report["Score and report<br/>grading artifacts<br/>[config.json]"]
  node_llm_providers{{"LLM providers<br/>external inference"}}
end

node_dataset_metadata -->|"indexes"| node_tasks
node_pier -->|"discovers"| node_dataset_metadata
node_pier -->|"selects all or one"| node_tasks
node_tasks -->|"contains"| node_task_metadata
node_tasks -->|"contains"| node_instruction
node_tasks -->|"contains"| node_agent_environment
node_tasks -->|"contains"| node_artifact_extractor
node_tasks -->|"contains"| node_verifier_image
node_task_metadata -->|"configures"| node_agent_environment
node_pier -->|"launches"| node_agent_environment
node_instruction -->|"guides"| node_agent
node_agent_environment -->|"hosts"| node_agent
node_llm_providers -->|"inference"| node_agent
node_agent -->|"committed work"| node_artifact_extractor
node_artifact_extractor -->|"extracts"| node_patch
node_pier -->|"launches separately"| node_verifier_image
node_patch -->|"applies in pristine sandbox"| node_verifier_image
node_verifier_image -->|"runs"| node_verifier_entry
node_verifier_entry -->|"invokes"| node_grader
node_grader -->|"emits"| node_score_report
node_reference_solution -.->|"excluded from runtime grading"| node_grader

click node_dataset_metadata "https://github.com/datacurve-ai/deep-swe/blob/main/tasks/manifest.json"
click node_tasks "https://github.com/datacurve-ai/deep-swe/tree/main/tasks"
click node_task_metadata "https://github.com/datacurve-ai/deep-swe/blob/main/tasks/httpx-streaming-json-iteration/task.toml"
click node_instruction "https://github.com/datacurve-ai/deep-swe/blob/main/tasks/httpx-streaming-json-iteration/instruction.md"
click node_agent_environment "https://github.com/datacurve-ai/deep-swe/tree/main/tasks/bandit-interprocedural-taint-checks/environment/Dockerfile"
click node_artifact_extractor "https://github.com/datacurve-ai/deep-swe/blob/main/tasks/bandit-interprocedural-taint-checks/pre_artifacts.sh"
click node_verifier_image "https://github.com/datacurve-ai/deep-swe/tree/main/tasks/fastapi-deprecation-response-headers/tests/Dockerfile"
click node_verifier_entry "https://github.com/datacurve-ai/deep-swe/blob/main/tasks/fastapi-deprecation-response-headers/tests/test.sh"
click node_grader "https://github.com/datacurve-ai/deep-swe/blob/main/tasks/fastapi-deprecation-response-headers/tests/grader.py"
click node_score_report "https://github.com/datacurve-ai/deep-swe/blob/main/tasks/fastapi-deprecation-response-headers/tests/config.json"
click node_reference_solution "https://github.com/datacurve-ai/deep-swe/blob/main/tasks/prometheus-transactional-reload-status/solution/solution.patch"

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_dataset_metadata,node_tasks toneBlue
class node_task_metadata,node_instruction,node_agent_environment,node_artifact_extractor,node_verifier_image,node_verifier_entry,node_grader,node_reference_solution toneAmber
class node_pier,node_agent,node_patch,node_score_report,node_llm_providers toneMint
```

## Components

### Dataset collection

- [Dataset metadata](https://github.com/datacurve-ai/deep-swe/blob/main/tasks/manifest.json): collection index · Defines the task collection boundary and manifest contract. · `tasks/manifest.json`
- [Task directories](https://github.com/datacurve-ai/deep-swe/tree/main/tasks): benchmark corpus · 113 independently runnable long-horizon coding tasks. · `tasks`

### Portable task contract

- [Task metadata](https://github.com/datacurve-ai/deep-swe/blob/main/tasks/httpx-streaming-json-iteration/task.toml): task declaration · Pins upstream source, revision, runtime image, and limits. · `tasks/httpx-streaming-json-iteration/task.toml`
- [Agent instruction](https://github.com/datacurve-ai/deep-swe/blob/main/tasks/httpx-streaming-json-iteration/instruction.md): requirement · `tasks/httpx-streaming-json-iteration/instruction.md`
- [Agent environment](https://github.com/datacurve-ai/deep-swe/tree/main/tasks/bandit-interprocedural-taint-checks/environment/Dockerfile): Docker sandbox · Checked-out upstream project workspace for agent changes. · `tasks/bandit-interprocedural-taint-checks/environment/Dockerfile`
- [Patch extractor](https://github.com/datacurve-ai/deep-swe/blob/main/tasks/bandit-interprocedural-taint-checks/pre_artifacts.sh): submission boundary · Converts committed agent work into the patch artifact. · `tasks/bandit-interprocedural-taint-checks/pre_artifacts.sh`
- [Verifier container](https://github.com/datacurve-ai/deep-swe/tree/main/tasks/fastapi-deprecation-response-headers/tests/Dockerfile): Docker sandbox · Pristine environment separate from the agent workspace. · `tasks/fastapi-deprecation-response-headers/tests/Dockerfile`
- [Verifier entry script](https://github.com/datacurve-ai/deep-swe/blob/main/tasks/fastapi-deprecation-response-headers/tests/test.sh): test runner · `tasks/fastapi-deprecation-response-headers/tests/test.sh`
- [Python grader](https://github.com/datacurve-ai/deep-swe/blob/main/tasks/fastapi-deprecation-response-headers/tests/grader.py): behavioral verifier · Runs held-out checks against the patched project. · `tasks/fastapi-deprecation-response-headers/tests/grader.py`
- [Reference solution](https://github.com/datacurve-ai/deep-swe/blob/main/tasks/prometheus-transactional-reload-status/solution/solution.patch): offline review aid · Canonical patch and solve script for human spot checks only. · `tasks/prometheus-transactional-reload-status/solution/solution.patch`

### Execution and grading

- **Pier runner**: external orchestrator · Discovers tasks and runs agent and verifier sandboxes.
- **Coding agent**: external agent · Modifies and commits the upstream project in the isolated workspace.
- **Submission patch**: artifact · The only agent-side output passed to grading.
- [Score and report](https://github.com/datacurve-ai/deep-swe/blob/main/tasks/fastapi-deprecation-response-headers/tests/config.json): grading artifacts · Structured evaluation output. · `tasks/fastapi-deprecation-response-headers/tests/config.json`
- **LLM providers**: external inference · Used by the runner and agent layer.

## Connections

- Dataset metadata → Task directories: indexes
- Pier runner → Dataset metadata: discovers
- Pier runner → Task directories: selects all or one
- Task directories → Task metadata: contains
- Task directories → Agent instruction: contains
- Task directories → Agent environment: contains
- Task directories → Patch extractor: contains
- Task directories → Verifier container: contains
- Task metadata → Agent environment: configures
- Pier runner → Agent environment: launches
- Agent instruction → Coding agent: guides
- Agent environment → Coding agent: hosts
- LLM providers → Coding agent: inference
- Coding agent → Patch extractor: committed work
- Patch extractor → Submission patch: extracts
- Pier runner → Verifier container: launches separately
- Submission patch → Verifier container: applies in pristine sandbox
- Verifier container → Verifier entry script: runs
- Verifier entry script → Python grader: invokes
- Python grader → Score and report: emits
- Reference solution → Python grader: excluded from runtime grading
