1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
//! # roboticus-agent
//!
//! Agent core for the Roboticus runtime. The central module is `agent_loop`
//! (mapped from `loop.rs`), which implements a ReAct reasoning loop as a typed
//! state machine: Think → Act → Observe → Persist, with idle/loop detection
//! and financial guards.
//!
//! ## Key Types
//!
//! - `agent_loop` -- ReAct state machine with typed transitions via `typestate`
//! - [`tools::ToolRegistry`] -- Trait-based tool system (10 categories)
//! - [`policy::PolicyEngine`] -- Rule-based policy evaluation
//! - [`retrieval::MemoryRetriever`] -- Hybrid RAG pipeline (FTS5 + vector cosine)
//! - [`analyzer::ContextAnalyzer`] -- Topic extraction, sentiment, complexity
//! - [`recommendations::RecommendationEngine`] -- Proactive suggestions
//! - [`obsidian::ObsidianVault`] -- Obsidian vault integration
//! - [`skills::SkillLoader`] / [`skills::SkillRegistry`] -- Dual-format skill system
//!
//! ## Modules
//!
//! - `context` -- Progressive context loading (4 levels) and compression
//! - `injection` -- 4-layer prompt injection defense
//! - `prompt` -- System prompt builder with HMAC trust boundaries
//! - `memory` -- Memory budget manager and turn ingestion
//! - `retrieval` -- Hybrid search RAG pipeline with content chunking
//! - `knowledge` -- KnowledgeSource trait and aggregation
//! - `discovery` -- Capability discovery across tools, skills, plugins
//! - `digest` -- Turn digest and history summarization
//! - `device` -- Device context and hardware info
//! - `workspace` -- Workspace state (file tree, git status, project metadata)
//! - `orchestration` -- Multi-agent task decomposition
//! - `governor` -- Rate governor and concurrency limits
//! - `typestate` -- Compile-time valid state transitions
//! - `speculative` -- Parallel branch evaluation with best-result selection
//! - `manifest` -- Agent capability declarations
//! - `services` -- Service locator and dependency wiring
//! - `mcp` -- Model Context Protocol client integration
//! - `wasm` -- WASM plugin runtime
//! - `obsidian` / `obsidian_tools` -- Vault integration and read/write/search tools
//! - `skills` / `script_runner` -- Skill loading, execution, sandboxed scripts
//! - `analyzer` / `recommendations` -- Conversation analysis and proactive suggestions
// Used by unix-gated script_runner tests