# rupeshhh007/ibm-flight architecture

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

- Interactive diagram: https://gitdiagram.com/rupeshhh007/ibm-flight
- Repository: https://github.com/rupeshhh007/ibm-flight

## Overview

AeroGuard is a simulation-only, auditable aviation-emergency demo. Operators start and advance synthetic scenarios, submit acknowledgements and fictional ATC decisions, then inspect flight, Guardian, Sentinel, Vision, scenario, and audit views. The backend orchestrator coordinates observations, telemetry, incident evaluation, authorization, symbolic simulator actions, and ordered event persistence; the browser polls REST snapshots and event history. Edges reflect README-documented flows and sampled wiring; unsampled subsystems are included where README documents them, without asserting unverified internal calls.

Main entry points: [`backend/app/core/orchestrator.py`](https://github.com/rupeshhh007/ibm-flight/blob/main/backend/app/core/orchestrator.py) (Command orchestrator), [`backend/app/api/routes.py`](https://github.com/rupeshhh007/ibm-flight/blob/main/backend/app/api/routes.py) (REST routes), [`frontend/src/hooks/useAeroGuard.tsx`](https://github.com/rupeshhh007/ibm-flight/blob/main/frontend/src/hooks/useAeroGuard.tsx) (Client state and polling), [`frontend/src/App.tsx`](https://github.com/rupeshhh007/ibm-flight/blob/main/frontend/src/App.tsx) (Dashboard shell)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_backend["Simulation backend"]
  node_api["REST routes<br/>[routes.py]"]
  node_orchestrator["Command orchestrator<br/>[orchestrator.py]"]
  node_contracts["Event and API contracts<br/>[models.py]"]
  node_event_store[("SQLite event store<br/>[event_store.py]")]
  node_event_bus["Committed event publisher<br/>[event_bus.py]"]
end

subgraph group_decision["Safety decisions"]
  node_guardian["Guardian assessment<br/>[agent.py]"]
  node_guardian_policy["Guardian policy<br/>[policy.py]"]
  node_sentinel["Sentinel authorization<br/>[deterministic.py]"]
  node_simulator["Synthetic aircraft simulator<br/>[mock.py]"]
end

subgraph group_vision["Observation and scenarios"]
  node_vision_adapter["Vision observation adapter<br/>[adapter.py]"]
  node_vision_evidence["Uncertainty-aware evidence<br/>[evidence.py]"]
  node_vision_source["Local camera sources<br/>[sources.py]"]
  node_scenario_catalog["Scenario catalogue<br/>[catalog.py]"]
  node_scenario_runner["Scenario runner<br/>[runner.py]"]
end

subgraph group_web["Operator dashboard"]
  node_browser["Dashboard shell<br/>[App.tsx]"]
  node_client_state["Client state and polling<br/>[useAeroGuard.tsx]"]
  node_api_client["REST client<br/>[client.ts]"]
  node_event_client["Event history client<br/>[events.ts]"]
  node_views["Six dashboard views"]
  node_ui_selectors["Event-derived insights<br/>[selectors.ts]"]
  node_audit_view["Audit timeline<br/>[AuditTimeline.tsx]"]
end

node_operator(("Operator"))
node_sim_atc(("Fictional ATC"))

node_operator -->|"operates"| node_browser
node_browser -->|"renders"| node_views
node_browser -->|"uses state"| node_client_state
node_client_state -->|"fetches state"| node_api_client
node_client_state -->|"polls history"| node_event_client
node_client_state -->|"sends REST commands"| node_api
node_api -->|"dispatches commands"| node_orchestrator
node_api -.->|"reads history"| node_event_store
node_orchestrator -->|"persists events"| node_event_store
node_orchestrator -->|"publishes events"| node_event_bus
node_orchestrator -->|"evaluates evidence"| node_guardian
node_guardian -->|"applies policy"| node_guardian_policy
node_orchestrator -->|"requests authorization"| node_sentinel
node_orchestrator -->|"starts and acts"| node_simulator
node_orchestrator -->|"requests observations"| node_vision_adapter
node_vision_adapter -.->|"builds evidence"| node_vision_evidence
node_vision_evidence -.->|"uses sources"| node_vision_source
node_orchestrator -->|"loads scenarios"| node_scenario_catalog
node_orchestrator -->|"advances scenarios"| node_scenario_runner
node_scenario_runner -->|"reads definitions"| node_scenario_catalog
node_sim_atc -.->|"submits decisions"| node_api
node_views -->|"derives summaries"| node_ui_selectors
node_ui_selectors -->|"interprets events"| node_event_client
node_views -.->|"shows audit"| node_audit_view
node_contracts -.->|"defines payloads"| node_api

click node_browser "https://github.com/rupeshhh007/ibm-flight/blob/main/frontend/src/App.tsx"
click node_client_state "https://github.com/rupeshhh007/ibm-flight/blob/main/frontend/src/hooks/useAeroGuard.tsx"
click node_api_client "https://github.com/rupeshhh007/ibm-flight/blob/main/frontend/src/api/client.ts"
click node_event_client "https://github.com/rupeshhh007/ibm-flight/blob/main/frontend/src/api/events.ts"
click node_views "https://github.com/rupeshhh007/ibm-flight/tree/main/frontend/src/pages"
click node_ui_selectors "https://github.com/rupeshhh007/ibm-flight/blob/main/frontend/src/hooks/selectors.ts"
click node_audit_view "https://github.com/rupeshhh007/ibm-flight/blob/main/frontend/src/components/AuditTimeline.tsx"
click node_api "https://github.com/rupeshhh007/ibm-flight/blob/main/backend/app/api/routes.py"
click node_orchestrator "https://github.com/rupeshhh007/ibm-flight/blob/main/backend/app/core/orchestrator.py"
click node_contracts "https://github.com/rupeshhh007/ibm-flight/blob/main/backend/app/contracts/models.py"
click node_event_store "https://github.com/rupeshhh007/ibm-flight/blob/main/backend/app/core/event_store.py"
click node_event_bus "https://github.com/rupeshhh007/ibm-flight/blob/main/backend/app/core/event_bus.py"
click node_guardian "https://github.com/rupeshhh007/ibm-flight/blob/main/backend/app/modules/guardian/agent.py"
click node_guardian_policy "https://github.com/rupeshhh007/ibm-flight/blob/main/backend/app/modules/guardian/policy.py"
click node_sentinel "https://github.com/rupeshhh007/ibm-flight/blob/main/backend/app/modules/sentinel/deterministic.py"
click node_simulator "https://github.com/rupeshhh007/ibm-flight/blob/main/backend/app/modules/simulator/mock.py"
click node_vision_adapter "https://github.com/rupeshhh007/ibm-flight/blob/main/backend/app/modules/vision/adapter.py"
click node_vision_evidence "https://github.com/rupeshhh007/ibm-flight/blob/main/backend/app/modules/vision/evidence.py"
click node_vision_source "https://github.com/rupeshhh007/ibm-flight/blob/main/backend/app/modules/vision/sources.py"
click node_scenario_catalog "https://github.com/rupeshhh007/ibm-flight/blob/main/backend/app/scenarios/catalog.py"
click node_scenario_runner "https://github.com/rupeshhh007/ibm-flight/blob/main/backend/app/scenarios/runner.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_api,node_orchestrator,node_contracts,node_event_store,node_event_bus toneBlue
class node_guardian,node_guardian_policy,node_sentinel,node_simulator toneAmber
class node_vision_adapter,node_vision_evidence,node_vision_source,node_scenario_catalog,node_scenario_runner toneMint
class node_browser,node_client_state,node_api_client,node_event_client,node_views,node_ui_selectors,node_audit_view toneRose
class node_operator,node_sim_atc toneIndigo
```

## Components

### Simulation backend

- [REST routes](https://github.com/rupeshhh007/ibm-flight/blob/main/backend/app/api/routes.py): `backend/app/api/routes.py`
- [Command orchestrator](https://github.com/rupeshhh007/ibm-flight/blob/main/backend/app/core/orchestrator.py): `backend/app/core/orchestrator.py`
- [Event and API contracts](https://github.com/rupeshhh007/ibm-flight/blob/main/backend/app/contracts/models.py): `backend/app/contracts/models.py`
- [SQLite event store](https://github.com/rupeshhh007/ibm-flight/blob/main/backend/app/core/event_store.py): `backend/app/core/event_store.py`
- [Committed event publisher](https://github.com/rupeshhh007/ibm-flight/blob/main/backend/app/core/event_bus.py): `backend/app/core/event_bus.py`

### Safety decisions

- [Guardian assessment](https://github.com/rupeshhh007/ibm-flight/blob/main/backend/app/modules/guardian/agent.py): `backend/app/modules/guardian/agent.py`
- [Guardian policy](https://github.com/rupeshhh007/ibm-flight/blob/main/backend/app/modules/guardian/policy.py): `backend/app/modules/guardian/policy.py`
- [Sentinel authorization](https://github.com/rupeshhh007/ibm-flight/blob/main/backend/app/modules/sentinel/deterministic.py): `backend/app/modules/sentinel/deterministic.py`
- [Synthetic aircraft simulator](https://github.com/rupeshhh007/ibm-flight/blob/main/backend/app/modules/simulator/mock.py): `backend/app/modules/simulator/mock.py`

### Observation and scenarios

- [Vision observation adapter](https://github.com/rupeshhh007/ibm-flight/blob/main/backend/app/modules/vision/adapter.py): `backend/app/modules/vision/adapter.py`
- [Uncertainty-aware evidence](https://github.com/rupeshhh007/ibm-flight/blob/main/backend/app/modules/vision/evidence.py): `backend/app/modules/vision/evidence.py`
- [Local camera sources](https://github.com/rupeshhh007/ibm-flight/blob/main/backend/app/modules/vision/sources.py): `backend/app/modules/vision/sources.py`
- [Scenario catalogue](https://github.com/rupeshhh007/ibm-flight/blob/main/backend/app/scenarios/catalog.py): `backend/app/scenarios/catalog.py`
- [Scenario runner](https://github.com/rupeshhh007/ibm-flight/blob/main/backend/app/scenarios/runner.py): `backend/app/scenarios/runner.py`

### Operator dashboard

- [Dashboard shell](https://github.com/rupeshhh007/ibm-flight/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [Client state and polling](https://github.com/rupeshhh007/ibm-flight/blob/main/frontend/src/hooks/useAeroGuard.tsx): `frontend/src/hooks/useAeroGuard.tsx`
- [REST client](https://github.com/rupeshhh007/ibm-flight/blob/main/frontend/src/api/client.ts): `frontend/src/api/client.ts`
- [Event history client](https://github.com/rupeshhh007/ibm-flight/blob/main/frontend/src/api/events.ts): `frontend/src/api/events.ts`
- [Six dashboard views](https://github.com/rupeshhh007/ibm-flight/tree/main/frontend/src/pages): `frontend/src/pages`
- [Event-derived insights](https://github.com/rupeshhh007/ibm-flight/blob/main/frontend/src/hooks/selectors.ts): `frontend/src/hooks/selectors.ts`
- [Audit timeline](https://github.com/rupeshhh007/ibm-flight/blob/main/frontend/src/components/AuditTimeline.tsx): `frontend/src/components/AuditTimeline.tsx`

### Other components

- **Operator**
- **Fictional ATC**

## Connections

- Operator → Dashboard shell: operates
- Dashboard shell → Six dashboard views: renders (evidence: `frontend/src/App.tsx`)
- Dashboard shell → Client state and polling: uses state (evidence: `frontend/src/App.tsx`)
- Client state and polling → REST client: fetches state (evidence: `frontend/src/hooks/useAeroGuard.tsx`)
- Client state and polling → Event history client: polls history (evidence: `frontend/src/hooks/useAeroGuard.tsx`)
- Client state and polling → REST routes: sends REST commands
- REST routes → Command orchestrator: dispatches commands (evidence: `backend/app/api/routes.py`)
- REST routes → SQLite event store: reads history
- Command orchestrator → SQLite event store: persists events
- Command orchestrator → Committed event publisher: publishes events
- Command orchestrator → Guardian assessment: evaluates evidence
- Guardian assessment → Guardian policy: applies policy (evidence: `backend/app/modules/guardian/agent.py`)
- Command orchestrator → Sentinel authorization: requests authorization
- Command orchestrator → Synthetic aircraft simulator: starts and acts (evidence: `backend/app/core/orchestrator.py`)
- Command orchestrator → Vision observation adapter: requests observations
- Vision observation adapter → Uncertainty-aware evidence: builds evidence
- Uncertainty-aware evidence → Local camera sources: uses sources (evidence: `backend/app/modules/vision/sources.py`)
- Command orchestrator → Scenario catalogue: loads scenarios (evidence: `backend/app/core/orchestrator.py`)
- Command orchestrator → Scenario runner: advances scenarios (evidence: `backend/app/core/orchestrator.py`)
- Scenario runner → Scenario catalogue: reads definitions (evidence: `backend/app/scenarios/runner.py`)
- Fictional ATC → REST routes: submits decisions
- Six dashboard views → Event-derived insights: derives summaries (evidence: `frontend/src/pages/FlightDeckPage.tsx`)
- Event-derived insights → Event history client: interprets events (evidence: `frontend/src/hooks/selectors.ts`)
- Six dashboard views → Audit timeline: shows audit
- Event and API contracts → REST routes: defines payloads (evidence: `backend/app/api/routes.py`)
