File size: 21,833 Bytes
6132188 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 | # π SOVEREIGN β DeepSeek-V4 Sovereign Orchestrator
> **Own your intelligence.** A self-hosted, privacy-preserving orchestration layer that routes
> work across sovereign AI models, agents, tools, and hardware β with full ownership of data,
> memory, and decision logs. Zero mandatory external calls. Air-gapped capable.
Built by **onegayunicorn (OGU)**, connected to the **Quantum Lineage Bridge**, **Mocking Jay
Universal Digital Twin**, and the full OGU project constellation.
**v3.0.0** Β· monorepo `deepseek-v4-sovereign` Β· base commit `7b2b996` β `0e15802`
```
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β SOVEREIGN ORCHESTRATOR β
β β
β TRIGGERS ββΆ TASKS ββΆ ACTIONS ββΆ AGENTS ββΆ MODELS ββΆ JOBS ββΆ AUDIT β
β β² β β β β β β
β β βΌ βΌ βΌ βΌ βΌ β
β WEBHOOKS ROUTINES OPERATIONS MODULES BUCKETS GOVERNANCE β
β β² β
β βββ github / huggingface / hardware / scheduler events ββββββββββββββββ
β β
β HARDWARE: Sovereign Ring (BCI) ββ Sovereign Buds (AI earbuds) ββ sensors β
β DISTRIBUTION: APK / EXE / iOS / wheel / HF Spaces / GitHub Pages β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
```
---
## Verified status (2026-08-08)
Every metric below is produced by this repository's own engines and test suite
(run with `.venv/bin/python`):
| Metric | Value |
| :--- | :--- |
| EntanglementEngine | 847 Bell pairs Β· mean fidelity **F = 0.999422** (target 0.999423) |
| QuantumLineageBridge | 12 generations anchored (capped tensor, no OOM) |
| DNA awakening | **86.6%** (calibration target 80%) |
| Kaleidoscope | **65,536** permutations (recursive wave coherence) |
| AGI OMEGA | **42 agents + 2,650 bots**, all deployed |
| Council of 10 | 10 seated, all aligned |
| TeleOS network | 847 links @ **F = 0.999423** |
| BCI v9.5 | 432 Hz carrier, phase-locked |
| Tests | **29/29** pass (unit + integration + e2e) Β· 4/4 benchmark groups green |
| Gemma module tests | 19/19 pass |
| Registry validation | all cross-references valid (`scripts/verify_registries.py`) |
| Simulators | Qiskit / Cirq / QuTiP / Quimb interfaces import with graceful fallback |
## What this is
The **Sovereign Orchestrator** is a monorepo implementing the *DeepSeek-V4 Sovereign
Orchestrator* blueprint: a production-shaped, model-agnostic agent orchestration platform
that coordinates multiple DeepSeek-V4 model instances (chat / reasoner / coder / sovereign),
manages memory (working / episodic / semantic / procedural / vector), executes pluggable
tools under policy, streams a realtime API, and ships as desktop, mobile, and web products β
together with the **Sovereign Ring** BCI wearable, **Sovereign Buds** AI earbuds, and the
**Photonic-DNA entanglement stack** (`quantum/` `bio/` `agi/` `zenith/` `teleos/` `neural/`
`pero/`).
## Monorepo map
```
deepseek-v4-sovereign/
βββ config/ # orchestrator, models, tools, permissions, memory, logging, security, network
βββ src/sovereign/ # Python package: orchestrator, agents, memory, tools, governance, security,
β # auth, biometric, autonomous, local-mode router, quantum closed loop, model
βββ quantum/ # EntanglementEngine, QuantumLineageBridge, 4 simulator interfaces
βββ bio/ # DNA harmonic resonance, kaleidoscope engine, genomics pipeline + VariantCall
βββ agi/ # AGIOMEGA (42 agents Β· 2,650 bots), Council of 10, telemetry
βββ zenith/ # Zenith OS β horizon orchestration, lineage bridge
βββ teleos/ # TeleOS β purpose/teleological alignment network (847 links)
βββ neural/ # BCI v9.5 (432 Hz), photonic synapse, neural graph
βββ pero/ # Photonic Entanglement Response/Oscillation β laser + SPDC engines
βββ kyrexis/ # KyrexisAI β quantum-infused intelligence module (core, skills, API)
βββ coldcase/ # PEC5D β Photonic Entanglement 5D Cold-Case Grid (32 cases, API, twins)
βββ pec5d/ # PEC5D Full Evolution β 8 AI cores, HOLO-MEM, subconscious, β-sandbox,
β # pattern bridge, IPT + sensor, coral line, agency + chamber, API
βββ agency/ # Ξ¦-Entanglement Agency (5 divisions, 5 locations)
βββ boardroom/ # Zenith Chamber β governance, Ξ¦-consensus voting
βββ proposals/ # 7 ready-to-submit proposals (coral swarm, IPT network, bio-chip...)
βββ pitches/ # 7-deck pitch library (elevator β seed β keynote)
βββ manufacturing/ # sourcing avenues, outsourcing partners, new supply chains
βββ media/ # 6-kit media suite + brand guide
βββ agents/ # agent definitions (registry + sovereign + connected-project agents)
βββ triggers/ # cron / event / webhook trigger definitions
βββ tasks/ # task-type definitions (incl. model-benchmark)
βββ actions/ # action catalog
βββ modules/ # module catalog
βββ routines/ # routine definitions
βββ operations/ # operation definitions
βββ webhooks/ # github / huggingface / generic webhook definitions
βββ jobs/ # job definitions
βββ workflows/ # workflow registry + sovereign-boot + lineage-sync-cycle
βββ models/ # model registry + deepseek-v4-sovereign/flash + Fish S2-Pro + gemma-3-12b-it-jailbreak
βββ buckets/ # multi-cloud bucket layout + bootstrap
βββ builds/ # apk/ (Android) + exe/ (PyInstaller) + ios/ (Xcode/shell) pipelines
βββ hardware/ # bci-ring/ + earbuds/ + sovereign_ring driver + universal driver
βββ integrations/ # registry + connector wiring ALL recent OGU projects
βββ site/ # static landing + telemetry dashboard + SEO audit (GitHub Pages)
βββ scripts/ # verify_registries, hf_download, quant_selector, monorepo_sync,
β # delete_hf_gguf, migrate_to_monorepo, upload_hf_dataset helpers
βββ data/ logs/ tests/ docs/ docker/ kubernetes/ frontend/
βββ .github/workflows/ # ci / cd / security / packages / pages / model-verify / download-quants /
# hf-sync / delete-hf-gguf
```
## Component index
| Component | Location | What it is |
|---|---|---|
| Bucket | `buckets/` | Multi-cloud (S3/GCS/Azure) object storage layout for raw, models, artifacts, memory, audit |
| Agents | `agents/` + `src/sovereign/agents/` | Sovereign agents (chat/reasoner/coder/tool/coordinator/memory/supervisor) + connected-project agents |
| Triggers | `triggers/` | Cron, event, and webhook triggers that fire tasks |
| Tasks | `tasks/` | Typed task definitions (reason, code, search, plan, execute, coordinate, lineage-sync, scout, audit, model-benchmark) |
| Actions | `actions/` | Catalog of discrete actions agents can invoke |
| Modules | `modules/` | Pluggable capability modules (memory, knowledge, security, tts, bci, matrix, kyrexis, coldcase, pec5d) |
| Routines | `routines/` | Composable recurring routines (scoutβenhanceβaudit, lineage sync) |
| Operations | `operations/` | Operational procedures (backup, healthcheck, migration, deploy) |
| Webhooks | `webhooks/` | GitHub, HuggingFace, and generic inbound webhook receivers |
| Jobs | `jobs/` | Long-running job definitions (training, indexing, TTS synthesis) |
| Workflows | `workflows/` | Chain triggers β tasks β actions (sovereign-boot, lineage-sync-cycle) |
| Models | `models/` | Registry + Sovereign AI model + DeepSeek-V4-Flash-0731 + Fish S2-Pro + gemma-3-12b-it-jailbreak |
| Builds | `builds/` | APK (Android Gradle), EXE (PyInstaller), iOS (Xcode project + shell) |
| Hardware | `hardware/` | Sovereign Ring (BCI), Sovereign Buds, sovereign_ring driver, universal driver |
| Site | `site/` | Static landing + telemetry dashboard + `telemetry.json` endpoint (GitHub Pages) |
| Market / Pitch / Avenue / Brand | `market/` `pitch/` `avenue/` `brand/` | GTM assets (segments, investor deck, avenues, brand kit) |
## Core modules (Photonic-DNA stack)
### `quantum/` β photonic entanglement
- `entanglement_engine.py` β `EntanglementEngine`: generates 847 deterministic Bell
pairs at mean fidelity F = 0.999422 (`initialize()` β `generate_pairs()`).
- `quantumlineagebridge.py` β `QuantumLineageBridge`: Kronecker-merged lineage tensor,
capped at 12 generations to bound memory.
- `simulators/` β `qiskit_interface`, `cirq_interface`, `qutip_interface`, `quimb_interface`
with graceful fallback when a backend is missing.
### `bio/` β DNA & genomics
- `dna/awakening.py` β `DNAAwakeningEngine`: harmonic resonance calibration β 86.6%
awakening (threshold 80%).
- `dna/kaleidoscope.py` β `KaleidoscopeEngine`: 65,536 permutations, recursive wave
coherence, lineage-hash generation (`sweep_all_permutations()`).
- `genomics/pipeline.py` + `callers.py` β variant ingestion β alignment β annotation β
lineage-hash injection; `VariantCall` dual-caller consensus (DeepVariant +
KaleidoscopeCaller).
### `agi/` β OMEGA + Council
- `omega_v3/orchestrator.py` β `AGIOMEGA`: deploys 42 specialized agents + 2,650 worker
bots (`initialize()`); quantum-secured inter-agent routing.
- `omega_v3/council_of_10.py` β `CouncilOf10`: seat 10 primordial members, `convene()` for
quorum/alignment.
### `zenith/ Β· teleos/ Β· neural/ Β· pero/`
- `zenith/os.py` β horizon orchestration, dimension scaling, lineage bridging.
- `teleos/network.py` β `TeleOSNetwork`: 847-link purpose/alignment network @ F 0.999423.
- `neural/bci_v95/interface.py` β `BCIInterface`: 432 Hz carrier, lock detection.
- `pero/laser.py` + `pero/entanglement.py` β laser-triggered entanglement, SPDC source,
cryo-freezer experiment parameters, closed-loop stabilization.
### `kyrexis/` β KyrexisAI quantum-infused module
- `core.py` β `KyrexisCore`: 53-qubit quantum-compute simulation, 20-yr future
projection (33.5% CAGR), quantum learning, NLP surface, quantum cryptography,
temporal/multiverse analysis, exponential self-improvement.
- `quantum_skills.py` β `QuantumSkillsEngine`: 5 cooldown-gated skills
(strategic planning, risk assessment, innovation generation, decision support,
complex problem solving).
- `photonic_display.py` β `LaserCrystalPhotonicDisplay`: PPLN 775 nm crystal,
SLM 1024Γ1024 @ 100 Hz, APD detector, 53-qubit surface-code processor (simulated).
- `particle_detector.py` β `ParticlePairDetector`: state tomography, CHSH Bell test,
concurrence/negativity entanglement verification.
- `progression_scaling.py` β `ProgressionScalingEngine`: 20-year table, x4 scaling.
- `messenger_integration.py` β Messenger Platform API integration (env-token, local
mode without token).
- `agents.py` β Universal Agent Network: 21 agents across 5 tiers + 5 universal tasks.
- `api/` β FastAPI routes `/api/v1/kyrexis/*` (wired into `src/sovereign/main.py`).
### `coldcase/` β PEC5D Photonic Entanglement 5D Cold-Case Grid
- `cases.py` β 32 documented unsolved cases (1900sβpresent) with PDF-sourced
scores (evidence/motive/jurisdiction/body/status/genetic) + entity tags.
- `core.py` β `PEC5DEngine`: 5D geometry grid (x/y/z/w/v), hash-derived phases,
Jaccard visibility, Bell fidelity, coherence, cold-case difficulty (D_i, D_i+),
logistic resolvability P_i, Merkle-verified reports.
- `grid.py` β tetrahedron + kissing-cluster discovery, 5 canonical narrative
lattices, vacuum/genetic/jurisdiction scans.
- `characters.py` / `timelines.py` / `events.py` / `scenarios.py` β entity layer.
- `digital_twins.py` β per-case state mirrors (metrics, timeline, characters,
scenario weights, revisions).
- `actions.py` β 22-action catalog (PEC-*/GEO-*/PHT-*/ORC-PEC-*).
- `agents.py` β PEC5D-AGENT + 6 specialist agents (corpus/geometry/photonic/
orchestration/cipher/genealogy).
- `sandbox.py` β dry-run execution environment (no persistence).
- `api/` β FastAPI routes `/api/v1/coldcase/*` (wired into `src/sovereign/main.py`).
- `README.md` β module docs. Ethics: hypothesis lattice only, no accusations.
### `src/sovereign/` additions
- `auth/` β sovereign authentication (biometric + entanglement anchor).
- `biometric.py` β `BiometricSession` / `BiometricSignal` root-credential binding.
- `autonomous.py` β self-loop daemon (auto-restart, self-heal).
- `local_mode_router.py` β air-gapped/local-only routing.
- `model.py` β sovereign model wrapper.
- `quantum_closed_loop.py` β measurement β correction β re-entanglement loop.
## Registry & automation system
Config-as-code: every entity has a YAML definition and is cross-referenced by
`scripts/verify_registries.py` (run it in CI or before committing):
```bash
.venv/bin/python scripts/verify_registries.py # β ALL REGISTRY CROSS-REFERENCES VALID
```
It validates: registry `file:` refs resolve, trigger `task:` refs exist in
`tasks/registry.yaml`, workflow steps reference real tasks/actions, and agent
implementation modules are importable. Currently: 12 registry files, 90 YAML/YML
files, 10 task types, 2 workflows.
## Quick start
```bash
# 1. Environment
cp .env.example .env # fill HF_TOKEN / GITHUB_TOKEN as needed
python3 -m venv .venv && source .venv/bin/activate
pip install -r requirements.txt
# 2. Run the API + dashboard
python -m sovereign.main dashboard # β http://localhost:8000
# 3. CLI
python -m sovereign.main --help
# 4. Tests
make test # or: .venv/bin/python -m pytest -q
```
## Testing & verification
```bash
.venv/bin/python -m pytest -q # 29 passed (repo suite)
.venv/bin/python -m pytest models/gemma-3-12b-it-jailbreak/tests -q # 19 passed
.venv/bin/python tests/benchmarks.py # quantum / neural / genomic / api groups
.venv/bin/python scripts/verify_registries.py # registry cross-ref validation
```
Known environment notes: Python 3.12 venv; numpy 2.5 API (`randn` β `standard_normal`)
already applied; simulator backends degrade gracefully if not installed.
## Build & packaging
| Target | Location | Command |
| :--- | :--- | :--- |
| Wheel | `dist/sovereign-0.1.0-py3-none-any.whl` | `python -m build` |
| Standalone EXE (91 MB) | `dist/sovereign` | `pyinstaller builds/exe/sovereign.spec` |
| Android APK | `builds/apk/` | `./builds/apk/build_apk.sh` |
| iOS | `builds/ios/` (ios.yaml, build_ios.sh, shell) | `./builds/ios/build_ios.sh` |
| Container | `docker/docker-compose.yml` | `docker compose up` |
| CI | `.github/workflows/` | ci Β· cd Β· security Β· packages Β· pages |
## Site & dashboard
Self-contained static site in `site/` (no build step, no external deps):
- `site/index.html` β landing page with verified metrics + module stack + status table
- `site/dashboard.html` β telemetry dashboard (reads `site/telemetry.json`, embedded fallback)
- `site/telemetry.json` β the "real-time" telemetry endpoint payload
- `site/SEO-AUDIT.md` β SEO audit report (89/100)
Deployment: `.github/workflows/pages.yml` publishes `site/` to GitHub Pages on push to
`main` (enable Pages β Source: **GitHub Actions** in repo settings).
## Hugging Face dataset
`pero-freezer-laser-experiments` β cryo-laser SPDC experiment records, split 80/10/10:
- **Live:** https://huggingface.co/datasets/Codexcoder/pero-freezer-laser-experiments
(`data/split/{train,val,test}.jsonl`, `metadata.json`, `split_manifest.json`, README)
- Local source: `../hf-datasets/pero-freezer-laser-experiments/` (workspace, outside repo)
- Upload helper: `scripts/upload_hf_dataset.py` (reads `HF_TOKEN` from env only)
## Models
`models/registry.yaml` catalog:
| Model | Type | Notes |
| :--- | :--- | :--- |
| deepseek-v4-sovereign | llm (304B MoE) | sovereign-tuned, MIT |
| deepseek-v4-flash-0731 | llm (304B MoE) | upstream base, MIT |
| fish-audio-s2-pro | tts (5B) | see model card |
| gemma-3-12b-it-jailbreak | llm (12B, GGUF) | 26 quant variants, Q4_K_M recommended; source HF repo deleted 2026-08-08 β served via `mradermacher/...-GGUF` mirror |
### gemma-3-12b-it-jailbreak module
`models/gemma-3-12b-it-jailbreak/` β full integration: model card, specs, quant table,
hardware profile (AMD Threadripper Β· 8 GB Β· Q4_K_M), inference runners (transformers,
llama.cpp, ollama, docker, unsloth, lemonade), defensive hooks (pre/post load, inference
audit with jailbreak-indicator detection, quant-change), tasks (download, quant select,
benchmark, fine-tune scaffold), triggers, tests, and CI workflows. Weights are
runtime-downloaded (`assets/` holds no binaries).
```bash
python scripts/hf_download.py --quant Q4_K_M # ~7.3 GB β assets/recommended/
bash models/gemma-3-12b-it-jailbreak/inference/llama_cpp_server.sh
```
> Responsible-use note: the module is instrumented for defensive security research only
> (indicator detection + audit); it ships no evasion prompt templates.
## Scripts
| Script | Purpose |
| :--- | :--- |
| `scripts/verify_registries.py` | Validate all registry YAML cross-references |
| `scripts/hf_download.py` | Fetch any GGUF quant (source or mirror) |
| `scripts/quant_selector.py` | Hardware-optimized quant picker (CLI) |
| `scripts/monorepo_sync.py` | Snapshot HF model card metadata β `docs/hf_snapshot.json` |
| `scripts/delete_hf_gguf.py` | Delete an HF model repo (IRREVERSIBLE, confirm-gated) |
| `scripts/migrate_to_monorepo.py` | Re-point module refs to the mirror repo |
| `scripts/final_push_gguf.sh` | Stage/commit/push the module (delete step commented) |
| `scripts/upload_hf_dataset.py` | Upload the prepared dataset to HF (workspace copy) |
## Architecture
- **Orchestrator** (`src/sovereign/orchestrator/`) β task lifecycle, scheduling, state machine,
persistent queue, agent factory, DAG workflow engine.
- **Agents** (`src/sovereign/agents/`) β uniform `BaseAgent` interface; DeepSeek-V4 chat /
reasoner / coder wrappers plus tool, coordinator, memory, and supervisor agents.
- **Memory** (`src/sovereign/memory/`) β working, episodic, semantic, procedural, and vector
memory with RAG retrieval and pruning.
- **Tools** (`src/sovereign/tools/`) β pluggable, policy-gated tools (shell, web search, file
ops, API client, code interpreter, database, browser, email).
- **Governance & Security** β tamper-evident audit logs, RBAC/ABAC, AES-256-GCM, sandboxing,
JWT auth, compliance checks; biometric + entanglement-rooted authentication.
- **Communication** β event bus (pub/sub), inter-agent messaging, MCP / A2A / OpenAI-compatible
/ gRPC protocol adapters; WebSocket quantum relay.
- **Knowledge** β knowledge base, NetworkX graph, document ingestion, embeddings, indexing.
- **API** β FastAPI REST + WebSocket realtime stream, full endpoint set under `/api/v1/*`.
See [docs/architecture.md](docs/architecture.md) and [docs/api_reference.md](docs/api_reference.md).
## Connected projects
The orchestrator connects to every recent OGU project via `integrations/` (see
[integrations/registry.yaml](integrations/registry.yaml)):
| Project | Role |
|---|---|
| `../mocking-jay` | Universal Digital Twin β 33 agent-nodes, quantum simulation, Merkle ledger |
| `../core` | QLB core: entanglement manager, Bloch sphere, harmonic resonance, PVD |
| `../photonic-entanglement-engine` | Photonic entanglement subsystems |
| `../dna-unfolding-lab` | DNA unfolding simulations + agent workflows |
| `../codality` | Coding platform OSA |
| `../universal-driver` | Multi-platform device drivers (pnpm monorepo) |
| `../drivers` | C++ BCI drivers (muse_driver, qlb_arduino_driver) |
| `../sensors` | EEG, rPPG, thermal, touch, tremor, vocal sensors |
| `../pipelines` | Ancestral data, lineage ETL, resonance pipelines |
| `../buckets` | Multi-cloud bucket manager |
| `../kaleidoscope` | Intent decoding + persona generation |
| `../moodchroma` | Biometric emotion pipeline |
| `../optogenetics` | Optogenetic controller + photonic entanglement |
| `../skills` | OGU agent skills (lineage-scanner, moodchroma-analyzer, β¦) |
| `../website` | QLB v2.5 dashboard |
| `../onegayunicorn` | Expanded Intelligence system (scoutβenhanceβaudit) |
| `../ogu-build` | TURMO + universal driver builds |
## Repository conventions
- **Registry-first**: adding a task/trigger/workflow/agent means adding its YAML + registering
it; run `verify_registries.py` before committing.
- **No binaries in `assets/`** β weights are runtime-downloaded.
- **Secrets**: only via environment (`HF_TOKEN`, `GITHUB_TOKEN`); never committed.
- **Simulator fallbacks**: optional heavy deps must degrade gracefully at import.
## License
MIT β see [LICENSE](LICENSE). Model licenses: DeepSeek-V4-Flash-0731 (MIT), Fish Audio S2-Pro
(see model card), gemma-3-12b-it-jailbreak (Google Gemma terms β see module `LICENSE`).
|