# yuhuajiang2002/harnessmm architecture

> Architecture diagram of the GitHub repository yuhuajiang2002/harnessmm, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-14). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/yuhuajiang2002/harnessmm
- Repository: https://github.com/yuhuajiang2002/harnessmm

## Overview

HarnessMM is an agent-harness efficiency system: an actor authors reusable actions, receipt checks gate their reuse, and eligible actions execute through native tools while recording substituted callbacks. Its companion recursive self-improvement work uses task feedback to refine prompts, context, and adapter rules, with validation selecting frozen candidates before testing. The repository also contains host integrations, task-specific harnesses, learning methods, and evaluation/accounting modules. Edges follow README-described behavior or explicit source-index references; many implementation details are unsampled, so uncertain links are omitted.

Main entry points: [`harnessmm/harness/gaia2_jev.py`](https://github.com/yuhuajiang2002/harnessmm/blob/main/harnessmm/harness/gaia2_jev.py) (GAIA2 continuations), [`dsh-plugin/harnessmm-desktop/lib/controller.mjs`](https://github.com/yuhuajiang2002/harnessmm/blob/main/dsh-plugin/harnessmm-desktop/lib/controller.mjs) (Receipt guard), [`harnessmm/harness/gaia2_cot_jev.py`](https://github.com/yuhuajiang2002/harnessmm/blob/main/harnessmm/harness/gaia2_cot_jev.py) (GAIA2 CoT Jev), [`harnessmm/learning/residual_meta_harness.py`](https://github.com/yuhuajiang2002/harnessmm/blob/main/harnessmm/learning/residual_meta_harness.py) (Residual meta-learning)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Decision reuse"]
  node_author["Action authoring<br/>[controller.mjs]"]
  node_guard["Receipt guard<br/>[controller.mjs]"]
  node_dispatch["Native dispatch<br/>[controller.mjs]"]
end

subgraph group_task["Task harnesses"]
  node_codex["Codex Chisel<br/>[codex_chisel.py]"]
  node_gaia["GAIA2 receipt graph"]
  node_gaiajev["GAIA2 continuations<br/>[gaia2_jev.py]"]
  node_cotjev["GAIA2 CoT Jev<br/>[gaia2_cot_jev.py]"]
  node_gaia_progress["GAIA2 progress"]
  node_gaia_state["GAIA2 state"]
  node_deferred["Deferred observations"]
  node_observation["Observation packing"]
  node_alfworld_jev["ALFWorld Jev<br/>[alfworld_jev.py]"]
  node_alfworld_pfn["ALFWorld PFN"]
end

subgraph group_learning["Learning and routing"]
  node_residual["Residual meta-learning"]
  node_router["QA quality-cost router"]
end

subgraph group_integrations["Host integrations"]
  node_deepseek["DeepSeek runner<br/>[runner.py]"]
  node_session["Session worker<br/>[session_worker.py]"]
end

subgraph group_research["Research and evaluation"]
  node_experiment["Experiment provenance<br/>[experiments.py]"]
  node_provenance["Data provenance<br/>[provenance.py]"]
  node_evaluation["Quality evaluation"]
  node_routing_eval["Routing evaluation"]
  node_gaia_runner["GAIA2 runner<br/>[run_gaia2_jev.py]"]
  node_alfworld_runner["ALFWorld worker"]
  node_alfworld_progress["ALFWorld progress"]
  node_chisel_runner["Chisel repair runner"]
end

node_actor(("Slow actor"))
node_tool["Native tools"]

node_actor -->|"authors actions"| node_author
node_author -->|"proposes graph"| node_guard
node_guard -->|"admits actions"| node_dispatch
node_dispatch -->|"executes natively"| node_tool
node_actor -->|"resumes reasoning"| node_guard
node_gaia -->|"uses continuations"| node_gaiajev
node_cotjev -->|"references"| node_gaiajev
node_cotjev -->|"references"| node_gaia_progress
node_gaiajev -->|"uses state progress"| node_gaia_state
node_deferred -->|"uses packing"| node_observation
node_residual -->|"supports routing"| node_router
node_deepseek -->|"references worker"| node_session
node_experiment -->|"uses provenance"| node_provenance
node_evaluation -->|"evaluates learning"| node_residual
node_routing_eval -->|"uses quality results"| node_evaluation
node_gaia_runner -->|"runs harness"| node_gaiajev
node_alfworld_runner -->|"runs learner"| node_alfworld_pfn
node_alfworld_jev -->|"references progress"| node_alfworld_progress
node_chisel_runner -->|"uses learner"| node_alfworld_pfn

click node_author "https://github.com/yuhuajiang2002/harnessmm/blob/main/dsh-plugin/harnessmm-desktop/lib/controller.mjs"
click node_guard "https://github.com/yuhuajiang2002/harnessmm/blob/main/dsh-plugin/harnessmm-desktop/lib/controller.mjs"
click node_dispatch "https://github.com/yuhuajiang2002/harnessmm/blob/main/dsh-plugin/harnessmm-desktop/lib/controller.mjs"
click node_codex "https://github.com/yuhuajiang2002/harnessmm/blob/main/harnessmm/harness/codex_chisel.py"
click node_gaia "https://github.com/yuhuajiang2002/harnessmm/blob/main/harnessmm/harness/gaia2_202060_progress.py"
click node_gaiajev "https://github.com/yuhuajiang2002/harnessmm/blob/main/harnessmm/harness/gaia2_jev.py"
click node_cotjev "https://github.com/yuhuajiang2002/harnessmm/blob/main/harnessmm/harness/gaia2_cot_jev.py"
click node_gaia_progress "https://github.com/yuhuajiang2002/harnessmm/blob/main/harnessmm/harness/gaia2_public_progress.py"
click node_gaia_state "https://github.com/yuhuajiang2002/harnessmm/blob/main/harnessmm/harness/gaia2_state_progress.py"
click node_deferred "https://github.com/yuhuajiang2002/harnessmm/blob/main/harnessmm/harness/deferred_observation_pack.py"
click node_observation "https://github.com/yuhuajiang2002/harnessmm/blob/main/harnessmm/harness/observation_pack.py"
click node_alfworld_jev "https://github.com/yuhuajiang2002/harnessmm/blob/main/harnessmm/learning/alfworld_jev.py"
click node_alfworld_pfn "https://github.com/yuhuajiang2002/harnessmm/blob/main/harnessmm/learning/alfworld_autosaddler_pfn.py"
click node_residual "https://github.com/yuhuajiang2002/harnessmm/blob/main/harnessmm/learning/residual_meta_harness.py"
click node_router "https://github.com/yuhuajiang2002/harnessmm/blob/main/harnessmm/learning/qa_quality_cost_router.py"
click node_deepseek "https://github.com/yuhuajiang2002/harnessmm/blob/main/integrations/deepseek_harness/runner.py"
click node_session "https://github.com/yuhuajiang2002/harnessmm/blob/main/integrations/deepseek_harness/session_worker.py"
click node_experiment "https://github.com/yuhuajiang2002/harnessmm/blob/main/harnessmm/experiments.py"
click node_provenance "https://github.com/yuhuajiang2002/harnessmm/blob/main/harnessmm/data_engine/provenance.py"
click node_evaluation "https://github.com/yuhuajiang2002/harnessmm/blob/main/harnessmm/evaluation/chisel_component_quality.py"
click node_routing_eval "https://github.com/yuhuajiang2002/harnessmm/blob/main/harnessmm/evaluation/routing_feature_quality.py"
click node_gaia_runner "https://github.com/yuhuajiang2002/harnessmm/blob/main/scripts/run_gaia2_jev.py"
click node_alfworld_runner "https://github.com/yuhuajiang2002/harnessmm/blob/main/scripts/run_alfworld_autosaddler_worker.py"
click node_alfworld_progress "https://github.com/yuhuajiang2002/harnessmm/blob/main/scripts/alfworld_public_progress.py"
click node_chisel_runner "https://github.com/yuhuajiang2002/harnessmm/blob/main/scripts/run_chisel_repair_alfworld.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_author,node_guard,node_dispatch toneBlue
class node_codex,node_gaia,node_gaiajev,node_cotjev,node_gaia_progress,node_gaia_state,node_deferred,node_observation,node_alfworld_jev,node_alfworld_pfn toneAmber
class node_residual,node_router toneMint
class node_deepseek,node_session toneRose
class node_experiment,node_provenance,node_evaluation,node_routing_eval,node_gaia_runner,node_alfworld_runner,node_alfworld_progress,node_chisel_runner,node_actor,node_tool toneIndigo
```

## Components

### Decision reuse

- [Action authoring](https://github.com/yuhuajiang2002/harnessmm/blob/main/dsh-plugin/harnessmm-desktop/lib/controller.mjs): `dsh-plugin/harnessmm-desktop/lib/controller.mjs`
- [Receipt guard](https://github.com/yuhuajiang2002/harnessmm/blob/main/dsh-plugin/harnessmm-desktop/lib/controller.mjs): `dsh-plugin/harnessmm-desktop/lib/controller.mjs`
- [Native dispatch](https://github.com/yuhuajiang2002/harnessmm/blob/main/dsh-plugin/harnessmm-desktop/lib/controller.mjs): `dsh-plugin/harnessmm-desktop/lib/controller.mjs`

### Task harnesses

- [Codex Chisel](https://github.com/yuhuajiang2002/harnessmm/blob/main/harnessmm/harness/codex_chisel.py): `harnessmm/harness/codex_chisel.py`
- [GAIA2 receipt graph](https://github.com/yuhuajiang2002/harnessmm/blob/main/harnessmm/harness/gaia2_202060_progress.py): `harnessmm/harness/gaia2_202060_progress.py`
- [GAIA2 continuations](https://github.com/yuhuajiang2002/harnessmm/blob/main/harnessmm/harness/gaia2_jev.py): `harnessmm/harness/gaia2_jev.py`
- [GAIA2 CoT Jev](https://github.com/yuhuajiang2002/harnessmm/blob/main/harnessmm/harness/gaia2_cot_jev.py): `harnessmm/harness/gaia2_cot_jev.py`
- [GAIA2 progress](https://github.com/yuhuajiang2002/harnessmm/blob/main/harnessmm/harness/gaia2_public_progress.py): `harnessmm/harness/gaia2_public_progress.py`
- [GAIA2 state](https://github.com/yuhuajiang2002/harnessmm/blob/main/harnessmm/harness/gaia2_state_progress.py): `harnessmm/harness/gaia2_state_progress.py`
- [Deferred observations](https://github.com/yuhuajiang2002/harnessmm/blob/main/harnessmm/harness/deferred_observation_pack.py): `harnessmm/harness/deferred_observation_pack.py`
- [Observation packing](https://github.com/yuhuajiang2002/harnessmm/blob/main/harnessmm/harness/observation_pack.py): `harnessmm/harness/observation_pack.py`
- [ALFWorld Jev](https://github.com/yuhuajiang2002/harnessmm/blob/main/harnessmm/learning/alfworld_jev.py): `harnessmm/learning/alfworld_jev.py`
- [ALFWorld PFN](https://github.com/yuhuajiang2002/harnessmm/blob/main/harnessmm/learning/alfworld_autosaddler_pfn.py): `harnessmm/learning/alfworld_autosaddler_pfn.py`

### Learning and routing

- [Residual meta-learning](https://github.com/yuhuajiang2002/harnessmm/blob/main/harnessmm/learning/residual_meta_harness.py): `harnessmm/learning/residual_meta_harness.py`
- [QA quality-cost router](https://github.com/yuhuajiang2002/harnessmm/blob/main/harnessmm/learning/qa_quality_cost_router.py): `harnessmm/learning/qa_quality_cost_router.py`

### Host integrations

- [DeepSeek runner](https://github.com/yuhuajiang2002/harnessmm/blob/main/integrations/deepseek_harness/runner.py): `integrations/deepseek_harness/runner.py`
- [Session worker](https://github.com/yuhuajiang2002/harnessmm/blob/main/integrations/deepseek_harness/session_worker.py): `integrations/deepseek_harness/session_worker.py`

### Research and evaluation

- [Experiment provenance](https://github.com/yuhuajiang2002/harnessmm/blob/main/harnessmm/experiments.py): `harnessmm/experiments.py`
- [Data provenance](https://github.com/yuhuajiang2002/harnessmm/blob/main/harnessmm/data_engine/provenance.py): `harnessmm/data_engine/provenance.py`
- [Quality evaluation](https://github.com/yuhuajiang2002/harnessmm/blob/main/harnessmm/evaluation/chisel_component_quality.py): `harnessmm/evaluation/chisel_component_quality.py`
- [Routing evaluation](https://github.com/yuhuajiang2002/harnessmm/blob/main/harnessmm/evaluation/routing_feature_quality.py): `harnessmm/evaluation/routing_feature_quality.py`
- [GAIA2 runner](https://github.com/yuhuajiang2002/harnessmm/blob/main/scripts/run_gaia2_jev.py): `scripts/run_gaia2_jev.py`
- [ALFWorld worker](https://github.com/yuhuajiang2002/harnessmm/blob/main/scripts/run_alfworld_autosaddler_worker.py): `scripts/run_alfworld_autosaddler_worker.py`
- [ALFWorld progress](https://github.com/yuhuajiang2002/harnessmm/blob/main/scripts/alfworld_public_progress.py): `scripts/alfworld_public_progress.py`
- [Chisel repair runner](https://github.com/yuhuajiang2002/harnessmm/blob/main/scripts/run_chisel_repair_alfworld.py): `scripts/run_chisel_repair_alfworld.py`

### Other components

- **Slow actor**
- **Native tools**

## Connections

- Slow actor → Action authoring: authors actions (evidence: `README.md`)
- Action authoring → Receipt guard: proposes graph (evidence: `README.md`)
- Receipt guard → Native dispatch: admits actions (evidence: `README.md`)
- Native dispatch → Native tools: executes natively (evidence: `README.md`)
- Slow actor → Receipt guard: resumes reasoning (evidence: `README.md`)
- GAIA2 receipt graph → GAIA2 continuations: uses continuations (evidence: `harnessmm/harness/gaia2_202060_progress.py`)
- GAIA2 CoT Jev → GAIA2 continuations: references (evidence: `harnessmm/harness/gaia2_cot_jev.py`)
- GAIA2 CoT Jev → GAIA2 progress: references (evidence: `harnessmm/harness/gaia2_cot_jev.py`)
- GAIA2 continuations → GAIA2 state: uses state progress (evidence: `harnessmm/harness/gaia2_jev.py`)
- Deferred observations → Observation packing: uses packing (evidence: `harnessmm/harness/deferred_observation_pack.py`)
- Residual meta-learning → QA quality-cost router: supports routing (evidence: `harnessmm/learning/qa_quality_cost_router.py`)
- DeepSeek runner → Session worker: references worker (evidence: `integrations/deepseek_harness/runner.py`)
- Experiment provenance → Data provenance: uses provenance (evidence: `harnessmm/experiments.py`)
- Quality evaluation → Residual meta-learning: evaluates learning (evidence: `harnessmm/evaluation/chisel_component_quality.py`)
- Routing evaluation → Quality evaluation: uses quality results (evidence: `harnessmm/evaluation/routing_feature_quality.py`)
- GAIA2 runner → GAIA2 continuations: runs harness (evidence: `scripts/run_gaia2_jev.py`)
- ALFWorld worker → ALFWorld PFN: runs learner (evidence: `scripts/run_alfworld_autosaddler_worker.py`)
- ALFWorld Jev → ALFWorld progress: references progress (evidence: `harnessmm/learning/alfworld_jev.py`)
- Chisel repair runner → ALFWorld PFN: uses learner (evidence: `scripts/run_chisel_repair_alfworld.py`)
