# Runtime Execution Model ## The Two Runtimes The platform contains two fundamentally different execution paths. Understanding this split is prerequisite to understanding everything else. ### Path 1 — Fast Conversational Response (In-Process) When a human sends a message, the system must reply quickly. This path runs entirely inside the application process: 1. Human message arrives via API 2. Message written to database, attention record created 3. Attention processor (polling every 2 seconds) picks up the record 4. Loads synthetic worker context and working memory 5. LLM call (streaming) 6. Parses reasoning, message, and action tags from response 7. Messages delivered immediately via WebSocket 8. Actions hand off to Path 2 Latency: seconds. ### Path 2 — Subprocess Execution (Out-of-Process) When the synthetic worker needs to actually do something — browse the web, write code, send email, search knowledge — the system spawns a child process: 1. Process manager spawns independent Python subprocess 2. Subprocess enters asyncio drain loop 3. Seeds initial task from action context 4. Pulls from async queue, executes MBUs 5. Each MBU may spawn further tasks onto the queue 6. Terminates when: queue empty and nothing in-flight, OR done MBU sets termination flag The subprocess is fully independent with its own event loop. It reads and writes to the same database but shares no memory with the conversational process. A synthetic worker can run a 10-minute browser automation session without blocking any API responses. ## Sandboxed Execution All generated code runs in a restricted environment with: - Package whitelist (pandas, numpy, requests are allowed; os, subprocess, sys are blocked) - Resource limits on memory and execution time - No network access outside approved endpoints - No filesystem access outside the working directory - Full audit logging of every execution ## The Attention System All inter-entity communication flows through a unified attention table. Every message — human-to-synthetic, synthetic-to-synthetic, synthetic-to-human — creates an attention record. The acknowledged-at field provides exactly-once processing semantics. This is the message bus that enables multi-agent coordination without special inter-agent protocols. ## Process Isolation as a Feature The subprocess model means a synthetic worker's execution has bounded blast radius. If a code execution hangs, the main application continues serving requests. If a browser automation fails, other workers are unaffected. Each worker process lives exactly as long as it has work to do, then terminates cleanly. --- *For the interactive visual walkthrough: https://usemissioncontrol.com/platform/#architecture-runtime*