# futuretechlab/rh-garden architecture

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

- Interactive diagram: https://gitdiagram.com/futuretechlab/rh-garden
- Repository: https://github.com/futuretechlab/rh-garden

## Overview

RH Garden is a typed research graph and proof-search scaffold, not an RH prover: its documented result is route exploration, exact finite calculations, numerical research views, and separate kernel-checked Lean theorems. The main user workflow is to explore obligations and representations through the Navigator or CLI, inspect routes and trust levels, and keep experimental evidence distinct from formal proofs. README statements establish the high-level links; source excerpts confirm selected UI and candidate/regression calls. Unsampled runtime wiring is omitted where it cannot be supported.

Main entry points: [`app/Main.hs`](https://github.com/futuretechlab/rh-garden/blob/main/app/Main.hs) (CLI), [`src/RHGarden/Registry.hs`](https://github.com/futuretechlab/rh-garden/blob/main/src/RHGarden/Registry.hs) (Garden Registry), [`ui/src/App.tsx`](https://github.com/futuretechlab/rh-garden/blob/main/ui/src/App.tsx) (Navigator UI), [`ui/public/data`](https://github.com/futuretechlab/rh-garden/tree/main/ui/public/data) (Exported Data)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_model["Typed Research Model"]
  node_obligations["Obligations<br/>[Core.hs]"]
  node_representations["Representations<br/>[Representation.hs]"]
  node_registry["Garden Registry<br/>[Registry.hs]"]
end

subgraph group_runtime["Search And Checks"]
  node_cli["CLI<br/>[Main.hs]"]
  node_exact["Exact Algebra<br/>[Algebra.hs]"]
  node_mobius["Mobius Checker<br/>[Mobius.hs]"]
  node_evidence["Finite Evidence<br/>[Evidence.hs]"]
  node_search["Route Search<br/>[Search.hs]"]
  node_export["UI Export<br/>[UIExport.hs]"]
end

subgraph group_formal["Lean Proofs"]
  node_lean["Lean Theorems"]
end

subgraph group_explorer["Suzuki Research"]
  node_explorer["Suzuki Explorer<br/>[Suzuki.hs]"]
  node_sieve["Sieve Candidate"]
  node_sievecheck["Sieve Regression"]
  node_moments["Moment Candidate"]
  node_momentcheck["Moment Regression"]
  node_eventreport["Event Report"]
  node_surcharge["Surcharge Profile"]
end

subgraph group_navigator["Research Navigator"]
  node_navigator["Navigator UI<br/>[App.tsx]"]
  node_ui_types["Data Types<br/>[types.ts]"]
  node_ui_entry["UI Entry<br/>[main.tsx]"]
  node_json["Exported Data"]
end

node_researcher(("Researcher"))
node_browser(("Browser User"))

node_researcher -->|"runs commands"| node_cli
node_cli -.->|"loads routes"| node_registry
node_cli -.->|"finds paths"| node_search
node_cli -->|"checks identity"| node_mobius
node_obligations -.->|"registered in"| node_registry
node_representations -.->|"registered in"| node_registry
node_cli -.->|"runs finite checks"| node_evidence
node_researcher -->|"explores research"| node_navigator
node_ui_entry -->|"renders"| node_navigator
node_navigator -->|"uses data types"| node_ui_types
node_export -->|"writes JSON"| node_json
node_json -->|"feeds views"| node_navigator
node_registry -->|"supplies registry"| node_export
node_explorer -->|"supplies scans"| node_export
node_lean -.->|"backs trust labels"| node_registry
node_sievecheck -->|"validates candidate"| node_sieve
node_momentcheck -->|"checks bounds"| node_moments
node_browser -->|"inspects views"| node_navigator
node_eventreport -.->|"reads diagnostics"| node_json
node_surcharge -.->|"reads diagnostics"| node_json

click node_cli "https://github.com/futuretechlab/rh-garden/blob/main/app/Main.hs"
click node_obligations "https://github.com/futuretechlab/rh-garden/blob/main/src/RHGarden/Core.hs"
click node_representations "https://github.com/futuretechlab/rh-garden/blob/main/src/RHGarden/Representation.hs"
click node_exact "https://github.com/futuretechlab/rh-garden/blob/main/src/RHGarden/Algebra.hs"
click node_mobius "https://github.com/futuretechlab/rh-garden/blob/main/src/RHGarden/Mobius.hs"
click node_evidence "https://github.com/futuretechlab/rh-garden/blob/main/src/RHGarden/Evidence.hs"
click node_registry "https://github.com/futuretechlab/rh-garden/blob/main/src/RHGarden/Registry.hs"
click node_search "https://github.com/futuretechlab/rh-garden/blob/main/src/RHGarden/Search.hs"
click node_export "https://github.com/futuretechlab/rh-garden/blob/main/src/RHGarden/UIExport.hs"
click node_lean "https://github.com/futuretechlab/rh-garden/tree/main/formal/RHGarden"
click node_explorer "https://github.com/futuretechlab/rh-garden/blob/main/src/RHGarden/Explorer/Suzuki.hs"
click node_sieve "https://github.com/futuretechlab/rh-garden/blob/main/scripts/suzuki-sieve-candidate.mjs"
click node_sievecheck "https://github.com/futuretechlab/rh-garden/blob/main/scripts/suzuki-sieve-regression.mjs"
click node_moments "https://github.com/futuretechlab/rh-garden/blob/main/scripts/suzuki-moment-candidate.mjs"
click node_momentcheck "https://github.com/futuretechlab/rh-garden/blob/main/scripts/suzuki-moment-regression.mjs"
click node_eventreport "https://github.com/futuretechlab/rh-garden/blob/main/scripts/suzuki-event-report.mjs"
click node_surcharge "https://github.com/futuretechlab/rh-garden/blob/main/scripts/suzuki-surcharge-profile.mjs"
click node_navigator "https://github.com/futuretechlab/rh-garden/blob/main/ui/src/App.tsx"
click node_ui_types "https://github.com/futuretechlab/rh-garden/blob/main/ui/src/types.ts"
click node_ui_entry "https://github.com/futuretechlab/rh-garden/blob/main/ui/src/main.tsx"
click node_json "https://github.com/futuretechlab/rh-garden/tree/main/ui/public/data"

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_obligations,node_representations,node_registry,node_browser toneBlue
class node_cli,node_exact,node_mobius,node_evidence,node_search,node_export toneAmber
class node_lean toneMint
class node_explorer,node_sieve,node_sievecheck,node_moments,node_momentcheck,node_eventreport,node_surcharge toneRose
class node_navigator,node_ui_types,node_ui_entry,node_json,node_researcher toneIndigo
```

## Components

### Typed Research Model

- [Obligations](https://github.com/futuretechlab/rh-garden/blob/main/src/RHGarden/Core.hs): `src/RHGarden/Core.hs`
- [Representations](https://github.com/futuretechlab/rh-garden/blob/main/src/RHGarden/Representation.hs): `src/RHGarden/Representation.hs`
- [Garden Registry](https://github.com/futuretechlab/rh-garden/blob/main/src/RHGarden/Registry.hs): `src/RHGarden/Registry.hs`

### Search And Checks

- [CLI](https://github.com/futuretechlab/rh-garden/blob/main/app/Main.hs): `app/Main.hs`
- [Exact Algebra](https://github.com/futuretechlab/rh-garden/blob/main/src/RHGarden/Algebra.hs): `src/RHGarden/Algebra.hs`
- [Mobius Checker](https://github.com/futuretechlab/rh-garden/blob/main/src/RHGarden/Mobius.hs): `src/RHGarden/Mobius.hs`
- [Finite Evidence](https://github.com/futuretechlab/rh-garden/blob/main/src/RHGarden/Evidence.hs): `src/RHGarden/Evidence.hs`
- [Route Search](https://github.com/futuretechlab/rh-garden/blob/main/src/RHGarden/Search.hs): `src/RHGarden/Search.hs`
- [UI Export](https://github.com/futuretechlab/rh-garden/blob/main/src/RHGarden/UIExport.hs): `src/RHGarden/UIExport.hs`

### Lean Proofs

- [Lean Theorems](https://github.com/futuretechlab/rh-garden/tree/main/formal/RHGarden): `formal/RHGarden`

### Suzuki Research

- [Suzuki Explorer](https://github.com/futuretechlab/rh-garden/blob/main/src/RHGarden/Explorer/Suzuki.hs): `src/RHGarden/Explorer/Suzuki.hs`
- [Sieve Candidate](https://github.com/futuretechlab/rh-garden/blob/main/scripts/suzuki-sieve-candidate.mjs): `scripts/suzuki-sieve-candidate.mjs`
- [Sieve Regression](https://github.com/futuretechlab/rh-garden/blob/main/scripts/suzuki-sieve-regression.mjs): `scripts/suzuki-sieve-regression.mjs`
- [Moment Candidate](https://github.com/futuretechlab/rh-garden/blob/main/scripts/suzuki-moment-candidate.mjs): `scripts/suzuki-moment-candidate.mjs`
- [Moment Regression](https://github.com/futuretechlab/rh-garden/blob/main/scripts/suzuki-moment-regression.mjs): `scripts/suzuki-moment-regression.mjs`
- [Event Report](https://github.com/futuretechlab/rh-garden/blob/main/scripts/suzuki-event-report.mjs): `scripts/suzuki-event-report.mjs`
- [Surcharge Profile](https://github.com/futuretechlab/rh-garden/blob/main/scripts/suzuki-surcharge-profile.mjs): `scripts/suzuki-surcharge-profile.mjs`

### Research Navigator

- [Navigator UI](https://github.com/futuretechlab/rh-garden/blob/main/ui/src/App.tsx): `ui/src/App.tsx`
- [Data Types](https://github.com/futuretechlab/rh-garden/blob/main/ui/src/types.ts): `ui/src/types.ts`
- [UI Entry](https://github.com/futuretechlab/rh-garden/blob/main/ui/src/main.tsx): `ui/src/main.tsx`
- [Exported Data](https://github.com/futuretechlab/rh-garden/tree/main/ui/public/data): `ui/public/data`

### Other components

- **Researcher**
- **Browser User**

## Connections

- Researcher → CLI: runs commands (evidence: `README.md`)
- CLI → Garden Registry: loads routes
- CLI → Route Search: finds paths
- CLI → Mobius Checker: checks identity (evidence: `README.md`)
- Obligations → Garden Registry: registered in
- Representations → Garden Registry: registered in
- CLI → Finite Evidence: runs finite checks
- Researcher → Navigator UI: explores research (evidence: `README.md`)
- UI Entry → Navigator UI: renders (evidence: `ui/src/main.tsx`)
- Navigator UI → Data Types: uses data types (evidence: `ui/src/App.tsx`)
- UI Export → Exported Data: writes JSON (evidence: `README.md`)
- Exported Data → Navigator UI: feeds views (evidence: `README.md`)
- Garden Registry → UI Export: supplies registry (evidence: `README.md`)
- Suzuki Explorer → UI Export: supplies scans (evidence: `README.md`)
- Lean Theorems → Garden Registry: backs trust labels
- Sieve Regression → Sieve Candidate: validates candidate (evidence: `scripts/suzuki-sieve-regression.mjs`)
- Moment Regression → Moment Candidate: checks bounds (evidence: `scripts/suzuki-moment-regression.mjs`)
- Browser User → Navigator UI: inspects views (evidence: `README.md`)
- Event Report → Exported Data: reads diagnostics
- Surcharge Profile → Exported Data: reads diagnostics
