Modular Rust workspace. Multiple execution surfaces.
M31A is a Rust 2024 workspace spanning the CLI, Ratatui TUI, runtime, JSON-RPC app server, SDK clients, and a Tauri 2 desktop host. Worktree-first execution isolates concurrent tasks; transactional integration and rollback help protect the shared working tree.
Layered Execution Topology
m31a CLI (54 subcommands)
m31a-tui (Ratatui / Crossterm)
Tauri 2 desktop workspace
TypeScript & Python SDKs
m31a-agent-engine (Turn Loop & Coordination)
m31a-provider (NVIDIA NIM SSE)
m31a-verify (Visual TDD & AST)
m31a-sandbox (Bubblewrap)
m31a-guardian (Circuit Breaker)
m31a-storage (SQLite Engine)
1. User Interaction & Client Layer
54 headless subcommands, global flags, and environment resolution.
Full-screen Ratatui terminal UI with streaming transcripts and fuzzy palette.
Native workspace UI with sessions, conversation timeline, approvals, questions, and settings.
First-party TypeScript / Node.js client library with async iterable streaming.
Pure Python asyncio and synchronous client library (zero external deps).
2. Application Server & Protocol Daemon
Standard JSON-RPC 2.0 daemon implementing over 40 RPC protocol methods.
Stdio (child process), Unix Domain Socket (~/.m31a/app-server-control.sock), and HTTP/SSE.
Model Context Protocol (MCP) host connecting external tool servers.
3. Autonomous Agent Core & Verification
Turn execution loop, context auto-compaction, vibe loop, speculative arena, and task orchestration.
Worktree-first task isolation, demand-driven conflict discovery, replanning, durable integration, and rollback.
Visual TDD DOM assertion engine and semantic AST blast-radius gate.
Headless Chromium CDP connection for zero-console-error frontend verification.
Filesystem event debouncer and workspace state monitor.
Interactive human-in-the-loop question and approval coordination.
4. Provider & Frontier Inference
NVIDIA NIM SSE streaming client with dynamic /v1/models discovery.
System prompt compiler, skill injection, and tool schema synthesizer.
Sliding-window context compression preserving active goals and file edits.
5. Security, Isolation & Safety Supervision
Bubblewrap Linux container isolation: Mount, PID, IPC, UTS, and Network namespaces.
Prefix pattern rules, PatternToken::Alts, and LAN network destination filtering.
Autonomous safety supervisor with sliding-window circuit breaker (window: 5, max: 3).
Workspace trust boundaries and Git hook protection.
6. Tools & Mutation Engines
18-tool orchestration suite covering execution, filesystem, and swarms.
OpenAI Codex multi-file patch engine with 4-tier fuzzy match (seek_sequence).
Script pragmas, yield runtime, and nested await tools.<name>() execution.
Tree-sitter symbol cross-referencing and data-flow taint tracking.
Colorized unified diff generator with syntax highlighting.
Child process supervision, timeout handling, and stdin streaming.
7. Durable Persistence & State
Transactional SQLite database engine at ~/.m31a/storage.db.
Session branching, historical rollbacks, and token expenditure ledgers.
Multi-agent pub-sub messaging and granular file path concurrency mutexes.
Deepen your understanding
Read the complete system architecture manual and sequence diagrams in the docs.