# metaevo-ai/harness-zero architecture

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

- Interactive diagram: https://gitdiagram.com/metaevo-ai/harness-zero
- Repository: https://github.com/metaevo-ai/harness-zero

## Overview

Harness-Zero runs a student under a minimal target harness, has a harnessing teacher review each unexecuted response against an adapted reference harness, then records accepted responses for supervised fine-tuning. The resulting model is deployed with the minimal harness rather than the evolved harness or reviewer. The graph preserves the documented SpreadsheetBench, AppWorld, and USPTO harness branches. Some wiring is documented in the README rather than shown in sampled source, so those subsystem links use only documented workflow relationships.

Main entry points: [`src/harness_zero/rollout.py`](https://github.com/metaevo-ai/harness-zero/blob/main/src/harness_zero/rollout.py) (Rollout runner), [`src/harness_zero/cli.py`](https://github.com/metaevo-ai/harness-zero/blob/main/src/harness_zero/cli.py) (CLI), [`src/harness_zero/teacher.py`](https://github.com/metaevo-ai/harness-zero/blob/main/src/harness_zero/teacher.py) (Harnessing teacher), [`src/harness_zero/sft.py`](https://github.com/metaevo-ai/harness-zero/blob/main/src/harness_zero/sft.py) (SFT builder)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_orchestration["Rollout orchestration"]
  node_cli["CLI<br/>[cli.py]"]
  node_rollout["Rollout runner<br/>[rollout.py]"]
end

subgraph group_review["Review runtime"]
  node_student["Student wrapper<br/>[student.py]"]
  node_student_harness["Target harness<br/>[student_harness.py]"]
  node_teacher["Harnessing teacher<br/>[teacher.py]"]
  node_review_schema["Review boundary<br/>[review.py]"]
  node_guidance["Review guidance"]
  node_deepagents["Harbor backend<br/>[backend.py]"]
  node_trajectory["Trajectory recorder<br/>[trajectory.py]"]
end

subgraph group_distillation["Distillation and deployment"]
  node_trajectory_store[("Trajectory store<br/>[store.py]")]
  node_sft_builder["SFT builder<br/>[sft.py]"]
  node_dataset["Reviewed SFT data"]
  node_trainer["Training loop<br/>[train.py]"]
  node_model["Distilled model"]
  node_minimal_deploy["Minimal deployment<br/>[agent_cli.py]"]
end

subgraph group_domains["Domain harnesses"]
  node_reference_harness["Reference harness K"]
  node_student_banks["Evolved harnesses"]
  node_appworld_env["AppWorld environment"]
  node_appworld_client["AppWorld client<br/>[client.py]"]
  node_appworld_server["AppWorld API service<br/>[server.py]"]
  node_spreadsheet_harness["SpreadsheetBench harness"]
  node_uspto_harness["USPTO harness"]
end

node_user(("Operator"))

node_user -->|"starts run"| node_cli
node_cli -->|"launches rollout"| node_rollout
node_rollout -->|"runs student"| node_student
node_rollout -->|"requests review"| node_teacher
node_student -->|"uses target"| node_student_harness
node_teacher -->|"reviews against"| node_reference_harness
node_teacher -->|"submits decision"| node_review_schema
node_teacher -->|"uses cues"| node_guidance
node_rollout -->|"runs sandbox"| node_deepagents
node_deepagents -->|"emits events"| node_trajectory
node_trajectory -->|"records"| node_trajectory_store
node_rollout -.->|"loads domain harness"| node_student_banks
node_rollout -->|"writes trials"| node_trajectory_store
node_cli -->|"builds SFT"| node_sft_builder
node_sft_builder -->|"reads trials"| node_trajectory_store
node_sft_builder -->|"produces data"| node_dataset
node_cli -->|"starts training"| node_trainer
node_trainer -->|"trains on"| node_dataset
node_trainer -->|"produces weights"| node_model
node_minimal_deploy -->|"loads weights"| node_model
node_student_harness -.->|"uses dedicated setup"| node_appworld_env
node_appworld_client -->|"requests APIs"| node_appworld_server
node_appworld_server -->|"loads task state"| node_appworld_env
node_student_banks -->|"includes"| node_spreadsheet_harness
node_student_banks -->|"includes"| node_uspto_harness

click node_cli "https://github.com/metaevo-ai/harness-zero/blob/main/src/harness_zero/cli.py"
click node_rollout "https://github.com/metaevo-ai/harness-zero/blob/main/src/harness_zero/rollout.py"
click node_student "https://github.com/metaevo-ai/harness-zero/blob/main/src/harness_zero/student.py"
click node_student_harness "https://github.com/metaevo-ai/harness-zero/blob/main/src/harness_zero/student_harness.py"
click node_teacher "https://github.com/metaevo-ai/harness-zero/blob/main/src/harness_zero/teacher.py"
click node_review_schema "https://github.com/metaevo-ai/harness-zero/blob/main/src/harness_zero/review.py"
click node_guidance "https://github.com/metaevo-ai/harness-zero/blob/main/src/harness_zero/teacher_guidance.py"
click node_reference_harness "https://github.com/metaevo-ai/harness-zero/tree/main/harness_bank"
click node_student_banks "https://github.com/metaevo-ai/harness-zero/tree/main/harness_bank"
click node_deepagents "https://github.com/metaevo-ai/harness-zero/blob/main/src/deepagents_harbor/backend.py"
click node_trajectory "https://github.com/metaevo-ai/harness-zero/blob/main/src/deepagents_harbor/trajectory.py"
click node_trajectory_store "https://github.com/metaevo-ai/harness-zero/blob/main/src/harness_zero/store.py"
click node_sft_builder "https://github.com/metaevo-ai/harness-zero/blob/main/src/harness_zero/sft.py"
click node_trainer "https://github.com/metaevo-ai/harness-zero/blob/main/src/harness_zero/train.py"
click node_minimal_deploy "https://github.com/metaevo-ai/harness-zero/blob/main/src/harness_zero/agent_cli.py"
click node_appworld_env "https://github.com/metaevo-ai/harness-zero/tree/main/envs/appworld"
click node_appworld_client "https://github.com/metaevo-ai/harness-zero/blob/main/envs/appworld/runtime/client.py"
click node_appworld_server "https://github.com/metaevo-ai/harness-zero/blob/main/envs/appworld/runtime/server.py"
click node_spreadsheet_harness "https://github.com/metaevo-ai/harness-zero/tree/main/harness_bank/spreadsheetbench_student"
click node_uspto_harness "https://github.com/metaevo-ai/harness-zero/tree/main/harness_bank/uspto_student"

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_rollout toneBlue
class node_student,node_student_harness,node_teacher,node_review_schema,node_guidance,node_deepagents,node_trajectory toneAmber
class node_trajectory_store,node_sft_builder,node_dataset,node_trainer,node_model,node_minimal_deploy toneMint
class node_reference_harness,node_student_banks,node_appworld_env,node_appworld_client,node_appworld_server,node_spreadsheet_harness,node_uspto_harness toneRose
class node_user toneIndigo
```

## Components

### Rollout orchestration

- [CLI](https://github.com/metaevo-ai/harness-zero/blob/main/src/harness_zero/cli.py): `src/harness_zero/cli.py`
- [Rollout runner](https://github.com/metaevo-ai/harness-zero/blob/main/src/harness_zero/rollout.py): `src/harness_zero/rollout.py`

### Review runtime

- [Student wrapper](https://github.com/metaevo-ai/harness-zero/blob/main/src/harness_zero/student.py): `src/harness_zero/student.py`
- [Target harness](https://github.com/metaevo-ai/harness-zero/blob/main/src/harness_zero/student_harness.py): `src/harness_zero/student_harness.py`
- [Harnessing teacher](https://github.com/metaevo-ai/harness-zero/blob/main/src/harness_zero/teacher.py): `src/harness_zero/teacher.py`
- [Review boundary](https://github.com/metaevo-ai/harness-zero/blob/main/src/harness_zero/review.py): `src/harness_zero/review.py`
- [Review guidance](https://github.com/metaevo-ai/harness-zero/blob/main/src/harness_zero/teacher_guidance.py): `src/harness_zero/teacher_guidance.py`
- [Harbor backend](https://github.com/metaevo-ai/harness-zero/blob/main/src/deepagents_harbor/backend.py): `src/deepagents_harbor/backend.py`
- [Trajectory recorder](https://github.com/metaevo-ai/harness-zero/blob/main/src/deepagents_harbor/trajectory.py): `src/deepagents_harbor/trajectory.py`

### Distillation and deployment

- [Trajectory store](https://github.com/metaevo-ai/harness-zero/blob/main/src/harness_zero/store.py): `src/harness_zero/store.py`
- [SFT builder](https://github.com/metaevo-ai/harness-zero/blob/main/src/harness_zero/sft.py): `src/harness_zero/sft.py`
- **Reviewed SFT data**
- [Training loop](https://github.com/metaevo-ai/harness-zero/blob/main/src/harness_zero/train.py): `src/harness_zero/train.py`
- **Distilled model**
- [Minimal deployment](https://github.com/metaevo-ai/harness-zero/blob/main/src/harness_zero/agent_cli.py): `src/harness_zero/agent_cli.py`

### Domain harnesses

- [Reference harness K](https://github.com/metaevo-ai/harness-zero/tree/main/harness_bank): `harness_bank`
- [Evolved harnesses](https://github.com/metaevo-ai/harness-zero/tree/main/harness_bank): `harness_bank`
- [AppWorld environment](https://github.com/metaevo-ai/harness-zero/tree/main/envs/appworld): `envs/appworld`
- [AppWorld client](https://github.com/metaevo-ai/harness-zero/blob/main/envs/appworld/runtime/client.py): `envs/appworld/runtime/client.py`
- [AppWorld API service](https://github.com/metaevo-ai/harness-zero/blob/main/envs/appworld/runtime/server.py): `envs/appworld/runtime/server.py`
- [SpreadsheetBench harness](https://github.com/metaevo-ai/harness-zero/tree/main/harness_bank/spreadsheetbench_student): `harness_bank/spreadsheetbench_student`
- [USPTO harness](https://github.com/metaevo-ai/harness-zero/tree/main/harness_bank/uspto_student): `harness_bank/uspto_student`

### Other components

- **Operator**

## Connections

- Operator → CLI: starts run
- CLI → Rollout runner: launches rollout
- Rollout runner → Student wrapper: runs student
- Rollout runner → Harnessing teacher: requests review
- Student wrapper → Target harness: uses target
- Harnessing teacher → Reference harness K: reviews against
- Harnessing teacher → Review boundary: submits decision
- Harnessing teacher → Review guidance: uses cues
- Rollout runner → Harbor backend: runs sandbox
- Harbor backend → Trajectory recorder: emits events
- Trajectory recorder → Trajectory store: records
- Rollout runner → Evolved harnesses: loads domain harness
- Rollout runner → Trajectory store: writes trials
- CLI → SFT builder: builds SFT
- SFT builder → Trajectory store: reads trials
- SFT builder → Reviewed SFT data: produces data
- CLI → Training loop: starts training
- Training loop → Reviewed SFT data: trains on
- Training loop → Distilled model: produces weights
- Minimal deployment → Distilled model: loads weights
- Target harness → AppWorld environment: uses dedicated setup
- AppWorld client → AppWorld API service: requests APIs
- AppWorld API service → AppWorld environment: loads task state
- Evolved harnesses → SpreadsheetBench harness: includes
- Evolved harnesses → USPTO harness: includes
