# authorsauravkushwaha/synthesis architecture

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

- Interactive diagram: https://gitdiagram.com/authorsauravkushwaha/synthesis
- Repository: https://github.com/authorsauravkushwaha/synthesis

## Overview

SYNTHESIS turns incoming observations into an evidence-carrying causal world model, then exposes impact analysis, hypotheses, forecasts, outcomes, and calibration through an API and web console. Its principal workflow runs from adapter proposals through world-state analysis to falsification and forecast scoring; federation adds signed peer exchange and review. The graph also includes security and independent clients. The source excerpts establish several key calls, while some detailed engine internals and runtime wiring were not shown; those relationships are omitted rather than inferred.

Main entry points: [`server/world.py`](https://github.com/authorsauravkushwaha/synthesis/blob/main/server/world.py) (Causal World Model), [`server/main.py`](https://github.com/authorsauravkushwaha/synthesis/blob/main/server/main.py) (API Gateway), [`server/federation.py`](https://github.com/authorsauravkushwaha/synthesis/blob/main/server/federation.py) (Federation Node), [`server/ingest.py`](https://github.com/authorsauravkushwaha/synthesis/blob/main/server/ingest.py) (Live Adapters)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ingestion["Evidence Ingestion"]
  node_ingest["Live Adapters<br/>[ingest.py]"]
end

subgraph group_engine["World Model"]
  node_world["Causal World Model<br/>[world.py]"]
  node_evidence_chain[("Evidence Chain<br/>[world.py]")]
  node_analysis["Impact and Hypotheses<br/>[world.py]"]
  node_falsification["Falsification and Watchpoints<br/>[world.py]"]
  node_contradictions["Contradiction Engine<br/>[world.py]"]
  node_outcomes["Forecasts and Calibration<br/>[world.py]"]
end

subgraph group_service["API and Security"]
  node_api["API Gateway<br/>[main.py]"]
  node_security["Access and Audit<br/>[security.py]"]
end

subgraph group_clients["User Interfaces"]
  node_web["Web Console and PWA<br/>[app.js]"]
  node_python_sdk["Python SDK<br/>[__init__.py]"]
  node_typescript_sdk["TypeScript SDK<br/>[synthesis-sdk.ts]"]
  node_standalone["Standalone Edition<br/>[synthesis.py]"]
end

subgraph group_federation["Federation"]
  node_federation["Federation Node<br/>[federation.py]"]
end

node_analyst(("Analyst"))
node_public_sources(("Public Data Sources"))
node_peer_nodes(("Peer Nodes"))

node_public_sources -->|"supply feeds"| node_ingest
node_ingest -->|"propose observations"| node_world
node_api -->|"exposes status"| node_ingest
node_api -->|"serves model data"| node_world
node_world -->|"records evidence"| node_evidence_chain
node_world -->|"builds analyses"| node_analysis
node_world -->|"tracks falsifiers"| node_falsification
node_world -->|"resolves conflicts"| node_contradictions
node_world -->|"scores forecasts"| node_outcomes
node_api -->|"serves peer routes"| node_federation
node_federation -->|"imports peer evidence"| node_world
node_peer_nodes -->|"exchange bundles"| node_federation
node_federation -->|"reprices peer trust"| node_outcomes
node_api -->|"checks access"| node_security
node_security -->|"reuses chain"| node_evidence_chain
node_analyst -->|"uses console"| node_web
node_web -->|"requests and streams"| node_api
node_python_sdk -->|"calls endpoints"| node_api
node_typescript_sdk -->|"calls endpoints"| node_api
node_standalone -.->|"implements independent chain"| node_evidence_chain

click node_ingest "https://github.com/authorsauravkushwaha/synthesis/blob/main/server/ingest.py"
click node_world "https://github.com/authorsauravkushwaha/synthesis/blob/main/server/world.py"
click node_evidence_chain "https://github.com/authorsauravkushwaha/synthesis/blob/main/server/world.py"
click node_analysis "https://github.com/authorsauravkushwaha/synthesis/blob/main/server/world.py"
click node_falsification "https://github.com/authorsauravkushwaha/synthesis/blob/main/server/world.py"
click node_contradictions "https://github.com/authorsauravkushwaha/synthesis/blob/main/server/world.py"
click node_outcomes "https://github.com/authorsauravkushwaha/synthesis/blob/main/server/world.py"
click node_api "https://github.com/authorsauravkushwaha/synthesis/blob/main/server/main.py"
click node_security "https://github.com/authorsauravkushwaha/synthesis/blob/main/server/security.py"
click node_federation "https://github.com/authorsauravkushwaha/synthesis/blob/main/server/federation.py"
click node_web "https://github.com/authorsauravkushwaha/synthesis/blob/main/web/app.js"
click node_python_sdk "https://github.com/authorsauravkushwaha/synthesis/blob/main/sdk/python/synthesis_sdk/__init__.py"
click node_typescript_sdk "https://github.com/authorsauravkushwaha/synthesis/blob/main/sdk/typescript/synthesis-sdk.ts"
click node_standalone "https://github.com/authorsauravkushwaha/synthesis/blob/main/standalone/synthesis.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_ingest toneBlue
class node_world,node_evidence_chain,node_analysis,node_falsification,node_contradictions,node_outcomes toneAmber
class node_api,node_security toneMint
class node_web,node_python_sdk,node_typescript_sdk,node_standalone toneRose
class node_federation,node_analyst,node_public_sources,node_peer_nodes toneIndigo
```

## Components

### Evidence Ingestion

- [Live Adapters](https://github.com/authorsauravkushwaha/synthesis/blob/main/server/ingest.py): `server/ingest.py`

### World Model

- [Causal World Model](https://github.com/authorsauravkushwaha/synthesis/blob/main/server/world.py): `server/world.py`
- [Evidence Chain](https://github.com/authorsauravkushwaha/synthesis/blob/main/server/world.py): `server/world.py`
- [Impact and Hypotheses](https://github.com/authorsauravkushwaha/synthesis/blob/main/server/world.py): `server/world.py`
- [Falsification and Watchpoints](https://github.com/authorsauravkushwaha/synthesis/blob/main/server/world.py): `server/world.py`
- [Contradiction Engine](https://github.com/authorsauravkushwaha/synthesis/blob/main/server/world.py): `server/world.py`
- [Forecasts and Calibration](https://github.com/authorsauravkushwaha/synthesis/blob/main/server/world.py): `server/world.py`

### API and Security

- [API Gateway](https://github.com/authorsauravkushwaha/synthesis/blob/main/server/main.py): `server/main.py`
- [Access and Audit](https://github.com/authorsauravkushwaha/synthesis/blob/main/server/security.py): `server/security.py`

### User Interfaces

- [Web Console and PWA](https://github.com/authorsauravkushwaha/synthesis/blob/main/web/app.js): `web/app.js`
- [Python SDK](https://github.com/authorsauravkushwaha/synthesis/blob/main/sdk/python/synthesis_sdk/__init__.py): `sdk/python/synthesis_sdk/__init__.py`
- [TypeScript SDK](https://github.com/authorsauravkushwaha/synthesis/blob/main/sdk/typescript/synthesis-sdk.ts): `sdk/typescript/synthesis-sdk.ts`
- [Standalone Edition](https://github.com/authorsauravkushwaha/synthesis/blob/main/standalone/synthesis.py): `standalone/synthesis.py`

### Federation

- [Federation Node](https://github.com/authorsauravkushwaha/synthesis/blob/main/server/federation.py): `server/federation.py`

### Other components

- **Analyst**
- **Public Data Sources**
- **Peer Nodes**

## Connections

- Public Data Sources → Live Adapters: supply feeds (evidence: `README.md`)
- Live Adapters → Causal World Model: propose observations (evidence: `server/ingest.py`)
- API Gateway → Live Adapters: exposes status (evidence: `server/main.py`)
- API Gateway → Causal World Model: serves model data (evidence: `server/main.py`)
- Causal World Model → Evidence Chain: records evidence (evidence: `server/world.py`)
- Causal World Model → Impact and Hypotheses: builds analyses (evidence: `server/world.py`)
- Causal World Model → Falsification and Watchpoints: tracks falsifiers (evidence: `server/world.py`)
- Causal World Model → Contradiction Engine: resolves conflicts (evidence: `README.md`)
- Causal World Model → Forecasts and Calibration: scores forecasts (evidence: `server/world.py`)
- API Gateway → Federation Node: serves peer routes (evidence: `server/main.py`)
- Federation Node → Causal World Model: imports peer evidence (evidence: `server/federation.py`)
- Peer Nodes → Federation Node: exchange bundles (evidence: `server/federation.py`)
- Federation Node → Forecasts and Calibration: reprices peer trust (evidence: `server/federation.py`)
- API Gateway → Access and Audit: checks access (evidence: `server/main.py`)
- Access and Audit → Evidence Chain: reuses chain (evidence: `server/security.py`)
- Analyst → Web Console and PWA: uses console (evidence: `README.md`)
- Web Console and PWA → API Gateway: requests and streams (evidence: `web/app.js`)
- Python SDK → API Gateway: calls endpoints (evidence: `sdk/python/synthesis_sdk/__init__.py`)
- TypeScript SDK → API Gateway: calls endpoints (evidence: `sdk/typescript/synthesis-sdk.ts`)
- Standalone Edition → Evidence Chain: implements independent chain
