# hpe-cpp2026-vit-vellore/io-workload-pattern-classification-hotspot-detection architecture

> Architecture diagram of the GitHub repository hpe-cpp2026-vit-vellore/io-workload-pattern-classification-hotspot-detection, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-07-02). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/hpe-cpp2026-vit-vellore/io-workload-pattern-classification-hotspot-detection
- Repository: https://github.com/hpe-cpp2026-vit-vellore/io-workload-pattern-classification-hotspot-detection

## Overview

1. **What this repository is**
   - It implements an autonomous storage control plane for IO workload classification, hotspot detection, predictive forecasting, and volume rebalancing.
   - The runtime is split into a **local/dev track** and a **production/Kubernetes track**, with the same logical pipeline but different infrastructure choices.

2. **Primary runtime topology**
   - The main live loop is: **telemetry source → message bus → stream worker → ML inference/control logic → state store/action history → API/dashboard**.
   - In local mode this uses **Redis Streams**; in production it swaps to **Kafka** and can persist windowed state in **TimescaleDB**.

3. **Telemetry ingestion and simulation**
   - Synthetic telemetry is generated or replayed by `src/data/data_generator.py` and `scripts/telemetry_playback.py`.
   - Messages are consumed by `src/pipeline/stream_worker.py`, which is the pipeline’s central ingestion loop.
   - The repository includes a C++ parser (`src/cpp/telemetry_parser.cpp`) with Python fallback, so parsing and clipping happen at a performance boundary before feature extraction.

4. **Stream processing boundary**
   - `src/pipeline/telemetry_parser.py`, `preprocessor.py`, `data_loader.py`, and `topology_graph.py` form the preprocessing layer.
   - This layer handles parsing, scaling, rolling-window features, dataset construction for forecasting, and topology/placement mapping between volumes and nodes.
   - The design separates raw telemetry handling from model-ready features, which is important for the architecture diagram.

5. **Model subsystem**
   - Models are grouped into three functional families under `src/models/`:
     - **Classifier**: LightGBM baseline/tuned and ARF+ADWIN for workload labeling.
     - **Anomaly detection**: statistical detector, Isolation Forest, LSTM autoencoder, ensemble detector, noisy-neighbor detection.
     - **Forecasting**: demand forecaster, N-BEATS, TFT-based latency forecasting.
   - Trained artifacts live in `models/`, and `scripts/train_all.py` is the offline training/export pipeline that produces them.

6. **Inference architecture**
   - The control plane can run inference in two modes:
     - **Local monolithic** via `src/control_plane/inference_hub.py`.
     - **Remote/disaggregated** via `src/control_plane/remote_inference_client.py`, which proxies heavy inference to external serving systems such as Triton/KServe.
   - This is a clear architectural boundary: inference can be colocated with control logic or routed to a dedicated serving tier.

7. **Control plane core loop**
   - `src/control_plane/decision_engine.py` evaluates policy, thresholds, and safety checks.
   - `rebalancer.py` applies migration/QoS actions, `actuators.py` abstracts the actual execution backend, and `monitor.py` watches for stalls and rollback conditions.
   - `capacity_planner.py` handles autoscaling and capacity recommendations, while `simulator.py` supports what-if evaluation before acting.
   - The overall control loop is **observe → infer → decide → act → monitor/rollback**.

8. **Safety and closed-loop guardrails**
   - Safety thresholds are configured in `configs/policy.yaml`.
   - The control plane has explicit rollback logic if target latency rises too much after a move, and a circuit breaker that disables autonomous rebalancing when rollback rates are excessive.
   - This makes the actuation path a constrained subsystem rather than a direct “fire-and-forget” automation layer.

9. **API layer**
   - `api/main.py` hosts a **FastAPI** service that exposes health, metrics, policy, simulation, forecasting, volume, and rebalance endpoints.
   - `api/schemas/models.py` defines request/response contracts.
   - The API is the main external boundary for both the dashboard and automation clients, and it also includes security concerns such as token issuance and auth checks.

10. **Dashboard/UI layer**
   - `dashboard/Home.py` and the Streamlit pages provide a read-only and operator-facing control surface.
   - The pages are split by concern: cluster overview, hotspot analytics, forecasting, and control-plane history/actions.
   - The dashboard talks to the API rather than to internal services directly, which keeps the UI boundary clean.

11. **State, messaging, and observability**
   - `src/infrastructure/` contains the bus abstraction and concrete transports (`redis_bus.py`, `kafka_bus.py`), plus `timescale_client.py`, `security.py`, `tracing.py`, and `bus_factory.py`.
   - Redis is used as both a transport and a lightweight state store in local mode; TimescaleDB is the persistent time-series backend in production.
   - Prometheus/Grafana are wired through deployment manifests, and the API exposes `/metrics` for scraping.

12. **Deployment and environment split**
   - Local orchestration is defined by `docker-compose.yml` and includes Redis, API, dashboard, stream worker, and telemetry generator.
   - Production deployment is modeled in `deploy/helm/hpe-control-plane/` with HPA, probes, service monitoring, and environment-driven swapping of bus, DB, and inference mode.
   - `configs/settings.py` is the central 12-factor configuration layer that switches behavior across environments.

13. **Offline workflow and validation**
   - Data generation, feature engineering, and model training are intentionally separate from serving-time code.
   - Notebooks under `notebooks/` support exploratory analysis and model evaluation, while `tests/` cover the control plane, infrastructure, parser, security, and production pipeline paths.
   - This separation is useful for the diagram: training/offline artifacts feed the serving pipeline, but do not sit on the critical runtime path.

Main entry points: [`src/control_plane/decision_engine.py`](https://github.com/hpe-cpp2026-vit-vellore/io-workload-pattern-classification-hotspot-detection/blob/main/src/control_plane/decision_engine.py) (Decision engine), [`api/main.py`](https://github.com/hpe-cpp2026-vit-vellore/io-workload-pattern-classification-hotspot-detection/blob/main/api/main.py) (API), [`src/pipeline/stream_worker.py`](https://github.com/hpe-cpp2026-vit-vellore/io-workload-pattern-classification-hotspot-detection/blob/main/src/pipeline/stream_worker.py) (Stream worker), [`src/pipeline/preprocessor.py`](https://github.com/hpe-cpp2026-vit-vellore/io-workload-pattern-classification-hotspot-detection/blob/main/src/pipeline/preprocessor.py) (Preprocessor)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_group_runtime["Runtime paths"]
  node_node_telemetry_source["Telemetry source<br/>synthetic/replay input<br/>[data_generator.py]"]
  node_node_message_bus["Message bus<br/>stream transport<br/>[redis_bus.py]"]
  node_node_timescale[("TimescaleDB<br/>time-series store")]
  node_node_bus_factory["Bus factory<br/>transport selection<br/>[bus_factory.py]"]
  node_node_tracing_security["Security/tracing<br/>cross-cutting<br/>[security.py]"]
end

subgraph group_group_pipeline["Telemetry pipeline"]
  node_node_stream_worker["Stream worker<br/>ingestion loop<br/>[stream_worker.py]"]
  node_node_cpp_parser["C++ parser<br/>perf parser"]
  node_node_telemetry_parser["Parser glue<br/>parse/clip layer"]
  node_node_preprocessor["Preprocessor<br/>feature prep<br/>[preprocessor.py]"]
  node_node_data_loader["Data loader<br/>dataset builder<br/>[data_loader.py]"]
  node_node_topology_graph[("Topology map<br/>placement model<br/>[topology_graph.py]")]
end

subgraph group_group_control["Control plane"]
  node_node_inference_hub["Inference hub<br/>local inference<br/>[inference_hub.py]"]
  node_node_remote_inference["Remote client<br/>served inference"]
  node_node_decision_engine["Decision engine<br/>policy/safety<br/>[decision_engine.py]"]
  node_node_rebalancer["Rebalancer<br/>migration action<br/>[rebalancer.py]"]
  node_node_actuators["Actuators<br/>execution backend<br/>[actuators.py]"]
  node_node_monitor["Monitor<br/>rollback/watchdog<br/>[monitor.py]"]
  node_node_capacity_planner["Capacity planner<br/>autoscaling"]
  node_node_simulator["Simulator<br/>what-if eval<br/>[simulator.py]"]
end

subgraph group_group_surface["Serving surfaces"]
  node_node_api["API<br/>[main.py]"]
  node_node_schemas["API schemas<br/>contracts<br/>[models.py]"]
  node_node_dashboard["Dashboard<br/>Streamlit UI<br/>[Home.py]"]
  node_node_settings["Settings<br/>config layer<br/>[settings.py]"]
  node_node_policy["Policy<br/>safety config<br/>[policy.yaml]"]
end

subgraph group_group_offline["Offline assets"]
  node_node_data_generator["Data generator<br/>offline synthesis<br/>[data_generator.py]"]
  node_node_train_all["Train all<br/>offline training<br/>[train_all.py]"]
  node_node_models_artifacts[("Model artifacts<br/>trained models")]
end

node_node_telemetry_source -->|"emit telemetry"| node_node_message_bus
node_node_bus_factory -.->|"select transport"| node_node_message_bus
node_node_message_bus -->|"consume"| node_node_stream_worker
node_node_stream_worker -->|"parse boundary"| node_node_cpp_parser
node_node_stream_worker -->|"fallback parse"| node_node_telemetry_parser
node_node_telemetry_parser -->|"normalize"| node_node_preprocessor
node_node_preprocessor -->|"window features"| node_node_data_loader
node_node_preprocessor -->|"map placement"| node_node_topology_graph
node_node_stream_worker -->|"local inference"| node_node_inference_hub
node_node_stream_worker -->|"remote inference"| node_node_remote_inference
node_node_inference_hub -->|"scores"| node_node_decision_engine
node_node_remote_inference -->|"scores"| node_node_decision_engine
node_node_decision_engine -->|"what-if"| node_node_simulator
node_node_decision_engine -->|"approve action"| node_node_rebalancer
node_node_rebalancer -->|"execute"| node_node_actuators
node_node_actuators -->|"observe outcome"| node_node_monitor
node_node_monitor -.->|"rollback signal"| node_node_decision_engine
node_node_capacity_planner -->|"recommend capacity"| node_node_decision_engine
node_node_api -->|"control requests"| node_node_decision_engine
node_node_api -->|"validate contracts"| node_node_schemas
node_node_dashboard -->|"read/control"| node_node_api
node_node_settings -.->|"configure"| node_node_api
node_node_policy -.->|"safety thresholds"| node_node_decision_engine
node_node_settings -.->|"env select"| node_node_bus_factory
node_node_timescale -->|"persist state"| node_node_monitor
node_node_timescale -->|"serve history"| node_node_api
node_node_data_generator -->|"training data"| node_node_train_all
node_node_train_all -->|"export models"| node_node_models_artifacts
node_node_models_artifacts -->|"load models"| node_node_inference_hub
node_node_models_artifacts -->|"serve models"| node_node_remote_inference
node_node_tracing_security -.->|"protect/trace"| node_node_api

click node_node_telemetry_source "https://github.com/hpe-cpp2026-vit-vellore/io-workload-pattern-classification-hotspot-detection/blob/main/src/data/data_generator.py"
click node_node_message_bus "https://github.com/hpe-cpp2026-vit-vellore/io-workload-pattern-classification-hotspot-detection/blob/main/src/infrastructure/redis_bus.py"
click node_node_stream_worker "https://github.com/hpe-cpp2026-vit-vellore/io-workload-pattern-classification-hotspot-detection/blob/main/src/pipeline/stream_worker.py"
click node_node_cpp_parser "https://github.com/hpe-cpp2026-vit-vellore/io-workload-pattern-classification-hotspot-detection/blob/main/src/cpp/telemetry_parser.cpp"
click node_node_telemetry_parser "https://github.com/hpe-cpp2026-vit-vellore/io-workload-pattern-classification-hotspot-detection/blob/main/src/pipeline/telemetry_parser.py"
click node_node_preprocessor "https://github.com/hpe-cpp2026-vit-vellore/io-workload-pattern-classification-hotspot-detection/blob/main/src/pipeline/preprocessor.py"
click node_node_data_loader "https://github.com/hpe-cpp2026-vit-vellore/io-workload-pattern-classification-hotspot-detection/blob/main/src/pipeline/data_loader.py"
click node_node_topology_graph "https://github.com/hpe-cpp2026-vit-vellore/io-workload-pattern-classification-hotspot-detection/blob/main/src/pipeline/topology_graph.py"
click node_node_inference_hub "https://github.com/hpe-cpp2026-vit-vellore/io-workload-pattern-classification-hotspot-detection/blob/main/src/control_plane/inference_hub.py"
click node_node_remote_inference "https://github.com/hpe-cpp2026-vit-vellore/io-workload-pattern-classification-hotspot-detection/blob/main/src/control_plane/remote_inference_client.py"
click node_node_decision_engine "https://github.com/hpe-cpp2026-vit-vellore/io-workload-pattern-classification-hotspot-detection/blob/main/src/control_plane/decision_engine.py"
click node_node_rebalancer "https://github.com/hpe-cpp2026-vit-vellore/io-workload-pattern-classification-hotspot-detection/blob/main/src/control_plane/rebalancer.py"
click node_node_actuators "https://github.com/hpe-cpp2026-vit-vellore/io-workload-pattern-classification-hotspot-detection/blob/main/src/control_plane/actuators.py"
click node_node_monitor "https://github.com/hpe-cpp2026-vit-vellore/io-workload-pattern-classification-hotspot-detection/blob/main/src/control_plane/monitor.py"
click node_node_capacity_planner "https://github.com/hpe-cpp2026-vit-vellore/io-workload-pattern-classification-hotspot-detection/blob/main/src/control_plane/capacity_planner.py"
click node_node_simulator "https://github.com/hpe-cpp2026-vit-vellore/io-workload-pattern-classification-hotspot-detection/blob/main/src/control_plane/simulator.py"
click node_node_api "https://github.com/hpe-cpp2026-vit-vellore/io-workload-pattern-classification-hotspot-detection/blob/main/api/main.py"
click node_node_schemas "https://github.com/hpe-cpp2026-vit-vellore/io-workload-pattern-classification-hotspot-detection/blob/main/api/schemas/models.py"
click node_node_dashboard "https://github.com/hpe-cpp2026-vit-vellore/io-workload-pattern-classification-hotspot-detection/blob/main/dashboard/Home.py"
click node_node_settings "https://github.com/hpe-cpp2026-vit-vellore/io-workload-pattern-classification-hotspot-detection/blob/main/configs/settings.py"
click node_node_policy "https://github.com/hpe-cpp2026-vit-vellore/io-workload-pattern-classification-hotspot-detection/blob/main/configs/policy.yaml"
click node_node_timescale "https://github.com/hpe-cpp2026-vit-vellore/io-workload-pattern-classification-hotspot-detection/blob/main/src/infrastructure/timescale_client.py"
click node_node_bus_factory "https://github.com/hpe-cpp2026-vit-vellore/io-workload-pattern-classification-hotspot-detection/blob/main/src/infrastructure/bus_factory.py"
click node_node_tracing_security "https://github.com/hpe-cpp2026-vit-vellore/io-workload-pattern-classification-hotspot-detection/blob/main/src/infrastructure/security.py"
click node_node_data_generator "https://github.com/hpe-cpp2026-vit-vellore/io-workload-pattern-classification-hotspot-detection/blob/main/src/data/data_generator.py"
click node_node_train_all "https://github.com/hpe-cpp2026-vit-vellore/io-workload-pattern-classification-hotspot-detection/blob/main/scripts/train_all.py"
click node_node_models_artifacts "https://github.com/hpe-cpp2026-vit-vellore/io-workload-pattern-classification-hotspot-detection/tree/main/models"

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_node_telemetry_source,node_node_message_bus,node_node_timescale,node_node_bus_factory,node_node_tracing_security toneBlue
class node_node_stream_worker,node_node_cpp_parser,node_node_telemetry_parser,node_node_preprocessor,node_node_data_loader,node_node_topology_graph toneAmber
class node_node_inference_hub,node_node_remote_inference,node_node_decision_engine,node_node_rebalancer,node_node_actuators,node_node_monitor,node_node_capacity_planner,node_node_simulator toneMint
class node_node_api,node_node_schemas,node_node_dashboard,node_node_settings,node_node_policy toneRose
class node_node_data_generator,node_node_train_all,node_node_models_artifacts toneIndigo
```

## Components

### Runtime paths

Local/dev and production runtime variants of the same closed-loop control plane.

- [Telemetry source](https://github.com/hpe-cpp2026-vit-vellore/io-workload-pattern-classification-hotspot-detection/blob/main/src/data/data_generator.py): synthetic/replay input · Generated or replayed telemetry that enters the system. · `src/data/data_generator.py`
- [Message bus](https://github.com/hpe-cpp2026-vit-vellore/io-workload-pattern-classification-hotspot-detection/blob/main/src/infrastructure/redis_bus.py): stream transport · Redis Streams in local mode, Kafka in production. · `src/infrastructure/redis_bus.py`
- [TimescaleDB](https://github.com/hpe-cpp2026-vit-vellore/io-workload-pattern-classification-hotspot-detection/blob/main/src/infrastructure/timescale_client.py): time-series store · Persistent windowed state and historical storage in production. · `src/infrastructure/timescale_client.py`
- [Bus factory](https://github.com/hpe-cpp2026-vit-vellore/io-workload-pattern-classification-hotspot-detection/blob/main/src/infrastructure/bus_factory.py): transport selection · Chooses Redis or Kafka transport based on environment. · `src/infrastructure/bus_factory.py`
- [Security/tracing](https://github.com/hpe-cpp2026-vit-vellore/io-workload-pattern-classification-hotspot-detection/blob/main/src/infrastructure/security.py): cross-cutting · Auth, token checks, and observability wiring. · `src/infrastructure/security.py`

### Telemetry pipeline

Ingestion, parsing, preprocessing, and stream orchestration.

- [Stream worker](https://github.com/hpe-cpp2026-vit-vellore/io-workload-pattern-classification-hotspot-detection/blob/main/src/pipeline/stream_worker.py): ingestion loop · Central live loop that consumes telemetry and coordinates processing. · `src/pipeline/stream_worker.py`
- [C++ parser](https://github.com/hpe-cpp2026-vit-vellore/io-workload-pattern-classification-hotspot-detection/blob/main/src/cpp/telemetry_parser.cpp): perf parser · Fast telemetry parsing boundary with Python fallback. · `src/cpp/telemetry_parser.cpp`
- [Parser glue](https://github.com/hpe-cpp2026-vit-vellore/io-workload-pattern-classification-hotspot-detection/blob/main/src/pipeline/telemetry_parser.py): parse/clip layer · Python-side parsing and normalization boundary. · `src/pipeline/telemetry_parser.py`
- [Preprocessor](https://github.com/hpe-cpp2026-vit-vellore/io-workload-pattern-classification-hotspot-detection/blob/main/src/pipeline/preprocessor.py): feature prep · Scaling, clipping, and rolling-window feature preparation. · `src/pipeline/preprocessor.py`
- [Data loader](https://github.com/hpe-cpp2026-vit-vellore/io-workload-pattern-classification-hotspot-detection/blob/main/src/pipeline/data_loader.py): dataset builder · Builds model-ready datasets, especially for forecasting. · `src/pipeline/data_loader.py`
- [Topology map](https://github.com/hpe-cpp2026-vit-vellore/io-workload-pattern-classification-hotspot-detection/blob/main/src/pipeline/topology_graph.py): placement model · Maps volumes and nodes for placement and rebalancing logic. · `src/pipeline/topology_graph.py`

### Control plane

Inference, decisioning, actuation, monitoring, and capacity planning.

- [Inference hub](https://github.com/hpe-cpp2026-vit-vellore/io-workload-pattern-classification-hotspot-detection/blob/main/src/control_plane/inference_hub.py): local inference · Monolithic in-process inference path for control logic. · `src/control_plane/inference_hub.py`
- [Remote client](https://github.com/hpe-cpp2026-vit-vellore/io-workload-pattern-classification-hotspot-detection/blob/main/src/control_plane/remote_inference_client.py): served inference · Proxies inference to external serving systems such as Triton or KServe. · `src/control_plane/remote_inference_client.py`
- [Decision engine](https://github.com/hpe-cpp2026-vit-vellore/io-workload-pattern-classification-hotspot-detection/blob/main/src/control_plane/decision_engine.py): policy/safety · Evaluates thresholds, policy, and guardrails before action. · `src/control_plane/decision_engine.py`
- [Rebalancer](https://github.com/hpe-cpp2026-vit-vellore/io-workload-pattern-classification-hotspot-detection/blob/main/src/control_plane/rebalancer.py): migration action · Applies rebalance and QoS-related moves. · `src/control_plane/rebalancer.py`
- [Actuators](https://github.com/hpe-cpp2026-vit-vellore/io-workload-pattern-classification-hotspot-detection/blob/main/src/control_plane/actuators.py): execution backend · Abstracts the concrete backend used to perform actions. · `src/control_plane/actuators.py`
- [Monitor](https://github.com/hpe-cpp2026-vit-vellore/io-workload-pattern-classification-hotspot-detection/blob/main/src/control_plane/monitor.py): rollback/watchdog · Tracks stalls, post-move regressions, and rollback conditions. · `src/control_plane/monitor.py`
- [Capacity planner](https://github.com/hpe-cpp2026-vit-vellore/io-workload-pattern-classification-hotspot-detection/blob/main/src/control_plane/capacity_planner.py): autoscaling · Produces capacity and autoscaling recommendations. · `src/control_plane/capacity_planner.py`
- [Simulator](https://github.com/hpe-cpp2026-vit-vellore/io-workload-pattern-classification-hotspot-detection/blob/main/src/control_plane/simulator.py): what-if eval · Supports scenario testing before applying control actions. · `src/control_plane/simulator.py`

### Serving surfaces

External API, dashboard, and deployment/observability boundaries.

- [API](https://github.com/hpe-cpp2026-vit-vellore/io-workload-pattern-classification-hotspot-detection/blob/main/api/main.py): FastAPI service · External control surface for health, metrics, policy, forecasting, simulation, and rebalance endpoints. · `api/main.py`
- [API schemas](https://github.com/hpe-cpp2026-vit-vellore/io-workload-pattern-classification-hotspot-detection/blob/main/api/schemas/models.py): contracts · Request and response models for the API boundary. · `api/schemas/models.py`
- [Dashboard](https://github.com/hpe-cpp2026-vit-vellore/io-workload-pattern-classification-hotspot-detection/blob/main/dashboard/Home.py): Streamlit UI · Operator-facing read-only dashboard that calls the API. · `dashboard/Home.py`
- [Settings](https://github.com/hpe-cpp2026-vit-vellore/io-workload-pattern-classification-hotspot-detection/blob/main/configs/settings.py): config layer · Central environment and deployment configuration. · `configs/settings.py`
- [Policy](https://github.com/hpe-cpp2026-vit-vellore/io-workload-pattern-classification-hotspot-detection/blob/main/configs/policy.yaml): safety config · Thresholds and safety limits for autonomous action. · `configs/policy.yaml`

### Offline assets

Synthetic data generation, training, and persisted model artifacts.

- [Data generator](https://github.com/hpe-cpp2026-vit-vellore/io-workload-pattern-classification-hotspot-detection/blob/main/src/data/data_generator.py): offline synthesis · Synthetic telemetry generation for development and training. · `src/data/data_generator.py`
- [Train all](https://github.com/hpe-cpp2026-vit-vellore/io-workload-pattern-classification-hotspot-detection/blob/main/scripts/train_all.py): offline training · Offline training and export pipeline for model artifacts. · `scripts/train_all.py`
- [Model artifacts](https://github.com/hpe-cpp2026-vit-vellore/io-workload-pattern-classification-hotspot-detection/tree/main/models): trained models · Persisted classifiers, anomaly detectors, and forecasters. · `models`

## Connections

- Telemetry source → Message bus: emit telemetry · Generated or replayed data is published onto the runtime bus.
- Bus factory → Message bus: select transport · Environment determines Redis or Kafka transport.
- Message bus → Stream worker: consume · The stream worker is the central consumer loop.
- Stream worker → C++ parser: parse boundary · High-throughput parsing starts at the C++ boundary when available.
- Stream worker → Parser glue: fallback parse · Python parsing path is used when native parsing is unavailable.
- Parser glue → Preprocessor: normalize · Parsed telemetry is turned into model-ready features.
- Preprocessor → Data loader: window features · Prepared features feed dataset construction and forecasting inputs.
- Preprocessor → Topology map: map placement · Volume/node topology is enriched for control decisions.
- Stream worker → Inference hub: local inference · Monolithic inference path for colocated execution.
- Stream worker → Remote client: remote inference · Heavy inference can be routed to external serving systems.
- Inference hub → Decision engine: scores · Inference outputs are consumed by the decision engine.
- Remote client → Decision engine: scores · Remote inference feeds the same decision path.
- Decision engine → Simulator: what-if · Actions can be evaluated in simulation before execution.
- Decision engine → Rebalancer: approve action · Policy and safety checks gate actuation.
- Rebalancer → Actuators: execute · Rebalance intent is handed to backend-specific actuators.
- Actuators → Monitor: observe outcome · Post-action monitoring watches for stalls and regressions.
- Monitor → Decision engine: rollback signal · Rollback or circuit-breaker conditions feed back into decisions.
- Capacity planner → Decision engine: recommend capacity · Autoscaling recommendations inform control policy.
- API → Decision engine: control requests · External callers drive policy, simulation, and rebalance flows through the API.
- API → API schemas: validate contracts · API requests and responses are typed by schemas.
- Dashboard → API: read/control · The dashboard talks to the API rather than internal services.
- Settings → API: configure · Central config shapes runtime behavior and environment switching.
- Policy → Decision engine: safety thresholds · Policy config constrains autonomous rebalancing.
- Settings → Bus factory: env select · Settings drive transport and deployment selection.
- TimescaleDB → Monitor: persist state · Production stores windowed state and historical metrics.
- TimescaleDB → API: serve history · Historical data supports API endpoints and analytics.
- Data generator → Train all: training data · Synthetic data can feed offline training workflows.
- Train all → Model artifacts: export models · Training produces the artifacts used in serving.
- Model artifacts → Inference hub: load models · Local inference consumes trained artifacts.
- Model artifacts → Remote client: serve models · Remote serving can expose the same artifacts externally.
- Security/tracing → API: protect/trace · Security and tracing are cross-cutting concerns at the service boundary.
