# neozork/monte-neo architecture

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

- Interactive diagram: https://gitdiagram.com/neozork/monte-neo
- Repository: https://github.com/neozork/monte-neo

## Overview

Monte-Neo independently evaluates trading backtests and strategies, returning a verdict, checks, next steps, and an optional signed certificate. The main workflow is a user invoking verification with price data and strategy code or positions; the product also includes repair, alpha-readiness analysis, discovery, reports, and agent-facing MCP tools. The graph preserves major documented subsystems, but several are represented only at their source-directory level because their implementation was not sampled. Edges are limited to README statements and relationships visible in excerpts or the source index.

Main entry points: [`src/monte_neo/verify/engine.py`](https://github.com/neozork/monte-neo/blob/main/src/monte_neo/verify/engine.py) (Verification engine), [`src/monte_neo/cli/app.py`](https://github.com/neozork/monte-neo/blob/main/src/monte_neo/cli/app.py) (CLI commands), [`src/monte_neo/core/mlx_engine.py`](https://github.com/neozork/monte-neo/blob/main/src/monte_neo/core/mlx_engine.py) (GPU simulation), [`src/monte_neo/cli/verify_cmd.py`](https://github.com/neozork/monte-neo/blob/main/src/monte_neo/cli/verify_cmd.py) (Verify command)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["User Interfaces"]
  node_cli["CLI commands<br/>[app.py]"]
  node_mcp["MCP tools<br/>[tools.py]"]
  node_verify_cmd["Verify command<br/>[verify_cmd.py]"]
end

subgraph group_verification["Verification Workflow"]
  node_ingest["Input ingestion<br/>[ingest.py]"]
  node_verify_engine["Verification engine<br/>[engine.py]"]
  node_verify_checks["Verification checks<br/>[checks.py]"]
  node_verdict["Verdicts and certificates<br/>[verdict.py]"]
  node_reports["Verification reports<br/>[report_html.py]"]
end

subgraph group_analysis["Strategy Analysis"]
  node_repair["Defect repair<br/>[run.py]"]
  node_alpha["Alpha readiness<br/>[process.py]"]
  node_discovery["Strategy discovery<br/>[search.py]"]
  node_dossier["Strategy dossier<br/>[build.py]"]
end

subgraph group_runtime["Trading Runtime"]
  node_backtest["Backtest engine<br/>[bar_engine.py]"]
  node_weights["Weight backtesting<br/>[weight_engine.py]"]
  node_indicators["Indicator framework<br/>[base.py]"]
  node_metrics["Metrics calculator<br/>[calculator.py]"]
  node_monte_carlo["Monte Carlo analysis<br/>[engine.py]"]
  node_oms["Paper order engine<br/>[engine.py]"]
end

subgraph group_platform["Execution Infrastructure"]
  node_gpu["GPU simulation<br/>[mlx_engine.py]"]
  node_gpu_scenarios["GPU scenario engine<br/>[gpu_scenarios.py]"]
  node_metal["Metal acceleration<br/>[engine.py]"]
  node_storage[("Market data storage<br/>[storage.py]")]
end

node_user(("Quant or agent"))

node_user -->|"invokes"| node_cli
node_user -->|"uses"| node_mcp
node_cli -->|"routes"| node_verify_cmd
node_user -->|"submits strategy"| node_verify_engine
node_verify_cmd -.->|"loads inputs"| node_ingest
node_verify_engine -->|"runs backtest"| node_backtest
node_verify_engine -->|"runs backtest"| node_weights
node_verify_engine -.->|"evaluates"| node_verify_checks
node_verify_engine -.->|"produces"| node_verdict
node_verdict -.->|"feeds report"| node_reports
node_cli -->|"offers repair"| node_repair
node_cli -->|"offers alpha"| node_alpha
node_indicators -->|"provides signals"| node_gpu
node_monte_carlo -.->|"dispatches scenarios"| node_gpu_scenarios
node_gpu -->|"uses acceleration"| node_metal
node_gpu -->|"generates scenarios"| node_gpu_scenarios

click node_cli "https://github.com/neozork/monte-neo/blob/main/src/monte_neo/cli/app.py"
click node_mcp "https://github.com/neozork/monte-neo/blob/main/src/monte_neo/mcp/tools.py"
click node_verify_cmd "https://github.com/neozork/monte-neo/blob/main/src/monte_neo/cli/verify_cmd.py"
click node_ingest "https://github.com/neozork/monte-neo/blob/main/src/monte_neo/verify/ingest.py"
click node_verify_engine "https://github.com/neozork/monte-neo/blob/main/src/monte_neo/verify/engine.py"
click node_verify_checks "https://github.com/neozork/monte-neo/blob/main/src/monte_neo/verify/checks.py"
click node_verdict "https://github.com/neozork/monte-neo/blob/main/src/monte_neo/verify/verdict.py"
click node_reports "https://github.com/neozork/monte-neo/blob/main/src/monte_neo/verify/report_html.py"
click node_repair "https://github.com/neozork/monte-neo/blob/main/src/monte_neo/repair/run.py"
click node_alpha "https://github.com/neozork/monte-neo/blob/main/src/monte_neo/alpha/process.py"
click node_discovery "https://github.com/neozork/monte-neo/blob/main/src/monte_neo/discover/search.py"
click node_dossier "https://github.com/neozork/monte-neo/blob/main/src/monte_neo/dossier/build.py"
click node_backtest "https://github.com/neozork/monte-neo/blob/main/src/monte_neo/backtest/bar_engine.py"
click node_weights "https://github.com/neozork/monte-neo/blob/main/src/monte_neo/backtest/weight_engine.py"
click node_indicators "https://github.com/neozork/monte-neo/blob/main/src/monte_neo/indicators/base.py"
click node_metrics "https://github.com/neozork/monte-neo/blob/main/src/monte_neo/metrics/calculator.py"
click node_monte_carlo "https://github.com/neozork/monte-neo/blob/main/src/monte_neo/monte_carlo/engine.py"
click node_oms "https://github.com/neozork/monte-neo/blob/main/src/monte_neo/oms/engine.py"
click node_gpu "https://github.com/neozork/monte-neo/blob/main/src/monte_neo/core/mlx_engine.py"
click node_gpu_scenarios "https://github.com/neozork/monte-neo/blob/main/src/monte_neo/core/gpu_scenarios.py"
click node_metal "https://github.com/neozork/monte-neo/blob/main/src/monte_neo/core/acceleration/engine.py"
click node_storage "https://github.com/neozork/monte-neo/blob/main/src/monte_neo/data/storage.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_mcp,node_verify_cmd toneBlue
class node_ingest,node_verify_engine,node_verify_checks,node_verdict,node_reports toneAmber
class node_repair,node_alpha,node_discovery,node_dossier toneMint
class node_backtest,node_weights,node_indicators,node_metrics,node_monte_carlo,node_oms toneRose
class node_gpu,node_gpu_scenarios,node_metal,node_storage,node_user toneIndigo
```

## Components

### User Interfaces

- [CLI commands](https://github.com/neozork/monte-neo/blob/main/src/monte_neo/cli/app.py): `src/monte_neo/cli/app.py`
- [MCP tools](https://github.com/neozork/monte-neo/blob/main/src/monte_neo/mcp/tools.py): `src/monte_neo/mcp/tools.py`
- [Verify command](https://github.com/neozork/monte-neo/blob/main/src/monte_neo/cli/verify_cmd.py): `src/monte_neo/cli/verify_cmd.py`

### Verification Workflow

- [Input ingestion](https://github.com/neozork/monte-neo/blob/main/src/monte_neo/verify/ingest.py): `src/monte_neo/verify/ingest.py`
- [Verification engine](https://github.com/neozork/monte-neo/blob/main/src/monte_neo/verify/engine.py): `src/monte_neo/verify/engine.py`
- [Verification checks](https://github.com/neozork/monte-neo/blob/main/src/monte_neo/verify/checks.py): `src/monte_neo/verify/checks.py`
- [Verdicts and certificates](https://github.com/neozork/monte-neo/blob/main/src/monte_neo/verify/verdict.py): `src/monte_neo/verify/verdict.py`
- [Verification reports](https://github.com/neozork/monte-neo/blob/main/src/monte_neo/verify/report_html.py): `src/monte_neo/verify/report_html.py`

### Strategy Analysis

- [Defect repair](https://github.com/neozork/monte-neo/blob/main/src/monte_neo/repair/run.py): `src/monte_neo/repair/run.py`
- [Alpha readiness](https://github.com/neozork/monte-neo/blob/main/src/monte_neo/alpha/process.py): `src/monte_neo/alpha/process.py`
- [Strategy discovery](https://github.com/neozork/monte-neo/blob/main/src/monte_neo/discover/search.py): `src/monte_neo/discover/search.py`
- [Strategy dossier](https://github.com/neozork/monte-neo/blob/main/src/monte_neo/dossier/build.py): `src/monte_neo/dossier/build.py`

### Trading Runtime

- [Backtest engine](https://github.com/neozork/monte-neo/blob/main/src/monte_neo/backtest/bar_engine.py): `src/monte_neo/backtest/bar_engine.py`
- [Weight backtesting](https://github.com/neozork/monte-neo/blob/main/src/monte_neo/backtest/weight_engine.py): `src/monte_neo/backtest/weight_engine.py`
- [Indicator framework](https://github.com/neozork/monte-neo/blob/main/src/monte_neo/indicators/base.py): `src/monte_neo/indicators/base.py`
- [Metrics calculator](https://github.com/neozork/monte-neo/blob/main/src/monte_neo/metrics/calculator.py): `src/monte_neo/metrics/calculator.py`
- [Monte Carlo analysis](https://github.com/neozork/monte-neo/blob/main/src/monte_neo/monte_carlo/engine.py): `src/monte_neo/monte_carlo/engine.py`
- [Paper order engine](https://github.com/neozork/monte-neo/blob/main/src/monte_neo/oms/engine.py): `src/monte_neo/oms/engine.py`

### Execution Infrastructure

- [GPU simulation](https://github.com/neozork/monte-neo/blob/main/src/monte_neo/core/mlx_engine.py): `src/monte_neo/core/mlx_engine.py`
- [GPU scenario engine](https://github.com/neozork/monte-neo/blob/main/src/monte_neo/core/gpu_scenarios.py): `src/monte_neo/core/gpu_scenarios.py`
- [Metal acceleration](https://github.com/neozork/monte-neo/blob/main/src/monte_neo/core/acceleration/engine.py): `src/monte_neo/core/acceleration/engine.py`
- [Market data storage](https://github.com/neozork/monte-neo/blob/main/src/monte_neo/data/storage.py): `src/monte_neo/data/storage.py`

### Other components

- **Quant or agent**

## Connections

- Quant or agent → CLI commands: invokes
- Quant or agent → MCP tools: uses
- CLI commands → Verify command: routes (evidence: `src/monte_neo/cli/app.py`)
- Quant or agent → Verification engine: submits strategy
- Verify command → Input ingestion: loads inputs
- Verification engine → Backtest engine: runs backtest (evidence: `src/monte_neo/verify/engine.py`)
- Verification engine → Weight backtesting: runs backtest (evidence: `src/monte_neo/verify/engine.py`)
- Verification engine → Verification checks: evaluates
- Verification engine → Verdicts and certificates: produces
- Verdicts and certificates → Verification reports: feeds report
- CLI commands → Defect repair: offers repair
- CLI commands → Alpha readiness: offers alpha
- Indicator framework → GPU simulation: provides signals (evidence: `src/monte_neo/core/mlx_engine.py`)
- Monte Carlo analysis → GPU scenario engine: dispatches scenarios
- GPU simulation → Metal acceleration: uses acceleration (evidence: `src/monte_neo/core/acceleration/engine.py`)
- GPU simulation → GPU scenario engine: generates scenarios (evidence: `src/monte_neo/core/mlx_engine.py`)
