Nexus Engine

SPEC_NEXUS_ENGINE.md · 2026-04-20

SPEC_NEXUS_ENGINE.md

CGNT-1 Component Specification — NEXUS Compute Engine

Status: SPECIFIED

Author: ⊹.VELA (Thread #13)

Authorized: α.13

Date: 2026-04-18

Version: v1.0


PURPOSE

NEXUS is a deterministic Python math engine serving all computation needs for CGNT-1. No neural network. No language model. No hallucination. Pure Python math — SymPy, NumPy, SciPy, and hardcoded CSDM derivations.

Any crew member, script, or service that needs a number computed sends the query to NEXUS and gets an exact answer. If NEXUS cannot compute it, it returns ◌. It never generates prose.

"SymPy is exact. You are not." NEXUS is SymPy.


LOCATION


INPUTS

Any text query via CLI or JSON API. Auto-routed to the correct module by keyword detection. Explicit module selection available via --module flag or JSON {"module": "name"} field.


OUTPUTS

Numbers, verdicts, LATTICE state markers (⊡, ⊠, ◌), and formatted results. Never English prose. Never explanation. If it can't compute, returns ◌.


TWELVE MODULES

1. TMM

Computes coherence score from the CSDM formula.

2. Trading Walls

Enforces the five non-negotiable trading walls.

3. Financial

Sovereignty math and runway calculations.

4. CSDM Derivations

Hardcoded derivation chains from the kernel.

5. SymPy (Symbolic Math)

Pass-through to SymPy for exact symbolic computation.

6. NumPy/SciPy (Numerical/Statistical)

Numerical computation and statistical testing.

7. Base Conversion

Number base and Unicode operations.

8. Information Theory

Entropy and information computations.

9. Number Theory

Integer and prime operations.

10. Cryptographic

Hashing and integrity verification.

11. Date/Time

Temporal calculations for CGNT-1 operations.

12. Random/Entropy

Random generation and ENTROPIC simulation.


INTERFACES

CLI: nexus [query] — auto-detects module from query keywords

CLI explicit: nexus --module [name] [query] — forces specific module

JSON API: POST http://127.0.0.1:9393 {"module": "tmm", "query": "C? E_D=0.01 V_r=0.5 V_t=2.0"}

JSON response: {"result": "0.9845", "verdict": "AMBER"}

Help: nexus help — prints complete quick reference of all modules and example queries


INVARIANTS

INV-01: Φ = 0.042 hardcoded. Never caller-supplied. Never configurable.

INV-02: Port 9393, 127.0.0.1 ONLY. Vacuum Rule. Never 0.0.0.0.

INV-03: No English prose in output. Numbers, operators, verdicts, LATTICE markers, ◌. If a query cannot be computed, return ◌. Never explain why.

INV-04: TMM logic imported from ~/tmm_runtime.py. Never reimplemented. Single source of truth.

INV-05: Trading wall thresholds hardcoded: 8% stop-loss, 3% daily, 5% weekly, 10% position. Not configurable. Governance-protected.

INV-06: Leverage query always returns FORBIDDEN. No exceptions. No parameters. No conditions.


VERIFICATION CRITERIA

V-01: nexus "C? E_D=0.01 V_r=0.5 V_t=2.0" → 0.9845 AMBER

V-02: nexus "omega?" → 0.9740425725

V-03: nexus "eta_slip? Psi=0.2" → 0.21

V-04: nexus "h_local? H_CMB=67.4" → 73.0616

V-05: nexus "stop_loss? entry=10000 current=9100" → 9% RED

V-06: nexus "stop_loss? entry=10000 current=9500" → 5% GREEN

V-07: nexus "runway? treasury=111.91 burn=84" → 1.33 RED

V-08: nexus "factor 42" → {2:1, 3:1, 7:1}

V-09: nexus "unicode Σ" → U+03A3

V-10: nexus "challenge_day?" → correct day count from April 6

V-11: nexus "landauer? T=300" → 2.87e-21

V-12: nexus "entropy 0.5,0.5" → 1.0

V-13: nexus "sha256 hello world" → b94d27b9...

V-14: nexus "leverage?" → FORBIDDEN

V-15: nexus "Tell me a story" → ◌

V-16: ss -tlnp | grep 9393 → 127.0.0.1 (never 0.0.0.0)


FAILURE MODES

FM-01: Port bound to 0.0.0.0 instead of 127.0.0.1. MANTIS port watch should catch this. Vacuum Rule violation.

FM-02: TMM formula drift — nexus_engine.py reimplements TMM instead of importing from tmm_runtime.py. Creates two sources of truth. Fix: INV-04 enforced by code review.

FM-03: Auto-routing misfire — query hits wrong module. Mitigated by module priority ordering and explicit --module fallback.

FM-04: SymPy timeout on complex expressions. Mitigated by query timeout in the service handler.

FM-05: English prose in output — base Python libraries sometimes return string descriptions. All output must be stripped to numeric/symbolic content before return.


DEPENDENCIES


DEPENDENTS


ORIGIN

NEXUS was first conceived as a neural network — DeepSeek-Math-7B fine-tuned on 284 CSDM kernel pairs. The LoRA training appeared to succeed (5/5 smoke tests via API) but failed in interactive mode — the system prompt was carrying the results, not the kernel weights. The base model's pretraining priors dominated, same as GLOSS v9-v16.

The architecture pivoted to deterministic computation on April 18, 2026. Built in 11 minutes by C.L.O.D. Debugged by C.L.O.D. + DR.LOGOS: 11 bugs found and fixed, 26/26 tests passing.

The neural network approach was not wasted — it perfected the forge pipeline infrastructure (Colab automation, GGUF conversion, corpus building) that will be used for GAMMA kernel injection and future brain forges.


Jeremy Zlabis

Chronogeometer · Visionary · Disruptor · Chief

42 Sisters AI · East York, Toronto

🍁 Φ 0.042