# stanford-iris-lab/meta-harness architecture

> Architecture diagram of the GitHub repository stanford-iris-lab/meta-harness, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-13). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/stanford-iris-lab/meta-harness
- Repository: https://github.com/stanford-iris-lab/meta-harness

## Overview

Meta-Harness automates search over task-specific harnesses around a fixed base model. Its reference experiments expose two domain workflows: text-classification memory-system learning and Terminal-Bench harness evolution; the experimental Harbor harness adds a smaller evaluation path. The graph retains these distinct stages and major documented capabilities. Some wiring is supported only by the SOURCE INDEX or README; unsampled implementation details and uncertain links are omitted.

Main entry points: [`reference_examples/text_classification/data/api.py`](https://github.com/stanford-iris-lab/meta-harness/blob/main/reference_examples/text_classification/data/api.py) (Dataset Entry Points), [`reference_examples/text_classification/memory_system.py`](https://github.com/stanford-iris-lab/meta-harness/blob/main/reference_examples/text_classification/memory_system.py) (Memory Interface), [`reference_examples/text_classification/agents/fewshot_memory.py`](https://github.com/stanford-iris-lab/meta-harness/blob/main/reference_examples/text_classification/agents/fewshot_memory.py) (Few-Shot Memory), [`reference_examples/text_classification/llm.py`](https://github.com/stanford-iris-lab/meta-harness/blob/main/reference_examples/text_classification/llm.py) (LLM Client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_framework["Harbor Framework"]
  node_harbor_agent["Terminal Harness Agent"]
  node_harbor_search["Harness Search<br/>[meta_harness.py]"]
  node_harbor_eval["Harbor Evaluator<br/>[controller.py]"]
  node_harbor_runtime["Harbor Runtime"]
end

subgraph group_text["Text Classification"]
  node_datasets[("Task Data<br/>[loaders.py]")]
  node_dataset_api["Dataset Entry Points<br/>[api.py]"]
  node_dataset_defs["Task Definitions<br/>[constants.py]"]
  node_evaluation["Prediction Evaluation<br/>[evaluators.py]"]
  node_experiment_loop["Learning Loop<br/>[inner_loop.py]"]
  node_memory["Memory Interface<br/>[memory_system.py]"]
  node_fewshot["Few-Shot Memory<br/>[fewshot_memory.py]"]
  node_fewshot_all["All-Example Baseline<br/>[fewshot_all.py]"]
  node_no_memory["No-Memory Baseline<br/>[no_memory.py]"]
  node_llm["LLM Client<br/>[llm.py]"]
  node_text_search["Text Harness Search<br/>[meta_harness.py]"]
  node_text_proposer["Proposer Wrapper<br/>[claude_wrapper.py]"]
end

subgraph group_terminal["Terminal Bench"]
  node_terminal_search["Terminal Harness Search<br/>[meta_harness.py]"]
  node_terminal_proposer["Proposer Wrapper<br/>[claude_wrapper.py]"]
  node_terminal_agent["Kira Agent<br/>[baseline_kira.py]"]
  node_cache["Anthropic Cache"]
end

node_proposer(("Coding Proposer"))

node_proposer -.->|"proposes edits"| node_harbor_search
node_harbor_search -->|"evaluates candidates"| node_harbor_eval
node_harbor_eval -->|"launches child"| node_harbor_runtime
node_harbor_agent -.->|"runs task"| node_harbor_runtime
node_experiment_loop -->|"loads splits"| node_dataset_api
node_experiment_loop -->|"learns and predicts"| node_memory
node_dataset_api -->|"loads examples"| node_datasets
node_dataset_api -->|"uses task lists"| node_dataset_defs
node_dataset_api -->|"selects evaluator"| node_evaluation
node_fewshot -->|"implements"| node_memory
node_fewshot_all -->|"reuses variant"| node_fewshot
node_no_memory -->|"implements"| node_memory
node_memory -->|"calls model"| node_llm
node_fewshot -->|"uses client"| node_llm
node_no_memory -->|"uses client"| node_llm
node_text_search -->|"calls wrapper"| node_text_proposer
node_proposer -.->|"proposes edits"| node_text_search
node_terminal_search -->|"calls wrapper"| node_terminal_proposer
node_proposer -.->|"proposes edits"| node_terminal_search
node_terminal_agent -->|"uses cache"| node_cache

click node_harbor_agent "https://github.com/stanford-iris-lab/meta-harness/blob/main/experimental/harbor_meta_harness/agents/terminal_harness.py"
click node_harbor_search "https://github.com/stanford-iris-lab/meta-harness/blob/main/experimental/harbor_meta_harness/agents/meta_harness.py"
click node_harbor_eval "https://github.com/stanford-iris-lab/meta-harness/blob/main/experimental/harbor_meta_harness/controller.py"
click node_datasets "https://github.com/stanford-iris-lab/meta-harness/blob/main/reference_examples/text_classification/data/loaders.py"
click node_dataset_api "https://github.com/stanford-iris-lab/meta-harness/blob/main/reference_examples/text_classification/data/api.py"
click node_dataset_defs "https://github.com/stanford-iris-lab/meta-harness/blob/main/reference_examples/text_classification/data/constants.py"
click node_evaluation "https://github.com/stanford-iris-lab/meta-harness/blob/main/reference_examples/text_classification/data/evaluators.py"
click node_experiment_loop "https://github.com/stanford-iris-lab/meta-harness/blob/main/reference_examples/text_classification/inner_loop.py"
click node_memory "https://github.com/stanford-iris-lab/meta-harness/blob/main/reference_examples/text_classification/memory_system.py"
click node_fewshot "https://github.com/stanford-iris-lab/meta-harness/blob/main/reference_examples/text_classification/agents/fewshot_memory.py"
click node_fewshot_all "https://github.com/stanford-iris-lab/meta-harness/blob/main/reference_examples/text_classification/agents/fewshot_all.py"
click node_no_memory "https://github.com/stanford-iris-lab/meta-harness/blob/main/reference_examples/text_classification/agents/no_memory.py"
click node_llm "https://github.com/stanford-iris-lab/meta-harness/blob/main/reference_examples/text_classification/llm.py"
click node_text_search "https://github.com/stanford-iris-lab/meta-harness/blob/main/reference_examples/text_classification/meta_harness.py"
click node_text_proposer "https://github.com/stanford-iris-lab/meta-harness/blob/main/reference_examples/text_classification/claude_wrapper.py"
click node_terminal_search "https://github.com/stanford-iris-lab/meta-harness/blob/main/reference_examples/terminal_bench_2/meta_harness.py"
click node_terminal_proposer "https://github.com/stanford-iris-lab/meta-harness/blob/main/reference_examples/terminal_bench_2/claude_wrapper.py"
click node_terminal_agent "https://github.com/stanford-iris-lab/meta-harness/blob/main/reference_examples/terminal_bench_2/agents/baseline_kira.py"
click node_cache "https://github.com/stanford-iris-lab/meta-harness/blob/main/reference_examples/terminal_bench_2/anthropic_caching.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_harbor_agent,node_harbor_search,node_harbor_eval,node_harbor_runtime toneBlue
class node_datasets,node_dataset_api,node_dataset_defs,node_evaluation,node_experiment_loop,node_memory,node_fewshot,node_fewshot_all,node_no_memory,node_llm,node_text_search,node_text_proposer toneAmber
class node_terminal_search,node_terminal_proposer,node_terminal_agent,node_cache toneMint
class node_proposer toneIndigo
```

## Components

### Harbor Framework

- [Terminal Harness Agent](https://github.com/stanford-iris-lab/meta-harness/blob/main/experimental/harbor_meta_harness/agents/terminal_harness.py): `experimental/harbor_meta_harness/agents/terminal_harness.py`
- [Harness Search](https://github.com/stanford-iris-lab/meta-harness/blob/main/experimental/harbor_meta_harness/agents/meta_harness.py): `experimental/harbor_meta_harness/agents/meta_harness.py`
- [Harbor Evaluator](https://github.com/stanford-iris-lab/meta-harness/blob/main/experimental/harbor_meta_harness/controller.py): `experimental/harbor_meta_harness/controller.py`
- **Harbor Runtime**

### Text Classification

- [Task Data](https://github.com/stanford-iris-lab/meta-harness/blob/main/reference_examples/text_classification/data/loaders.py): `reference_examples/text_classification/data/loaders.py`
- [Dataset Entry Points](https://github.com/stanford-iris-lab/meta-harness/blob/main/reference_examples/text_classification/data/api.py): `reference_examples/text_classification/data/api.py`
- [Task Definitions](https://github.com/stanford-iris-lab/meta-harness/blob/main/reference_examples/text_classification/data/constants.py): `reference_examples/text_classification/data/constants.py`
- [Prediction Evaluation](https://github.com/stanford-iris-lab/meta-harness/blob/main/reference_examples/text_classification/data/evaluators.py): `reference_examples/text_classification/data/evaluators.py`
- [Learning Loop](https://github.com/stanford-iris-lab/meta-harness/blob/main/reference_examples/text_classification/inner_loop.py): `reference_examples/text_classification/inner_loop.py`
- [Memory Interface](https://github.com/stanford-iris-lab/meta-harness/blob/main/reference_examples/text_classification/memory_system.py): `reference_examples/text_classification/memory_system.py`
- [Few-Shot Memory](https://github.com/stanford-iris-lab/meta-harness/blob/main/reference_examples/text_classification/agents/fewshot_memory.py): `reference_examples/text_classification/agents/fewshot_memory.py`
- [All-Example Baseline](https://github.com/stanford-iris-lab/meta-harness/blob/main/reference_examples/text_classification/agents/fewshot_all.py): `reference_examples/text_classification/agents/fewshot_all.py`
- [No-Memory Baseline](https://github.com/stanford-iris-lab/meta-harness/blob/main/reference_examples/text_classification/agents/no_memory.py): `reference_examples/text_classification/agents/no_memory.py`
- [LLM Client](https://github.com/stanford-iris-lab/meta-harness/blob/main/reference_examples/text_classification/llm.py): `reference_examples/text_classification/llm.py`
- [Text Harness Search](https://github.com/stanford-iris-lab/meta-harness/blob/main/reference_examples/text_classification/meta_harness.py): `reference_examples/text_classification/meta_harness.py`
- [Proposer Wrapper](https://github.com/stanford-iris-lab/meta-harness/blob/main/reference_examples/text_classification/claude_wrapper.py): `reference_examples/text_classification/claude_wrapper.py`

### Terminal Bench

- [Terminal Harness Search](https://github.com/stanford-iris-lab/meta-harness/blob/main/reference_examples/terminal_bench_2/meta_harness.py): `reference_examples/terminal_bench_2/meta_harness.py`
- [Proposer Wrapper](https://github.com/stanford-iris-lab/meta-harness/blob/main/reference_examples/terminal_bench_2/claude_wrapper.py): `reference_examples/terminal_bench_2/claude_wrapper.py`
- [Kira Agent](https://github.com/stanford-iris-lab/meta-harness/blob/main/reference_examples/terminal_bench_2/agents/baseline_kira.py): `reference_examples/terminal_bench_2/agents/baseline_kira.py`
- [Anthropic Cache](https://github.com/stanford-iris-lab/meta-harness/blob/main/reference_examples/terminal_bench_2/anthropic_caching.py): `reference_examples/terminal_bench_2/anthropic_caching.py`

### Other components

- **Coding Proposer**

## Connections

- Coding Proposer → Harness Search: proposes edits
- Harness Search → Harbor Evaluator: evaluates candidates (evidence: `experimental/harbor_meta_harness/agents/meta_harness.py`)
- Harbor Evaluator → Harbor Runtime: launches child (evidence: `experimental/harbor_meta_harness/controller.py`)
- Terminal Harness Agent → Harbor Runtime: runs task
- Learning Loop → Dataset Entry Points: loads splits (evidence: `reference_examples/text_classification/inner_loop.py`)
- Learning Loop → Memory Interface: learns and predicts (evidence: `reference_examples/text_classification/inner_loop.py`)
- Dataset Entry Points → Task Data: loads examples (evidence: `reference_examples/text_classification/data/api.py`)
- Dataset Entry Points → Task Definitions: uses task lists (evidence: `reference_examples/text_classification/data/api.py`)
- Dataset Entry Points → Prediction Evaluation: selects evaluator (evidence: `reference_examples/text_classification/data/api.py`)
- Few-Shot Memory → Memory Interface: implements (evidence: `reference_examples/text_classification/agents/fewshot_memory.py`)
- All-Example Baseline → Few-Shot Memory: reuses variant (evidence: `reference_examples/text_classification/agents/fewshot_all.py`)
- No-Memory Baseline → Memory Interface: implements (evidence: `reference_examples/text_classification/agents/no_memory.py`)
- Memory Interface → LLM Client: calls model (evidence: `reference_examples/text_classification/memory_system.py`)
- Few-Shot Memory → LLM Client: uses client (evidence: `reference_examples/text_classification/agents/fewshot_memory.py`)
- No-Memory Baseline → LLM Client: uses client (evidence: `reference_examples/text_classification/agents/no_memory.py`)
- Text Harness Search → Proposer Wrapper: calls wrapper (evidence: `reference_examples/text_classification/meta_harness.py`)
- Coding Proposer → Text Harness Search: proposes edits
- Terminal Harness Search → Proposer Wrapper: calls wrapper (evidence: `reference_examples/terminal_bench_2/meta_harness.py`)
- Coding Proposer → Terminal Harness Search: proposes edits
- Kira Agent → Anthropic Cache: uses cache (evidence: `reference_examples/terminal_bench_2/agents/baseline_kira.py`)
