# giacomoghi/ath-quant-desk architecture

> Architecture diagram of the GitHub repository giacomoghi/ath-quant-desk, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-05). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/giacomoghi/ath-quant-desk
- Repository: https://github.com/giacomoghi/ath-quant-desk

## Overview

ATH Quant Desk is a playbook-and-folder protocol for AI agents, not a trading engine. Agents use the shared pipeline of idea cards to move research through design, analysis, build, verification, staged validation and demo incubation; the platform performs trading-system work through MCP. Separate roles handle portfolio and prop-firm work, coordinated by the head of desk. An optional visual desk replays or streams pipeline activity and exposes documents subject to privacy mode. Workflow links follow the README; the visual links are limited to relationships shown in the excerpts.

Main entry points: [`viz/server.mjs`](https://github.com/giacomoghi/ath-quant-desk/blob/main/viz/server.mjs) (Visual desk server), [`roles/builder.md`](https://github.com/giacomoghi/ath-quant-desk/blob/main/roles/builder.md) (Builder), [`roles/verifier.md`](https://github.com/giacomoghi/ath-quant-desk/blob/main/roles/verifier.md) (Verifier), [`roles/quant.md`](https://github.com/giacomoghi/ath-quant-desk/blob/main/roles/quant.md) (Quant)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_desk["Desk protocol"]
  node_charter["Desk rules<br/>[charter.md]"]
  node_design["Team design<br/>[design.md]"]
  node_protocol["Pipeline protocol<br/>[pipeline.md]"]
  node_settings["Owner thresholds"]
  node_lead_template["Lead template<br/>[lead.md]"]
  node_card_template["Idea card template<br/>[idea-card.md]"]
  node_pipeline[("Shared card pipeline")]
end

subgraph group_workflow["Idea workflow"]
  node_scout["Scout<br/>[scout.md]"]
  node_designer["Designer<br/>[designer.md]"]
  node_analyst["Analyst<br/>[analyst.md]"]
  node_builder["Builder<br/>[builder.md]"]
  node_verifier["Verifier<br/>[verifier.md]"]
  node_quant["Quant<br/>[quant.md]"]
end

subgraph group_operations["Portfolio operations"]
  node_pm["Portfolio manager"]
  node_prop["Prop strategist<br/>[prop-strategist.md]"]
  node_head["Head of desk<br/>[head-of-desk.md]"]
end

subgraph group_visual["Visual desk"]
  node_vizserver["Visual desk server<br/>[server.mjs]"]
  node_args["CLI configuration<br/>[args.mjs]"]
  node_timeline["Timeline builder<br/>[pipeline.mjs]"]
  node_library["Document library<br/>[library.mjs]"]
  node_board["Replay board<br/>[desk.js]"]
  node_inspector["Detail inspector<br/>[inspect.js]"]
end

node_owner(("Desk owner"))
node_agent(("Coding agent"))
node_platform{{"AlgoTradingHub"}}

node_owner -->|"starts role"| node_agent
node_agent -->|"runs playbook"| node_scout
node_agent -->|"runs playbook"| node_designer
node_agent -->|"runs playbook"| node_analyst
node_agent -->|"runs playbook"| node_builder
node_agent -->|"runs playbook"| node_verifier
node_agent -->|"runs playbook"| node_quant
node_agent -->|"runs playbook"| node_pm
node_agent -->|"runs playbook"| node_prop
node_agent -->|"runs playbook"| node_head
node_head -->|"dispatches roles"| node_agent
node_scout -->|"creates leads"| node_pipeline
node_designer -->|"creates ideas"| node_pipeline
node_analyst -->|"writes cards"| node_pipeline
node_pipeline -->|"supplies cards"| node_builder
node_builder -->|"builds strategy"| node_platform
node_builder -->|"logs smoke run"| node_pipeline
node_pipeline -->|"supplies strategy"| node_verifier
node_verifier -->|"checks trades"| node_platform
node_verifier -->|"logs checks"| node_pipeline
node_pipeline -->|"supplies card"| node_quant
node_quant -->|"runs validation"| node_platform
node_quant -->|"logs results"| node_pipeline
node_pipeline -->|"supplies strategies"| node_pm
node_pm -->|"incubates demos"| node_platform
node_pipeline -->|"supplies warnings"| node_prop
node_pm -.->|"records portfolios"| node_pipeline
node_prop -.->|"records plans"| node_pipeline
node_owner -->|"sets thresholds"| node_settings
node_analyst -->|"uses template"| node_card_template
node_scout -.->|"uses template"| node_lead_template
node_agent -->|"connects via MCP"| node_platform
node_vizserver -->|"reads options"| node_args
node_vizserver -->|"builds timeline"| node_timeline
node_vizserver -->|"serves documents"| node_library
node_timeline -->|"reads events"| node_pipeline
node_library -->|"uses snapshot"| node_timeline
node_library -->|"reads card files"| node_pipeline
node_vizserver -->|"serves interface"| node_board
node_board -->|"opens details"| node_inspector
node_inspector -->|"requests documents"| node_vizserver

click node_charter "https://github.com/giacomoghi/ath-quant-desk/blob/main/docs/charter.md"
click node_design "https://github.com/giacomoghi/ath-quant-desk/blob/main/docs/design.md"
click node_protocol "https://github.com/giacomoghi/ath-quant-desk/blob/main/docs/pipeline.md"
click node_settings "https://github.com/giacomoghi/ath-quant-desk/blob/main/settings.example.yaml"
click node_lead_template "https://github.com/giacomoghi/ath-quant-desk/blob/main/templates/lead.md"
click node_card_template "https://github.com/giacomoghi/ath-quant-desk/blob/main/templates/idea-card.md"
click node_scout "https://github.com/giacomoghi/ath-quant-desk/blob/main/roles/scout.md"
click node_designer "https://github.com/giacomoghi/ath-quant-desk/blob/main/roles/designer.md"
click node_analyst "https://github.com/giacomoghi/ath-quant-desk/blob/main/roles/analyst.md"
click node_builder "https://github.com/giacomoghi/ath-quant-desk/blob/main/roles/builder.md"
click node_verifier "https://github.com/giacomoghi/ath-quant-desk/blob/main/roles/verifier.md"
click node_quant "https://github.com/giacomoghi/ath-quant-desk/blob/main/roles/quant.md"
click node_pm "https://github.com/giacomoghi/ath-quant-desk/blob/main/roles/portfolio-manager.md"
click node_prop "https://github.com/giacomoghi/ath-quant-desk/blob/main/roles/prop-strategist.md"
click node_head "https://github.com/giacomoghi/ath-quant-desk/blob/main/roles/head-of-desk.md"
click node_vizserver "https://github.com/giacomoghi/ath-quant-desk/blob/main/viz/server.mjs"
click node_args "https://github.com/giacomoghi/ath-quant-desk/blob/main/viz/lib/args.mjs"
click node_timeline "https://github.com/giacomoghi/ath-quant-desk/blob/main/viz/lib/pipeline.mjs"
click node_library "https://github.com/giacomoghi/ath-quant-desk/blob/main/viz/lib/library.mjs"
click node_board "https://github.com/giacomoghi/ath-quant-desk/blob/main/viz/desk.js"
click node_inspector "https://github.com/giacomoghi/ath-quant-desk/blob/main/viz/inspect.js"

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_charter,node_design,node_protocol,node_settings,node_lead_template,node_card_template,node_pipeline toneBlue
class node_scout,node_designer,node_analyst,node_builder,node_verifier,node_quant toneAmber
class node_pm,node_prop,node_head toneMint
class node_vizserver,node_args,node_timeline,node_library,node_board,node_inspector toneRose
class node_owner,node_agent,node_platform toneIndigo
```

## Components

### Desk protocol

- [Desk rules](https://github.com/giacomoghi/ath-quant-desk/blob/main/docs/charter.md): `docs/charter.md`
- [Team design](https://github.com/giacomoghi/ath-quant-desk/blob/main/docs/design.md): `docs/design.md`
- [Pipeline protocol](https://github.com/giacomoghi/ath-quant-desk/blob/main/docs/pipeline.md): `docs/pipeline.md`
- [Owner thresholds](https://github.com/giacomoghi/ath-quant-desk/blob/main/settings.example.yaml): `settings.example.yaml`
- [Lead template](https://github.com/giacomoghi/ath-quant-desk/blob/main/templates/lead.md): `templates/lead.md`
- [Idea card template](https://github.com/giacomoghi/ath-quant-desk/blob/main/templates/idea-card.md): `templates/idea-card.md`
- **Shared card pipeline**

### Idea workflow

- [Scout](https://github.com/giacomoghi/ath-quant-desk/blob/main/roles/scout.md): `roles/scout.md`
- [Designer](https://github.com/giacomoghi/ath-quant-desk/blob/main/roles/designer.md): `roles/designer.md`
- [Analyst](https://github.com/giacomoghi/ath-quant-desk/blob/main/roles/analyst.md): `roles/analyst.md`
- [Builder](https://github.com/giacomoghi/ath-quant-desk/blob/main/roles/builder.md): `roles/builder.md`
- [Verifier](https://github.com/giacomoghi/ath-quant-desk/blob/main/roles/verifier.md): `roles/verifier.md`
- [Quant](https://github.com/giacomoghi/ath-quant-desk/blob/main/roles/quant.md): `roles/quant.md`

### Portfolio operations

- [Portfolio manager](https://github.com/giacomoghi/ath-quant-desk/blob/main/roles/portfolio-manager.md): `roles/portfolio-manager.md`
- [Prop strategist](https://github.com/giacomoghi/ath-quant-desk/blob/main/roles/prop-strategist.md): `roles/prop-strategist.md`
- [Head of desk](https://github.com/giacomoghi/ath-quant-desk/blob/main/roles/head-of-desk.md): `roles/head-of-desk.md`

### Visual desk

- [Visual desk server](https://github.com/giacomoghi/ath-quant-desk/blob/main/viz/server.mjs): `viz/server.mjs`
- [CLI configuration](https://github.com/giacomoghi/ath-quant-desk/blob/main/viz/lib/args.mjs): `viz/lib/args.mjs`
- [Timeline builder](https://github.com/giacomoghi/ath-quant-desk/blob/main/viz/lib/pipeline.mjs): `viz/lib/pipeline.mjs`
- [Document library](https://github.com/giacomoghi/ath-quant-desk/blob/main/viz/lib/library.mjs): `viz/lib/library.mjs`
- [Replay board](https://github.com/giacomoghi/ath-quant-desk/blob/main/viz/desk.js): `viz/desk.js`
- [Detail inspector](https://github.com/giacomoghi/ath-quant-desk/blob/main/viz/inspect.js): `viz/inspect.js`

### Other components

- **Desk owner**
- **Coding agent**
- **AlgoTradingHub**

## Connections

- Desk owner → Coding agent: starts role (evidence: `README.md`)
- Coding agent → Scout: runs playbook (evidence: `README.md`)
- Coding agent → Designer: runs playbook (evidence: `README.md`)
- Coding agent → Analyst: runs playbook (evidence: `README.md`)
- Coding agent → Builder: runs playbook (evidence: `README.md`)
- Coding agent → Verifier: runs playbook (evidence: `README.md`)
- Coding agent → Quant: runs playbook (evidence: `README.md`)
- Coding agent → Portfolio manager: runs playbook (evidence: `README.md`)
- Coding agent → Prop strategist: runs playbook (evidence: `README.md`)
- Coding agent → Head of desk: runs playbook (evidence: `README.md`)
- Head of desk → Coding agent: dispatches roles (evidence: `README.md`)
- Scout → Shared card pipeline: creates leads (evidence: `README.md`)
- Designer → Shared card pipeline: creates ideas (evidence: `README.md`)
- Analyst → Shared card pipeline: writes cards (evidence: `README.md`)
- Shared card pipeline → Builder: supplies cards (evidence: `README.md`)
- Builder → AlgoTradingHub: builds strategy (evidence: `README.md`)
- Builder → Shared card pipeline: logs smoke run (evidence: `README.md`)
- Shared card pipeline → Verifier: supplies strategy (evidence: `README.md`)
- Verifier → AlgoTradingHub: checks trades (evidence: `README.md`)
- Verifier → Shared card pipeline: logs checks (evidence: `README.md`)
- Shared card pipeline → Quant: supplies card (evidence: `README.md`)
- Quant → AlgoTradingHub: runs validation (evidence: `README.md`)
- Quant → Shared card pipeline: logs results (evidence: `README.md`)
- Shared card pipeline → Portfolio manager: supplies strategies (evidence: `README.md`)
- Portfolio manager → AlgoTradingHub: incubates demos (evidence: `README.md`)
- Shared card pipeline → Prop strategist: supplies warnings (evidence: `README.md`)
- Portfolio manager → Shared card pipeline: records portfolios
- Prop strategist → Shared card pipeline: records plans
- Desk owner → Owner thresholds: sets thresholds (evidence: `README.md`)
- Analyst → Idea card template: uses template (evidence: `README.md`)
- Scout → Lead template: uses template
- Coding agent → AlgoTradingHub: connects via MCP (evidence: `README.md`)
- Visual desk server → CLI configuration: reads options (evidence: `viz/server.mjs`)
- Visual desk server → Timeline builder: builds timeline (evidence: `viz/server.mjs`)
- Visual desk server → Document library: serves documents (evidence: `viz/server.mjs`)
- Timeline builder → Shared card pipeline: reads events (evidence: `viz/lib/pipeline.mjs`)
- Document library → Timeline builder: uses snapshot (evidence: `viz/lib/library.mjs`)
- Document library → Shared card pipeline: reads card files (evidence: `viz/lib/library.mjs`)
- Visual desk server → Replay board: serves interface (evidence: `viz/server.mjs`)
- Replay board → Detail inspector: opens details (evidence: `viz/desk.js`)
- Detail inspector → Visual desk server: requests documents (evidence: `viz/inspect.js`)
