# zyan-zhong/repair architecture

> Architecture diagram of the GitHub repository zyan-zhong/repair, 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/zyan-zhong/repair
- Repository: https://github.com/zyan-zhong/repair

## Overview

RePair is a research framework for testing whether proposed repairs produce verified lessons that improve a policy. Its documented workflow runs paired environment tests, derives supervision from verified evidence, updates a policy, then evaluates it without research memory or repair interventions. The graph includes the registered campaign entry and selected framework/runtime capabilities; most implementation wiring is not shown in the sampled source, so uncertain links are omitted. Historical registered snapshots are not assumed to be the active execution authority.

Main entry points: [`runtime/packages/package-123e43da6811/entry/driver.py`](https://github.com/zyan-zhong/repair/blob/main/runtime/packages/package-123e43da6811/entry/driver.py) (Round driver), [`runtime/packages/package-123e43da6811/entry/main.py`](https://github.com/zyan-zhong/repair/blob/main/runtime/packages/package-123e43da6811/entry/main.py) (Campaign entry), [`runtime/packages/MAX10_V2_0_4_EXECUTABLE_FEEDBACK-417999ec97fc/repair_feedback.py`](https://github.com/zyan-zhong/repair/blob/main/runtime/packages/MAX10_V2_0_4_EXECUTABLE_FEEDBACK-417999ec97fc/repair_feedback.py) (Repair feedback), [`runtime/packages/package-123e43da6811/offoff_binding/native.py`](https://github.com/zyan-zhong/repair/blob/main/runtime/packages/package-123e43da6811/offoff_binding/native.py) (Native worker)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_campaign["Campaign Runtime"]
  node_entry["Campaign entry<br/>[main.py]"]
  node_owner["Campaign owner<br/>[campaign_owner.py]"]
  node_driver["Round driver<br/>[driver.py]"]
  node_training["Training binding<br/>[training.py]"]
end

subgraph group_research["Repair Research"]
  node_planner["Strategy planner"]
  node_feedback["Repair feedback<br/>[repair_feedback.py]"]
  node_trajectory["Trajectory facts"]
end

subgraph group_evidence["Evidence and Evaluation"]
  node_native["Native worker<br/>[native.py]"]
  node_parallel["Parallel execution<br/>[parallel.py]"]
  node_outcome["Outcome routing<br/>[outcome_router.py]"]
  node_policy["Policy client<br/>[policy_client.py]"]
end

subgraph group_continuity["Memory and Continuity"]
  node_memory["Memory binding<br/>[api.py]"]
  node_continuity["Continuity binding<br/>[api.py]"]
end

node_researcher(("Researcher"))
node_environment{{"Paired environments"}}

node_researcher -->|"starts campaign"| node_entry
node_entry -->|"selects owner"| node_owner
node_entry -->|"runs rounds"| node_driver
node_driver -->|"dispatches work"| node_native
node_native -->|"executes shards"| node_parallel
node_parallel -->|"tests repairs"| node_environment
node_outcome -->|"routes evidence"| node_feedback
node_feedback -->|"projects facts"| node_trajectory
node_driver -->|"supplies evidence"| node_outcome
node_driver -->|"requests planning"| node_planner
node_driver -->|"requests update"| node_training
node_driver -->|"evaluates policy"| node_policy
node_entry -->|"bootstraps memory"| node_memory
node_entry -->|"binds continuity"| node_continuity
node_policy -.->|"sends policy calls"| node_environment

click node_entry "https://github.com/zyan-zhong/repair/blob/main/runtime/packages/package-123e43da6811/entry/main.py"
click node_owner "https://github.com/zyan-zhong/repair/blob/main/runtime/packages/package-123e43da6811/entry/campaign_owner.py"
click node_driver "https://github.com/zyan-zhong/repair/blob/main/runtime/packages/package-123e43da6811/entry/driver.py"
click node_native "https://github.com/zyan-zhong/repair/blob/main/runtime/packages/package-123e43da6811/offoff_binding/native.py"
click node_parallel "https://github.com/zyan-zhong/repair/blob/main/runtime/packages/package-123e43da6811/offoff_binding/parallel.py"
click node_outcome "https://github.com/zyan-zhong/repair/blob/main/src/pchsi/analyzer/outcome_router.py"
click node_planner "https://github.com/zyan-zhong/repair/blob/main/runtime/packages/MAX10_V2_1_1_EXECUTABLE_PLANNER_VALIDATION-0c20fc82ebc2/strategy_planner.py"
click node_feedback "https://github.com/zyan-zhong/repair/blob/main/runtime/packages/MAX10_V2_0_4_EXECUTABLE_FEEDBACK-417999ec97fc/repair_feedback.py"
click node_trajectory "https://github.com/zyan-zhong/repair/blob/main/runtime/packages/MAX10_V2_0_4_EXECUTABLE_FEEDBACK-417999ec97fc/trajectory_facts.py"
click node_memory "https://github.com/zyan-zhong/repair/blob/main/runtime/packages/package-123e43da6811/memory_binding/api.py"
click node_continuity "https://github.com/zyan-zhong/repair/blob/main/runtime/packages/package-123e43da6811/continuity_binding/api.py"
click node_training "https://github.com/zyan-zhong/repair/blob/main/runtime/packages/package-123e43da6811/entry/training.py"
click node_policy "https://github.com/zyan-zhong/repair/blob/main/src/pchsi/evaluation/policy_client.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_entry,node_owner,node_driver,node_training toneBlue
class node_planner,node_feedback,node_trajectory toneAmber
class node_native,node_parallel,node_outcome,node_policy toneMint
class node_memory,node_continuity toneRose
class node_researcher,node_environment toneIndigo
```

## Components

### Campaign Runtime

- [Campaign entry](https://github.com/zyan-zhong/repair/blob/main/runtime/packages/package-123e43da6811/entry/main.py): `runtime/packages/package-123e43da6811/entry/main.py`
- [Campaign owner](https://github.com/zyan-zhong/repair/blob/main/runtime/packages/package-123e43da6811/entry/campaign_owner.py): `runtime/packages/package-123e43da6811/entry/campaign_owner.py`
- [Round driver](https://github.com/zyan-zhong/repair/blob/main/runtime/packages/package-123e43da6811/entry/driver.py): `runtime/packages/package-123e43da6811/entry/driver.py`
- [Training binding](https://github.com/zyan-zhong/repair/blob/main/runtime/packages/package-123e43da6811/entry/training.py): `runtime/packages/package-123e43da6811/entry/training.py`

### Repair Research

- [Strategy planner](https://github.com/zyan-zhong/repair/blob/main/runtime/packages/MAX10_V2_1_1_EXECUTABLE_PLANNER_VALIDATION-0c20fc82ebc2/strategy_planner.py): `runtime/packages/MAX10_V2_1_1_EXECUTABLE_PLANNER_VALIDATION-0c20fc82ebc2/strategy_planner.py`
- [Repair feedback](https://github.com/zyan-zhong/repair/blob/main/runtime/packages/MAX10_V2_0_4_EXECUTABLE_FEEDBACK-417999ec97fc/repair_feedback.py): `runtime/packages/MAX10_V2_0_4_EXECUTABLE_FEEDBACK-417999ec97fc/repair_feedback.py`
- [Trajectory facts](https://github.com/zyan-zhong/repair/blob/main/runtime/packages/MAX10_V2_0_4_EXECUTABLE_FEEDBACK-417999ec97fc/trajectory_facts.py): `runtime/packages/MAX10_V2_0_4_EXECUTABLE_FEEDBACK-417999ec97fc/trajectory_facts.py`

### Evidence and Evaluation

- [Native worker](https://github.com/zyan-zhong/repair/blob/main/runtime/packages/package-123e43da6811/offoff_binding/native.py): `runtime/packages/package-123e43da6811/offoff_binding/native.py`
- [Parallel execution](https://github.com/zyan-zhong/repair/blob/main/runtime/packages/package-123e43da6811/offoff_binding/parallel.py): `runtime/packages/package-123e43da6811/offoff_binding/parallel.py`
- [Outcome routing](https://github.com/zyan-zhong/repair/blob/main/src/pchsi/analyzer/outcome_router.py): `src/pchsi/analyzer/outcome_router.py`
- [Policy client](https://github.com/zyan-zhong/repair/blob/main/src/pchsi/evaluation/policy_client.py): `src/pchsi/evaluation/policy_client.py`

### Memory and Continuity

- [Memory binding](https://github.com/zyan-zhong/repair/blob/main/runtime/packages/package-123e43da6811/memory_binding/api.py): `runtime/packages/package-123e43da6811/memory_binding/api.py`
- [Continuity binding](https://github.com/zyan-zhong/repair/blob/main/runtime/packages/package-123e43da6811/continuity_binding/api.py): `runtime/packages/package-123e43da6811/continuity_binding/api.py`

### Other components

- **Researcher**
- **Paired environments**

## Connections

- Researcher → Campaign entry: starts campaign
- Campaign entry → Campaign owner: selects owner
- Campaign entry → Round driver: runs rounds
- Round driver → Native worker: dispatches work
- Native worker → Parallel execution: executes shards
- Parallel execution → Paired environments: tests repairs
- Outcome routing → Repair feedback: routes evidence
- Repair feedback → Trajectory facts: projects facts
- Round driver → Outcome routing: supplies evidence
- Round driver → Strategy planner: requests planning
- Round driver → Training binding: requests update
- Round driver → Policy client: evaluates policy
- Campaign entry → Memory binding: bootstraps memory
- Campaign entry → Continuity binding: binds continuity
- Policy client → Paired environments: sends policy calls
