# gen-verse/discoveryrsi architecture

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

- Interactive diagram: https://gitdiagram.com/gen-verse/discoveryrsi
- Repository: https://github.com/gen-verse/discoveryrsi

## Overview

DiscoveryRSI is a model-agnostic research-hypothesis harness. A user runs a local demo, a manifest-driven campaign, or a GEO/GO domain demo; campaigns generate candidates, critique and select them recursively, and append episodes to a replay file. The harness supplies model adapters, role instructions, manifests, and tool descriptions. Domain adapters turn user-supplied pathway or target records into candidates. The README also describes compiled Harbor tasks, model training, and DFM-Bench, but these are not implemented in the sampled runtime, so they are not mapped as repository components.

Main entry points: [`src/discovery_rsi/harness.py`](https://github.com/gen-verse/discoveryrsi/blob/main/src/discovery_rsi/harness.py) (Campaign harness), [`src/discovery_rsi/cli.py`](https://github.com/gen-verse/discoveryrsi/blob/main/src/discovery_rsi/cli.py) (CLI commands), [`src/discovery_rsi/go_domains.py`](https://github.com/gen-verse/discoveryrsi/blob/main/src/discovery_rsi/go_domains.py) (GEO/GO adapters), [`src/discovery_rsi/core.py`](https://github.com/gen-verse/discoveryrsi/blob/main/src/discovery_rsi/core.py) (Hypothesis loop)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Entry and domains"]
  node_cli["CLI commands<br/>[cli.py]"]
  node_domain["GEO/GO adapters<br/>[go_domains.py]"]
end

subgraph group_campaign["Campaign orchestration"]
  node_harness["Campaign harness<br/>[harness.py]"]
  node_manifest["Research manifest<br/>[manifest.py]"]
  node_roles["Role loader<br/>[plugin.py]"]
  node_tools["Tool registry<br/>[tools.py]"]
end

subgraph group_research["Research loop"]
  node_loop["Hypothesis loop<br/>[core.py]"]
  node_replay[("Episode replay<br/>[core.py]")]
end

subgraph group_integrations["Model integrations"]
  node_providers["Model adapters<br/>[providers.py]"]
end

node_user(("Researcher"))
node_model{{"Model endpoint or CLI"}}
node_records["User-supplied records"]

node_user -->|"runs"| node_cli
node_cli -->|"starts campaign"| node_harness
node_cli -->|"loads"| node_manifest
node_harness -->|"reads"| node_manifest
node_harness -->|"loads roles"| node_roles
node_harness -->|"describes tools"| node_tools
node_harness -->|"requests completions"| node_providers
node_providers -->|"sends prompts"| node_model
node_harness -->|"runs iterations"| node_loop
node_loop -->|"appends episodes"| node_replay
node_user -->|"supplies"| node_records
node_cli -->|"builds candidates"| node_domain
node_domain -->|"reads records"| node_records

click node_cli "https://github.com/gen-verse/discoveryrsi/blob/main/src/discovery_rsi/cli.py"
click node_domain "https://github.com/gen-verse/discoveryrsi/blob/main/src/discovery_rsi/go_domains.py"
click node_harness "https://github.com/gen-verse/discoveryrsi/blob/main/src/discovery_rsi/harness.py"
click node_manifest "https://github.com/gen-verse/discoveryrsi/blob/main/src/discovery_rsi/manifest.py"
click node_roles "https://github.com/gen-verse/discoveryrsi/blob/main/src/discovery_rsi/plugin.py"
click node_tools "https://github.com/gen-verse/discoveryrsi/blob/main/src/discovery_rsi/tools.py"
click node_providers "https://github.com/gen-verse/discoveryrsi/blob/main/src/discovery_rsi/providers.py"
click node_loop "https://github.com/gen-verse/discoveryrsi/blob/main/src/discovery_rsi/core.py"
click node_replay "https://github.com/gen-verse/discoveryrsi/blob/main/src/discovery_rsi/core.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_cli,node_domain,node_records toneBlue
class node_harness,node_manifest,node_roles,node_tools toneAmber
class node_loop,node_replay toneMint
class node_providers toneRose
class node_user,node_model toneIndigo
```

## Components

### Entry and domains

- [CLI commands](https://github.com/gen-verse/discoveryrsi/blob/main/src/discovery_rsi/cli.py): `src/discovery_rsi/cli.py`
- [GEO/GO adapters](https://github.com/gen-verse/discoveryrsi/blob/main/src/discovery_rsi/go_domains.py): `src/discovery_rsi/go_domains.py`

### Campaign orchestration

- [Campaign harness](https://github.com/gen-verse/discoveryrsi/blob/main/src/discovery_rsi/harness.py): `src/discovery_rsi/harness.py`
- [Research manifest](https://github.com/gen-verse/discoveryrsi/blob/main/src/discovery_rsi/manifest.py): `src/discovery_rsi/manifest.py`
- [Role loader](https://github.com/gen-verse/discoveryrsi/blob/main/src/discovery_rsi/plugin.py): `src/discovery_rsi/plugin.py`
- [Tool registry](https://github.com/gen-verse/discoveryrsi/blob/main/src/discovery_rsi/tools.py): `src/discovery_rsi/tools.py`

### Research loop

- [Hypothesis loop](https://github.com/gen-verse/discoveryrsi/blob/main/src/discovery_rsi/core.py): `src/discovery_rsi/core.py`
- [Episode replay](https://github.com/gen-verse/discoveryrsi/blob/main/src/discovery_rsi/core.py): `src/discovery_rsi/core.py`

### Model integrations

- [Model adapters](https://github.com/gen-verse/discoveryrsi/blob/main/src/discovery_rsi/providers.py): `src/discovery_rsi/providers.py`

### Other components

- **Researcher**
- **Model endpoint or CLI**
- **User-supplied records**

## Connections

- Researcher → CLI commands: runs (evidence: `README.md`)
- CLI commands → Campaign harness: starts campaign (evidence: `src/discovery_rsi/cli.py`)
- CLI commands → Research manifest: loads (evidence: `src/discovery_rsi/cli.py`)
- Campaign harness → Research manifest: reads (evidence: `src/discovery_rsi/harness.py`)
- Campaign harness → Role loader: loads roles (evidence: `src/discovery_rsi/harness.py`)
- Campaign harness → Tool registry: describes tools (evidence: `src/discovery_rsi/harness.py`)
- Campaign harness → Model adapters: requests completions (evidence: `src/discovery_rsi/harness.py`)
- Model adapters → Model endpoint or CLI: sends prompts (evidence: `src/discovery_rsi/providers.py`)
- Campaign harness → Hypothesis loop: runs iterations (evidence: `src/discovery_rsi/harness.py`)
- Hypothesis loop → Episode replay: appends episodes (evidence: `src/discovery_rsi/core.py`)
- Researcher → User-supplied records: supplies (evidence: `README.md`)
- CLI commands → GEO/GO adapters: builds candidates (evidence: `src/discovery_rsi/cli.py`)
- GEO/GO adapters → User-supplied records: reads records (evidence: `src/discovery_rsi/go_domains.py`)
