aegis-runtime-mv
Native Rust agent runtime: Axum WebSocket/SSE/REST gateway, heartbeat scheduler, dependency-aware task workflow, SQLite storage. Attachment of AienOS. Pre-alpha.
Brought by drakestapleton
aegis-runtime-mv / docs / INNOVATIONS.md
| 1 | # AEGIS Architectural Innovations |
| 2 | |
| 3 | ### Pure Compiled Systems Architecture and Hardware TPM Vault |
| 4 | |
| 5 | `aegis-runtime` is an autonomous agent runtime engineered in pure native compiled Rust. It replaces bloated, interpreted Node.js frameworks with a sub-millisecond compiled engine optimized for local workstation hardware. |
| 6 | |
| 7 | --- |
| 8 | |
| 9 | ## 1. Pure Compiled Native Architecture |
| 10 | |
| 11 | ### Sub-Millisecond Axum Control Plane |
| 12 | The control plane runs on Axum and Tokio (`src/gateway.rs`), providing high-concurrency WebSocket duplex streams, Server-Sent Events (SSE), and REST endpoints. |
| 13 | - Response dispatch latency: < 0.5ms. |
| 14 | - Zero garbage collection pauses or runtime interpreter bloat. |
| 15 | - Direct memory-mapped operations. |
| 16 | |
| 17 | ### Vector Math (`src/vector_math.rs`) |
| 18 | Small fixed-size vector arithmetic runs in plain Rust with no external libraries: |
| 19 | - **4D Vector Cosine Similarity**: Evaluates semantic orientation between token embeddings. |
| 20 | - **Token Entropy Estimation**: Computes probability distribution entropy without allocating intermediate heap structures. |
| 21 | - **Token Projection and Temperature Scaling**: Applies a weighted sum plus bias, and divides logits by temperature. |
| 22 | |
| 23 | --- |
| 24 | |
| 25 | ## 2. Multi-Turn Autonomous Agent Engine (`src/agent.rs`) |
| 26 | |
| 27 | ### Multi-Turn Tool Calling Loop |
| 28 | The `AgentEngine` implements an autonomous reasoning and execution loop: |
| 29 | 1. **Thought & Tool Formulation**: Generates structured reasoning and tool calls against the configured inference backend (the local model seat on port 18006 with `--inference http`). |
| 30 | 2. **Deterministic Tool Execution**: Dispatches tool invocations to the native `SkillRegistry`. |
| 31 | 3. **Multi-Turn Context Preservation**: Retains dialogue history, tool outputs, and execution receipts across iterative steps until the task goal is satisfied. |
| 32 | |
| 33 | ### Hardened Execution Guards |
| 34 | - **Process Timeout Guard**: All shell invocations via `bash_eval` execute under strict 15-second process wrappers (`timeout 15s`) to prevent runaway processes or terminal deadlocks. |
| 35 | - **Root Directory Protection**: Explicitly blocks recursive searches targeting `/` or system root directories, safeguarding host operating system files. |
| 36 | |
| 37 | ### Standard Native Skills |
| 38 | - `read_file`: Reads text files with line-indexed bounds. |
| 39 | - `write_file`: Atomically writes or updates files with parent directory creation. |
| 40 | - `list_dir`: Traverses directories, reporting relative paths and sizes. |
| 41 | - `git_status`: Inspects repository branch, staged modifications, and untracked files. |
| 42 | - `cortex.search`: The canonical memory tool. It is registered and not connected, so it reports unavailable instead of a fake result. `cortex_recall` is the legacy alias. |
| 43 | |
| 44 | --- |
| 45 | |
| 46 | ## 3. Secret resolution (`src/vault.rs`) |
| 47 | |
| 48 | ### No plaintext secret files |
| 49 | - No `.env`, `.env.local`, or configuration secret files are stored on disk. |
| 50 | - `VaultResolver` is a client of the `atlas-vault` command. It does not open a TPM device. Hardware-backed protection is a property of that provider when the deployment has it. |
| 51 | - Production resolution is the in-memory cache, then `atlas-vault`. If the provider does not answer, resolution fails closed. |
| 52 | - `AIEN_DEV_SECRET_FALLBACK=1` is the explicit development permission to read the process environment after that. |
| 53 | - Model outputs and logs are scanned to redact known secret values with `[REDACTED_BY_ATLAS_VAULT]`. |
| 54 | |
| 55 | --- |
| 56 | |
| 57 | ## 4. SQLite WAL Persistence with Crumb Trails (`src/persistence.rs`) |
| 58 | |
| 59 | Operational tasks and event logs persist in SQLite using Write-Ahead Logging (WAL) mode: |
| 60 | - Concurrent reader and writer threads operate without lock contention. |
| 61 | - Every completed agent action creates an immutable `CrumbRecord` tracking session state, timestamps, and return codes. |
| 62 | |
| 63 | --- |
| 64 | |
| 65 | ## 5. Hardware Target and Performance Metrics |
| 66 | |
| 67 | Verified on NVIDIA Grace Blackwell GB10: |
| 68 | - **Local Model Seat Endpoint**: `http://127.0.0.1:18006/v1/chat/completions` (any OpenAI-compatible server). |
| 69 | - The three figures below were measured while the seat ran Modular MAX, which was removed from AIEN on 2026-10-15. They have not been re-measured since. |
| 70 | - **Active GPU Utilization**: 94% to 96% under sustained multi-turn generation. |
| 71 | - **Inference Speed**: 20.7 tokens per second sustained across multi-turn reasoning loops. |
| 72 | - **Memory Footprint**: < 35 MB resident set size for the core runtime engine. |
| 73 | |
| 74 | --- |
| 75 | |
| 76 | ## 6. License and Commons Covenant |
| 77 | |
| 78 | Licensed under the **GNU Affero General Public License v3.0 or later** (SPDX: `AGPL-3.0-or-later`). See [LICENSE](../LICENSE). Project values live in the nonbinding [COVENANT.md](../COVENANT.md), which grants and restricts no legal rights. |
| 79 | Copyright (c) 2026 Drake Stapleton <aien@aienos.com> & AIEN <aien@aienos.com>. |