# kybertechnologies/kyber-command-prototype architecture

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

- Interactive diagram: https://gitdiagram.com/kybertechnologies/kyber-command-prototype
- Repository: https://github.com/kybertechnologies/kyber-command-prototype

## Overview

Command is a Streamlit prototype for utility outage response. Operators inspect the grid and incidents, trigger a fault, and receive a switching plan and ranked crew dispatch; the incident manager tracks restoration through repair and closure. Separate capabilities include telemetry-based voltage risk analysis and anomaly-model training. The excerpts show the incident orchestration and core module responsibilities; some dashboard calls and unsampled implementations are supported only by the source index, so uncertain links are omitted.

Main entry points: [`command_app.py`](https://github.com/kybertechnologies/kyber-command-prototype/blob/main/command_app.py) (Command UI), [`incident_manager.py`](https://github.com/kybertechnologies/kyber-command-prototype/blob/main/incident_manager.py) (Incident lifecycle), [`grid_topology.py`](https://github.com/kybertechnologies/kyber-command-prototype/blob/main/grid_topology.py) (Grid model), [`predictive_risk.py`](https://github.com/kybertechnologies/kyber-command-prototype/blob/main/predictive_risk.py) (Voltage risk)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_operator["Command dashboard"]
  node_app["Command UI<br/>[command_app.py]"]
end

subgraph group_response["Outage response"]
  node_incident["Incident lifecycle"]
  node_switching["Switching planner"]
  node_dispatch["Crew optimizer"]
  node_crews[("Crew registry<br/>[crew_database.py]")]
end

subgraph group_grid["Grid and analytics"]
  node_topology["Grid model<br/>[grid_topology.py]"]
  node_risk["Voltage risk<br/>[predictive_risk.py]"]
end

subgraph group_telemetry["Telemetry"]
  node_telemetry_gen["Telemetry simulator"]
  node_telemetry_data["Telemetry CSV"]
  node_anomaly_train["Anomaly model training"]
end

node_operator(("Utility operator"))

node_operator -->|"uses"| node_app
node_app -->|"triggers faults"| node_incident
node_app -->|"accesses risk"| node_risk
node_app -->|"reads grid"| node_topology
node_app -->|"uses crews"| node_crews
node_incident -->|"triggers fault"| node_topology
node_incident -->|"requests plan"| node_switching
node_incident -->|"ranks crews"| node_dispatch
node_incident -->|"updates crews"| node_crews
node_switching -->|"reads topology"| node_topology
node_dispatch -->|"ranks available"| node_crews
node_risk -->|"reads telemetry"| node_telemetry_data
node_risk -->|"reads bus locations"| node_topology
node_telemetry_gen -->|"writes CSV"| node_telemetry_data
node_anomaly_train -->|"reads data"| node_telemetry_data

click node_app "https://github.com/kybertechnologies/kyber-command-prototype/blob/main/command_app.py"
click node_incident "https://github.com/kybertechnologies/kyber-command-prototype/blob/main/incident_manager.py"
click node_switching "https://github.com/kybertechnologies/kyber-command-prototype/blob/main/switching_calculator.py"
click node_dispatch "https://github.com/kybertechnologies/kyber-command-prototype/blob/main/dispatch_optimizer.py"
click node_crews "https://github.com/kybertechnologies/kyber-command-prototype/blob/main/crew_database.py"
click node_topology "https://github.com/kybertechnologies/kyber-command-prototype/blob/main/grid_topology.py"
click node_risk "https://github.com/kybertechnologies/kyber-command-prototype/blob/main/predictive_risk.py"
click node_telemetry_gen "https://github.com/kybertechnologies/kyber-command-prototype/blob/main/generate_telemetry.py"
click node_telemetry_data "https://github.com/kybertechnologies/kyber-command-prototype/blob/main/atlas_training_data.csv"
click node_anomaly_train "https://github.com/kybertechnologies/kyber-command-prototype/blob/main/train_anomaly_models.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_app toneBlue
class node_incident,node_switching,node_dispatch,node_crews toneAmber
class node_topology,node_risk toneMint
class node_telemetry_gen,node_telemetry_data,node_anomaly_train toneRose
class node_operator toneIndigo
```

## Components

### Command dashboard

- [Command UI](https://github.com/kybertechnologies/kyber-command-prototype/blob/main/command_app.py): `command_app.py`

### Outage response

- [Incident lifecycle](https://github.com/kybertechnologies/kyber-command-prototype/blob/main/incident_manager.py): `incident_manager.py`
- [Switching planner](https://github.com/kybertechnologies/kyber-command-prototype/blob/main/switching_calculator.py): `switching_calculator.py`
- [Crew optimizer](https://github.com/kybertechnologies/kyber-command-prototype/blob/main/dispatch_optimizer.py): `dispatch_optimizer.py`
- [Crew registry](https://github.com/kybertechnologies/kyber-command-prototype/blob/main/crew_database.py): `crew_database.py`

### Grid and analytics

- [Grid model](https://github.com/kybertechnologies/kyber-command-prototype/blob/main/grid_topology.py): `grid_topology.py`
- [Voltage risk](https://github.com/kybertechnologies/kyber-command-prototype/blob/main/predictive_risk.py): `predictive_risk.py`

### Telemetry

- [Telemetry simulator](https://github.com/kybertechnologies/kyber-command-prototype/blob/main/generate_telemetry.py): `generate_telemetry.py`
- [Telemetry CSV](https://github.com/kybertechnologies/kyber-command-prototype/blob/main/atlas_training_data.csv): `atlas_training_data.csv`
- [Anomaly model training](https://github.com/kybertechnologies/kyber-command-prototype/blob/main/train_anomaly_models.py): `train_anomaly_models.py`

### Other components

- **Utility operator**

## Connections

- Utility operator → Command UI: uses (evidence: `command_app.py`)
- Command UI → Incident lifecycle: triggers faults (evidence: `command_app.py`)
- Command UI → Voltage risk: accesses risk (evidence: `command_app.py`)
- Command UI → Grid model: reads grid (evidence: `command_app.py`)
- Command UI → Crew registry: uses crews (evidence: `command_app.py`)
- Incident lifecycle → Grid model: triggers fault (evidence: `incident_manager.py`)
- Incident lifecycle → Switching planner: requests plan (evidence: `incident_manager.py`)
- Incident lifecycle → Crew optimizer: ranks crews (evidence: `incident_manager.py`)
- Incident lifecycle → Crew registry: updates crews (evidence: `incident_manager.py`)
- Switching planner → Grid model: reads topology (evidence: `switching_calculator.py`)
- Crew optimizer → Crew registry: ranks available (evidence: `dispatch_optimizer.py`)
- Voltage risk → Telemetry CSV: reads telemetry (evidence: `predictive_risk.py`)
- Voltage risk → Grid model: reads bus locations (evidence: `predictive_risk.py`)
- Telemetry simulator → Telemetry CSV: writes CSV (evidence: `generate_telemetry.py`)
- Anomaly model training → Telemetry CSV: reads data (evidence: `train_anomaly_models.py`)
