# System Layer Diagram
KURO cleanly decouples presentation, intelligence, permission gates, capabilities, and persistence:
┌────────────────────────────────────────────────────────────────────────┐
│ USER / DEVELOPER CLI │
└───────────────────────────────────┬────────────────────────────────────┘
│ CLIAdapter / IOHost
▼
┌────────────────────────────────────────────────────────────────────────┐
│ CORE AGENT ORCHESTRATION │
│ │
│ • KuroAgent (ReAct State Machine) │
│ • ModelRouter (Gemini › Groq › OpenRouter › OpenAI › Ollama) │
│ • ContextEngine (Episodic Memory & Token Budget Optimization) │
└───────────────────────────────────┬────────────────────────────────────┘
│ Safe Action Parser
▼
┌────────────────────────────────────────────────────────────────────────┐
│ SECURITY & SANDBOX PERIMETER │
│ │
│ • Permission Gate (SAFE, CONFIRM, DANGEROUS states) │
│ • AST Guard (Static inspection: blocks winreg, _ctypes, popen) │
│ • Windows DPAPI Vault (Zero plaintext credential leaks) │
│ • Git Stash Safety Net (Automatic snapshot before write operations) │
└───────────────────────────────────┬────────────────────────────────────┘
│ Whitelisted Invocations
▼
┌────────────────────────────────────────────────────────────────────────┐
│ PLUG-AND-PLAY CAPABILITIES │
│ │
│ • Core Tools (FileSystem, Shell, Telemetry, Vision, Browser) │
│ • Kuro Hub Store (/hub install: tools, plugins, skills, bridges) │
└───────────────────────────────────┬────────────────────────────────────┘
│ Result Inspection
▼
┌────────────────────────────────────────────────────────────────────────┐
│ DETERMINISTIC VERIFICATION & HEALING │
│ │
│ • py_compile AST syntax check & exit code validation │
│ • Failure Classifier (10 categories: MISSING_DEPENDENCY, etc.) │
│ • Automated Repair (auto-pip, mkdir -p, or git-stash rollback) │
└────────────────────────────────────────────────────────────────────────┘
# Core Module Breakdown
Coordinates the ReAct execution lifecycle: Goal Decomposition → Thought Synthesis → Action Dispatch → Observation Ingestion → Termination Check.
Routes prompts based on task characteristics (e.g. reasoning vs. low-latency token streaming) and cascades across alternative API providers on HTTP 429 rate limit errors.
Applies Python AST inspection prior to dynamic tool execution. Identifies prohibited AST nodes, unauthorized disk wiping commands (rm -rf, format), and unapproved network calls.
Autonomous error recovery pipeline. Classifies exceptions into structured diagnostic categories and resolves issues (e.g. installing missing modules or rolling back corrupt diffs) before reporting failure.
# Deterministic Verification & Healing
Passive chat widgets assume an operation succeeded if the language model says so. KURO rejects this assumption:
- 1. File Presence & Diff Audit: Every created or edited file is immediately validated on disk with stat checks and byte comparison.
-
2. AST Syntax Compilation:
Python source code changes are pre-compiled with
py_compileto ensure no broken syntax is committed. -
3. Git Safety Rollbacks:
If an automated change produces errors, KURO triggers
/undovia internal stash checkpoints to restore pristine state.