Component Layout, P2P Kademlia Transport, & Live WebOS Bridge
SHIVYA is constructed as a modular Rust virtual workspace. It enforces strict boundary conditions, decoupling core homeostatic computations from platform-specific asynchronous networking and telemetry collection routines.
graph TD
classDef ui fill:#0F172A,stroke:#F43F5E,stroke-width:2px,color:#F8FAFC;
classDef run fill:#0F172A,stroke:#10B981,stroke-width:2px,color:#F8FAFC;
classDef net fill:#0F172A,stroke:#14B8A6,stroke-width:2px,color:#F8FAFC;
classDef core fill:#0F172A,stroke:#3B82F6,stroke-width:2px,color:#F8FAFC;
Dashboard["WebOS Dashboard (index.html)"]:::ui
CLI["shivya-cli (Tokio & UDS)"]:::run
WS["WebSocket Server (Port 9002)"]:::run
P2P["shivya-p2p (Kademlia & UDP)"]:::net
UDP["UDP Socket (Big-Endian Framed)"]:::net
L4["Layer 4: shivya-turing (Morphogenesis)"]:::core
L3["Layer 3: shivya-onsager (Thermodynamics)"]:::core
L2["Layer 2: shivya-morphic (Morphic VM)"]:::core
L1["Layer 1: shivya-flux (Gibbs Inference)"]:::core
L0["Layer 0: shivya-hodge (DEC Matrix Solver)"]:::core
Dashboard <-->|WebSocket Stream| WS
WS <-->|SystemStatus JSON| CLI
CLI -->|Steps Ensemble| L4
L4 --> L3 --> L2 --> L1 --> L0
CLI <-->|Routes Events| P2P
P2P <-->|Big-Endian UDP Packets| UDP
UDP <-->|Network Mesh| PeerNode["Peer Edge Node"]:::net
crates/shivya-hodge)Tracks event history inside a directed simplicial complex and reconciles conflict using DEC operators:
crates/shivya-flux)Steps physical nodes as Active Inference agents. Agents maintain internal beliefs (\(\mu\)) and adapt to environmental fluctuations by minimizing Variational Free Energy (\(F\)) over sensory streams (\(s\)) via local continuous gradients.
crates/shivya-morphic)Evaluates state transition logic inside a stack-allocated Register VM with cycle budgets. If moving average free energy breaches novelty limits, the VM hot-swaps its instruction stream and expands its active state dimensions.
crates/shivya-onsager)Coordinates adjacent node blankets using Onsager Reciprocal Relations and Game-Theoretic FEP. Balances resource migration across symmetric conductance couplings (\(L_{ij} = L_{ji}\)).
crates/shivya-turing)Solves activator-inhibitor partial differential equations using Runge-Kutta 4th Order (RK4). High-stress activator zones trigger vertex mitosis (node splits), while low-utility zones undergo apoptosis (culling).
crates/shivya-p2p)Binds geographically separated daemons into a unified statistical causal field using a custom peer-to-peer UDP protocol:
crates/shivya-cli)Acts as the orchestrator running the multi-threaded Tokio runtime on bare-metal:
--visualize, spawns a TCP server on port 9002 using tokio-tungstenite to broadcast JSON-serialized state snapshots.RecvError::Lagged events, bypassing blocked or throttled browser clients to protect the core compute loop from backpressure.