# fourstoats/openfade architecture

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

## Overview

Openfade is a pre-alpha design, not a working implementation. Its principal workflow is to turn a plain-language trading idea into a target-language script by retrieving platform symbols, generating code, and statically validating it before returning it. The README also describes Pine/Lipi conversion, research and strategy agents, debugging, backtesting, and a longer-term trading lifecycle. Components below represent documented planned capabilities, not inspected runtime modules; the repository tree contains no source code, so relationships are limited to those stated in the README.

Main entry points: [`README.md`](https://github.com/fourstoats/openfade/blob/main/README.md) (Agent Graph)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_platform["Platform"]
  node_platform["Platform Services<br/>[README.md]"]
  node_gateway["Model Gateway<br/>[README.md]"]
end

subgraph group_intelligence["Intelligence Core"]
  node_corpus[("Versioned Corpus<br/>[README.md]")]
  node_dialects["Language Dialects<br/>[README.md]"]
  node_retrieval["Symbol Retrieval<br/>[README.md]"]
  node_validation["Static Validation<br/>[README.md]"]
  node_generation["Script Generation<br/>[README.md]"]
  node_conversion["Script Conversion<br/>[README.md]"]
end

subgraph group_agents["Agent System"]
  node_agentgraph["Agent Graph<br/>[README.md]"]
  node_research["Research<br/>[README.md]"]
  node_strategy["Strategy<br/>[README.md]"]
  node_codeagent["Code Agent<br/>[README.md]"]
  node_debug["Debug Agent<br/>[README.md]"]
  node_backtest["Backtest Agent<br/>[README.md]"]
end

subgraph group_lifecycle["Trading Lifecycle"]
  node_services["External Services<br/>[README.md]"]
  node_analysis["Analysis<br/>[README.md]"]
  node_decision["Decision<br/>[README.md]"]
  node_automation["Automation<br/>[README.md]"]
end

node_user(("Trader"))
node_script["Validated Script"]

node_user -->|"describes idea"| node_agentgraph
node_agentgraph -->|"retrieves symbols"| node_retrieval
node_retrieval -->|"uses corpus"| node_corpus
node_agentgraph -->|"generates script"| node_generation
node_generation -->|"validates script"| node_validation
node_validation -->|"returns valid output"| node_script
node_agentgraph -->|"includes stage"| node_research
node_agentgraph -->|"includes stage"| node_strategy
node_agentgraph -->|"includes stage"| node_codeagent
node_agentgraph -->|"includes stage"| node_debug
node_agentgraph -->|"includes stage"| node_backtest
node_generation -->|"targets languages"| node_dialects
node_conversion -->|"translates between"| node_dialects
node_agentgraph -->|"uses model layer"| node_gateway
node_agentgraph -->|"runs on platform"| node_platform
node_backtest -->|"uses engines"| node_services
node_services -.->|"supports analysis"| node_analysis
node_analysis -->|"informs decision"| node_decision
node_decision -.->|"may enable"| node_automation

click node_platform "https://github.com/fourstoats/openfade/blob/main/README.md"
click node_gateway "https://github.com/fourstoats/openfade/blob/main/README.md"
click node_corpus "https://github.com/fourstoats/openfade/blob/main/README.md"
click node_dialects "https://github.com/fourstoats/openfade/blob/main/README.md"
click node_retrieval "https://github.com/fourstoats/openfade/blob/main/README.md"
click node_validation "https://github.com/fourstoats/openfade/blob/main/README.md"
click node_generation "https://github.com/fourstoats/openfade/blob/main/README.md"
click node_conversion "https://github.com/fourstoats/openfade/blob/main/README.md"
click node_agentgraph "https://github.com/fourstoats/openfade/blob/main/README.md"
click node_research "https://github.com/fourstoats/openfade/blob/main/README.md"
click node_strategy "https://github.com/fourstoats/openfade/blob/main/README.md"
click node_codeagent "https://github.com/fourstoats/openfade/blob/main/README.md"
click node_debug "https://github.com/fourstoats/openfade/blob/main/README.md"
click node_backtest "https://github.com/fourstoats/openfade/blob/main/README.md"
click node_services "https://github.com/fourstoats/openfade/blob/main/README.md"
click node_analysis "https://github.com/fourstoats/openfade/blob/main/README.md"
click node_decision "https://github.com/fourstoats/openfade/blob/main/README.md"
click node_automation "https://github.com/fourstoats/openfade/blob/main/README.md"

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_platform,node_gateway toneBlue
class node_corpus,node_dialects,node_retrieval,node_validation,node_generation,node_conversion toneAmber
class node_agentgraph,node_research,node_strategy,node_codeagent,node_debug,node_backtest toneMint
class node_services,node_analysis,node_decision,node_automation toneRose
class node_user,node_script toneIndigo
```

## Components

### Platform

- [Platform Services](https://github.com/fourstoats/openfade/blob/main/README.md): `README.md`
- [Model Gateway](https://github.com/fourstoats/openfade/blob/main/README.md): `README.md`

### Intelligence Core

- [Versioned Corpus](https://github.com/fourstoats/openfade/blob/main/README.md): `README.md`
- [Language Dialects](https://github.com/fourstoats/openfade/blob/main/README.md): `README.md`
- [Symbol Retrieval](https://github.com/fourstoats/openfade/blob/main/README.md): `README.md`
- [Static Validation](https://github.com/fourstoats/openfade/blob/main/README.md): `README.md`
- [Script Generation](https://github.com/fourstoats/openfade/blob/main/README.md): `README.md`
- [Script Conversion](https://github.com/fourstoats/openfade/blob/main/README.md): `README.md`

### Agent System

- [Agent Graph](https://github.com/fourstoats/openfade/blob/main/README.md): `README.md`
- [Research](https://github.com/fourstoats/openfade/blob/main/README.md): `README.md`
- [Strategy](https://github.com/fourstoats/openfade/blob/main/README.md): `README.md`
- [Code Agent](https://github.com/fourstoats/openfade/blob/main/README.md): `README.md`
- [Debug Agent](https://github.com/fourstoats/openfade/blob/main/README.md): `README.md`
- [Backtest Agent](https://github.com/fourstoats/openfade/blob/main/README.md): `README.md`

### Trading Lifecycle

- [External Services](https://github.com/fourstoats/openfade/blob/main/README.md): `README.md`
- [Analysis](https://github.com/fourstoats/openfade/blob/main/README.md): `README.md`
- [Decision](https://github.com/fourstoats/openfade/blob/main/README.md): `README.md`
- [Automation](https://github.com/fourstoats/openfade/blob/main/README.md): `README.md`

### Other components

- **Trader**
- **Validated Script**

## Connections

- Trader → Agent Graph: describes idea (evidence: `README.md`)
- Agent Graph → Symbol Retrieval: retrieves symbols (evidence: `README.md`)
- Symbol Retrieval → Versioned Corpus: uses corpus (evidence: `README.md`)
- Agent Graph → Script Generation: generates script (evidence: `README.md`)
- Script Generation → Static Validation: validates script (evidence: `README.md`)
- Static Validation → Validated Script: returns valid output (evidence: `README.md`)
- Agent Graph → Research: includes stage (evidence: `README.md`)
- Agent Graph → Strategy: includes stage (evidence: `README.md`)
- Agent Graph → Code Agent: includes stage (evidence: `README.md`)
- Agent Graph → Debug Agent: includes stage (evidence: `README.md`)
- Agent Graph → Backtest Agent: includes stage (evidence: `README.md`)
- Script Generation → Language Dialects: targets languages (evidence: `README.md`)
- Script Conversion → Language Dialects: translates between (evidence: `README.md`)
- Agent Graph → Model Gateway: uses model layer (evidence: `README.md`)
- Agent Graph → Platform Services: runs on platform (evidence: `README.md`)
- Backtest Agent → External Services: uses engines (evidence: `README.md`)
- External Services → Analysis: supports analysis
- Analysis → Decision: informs decision (evidence: `README.md`)
- Decision → Automation: may enable (evidence: `README.md`)
