# probablyapigeon/xembra-cluster-dashboard architecture

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

- Interactive diagram: https://gitdiagram.com/probablyapigeon/xembra-cluster-dashboard
- Repository: https://github.com/probablyapigeon/xembra-cluster-dashboard

## Overview

XEMBRA Cluster Dashboard is a localhost control plane for scheduling and operating isolated evolution workers. The main workflow is operator command or browser request → cluster controller → scheduled worker runs → status, heartbeat, and crash history shown in the dashboard. The README also documents guardian recovery, autoscaling, a durable command/completion message bus, and a persistent kill switch. The sampled sources show the separate XEMBRA cognitive and peer-cluster runtime; unsampled wiring between scheduled workers and that runtime is not asserted.

Main entry points: [`scripts/cluster_control.py`](https://github.com/probablyapigeon/xembra-cluster-dashboard/blob/main/scripts/cluster_control.py) (Scheduler controller), [`cognitive_singularity.py`](https://github.com/probablyapigeon/xembra-cluster-dashboard/blob/main/cognitive_singularity.py) (Cognitive engine), [`xembra_cluster.py`](https://github.com/probablyapigeon/xembra-cluster-dashboard/blob/main/xembra_cluster.py) (Peer cluster nodes), [`scripts/cluster_dashboard.html`](https://github.com/probablyapigeon/xembra-cluster-dashboard/blob/main/scripts/cluster_dashboard.html) (Browser dashboard)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_control["Cluster control"]
  node_cli["Control commands<br/>[cluster_control.py]"]
  node_guardian["Guardian recovery<br/>[cluster_control.py]"]
  node_controller["Scheduler controller<br/>[cluster_control.py]"]
  node_worker["Evolution workers<br/>[cluster_control.py]"]
  node_autoscale["Queue autoscaling<br/>[cluster_control.py]"]
  node_kill["Kill switch<br/>[cluster_control.py]"]
end

subgraph group_dashboard["Dashboard and state"]
  node_dashboard_api["Dashboard API<br/>[cluster_control.py]"]
  node_dashboard_ui["Browser dashboard"]
  node_control_db[("Control history and bus<br/>[cluster_control.py]")]
end

subgraph group_runtime["Evolution runtime"]
  node_batch["Evolution batch workload<br/>[cluster_test.py]"]
  node_peer_cluster["Peer cluster nodes<br/>[xembra_cluster.py]"]
  node_evolution["Function evolution"]
end

subgraph group_cognition["Cognitive processing"]
  node_engine["Cognitive engine"]
  node_recorders["Ψ data capture"]
  node_compression["Ψ compression"]
  node_qt["QT analysis"]
  node_psi_db[("Ψ library")]
end

node_operator(("Operator"))
node_browser(("Browser user"))

node_operator -->|"issues commands"| node_cli
node_cli -->|"controls runs"| node_controller
node_controller -->|"dispatches jobs"| node_worker
node_controller -->|"records state"| node_control_db
node_controller -->|"scales workers"| node_autoscale
node_controller -->|"checks work gate"| node_kill
node_guardian -->|"recovers crashes"| node_controller
node_worker -->|"writes heartbeats"| node_control_db
node_worker -->|"records completion"| node_control_db
node_browser -->|"opens dashboard"| node_dashboard_ui
node_dashboard_ui -->|"requests status"| node_dashboard_api
node_dashboard_api -->|"reads status"| node_control_db
node_dashboard_api -->|"submits controls"| node_controller
node_worker -.->|"runs workload"| node_batch
node_batch -.->|"uses cluster runtime"| node_peer_cluster
node_peer_cluster -->|"processes Ψ"| node_engine
node_peer_cluster -->|"evolves functions"| node_evolution
node_evolution -->|"updates functions"| node_engine
node_engine -->|"captures data"| node_recorders
node_engine -->|"compresses Ψ"| node_compression
node_engine -->|"analyzes state"| node_qt
node_engine -->|"saves results"| node_psi_db

click node_cli "https://github.com/probablyapigeon/xembra-cluster-dashboard/blob/main/scripts/cluster_control.py"
click node_guardian "https://github.com/probablyapigeon/xembra-cluster-dashboard/blob/main/scripts/cluster_control.py"
click node_controller "https://github.com/probablyapigeon/xembra-cluster-dashboard/blob/main/scripts/cluster_control.py"
click node_worker "https://github.com/probablyapigeon/xembra-cluster-dashboard/blob/main/scripts/cluster_control.py"
click node_autoscale "https://github.com/probablyapigeon/xembra-cluster-dashboard/blob/main/scripts/cluster_control.py"
click node_kill "https://github.com/probablyapigeon/xembra-cluster-dashboard/blob/main/scripts/cluster_control.py"
click node_dashboard_api "https://github.com/probablyapigeon/xembra-cluster-dashboard/blob/main/scripts/cluster_control.py"
click node_dashboard_ui "https://github.com/probablyapigeon/xembra-cluster-dashboard/blob/main/scripts/cluster_dashboard.html"
click node_control_db "https://github.com/probablyapigeon/xembra-cluster-dashboard/blob/main/scripts/cluster_control.py"
click node_batch "https://github.com/probablyapigeon/xembra-cluster-dashboard/blob/main/cluster_test.py"
click node_peer_cluster "https://github.com/probablyapigeon/xembra-cluster-dashboard/blob/main/xembra_cluster.py"
click node_evolution "https://github.com/probablyapigeon/xembra-cluster-dashboard/blob/main/evolution_engine.py"
click node_engine "https://github.com/probablyapigeon/xembra-cluster-dashboard/blob/main/cognitive_singularity.py"
click node_recorders "https://github.com/probablyapigeon/xembra-cluster-dashboard/blob/main/cognitive_singularity.py"
click node_compression "https://github.com/probablyapigeon/xembra-cluster-dashboard/blob/main/cognitive_singularity.py"
click node_qt "https://github.com/probablyapigeon/xembra-cluster-dashboard/blob/main/cognitive_singularity.py"
click node_psi_db "https://github.com/probablyapigeon/xembra-cluster-dashboard/blob/main/cognitive_singularity.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_cli,node_guardian,node_controller,node_worker,node_autoscale,node_kill,node_browser toneBlue
class node_dashboard_api,node_dashboard_ui,node_control_db toneAmber
class node_batch,node_peer_cluster,node_evolution toneMint
class node_engine,node_recorders,node_compression,node_qt,node_psi_db toneRose
class node_operator toneIndigo
```

## Components

### Cluster control

- [Control commands](https://github.com/probablyapigeon/xembra-cluster-dashboard/blob/main/scripts/cluster_control.py): `scripts/cluster_control.py`
- [Guardian recovery](https://github.com/probablyapigeon/xembra-cluster-dashboard/blob/main/scripts/cluster_control.py): `scripts/cluster_control.py`
- [Scheduler controller](https://github.com/probablyapigeon/xembra-cluster-dashboard/blob/main/scripts/cluster_control.py): `scripts/cluster_control.py`
- [Evolution workers](https://github.com/probablyapigeon/xembra-cluster-dashboard/blob/main/scripts/cluster_control.py): `scripts/cluster_control.py`
- [Queue autoscaling](https://github.com/probablyapigeon/xembra-cluster-dashboard/blob/main/scripts/cluster_control.py): `scripts/cluster_control.py`
- [Kill switch](https://github.com/probablyapigeon/xembra-cluster-dashboard/blob/main/scripts/cluster_control.py): `scripts/cluster_control.py`

### Dashboard and state

- [Dashboard API](https://github.com/probablyapigeon/xembra-cluster-dashboard/blob/main/scripts/cluster_control.py): `scripts/cluster_control.py`
- [Browser dashboard](https://github.com/probablyapigeon/xembra-cluster-dashboard/blob/main/scripts/cluster_dashboard.html): `scripts/cluster_dashboard.html`
- [Control history and bus](https://github.com/probablyapigeon/xembra-cluster-dashboard/blob/main/scripts/cluster_control.py): `scripts/cluster_control.py`

### Evolution runtime

- [Evolution batch workload](https://github.com/probablyapigeon/xembra-cluster-dashboard/blob/main/cluster_test.py): `cluster_test.py`
- [Peer cluster nodes](https://github.com/probablyapigeon/xembra-cluster-dashboard/blob/main/xembra_cluster.py): `xembra_cluster.py`
- [Function evolution](https://github.com/probablyapigeon/xembra-cluster-dashboard/blob/main/evolution_engine.py): `evolution_engine.py`

### Cognitive processing

- [Cognitive engine](https://github.com/probablyapigeon/xembra-cluster-dashboard/blob/main/cognitive_singularity.py): `cognitive_singularity.py`
- [Ψ data capture](https://github.com/probablyapigeon/xembra-cluster-dashboard/blob/main/cognitive_singularity.py): `cognitive_singularity.py`
- [Ψ compression](https://github.com/probablyapigeon/xembra-cluster-dashboard/blob/main/cognitive_singularity.py): `cognitive_singularity.py`
- [QT analysis](https://github.com/probablyapigeon/xembra-cluster-dashboard/blob/main/cognitive_singularity.py): `cognitive_singularity.py`
- [Ψ library](https://github.com/probablyapigeon/xembra-cluster-dashboard/blob/main/cognitive_singularity.py): `cognitive_singularity.py`

### Other components

- **Operator**
- **Browser user**

## Connections

- Operator → Control commands: issues commands (evidence: `README.md`)
- Control commands → Scheduler controller: controls runs (evidence: `README.md`)
- Scheduler controller → Evolution workers: dispatches jobs (evidence: `README.md`)
- Scheduler controller → Control history and bus: records state (evidence: `scripts/cluster_control.py`)
- Scheduler controller → Queue autoscaling: scales workers (evidence: `README.md`)
- Scheduler controller → Kill switch: checks work gate (evidence: `scripts/cluster_control.py`)
- Guardian recovery → Scheduler controller: recovers crashes (evidence: `README.md`)
- Evolution workers → Control history and bus: writes heartbeats (evidence: `scripts/cluster_control.py`)
- Evolution workers → Control history and bus: records completion (evidence: `README.md`)
- Browser user → Browser dashboard: opens dashboard (evidence: `README.md`)
- Browser dashboard → Dashboard API: requests status (evidence: `scripts/cluster_control.py`)
- Dashboard API → Control history and bus: reads status (evidence: `scripts/cluster_control.py`)
- Dashboard API → Scheduler controller: submits controls (evidence: `scripts/cluster_control.py`)
- Evolution workers → Evolution batch workload: runs workload
- Evolution batch workload → Peer cluster nodes: uses cluster runtime
- Peer cluster nodes → Cognitive engine: processes Ψ (evidence: `xembra_cluster.py`)
- Peer cluster nodes → Function evolution: evolves functions (evidence: `xembra_cluster.py`)
- Function evolution → Cognitive engine: updates functions (evidence: `evolution_engine.py`)
- Cognitive engine → Ψ data capture: captures data (evidence: `cognitive_singularity.py`)
- Cognitive engine → Ψ compression: compresses Ψ (evidence: `cognitive_singularity.py`)
- Cognitive engine → QT analysis: analyzes state (evidence: `cognitive_singularity.py`)
- Cognitive engine → Ψ library: saves results (evidence: `cognitive_singularity.py`)
