M31A Logo
M31Av0.1.15
System Topology

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

Interaction Surfaces

m31a CLI (54 subcommands)

m31a-tui (Ratatui / Crossterm)

Tauri 2 desktop workspace

TypeScript & Python SDKs

Autonomous Core

m31a-agent-engine (Turn Loop & Coordination)

m31a-provider (NVIDIA NIM SSE)

m31a-verify (Visual TDD & AST)

Containment & Storage

m31a-sandbox (Bubblewrap)

m31a-guardian (Circuit Breaker)

m31a-storage (SQLite Engine)

1. User Interaction & Client Layer

m31a-cli

54 headless subcommands, global flags, and environment resolution.

m31a-tui

Full-screen Ratatui terminal UI with streaming transcripts and fuzzy palette.

M31A Desktop (Tauri 2)

Native workspace UI with sessions, conversation timeline, approvals, questions, and settings.

@m31a/sdk

First-party TypeScript / Node.js client library with async iterable streaming.

m31a (Python)

Pure Python asyncio and synchronous client library (zero external deps).

2. Application Server & Protocol Daemon

m31a-app-server

Standard JSON-RPC 2.0 daemon implementing over 40 RPC protocol methods.

Transports

Stdio (child process), Unix Domain Socket (~/.m31a/app-server-control.sock), and HTTP/SSE.

m31a-mcp

Model Context Protocol (MCP) host connecting external tool servers.

3. Autonomous Agent Core & Verification

m31a-agent-engine

Turn execution loop, context auto-compaction, vibe loop, speculative arena, and task orchestration.

Worktree Coordination

Worktree-first task isolation, demand-driven conflict discovery, replanning, durable integration, and rollback.

m31a-verify

Visual TDD DOM assertion engine and semantic AST blast-radius gate.

m31a-browser

Headless Chromium CDP connection for zero-console-error frontend verification.

m31a-watcher

Filesystem event debouncer and workspace state monitor.

m31a-elicitation

Interactive human-in-the-loop question and approval coordination.

4. Provider & Frontier Inference

m31a-provider

NVIDIA NIM SSE streaming client with dynamic /v1/models discovery.

m31a-prompts

System prompt compiler, skill injection, and tool schema synthesizer.

m31a-compaction

Sliding-window context compression preserving active goals and file edits.

5. Security, Isolation & Safety Supervision

m31a-sandbox

Bubblewrap Linux container isolation: Mount, PID, IPC, UTS, and Network namespaces.

m31a-execpolicy

Prefix pattern rules, PatternToken::Alts, and LAN network destination filtering.

m31a-guardian

Autonomous safety supervisor with sliding-window circuit breaker (window: 5, max: 3).

m31a-trust

Workspace trust boundaries and Git hook protection.

6. Tools & Mutation Engines

m31a-tools

18-tool orchestration suite covering execution, filesystem, and swarms.

m31a-patch

OpenAI Codex multi-file patch engine with 4-tier fuzzy match (seek_sequence).

m31a-code-mode

Script pragmas, yield runtime, and nested await tools.<name>() execution.

m31a-ast

Tree-sitter symbol cross-referencing and data-flow taint tracking.

m31a-diff

Colorized unified diff generator with syntax highlighting.

m31a-shell & m31a-proc

Child process supervision, timeout handling, and stdin streaming.

7. Durable Persistence & State

m31a-storage

Transactional SQLite database engine at ~/.m31a/storage.db.

Threads & Checkpoints

Session branching, historical rollbacks, and token expenditure ledgers.

Pub-Sub Board & Locks

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.

System Architecture Docs