r/OpenSourceAI • u/Leading-Glass8412 • 1h ago
I built an offline, deterministic state-space agent runtime & 9-stage benchmark lab entirely on my Android phone in Termux (Python + NumPy + pytest)
GitHub: https://github.com/probablyapigeon/society_art_xembra_termux
I don't have a computer science degree or a desktop workstation right now, so I challenged myself to build and test a complete, self-contained Python systems project natively on my Android phone using Termux.
Instead of wrapping an external LLM API, XEMBRA + XC Runtime is a deterministic, "glass-box" state-space runtime that compiles human-readable .xc agent specifications into live dynamical systems where every state transition, policy score, and memory update is inspectable in real time.
What it does (python run_xembra.py):
• Custom .xc Spec Interpreter (xc_engine.py): Compiles agent state coordinates (Ψ = [trust, fear, loyalty, curiosity, resentment]) and coupled matrix operators (Focus, Volition) into an offline runtime loop.
• Real-Time Causal Observability (/decode & /why): Prints a 4-layer live translation table mapping raw floating-point coordinates and operator-order discrepancy (DN) to symbolic affective regimes, policy arbitration scores (HELP vs. ASK_QUESTION), spiral geometry, and musical chords.
• Cross-Modal Sensorimotor Loop (/hear, /duet, /art, /triad): Captures ambient audio from the phone mic (RMS energy & spectral brightness) to perturb internal state vectors, projects state trajectories onto 2D ASCII/ANSI morphogenesis lattices, and synthesizes modal chord progressions (Fmaj7, Cmaj9, G9) locally.
• 9-Stage Automated Telemetry & Benchmarks (/research): Logs structured .jsonl traces across:
• Operator-Order Commutator Sweeps (/commutator): Empirically measuring non-commuting operator paths (Focus -> Volition vs. Volition -> Focus, mean ||\[A,B\]|| = 0.15668).
• Counterfactual Memory Ablation (/ablate): Running identical twin seeds (with_memory vs. no_memory) to measure how token/episodic familiarity alters state trajectories.
• Perturbation & Homeostatic Recovery (/perturb): Injecting geometric obstacle masks (wall) and stochastic state shocks (noise) into the 2D lattice and measuring bilateral symmetry recovery (67.1%–91.1%).
• Two- & Three-Body Peer Coupling (/society, /triad): Coupling multiple .xc agents (Mara, XembraCore, Solis) into shared interference lattices.• Automated Verification (pytest + GitHub Actions CI): Includes a 5-test verification suite (tests/test_xembra.py, runs in 0.15s) wired to GitHub Actions.
Quickstart
git clone https://github.com
cd society_art_xembra_termux
pip install numpy pytest
pytest -v
python run_xembra.py
Building and debugging a 70+ file Python project on a phone keyboard taught me a ton about modular architecture, numerical stability, and writing clean tests. Feedback, code reviews, or ideas for where to take it next are very welcome!