# baba256atma/statestudio architecture

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

- Interactive diagram: https://gitdiagram.com/baba256atma/statestudio
- Repository: https://github.com/baba256atma/statestudio

## Overview

Nexora is a full-stack system-intelligence workspace. The principal workflow is to describe or model a system, apply a scenario or pressure, inspect how effects propagate, and use decision-oriented insight to guide action. The graph preserves the documented visual and conversational interaction alongside backend modeling, simulation, fragility analysis, and decision support. Some connections are documented only at product level; those use the README as evidence, and unsampled implementation details are not inferred.

Main entry points: [`backend/app/routers/analysis_router.py`](https://github.com/baba256atma/statestudio/blob/main/backend/app/routers/analysis_router.py) (Analysis endpoints), [`backend/main.py`](https://github.com/baba256atma/statestudio/blob/main/backend/main.py) (API application), [`frontend/app/components/SceneCanvas.tsx`](https://github.com/baba256atma/statestudio/blob/main/frontend/app/components/SceneCanvas.tsx) (Visual workspace), [`backend/engines/scenario_simulation/simulation_core.py`](https://github.com/baba256atma/statestudio/blob/main/backend/engines/scenario_simulation/simulation_core.py) (Scenario simulation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["User experience"]
  node_frontend["Visual workspace<br/>[SceneCanvas.tsx]"]
  node_chat["Chat interaction"]
  node_scene_contract["Scene data contract<br/>[sceneTypes.ts]"]
end

subgraph group_api["API and orchestration"]
  node_api_app["API application<br/>[main.py]"]
  node_analysis_api["Analysis endpoints<br/>[analysis_router.py]"]
  node_scanner_api["Fragility endpoint"]
  node_response_utils["API response shaping<br/>[responses.py]"]
end

subgraph group_analysis["System analysis"]
  node_system_model["System model<br/>[model_schema.py]"]
  node_scenario_sim["Scenario simulation<br/>[simulation_core.py]"]
  node_propagation["Risk propagation"]
  node_fragility["Fragility analysis"]
  node_chaos["Scene behavior<br/>[core.py]"]
end

subgraph group_intelligence["Decision intelligence"]
  node_decision["Decision analysis<br/>[decision_engine.py]"]
  node_strategic_council["Strategic council<br/>[council_engine.py]"]
  node_control_plane["AI policy control"]
end

node_user(("Team member"))

node_user -->|"explores system"| node_frontend
node_user -->|"tests hypotheses"| node_chat
node_chat -->|"requests analysis"| node_api_app
node_frontend -->|"sends requests"| node_api_app
node_api_app -->|"registers routes"| node_analysis_api
node_analysis_api -.->|"analyzes model"| node_system_model
node_system_model -->|"simulates state"| node_scenario_sim
node_scenario_sim -->|"provides baseline"| node_decision
node_decision -->|"simulates actions"| node_scenario_sim
node_analysis_api -.->|"offers scan capability"| node_scanner_api
node_scanner_api -->|"runs scan"| node_fragility
node_scenario_sim -.->|"models propagation"| node_propagation
node_analysis_api -.->|"supports scene analysis"| node_chaos
node_decision -.->|"supports strategic advice"| node_strategic_council
node_api_app -.->|"exposes AI controls"| node_control_plane
node_analysis_api -.->|"formats responses"| node_response_utils
node_api_app -->|"returns results"| node_frontend
node_frontend -->|"renders scene data"| node_scene_contract

click node_frontend "https://github.com/baba256atma/statestudio/blob/main/frontend/app/components/SceneCanvas.tsx"
click node_chat "https://github.com/baba256atma/statestudio/blob/main/frontend/app/screens/hooks/chat/useChatPipelineController.ts"
click node_scene_contract "https://github.com/baba256atma/statestudio/blob/main/frontend/app/lib/sceneTypes.ts"
click node_api_app "https://github.com/baba256atma/statestudio/blob/main/backend/main.py"
click node_analysis_api "https://github.com/baba256atma/statestudio/blob/main/backend/app/routers/analysis_router.py"
click node_scanner_api "https://github.com/baba256atma/statestudio/blob/main/backend/app/routers/fragility_scanner_router.py"
click node_system_model "https://github.com/baba256atma/statestudio/blob/main/backend/engines/system_modeling/model_schema.py"
click node_scenario_sim "https://github.com/baba256atma/statestudio/blob/main/backend/engines/scenario_simulation/simulation_core.py"
click node_propagation "https://github.com/baba256atma/statestudio/blob/main/backend/engines/scenario_simulation/propagation_engine.py"
click node_fragility "https://github.com/baba256atma/statestudio/blob/main/backend/app/services/scanner/fragility_evaluator.py"
click node_chaos "https://github.com/baba256atma/statestudio/blob/main/backend/chaos_engine/core.py"
click node_decision "https://github.com/baba256atma/statestudio/blob/main/backend/engines/decision_engine/decision_engine.py"
click node_strategic_council "https://github.com/baba256atma/statestudio/blob/main/backend/engines/strategic_council/council_engine.py"
click node_control_plane "https://github.com/baba256atma/statestudio/blob/main/backend/app/services/ai/control_plane/control_plane_service.py"
click node_response_utils "https://github.com/baba256atma/statestudio/blob/main/backend/app/utils/responses.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_frontend,node_chat,node_scene_contract toneBlue
class node_api_app,node_analysis_api,node_scanner_api,node_response_utils toneAmber
class node_system_model,node_scenario_sim,node_propagation,node_fragility,node_chaos toneMint
class node_decision,node_strategic_council,node_control_plane toneRose
class node_user toneIndigo
```

## Components

### User experience

- [Visual workspace](https://github.com/baba256atma/statestudio/blob/main/frontend/app/components/SceneCanvas.tsx): `frontend/app/components/SceneCanvas.tsx`
- [Chat interaction](https://github.com/baba256atma/statestudio/blob/main/frontend/app/screens/hooks/chat/useChatPipelineController.ts): `frontend/app/screens/hooks/chat/useChatPipelineController.ts`
- [Scene data contract](https://github.com/baba256atma/statestudio/blob/main/frontend/app/lib/sceneTypes.ts): `frontend/app/lib/sceneTypes.ts`

### API and orchestration

- [API application](https://github.com/baba256atma/statestudio/blob/main/backend/main.py): `backend/main.py`
- [Analysis endpoints](https://github.com/baba256atma/statestudio/blob/main/backend/app/routers/analysis_router.py): `backend/app/routers/analysis_router.py`
- [Fragility endpoint](https://github.com/baba256atma/statestudio/blob/main/backend/app/routers/fragility_scanner_router.py): `backend/app/routers/fragility_scanner_router.py`
- [API response shaping](https://github.com/baba256atma/statestudio/blob/main/backend/app/utils/responses.py): `backend/app/utils/responses.py`

### System analysis

- [System model](https://github.com/baba256atma/statestudio/blob/main/backend/engines/system_modeling/model_schema.py): `backend/engines/system_modeling/model_schema.py`
- [Scenario simulation](https://github.com/baba256atma/statestudio/blob/main/backend/engines/scenario_simulation/simulation_core.py): `backend/engines/scenario_simulation/simulation_core.py`
- [Risk propagation](https://github.com/baba256atma/statestudio/blob/main/backend/engines/scenario_simulation/propagation_engine.py): `backend/engines/scenario_simulation/propagation_engine.py`
- [Fragility analysis](https://github.com/baba256atma/statestudio/blob/main/backend/app/services/scanner/fragility_evaluator.py): `backend/app/services/scanner/fragility_evaluator.py`
- [Scene behavior](https://github.com/baba256atma/statestudio/blob/main/backend/chaos_engine/core.py): `backend/chaos_engine/core.py`

### Decision intelligence

- [Decision analysis](https://github.com/baba256atma/statestudio/blob/main/backend/engines/decision_engine/decision_engine.py): `backend/engines/decision_engine/decision_engine.py`
- [Strategic council](https://github.com/baba256atma/statestudio/blob/main/backend/engines/strategic_council/council_engine.py): `backend/engines/strategic_council/council_engine.py`
- [AI policy control](https://github.com/baba256atma/statestudio/blob/main/backend/app/services/ai/control_plane/control_plane_service.py): `backend/app/services/ai/control_plane/control_plane_service.py`

### Other components

- **Team member**

## Connections

- Team member → Visual workspace: explores system (evidence: `README.md`)
- Team member → Chat interaction: tests hypotheses (evidence: `README.md`)
- Chat interaction → API application: requests analysis (evidence: `README.md`)
- Visual workspace → API application: sends requests (evidence: `README.md`)
- API application → Analysis endpoints: registers routes (evidence: `backend/main.py`)
- Analysis endpoints → System model: analyzes model
- System model → Scenario simulation: simulates state
- Scenario simulation → Decision analysis: provides baseline (evidence: `backend/engines/decision_engine/decision_engine.py`)
- Decision analysis → Scenario simulation: simulates actions (evidence: `backend/engines/decision_engine/decision_engine.py`)
- Analysis endpoints → Fragility endpoint: offers scan capability
- Fragility endpoint → Fragility analysis: runs scan (evidence: `backend/app/routers/fragility_scanner_router.py`)
- Scenario simulation → Risk propagation: models propagation
- Analysis endpoints → Scene behavior: supports scene analysis
- Decision analysis → Strategic council: supports strategic advice
- API application → AI policy control: exposes AI controls
- Analysis endpoints → API response shaping: formats responses
- API application → Visual workspace: returns results (evidence: `README.md`)
- Visual workspace → Scene data contract: renders scene data (evidence: `frontend/app/lib/sceneTypes.ts`)
