# K-SYSTEMS: SOVEREIGN ARCHITECTURE MASTER INDEX

This repository contains the formalized documentation for every deployed function, process, and technology within the Keddeh Systems Architecture.

## The 7 Stages of Sovereign Deployment

### 1. The Edge OS Carrier (HTML/WASM)
- **Component:** `ServerSpace-DNS-Broadcast/hcf_workstation.html`
- **Implied Goal:** Zero-cost infinite scaling at the edge.
- **How it achieves it:** Bypasses Vercel/AWS by compiling the entire OS (V76 VM, VFS, Pyodide kernel) into a single 5MB HTML file hosted on standard CDNs like GitHub Pages. It acts purely as a terminal that dials back to the native substrate.

### 2. The Local PM2 Substrate
- **Component:** `ecosystem.config.cjs` & `braink-console`
- **Implied Goal:** Centralized, highly-available control plane on local hardware.
- **How it achieves it:** PM2 daemonizes the Python/Node backend processes (KERA Mesh, Stratum Miner, Node ServerSpace), ensuring 100% uptime, automatic restarts, and isolation of background execution from the frontend UI.

### 3. Domain Edge Controller (KERA Domain Registry)
- **Component:** `kera_server/domain_runtime.py` & `src/server/routes/kera_domain.routes.ts`
- **Implied Goal:** SquareSpace-style domain management without cloud registrars.
- **How it achieves it:** A self-hosted Domain API that registers `*.keddeh.com` routes dynamically, mapping them to the Edge OS Carriers via KERA endpoints and tracking them in a local SQLite ledger.

### 4. Dual-Track Stratum TCP Mining (Law F)
- **Component:** `start_dual_stratum_pipeline.py` & `stratum_core_client.py`
- **Implied Goal:** Sovereign verification of hardware hashing without arbitrary cloud dropouts.
- **How it achieves it:** Maintains strictly decoupled, persistent `setKeepAlive(true)` TCP streams to `solo.ckpool.org` (Solo) and `bitcoin.viabtc.io` (PPLNS), rejecting mock nonces and directly scanning block templates.

### 5. 7-Stage Cascade POSIX Fsync (Law E)
- **Component:** `braink.keddeh_cloud_adapter.KeddehCloudWorkbookAdapter`
- **Implied Goal:** Flawless epistemic integrity of state execution.
- **How it achieves it:** Translates incoming mesh and mining signals into physical write-backs on Google Drive Workbook-as-CPU sheets. Employs POSIX `fsync` and atomic rename to guarantee state survives power loss.

### 6. Substrate Inter-Process Communication (Law A)
- **Component:** `kera_mesh_node.py` (UDP Multicast 239.29.7.100)
- **Implied Goal:** Zero Process Spawning per Request.
- **How it achieves it:** Instead of invoking `child_process.exec` per HTTP hit, the KERA Mesh uses persistent multicast groups and Unix Domain Sockets to propagate state across the hardware matrix instantly.

### 7. Pre-Completion Deep Critique Gate (DCVG)
- **Component:** Active Agentic Adversarial Conference Floor
- **Implied Goal:** Anti-Hallucination and Empirical Reality check.
- **How it achieves it:** Prevents mock implementations (like attempting to run raw TCP servers in WebAssembly) by strictly enforcing physical viability tests against Substrate Integrity, Axiomatic Compliance, and Delivery Quality.

