Architecture - Magnum-Insignia/nagahana GitHub Wiki

System Architecture

1. Epistemic Memory Separation

A foundational design requirement of NagaHana is the complete mathematical and operational separation between what has been observed, what is hypothesized, and how the model is regulated.

Memory Region Content & Role Read/Write Permissions
Environment Durable record of observed facts, entity states, and true transition history encoded in the TSTCT Key-Value cache. Written exclusively by the Simulator. Read by Forecaster, Advisor, Verifier, Decoder.
Imagination Dynamic space of adversarial hypotheses, suspicion posteriors, candidate attack routes, and future projections. Written exclusively by the Forecaster / TAAFT. Read by Advisor, Verifier, Decoder.
Monitor Historical calibration logs, drift statistics, forecast-vs-outcome pairs, and poisoning alerts. Written exclusively by the Verifier. Read by operational auditing interfaces.

Strict Non-Feedback Invariant: Hypotheses in Imagination can never write to or overwrite facts in the Environment cache. Beliefs never render as facts.


2. Topological Heterogeneous Multiplex Hypergraph

NagaHana represents computer and industrial networks not as flat graphs or sequence tokens, but as heterogeneous multiplex hypergraphs:

  • Multiplex Planes: Telemetry is decomposed into six parallel semantic relation planes:
    1. connectivity: Raw IP transport flows (TCP, UDP, ICMP).
    2. services: Layer 7 application transactions and exposed daemons.
    3. identity: Authentication and directory interactions (Kerberos, LDAP, SMB, NTLM).
    4. remote_admin: Remote administration channels (SSH, RDP, WinRM, VNC).
    5. name_resolution: DNS, LLMNR, mDNS, and NetBIOS resolution graphs.
    6. ot_control: Supervisory control protocols (Modbus, DNP3, IEC-104, S7comm, EtherNet/IP).
  • Hyperedges: Hyperedges capture simultaneous multi-entity interactions (e.g., multicast/broadcast groups, network-wide scans, distributed sessions).
  • Permutation Equivariance: Structural node positions are encoded via Random Walk Structural Embeddings (RWSE) on weighted clique expansions, ensuring topological invariance under entity re-indexing.

3. Physics Boundary Against Hallucination ($\Phi_{\text{phys}}$)

Generative AI world models can hallucinate physically impossible network behavior. NagaHana prevents this by embedding a global physics boundary:

  • Hard Constraints: Output projections enforce mathematical invariants (non-negative packet counts, monotonic event timestamps, flag count bounds, bandwidth conservation).
  • Soft Residuals ($\Phi_{\text{phys}}$): Queueing theory constraints, inter-arrival time variances, and protocol state transitions are penalized in the loss landscape and energy surface.
  • Scope: The physics boundary restricts reconstructions, simulated futures, and generated training variants without penalizing real observed anomalies.