# Code Index

> Generated: 2026-05-21T15:12:16Z | 82 files | Python, Rust

## Project Structure

```
├── crates/
│   ├── muninn/
│   │   ├── src/
│   │   │   ├── config.rs
│   │   │   ├── install.rs
│   │   │   ├── main.rs
│   │   │   └── session.rs
│   │   └── tests/
│   │       ├── daemon_lifecycle.rs
│   │       ├── mcp_protocol.rs
│   │       ├── routing.rs
│   │       ├── uat.rs
│   │       └── user_prompt_submit.rs
│   ├── muninn-core/
│   │   └── src/
│   │       ├── daemon.rs
│   │       ├── error.rs
│   │       ├── lib.rs
│   │       ├── llm.rs
│   │       ├── mcp.rs
│   │       └── types.rs
│   ├── muninn-graph/
│   │   ├── src/
│   │   │   ├── builder.rs
│   │   │   ├── doc_store.rs
│   │   │   ├── edges.rs
│   │   │   ├── embeddings.rs
│   │   │   ├── graph.rs
│   │   │   ├── lang/
│   │   │   │   ├── mod.rs
│   │   │   │   ├── python.rs
│   │   │   │   └── rust.rs
│   │   │   ├── lib.rs
│   │   │   ├── parser.rs
│   │   │   ├── registry/
│   │   │   │   ├── crates_io.rs
│   │   │   │   ├── indexer.rs
│   │   │   │   ├── llmstxt.rs
│   │   │   │   ├── mod.rs
│   │   │   │   ├── py_indexer.rs
│   │   │   │   ├── pydoc.rs
│   │   │   │   ├── pypi.rs
│   │   │   │   └── rustdoc.rs
│   │   │   ├── store.rs
│   │   │   ├── symbols.rs
│   │   │   └── watcher.rs
│   │   └── tests/
│   │       ├── doc_indexing.rs
│   │       └── integration.rs
│   ├── muninn-rlm/
│   │   ├── src/
│   │   │   ├── anthropic.rs
│   │   │   ├── backend.rs
│   │   │   ├── context.rs
│   │   │   ├── doc_tools.rs
│   │   │   ├── engine/
│   │   │   │   ├── budget.rs
│   │   │   │   ├── context.rs
│   │   │   │   ├── dir_tree.rs
│   │   │   │   ├── mod.rs
│   │   │   │   ├── muninn_engine_impl.rs
│   │   │   │   ├── tests.rs
│   │   │   │   ├── tool_executor.rs
│   │   │   │   └── trace.rs
│   │   │   ├── error.rs
│   │   │   ├── fs.rs
│   │   │   ├── fs_tools.rs
│   │   │   ├── graph_tools.rs
│   │   │   ├── groq.rs
│   │   │   ├── lib.rs
│   │   │   ├── mcp.rs
│   │   │   ├── mcp_engine_server.rs
│   │   │   ├── oauth.rs
│   │   │   ├── ollama.rs
│   │   │   ├── passthrough.rs
│   │   │   ├── prompts.rs
│   │   │   ├── proxy.rs
│   │   │   ├── repl_tools.rs
│   │   │   ├── router.rs
│   │   │   ├── subquery.rs
│   │   │   ├── testing/
│   │   │   │   ├── fixtures.rs
│   │   │   │   ├── mock_backend.rs
│   │   │   │   ├── mock_server.rs
│   │   │   │   └── mod.rs
│   │   │   ├── token_manager.rs
│   │   │   ├── tools.rs
│   │   │   └── types.rs
│   │   └── tests/
│   │       └── integration.rs
│   ├── muninn-tracing/
│   │   ├── examples/
│   │   │   └── demo_trace.rs
│   │   └── src/
│   │       ├── collector.rs
│   │       ├── lib.rs
│   │       ├── types.rs
│   │       └── writer.rs
│   └── tests/
│       ├── src/
│       │   └── lib.rs
│       └── tests/
│           └── cross_crate.rs
└── tools/
    └── capture_proxy.py
```

## Modules

### crates/muninn/src

> *Semantic summary to be generated by AI agent.*

#### crates/muninn/src/config.rs

- pub `MUNINN_DIR` variable L14 — `: &str` — The muninn data directory name.
- pub `CONFIG_FILE` variable L16 — `: &str` — The config file name within the muninn directory.
- pub `Config` struct L25-51 — `{ project: ProjectConfig, graph: GraphConfig, backend: BackendConfig, default: D...` — Main configuration structure.
- pub `ProjectConfig` struct L56-59 — `{ root: PathBuf }` — Project configuration.
- pub `GraphConfig` struct L72-77 — `{ path: PathBuf, extensions: Vec<String> }` — Graph/index configuration.
- pub `BackendConfig` struct L101-111 — `{ backend_type: String, model: Option<String>, base_url: Option<String>, model_p...` — Backend configuration.
- pub `RouterConfig` struct L132-141 — `{ strategy: String, enabled: bool, provider: Option<String>, model: Option<Strin...` — Router configuration.
- pub `RlmConfig` struct L160-165 — `{ provider: Option<String>, model: Option<String> }` — RLM (Recursive Language Model) configuration.
- pub `DefaultLlmConfig` struct L175-180 — `{ provider: String, model: String }` — Default LLM provider/model baseline.
- pub `ResolvedLlmConfig` struct L193-196 — `{ provider: String, model: String }` — Fully-resolved LLM provider/model after applying inheritance from `[default]`.
- pub `OllamaProviderConfig` struct L202-215 — `{ api_key: Option<String>, base_url: Option<String>, max_retries: Option<u32> }` — Ollama provider configuration.
- pub `OLLAMA_CLOUD_BASE_URL` variable L218 — `: &str` — Default Ollama Cloud base URL.
- pub `OLLAMA_LOCAL_BASE_URL` variable L221 — `: &str` — Default local Ollama base URL.
- pub `resolved_base_url` function L225-227 — `(&self) -> &str` — Resolve the effective base URL, defaulting to Ollama Cloud.
- pub `resolved_api_key` function L231-236 — `(&self) -> Option<String>` — Resolve the effective API key, consulting `OLLAMA_API_KEY` if the
- pub `needs_api_key` function L240-243 — `(&self) -> bool` — True when the resolved base URL points at Ollama Cloud (or any
- pub `BudgetConfig` struct L249-258 — `{ max_tokens: u32, max_depth: u32, max_tool_calls: u32, max_duration_secs: u64 }` — Budget configuration for recursive exploration.
- pub `GroqProviderConfig` struct L274-279 — `{ api_key: Option<String>, base_url: Option<String> }` — Groq provider configuration.
- pub `AnthropicProviderConfig` struct L284-289 — `{ api_key: Option<String>, base_url: Option<String> }` — Anthropic provider configuration.
- pub `from_file` function L293-299 — `(path: &Path) -> Result<Self>` — Load configuration from a file.
- pub `find_and_load` function L305-308 — `() -> Result<Option<(Self, PathBuf)>>` — Find and load configuration from current or parent directories.
- pub `find_and_load_from` function L313-332 — `(start: &Path) -> Result<Option<(Self, PathBuf)>>` — Find and load configuration starting from a specific directory.
- pub `load_or_default` function L336-351 — `() -> Self` — Load configuration or use defaults.
- pub `resolve_graph_path` function L354-363 — `(&self, muninn_dir: Option<&Path>) -> PathBuf` — Resolve the graph path relative to the .muninn directory.
- pub `muninn_dir` function L367-369 — `(base: &Path) -> PathBuf` — Get the path to the .muninn directory for a given base path.
- pub `config_path` function L373-375 — `(muninn_dir: &Path) -> PathBuf` — Get the config file path for a given .muninn directory.
- pub `resolved_router` function L380-393 — `(&self) -> ResolvedLlmConfig` — Resolve the router's effective provider+model after applying
- pub `resolved_rlm` function L397-410 — `(&self) -> ResolvedLlmConfig` — Resolve the RLM's effective provider+model after applying inheritance
- pub `ConfigValidationError` struct L416-419 — `{ field: String, message: String }` — Configuration validation error.
- pub `validate` function L434-537 — `(&self) -> Vec<ConfigValidationError>` — Validate the configuration.
- pub `has_deprecated_backend_config` function L540-547 — `(&self) -> bool` — Check if the deprecated [backend] section is being used.
- pub `warn_deprecated_backend` function L550-563 — `(&self)` — Emit a deprecation warning if using old [backend] section.
-  `ProjectConfig` type L61-67 — `impl Default for ProjectConfig` — directory and walking up to parent directories.
-  `default` function L62-66 — `() -> Self` — directory and walking up to parent directories.
-  `GraphConfig` type L79-96 — `impl Default for GraphConfig` — directory and walking up to parent directories.
-  `default` function L80-95 — `() -> Self` — directory and walking up to parent directories.
-  `BackendConfig` type L113-122 — `impl Default for BackendConfig` — directory and walking up to parent directories.
-  `default` function L114-121 — `() -> Self` — directory and walking up to parent directories.
-  `RouterConfig` type L143-152 — `impl Default for RouterConfig` — directory and walking up to parent directories.
-  `default` function L144-151 — `() -> Self` — directory and walking up to parent directories.
-  `DefaultLlmConfig` type L182-189 — `impl Default for DefaultLlmConfig` — directory and walking up to parent directories.
-  `default` function L183-188 — `() -> Self` — directory and walking up to parent directories.
-  `OllamaProviderConfig` type L223-244 — `= OllamaProviderConfig` — directory and walking up to parent directories.
-  `BudgetConfig` type L260-269 — `impl Default for BudgetConfig` — directory and walking up to parent directories.
-  `default` function L261-268 — `() -> Self` — directory and walking up to parent directories.
-  `Config` type L291-411 — `= Config` — directory and walking up to parent directories.
-  `ConfigValidationError` type L421-425 — `= ConfigValidationError` — directory and walking up to parent directories.
-  `fmt` function L422-424 — `(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result` — directory and walking up to parent directories.
-  `ConfigValidationError` type L427 — `= ConfigValidationError` — directory and walking up to parent directories.
-  `Config` type L429-564 — `= Config` — directory and walking up to parent directories.
-  `tests` module L567-790 — `-` — directory and walking up to parent directories.
-  `test_default_config` function L571-588 — `()` — directory and walking up to parent directories.
-  `test_parse_minimal_config` function L591-600 — `()` — directory and walking up to parent directories.
-  `test_parse_full_config` function L603-642 — `()` — directory and walking up to parent directories.
-  `test_inheritance_default_only` function L645-659 — `()` — directory and walking up to parent directories.
-  `test_inheritance_router_override_beats_default` function L662-678 — `()` — directory and walking up to parent directories.
-  `test_inheritance_backwards_compat_no_default_section` function L681-698 — `()` — directory and walking up to parent directories.
-  `test_validate_requires_ollama_api_key_for_cloud` function L701-722 — `()` — directory and walking up to parent directories.
-  `test_validate_local_ollama_keyless_ok` function L725-745 — `()` — directory and walking up to parent directories.
-  `test_default_graph_path` function L748-752 — `()` — directory and walking up to parent directories.
-  `test_resolve_graph_path` function L755-760 — `()` — directory and walking up to parent directories.
-  `test_validate_invalid_provider` function L763-769 — `()` — directory and walking up to parent directories.
-  `test_validate_empty_model` function L772-780 — `()` — directory and walking up to parent directories.
-  `test_deprecated_backend_detection` function L783-789 — `()` — directory and walking up to parent directories.

#### crates/muninn/src/install.rs

- pub `MUNINN_SERVER_NAME` variable L42 — `: &str` — MCP server key — also the name CC will surface in the tool picker.
- pub `InstallScope` enum L46-52 — `Project | Global` — Where to write the registration.
- pub `resolve_config_path` function L70-84 — `(scope: InstallScope, config_dir: Option<&Path>) -> Result<PathBuf>` — Resolve the on-disk config path for a given scope.
- pub `muninn_mcp_entry` function L87-93 — `() -> Value` — Build the MCP server entry value we write into `mcpServers.muninn`.
- pub `InstallOutcome` enum L98-112 — `Wrote | AlreadyPresent | DryRun` — Result of an install/uninstall operation.
- pub `UninstallOutcome` enum L115-127 — `Removed | NothingToRemove | DryRun` — ```
- pub `install` function L130-165 — `( scope: InstallScope, config_dir: Option<&Path>, dry_run: bool, ) -> Result<Ins...` — Install (or no-op) the muninn MCP entry into the target config.
- pub `uninstall` function L169-201 — `( scope: InstallScope, config_dir: Option<&Path>, dry_run: bool, ) -> Result<Uni...` — Remove the muninn MCP entry from the target config, leaving other
- pub `describe_install` function L261-291 — `(outcome: &InstallOutcome, scope: InstallScope) -> String` — Render a friendly install summary for stdout.
- pub `describe_uninstall` function L293-318 — `(outcome: &UninstallOutcome, scope: InstallScope) -> String` — ```
- pub `plugin_install_notice` function L323-330 — `() -> String` — Hook + plugin install notice — printed alongside the MCP summary
-  `InstallScope` type L54-61 — `= InstallScope` — ```
-  `label` function L55-60 — `(self) -> &'static str` — ```
-  `read_or_empty_object` function L205-223 — `(path: &Path) -> Result<(Value, bool)>` — Read the config file as a JSON object (or treat a missing file as
-  `ensure_mcp_servers` function L226-235 — `(root: &mut Value) -> &mut Map<String, Value>` — Borrow the `mcpServers` object out of `root`, creating it if absent.
-  `backup_file` function L238-244 — `(path: &Path) -> Result<Option<PathBuf>>` — Copy `path` to `path.bak` for safety before mutating it.
-  `write_json_pretty` function L249-258 — `(path: &Path, value: &Value) -> Result<()>` — Pretty-print JSON with a trailing newline.
-  `tests` module L333-603 — `-` — ```
-  `read_json` function L337-339 — `(path: &Path) -> Value` — ```
-  `install_into_missing_file_creates_it` function L343-356 — `()` — Install into a missing file → creates it and writes our entry.
-  `install_preserves_unrelated_entries` function L361-385 — `()` — Install over an existing config with other entries preserves
-  `install_is_idempotent` function L389-397 — `()` — Re-installing on an already-installed config is a no-op.
-  `install_rewrites_when_entry_differs` function L402-419 — `()` — If muninn's entry exists but differs (e.g.
-  `install_dry_run_does_not_write` function L423-429 — `()` — `--dry-run` doesn't touch disk.
-  `install_rejects_non_object_config` function L433-440 — `()` — Refuse to clobber a config that isn't a JSON object.
-  `uninstall_preserves_other_entries` function L444-463 — `()` — Uninstall removes only our entry and leaves the rest intact.
-  `uninstall_on_clean_config_is_noop` function L467-473 — `()` — Uninstall on a clean config reports NothingToRemove.
-  `uninstall_on_missing_config_is_noop` function L477-482 — `()` — Uninstall on a missing config is also a no-op.
-  `install_then_uninstall_restores_pre_install_state` function L487-505 — `()` — Round-trip: install → uninstall returns to a state where
-  `describe_install_handles_all_variants` function L509-526 — `()` — Confirm describe_install renders something useful in each branch.
-  `install_with_path` function L536-566 — `(path: &Path, dry_run: bool) -> Result<InstallOutcome>` — ```
-  `uninstall_with_path` function L568-602 — `(path: &Path, dry_run: bool) -> Result<UninstallOutcome>` — ```

#### crates/muninn/src/main.rs

-  `config` module L6 — `-` — Muninn sits between your coding agent (like Claude Code) and local LLMs,
-  `install` module L7 — `-` — providing intelligent request routing and deep context exploration.
-  `session` module L8 — `-` — providing intelligent request routing and deep context exploration.
-  `AGENT_COMMANDS` variable L22 — `: &[&str]` — Known agent commands that trigger passthrough mode.
-  `split_args_at_agent` function L26-41 — `() -> (Vec<String>, Option<(String, Vec<String>)>)` — Split command line args at agent command boundary.
-  `config_to_rlm_budget` function L60-67 — `(config: &config::BudgetConfig) -> RlmBudgetConfig` — Convert config budget to RLM budget type.
-  `create_backend_from_config` function L72-132 — `( provider: &str, model: &str, config: &Config, _config_dir: Option<&std::path::...` — Create a backend from provider and model configuration.
-  `Cli` struct L141-168 — `{ verbose: bool, config: Option<PathBuf>, port: u16, groq_key: Option<String>, r...` — Privacy-first recursive context gateway for agentic coding
-  `Commands` enum L171-277 — `Proxy | Index | Init | Auth | Docs | Daemon | Hook | InstallCc | UninstallCc | M...` — providing intelligent request routing and deep context exploration.
-  `DaemonCommand` enum L281-309 — `Start | Status | Stop | Ensure` — Subcommands for the local-IPC engine daemon.
-  `HookCommand` enum L313-321 — `Submit` — Subcommands for Claude Code hook integration.
-  `DocsCommand` enum L325-438 — `IndexCrate | IndexPackage | List | Search | Remove | Update | IndexLlms` — Subcommands for documentation management.
-  `init_logging` function L442-453 — `(verbose: bool)` — Initialize logging for standalone commands (not agent mode).
-  `init_file_logging` function L457-490 — `(muninn_dir: &std::path::Path, verbose: bool)` — Initialize logging for proxy/daemon mode.
-  `GUARD` variable L482-483 — `: std::sync::OnceLock<tracing_appender::non_blocking::WorkerGuard>` — providing intelligent request routing and deep context exploration.
-  `init_agent_logging` function L493-516 — `(muninn_dir: &std::path::Path)` — Initialize logging for agent mode - logs to file to keep terminal clean.
-  `AGENT_GUARD` variable L505-506 — `: std::sync::OnceLock<tracing_appender::non_blocking::WorkerGuard>` — providing intelligent request routing and deep context exploration.
-  `init_session_logging` function L520-555 — `(session_dir: &std::path::Path, verbose: bool)` — Initialize logging for session-based mode.
-  `SESSION_GUARD` variable L547-548 — `: std::sync::OnceLock<tracing_appender::non_blocking::WorkerGuard>` — providing intelligent request routing and deep context exploration.
-  `parse_router_strategy` function L557-567 — `(s: &str) -> RouterStrategy` — providing intelligent request routing and deep context exploration.
-  `create_tools` function L570-597 — `( workdir: &PathBuf, graph_store: Option<SharedGraphStore>, doc_store: Option<Sh...` — Create a tool registry with all available tools.
-  `open_graph_store` function L600-608 — `(path: &PathBuf) -> Result<Option<SharedGraphStore>>` — Load or open the graph store, optionally starting background indexing if missing.
-  `open_doc_store` function L611-623 — `(path: &PathBuf) -> Result<Option<SharedDocStore>>` — Open the doc store if it exists.
-  `start_background_indexing` function L626-672 — `(graph_path: PathBuf, source_path: PathBuf, extensions: Vec<String>)` — Start background indexing if graph store doesn't exist.
-  `start_file_watcher` function L677-737 — `(graph_path: PathBuf, source_path: PathBuf, debounce_ms: u64)` — Start file watcher to keep graph in sync with source changes.
-  `process_file_changes` function L740-779 — `( graph_path: &PathBuf, modified: &[PathBuf], deleted: &[PathBuf], ) -> Result<(...` — Process batched file changes by updating the graph.
-  `load_config` function L784-825 — `(override_path: Option<&PathBuf>) -> (Config, Option<PathBuf>)` — Load config from file or auto-discover from `.muninn/config.toml`.
-  `main` function L828-1704 — `() -> Result<()>` — providing intelligent request routing and deep context exploration.
-  `run_hook_command` function L1710-1721 — `( command: HookCommand, config: &Config, config_dir: Option<&std::path::Path>, )...` — Handle `muninn hook …` subcommands.
-  `hook_socket_path` function L1731-1739 — `(_config: &Config, config_dir: Option<&std::path::Path>) -> PathBuf` — Resolve the daemon socket path the hook should target — the
-  `HookResponse` enum L1744-1747 — `Passthrough | Augment` — What the hook tells Claude Code to do.
-  `HookResponse` type L1749-1767 — `= HookResponse` — providing intelligent request routing and deep context exploration.
-  `write_to_stdout_for_event` function L1752-1766 — `(self, event: &str)` — Serialize to CC's hook-response JSON envelope on stdout.
-  `UserPromptInput` struct L1772-1775 — `{ prompt: String }` — CC UserPromptSubmit hook input shape.
-  `run_hook_submit` function L1788-1820 — `(config: &Config, config_dir: Option<&std::path::Path>)` — Body of `muninn hook submit`.
-  `SUBMIT_DEADLINE_DEFAULT` variable L1799 — `: std::time::Duration` — providing intelligent request routing and deep context exploration.
-  `SUBMIT_RLM_INSTRUCTION` variable L1829-1842 — `: &str` — User-message prefix when we drive the engine for the
-  `submit_inner` function L1844-1965 — `( config: &Config, config_dir: Option<&std::path::Path>, ) -> Result<HookRespons...` — providing intelligent request routing and deep context exploration.
-  `extract_final_capture` function L1969-1975 — `(text: &str) -> Option<String>` — Extract the FINAL(...) capture from an RLM response if present.
-  `init_logging_stderr_only` function L1979-1989 — `(verbose: bool)` — Set up tracing for the MCP subcommand.
-  `resolve_daemon_socket` function L1992-2005 — `( explicit: Option<PathBuf>, config_dir: Option<&std::path::Path>, ) -> PathBuf` — Resolve the daemon socket path: explicit override > repo-scoped default.
-  `run_daemon_command` function L2008-2146 — `( command: DaemonCommand, config: &Config, config_dir: Option<&std::path::Path>,...` — Handle `muninn daemon …` subcommands.
-  `AgentLaunchConfig` struct L2149-2168 — `{ port: u16, groq_key: Option<String>, router_strategy: Option<String>, workdir:...` — Configuration for launching an agent with muninn proxy.
-  `run_with_agent` function L2171-2450 — `(launch: AgentLaunchConfig) -> Result<()>` — Run an agent with muninn proxy transparently injected.
-  `run_oauth_flow` function L2453-2521 — `(token_manager: &FileTokenManager) -> Result<()>` — Run the OAuth PKCE flow for Claude MAX authentication.

#### crates/muninn/src/session.rs

- pub `SessionId` struct L16 — `-` — Unique identifier for a proxy session.
- pub `generate` function L20-28 — `() -> Self` — Generate a new session ID with current timestamp and random suffix.
- pub `from_string` function L32-34 — `(s: impl Into<String>) -> Self` — Create a session ID from a string (for testing or restoration).
- pub `as_str` function L38-40 — `(&self) -> &str` — Get the session ID as a string.
- pub `session_dir` function L50-52 — `(muninn_dir: &Path, session_id: &SessionId) -> PathBuf` — Get the session directory path for a given session ID.
- pub `SessionMetadata` struct L56-73 — `{ session_id: String, started_at: DateTime<Utc>, work_dir: PathBuf, router_strat...` — Metadata about a proxy session.
- pub `new` function L77-85 — `(session_id: &SessionId, work_dir: PathBuf) -> Self` — Create new session metadata.
- pub `with_router_strategy` function L88-91 — `(mut self, strategy: impl Into<String>) -> Self` — Set the router strategy.
- pub `with_rlm_model` function L94-97 — `(mut self, model: impl Into<String>) -> Self` — Set the RLM model.
- pub `write_metadata` function L101-106 — `(session_dir: &Path, metadata: &SessionMetadata) -> anyhow::Result<()>` — Write session metadata to the session directory.
- pub `read_metadata` function L110-115 — `(session_dir: &Path) -> anyhow::Result<SessionMetadata>` — Read session metadata from a session directory.
-  `SessionId` type L18-41 — `= SessionId` — Each proxy run gets a unique session ID and directory for isolated logging.
-  `SessionId` type L43-47 — `= SessionId` — Each proxy run gets a unique session ID and directory for isolated logging.
-  `fmt` function L44-46 — `(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result` — Each proxy run gets a unique session ID and directory for isolated logging.
-  `SessionMetadata` type L75-98 — `= SessionMetadata` — Each proxy run gets a unique session ID and directory for isolated logging.
-  `tests` module L118-161 — `-` — Each proxy run gets a unique session ID and directory for isolated logging.
-  `test_session_id_format` function L123-131 — `()` — Each proxy run gets a unique session ID and directory for isolated logging.
-  `test_session_dir_path` function L134-143 — `()` — Each proxy run gets a unique session ID and directory for isolated logging.
-  `test_metadata_roundtrip` function L146-160 — `()` — Each proxy run gets a unique session ID and directory for isolated logging.

### crates/muninn/tests

> *Semantic summary to be generated by AI agent.*

#### crates/muninn/tests/daemon_lifecycle.rs

-  `POLL_INTERVAL` variable L25 — `: Duration` — and runs all `#[ignore]`'d UAT crates.
-  `ALIVE_TIMEOUT` variable L26 — `: Duration` — and runs all `#[ignore]`'d UAT crates.
-  `DEAD_TIMEOUT` variable L27 — `: Duration` — and runs all `#[ignore]`'d UAT crates.
-  `muninn_bin` function L29-31 — `() -> &'static str` — and runs all `#[ignore]`'d UAT crates.
-  `isolated_socket` function L35-40 — `() -> PathBuf` — Create a unique tempdir + socket path that survives the test
-  `status` function L43-61 — `(socket: &std::path::Path) -> String` — `muninn daemon status --socket <sock>` — returns "alive" or "dead".
-  `wait_alive` function L64-76 — `(socket: &std::path::Path, timeout: Duration)` — Block until the socket reports `alive` or the timeout fires.
-  `wait_dead` function L79-91 — `(socket: &std::path::Path, timeout: Duration)` — Block until the socket reports `dead` or the timeout fires.
-  `skip_if_no_backend` function L94-107 — `(test: &str) -> bool` — Skip-with-message when credentials aren't around.
-  `daemon_full_lifecycle` function L113-149 — `()` — Full lifecycle:
-  `daemon_ensure_is_idempotent_when_alive` function L155-200 — `()` — `ensure` is idempotent — running it twice when alive doesn't error
-  `daemon_stop_is_idempotent_when_dead` function L206-224 — `()` — `stop` on a dead daemon is idempotent — reports the "no PID file"
-  `daemon_auto_respawn_after_hard_kill` function L232-296 — `()` — Kill the daemon process out-of-band (SIGKILL the PID we wrote) and

#### crates/muninn/tests/mcp_protocol.rs

-  `ALIVE_TIMEOUT` variable L25 — `: Duration` — - subprocess work belongs in the UAT pipeline.
-  `DEAD_TIMEOUT` variable L26 — `: Duration` — - subprocess work belongs in the UAT pipeline.
-  `RESPONSE_TIMEOUT` variable L27 — `: Duration` — - subprocess work belongs in the UAT pipeline.
-  `POLL_INTERVAL` variable L28 — `: Duration` — - subprocess work belongs in the UAT pipeline.
-  `muninn_bin` function L30-32 — `() -> &'static str` — - subprocess work belongs in the UAT pipeline.
-  `isolated_socket` function L34-39 — `() -> PathBuf` — - subprocess work belongs in the UAT pipeline.
-  `status_verb` function L41-52 — `(socket: &std::path::Path) -> String` — - subprocess work belongs in the UAT pipeline.
-  `wait_until` function L54-63 — `(label: &str, timeout: Duration, cond: F)` — - subprocess work belongs in the UAT pipeline.
-  `skip_if_no_backend` function L65-75 — `(test: &str) -> bool` — - subprocess work belongs in the UAT pipeline.
-  `DaemonGuard` struct L79-81 — `{ socket: PathBuf }` — Bring up a daemon scoped to `socket`.
-  `DaemonGuard` type L83-97 — `= DaemonGuard` — - subprocess work belongs in the UAT pipeline.
-  `start` function L84-96 — `(socket: PathBuf) -> Self` — - subprocess work belongs in the UAT pipeline.
-  `DaemonGuard` type L99-111 — `impl Drop for DaemonGuard` — - subprocess work belongs in the UAT pipeline.
-  `drop` function L100-110 — `(&mut self)` — - subprocess work belongs in the UAT pipeline.
-  `McpClient` struct L115-120 — `{ child: Child, stdin: std::process::ChildStdin, stdout: BufReader<std::process:...` — Minimal JSON-RPC client over the muninn-mcp child process's
-  `McpClient` type L122-191 — `= McpClient` — - subprocess work belongs in the UAT pipeline.
-  `spawn` function L123-140 — `(socket: &std::path::Path) -> Self` — - subprocess work belongs in the UAT pipeline.
-  `send` function L142-146 — `(&mut self, payload: serde_json::Value)` — - subprocess work belongs in the UAT pipeline.
-  `request` function L148-182 — `(&mut self, method: &str, params: serde_json::Value) -> serde_json::Value` — - subprocess work belongs in the UAT pipeline.
-  `notify` function L184-190 — `(&mut self, method: &str, params: serde_json::Value)` — - subprocess work belongs in the UAT pipeline.
-  `McpClient` type L193-202 — `impl Drop for McpClient` — - subprocess work belongs in the UAT pipeline.
-  `drop` function L194-201 — `(&mut self)` — - subprocess work belongs in the UAT pipeline.
-  `mcp_initialize_and_list_tools` function L210-266 — `()` — Full handshake: `initialize` succeeds, the server reports its
-  `mcp_tools_call_search_code_returns_filesystem_hits` function L276-344 — `()` — Call `search_code` over MCP and assert the engine actually walks
-  `mcp_tools_call_query_graph_returns_graph_payload` function L354-450 — `()` — Call `query_graph` over MCP with `kind=callers` against a target

#### crates/muninn/tests/routing.rs

-  `READY_TIMEOUT` variable L31 — `: Duration` — engine can grep against real source files.
-  `REQUEST_TIMEOUT` variable L32 — `: Duration` — engine can grep against real source files.
-  `muninn_bin` function L34-36 — `() -> &'static str` — engine can grep against real source files.
-  `workspace_root` function L40-46 — `() -> PathBuf` — Workspace root — `crates/muninn/` is the test crate; `..` then `..`
-  `pick_port` function L51-54 — `() -> u16` — Pick a free localhost port by binding 0 + releasing the listener.
-  `skip_if_no_backend` function L56-68 — `(test: &str) -> bool` — engine can grep against real source files.
-  `stage_proxy_config` function L73-95 — `() -> PathBuf` — Stage a `.muninn/config.toml` pointing the engine at the muninn
-  `ProxyHandle` struct L99-102 — `{ child: Child, base: String }` — Spawn `muninn --config <dir> proxy --port <port>`.
-  `ProxyHandle` type L104-159 — `= ProxyHandle` — engine can grep against real source files.
-  `start` function L109-158 — `(config_dir: &Path, port: u16) -> Self` — engine can grep against real source files.
-  `ProxyHandle` type L161-169 — `impl Drop for ProxyHandle` — engine can grep against real source files.
-  `drop` function L162-168 — `(&mut self)` — engine can grep against real source files.
-  `send_messages_request` function L172-188 — `(base: &str, body: &serde_json::Value) -> serde_json::Value` — Send a /v1/messages request and return the raw response body.
-  `proxy_rlm_explore_finds_known_symbol` function L201-255 — `()` — Headline test: explicit `@muninn explore` should fire the
-  `proxy_records_exploration_metadata` function L268-316 — `()` — Verify the engine's exploration metadata (tool_calls,
-  `proxy_router_chooses_rlm_for_implicit_implementation_request` function L328-359 — `()` — Implicit-context routing — the user is asking the agent to do an
-  `proxy_router_chooses_rlm_for_implicit_diagnostic_request` function L367-394 — `()` — Same idea, different surface — a diagnostic ("why" / "what's
-  `extract_text` function L397-412 — `(resp: &serde_json::Value) -> String` — Pull plain text out of an Anthropic-style `content` array.

#### crates/muninn/tests/uat.rs

-  `cli_advertises_hook_and_mcp_subcommands` function L32-50 — `()` — Probe that the binary's CLI surface is intact — runs

#### crates/muninn/tests/user_prompt_submit.rs

-  `ALIVE_TIMEOUT` variable L26 — `: Duration` — socket the hook resolves doesn't match a live daemon.
-  `DEAD_TIMEOUT` variable L27 — `: Duration` — socket the hook resolves doesn't match a live daemon.
-  `POLL_INTERVAL` variable L28 — `: Duration` — socket the hook resolves doesn't match a live daemon.
-  `muninn_bin` function L30-32 — `() -> &'static str` — socket the hook resolves doesn't match a live daemon.
-  `isolated_socket` function L34-39 — `() -> PathBuf` — socket the hook resolves doesn't match a live daemon.
-  `skip_if_no_backend` function L41-53 — `(test: &str) -> bool` — socket the hook resolves doesn't match a live daemon.
-  `wait_alive` function L55-67 — `(socket: &std::path::Path)` — socket the hook resolves doesn't match a live daemon.
-  `wait_dead` function L69-81 — `(socket: &std::path::Path)` — socket the hook resolves doesn't match a live daemon.
-  `smol_block` function L86-92 — `(f: F) -> F::Output` — Tiny single-shot block-on for a future.
-  `DaemonGuard` struct L94-96 — `{ socket: PathBuf }` — socket the hook resolves doesn't match a live daemon.
-  `DaemonGuard` type L98-116 — `= DaemonGuard` — socket the hook resolves doesn't match a live daemon.
-  `start_with_config` function L100-115 — `(socket: PathBuf, config_dir: Option<&std::path::Path>) -> Self` — socket the hook resolves doesn't match a live daemon.
-  `DaemonGuard` type L118-128 — `impl Drop for DaemonGuard` — socket the hook resolves doesn't match a live daemon.
-  `drop` function L119-127 — `(&mut self)` — socket the hook resolves doesn't match a live daemon.
-  `repo_root` function L134-140 — `() -> PathBuf` — Repo root, derived from `CARGO_MANIFEST_DIR` (which points at
-  `staged_config_dir` function L147-159 — `(toml_body: &str) -> PathBuf` — Stage an isolated `.muninn/config.toml` with the given TOML body.
-  `isolated_config_dir` function L164-184 — `() -> PathBuf` — Default test config: both router and rlm on Ollama Cloud +
-  `run_hook_submit` function L191-228 — `( socket: Option<&std::path::Path>, config_dir: Option<&std::path::Path>, envs: ...` — Spawn `muninn hook submit` with `stdin_payload` on stdin.
-  `submit_returns_passthrough_when_daemon_unreachable` function L237-253 — `()` — Hook degrades cleanly when the daemon socket it resolves doesn't
-  `submit_honors_explicit_passthrough_marker` function L261-273 — `()` — Floor-case passthrough: `@muninn passthrough` short-circuits the
-  `submit_injects_answer_envelope_for_code_question` function L286-357 — `()` — Happy path: daemon alive, RLM produces a FINAL answer, and the
-  `submit_handles_provider_error_during_rlm` function L370-434 — `()` — Mid-flight provider error: router picks RLM (forced via the
-  `submit_timeout_backstop_fires_on_hung_backend` function L445-523 — `()` — Outer-cap backstop: deliberately wedge the daemon's RLM backend

### crates/muninn-core/src

> *Semantic summary to be generated by AI agent.*

#### crates/muninn-core/src/daemon.rs

- pub `DaemonMethod` enum L76-81 — `Complete | SearchCode | Explore | QueryGraph` — Method discriminant for daemon requests.
- pub `Request` struct L85-91 — `{ id: u64, method: DaemonMethod, payload: Value }` — A single client→server request frame.
- pub `Response` struct L95-99 — `{ id: u64, result: ResponseResult }` — A single server→client response frame.
- pub `ResponseResult` enum L104-107 — `Ok | Err` — Result discriminant for [`Response`].
- pub `WireError` enum L112-119 — `InvalidRequest | NotFound | BudgetExceeded | Backend | Storage | Internal` — Engine error in wire form.
- pub `socket_path_for_repo` function L157-166 — `(repo_root: &Path) -> PathBuf` — Compute the canonical daemon socket path for a given repository root.
- pub `daemon_runtime_dir` function L173-181 — `() -> PathBuf` — Best-effort runtime directory for daemon sockets.
- pub `prepare_socket_dir` function L185-189 — `() -> std::io::Result<PathBuf>` — Create the daemon runtime directory if it doesn't exist.
- pub `pid_path_for_socket` function L241-245 — `(socket_path: &Path) -> PathBuf` — Return the PID-file path that pairs with a given socket path
- pub `serve` function L257-337 — `( engine: SharedEngine, socket_path: &Path, mut shutdown: oneshot::Receiver<()>,...` — Run a daemon serving `engine` on `socket_path`.
- pub `DaemonClient` struct L409-412 — `{ conn: Mutex<UnixStream>, next_id: std::sync::atomic::AtomicU64 }` — A client that talks to a daemon over a Unix socket.
- pub `connect` function L416-424 — `(socket_path: &Path) -> Result<Self>` — Connect to a daemon at `socket_path`.
- pub `is_alive` function L475-477 — `(socket_path: &Path) -> bool` — Quick liveness probe: returns `true` if a daemon is currently
- pub `stop_daemon` function L486-529 — `(socket_path: &Path) -> Result<()>` — Send `SIGTERM` to the daemon associated with `socket_path` and wait
- pub `ensure_daemon` function L544-546 — `(socket_path: &Path, binary_path: &Path) -> Result<()>` — Ensure a daemon is alive at `socket_path`, spawning one via the
- pub `ensure_daemon_with_args` function L554-608 — `( socket_path: &Path, binary_path: &Path, top_level_args: &[std::ffi::OsString],...` — Like [`ensure_daemon`], but lets the caller prepend extra
-  `WireError` type L121-132 — `= WireError` — contention becomes real, a `flock(2)`-based gate can replace it.
-  `from` function L122-131 — `(e: MuninnCoreError) -> Self` — contention becomes real, a `flock(2)`-based gate can replace it.
-  `MuninnCoreError` type L134-145 — `= MuninnCoreError` — contention becomes real, a `flock(2)`-based gate can replace it.
-  `from` function L135-144 — `(e: WireError) -> Self` — contention becomes real, a `flock(2)`-based gate can replace it.
-  `read_frame` function L196-219 — `(stream: &mut UnixStream) -> Result<T>` — Length-prefix-framed read of a single JSON message into `T`.
-  `MAX_FRAME` variable L206 — `: usize` — contention becomes real, a `flock(2)`-based gate can replace it.
-  `write_frame` function L222-236 — `(stream: &mut UnixStream, msg: &T) -> Result<()>` — Length-prefix-framed write of a single JSON message.
-  `handle_connection` function L339-365 — `(engine: SharedEngine, mut stream: UnixStream) -> Result<()>` — contention becomes real, a `flock(2)`-based gate can replace it.
-  `dispatch` function L367-395 — `(engine: &SharedEngine, req: Request) -> Result<Value>` — contention becomes real, a `flock(2)`-based gate can replace it.
-  `decode` function L368-371 — `(payload: Value) -> Result<T>` — contention becomes real, a `flock(2)`-based gate can replace it.
-  `encode` function L372-375 — `(v: T) -> Result<Value>` — contention becomes real, a `flock(2)`-based gate can replace it.
-  `DaemonClient` type L414-455 — `= DaemonClient` — contention becomes real, a `flock(2)`-based gate can replace it.
-  `call` function L426-454 — `( &self, method: DaemonMethod, payload: P, ) -> Result<R>` — contention becomes real, a `flock(2)`-based gate can replace it.
-  `DaemonClient` type L458-471 — `impl MuninnEngine for DaemonClient` — contention becomes real, a `flock(2)`-based gate can replace it.
-  `complete` function L459-461 — `(&self, request: CompletionRequest) -> Result<CompletionResponse>` — contention becomes real, a `flock(2)`-based gate can replace it.
-  `search_code` function L462-464 — `(&self, query: SearchQuery) -> Result<SearchResult>` — contention becomes real, a `flock(2)`-based gate can replace it.
-  `explore` function L465-467 — `(&self, request: ExploreRequest) -> Result<ExploreResult>` — contention becomes real, a `flock(2)`-based gate can replace it.
-  `query_graph` function L468-470 — `(&self, query: GraphQuery) -> Result<GraphResult>` — contention becomes real, a `flock(2)`-based gate can replace it.
-  `tests` module L615-886 — `-` — contention becomes real, a `flock(2)`-based gate can replace it.
-  `StubEngine` struct L623-625 — `{ search_calls: AtomicU32 }` — In-memory engine that records calls and returns canned responses.
-  `StubEngine` type L628-649 — `impl MuninnEngine for StubEngine` — contention becomes real, a `flock(2)`-based gate can replace it.
-  `complete` function L629-631 — `(&self, _r: CompletionRequest) -> CoreResult<CompletionResponse>` — contention becomes real, a `flock(2)`-based gate can replace it.
-  `search_code` function L632-642 — `(&self, query: SearchQuery) -> CoreResult<SearchResult>` — contention becomes real, a `flock(2)`-based gate can replace it.
-  `explore` function L643-645 — `(&self, _r: ExploreRequest) -> CoreResult<ExploreResult>` — contention becomes real, a `flock(2)`-based gate can replace it.
-  `query_graph` function L646-648 — `(&self, _q: GraphQuery) -> CoreResult<GraphResult>` — contention becomes real, a `flock(2)`-based gate can replace it.
-  `temp_socket` function L651-658 — `() -> PathBuf` — contention becomes real, a `flock(2)`-based gate can replace it.
-  `socket_path_is_deterministic_per_repo` function L661-665 — `()` — contention becomes real, a `flock(2)`-based gate can replace it.
-  `socket_path_differs_across_repos` function L668-672 — `()` — contention becomes real, a `flock(2)`-based gate can replace it.
-  `is_alive_false_when_no_daemon` function L675-678 — `()` — contention becomes real, a `flock(2)`-based gate can replace it.
-  `server_client_roundtrip_search_code` function L681-730 — `()` — contention becomes real, a `flock(2)`-based gate can replace it.
-  `serve_writes_pid_file_and_drains_on_shutdown` function L733-767 — `()` — contention becomes real, a `flock(2)`-based gate can replace it.
-  `stop_daemon_signals_and_cleans_up` function L771-809 — `()` — contention becomes real, a `flock(2)`-based gate can replace it.
-  `ensure_daemon_noop_when_already_alive` function L813-838 — `()` — contention becomes real, a `flock(2)`-based gate can replace it.
-  `ensure_daemon_errors_when_spawn_target_missing` function L842-850 — `()` — contention becomes real, a `flock(2)`-based gate can replace it.
-  `error_responses_round_trip` function L853-885 — `()` — contention becomes real, a `flock(2)`-based gate can replace it.

#### crates/muninn-core/src/error.rs

- pub `Result` type L12 — `= std::result::Result<T, MuninnCoreError>` — Result alias used across the trait surface.
- pub `MuninnCoreError` enum L16-45 — `InvalidRequest | NotFound | BudgetExceeded | Backend | Storage | Internal` — Error type returned by every [`crate::MuninnEngine`] method.
- pub `internal` function L50-52 — `(msg: impl Into<String>) -> Self` — Convenience for adapters that want a single helper to wrap an
-  `MuninnCoreError` type L47-53 — `= MuninnCoreError` — hierarchy.
-  `tests` module L56-70 — `-` — hierarchy.
-  `display_includes_variant_payload` function L60-63 — `()` — hierarchy.
-  `internal_helper_constructs_internal_variant` function L66-69 — `()` — hierarchy.

#### crates/muninn-core/src/lib.rs

- pub `daemon` module L19 — `-` — `muninn-core` defines the [`MuninnEngine`] trait and the request/response
- pub `error` module L20 — `-` — later is expensive.
- pub `llm` module L21 — `-` — later is expensive.
- pub `mcp` module L22 — `-` — later is expensive.
- pub `types` module L23 — `-` — later is expensive.
- pub `MuninnEngine` interface L47-71 — `{ fn complete(), fn search_code(), fn explore(), fn query_graph() }` — Adapter-neutral engine API.
- pub `SharedEngine` type L75 — `= Arc<dyn MuninnEngine>` — A shared, object-safe handle to a [`MuninnEngine`].

#### crates/muninn-core/src/llm.rs

- pub `SystemPrompt` enum L20-25 — `Text | Blocks` — System prompt - can be a string or array of text blocks.
- pub `SystemBlock` struct L29-38 — `{ text: String, block_type: String, cache_control: Option<CacheControl> }` — A text block in a system prompt.
- pub `to_text` function L42-51 — `(&self) -> String` — Get the text content of the system prompt.
- pub `CompletionRequest` struct L56-109 — `{ model: String, messages: Vec<Message>, max_tokens: u32, system: Option<SystemP...` — A completion request compatible with Anthropic Messages API.
- pub `is_recursive` function L114-116 — `(&self) -> bool` — True when the caller has opted this request into the recursive
- pub `new` function L119-136 — `(model: impl Into<String>, messages: Vec<Message>, max_tokens: u32) -> Self` — Create a new completion request with the given model and messages.
- pub `with_system` function L139-142 — `(mut self, system: impl Into<String>) -> Self` — Set the system prompt.
- pub `with_tools` function L145-148 — `(mut self, tools: Vec<ToolDefinition>) -> Self` — Add tools to the request.
- pub `with_streaming` function L151-154 — `(mut self) -> Self` — Enable streaming.
- pub `with_muninn` function L157-160 — `(mut self, config: MuninnConfig) -> Self` — Set Muninn configuration.
- pub `Message` struct L165-171 — `{ role: Role, content: Content }` — A message in the conversation.
- pub `user` function L175-180 — `(text: impl Into<String>) -> Self` — Create a user message with text content.
- pub `assistant` function L183-188 — `(text: impl Into<String>) -> Self` — Create an assistant message with text content.
- pub `assistant_blocks` function L191-196 — `(blocks: Vec<ContentBlock>) -> Self` — Create an assistant message with content blocks.
- pub `tool_results` function L199-204 — `(results: Vec<ToolResultBlock>) -> Self` — Create a user message with tool results.
- pub `Role` enum L210-213 — `User | Assistant` — The role of a message author.
- pub `Content` enum L218-223 — `Text | Blocks` — Message content - either a simple string or structured blocks.
- pub `as_text` function L227-232 — `(&self) -> Option<&str>` — Get the text content if this is simple text.
- pub `blocks` function L235-243 — `(&self) -> Vec<ContentBlock>` — Get the content blocks.
- pub `to_text` function L246-277 — `(&self) -> String` — Extract all text from the content.
- pub `CacheControl` enum L283-286 — `Ephemeral` — Cache control for prompt caching.
- pub `ContentBlock` enum L295-337 — `Text | ToolUse | ToolResult | Thinking` — A content block in a message.
- pub `ToolResultContent` enum L342-345 — `Text | Blocks` — Tool result content - can be a string or array of content blocks.
- pub `ToolUseBlock` struct L351-358 — `{ id: String, name: String, input: serde_json::Value }` — Convenience struct for creating tool use blocks.
- pub `ToolResultBlock` struct L375-384 — `{ tool_use_id: String, content: Option<ToolResultContent>, is_error: bool }` — Convenience struct for creating tool result blocks.
- pub `success` function L388-394 — `(tool_use_id: impl Into<String>, content: impl Into<String>) -> Self` — Create a successful tool result.
- pub `error` function L397-403 — `(tool_use_id: impl Into<String>, error: impl Into<String>) -> Self` — Create an error tool result.
- pub `text` function L419-424 — `(content: impl Into<String>) -> Self` — Create a text content block.
- pub `tool_use` function L427-438 — `( id: impl Into<String>, name: impl Into<String>, input: serde_json::Value, ) ->...` — Create a tool use content block.
- pub `tool_result_success` function L441-448 — `(tool_use_id: impl Into<String>, content: impl Into<String>) -> Self` — Create a successful tool result block.
- pub `tool_result_error` function L451-458 — `(tool_use_id: impl Into<String>, error: impl Into<String>) -> Self` — Create an error tool result block.
- pub `ToolDefinition` struct L463-472 — `{ name: String, description: String, input_schema: serde_json::Value }` — Definition of a tool available to the model.
- pub `new` function L476-486 — `( name: impl Into<String>, description: impl Into<String>, input_schema: serde_j...` — Create a new tool definition.
- pub `ToolChoice` enum L492-501 — `Auto | Any | Tool | None` — How the model should choose which tool to use.
- pub `CompletionResponse` struct L505-531 — `{ id: String, response_type: String, role: Role, content: Vec<ContentBlock>, mod...` — A completion response from the model.
- pub `new` function L539-556 — `( id: impl Into<String>, model: impl Into<String>, content: Vec<ContentBlock>, s...` — Create a new completion response.
- pub `tool_uses` function L559-576 — `(&self) -> Vec<ToolUseBlock>` — Get all tool use blocks from the response.
- pub `text` function L579-591 — `(&self) -> String` — Get the text content from the response.
- pub `has_tool_use` function L594-598 — `(&self) -> bool` — Check if the response contains tool use requests.
- pub `StopReason` enum L604-613 — `EndTurn | ToolUse | MaxTokens | StopSequence` — Why the model stopped generating.
- pub `Usage` struct L617-628 — `{ input_tokens: u32, output_tokens: u32, cache_creation_input_tokens: u32, cache...` — Token usage statistics.
- pub `new` function L632-639 — `(input_tokens: u32, output_tokens: u32) -> Self` — Create new usage statistics.
- pub `total` function L642-644 — `(&self) -> u32` — Total tokens used.
- pub `MuninnConfig` struct L649-661 — `{ recursive: bool, budget: BudgetConfig, include_metadata: bool }` — Muninn-specific configuration for recursive exploration.
- pub `recursive` function L679-685 — `() -> Self` — Create a new Muninn config with recursive exploration enabled.
- pub `with_budget` function L688-691 — `(mut self, budget: BudgetConfig) -> Self` — Set the budget configuration.
- pub `BudgetConfig` struct L696-712 — `{ max_tokens: Option<u64>, max_duration_secs: Option<u64>, max_depth: Option<u32...` — Budget configuration for recursive exploration.
- pub `ExplorationMetadata` struct L727-736 — `{ depth_reached: u32, tokens_used: u64, tool_calls: u32, duration_ms: u64 }` — Metadata about recursive exploration.
-  `SystemPrompt` type L40-52 — `= SystemPrompt` — fine (new optional fields), renames and removals are breaking.
-  `CompletionRequest` type L111-161 — `= CompletionRequest` — fine (new optional fields), renames and removals are breaking.
-  `Message` type L173-205 — `= Message` — fine (new optional fields), renames and removals are breaking.
-  `Content` type L225-278 — `= Content` — fine (new optional fields), renames and removals are breaking.
-  `ContentBlock` type L360-369 — `= ContentBlock` — fine (new optional fields), renames and removals are breaking.
-  `from` function L361-368 — `(block: ToolUseBlock) -> Self` — fine (new optional fields), renames and removals are breaking.
-  `ToolResultBlock` type L386-404 — `= ToolResultBlock` — fine (new optional fields), renames and removals are breaking.
-  `ContentBlock` type L406-415 — `= ContentBlock` — fine (new optional fields), renames and removals are breaking.
-  `from` function L407-414 — `(block: ToolResultBlock) -> Self` — fine (new optional fields), renames and removals are breaking.
-  `ContentBlock` type L417-459 — `= ContentBlock` — fine (new optional fields), renames and removals are breaking.
-  `ToolDefinition` type L474-487 — `= ToolDefinition` — fine (new optional fields), renames and removals are breaking.
-  `default_message_type` function L533-535 — `() -> String` — fine (new optional fields), renames and removals are breaking.
-  `CompletionResponse` type L537-599 — `= CompletionResponse` — fine (new optional fields), renames and removals are breaking.
-  `Usage` type L630-645 — `= Usage` — fine (new optional fields), renames and removals are breaking.
-  `default_true` function L663-665 — `() -> bool` — fine (new optional fields), renames and removals are breaking.
-  `MuninnConfig` type L667-675 — `impl Default for MuninnConfig` — fine (new optional fields), renames and removals are breaking.
-  `default` function L668-674 — `() -> Self` — fine (new optional fields), renames and removals are breaking.
-  `MuninnConfig` type L677-692 — `= MuninnConfig` — fine (new optional fields), renames and removals are breaking.
-  `BudgetConfig` type L714-723 — `impl Default for BudgetConfig` — fine (new optional fields), renames and removals are breaking.
-  `default` function L715-722 — `() -> Self` — fine (new optional fields), renames and removals are breaking.
-  `tests` module L739-857 — `-` — fine (new optional fields), renames and removals are breaking.
-  `test_message_user` function L743-747 — `()` — fine (new optional fields), renames and removals are breaking.
-  `test_message_assistant` function L750-754 — `()` — fine (new optional fields), renames and removals are breaking.
-  `test_completion_request_builder` function L757-770 — `()` — fine (new optional fields), renames and removals are breaking.
-  `test_completion_response_tool_uses` function L773-800 — `()` — fine (new optional fields), renames and removals are breaking.
-  `test_tool_result_block` function L803-813 — `()` — fine (new optional fields), renames and removals are breaking.
-  `test_serialize_deserialize_request` function L816-829 — `()` — fine (new optional fields), renames and removals are breaking.
-  `test_budget_config_default` function L832-838 — `()` — fine (new optional fields), renames and removals are breaking.
-  `test_content_blocks` function L841-856 — `()` — fine (new optional fields), renames and removals are breaking.

#### crates/muninn-core/src/mcp.rs

- pub `SchemaStability` enum L43-50 — `Stable | Experimental` — Stability classification for a tool schema.
- pub `McpToolSchema` struct L58-72 — `{ name: &'static str, description: &'static str, input_schema: Value, output_sch...` — Self-describing schema for one MCP tool.
- pub `tool_schemas` function L78-80 — `() -> Vec<McpToolSchema>` — Return every MCP tool schema muninn currently exposes.
-  `schema_value` function L82-84 — `() -> Value` — are **best-effort** — clients should not depend on specific values.
-  `search_code_schema` function L86-111 — `() -> McpToolSchema` — are **best-effort** — clients should not depend on specific values.
-  `query_graph_schema` function L113-136 — `() -> McpToolSchema` — are **best-effort** — clients should not depend on specific values.
-  `tests` module L139-199 — `-` — are **best-effort** — clients should not depend on specific values.
-  `tool_schemas_lists_all_expected_tools` function L143-146 — `()` — are **best-effort** — clients should not depend on specific values.
-  `tool_schemas_do_not_expose_explore` function L149-157 — `()` — are **best-effort** — clients should not depend on specific values.
-  `every_schema_has_non_empty_description_and_input_schema` function L160-174 — `()` — are **best-effort** — clients should not depend on specific values.
-  `every_example_is_a_json_object` function L177-189 — `()` — are **best-effort** — clients should not depend on specific values.
-  `schemas_serialize_to_json` function L192-198 — `()` — are **best-effort** — clients should not depend on specific values.

#### crates/muninn-core/src/types.rs

- pub `SearchQuery` struct L20-37 — `{ pattern: String, is_regex: bool, path_glob: Option<String>, language: Option<S...` — Text/regex search over the working tree.
- pub `SearchHit` struct L41-46 — `{ path: String, line: u32, snippet: String }` — A single hit returned by `search_code`.
- pub `SearchResult` struct L50-55 — `{ hits: Vec<SearchHit>, truncated: bool }` — Aggregated result of a `search_code` call.
- pub `ExploreRequest` struct L63-74 — `{ question: String, seed_paths: Vec<String>, max_depth: Option<u32> }` — Kicks off a recursive LLM-driven exploration.
- pub `ExploreResult` struct L78-87 — `{ answer: String, evidence: Vec<String>, truncated: bool }` — Final answer plus the trail of evidence the engine gathered.
- pub `GraphQueryKind` enum L96-105 — `Callers | Callees | Defines | References` — What kind of graph relationship to chase from the `target`.
- pub `GraphQuery` struct L109-116 — `{ target: String, kind: GraphQueryKind, max_hops: Option<u32> }` — A graph query.
- pub `GraphNode` struct L120-126 — `{ id: String, location: Option<String> }` — A node in the result graph.
- pub `GraphEdge` struct L130-135 — `{ from: String, to: String, kind: String }` — An edge between two [`GraphNode`]s.
- pub `GraphResult` struct L139-142 — `{ nodes: Vec<GraphNode>, edges: Vec<GraphEdge> }` — Aggregated graph-query result.
-  `tests` module L145-188 — `-` — out until an adapter actually needs it.
-  `search_query_roundtrips_minimal` function L149-162 — `()` — out until an adapter actually needs it.
-  `search_query_roundtrips_full` function L165-176 — `()` — out until an adapter actually needs it.
-  `graph_query_kind_serializes_snake_case` function L179-187 — `()` — out until an adapter actually needs it.

### crates/muninn-graph/src

> *Semantic summary to be generated by AI agent.*

#### crates/muninn-graph/src/builder.rs

- pub `BuildError` enum L18-29 — `Parse | Store | Extraction | Io | UnsupportedLanguage` — Error type for graph building operations.
- pub `Result` type L31 — `= std::result::Result<T, BuildError>` — to build a queryable code graph from source files.
- pub `BuildStats` struct L35-46 — `{ nodes_added: usize, edges_added: usize, parse_time_ms: u64, store_time_ms: u64...` — Statistics from a build operation.
- pub `merge` function L50-56 — `(&mut self, other: &BuildStats)` — Merge another BuildStats into this one.
- pub `GraphBuilder` struct L63-66 — `{ parser: Parser, store: GraphStore }` — Coordinates parsing and graph construction.
- pub `new` function L70-75 — `(store: GraphStore) -> Self` — Create a new GraphBuilder with the given store.
- pub `build_file` function L81-112 — `(&mut self, path: &Path) -> Result<BuildStats>` — Parse and add a single file to the graph.
- pub `rebuild_file` function L118-127 — `(&mut self, path: &Path) -> Result<BuildStats>` — Remove old data and rebuild a file.
- pub `build_directory` function L130-136 — `(&mut self, path: &Path) -> Result<BuildStats>` — Build all supported files in a directory recursively.
- pub `store` function L482-484 — `(&self) -> &GraphStore` — Get a reference to the underlying store.
- pub `store_mut` function L487-489 — `(&mut self) -> &mut GraphStore` — Get a mutable reference to the underlying store.
- pub `into_store` function L492-494 — `(self) -> GraphStore` — Consume the builder and return the store.
-  `BuildStats` type L48-57 — `= BuildStats` — to build a queryable code graph from source files.
-  `GraphBuilder` type L68-495 — `= GraphBuilder` — to build a queryable code graph from source files.
-  `build_directory_recursive` function L139-170 — `(&mut self, path: &Path, stats: &mut BuildStats) -> Result<()>` — Recursive helper for build_directory.
-  `is_supported_file` function L173-177 — `(&self, path: &Path) -> bool` — Check if a file has a supported extension.
-  `build_rust_file` function L180-346 — `( &self, tree: &tree_sitter::Tree, source: &str, file_path: &str, stats: &mut Bu...` — Build graph data for a Rust file.
-  `build_python_file` function L349-479 — `( &self, tree: &tree_sitter::Tree, source: &str, file_path: &str, stats: &mut Bu...` — Build graph data for a Python file.
-  `tests` module L498-634 — `-` — to build a queryable code graph from source files.
-  `create_test_rust_file` function L504-508 — `(dir: &Path, name: &str, content: &str) -> std::path::PathBuf` — to build a queryable code graph from source files.
-  `test_build_simple_rust_file` function L512-558 — `()` — to build a queryable code graph from source files.
-  `test_build_directory` function L562-582 — `()` — to build a queryable code graph from source files.
-  `test_builder_stats` function L585-609 — `()` — to build a queryable code graph from source files.
-  `test_skip_hidden_directories` function L613-633 — `()` — to build a queryable code graph from source files.

#### crates/muninn-graph/src/doc_store.rs

- pub `DocStoreError` enum L12-21 — `Database | Sqlite | LibraryNotFound | InvalidData` — Error type for doc store operations.
- pub `Result` type L23 — `= std::result::Result<T, DocStoreError>` — with support for full-text search (FTS5) and embeddings for semantic search.
- pub `Ecosystem` enum L27-32 — `Rust | Python | Web` — Ecosystem for a library.
- pub `as_str` function L35-41 — `(&self) -> &'static str` — with support for full-text search (FTS5) and embeddings for semantic search.
- pub `from_str` function L46-53 — `(s: &str) -> Option<Self>` — with support for full-text search (FTS5) and embeddings for semantic search.
- pub `ItemType` enum L58-72 — `Module | Class | Struct | Enum | Trait | Function | Method | Constant | Type | P...` — Type of documented item.
- pub `as_str` function L75-89 — `(&self) -> &'static str` — with support for full-text search (FTS5) and embeddings for semantic search.
- pub `from_str` function L94-109 — `(s: &str) -> Option<Self>` — with support for full-text search (FTS5) and embeddings for semantic search.
- pub `DocLibrary` struct L114-121 — `{ id: i64, library: String, ecosystem: Ecosystem, version: String, source_url: O...` — Metadata for an indexed library.
- pub `DocChunk` struct L125-133 — `{ id: i64, library_id: i64, item_path: String, item_type: ItemType, doc_text: St...` — A documentation chunk for a library item.
- pub `ScoredChunk` struct L137-140 — `{ chunk: DocChunk, score: f64 }` — A documentation chunk with a relevance score.
- pub `SearchMode` enum L144-152 — `Fts | Semantic | Hybrid` — Search mode for hybrid search.
- pub `DocChunkInput` struct L225-231 — `{ item_path: String, item_type: ItemType, doc_text: String, signature: Option<St...` — Input for inserting a new doc chunk.
- pub `DocStore` struct L237-239 — `{ graph: Graph }` — Documentation storage for external libraries.
- pub `open` function L245-250 — `(path: P) -> Result<Self>` — Open or create a doc store at the specified path.
- pub `open_in_memory` function L253-258 — `() -> Result<Self>` — Create an in-memory doc store (for testing).
- pub `upsert_library` function L358-390 — `( &self, library: &str, ecosystem: Ecosystem, version: &str, source_url: Option<...` — Insert or update a library's metadata.
- pub `get_library` function L393-430 — `(&self, library: &str) -> Result<Option<DocLibrary>>` — Get a library by name.
- pub `list_libraries` function L433-470 — `(&self) -> Result<Vec<DocLibrary>>` — List all indexed libraries.
- pub `delete_library` function L473-480 — `(&self, library: &str) -> Result<bool>` — Delete a library and all its chunks.
- pub `insert_chunk` function L483-510 — `(&self, library_id: i64, chunk: &DocChunkInput) -> Result<i64>` — Insert a documentation chunk.
- pub `insert_chunks_batch` function L513-548 — `(&self, library_id: i64, chunks: &[DocChunkInput]) -> Result<usize>` — Insert multiple documentation chunks in a batch.
- pub `search_fts` function L551-580 — `(&self, library: &str, query: &str, limit: usize) -> Result<Vec<DocChunk>>` — Search documentation using full-text search.
- pub `search_semantic` function L593-606 — `( &self, library: &str, query_embedding: &[f32], limit: usize, ) -> Result<Vec<D...` — Search documentation using semantic (embedding) search.
- pub `search_hybrid` function L619-666 — `( &self, library: &str, query: &str, query_embedding: Option<&[f32]>, limit: usi...` — Perform hybrid search combining FTS and semantic search with RRF fusion.
- pub `search` function L672-674 — `(&self, library: &str, query: &str, limit: usize) -> Result<Vec<ScoredChunk>>` — Search with default hybrid mode and no semantic embedding.
- pub `get_chunks` function L677-702 — `(&self, library: &str) -> Result<Vec<DocChunk>>` — Get all chunks for a library.
- pub `chunk_count` function L705-719 — `(&self, library: &str) -> Result<usize>` — Get chunk count for a library.
- pub `inner` function L754-756 — `(&self) -> &Graph` — Get the underlying graph for advanced operations.
-  `Ecosystem` type L34-54 — `= Ecosystem` — with support for full-text search (FTS5) and embeddings for semantic search.
-  `ItemType` type L74-110 — `= ItemType` — with support for full-text search (FTS5) and embeddings for semantic search.
-  `RRF_K` variable L155 — `: f64` — RRF (Reciprocal Rank Fusion) constant.
-  `chunks_to_scored` function L158-168 — `(chunks: Vec<DocChunk>) -> Vec<ScoredChunk>` — Convert a list of chunks to scored chunks with rank-based scores.
-  `rrf_fusion` function L180-221 — `( fts_results: &[DocChunk], semantic_results: &[DocChunk], limit: usize, ) -> Ve...` — Apply Reciprocal Rank Fusion (RRF) to combine two ranked lists.
-  `DocStore` type L241-757 — `= DocStore` — with support for full-text search (FTS5) and embeddings for semantic search.
-  `sqlite` function L261-263 — `(&self) -> &rusqlite::Connection` — Get the underlying rusqlite connection for parameterized queries.
-  `init_schema` function L266-353 — `(&self) -> Result<()>` — Initialize the doc store schema (creates tables if they don't exist).
-  `rows_to_chunks` function L722-751 — `( &self, rows: rusqlite::MappedRows< '_, impl FnMut( &rusqlite::Row<'_>, ) -> ru...` — Convert query result rows to DocChunk structs.
-  `tests` module L760-1086 — `-` — with support for full-text search (FTS5) and embeddings for semantic search.
-  `test_open_in_memory` function L766-770 — `()` — with support for full-text search (FTS5) and embeddings for semantic search.
-  `test_upsert_library` function L774-791 — `()` — with support for full-text search (FTS5) and embeddings for semantic search.
-  `test_insert_chunk` function L795-817 — `()` — with support for full-text search (FTS5) and embeddings for semantic search.
-  `test_insert_chunks_batch` function L821-850 — `()` — with support for full-text search (FTS5) and embeddings for semantic search.
-  `test_search_fts` function L854-883 — `()` — with support for full-text search (FTS5) and embeddings for semantic search.
-  `test_delete_library` function L887-909 — `()` — with support for full-text search (FTS5) and embeddings for semantic search.
-  `test_list_libraries` function L913-929 — `()` — with support for full-text search (FTS5) and embeddings for semantic search.
-  `test_search_hybrid_fts_mode` function L933-968 — `()` — with support for full-text search (FTS5) and embeddings for semantic search.
-  `test_search_hybrid_default_mode` function L972-996 — `()` — with support for full-text search (FTS5) and embeddings for semantic search.
-  `test_search_convenience_method` function L1000-1023 — `()` — with support for full-text search (FTS5) and embeddings for semantic search.
-  `test_rrf_fusion_algorithm` function L1027-1068 — `()` — with support for full-text search (FTS5) and embeddings for semantic search.
-  `test_search_semantic_stub` function L1072-1085 — `()` — with support for full-text search (FTS5) and embeddings for semantic search.

#### crates/muninn-graph/src/edges.rs

- pub `CallType` enum L16-29 — `Direct | Method | StaticMethod | Dynamic | FFI | API` — The type of function/method call.
- pub `as_str` function L33-42 — `(&self) -> &'static str` — Returns the string representation for queries and display.
- pub `is_cross_language` function L45-47 — `(&self) -> bool` — Returns true if this call type crosses a language boundary.
- pub `is_dynamic` function L50-52 — `(&self) -> bool` — Returns true if the call target may not be statically resolvable.
- pub `EdgeKind` enum L61-105 — `Contains | Imports | Calls | Inherits | Implements | UsesType | Instantiates | R...` — The kind of relationship between two symbols.
- pub `as_str` function L109-122 — `(&self) -> &'static str` — Returns the string representation for queries.
- pub `is_structural` function L125-127 — `(&self) -> bool` — Returns true if this edge represents a structural containment.
- pub `is_dependency` function L130-139 — `(&self) -> bool` — Returns true if this edge represents a dependency.
- pub `is_type_relationship` function L142-147 — `(&self) -> bool` — Returns true if this edge represents a type relationship.
- pub `Edge` struct L155-164 — `{ source_id: String, target_id: String, kind: EdgeKind }` — An edge connecting two symbols in the code graph.
- pub `new` function L168-174 — `(source_id: impl Into<String>, target_id: impl Into<String>, kind: EdgeKind) -> ...` — Create a new edge.
- pub `contains` function L177-179 — `(parent_id: impl Into<String>, child_id: impl Into<String>) -> Self` — Create a CONTAINS edge (parent contains child).
- pub `imports` function L182-196 — `( source_id: impl Into<String>, target_id: impl Into<String>, path: impl Into<St...` — Create an IMPORTS edge.
- pub `calls` function L199-206 — `( caller_id: impl Into<String>, callee_id: impl Into<String>, call_type: CallTyp...` — Create a CALLS edge.
- pub `inherits` function L209-211 — `(child_id: impl Into<String>, parent_id: impl Into<String>) -> Self` — Create an INHERITS edge.
- pub `implements` function L214-216 — `(implementor_id: impl Into<String>, interface_id: impl Into<String>) -> Self` — Create an IMPLEMENTS edge.
- pub `generated_by` function L219-231 — `( generated_id: impl Into<String>, generator_id: impl Into<String>, generator_na...` — Create a GENERATED_BY edge.
-  `CallType` type L31-53 — `= CallType` — special cases (macros, generated code).
-  `EdgeKind` type L107-148 — `= EdgeKind` — special cases (macros, generated code).
-  `Edge` type L166-232 — `= Edge` — special cases (macros, generated code).
-  `tests` module L235-368 — `-` — special cases (macros, generated code).
-  `test_call_type_as_str` function L239-243 — `()` — special cases (macros, generated code).
-  `test_call_type_classification` function L246-253 — `()` — special cases (macros, generated code).
-  `test_edge_kind_as_str` function L256-274 — `()` — special cases (macros, generated code).
-  `test_edge_kind_classification` function L277-300 — `()` — special cases (macros, generated code).
-  `test_edge_creation` function L303-308 — `()` — special cases (macros, generated code).
-  `test_edge_factory_methods` function L311-338 — `()` — special cases (macros, generated code).
-  `test_edge_serialization` function L341-348 — `()` — special cases (macros, generated code).
-  `test_call_type_serialization` function L351-355 — `()` — special cases (macros, generated code).
-  `test_edge_kind_serialization` function L358-367 — `()` — special cases (macros, generated code).

#### crates/muninn-graph/src/embeddings.rs

- pub `EmbeddingStore` struct L4-6 — `-` — Embedding store for semantic search
- pub `open` function L10-12 — `(_path: &std::path::Path) -> anyhow::Result<Self>` — Open or create an embedding store at the given path
- pub `store` function L15-17 — `(&self, _symbol_id: &str, _embedding: &[f32]) -> anyhow::Result<()>` — Store an embedding for a symbol
- pub `search` function L20-22 — `(&self, _query_embedding: &[f32], _limit: usize) -> anyhow::Result<Vec<String>>` — Find similar symbols by embedding
-  `EmbeddingStore` type L8-23 — `= EmbeddingStore` — Vector embeddings storage via sqlite-vec

#### crates/muninn-graph/src/graph.rs

- pub `CodeGraph` struct L4-6 — `-` — Code graph storing symbols and relationships
- pub `open` function L10-12 — `(_path: &std::path::Path) -> anyhow::Result<Self>` — Open or create a code graph at the given path
-  `CodeGraph` type L8-13 — `= CodeGraph` — Graph storage via graphqlite

#### crates/muninn-graph/src/lib.rs

- pub `builder` module L10 — `-` — This crate provides the core code graph functionality for Muninn:
- pub `doc_store` module L11 — `-` — - Registry clients for fetching package metadata and source
- pub `edges` module L12 — `-` — - Registry clients for fetching package metadata and source
- pub `lang` module L13 — `-` — - Registry clients for fetching package metadata and source
- pub `parser` module L14 — `-` — - Registry clients for fetching package metadata and source
- pub `registry` module L15 — `-` — - Registry clients for fetching package metadata and source
- pub `store` module L16 — `-` — - Registry clients for fetching package metadata and source
- pub `symbols` module L17 — `-` — - Registry clients for fetching package metadata and source
- pub `watcher` module L18 — `-` — - Registry clients for fetching package metadata and source

#### crates/muninn-graph/src/parser.rs

- pub `ParseError` enum L15-30 — `UnsupportedExtension | IoError | ParseFailed | LanguageError | QueryError` — Errors that can occur during parsing.
- pub `Language` enum L34-39 — `Rust | Python | C | Cpp` — Supported programming languages.
- pub `from_extension` function L43-51 — `(ext: &str) -> Option<Self>` — Detect language from file extension.
- pub `from_path` function L54-58 — `(path: &Path) -> Option<Self>` — Detect language from file path.
- pub `tree_sitter_language` function L61-68 — `(&self) -> tree_sitter::Language` — Get the tree-sitter language for this language.
- pub `extensions` function L71-78 — `(&self) -> &'static [&'static str]` — Get file extensions associated with this language.
- pub `name` function L81-88 — `(&self) -> &'static str` — Get the display name for this language.
- pub `LanguageConfig` struct L92-97 — `{ language: tree_sitter::Language, symbols_query: tree_sitter::Query }` — Configuration for a language including tree-sitter queries.
- pub `new` function L101-112 — `(lang: Language) -> Result<Self, ParseError>` — Create a new language configuration.
- pub `LazyLanguageConfig` struct L129-132 — `{ language: Language, config: OnceLock<Result<LanguageConfig, String>> }` — Lazily initialized language configuration.
- pub `new` function L136-141 — `(language: Language) -> Self` — Create a new lazy config for the given language.
- pub `get` function L144-149 — `(&self) -> Result<&LanguageConfig, ParseError>` — Get the configuration, initializing if needed.
- pub `ParsedFile` struct L153-162 — `{ language: Language, tree: tree_sitter::Tree, source: String, path: Option<Stri...` — A parsed source file with its AST.
- pub `root_node` function L166-168 — `(&self) -> tree_sitter::Node<'_>` — Get the root node of the syntax tree.
- pub `source_bytes` function L171-173 — `(&self) -> &[u8]` — Get the source code as bytes.
- pub `node_text` function L176-178 — `(&self, node: tree_sitter::Node) -> &str` — Get text for a node.
- pub `Parser` struct L185-190 — `{ ts_parser: tree_sitter::Parser, configs: HashMap<Language, LazyLanguageConfig>...` — Multi-language source code parser.
- pub `new` function L194-205 — `() -> Self` — Create a new parser with all supported languages.
- pub `parse_file` function L208-222 — `(&mut self, path: &Path) -> Result<ParsedFile, ParseError>` — Parse a file from the filesystem.
- pub `parse_source` function L225-254 — `( &mut self, source: &str, language: Language, ) -> Result<ParsedFile, ParseErro...` — Parse source code string with a specified language.
- pub `get_config` function L257-262 — `(&self, language: Language) -> Result<&LanguageConfig, ParseError>` — Get the language configuration for a language.
- pub `supports_extension` function L265-267 — `(ext: &str) -> bool` — Check if a file extension is supported.
- pub `supported_extensions` function L270-276 — `() -> Vec<&'static str>` — Get all supported extensions.
-  `Language` type L41-89 — `= Language` — grammars and uses lazy initialization for efficient resource usage.
-  `LanguageConfig` type L99-123 — `= LanguageConfig` — grammars and uses lazy initialization for efficient resource usage.
-  `get_symbols_query` function L115-122 — `(lang: Language) -> &'static str` — Get the symbols query source for a language.
-  `LazyLanguageConfig` type L134-150 — `= LazyLanguageConfig` — grammars and uses lazy initialization for efficient resource usage.
-  `ParsedFile` type L164-179 — `= ParsedFile` — grammars and uses lazy initialization for efficient resource usage.
-  `Parser` type L192-277 — `= Parser` — grammars and uses lazy initialization for efficient resource usage.
-  `Parser` type L279-283 — `impl Default for Parser` — grammars and uses lazy initialization for efficient resource usage.
-  `default` function L280-282 — `() -> Self` — grammars and uses lazy initialization for efficient resource usage.
-  `tests` module L286-384 — `-` — grammars and uses lazy initialization for efficient resource usage.
-  `test_language_from_extension` function L290-297 — `()` — grammars and uses lazy initialization for efficient resource usage.
-  `test_language_from_path` function L300-310 — `()` — grammars and uses lazy initialization for efficient resource usage.
-  `test_parser_parse_rust_source` function L313-324 — `()` — grammars and uses lazy initialization for efficient resource usage.
-  `test_parser_parse_python_source` function L327-341 — `()` — grammars and uses lazy initialization for efficient resource usage.
-  `test_parser_parse_c_source` function L344-357 — `()` — grammars and uses lazy initialization for efficient resource usage.
-  `test_parsed_file_node_text` function L360-367 — `()` — grammars and uses lazy initialization for efficient resource usage.
-  `test_supported_extensions` function L370-376 — `()` — grammars and uses lazy initialization for efficient resource usage.
-  `test_supports_extension` function L379-383 — `()` — grammars and uses lazy initialization for efficient resource usage.

#### crates/muninn-graph/src/store.rs

- pub `NodeIdMap` type L11 — `= HashMap<String, i64>` — Type alias for the node ID map returned by bulk insert.
- pub `StoreError` enum L18-23 — `Database | InvalidData` — Error type for graph store operations.
- pub `Result` type L25 — `= std::result::Result<T, StoreError>` — Provides persistent storage for the code graph using SQLite with Cypher query support.
- pub `GraphStore` struct L31-33 — `{ graph: Graph }` — Persistent storage for the code graph.
- pub `open` function L40-43 — `(path: P) -> Result<Self>` — Open or create a graph database at the specified path.
- pub `open_in_memory` function L46-49 — `() -> Result<Self>` — Create an in-memory graph database.
- pub `insert_node` function L54-62 — `(&self, symbol: &Symbol) -> Result<String>` — Insert or update a symbol as a node in the graph.
- pub `insert_nodes_batch` function L68-97 — `(&self, symbols: &[Symbol]) -> Result<NodeIdMap>` — Insert multiple symbols as nodes in a batch operation.
- pub `insert_edge` function L100-108 — `(&self, edge: &Edge) -> Result<()>` — Insert an edge between two nodes.
- pub `insert_edges_batch` function L114-147 — `(&self, edges: &[Edge], id_map: &NodeIdMap) -> Result<usize>` — Insert multiple edges in a batch operation.
- pub `insert_edges_batch_slow` function L153-167 — `(&self, edges: &[Edge]) -> Result<()>` — Insert multiple edges without an ID map (uses transaction for performance).
- pub `delete_file` function L173-205 — `(&self, file_path: &str) -> Result<usize>` — Delete all nodes and edges associated with a file.
- pub `delete_node` function L208-211 — `(&self, node_id: &str) -> Result<()>` — Delete a specific node by ID.
- pub `delete_edge` function L214-217 — `(&self, source_id: &str, target_id: &str) -> Result<()>` — Delete an edge between two nodes.
- pub `has_node` function L220-222 — `(&self, node_id: &str) -> Result<bool>` — Check if a node exists.
- pub `get_node` function L225-227 — `(&self, node_id: &str) -> Result<Option<Value>>` — Get a node by ID.
- pub `query` function L230-232 — `(&self, cypher: &str) -> Result<CypherResult>` — Execute a Cypher query.
- pub `find_callers` function L235-246 — `(&self, callee_id: &str) -> Result<Vec<Value>>` — Find all callers of a function/method.
- pub `find_callees` function L249-260 — `(&self, caller_id: &str) -> Result<Vec<Value>>` — Find all functions/methods called by a caller.
- pub `find_implementations` function L263-274 — `(&self, trait_id: &str) -> Result<Vec<Value>>` — Find implementations of a trait/interface.
- pub `find_symbols_in_file` function L277-288 — `(&self, file_path: &str) -> Result<Vec<Value>>` — Find all symbols in a file.
- pub `find_by_name` function L291-302 — `(&self, name: &str) -> Result<Vec<Value>>` — Find symbols by name (exact match).
- pub `stats` function L305-311 — `(&self) -> Result<GraphStats>` — Get graph statistics.
- pub `inner` function L314-316 — `(&self) -> &Graph` — Get the underlying graphqlite Graph for advanced operations.
- pub `GraphStats` struct L321-324 — `{ node_count: i64, edge_count: i64 }` — Graph statistics.
-  `GraphStore` type L35-317 — `= GraphStore` — Provides persistent storage for the code graph using SQLite with Cypher query support.
-  `symbol_kind_to_label` function L327-341 — `(kind: SymbolKind) -> &'static str` — Convert a SymbolKind to a node label.
-  `symbol_to_properties` function L344-367 — `(symbol: &Symbol) -> Vec<(&'static str, String)>` — Convert a Symbol to property key-value pairs (as strings for graphqlite).
-  `visibility_to_string` function L370-377 — `(vis: &Visibility) -> String` — Convert Visibility to a string representation.
-  `edge_kind_to_rel_type` function L380-393 — `(kind: &EdgeKind) -> &'static str` — Convert an EdgeKind to a relationship type.
-  `edge_to_properties` function L396-416 — `(kind: &EdgeKind) -> Vec<(&'static str, String)>` — Convert an EdgeKind to property key-value pairs (as strings).
-  `tests` module L419-669 — `-` — Provides persistent storage for the code graph using SQLite with Cypher query support.
-  `create_test_symbol` function L424-436 — `(name: &str, kind: SymbolKind) -> Symbol` — Provides persistent storage for the code graph using SQLite with Cypher query support.
-  `test_store_open_in_memory` function L440-445 — `()` — Provides persistent storage for the code graph using SQLite with Cypher query support.
-  `test_insert_node` function L449-460 — `()` — Provides persistent storage for the code graph using SQLite with Cypher query support.
-  `test_insert_edge` function L464-479 — `()` — Provides persistent storage for the code graph using SQLite with Cypher query support.
-  `test_delete_node` function L483-492 — `()` — Provides persistent storage for the code graph using SQLite with Cypher query support.
-  `test_delete_file` function L496-523 — `()` — Provides persistent storage for the code graph using SQLite with Cypher query support.
-  `test_find_callers` function L527-548 — `()` — Provides persistent storage for the code graph using SQLite with Cypher query support.
-  `test_find_callees` function L552-573 — `()` — Provides persistent storage for the code graph using SQLite with Cypher query support.
-  `test_find_implementations` function L577-599 — `()` — Provides persistent storage for the code graph using SQLite with Cypher query support.
-  `test_find_symbols_in_file` function L603-630 — `()` — Provides persistent storage for the code graph using SQLite with Cypher query support.
-  `test_batch_insert` function L634-648 — `()` — Provides persistent storage for the code graph using SQLite with Cypher query support.
-  `test_cypher_query` function L652-668 — `()` — Provides persistent storage for the code graph using SQLite with Cypher query support.

#### crates/muninn-graph/src/symbols.rs

- pub `SymbolKind` enum L15-38 — `File | Module | Class | Struct | Interface | Enum | Function | Method | Variable...` — The kind of symbol extracted from source code.
- pub `as_str` function L42-56 — `(&self) -> &'static str` — Returns the string representation used in node IDs and queries.
- pub `is_type_definition` function L59-68 — `(&self) -> bool` — Returns true if this symbol kind represents a type definition.
- pub `is_callable` function L71-76 — `(&self) -> bool` — Returns true if this symbol kind represents a callable.
- pub `Visibility` enum L86-96 — `Public | Private | Crate | Restricted` — Visibility/accessibility of a symbol.
- pub `Symbol` struct L103-130 — `{ name: String, kind: SymbolKind, file_path: String, start_line: usize, end_line...` — A symbol extracted from source code.
- pub `new` function L134-152 — `( name: impl Into<String>, kind: SymbolKind, file_path: impl Into<String>, start...` — Create a new symbol with required fields.
- pub `with_signature` function L155-158 — `(mut self, signature: impl Into<String>) -> Self` — Set the signature.
- pub `with_qualified_name` function L161-164 — `(mut self, qualified_name: impl Into<String>) -> Self` — Set the qualified name.
- pub `with_doc_comment` function L167-170 — `(mut self, doc_comment: impl Into<String>) -> Self` — Set the doc comment.
- pub `with_visibility` function L173-176 — `(mut self, visibility: Visibility) -> Self` — Set the visibility.
- pub `id` function L183-193 — `(&self) -> String` — Generate a stable ID for this symbol.
- pub `line_count` function L196-198 — `(&self) -> usize` — Returns the number of lines this symbol spans.
- pub `location` function L201-203 — `(&self) -> String` — Returns a location string for display (file:line-line).
-  `SymbolKind` type L40-77 — `= SymbolKind` — code graph and are used by parsers, graph storage, and query interfaces.
-  `Symbol` type L132-204 — `= Symbol` — code graph and are used by parsers, graph storage, and query interfaces.
-  `tests` module L207-297 — `-` — code graph and are used by parsers, graph storage, and query interfaces.
-  `test_symbol_kind_as_str` function L211-215 — `()` — code graph and are used by parsers, graph storage, and query interfaces.
-  `test_symbol_kind_classification` function L218-226 — `()` — code graph and are used by parsers, graph storage, and query interfaces.
-  `test_symbol_creation` function L229-246 — `()` — code graph and are used by parsers, graph storage, and query interfaces.
-  `test_symbol_id_generation` function L249-253 — `()` — code graph and are used by parsers, graph storage, and query interfaces.
-  `test_symbol_location` function L256-259 — `()` — code graph and are used by parsers, graph storage, and query interfaces.
-  `test_visibility_default` function L262-264 — `()` — code graph and are used by parsers, graph storage, and query interfaces.
-  `test_symbol_serialization` function L267-277 — `()` — code graph and are used by parsers, graph storage, and query interfaces.
-  `test_symbol_kind_serialization` function L280-287 — `()` — code graph and are used by parsers, graph storage, and query interfaces.
-  `test_visibility_serialization` function L290-296 — `()` — code graph and are used by parsers, graph storage, and query interfaces.

#### crates/muninn-graph/src/watcher.rs

- pub `WatchError` enum L16-23 — `Notify | Io | Gitignore` — Error type for file watcher operations.
- pub `Result` type L25 — `= std::result::Result<T, WatchError>` — gitignore support, and integration with the graph builder.
- pub `FileEvent` enum L29-36 — `Created | Modified | Deleted` — Events emitted by the file watcher.
- pub `path` function L40-44 — `(&self) -> &Path` — Get the path associated with this event.
- pub `WatcherConfig` struct L49-58 — `{ debounce_duration: Duration, extensions: Vec<String>, use_gitignore: bool, ign...` — Configuration for the file watcher.
- pub `FileWatcher` struct L85-91 — `{ _debouncer: Debouncer<RecommendedWatcher>, rx: Receiver<std::result::Result<Ve...` — File system watcher with debouncing and filtering.
- pub `new` function L95-97 — `(root: &Path) -> Result<Self>` — Create a new file watcher for the given root directory.
- pub `with_config` function L100-122 — `(root: &Path, config: WatcherConfig) -> Result<Self>` — Create a new file watcher with custom configuration.
- pub `next_event` function L173-206 — `(&self) -> Option<FileEvent>` — Get the next file event, blocking until one is available.
- pub `try_next_event` function L211-234 — `(&self) -> Option<FileEvent>` — Try to get the next file event without blocking.
- pub `root` function L237-239 — `(&self) -> &Path` — Get the root directory being watched.
- pub `watch_and_rebuild` function L246-256 — `(watcher: &FileWatcher, mut on_event: F) -> Result<()>` — Watch a directory and rebuild the graph on changes.
-  `FileEvent` type L38-45 — `= FileEvent` — gitignore support, and integration with the graph builder.
-  `WatcherConfig` type L60-82 — `impl Default for WatcherConfig` — gitignore support, and integration with the graph builder.
-  `default` function L61-81 — `() -> Self` — gitignore support, and integration with the graph builder.
-  `FileWatcher` type L93-240 — `= FileWatcher` — gitignore support, and integration with the graph builder.
-  `build_gitignore` function L125-146 — `(root: &Path, extra_patterns: &[String]) -> Result<Gitignore>` — Build a gitignore matcher from .gitignore and custom patterns.
-  `should_ignore` function L149-168 — `(&self, path: &Path) -> bool` — Check if a path should be ignored.
-  `tests` module L259-382 — `-` — gitignore support, and integration with the graph builder.
-  `test_watcher_config_default` function L266-271 — `()` — gitignore support, and integration with the graph builder.
-  `test_file_event_path` function L274-285 — `()` — gitignore support, and integration with the graph builder.
-  `test_watcher_creation` function L288-295 — `()` — gitignore support, and integration with the graph builder.
-  `test_watcher_detects_file_changes` function L298-331 — `()` — gitignore support, and integration with the graph builder.
-  `test_watcher_ignores_non_source_files` function L334-355 — `()` — gitignore support, and integration with the graph builder.
-  `test_should_ignore` function L358-381 — `()` — gitignore support, and integration with the graph builder.

### crates/muninn-graph/src/lang

> *Semantic summary to be generated by AI agent.*

#### crates/muninn-graph/src/lang/mod.rs

- pub `python` module L6 — `-` — Each language module provides extraction logic for symbols, imports,
- pub `rust` module L7 — `-` — and call relationships from parsed syntax trees.

#### crates/muninn-graph/src/lang/python.rs

- pub `Import` struct L14-23 — `{ module: String, name: Option<String>, alias: Option<String>, line: usize }` — Import statement from Python source.
- pub `Call` struct L27-34 — `{ callee: String, line: usize, is_method: bool }` — Function/method call.
- pub `FFIMarker` enum L38-46 — `Ctypes | Cffi` — FFI marker detected in Python code.
- pub `PythonExtractor` struct L180 — `-` — Python-specific symbol extractor.
- pub `extract_symbols` function L184-297 — `( tree: &Tree, source: &str, file_path: &str, ) -> Result<Vec<Symbol>, String>` — Extract symbols from a Python source file.
- pub `extract_imports` function L300-347 — `(tree: &Tree, source: &str) -> Result<Vec<Import>, String>` — Extract import statements.
- pub `extract_calls` function L350-392 — `(tree: &Tree, source: &str) -> Result<Vec<Call>, String>` — Extract function/method calls.
- pub `extract_ffi_markers` function L395-464 — `(tree: &Tree, source: &str) -> Result<Vec<FFIMarker>, String>` — Extract FFI markers (ctypes, cffi usage).
-  `PythonQueries` struct L49-54 — `{ symbols: Query, imports: Query, calls: Query, ffi: Query }` — Compiled tree-sitter queries for Python.
-  `PYTHON_QUERIES` variable L56 — `: OnceLock<PythonQueries>` — Extracts classes, functions, imports, and FFI patterns from Python source code.
-  `get_queries` function L58-177 — `() -> &'static PythonQueries` — Extracts classes, functions, imports, and FFI patterns from Python source code.
-  `PythonExtractor` type L182-517 — `= PythonExtractor` — Extracts classes, functions, imports, and FFI patterns from Python source code.
-  `node_text` function L467-469 — `(node: &tree_sitter::Node, source: &str) -> String` — Get text content of a node.
-  `extract_docstring` function L472-503 — `(block: &tree_sitter::Node, source: &str) -> Option<String>` — Extract docstring from a block (first string literal).
-  `visibility_from_name` function L506-516 — `(name: &str) -> Visibility` — Determine visibility from Python naming convention.
-  `tests` module L520-710 — `-` — Extracts classes, functions, imports, and FFI patterns from Python source code.
-  `parse_python` function L524-530 — `(source: &str) -> Tree` — Extracts classes, functions, imports, and FFI patterns from Python source code.
-  `test_extract_class` function L533-557 — `()` — Extracts classes, functions, imports, and FFI patterns from Python source code.
-  `test_extract_function` function L560-593 — `()` — Extracts classes, functions, imports, and FFI patterns from Python source code.
-  `test_extract_methods` function L596-614 — `()` — Extracts classes, functions, imports, and FFI patterns from Python source code.
-  `test_extract_imports` function L617-642 — `()` — Extracts classes, functions, imports, and FFI patterns from Python source code.
-  `test_extract_calls` function L645-669 — `()` — Extracts classes, functions, imports, and FFI patterns from Python source code.
-  `test_visibility_convention` function L672-689 — `()` — Extracts classes, functions, imports, and FFI patterns from Python source code.
-  `test_extract_ffi_markers` function L692-709 — `()` — Extracts classes, functions, imports, and FFI patterns from Python source code.

#### crates/muninn-graph/src/lang/rust.rs

- pub `Import` struct L14-21 — `{ path: String, alias: Option<String>, line: usize }` — Represents a use/import statement.
- pub `Call` struct L25-32 — `{ callee: String, line: usize, is_method: bool }` — Represents a function call site.
- pub `FFIMarker` struct L36-44 — `{ abi: Option<String>, line: usize, start_line: usize, end_line: usize }` — Represents an FFI boundary marker.
- pub `TraitImpl` struct L48-55 — `{ type_name: String, trait_name: String, line: usize }` — Represents a trait implementation.
- pub `RustExtractor` struct L215 — `-` — Rust language extractor.
- pub `extract_symbols` function L219-331 — `( tree: &tree_sitter::Tree, source: &str, file_path: &str, ) -> Result<Vec<Symbo...` — Extract symbols from a parsed Rust syntax tree.
- pub `extract_imports` function L334-370 — `(tree: &tree_sitter::Tree, source: &str) -> Result<Vec<Import>, String>` — Extract import statements from a parsed Rust syntax tree.
- pub `extract_calls` function L373-418 — `(tree: &tree_sitter::Tree, source: &str) -> Result<Vec<Call>, String>` — Extract function calls from a parsed Rust syntax tree.
- pub `extract_implementations` function L421-466 — `( tree: &tree_sitter::Tree, source: &str, ) -> Result<Vec<TraitImpl>, String>` — Extract trait implementations from a parsed Rust syntax tree.
- pub `extract_ffi_markers` function L469-514 — `( tree: &tree_sitter::Tree, source: &str, ) -> Result<Vec<FFIMarker>, String>` — Extract FFI markers (extern blocks) from a parsed Rust syntax tree.
-  `RustQueries` struct L58-64 — `{ symbols: tree_sitter::Query, imports: tree_sitter::Query, calls: tree_sitter::...` — Compiled queries for Rust symbol extraction.
-  `RustQueries` type L66-86 — `= RustQueries` — from Rust source code.
-  `new` function L67-85 — `(language: tree_sitter::Language) -> Result<Self, String>` — from Rust source code.
-  `RUST_QUERIES` variable L88 — `: OnceLock<Result<RustQueries, String>>` — from Rust source code.
-  `get_queries` function L90-98 — `() -> Result<&'static RustQueries, &'static str>` — from Rust source code.
-  `SYMBOLS_QUERY` variable L101-152 — `: &str` — Tree-sitter query for extracting Rust symbols.
-  `IMPORTS_QUERY` variable L155-175 — `: &str` — Tree-sitter query for extracting use statements.
-  `CALLS_QUERY` variable L178-192 — `: &str` — Tree-sitter query for extracting function calls.
-  `EXTERNS_QUERY` variable L195-204 — `: &str` — Tree-sitter query for extracting extern blocks.
-  `IMPLS_QUERY` variable L207-212 — `: &str` — Tree-sitter query for extracting trait implementations.
-  `RustExtractor` type L217-515 — `= RustExtractor` — from Rust source code.
-  `parse_visibility` function L518-543 — `(vis_text: &str) -> Visibility` — Parse a Rust visibility modifier into our Visibility enum.
-  `extract_doc_comment` function L546-617 — `( tree: &tree_sitter::Tree, symbol_line: usize, source: &str, ) -> Option<String...` — Extract doc comments preceding a symbol by looking at source lines.
-  `tests` module L620-843 — `-` — from Rust source code.
-  `parse_rust` function L623-629 — `(source: &str) -> tree_sitter::Tree` — from Rust source code.
-  `test_extract_struct` function L632-654 — `()` — from Rust source code.
-  `test_extract_function` function L657-671 — `()` — from Rust source code.
-  `test_extract_enum` function L674-688 — `()` — from Rust source code.
-  `test_extract_trait` function L691-707 — `()` — from Rust source code.
-  `test_extract_impl` function L710-734 — `()` — from Rust source code.
-  `test_extract_module` function L737-752 — `()` — from Rust source code.
-  `test_extract_imports` function L755-766 — `()` — from Rust source code.
-  `test_extract_calls` function L769-784 — `()` — from Rust source code.
-  `test_extract_ffi_markers` function L787-800 — `()` — from Rust source code.
-  `test_visibility_parsing` function L803-814 — `()` — from Rust source code.
-  `test_extract_constant` function L817-827 — `()` — from Rust source code.
-  `test_extract_macro` function L830-842 — `()` — from Rust source code.

### crates/muninn-graph/src/registry

> *Semantic summary to be generated by AI agent.*

#### crates/muninn-graph/src/registry/crates_io.rs

- pub `CratesIoError` enum L36-57 — `Http | Io | Json | CrateNotFound | VersionNotFound | NoVersions | ApiError` — Error type for crates.io API operations.
- pub `Result` type L59 — `= std::result::Result<T, CratesIoError>` — ```
- pub `CratesIoClient` struct L71-73 — `{ client: Client }` — crates.io API client.
- pub `new` function L77-79 — `() -> Self` — Create a new crates.io client with default settings.
- pub `with_user_agent` function L84-91 — `(user_agent: &str) -> Self` — Create a new client with a custom user agent.
- pub `get_crate` function L94-112 — `(&self, crate_name: &str) -> Result<CrateResponse>` — Get metadata for a crate including all versions.
- pub `get_latest_version` function L115-124 — `(&self, crate_name: &str) -> Result<CrateVersion>` — Get the latest (non-yanked) version of a crate.
- pub `get_version` function L127-138 — `(&self, crate_name: &str, version: &str) -> Result<CrateVersion>` — Get a specific version of a crate.
- pub `download_source` function L151-198 — `( &self, crate_name: &str, version: &str, output_dir: impl AsRef<Path>, ) -> Res...` — Download and extract the source tarball for a crate version.
- pub `download_latest` function L236-244 — `( &self, crate_name: &str, output_dir: impl AsRef<Path>, ) -> Result<(PathBuf, C...` — Download and extract source, returning both the path and version info.
- pub `CrateResponse` struct L255-262 — `{ krate: CrateInfo, versions: Vec<CrateVersion> }` — Response from crates.io crate endpoint.
- pub `CrateInfo` struct L266-290 — `{ name: String, description: Option<String>, homepage: Option<String>, documenta...` — Basic crate information.
- pub `CrateVersion` struct L294-321 — `{ num: String, yanked: bool, downloads: i64, crate_size: Option<i64>, checksum: ...` — Version-specific information.
- pub `VersionLinks` struct L325-328 — `{ dependencies: String }` — Links associated with a version.
-  `CRATES_IO_API` variable L62 — `: &str` — Base URL for crates.io API.
-  `CRATES_IO_DOWNLOAD` variable L65 — `: &str` — Base URL for downloading crates.
-  `CratesIoClient` type L75-245 — `= CratesIoClient` — ```
-  `extract_tarball` function L201-231 — `(&self, tarball_path: &Path, output_dir: &Path) -> Result<PathBuf>` — Extract a .crate tarball (gzipped tar).
-  `CratesIoClient` type L247-251 — `impl Default for CratesIoClient` — ```
-  `default` function L248-250 — `() -> Self` — ```
-  `tests` module L331-438 — `-` — ```
-  `skip_network_tests` function L336-338 — `() -> bool` — ```
-  `test_client_creation` function L341-345 — `()` — ```
-  `test_client_custom_user_agent` function L348-351 — `()` — ```
-  `test_get_crate` function L355-367 — `()` — ```
-  `test_get_latest_version` function L371-383 — `()` — ```
-  `test_get_nonexistent_crate` function L387-396 — `()` — ```
-  `test_download_source` function L400-418 — `()` — ```
-  `test_download_latest` function L422-437 — `()` — ```

#### crates/muninn-graph/src/registry/indexer.rs

- pub `IndexerError` enum L37-52 — `CratesIo | Rustdoc | DocStore | Io | IndexingFailed` — Error type for indexer operations.
- pub `Result` type L54 — `= std::result::Result<T, IndexerError>` — ```
- pub `IndexStats` struct L58-69 — `{ crate_name: String, version: String, items_extracted: usize, items_indexed: us...` — Statistics from an indexing operation.
- pub `IndexerConfig` struct L73-80 — `{ keep_source: bool, work_dir: Option<PathBuf>, rustdoc_flags: Vec<String> }` — Configuration for the indexer.
- pub `RustDocIndexer` struct L86-89 — `{ crates_client: CratesIoClient, config: IndexerConfig }` — Rust documentation indexer.
- pub `new` function L93-98 — `() -> Self` — Create a new indexer with default configuration.
- pub `with_config` function L101-106 — `(config: IndexerConfig) -> Self` — Create an indexer with custom configuration.
- pub `index_crate` function L122-186 — `( &self, store: &DocStore, crate_name: &str, version: Option<&str>, ) -> Result<...` — Index a crate by name.
- pub `index_local` function L198-231 — `( &self, store: &DocStore, crate_path: impl AsRef<Path>, crate_name: &str, versi...` — Index a crate from a local path.
- pub `index_batch` function L243-252 — `( &self, store: &DocStore, crates: &[(&str, Option<&str>)], ) -> Vec<Result<Inde...` — Index multiple crates in batch.
- pub `index_extracted` function L265-273 — `( &self, store: &DocStore, crate_path: impl AsRef<Path>, crate_name: &str, versi...` — Index a pre-downloaded crate from an extracted directory.
- pub `index_crate` function L298-305 — `( store: &DocStore, crate_name: &str, version: Option<&str>, ) -> Result<IndexSt...` — Convenience function to index a single crate.
- pub `index_local_crate` function L308-316 — `( store: &DocStore, crate_path: impl AsRef<Path>, crate_name: &str, version: &st...` — Convenience function to index a local crate.
-  `RustDocIndexer` type L91-287 — `= RustDocIndexer` — ```
-  `get_work_dir` function L276-286 — `(&self) -> Result<PathBuf>` — Get the work directory for downloads.
-  `RustDocIndexer` type L289-293 — `impl Default for RustDocIndexer` — ```
-  `default` function L290-292 — `() -> Self` — ```
-  `tests` module L319-465 — `-` — ```
-  `test_indexer_creation` function L323-326 — `()` — ```
-  `test_indexer_with_config` function L329-337 — `()` — ```
-  `test_index_crate` function L341-381 — `()` — ```
-  `test_index_crate_specific_version` function L385-427 — `()` — ```
-  `test_index_batch` function L431-464 — `()` — ```

#### crates/muninn-graph/src/registry/llmstxt.rs

- pub `LlmsTxtError` enum L47-59 — `Http | Parse | MissingHeader | Io` — Error type for llms.txt operations.
- pub `Result` type L61 — `= std::result::Result<T, LlmsTxtError>` — ```
- pub `LlmsTxt` struct L65-74 — `{ name: String, summary: Option<String>, sections: HashMap<String, Vec<LlmsTxtLi...` — A parsed llms.txt file.
- pub `LlmsTxtLink` struct L78-87 — `{ title: String, url: String, description: Option<String>, section: String }` — A documentation link from llms.txt.
- pub `LlmsTxtParser` struct L90 — `-` — Parser for llms.txt content.
- pub `parse` function L94-183 — `(content: &str) -> Result<LlmsTxt>` — Parse llms.txt content from a string.
- pub `LlmsTxtFetcher` struct L224-226 — `{ client: reqwest::blocking::Client }` — Fetcher for llms.txt files from URLs.
- pub `new` function L230-238 — `() -> Self` — Create a new fetcher with default settings.
- pub `fetch` function L245-259 — `(&self, url: &str) -> Result<LlmsTxt>` — Fetch and parse llms.txt from a URL.
- pub `fetch_linked_content` function L262-274 — `(&self, url: &str) -> Result<String>` — Fetch the content of a linked markdown file.
- pub `LlmsTxtIndexerError` enum L302-311 — `LlmsTxt | DocStore | IndexingFailed` — Error type for llms.txt indexer operations.
- pub `LlmsTxtIndexStats` struct L315-326 — `{ name: String, source_url: String, links_found: usize, links_indexed: usize, li...` — Statistics from an llms.txt indexing operation.
- pub `LlmsTxtIndexerConfig` struct L330-337 — `{ fetch_linked_content: bool, max_links: usize, link_timeout_secs: u64 }` — Configuration for the llms.txt indexer.
- pub `LlmsTxtIndexer` struct L353-356 — `{ fetcher: LlmsTxtFetcher, config: LlmsTxtIndexerConfig }` — Indexer for llms.txt documentation.
- pub `new` function L360-365 — `() -> Self` — Create a new indexer with default configuration.
- pub `with_config` function L368-373 — `(config: LlmsTxtIndexerConfig) -> Self` — Create an indexer with custom configuration.
- pub `index_url` function L385-395 — `( &self, store: &DocStore, url: &str, ) -> std::result::Result<LlmsTxtIndexStats...` — Index llms.txt from a URL.
- pub `index_llmstxt` function L398-497 — `( &self, store: &DocStore, llms_txt: &LlmsTxt, source_url: &str, ) -> std::resul...` — Index a parsed llms.txt.
- pub `index_llmstxt` function L520-526 — `( store: &DocStore, url: &str, ) -> std::result::Result<LlmsTxtIndexStats, LlmsT...` — Convenience function to index llms.txt from a URL.
- pub `index_llmstxt_fast` function L529-539 — `( store: &DocStore, url: &str, ) -> std::result::Result<LlmsTxtIndexStats, LlmsT...` — Convenience function to index llms.txt without fetching linked content (fast mode).
-  `LlmsTxtParser` type L92-221 — `= LlmsTxtParser` — ```
-  `parse_link` function L186-220 — `(line: &str, section: &str) -> Option<LlmsTxtLink>` — Parse a single link line.
-  `LlmsTxtFetcher` type L228-286 — `= LlmsTxtFetcher` — ```
-  `normalize_url` function L277-285 — `(url: &str) -> String` — Normalize URL to point to llms.txt.
-  `LlmsTxtFetcher` type L288-292 — `impl Default for LlmsTxtFetcher` — ```
-  `default` function L289-291 — `() -> Self` — ```
-  `LlmsTxtIndexerConfig` type L339-347 — `impl Default for LlmsTxtIndexerConfig` — ```
-  `default` function L340-346 — `() -> Self` — ```
-  `LlmsTxtIndexer` type L358-511 — `= LlmsTxtIndexer` — ```
-  `section_to_item_type` function L500-510 — `(section: &str) -> ItemType` — Map section names to item types.
-  `LlmsTxtIndexer` type L513-517 — `impl Default for LlmsTxtIndexer` — ```
-  `default` function L514-516 — `() -> Self` — ```
-  `tests` module L542-667 — `-` — ```
-  `test_parse_simple_llmstxt` function L546-579 — `()` — ```
-  `test_parse_minimal_llmstxt` function L582-592 — `()` — ```
-  `test_parse_no_header_fails` function L595-600 — `()` — ```
-  `test_parse_link` function L603-611 — `()` — ```
-  `test_parse_link_no_description` function L614-621 — `()` — ```
-  `test_normalize_url` function L624-641 — `()` — ```
-  `test_parse_real_world_example` function L644-666 — `()` — ```

#### crates/muninn-graph/src/registry/mod.rs

- pub `crates_io` module L17 — `-` — This module provides clients for interacting with package registries:
- pub `indexer` module L18 — `-` — - LlmsTxtIndexer for fetching and storing llms.txt documentation
- pub `llmstxt` module L19 — `-` — - LlmsTxtIndexer for fetching and storing llms.txt documentation
- pub `py_indexer` module L20 — `-` — - LlmsTxtIndexer for fetching and storing llms.txt documentation
- pub `pydoc` module L21 — `-` — - LlmsTxtIndexer for fetching and storing llms.txt documentation
- pub `pypi` module L22 — `-` — - LlmsTxtIndexer for fetching and storing llms.txt documentation
- pub `rustdoc` module L23 — `-` — - LlmsTxtIndexer for fetching and storing llms.txt documentation

#### crates/muninn-graph/src/registry/py_indexer.rs

- pub `PyIndexerError` enum L36-51 — `PyPi | Extraction | DocStore | Io | IndexingFailed` — Error type for Python indexer operations.
- pub `Result` type L53 — `= std::result::Result<T, PyIndexerError>` — ```
- pub `PyIndexStats` struct L57-68 — `{ package_name: String, version: String, items_extracted: usize, items_indexed: ...` — Statistics from a Python indexing operation.
- pub `PyIndexerConfig` struct L72-83 — `{ keep_source: bool, work_dir: Option<PathBuf>, python: String, griffe_flags: Ve...` — Configuration for the Python indexer.
- pub `PyDocIndexer` struct L104-107 — `{ pypi_client: PyPiClient, config: PyIndexerConfig }` — Python documentation indexer.
- pub `new` function L111-116 — `() -> Self` — Create a new indexer with default configuration.
- pub `with_config` function L119-124 — `(config: PyIndexerConfig) -> Self` — Create an indexer with custom configuration.
- pub `index_package` function L140-192 — `( &self, store: &DocStore, package_name: &str, version: Option<&str>, ) -> Resul...` — Index a Python package by name.
- pub `index_local` function L204-234 — `( &self, store: &DocStore, package_path: impl AsRef<Path>, package_name: &str, v...` — Index a package from a local path.
- pub `index_batch` function L246-255 — `( &self, store: &DocStore, packages: &[(&str, Option<&str>)], ) -> Vec<Result<Py...` — Index multiple packages in batch.
- pub `index_package` function L280-287 — `( store: &DocStore, package_name: &str, version: Option<&str>, ) -> Result<PyInd...` — Convenience function to index a single Python package.
- pub `index_local_package` function L290-298 — `( store: &DocStore, package_path: impl AsRef<Path>, package_name: &str, version:...` — Convenience function to index a local Python package.
-  `PyIndexerConfig` type L85-95 — `impl Default for PyIndexerConfig` — ```
-  `default` function L86-94 — `() -> Self` — ```
-  `PyDocIndexer` type L109-269 — `= PyDocIndexer` — ```
-  `get_work_dir` function L258-268 — `(&self) -> Result<PathBuf>` — Get the work directory for downloads.
-  `PyDocIndexer` type L271-275 — `impl Default for PyDocIndexer` — ```
-  `default` function L272-274 — `() -> Self` — ```
-  `tests` module L301-374 — `-` — ```
-  `test_indexer_creation` function L305-308 — `()` — ```
-  `test_indexer_with_config` function L312-321 — `()` — ```
-  `test_index_package` function L325-349 — `()` — ```
-  `test_index_batch` function L353-373 — `()` — ```

#### crates/muninn-graph/src/registry/pydoc.rs

- pub `PyDocError` enum L30-39 — `Io | Parse | PackageNotFound` — Error type for Python doc extraction.
- pub `Result` type L41 — `= std::result::Result<T, PyDocError>` — ```
- pub `ExtractedPyItem` struct L48-59 — `{ path: String, item_type: ItemType, docstring: String, signature: Option<String...` — An extracted documentation item from Python code.
- pub `to_chunk` function L63-71 — `(&self) -> DocChunkInput` — Convert to DocChunkInput for storage.
- pub `PyDocExtractor` struct L78-80 — `{ parser: Parser }` — Python documentation extractor using tree-sitter.
- pub `new` function L87-91 — `() -> Self` — Create a new extractor.
- pub `check_griffe` function L95-97 — `(&self) -> Result<bool>` — Compatibility method - does nothing since we don't use griffe.
- pub `with_python` function L101-103 — `(_python: impl Into<String>) -> Self` — Compatibility constructor - python argument is ignored.
- pub `with_flags` function L107-109 — `(self, _flags: Vec<String>) -> Self` — Compatibility method - flags are ignored.
- pub `extract_from_path` function L114-135 — `( &mut self, package_path: impl AsRef<Path>, ) -> Result<Vec<ExtractedPyItem>>` — Extract documentation from a package at the given path.
- pub `extract_from_file` function L138-147 — `( &mut self, file_path: impl AsRef<Path>, module_path: &str, ) -> Result<Vec<Ext...` — Extract documentation from a single Python file.
- pub `extract_from_source` function L150-179 — `( &mut self, source: &str, module_path: &str, ) -> Result<Vec<ExtractedPyItem>>` — Extract documentation from Python source code.
- pub `items_to_chunks` function L517-523 — `(items: Vec<ExtractedPyItem>) -> Vec<DocChunkInput>` — Convert extracted items to DocChunkInput for storage.
-  `ExtractedPyItem` type L61-72 — `= ExtractedPyItem` — ```
-  `PyDocExtractor` type L85-508 — `= PyDocExtractor` — ```
-  `find_package_root` function L182-229 — `(&self, path: &Path) -> Result<(PathBuf, String)>` — Find the package root directory and name.
-  `walk_python_files` function L232-275 — `( &mut self, dir: &Path, module_prefix: &str, items: &mut Vec<ExtractedPyItem>, ...` — Walk Python files in a directory recursively.
-  `extract_module_docstring` function L278-307 — `(&self, root: &tree_sitter::Node, source: &str) -> Option<String>` — Extract module-level docstring (first string literal at top level).
-  `extract_from_node` function L310-358 — `( &self, node: &tree_sitter::Node, source: &str, module_path: &str, parent_class...` — Extract items from an AST node recursively.
-  `extract_class` function L361-396 — `( &self, node: &tree_sitter::Node, source: &str, module_path: &str, items: &mut ...` — Extract a class and its methods.
-  `extract_function` function L399-440 — `( &self, node: &tree_sitter::Node, source: &str, parent_path: &str, parent_class...` — Extract a function or method.
-  `build_signature` function L443-462 — `( &self, node: &tree_sitter::Node, source: &str, name: &str, ) -> Option<String>` — Build function signature from AST.
-  `extract_block_docstring` function L465-483 — `(&self, block: &tree_sitter::Node, source: &str) -> Option<String>` — Extract docstring from a block (first string literal).
-  `extract_string_content` function L486-502 — `(&self, node: &tree_sitter::Node, source: &str) -> String` — Extract string content, removing quotes.
-  `node_text` function L505-507 — `(&self, node: &tree_sitter::Node, source: &str) -> String` — Get text content of a node.
-  `PyDocExtractor` type L510-514 — `impl Default for PyDocExtractor` — ```
-  `default` function L511-513 — `() -> Self` — ```
-  `tests` module L526-718 — `-` — ```
-  `test_extractor_creation` function L530-533 — `()` — ```
-  `test_extract_module_docstring` function L536-555 — `()` — ```
-  `test_extract_function_docstring` function L558-582 — `()` — ```
-  `test_extract_class_and_methods` function L585-617 — `()` — ```
-  `test_extract_decorated_function` function L620-644 — `()` — ```
-  `test_items_to_chunks_filters_empty` function L647-668 — `()` — ```
-  `test_single_quote_docstrings` function L671-692 — `()` — ```
-  `test_nested_class` function L695-717 — `()` — ```

#### crates/muninn-graph/src/registry/pypi.rs

- pub `PyPiError` enum L36-66 — `Http | Io | Json | PackageNotFound | VersionNotFound | NoSdist | NoVersions | Ap...` — Error type for PyPI API operations.
- pub `Result` type L68 — `= std::result::Result<T, PyPiError>` — ```
- pub `PyPiClient` struct L77-79 — `{ client: Client }` — PyPI API client.
- pub `new` function L83-85 — `() -> Self` — Create a new PyPI client with default settings.
- pub `with_user_agent` function L88-95 — `(user_agent: &str) -> Self` — Create a new client with a custom user agent.
- pub `get_package` function L98-116 — `(&self, package_name: &str) -> Result<PackageMetadata>` — Get metadata for a package (all versions).
- pub `get_package_version` function L119-144 — `( &self, package_name: &str, version: &str, ) -> Result<PackageMetadata>` — Get metadata for a specific version.
- pub `get_latest_version` function L147-150 — `(&self, package_name: &str) -> Result<String>` — Get the latest version string for a package.
- pub `list_versions` function L153-160 — `(&self, package_name: &str) -> Result<Vec<String>>` — List all available versions for a package.
- pub `download_source` function L173-235 — `( &self, package_name: &str, version: Option<&str>, output_dir: impl AsRef<Path>...` — Download and extract the source distribution for a package.
- pub `download_latest` function L238-246 — `( &self, package_name: &str, output_dir: impl AsRef<Path>, ) -> Result<(PathBuf,...` — Download and extract source, returning both path and full metadata.
- pub `PackageMetadata` struct L309-321 — `{ info: PackageInfo, urls: Vec<ReleaseFile>, releases: std::collections::HashMap...` — Package metadata from PyPI JSON API.
- pub `PackageInfo` struct L325-370 — `{ name: String, version: String, summary: Option<String>, home_page: Option<Stri...` — Package information.
- pub `ReleaseFile` struct L374-399 — `{ filename: String, url: String, packagetype: String, python_version: Option<Str...` — A release file (sdist or wheel).
- pub `FileDigests` struct L403-406 — `{ md5: Option<String>, sha256: Option<String> }` — File digests.
-  `PYPI_API` variable L71 — `: &str` — Base URL for PyPI JSON API.
-  `PyPiClient` type L81-299 — `= PyPiClient` — ```
-  `extract_tar_gz` function L249-279 — `(&self, archive_path: &Path, output_dir: &Path) -> Result<PathBuf>` — Extract a .tar.gz archive.
-  `extract_zip` function L282-298 — `(&self, archive_path: &Path, output_dir: &Path) -> Result<PathBuf>` — Extract a .zip archive.
-  `PyPiClient` type L301-305 — `impl Default for PyPiClient` — ```
-  `default` function L302-304 — `() -> Self` — ```
-  `tests` module L409-545 — `-` — ```
-  `skip_network_tests` function L414-416 — `() -> bool` — ```
-  `test_client_creation` function L419-422 — `()` — ```
-  `test_client_custom_user_agent` function L425-428 — `()` — ```
-  `test_get_package` function L432-444 — `()` — ```
-  `test_get_package_version` function L448-459 — `()` — ```
-  `test_get_latest_version` function L463-474 — `()` — ```
-  `test_list_versions` function L478-490 — `()` — ```
-  `test_get_nonexistent_package` function L494-503 — `()` — ```
-  `test_download_source` function L507-525 — `()` — ```
-  `test_download_latest` function L529-544 — `()` — ```

#### crates/muninn-graph/src/registry/rustdoc.rs

- pub `RustdocError` enum L37-55 — `Io | Json | CargoFailed | JsonNotFound | NoCrateName | NoCargoToml` — Error type for rustdoc operations.
- pub `Result` type L57 — `= std::result::Result<T, RustdocError>` — ```
- pub `ExtractedItem` struct L61-76 — `{ path: String, item_type: ItemType, doc_text: Option<String>, signature: Option...` — Extracted documentation item from rustdoc JSON.
- pub `ItemVisibility` enum L80-85 — `Public | Crate | Restricted | Private` — Visibility of an extracted item.
- pub `to_doc_chunk` function L100-108 — `(&self) -> DocChunkInput` — Convert to DocChunkInput for storage.
- pub `RustdocExtractor` struct L115-118 — `{ rustdoc_flags: Vec<String> }` — Rustdoc JSON generator and parser.
- pub `new` function L122-126 — `() -> Self` — Create a new rustdoc extractor with default settings.
- pub `with_flags` function L129-132 — `(mut self, flags: Vec<String>) -> Self` — Add custom rustdoc flags.
- pub `generate_json` function L148-186 — `(&self, crate_path: impl AsRef<Path>) -> Result<PathBuf>` — Generate rustdoc JSON for a crate.
- pub `extract_docs_from_json` function L275-280 — `(json_path: impl AsRef<Path>) -> Result<Vec<ExtractedItem>>` — Extract documentation items from a rustdoc JSON file.
- pub `extract_docs_from_crate` function L283-314 — `(krate: &Crate) -> Result<Vec<ExtractedItem>>` — Extract documentation items from a parsed rustdoc Crate.
- pub `items_to_chunks` function L782-788 — `(items: Vec<ExtractedItem>) -> Vec<DocChunkInput>` — Convert extracted items to DocChunkInput for storage.
-  `ItemVisibility` type L87-96 — `= ItemVisibility` — ```
-  `from` function L88-95 — `(vis: &Visibility) -> Self` — ```
-  `ExtractedItem` type L98-109 — `= ExtractedItem` — ```
-  `RustdocExtractor` type L120-258 — `= RustdocExtractor` — ```
-  `try_generate_json_with_toolchain` function L189-223 — `( &self, crate_path: &Path, toolchain: Option<&str>, ) -> Result<()>` — Try to generate rustdoc JSON with a specific toolchain.
-  `find_json_output` function L226-238 — `(&self, crate_path: &Path, crate_name: &str) -> Result<PathBuf>` — Find the generated JSON output file.
-  `get_crate_name` function L241-257 — `(&self, cargo_toml: &Path) -> Result<String>` — Extract crate name from Cargo.toml.
-  `RustdocExtractor` type L260-264 — `impl Default for RustdocExtractor` — ```
-  `default` function L261-263 — `() -> Self` — ```
-  `is_public_item` function L317-319 — `(item: &Item) -> bool` — Check if an item is publicly visible.
-  `build_item_path` function L322-347 — `( krate: &'a Crate, id: &'a Id, cache: &mut HashMap<&'a Id, Vec<String>>, ) -> S...` — Build the full path for an item (e.g., "crate::module::function").
-  `extract_item` function L350-411 — `( krate: &'a Crate, item: &Item, path: &str, cache: &mut HashMap<&'a Id, Vec<Str...` — Extract documentation from a single item.
-  `extract_nested_items` function L414-513 — `( krate: &'a Crate, item: &Item, parent_path: &str, items: &mut Vec<ExtractedIte...` — Extract nested items like struct fields, enum variants, and impl methods.
-  `build_impl_path` function L516-529 — `( krate: &'a Crate, impl_: &rustdoc_types::Impl, cache: &mut HashMap<&'a Id, Vec...` — Build the path for an impl block.
-  `format_function_signature` function L532-578 — `( krate: &'a Crate, f: &rustdoc_types::Function, name: Option<&str>, cache: &mut...` — Format a function signature for display.
-  `format_struct_signature` function L581-590 — `(s: &rustdoc_types::Struct, name: Option<&str>) -> String` — Format a struct signature.
-  `format_enum_signature` function L593-597 — `(e: &rustdoc_types::Enum, name: Option<&str>) -> String` — Format an enum signature.
-  `format_trait_signature` function L600-604 — `(t: &rustdoc_types::Trait, name: Option<&str>) -> String` — Format a trait signature.
-  `format_type_alias_signature` function L607-617 — `( krate: &'a Crate, t: &rustdoc_types::TypeAlias, name: Option<&str>, cache: &mu...` — Format a type alias signature.
-  `format_constant_signature` function L620-630 — `( krate: &'a Crate, ty: &rustdoc_types::Type, _const_: &rustdoc_types::Constant,...` — Format a constant signature.
-  `format_generics` function L633-647 — `(generics: &rustdoc_types::Generics) -> String` — Format generics for display.
-  `format_type` function L655-774 — `( krate: &'a Crate, ty: &rustdoc_types::Type, cache: &mut HashMap<&'a Id, Vec<St...` — ```
-  `format_path` function L777-779 — `(path: &str) -> String` — Format a path for display.
-  `tests` module L791-1027 — `-` — ```
-  `test_extractor_creation` function L795-799 — `()` — ```
-  `test_item_visibility_conversion` function L802-815 — `()` — ```
-  `test_extracted_item_to_chunk` function L818-835 — `()` — ```
-  `test_items_to_chunks_filters_empty` function L838-867 — `()` — ```
-  `test_full_pipeline_with_crate` function L871-916 — `()` — ```
-  `test_generate_json_no_cargo_toml` function L920-926 — `()` — ```
-  `test_extract_structs_and_methods` function L930-1026 — `()` — ```

### crates/muninn-graph/tests

> *Semantic summary to be generated by AI agent.*

#### crates/muninn-graph/tests/doc_indexing.rs

-  `test_index_crate_thiserror` function L33-89 — `()` — Index the `thiserror` crate and verify documentation is searchable.
-  `test_index_crate_once_cell` function L94-139 — `()` — Index the `once_cell` crate - another small, stable crate.
-  `test_index_crate_specific_version` function L144-167 — `()` — Index a specific version of a crate.
-  `test_index_package_six` function L181-220 — `()` — Index the `six` package - a minimal, stable Python package.
-  `test_index_package_attrs` function L225-271 — `()` — Index the `attrs` package - popular, well-documented package.
-  `test_index_llmstxt_mintlify_fast` function L280-324 — `()` — Index Mintlify's llms.txt in fast mode (descriptions only).
-  `test_index_llmstxt_anthropic` function L329-358 — `()` — Index Anthropic's llms.txt (if available).
-  `test_list_multiple_libraries` function L367-421 — `()` — Index multiple libraries and verify listing works.
-  `test_remove_and_reindex` function L426-464 — `()` — Test removing and re-indexing a library.
-  `test_search_edge_cases` function L469-505 — `()` — Test search across empty results gracefully handles edge cases.

#### crates/muninn-graph/tests/integration.rs

-  `parse_muninn_graph_source` function L12-54 — `()` — Parse muninn-graph's own source code to verify the Rust extractor works on real code.
-  `parse_symbols_module` function L58-94 — `()` — Parse symbols.rs and verify symbol extraction.
-  `parse_edges_module` function L98-135 — `()` — Parse edges.rs and verify symbol extraction.
-  `extract_imports_from_real_file` function L139-164 — `()` — Verify import extraction on a real file.
-  `parse_all_source_files` function L168-217 — `()` — Parse all Rust files in src/ directory.
-  `visit_dir` function L177-200 — `( dir: &Path, parser: &mut Parser, file_count: &mut usize, total_symbols: &mut u...` — Tests the public API of the graph crate.

### crates/muninn-rlm/src

> *Semantic summary to be generated by AI agent.*

#### crates/muninn-rlm/src/anthropic.rs

- pub `AnthropicConfig` struct L29-47 — `{ api_key: String, base_url: String, api_version: String, timeout: Duration, max...` — Configuration for the Anthropic backend.
- pub `new` function L51-60 — `(api_key: impl Into<String>) -> Self` — Create a new config with the given API key.
- pub `from_env` function L63-68 — `() -> Result<Self>` — Create config from environment variable.
- pub `with_base_url` function L71-74 — `(mut self, url: impl Into<String>) -> Self` — Set a custom base URL.
- pub `with_timeout` function L77-80 — `(mut self, timeout: Duration) -> Self` — Set request timeout.
- pub `with_max_retries` function L83-86 — `(mut self, retries: u32) -> Self` — Set max retries.
- pub `AnthropicBackend` struct L90-93 — `{ client: Client, config: AnthropicConfig }` — Anthropic API backend.
- pub `new` function L97-104 — `(config: AnthropicConfig) -> Result<Self>` — Create a new Anthropic backend with the given configuration.
- pub `from_env` function L107-109 — `() -> Result<Self>` — Create a backend from environment configuration.
- pub `create_shared_backend` function L557-559 — `(config: AnthropicConfig) -> Result<Arc<dyn LLMBackend>>` — Create a shared Anthropic backend.
-  `DEFAULT_API_BASE` variable L19 — `: &str` — Default API base URL.
-  `DEFAULT_API_VERSION` variable L22 — `: &str` — Default API version.
-  `DEFAULT_TIMEOUT_SECS` variable L25 — `: u64` — Default timeout for requests.
-  `AnthropicConfig` type L49-87 — `= AnthropicConfig` — Messages API for Claude completions.
-  `AnthropicBackend` type L95-123 — `= AnthropicBackend` — Messages API for Claude completions.
-  `messages_url` function L112-114 — `(&self) -> String` — Build the messages endpoint URL.
-  `add_headers` function L117-122 — `(&self, builder: reqwest::RequestBuilder) -> reqwest::RequestBuilder` — Add authentication and API headers to a request.
-  `AnthropicBackend` type L126-189 — `impl LLMBackend for AnthropicBackend` — Messages API for Claude completions.
-  `complete` function L127-147 — `(&self, request: CompletionRequest) -> Result<CompletionResponse>` — Messages API for Claude completions.
-  `complete_stream` function L149-165 — `(&self, request: CompletionRequest) -> Result<ResponseStream>` — Messages API for Claude completions.
-  `name` function L167-169 — `(&self) -> &str` — Messages API for Claude completions.
-  `health_check` function L171-188 — `(&self) -> Result<()>` — Messages API for Claude completions.
-  `AnthropicBackend` type L191-222 — `= AnthropicBackend` — Messages API for Claude completions.
-  `handle_response` function L193-203 — `(response: Response) -> Result<CompletionResponse>` — Handle a successful response.
-  `handle_error_response` function L206-221 — `(response: Response) -> RlmError` — Handle an error response.
-  `ApiResponse` struct L226-236 — `{ id: String, response_type: String, role: String, content: Vec<ApiContentBlock>...` — Internal API response structure.
-  `CompletionResponse` type L238-281 — `= CompletionResponse` — Messages API for Claude completions.
-  `from` function L239-280 — `(api: ApiResponse) -> Self` — Messages API for Claude completions.
-  `ApiContentBlock` enum L285-294 — `Text | ToolUse` — Messages API for Claude completions.
-  `ApiUsage` struct L297-302 — `{ input_tokens: u32, output_tokens: u32, cache_creation_input_tokens: Option<u32...` — Messages API for Claude completions.
-  `ApiError` struct L305-307 — `{ error: ApiErrorDetail }` — Messages API for Claude completions.
-  `ApiErrorDetail` struct L310-315 — `{ error_type: String, message: String }` — Messages API for Claude completions.
-  `parse_sse_stream` function L319-384 — `( byte_stream: impl Stream<Item = reqwest::Result<Bytes>> + Send + 'static, ) ->...` — Parse SSE events from a byte stream and convert to StreamEvents.
-  `SseState` struct L386-391 — `{ byte_stream: Pin<Box<dyn Stream<Item = reqwest::Result<Bytes>> + Send>>, buffe...` — Messages API for Claude completions.
-  `parse_sse_line` function L393-401 — `(line: &str) -> Option<(&str, &str)>` — Messages API for Claude completions.
-  `parse_stream_event` function L403-482 — `(event_type: &str, data: &str) -> Option<StreamEvent>` — Messages API for Claude completions.
-  `MessageStartEvent` struct L487-489 — `{ message: MessageStartMessage }` — Messages API for Claude completions.
-  `MessageStartMessage` struct L492-495 — `{ id: String, model: String }` — Messages API for Claude completions.
-  `ContentBlockStartEvent` struct L498-501 — `{ index: usize, content_block: ContentBlockType }` — Messages API for Claude completions.
-  `ContentBlockType` struct L504-507 — `{ block_type: String }` — Messages API for Claude completions.
-  `ContentBlockDeltaEvent` struct L510-513 — `{ index: usize, delta: DeltaContent }` — Messages API for Claude completions.
-  `DeltaContent` enum L517-520 — `TextDelta | InputJsonDelta` — Messages API for Claude completions.
-  `ContentBlockStopEvent` struct L523-525 — `{ index: usize }` — Messages API for Claude completions.
-  `MessageDeltaEvent` struct L528-531 — `{ delta: MessageDelta, usage: MessageDeltaUsage }` — Messages API for Claude completions.
-  `MessageDelta` struct L534-536 — `{ stop_reason: Option<String> }` — Messages API for Claude completions.
-  `MessageDeltaUsage` struct L539-541 — `{ output_tokens: u32 }` — Messages API for Claude completions.
-  `StreamErrorEvent` struct L544-546 — `{ error: StreamErrorDetail }` — Messages API for Claude completions.
-  `StreamErrorDetail` struct L549-554 — `{ error_type: String, message: String }` — Messages API for Claude completions.
-  `tests` module L562-695 — `-` — Messages API for Claude completions.
-  `test_config_new` function L566-571 — `()` — Messages API for Claude completions.
-  `test_config_with_base_url` function L574-577 — `()` — Messages API for Claude completions.
-  `test_config_with_timeout` function L580-583 — `()` — Messages API for Claude completions.
-  `test_parse_sse_line` function L586-596 — `()` — Messages API for Claude completions.
-  `test_api_response_conversion` function L599-623 — `()` — Messages API for Claude completions.
-  `test_api_response_with_tool_use` function L626-660 — `()` — Messages API for Claude completions.
-  `test_messages_url` function L663-670 — `()` — Messages API for Claude completions.
-  `test_messages_url_custom_base` function L673-677 — `()` — Messages API for Claude completions.
-  `test_backend_name` function L680-684 — `()` — Messages API for Claude completions.
-  `test_is_retryable` function L687-694 — `()` — Messages API for Claude completions.

#### crates/muninn-rlm/src/backend.rs

- pub `with_retry` function L25-64 — `( max_retries: u32, initial_backoff: Duration, backend_name: &str, mut f: F, ) -...` — Execute an async operation with exponential backoff retry.
- pub `is_retryable` function L70-72 — `(error: &RlmError) -> bool` — Check if an error is retryable.
- pub `pick_model` function L79-86 — `(request_model: &str, default_model: &str) -> String` — Resolve the wire-level model name for a request.
- pub `ResponseStream` type L89 — `= Pin<Box<dyn Stream<Item = Result<StreamEvent>> + Send + 'static>>` — A streaming response from an LLM backend.
- pub `StreamEvent` enum L93-113 — `MessageStart | ContentBlockStart | ContentBlockDelta | ContentBlockStop | Messag...` — Events emitted during streaming.
- pub `ContentDelta` enum L117-122 — `TextDelta | InputJsonDelta` — Delta content in a streaming response.
- pub `ParsedToolCall` struct L126-133 — `{ id: String, name: String, arguments: serde_json::Value }` — A parsed tool call from model output.
- pub `LLMBackend` interface L159-230 — `{ fn complete(), fn complete_stream(), fn name(), fn health_check(), fn supports...` — Trait for LLM backend providers.
- pub `default_format_tool_definitions` function L233-264 — `(tools: &[ToolDefinition]) -> String` — Default human-readable format for tool definitions.
- pub `default_format_tool_result` function L267-273 — `(tool_use_id: &str, content: &str, is_error: bool) -> String` — Default format for tool results.
- pub `MockBackend` struct L280-284 — `{ name: String, responses: std::sync::Mutex<Vec<CompletionResponse>>, request_lo...` — A mock backend for testing purposes.
- pub `new` function L291-297 — `(responses: Vec<CompletionResponse>) -> Self` — Create a new mock backend with the given responses.
- pub `with_text` function L300-311 — `(text: impl Into<String>) -> Self` — Create a mock backend with a single text response.
- pub `requests` function L314-316 — `(&self) -> Vec<CompletionRequest>` — Get all requests that were made to this backend.
- pub `request_count` function L319-321 — `(&self) -> usize` — Get the number of requests made.
- pub `LoggingBackend` struct L378-381 — `{ inner: B, name: String }` — A backend that wraps another backend with request/response logging.
- pub `new` function L385-388 — `(inner: B) -> Self` — Create a new logging backend.
- pub `SharedBackend` type L449 — `= Arc<dyn LLMBackend>` — A backend that can be shared across threads.
-  `ContentBlock` type L135-144 — `= ContentBlock` — (Anthropic, OpenAI, local models) and provides mock implementations for testing.
-  `from` function L136-143 — `(call: ParsedToolCall) -> Self` — (Anthropic, OpenAI, local models) and provides mock implementations for testing.
-  `supports_native_tools` function L186-188 — `(&self) -> bool` — Returns true if backend handles tools natively via API.
-  `tool_calling_instructions` function L196-198 — `(&self) -> Option<&str>` — Instructions for HOW to call tools (model-specific format).
-  `format_tool_definitions` function L206-208 — `(&self, tools: &[ToolDefinition]) -> String` — Format tool definitions for the system prompt.
-  `format_tool_result` function L216-218 — `(&self, tool_use_id: &str, content: &str, is_error: bool) -> String` — Format a tool result for the conversation.
-  `parse_tool_calls` function L227-229 — `(&self, text: &str) -> (String, Vec<ParsedToolCall>)` — Parse tool calls from model text output.
-  `MockBackend` type L286-322 — `= MockBackend` — (Anthropic, OpenAI, local models) and provides mock implementations for testing.
-  `MockBackend` type L325-375 — `impl LLMBackend for MockBackend` — (Anthropic, OpenAI, local models) and provides mock implementations for testing.
-  `complete` function L326-338 — `(&self, request: CompletionRequest) -> Result<CompletionResponse>` — (Anthropic, OpenAI, local models) and provides mock implementations for testing.
-  `complete_stream` function L340-366 — `(&self, request: CompletionRequest) -> Result<ResponseStream>` — (Anthropic, OpenAI, local models) and provides mock implementations for testing.
-  `name` function L368-370 — `(&self) -> &str` — (Anthropic, OpenAI, local models) and provides mock implementations for testing.
-  `health_check` function L372-374 — `(&self) -> Result<()>` — (Anthropic, OpenAI, local models) and provides mock implementations for testing.
-  `complete` function L393-428 — `(&self, request: CompletionRequest) -> Result<CompletionResponse>` — (Anthropic, OpenAI, local models) and provides mock implementations for testing.
-  `complete_stream` function L430-437 — `(&self, request: CompletionRequest) -> Result<ResponseStream>` — (Anthropic, OpenAI, local models) and provides mock implementations for testing.
-  `name` function L439-441 — `(&self) -> &str` — (Anthropic, OpenAI, local models) and provides mock implementations for testing.
-  `health_check` function L443-445 — `(&self) -> Result<()>` — (Anthropic, OpenAI, local models) and provides mock implementations for testing.
-  `tests` module L452-583 — `-` — (Anthropic, OpenAI, local models) and provides mock implementations for testing.
-  `test_mock_backend_single_response` function L457-465 — `()` — (Anthropic, OpenAI, local models) and provides mock implementations for testing.
-  `test_mock_backend_multiple_responses` function L468-501 — `()` — (Anthropic, OpenAI, local models) and provides mock implementations for testing.
-  `test_mock_backend_exhausted` function L504-511 — `()` — (Anthropic, OpenAI, local models) and provides mock implementations for testing.
-  `test_mock_backend_with_tool_use` function L514-543 — `()` — (Anthropic, OpenAI, local models) and provides mock implementations for testing.
-  `test_mock_backend_stream` function L546-563 — `()` — (Anthropic, OpenAI, local models) and provides mock implementations for testing.
-  `test_mock_backend_health_check` function L566-569 — `()` — (Anthropic, OpenAI, local models) and provides mock implementations for testing.
-  `test_logging_backend` function L572-582 — `()` — (Anthropic, OpenAI, local models) and provides mock implementations for testing.

#### crates/muninn-rlm/src/context.rs

- pub `ContextItem` struct L17-28 — `{ content: String, source: String, relevance: f32, category: String, hash: u64 }` — A piece of context with metadata.
- pub `new` function L32-42 — `(content: impl Into<String>, source: impl Into<String>) -> Self` — Create a new context item.
- pub `with_relevance` function L45-48 — `(mut self, relevance: f32) -> Self` — Set the relevance score.
- pub `with_category` function L51-54 — `(mut self, category: impl Into<String>) -> Self` — Set the category.
- pub `len` function L71-73 — `(&self) -> usize` — Get content length in characters.
- pub `is_empty` function L76-78 — `(&self) -> bool` — Check if content is empty.
- pub `ContextAggregator` struct L87-91 — `{ items: Vec<ContextItem>, seen_hashes: HashSet<u64>, max_total_chars: usize }` — Aggregates and manages context from multiple sources.
- pub `new` function L95-101 — `() -> Self` — Create a new aggregator with default limits.
- pub `with_max_chars` function L104-107 — `(mut self, max: usize) -> Self` — Set the maximum total characters.
- pub `add` function L110-122 — `(&mut self, item: ContextItem) -> bool` — Add a context item, deduplicating if already seen.
- pub `add_content` function L125-127 — `(&mut self, content: impl Into<String>, source: impl Into<String>) -> bool` — Add content with source (convenience method).
- pub `add_with_relevance` function L130-137 — `( &mut self, content: impl Into<String>, source: impl Into<String>, relevance: f...` — Add content with source and relevance.
- pub `len` function L140-142 — `(&self) -> usize` — Get the number of items.
- pub `is_empty` function L145-147 — `(&self) -> bool` — Check if empty.
- pub `total_chars` function L150-152 — `(&self) -> usize` — Get total content size in characters.
- pub `sort_by_relevance` function L155-161 — `(&mut self)` — Sort items by relevance (highest first).
- pub `sort_by_category` function L164-172 — `(&mut self)` — Sort items by category, then relevance.
- pub `truncate_to_limit` function L175-190 — `(&mut self)` — Truncate to fit within max_total_chars, keeping highest relevance items.
- pub `items` function L193-195 — `(&self) -> &[ContextItem]` — Get items as a slice.
- pub `into_items` function L198-200 — `(self) -> Vec<ContextItem>` — Take all items, consuming the aggregator.
- pub `clear` function L203-206 — `(&mut self)` — Clear all items.
- pub `build` function L209-228 — `(&self) -> String` — Build formatted context string for LLM consumption.
- pub `build_json` function L231-250 — `(&self) -> serde_json::Value` — Build as JSON structure.
- pub `build_compact` function L253-259 — `(&self) -> String` — Build compact format (just content, no metadata).
- pub `ContextBuilder` struct L267-269 — `{ aggregator: ContextAggregator }` — Builder for constructing context with a fluent API.
- pub `new` function L273-277 — `() -> Self` — Create a new builder.
- pub `max_chars` function L280-283 — `(mut self, max: usize) -> Self` — Set max characters limit.
- pub `add` function L286-289 — `(mut self, content: impl Into<String>, source: impl Into<String>) -> Self` — Add a context item.
- pub `add_with_relevance` function L292-301 — `( mut self, content: impl Into<String>, source: impl Into<String>, relevance: f3...` — Add with relevance.
- pub `add_item` function L304-307 — `(mut self, item: ContextItem) -> Self` — Add a pre-built item.
- pub `finalize` function L310-313 — `(mut self) -> ContextAggregator` — Sort by relevance and truncate.
- pub `build` function L316-318 — `(self) -> String` — Build directly to string.
- pub `build_json` function L321-323 — `(self) -> serde_json::Value` — Build directly to JSON.
-  `ContextItem` type L30-79 — `= ContextItem` — - Truncating to fit context limits
-  `compute_hash` function L57-68 — `(content: &str) -> u64` — Compute a simple hash for deduplication.
-  `ContextAggregator` type L93-260 — `= ContextAggregator` — - Truncating to fit context limits
-  `ContextBuilder` type L271-324 — `= ContextBuilder` — - Truncating to fit context limits
-  `ContextBuilder` type L326-330 — `impl Default for ContextBuilder` — - Truncating to fit context limits
-  `default` function L327-329 — `() -> Self` — - Truncating to fit context limits
-  `tests` module L337-502 — `-` — - Truncating to fit context limits
-  `test_context_item_creation` function L341-350 — `()` — - Truncating to fit context limits
-  `test_relevance_clamping` function L353-359 — `()` — - Truncating to fit context limits
-  `test_aggregator_add` function L362-368 — `()` — - Truncating to fit context limits
-  `test_aggregator_deduplication` function L371-377 — `()` — - Truncating to fit context limits
-  `test_aggregator_whitespace_normalization` function L380-387 — `()` — - Truncating to fit context limits
-  `test_aggregator_empty_content` function L390-395 — `()` — - Truncating to fit context limits
-  `test_aggregator_sort_by_relevance` function L398-411 — `()` — - Truncating to fit context limits
-  `test_aggregator_truncate` function L414-426 — `()` — - Truncating to fit context limits
-  `test_aggregator_build` function L429-439 — `()` — - Truncating to fit context limits
-  `test_aggregator_build_compact` function L442-449 — `()` — - Truncating to fit context limits
-  `test_aggregator_build_json` function L452-459 — `()` — - Truncating to fit context limits
-  `test_context_builder` function L462-471 — `()` — - Truncating to fit context limits
-  `test_context_builder_finalize` function L474-478 — `()` — - Truncating to fit context limits
-  `test_total_chars` function L481-487 — `()` — - Truncating to fit context limits
-  `test_clear` function L490-501 — `()` — - Truncating to fit context limits

#### crates/muninn-rlm/src/doc_tools.rs

- pub `SharedDocStore` type L26 — `= Arc<Mutex<DocStore>>` — Thread-safe wrapper around DocStore.
- pub `wrap_doc_store` function L29-31 — `(store: DocStore) -> SharedDocStore` — Create a shared doc store from a DocStore.
- pub `SearchDocsTool` struct L45-48 — `{ store: SharedDocStore, max_results: usize }` — Tool for searching documentation in indexed libraries.
- pub `new` function L52-57 — `(store: SharedDocStore) -> Self` — Create a new search docs tool.
- pub `with_max_results` function L60-63 — `(mut self, max: usize) -> Self` — Set maximum results to return.
- pub `IndexCrateTool` struct L190-193 — `{ store: SharedDocStore, work_dir: Option<PathBuf> }` — Tool for on-demand indexing of Rust crates from crates.io.
- pub `new` function L197-202 — `(store: SharedDocStore) -> Self` — Create a new index crate tool.
- pub `with_work_dir` function L205-208 — `(mut self, dir: PathBuf) -> Self` — Set a custom work directory for downloads.
- pub `IndexPackageTool` struct L325-331 — `{ store: SharedDocStore, work_dir: Option<PathBuf>, python: String }` — Tool for on-demand indexing of Python packages from PyPI.
- pub `new` function L336-342 — `(store: SharedDocStore) -> Self` — Create a new index package tool.
- pub `with_work_dir` function L345-348 — `(mut self, dir: PathBuf) -> Self` — Set a custom work directory for downloads.
- pub `with_python` function L355-358 — `(mut self, python: impl Into<String>) -> Self` — Set the Python executable to use.
- pub `ListLibrariesTool` struct L472-474 — `{ store: SharedDocStore }` — Tool for listing all indexed libraries.
- pub `new` function L478-480 — `(store: SharedDocStore) -> Self` — Create a new list libraries tool.
- pub `create_doc_tools` function L570-577 — `(store: SharedDocStore) -> Vec<Box<dyn Tool>>` — Create all documentation tools for a given store.
-  `lock_store` function L34-38 — `(store: &SharedDocStore) -> Result<std::sync::MutexGuard<'_, DocStore>>` — Acquire the doc store lock with consistent error handling.
-  `SearchDocsTool` type L50-64 — `= SearchDocsTool` — - `list_libraries`: List all indexed libraries
-  `SearchDocsTool` type L67-183 — `impl Tool for SearchDocsTool` — - `list_libraries`: List all indexed libraries
-  `name` function L68-70 — `(&self) -> &str` — - `list_libraries`: List all indexed libraries
-  `description` function L72-76 — `(&self) -> &str` — - `list_libraries`: List all indexed libraries
-  `parameters_schema` function L78-97 — `(&self) -> serde_json::Value` — - `list_libraries`: List all indexed libraries
-  `execute` function L99-182 — `(&self, params: serde_json::Value) -> Result<ToolResult>` — - `list_libraries`: List all indexed libraries
-  `IndexCrateTool` type L195-209 — `= IndexCrateTool` — - `list_libraries`: List all indexed libraries
-  `IndexCrateTool` type L212-318 — `impl Tool for IndexCrateTool` — - `list_libraries`: List all indexed libraries
-  `name` function L213-215 — `(&self) -> &str` — - `list_libraries`: List all indexed libraries
-  `description` function L217-221 — `(&self) -> &str` — - `list_libraries`: List all indexed libraries
-  `parameters_schema` function L223-238 — `(&self) -> serde_json::Value` — - `list_libraries`: List all indexed libraries
-  `execute` function L240-317 — `(&self, params: serde_json::Value) -> Result<ToolResult>` — - `list_libraries`: List all indexed libraries
-  `IndexPackageTool` type L333-359 — `= IndexPackageTool` — - `list_libraries`: List all indexed libraries
-  `IndexPackageTool` type L362-465 — `impl Tool for IndexPackageTool` — - `list_libraries`: List all indexed libraries
-  `name` function L363-365 — `(&self) -> &str` — - `list_libraries`: List all indexed libraries
-  `description` function L367-371 — `(&self) -> &str` — - `list_libraries`: List all indexed libraries
-  `parameters_schema` function L373-388 — `(&self) -> serde_json::Value` — - `list_libraries`: List all indexed libraries
-  `execute` function L390-464 — `(&self, params: serde_json::Value) -> Result<ToolResult>` — - `list_libraries`: List all indexed libraries
-  `ListLibrariesTool` type L476-481 — `= ListLibrariesTool` — - `list_libraries`: List all indexed libraries
-  `ListLibrariesTool` type L484-563 — `impl Tool for ListLibrariesTool` — - `list_libraries`: List all indexed libraries
-  `name` function L485-487 — `(&self) -> &str` — - `list_libraries`: List all indexed libraries
-  `description` function L489-492 — `(&self) -> &str` — - `list_libraries`: List all indexed libraries
-  `parameters_schema` function L494-505 — `(&self) -> serde_json::Value` — - `list_libraries`: List all indexed libraries
-  `execute` function L507-562 — `(&self, params: serde_json::Value) -> Result<ToolResult>` — - `list_libraries`: List all indexed libraries
-  `tests` module L580-798 — `-` — - `list_libraries`: List all indexed libraries
-  `setup_test_store` function L584-587 — `() -> SharedDocStore` — - `list_libraries`: List all indexed libraries
-  `test_create_doc_tools` function L590-600 — `()` — - `list_libraries`: List all indexed libraries
-  `test_search_docs_library_not_found` function L604-618 — `()` — - `list_libraries`: List all indexed libraries
-  `test_search_docs_with_indexed_library` function L622-656 — `()` — - `list_libraries`: List all indexed libraries
-  `test_list_libraries_empty` function L660-668 — `()` — - `list_libraries`: List all indexed libraries
-  `test_list_libraries_with_data` function L672-692 — `()` — - `list_libraries`: List all indexed libraries
-  `test_list_libraries_filter_by_ecosystem` function L696-722 — `()` — - `list_libraries`: List all indexed libraries
-  `test_index_crate_already_indexed` function L726-747 — `()` — - `list_libraries`: List all indexed libraries
-  `test_index_package_already_indexed` function L751-772 — `()` — - `list_libraries`: List all indexed libraries
-  `test_tool_descriptions` function L775-784 — `()` — - `list_libraries`: List all indexed libraries
-  `test_tool_schemas` function L787-797 — `()` — - `list_libraries`: List all indexed libraries

#### crates/muninn-rlm/src/error.rs

- pub `Result` type L6 — `= std::result::Result<T, RlmError>` — Result type alias for RLM operations.
- pub `RlmError` enum L10-46 — `Backend | ToolExecution | BudgetExceeded | InvalidRequest | Network | Serializat...` — Errors that can occur in the RLM gateway.
- pub `BudgetExceededError` struct L50-57 — `{ budget_type: BudgetType, limit: u64, actual: u64 }` — Details about which budget was exceeded.
- pub `BudgetType` enum L71-80 — `Tokens | Duration | Depth | ToolCalls` — Types of budgets that can be exceeded.
-  `BudgetExceededError` type L59-67 — `= BudgetExceededError` — Error types for the RLM gateway.
-  `fmt` function L60-66 — `(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result` — Error types for the RLM gateway.
-  `RlmError` type L82-86 — `= RlmError` — Error types for the RLM gateway.
-  `from` function L83-85 — `(e: reqwest::Error) -> Self` — Error types for the RLM gateway.
-  `RlmError` type L88-92 — `= RlmError` — Error types for the RLM gateway.
-  `from` function L89-91 — `(e: serde_json::Error) -> Self` — Error types for the RLM gateway.
-  `RlmError` type L94-98 — `= RlmError` — Error types for the RLM gateway.
-  `from` function L95-97 — `(e: std::io::Error) -> Self` — Error types for the RLM gateway.
-  `tests` module L101-127 — `-` — Error types for the RLM gateway.
-  `test_error_display` function L105-116 — `()` — Error types for the RLM gateway.
-  `test_budget_exceeded_display` function L119-126 — `()` — Error types for the RLM gateway.

#### crates/muninn-rlm/src/fs.rs

- pub `FileSystem` interface L21-48 — `{ fn read_file(), fn read_file_bytes(), fn write_file(), fn list_dir(), fn exist...` — Abstraction over filesystem operations for testability.
- pub `DirEntry` struct L52-59 — `{ path: PathBuf, name: String, is_dir: bool }` — Directory entry information.
- pub `FileMetadata` struct L63-70 — `{ len: u64, is_dir: bool, is_file: bool }` — File metadata.
- pub `RealFileSystem` struct L78 — `-` — Real filesystem implementation using tokio::fs.
- pub `new` function L82-84 — `() -> Self` — Create a new real filesystem.
- pub `MockFileSystem` struct L160-167 — `{ files: Arc<RwLock<HashMap<PathBuf, Vec<u8>>>>, directories: Arc<RwLock<HashMap...` — Mock filesystem for testing.
- pub `new` function L177-183 — `() -> Self` — Create a new empty mock filesystem.
- pub `with_file` function L186-200 — `(self, path: impl Into<PathBuf>, content: impl Into<String>) -> Self` — Add a file with string content.
- pub `with_file_bytes` function L203-213 — `(self, path: impl Into<PathBuf>, content: Vec<u8>) -> Self` — Add a file with binary content.
- pub `with_files` function L216-224 — `( mut self, files: impl IntoIterator<Item = (impl Into<PathBuf>, impl Into<Strin...` — Add multiple files at once.
- pub `with_directory` function L227-232 — `(self, path: impl Into<PathBuf>) -> Self` — Add a directory.
- pub `get_written_files` function L235-242 — `(&self) -> HashMap<PathBuf, String>` — Get all files that were written during the test.
- pub `get_written_file` function L245-251 — `(&self, path: &Path) -> Option<String>` — Get a specific file's content that was written.
- pub `was_file_written` function L254-256 — `(&self, path: &Path) -> bool` — Check if a file was written.
- pub `SharedFileSystem` type L450 — `= Arc<dyn FileSystem>` — Shared filesystem reference.
-  `RealFileSystem` type L80-85 — `= RealFileSystem` — allowing tools to be tested with mock filesystems instead of real files.
-  `RealFileSystem` type L88-150 — `impl FileSystem for RealFileSystem` — allowing tools to be tested with mock filesystems instead of real files.
-  `read_file` function L89-91 — `(&self, path: &Path) -> io::Result<String>` — allowing tools to be tested with mock filesystems instead of real files.
-  `read_file_bytes` function L93-95 — `(&self, path: &Path) -> io::Result<Vec<u8>>` — allowing tools to be tested with mock filesystems instead of real files.
-  `write_file` function L97-99 — `(&self, path: &Path, content: &str) -> io::Result<()>` — allowing tools to be tested with mock filesystems instead of real files.
-  `list_dir` function L101-118 — `(&self, path: &Path) -> io::Result<Vec<DirEntry>>` — allowing tools to be tested with mock filesystems instead of real files.
-  `exists` function L120-122 — `(&self, path: &Path) -> bool` — allowing tools to be tested with mock filesystems instead of real files.
-  `is_dir` function L124-129 — `(&self, path: &Path) -> bool` — allowing tools to be tested with mock filesystems instead of real files.
-  `is_file` function L131-136 — `(&self, path: &Path) -> bool` — allowing tools to be tested with mock filesystems instead of real files.
-  `metadata` function L138-145 — `(&self, path: &Path) -> io::Result<FileMetadata>` — allowing tools to be tested with mock filesystems instead of real files.
-  `canonicalize` function L147-149 — `(&self, path: &Path) -> io::Result<PathBuf>` — allowing tools to be tested with mock filesystems instead of real files.
-  `MockFileSystem` type L169-173 — `impl Default for MockFileSystem` — allowing tools to be tested with mock filesystems instead of real files.
-  `default` function L170-172 — `() -> Self` — allowing tools to be tested with mock filesystems instead of real files.
-  `MockFileSystem` type L175-292 — `= MockFileSystem` — allowing tools to be tested with mock filesystems instead of real files.
-  `ensure_parent_dirs` function L259-275 — `(&self, path: &Path)` — Ensure parent directories exist.
-  `normalize_path` function L278-291 — `(&self, path: &Path) -> PathBuf` — Normalize a path for consistent lookups.
-  `MockFileSystem` type L295-443 — `impl FileSystem for MockFileSystem` — allowing tools to be tested with mock filesystems instead of real files.
-  `read_file` function L296-306 — `(&self, path: &Path) -> io::Result<String>` — allowing tools to be tested with mock filesystems instead of real files.
-  `read_file_bytes` function L308-318 — `(&self, path: &Path) -> io::Result<Vec<u8>>` — allowing tools to be tested with mock filesystems instead of real files.
-  `write_file` function L320-334 — `(&self, path: &Path, content: &str) -> io::Result<()>` — allowing tools to be tested with mock filesystems instead of real files.
-  `list_dir` function L336-386 — `(&self, path: &Path) -> io::Result<Vec<DirEntry>>` — allowing tools to be tested with mock filesystems instead of real files.
-  `exists` function L388-392 — `(&self, path: &Path) -> bool` — allowing tools to be tested with mock filesystems instead of real files.
-  `is_dir` function L394-397 — `(&self, path: &Path) -> bool` — allowing tools to be tested with mock filesystems instead of real files.
-  `is_file` function L399-402 — `(&self, path: &Path) -> bool` — allowing tools to be tested with mock filesystems instead of real files.
-  `metadata` function L404-427 — `(&self, path: &Path) -> io::Result<FileMetadata>` — allowing tools to be tested with mock filesystems instead of real files.
-  `canonicalize` function L429-442 — `(&self, path: &Path) -> io::Result<PathBuf>` — allowing tools to be tested with mock filesystems instead of real files.
-  `tests` module L457-625 — `-` — allowing tools to be tested with mock filesystems instead of real files.
-  `test_mock_fs_read_file` function L461-466 — `()` — allowing tools to be tested with mock filesystems instead of real files.
-  `test_mock_fs_read_file_not_found` function L469-475 — `()` — allowing tools to be tested with mock filesystems instead of real files.
-  `test_mock_fs_write_file` function L478-495 — `()` — allowing tools to be tested with mock filesystems instead of real files.
-  `test_mock_fs_exists` function L498-506 — `()` — allowing tools to be tested with mock filesystems instead of real files.
-  `test_mock_fs_is_file_is_dir` function L509-519 — `()` — allowing tools to be tested with mock filesystems instead of real files.
-  `test_mock_fs_metadata` function L522-529 — `()` — allowing tools to be tested with mock filesystems instead of real files.
-  `test_mock_fs_list_dir` function L532-545 — `()` — allowing tools to be tested with mock filesystems instead of real files.
-  `test_mock_fs_with_files` function L548-558 — `()` — allowing tools to be tested with mock filesystems instead of real files.
-  `test_mock_fs_canonicalize` function L561-571 — `()` — allowing tools to be tested with mock filesystems instead of real files.
-  `test_mock_fs_get_written_files` function L574-594 — `()` — allowing tools to be tested with mock filesystems instead of real files.
-  `test_mock_fs_builder_pattern` function L597-624 — `()` — allowing tools to be tested with mock filesystems instead of real files.

#### crates/muninn-rlm/src/fs_tools.rs

- pub `ReadFileTool` struct L40-49 — `{ fs: SharedFileSystem, root: PathBuf, max_size: usize, max_lines: usize }` — Tool for reading file contents.
- pub `new` function L55-62 — `(root: impl Into<PathBuf>) -> Self` — Create a new read_file tool rooted at the given directory.
- pub `with_fs` function L65-72 — `(root: impl Into<PathBuf>, fs: SharedFileSystem) -> Self` — Create a new read_file tool with a custom filesystem.
- pub `with_max_size` function L75-78 — `(mut self, bytes: usize) -> Self` — Set maximum file size.
- pub `with_max_lines` function L81-84 — `(mut self, lines: usize) -> Self` — Set maximum lines to return.
- pub `ListDirectoryTool` struct L337-344 — `{ fs: SharedFileSystem, root: PathBuf, max_entries: usize }` — Tool for listing directory contents.
- pub `new` function L348-354 — `(root: impl Into<PathBuf>) -> Self` — Create a new list_directory tool.
- pub `with_fs` function L357-363 — `(root: impl Into<PathBuf>, fs: SharedFileSystem) -> Self` — Create a new list_directory tool with a custom filesystem.
- pub `with_max_entries` function L366-369 — `(mut self, entries: usize) -> Self` — Set maximum entries to return.
- pub `SearchFilesTool` struct L653-662 — `{ fs: SharedFileSystem, root: PathBuf, max_results: usize, context_lines: usize ...` — Tool for searching file contents.
- pub `new` function L666-673 — `(root: impl Into<PathBuf>) -> Self` — Create a new search_files tool.
- pub `with_fs` function L676-683 — `(root: impl Into<PathBuf>, fs: SharedFileSystem) -> Self` — Create a new search_files tool with a custom filesystem.
- pub `with_max_results` function L686-689 — `(mut self, results: usize) -> Self` — Set maximum results.
- pub `with_context_lines` function L692-695 — `(mut self, lines: usize) -> Self` — Set context lines.
- pub `run_search` function L818-872 — `( &self, query: muninn_core::types::SearchQuery, ) -> std::result::Result<muninn...` — Public wrapper: search the working tree for a [`muninn_core::types::SearchQuery`]
- pub `FinalAnswerTool` struct L1043 — `-` — Tool for signaling completion with a final answer.
- pub `new` function L1047-1049 — `() -> Self` — Create a new final_answer tool.
- pub `create_fs_tools` function L1100-1108 — `(root: impl Into<PathBuf>) -> Vec<Box<dyn Tool>>` — Create all file system tools for a given root directory.
- pub `create_fs_tools_with_fs` function L1113-1124 — `( root: impl Into<PathBuf>, fs: SharedFileSystem, ) -> Vec<Box<dyn Tool>>` — Create all file system tools with a custom filesystem.
-  `language_to_glob` function L20-31 — `(lang: Option<&str>) -> Option<&'static str>` — Map a language tag (e.g.
-  `ReadFileTool` type L51-182 — `= ReadFileTool` — with mock filesystems.
-  `resolve_path` function L90-146 — `(&self, path: &str) -> Result<PathBuf>` — Resolve and validate a path.
-  `detect_language` function L149-181 — `(path: &Path) -> Option<String>` — Detect language from file extension.
-  `ReadFileTool` type L185-328 — `impl Tool for ReadFileTool` — with mock filesystems.
-  `name` function L186-188 — `(&self) -> &str` — with mock filesystems.
-  `description` function L190-192 — `(&self) -> &str` — with mock filesystems.
-  `is_internal` function L194-196 — `(&self) -> bool` — with mock filesystems.
-  `parameters_schema` function L198-217 — `(&self) -> serde_json::Value` — with mock filesystems.
-  `execute` function L219-327 — `(&self, params: serde_json::Value) -> Result<ToolResult>` — with mock filesystems.
-  `ListDirectoryTool` type L346-400 — `= ListDirectoryTool` — with mock filesystems.
-  `resolve_path` function L372-399 — `(&self, path: &str) -> Result<PathBuf>` — Resolve path safely.
-  `ListDirectoryTool` type L403-501 — `impl Tool for ListDirectoryTool` — with mock filesystems.
-  `name` function L404-406 — `(&self) -> &str` — with mock filesystems.
-  `description` function L408-410 — `(&self) -> &str` — with mock filesystems.
-  `is_internal` function L412-414 — `(&self) -> bool` — with mock filesystems.
-  `parameters_schema` function L416-435 — `(&self) -> serde_json::Value` — with mock filesystems.
-  `execute` function L437-500 — `(&self, params: serde_json::Value) -> Result<ToolResult>` — with mock filesystems.
-  `ListDirectoryTool` type L503-644 — `= ListDirectoryTool` — with mock filesystems.
-  `list_single` function L504-540 — `( &self, dir: &Path, pattern: Option<&str>, entries: &mut Vec<String>, ) -> Resu...` — with mock filesystems.
-  `list_recursive` function L542-549 — `( &self, dir: &Path, pattern: Option<&str>, entries: &mut Vec<String>, ) -> Resu...` — with mock filesystems.
-  `walk_dir` function L551-612 — `( &self, base: &Path, current: &Path, pattern: Option<&str>, entries: &mut Vec<S...` — with mock filesystems.
-  `matches_pattern` function L615-626 — `(name: &str, pattern: &str) -> bool` — Simple glob pattern matching.
-  `matches_simple` function L629-643 — `(name: &str, pattern: &str) -> bool` — Simple wildcard matching (* only).
-  `SearchFilesTool` type L664-888 — `= SearchFilesTool` — with mock filesystems.
-  `search_file` function L698-746 — `( &self, path: &Path, pattern: &regex::Regex, results: &mut Vec<SearchMatch>, ) ...` — Search a single file for matches.
-  `search_dir` function L749-804 — `( &self, dir: &Path, pattern: &regex::Regex, file_pattern: Option<&str>, results...` — Recursively search directory.
-  `is_likely_binary` function L875-887 — `(name: &str) -> bool` — Check if file is likely binary based on extension.
-  `SearchMatch` struct L891-895 — `{ path: String, line_number: usize, context: Vec<ContextLine> }` — with mock filesystems.
-  `ContextLine` struct L898-902 — `{ line_number: usize, content: String, is_match: bool }` — with mock filesystems.
-  `SearchFilesTool` type L905-1032 — `impl Tool for SearchFilesTool` — with mock filesystems.
-  `name` function L906-908 — `(&self) -> &str` — with mock filesystems.
-  `description` function L910-912 — `(&self) -> &str` — with mock filesystems.
-  `is_internal` function L914-916 — `(&self) -> bool` — with mock filesystems.
-  `parameters_schema` function L918-941 — `(&self) -> serde_json::Value` — with mock filesystems.
-  `execute` function L943-1031 — `(&self, params: serde_json::Value) -> Result<ToolResult>` — with mock filesystems.
-  `FinalAnswerTool` type L1045-1050 — `= FinalAnswerTool` — with mock filesystems.
-  `FinalAnswerTool` type L1052-1056 — `impl Default for FinalAnswerTool` — with mock filesystems.
-  `default` function L1053-1055 — `() -> Self` — with mock filesystems.
-  `FinalAnswerTool` type L1059-1091 — `impl Tool for FinalAnswerTool` — with mock filesystems.
-  `name` function L1060-1062 — `(&self) -> &str` — with mock filesystems.
-  `description` function L1064-1066 — `(&self) -> &str` — with mock filesystems.
-  `parameters_schema` function L1068-1079 — `(&self) -> serde_json::Value` — with mock filesystems.
-  `execute` function L1081-1090 — `(&self, input: serde_json::Value) -> Result<ToolResult>` — with mock filesystems.
-  `tests` module L1127-1366 — `-` — with mock filesystems.
-  `setup_test_dir` function L1132-1151 — `() -> TempDir` — with mock filesystems.
-  `test_read_file_tool` function L1154-1169 — `()` — with mock filesystems.
-  `test_read_file_with_line_range` function L1172-1189 — `()` — with mock filesystems.
-  `test_read_file_not_found` function L1192-1204 — `()` — with mock filesystems.
-  `test_read_file_path_traversal` function L1207-1219 — `()` — with mock filesystems.
-  `test_list_directory_tool` function L1222-1237 — `()` — with mock filesystems.
-  `test_list_directory_with_pattern` function L1240-1256 — `()` — with mock filesystems.
-  `test_list_directory_recursive` function L1259-1276 — `()` — with mock filesystems.
-  `test_search_files_tool` function L1279-1294 — `()` — with mock filesystems.
-  `test_search_files_with_file_pattern` function L1297-1312 — `()` — with mock filesystems.
-  `test_search_files_no_matches` function L1315-1328 — `()` — with mock filesystems.
-  `test_create_fs_tools` function L1331-1340 — `()` — with mock filesystems.
-  `test_language_detection` function L1343-1357 — `()` — with mock filesystems.
-  `test_pattern_matching` function L1360-1365 — `()` — with mock filesystems.

#### crates/muninn-rlm/src/graph_tools.rs

- pub `SharedGraphStore` type L16 — `= Arc<Mutex<GraphStore>>` — Thread-safe wrapper around GraphStore.
- pub `wrap_store` function L19-21 — `(store: GraphStore) -> SharedGraphStore` — Create a shared graph store from a GraphStore.
- pub `GraphQueryTool` struct L39-42 — `{ store: SharedGraphStore, max_results: usize }` — Tool for executing Cypher queries against the code graph.
- pub `new` function L46-51 — `(store: SharedGraphStore) -> Self` — Create a new graph query tool.
- pub `with_max_results` function L54-57 — `(mut self, max: usize) -> Self` — Set maximum results to return.
- pub `FindCallersTool` struct L148-150 — `{ store: SharedGraphStore }` — Tool for finding callers of a function or method.
- pub `new` function L154-156 — `(store: SharedGraphStore) -> Self` — Create a new find_callers tool.
- pub `FindImplementationsTool` struct L256-258 — `{ store: SharedGraphStore }` — Tool for finding implementations of a trait or interface.
- pub `new` function L262-264 — `(store: SharedGraphStore) -> Self` — Create a new find_implementations tool.
- pub `GetSymbolTool` struct L362-364 — `{ store: SharedGraphStore }` — Tool for getting details about a symbol.
- pub `new` function L368-370 — `(store: SharedGraphStore) -> Self` — Create a new get_symbol tool.
- pub `FindSymbolsTool` struct L467-470 — `{ store: SharedGraphStore, max_results: usize }` — Tool for searching symbols with user-friendly parameters.
- pub `new` function L474-479 — `(store: SharedGraphStore) -> Self` — Create a new find_symbols tool.
- pub `FindCalleesTool` struct L643-645 — `{ store: SharedGraphStore }` — Tool for finding functions called by a given function.
- pub `new` function L649-651 — `(store: SharedGraphStore) -> Self` — Create a new find_callees tool.
- pub `FileOutlineTool` struct L749-751 — `{ store: SharedGraphStore }` — Tool for getting an outline of symbols defined in a file.
- pub `new` function L755-757 — `(store: SharedGraphStore) -> Self` — Create a new file_outline tool.
- pub `FindUsagesTool` struct L833-835 — `{ store: SharedGraphStore }` — Tool for finding all usages/references to a symbol.
- pub `new` function L839-841 — `(store: SharedGraphStore) -> Self` — Create a new find_usages tool.
- pub `create_graph_tools` function L1049-1064 — `(store: SharedGraphStore) -> Vec<Box<dyn Tool>>` — Create all graph tools for a given store.
-  `lock_store` function L28-32 — `(store: &SharedGraphStore) -> Result<std::sync::MutexGuard<'_, GraphStore>>` — Acquire the graph store lock with consistent error handling.
-  `GraphQueryTool` type L44-58 — `= GraphQueryTool` — Cypher queries, finding callers/callees, and finding implementations.
-  `GraphQueryTool` type L61-141 — `impl Tool for GraphQueryTool` — Cypher queries, finding callers/callees, and finding implementations.
-  `name` function L62-64 — `(&self) -> &str` — Cypher queries, finding callers/callees, and finding implementations.
-  `description` function L66-70 — `(&self) -> &str` — Cypher queries, finding callers/callees, and finding implementations.
-  `parameters_schema` function L72-87 — `(&self) -> serde_json::Value` — Cypher queries, finding callers/callees, and finding implementations.
-  `execute` function L89-140 — `(&self, params: serde_json::Value) -> Result<ToolResult>` — Cypher queries, finding callers/callees, and finding implementations.
-  `FindCallersTool` type L152-157 — `= FindCallersTool` — Cypher queries, finding callers/callees, and finding implementations.
-  `FindCallersTool` type L160-249 — `impl Tool for FindCallersTool` — Cypher queries, finding callers/callees, and finding implementations.
-  `name` function L161-163 — `(&self) -> &str` — Cypher queries, finding callers/callees, and finding implementations.
-  `description` function L165-168 — `(&self) -> &str` — Cypher queries, finding callers/callees, and finding implementations.
-  `parameters_schema` function L170-184 — `(&self) -> serde_json::Value` — Cypher queries, finding callers/callees, and finding implementations.
-  `execute` function L186-248 — `(&self, params: serde_json::Value) -> Result<ToolResult>` — Cypher queries, finding callers/callees, and finding implementations.
-  `FindImplementationsTool` type L260-265 — `= FindImplementationsTool` — Cypher queries, finding callers/callees, and finding implementations.
-  `FindImplementationsTool` type L268-355 — `impl Tool for FindImplementationsTool` — Cypher queries, finding callers/callees, and finding implementations.
-  `name` function L269-271 — `(&self) -> &str` — Cypher queries, finding callers/callees, and finding implementations.
-  `description` function L273-275 — `(&self) -> &str` — Cypher queries, finding callers/callees, and finding implementations.
-  `parameters_schema` function L277-291 — `(&self) -> serde_json::Value` — Cypher queries, finding callers/callees, and finding implementations.
-  `execute` function L293-354 — `(&self, params: serde_json::Value) -> Result<ToolResult>` — Cypher queries, finding callers/callees, and finding implementations.
-  `GetSymbolTool` type L366-371 — `= GetSymbolTool` — Cypher queries, finding callers/callees, and finding implementations.
-  `GetSymbolTool` type L374-457 — `impl Tool for GetSymbolTool` — Cypher queries, finding callers/callees, and finding implementations.
-  `name` function L375-377 — `(&self) -> &str` — Cypher queries, finding callers/callees, and finding implementations.
-  `description` function L379-382 — `(&self) -> &str` — Cypher queries, finding callers/callees, and finding implementations.
-  `parameters_schema` function L384-398 — `(&self) -> serde_json::Value` — Cypher queries, finding callers/callees, and finding implementations.
-  `execute` function L400-456 — `(&self, params: serde_json::Value) -> Result<ToolResult>` — Cypher queries, finding callers/callees, and finding implementations.
-  `FindSymbolsTool` type L472-480 — `= FindSymbolsTool` — Cypher queries, finding callers/callees, and finding implementations.
-  `FindSymbolsTool` type L483-636 — `impl Tool for FindSymbolsTool` — Cypher queries, finding callers/callees, and finding implementations.
-  `name` function L484-486 — `(&self) -> &str` — Cypher queries, finding callers/callees, and finding implementations.
-  `description` function L488-492 — `(&self) -> &str` — Cypher queries, finding callers/callees, and finding implementations.
-  `parameters_schema` function L494-518 — `(&self) -> serde_json::Value` — Cypher queries, finding callers/callees, and finding implementations.
-  `execute` function L520-635 — `(&self, params: serde_json::Value) -> Result<ToolResult>` — Cypher queries, finding callers/callees, and finding implementations.
-  `FindCalleesTool` type L647-652 — `= FindCalleesTool` — Cypher queries, finding callers/callees, and finding implementations.
-  `FindCalleesTool` type L655-742 — `impl Tool for FindCalleesTool` — Cypher queries, finding callers/callees, and finding implementations.
-  `name` function L656-658 — `(&self) -> &str` — Cypher queries, finding callers/callees, and finding implementations.
-  `description` function L660-663 — `(&self) -> &str` — Cypher queries, finding callers/callees, and finding implementations.
-  `parameters_schema` function L665-679 — `(&self) -> serde_json::Value` — Cypher queries, finding callers/callees, and finding implementations.
-  `execute` function L681-741 — `(&self, params: serde_json::Value) -> Result<ToolResult>` — Cypher queries, finding callers/callees, and finding implementations.
-  `FileOutlineTool` type L753-758 — `= FileOutlineTool` — Cypher queries, finding callers/callees, and finding implementations.
-  `FileOutlineTool` type L761-826 — `impl Tool for FileOutlineTool` — Cypher queries, finding callers/callees, and finding implementations.
-  `name` function L762-764 — `(&self) -> &str` — Cypher queries, finding callers/callees, and finding implementations.
-  `description` function L766-770 — `(&self) -> &str` — Cypher queries, finding callers/callees, and finding implementations.
-  `parameters_schema` function L772-783 — `(&self) -> serde_json::Value` — Cypher queries, finding callers/callees, and finding implementations.
-  `execute` function L785-825 — `(&self, params: serde_json::Value) -> Result<ToolResult>` — Cypher queries, finding callers/callees, and finding implementations.
-  `FindUsagesTool` type L837-842 — `= FindUsagesTool` — Cypher queries, finding callers/callees, and finding implementations.
-  `FindUsagesTool` type L845-955 — `impl Tool for FindUsagesTool` — Cypher queries, finding callers/callees, and finding implementations.
-  `name` function L846-848 — `(&self) -> &str` — Cypher queries, finding callers/callees, and finding implementations.
-  `description` function L850-853 — `(&self) -> &str` — Cypher queries, finding callers/callees, and finding implementations.
-  `parameters_schema` function L855-869 — `(&self) -> serde_json::Value` — Cypher queries, finding callers/callees, and finding implementations.
-  `execute` function L871-954 — `(&self, params: serde_json::Value) -> Result<ToolResult>` — Cypher queries, finding callers/callees, and finding implementations.
-  `format_symbol_value` function L962-1000 — `(value: &Value) -> serde_json::Value` — Format a symbol Value into a user-friendly JSON object.
-  `extract_id_from_value` function L1005-1025 — `(value: &Value) -> Option<String>` — Extract or reconstruct the node ID from a Value::Object.
-  `value_to_json` function L1028-1046 — `(value: &Value) -> serde_json::Value` — Convert a graphqlite Value to a serde_json Value.
-  `tests` module L1067-1300 — `-` — Cypher queries, finding callers/callees, and finding implementations.
-  `create_test_symbol` function L1072-1084 — `(name: &str, kind: SymbolKind) -> Symbol` — Cypher queries, finding callers/callees, and finding implementations.
-  `setup_test_store` function L1086-1112 — `() -> SharedGraphStore` — Cypher queries, finding callers/callees, and finding implementations.
-  `test_create_graph_tools` function L1116-1130 — `()` — Cypher queries, finding callers/callees, and finding implementations.
-  `test_graph_query_tool` function L1134-1148 — `()` — Cypher queries, finding callers/callees, and finding implementations.
-  `test_graph_query_invalid` function L1152-1164 — `()` — Cypher queries, finding callers/callees, and finding implementations.
-  `test_find_callers_tool` function L1168-1183 — `()` — Cypher queries, finding callers/callees, and finding implementations.
-  `test_find_callers_not_found` function L1187-1200 — `()` — Cypher queries, finding callers/callees, and finding implementations.
-  `test_find_implementations_tool` function L1204-1219 — `()` — Cypher queries, finding callers/callees, and finding implementations.
-  `test_get_symbol_tool` function L1223-1237 — `()` — Cypher queries, finding callers/callees, and finding implementations.
-  `test_get_symbol_not_found` function L1241-1254 — `()` — Cypher queries, finding callers/callees, and finding implementations.
-  `test_value_to_json` function L1257-1266 — `()` — Cypher queries, finding callers/callees, and finding implementations.
-  `test_extract_id_from_value` function L1269-1299 — `()` — Cypher queries, finding callers/callees, and finding implementations.

#### crates/muninn-rlm/src/groq.rs

- pub `GroqConfig` struct L33-51 — `{ api_key: String, base_url: String, model: String, timeout: Duration, max_retri...` — Configuration for the Groq backend.
- pub `new` function L55-64 — `(api_key: impl Into<String>) -> Self` — Create a new config with the given API key.
- pub `with_model` function L67-70 — `(mut self, model: impl Into<String>) -> Self` — Set the model to use.
- pub `from_env` function L73-78 — `() -> Result<Self>` — Create config from environment variable.
- pub `with_base_url` function L81-84 — `(mut self, url: impl Into<String>) -> Self` — Set a custom base URL.
- pub `with_timeout` function L87-90 — `(mut self, timeout: Duration) -> Self` — Set request timeout.
- pub `with_max_retries` function L93-96 — `(mut self, retries: u32) -> Self` — Set max retries.
- pub `GroqBackend` struct L100-103 — `{ client: Client, config: GroqConfig }` — Groq API backend.
- pub `new` function L107-114 — `(config: GroqConfig) -> Result<Self>` — Create a new Groq backend with the given configuration.
- pub `from_env` function L117-119 — `() -> Result<Self>` — Create a backend from environment configuration.
- pub `create_shared_backend` function L720-722 — `(config: GroqConfig) -> Result<Arc<dyn LLMBackend>>` — Create a shared Groq backend.
-  `DEFAULT_API_BASE` variable L23 — `: &str` — Default Groq API base URL.
-  `DEFAULT_TIMEOUT_SECS` variable L26 — `: u64` — Default timeout for requests.
-  `DEFAULT_MODEL` variable L29 — `: &str` — Default model for Groq backend.
-  `GroqConfig` type L53-97 — `= GroqConfig` — OpenAI-compatible API for fast LLM inference.
-  `GroqBackend` type L105-333 — `= GroqBackend` — OpenAI-compatible API for fast LLM inference.
-  `completions_url` function L122-124 — `(&self) -> String` — Build the chat completions endpoint URL.
-  `add_headers` function L127-134 — `(&self, builder: reqwest::RequestBuilder) -> reqwest::RequestBuilder` — Add authentication headers to a request.
-  `to_groq_request` function L137-302 — `(&self, request: &CompletionRequest) -> GroqChatRequest` — Convert our CompletionRequest to Groq's OpenAI-compatible format.
-  `handle_response` function L305-315 — `(response: Response) -> Result<CompletionResponse>` — Handle a successful response.
-  `handle_error_response` function L318-332 — `(response: Response) -> RlmError` — Handle an error response.
-  `GroqBackend` type L336-418 — `impl LLMBackend for GroqBackend` — OpenAI-compatible API for fast LLM inference.
-  `complete` function L337-378 — `(&self, request: CompletionRequest) -> Result<CompletionResponse>` — OpenAI-compatible API for fast LLM inference.
-  `complete_stream` function L380-397 — `(&self, request: CompletionRequest) -> Result<ResponseStream>` — OpenAI-compatible API for fast LLM inference.
-  `name` function L399-401 — `(&self) -> &str` — OpenAI-compatible API for fast LLM inference.
-  `health_check` function L403-412 — `(&self) -> Result<()>` — OpenAI-compatible API for fast LLM inference.
-  `supports_native_tools` function L415-417 — `(&self) -> bool` — Groq supports native tool calling via their OpenAI-compatible API.
-  `GroqChatRequest` struct L425-444 — `{ model: String, messages: Vec<GroqMessage>, max_completion_tokens: Option<u32>,...` — OpenAI-compatible API for fast LLM inference.
-  `GroqMessage` struct L447-455 — `{ role: String, content: Option<String>, tool_calls: Option<Vec<GroqToolCall>>, ...` — OpenAI-compatible API for fast LLM inference.
-  `GroqTool` struct L458-462 — `{ tool_type: String, function: GroqFunction }` — OpenAI-compatible API for fast LLM inference.
-  `GroqFunction` struct L465-470 — `{ name: String, description: Option<String>, parameters: serde_json::Value }` — OpenAI-compatible API for fast LLM inference.
-  `GroqToolCall` struct L473-478 — `{ id: String, call_type: String, function: GroqFunctionCall }` — OpenAI-compatible API for fast LLM inference.
-  `GroqFunctionCall` struct L481-484 — `{ name: String, arguments: String }` — OpenAI-compatible API for fast LLM inference.
-  `GroqChatResponse` struct L487-492 — `{ id: String, choices: Vec<GroqChoice>, model: String, usage: GroqUsage }` — OpenAI-compatible API for fast LLM inference.
-  `CompletionResponse` type L494-553 — `= CompletionResponse` — OpenAI-compatible API for fast LLM inference.
-  `from` function L495-552 — `(resp: GroqChatResponse) -> Self` — OpenAI-compatible API for fast LLM inference.
-  `GroqChoice` struct L556-559 — `{ message: GroqResponseMessage, finish_reason: Option<String> }` — OpenAI-compatible API for fast LLM inference.
-  `GroqResponseMessage` struct L562-565 — `{ content: Option<String>, tool_calls: Option<Vec<GroqToolCall>> }` — OpenAI-compatible API for fast LLM inference.
-  `GroqUsage` struct L568-571 — `{ prompt_tokens: u32, completion_tokens: u32 }` — OpenAI-compatible API for fast LLM inference.
-  `GroqErrorResponse` struct L574-576 — `{ error: GroqError }` — OpenAI-compatible API for fast LLM inference.
-  `GroqError` struct L579-581 — `{ message: String }` — OpenAI-compatible API for fast LLM inference.
-  `parse_groq_sse_stream` function L587-689 — `( byte_stream: impl Stream<Item = reqwest::Result<Bytes>> + Send + 'static, ) ->...` — OpenAI-compatible API for fast LLM inference.
-  `GroqSseState` struct L691-699 — `{ byte_stream: Pin<Box<dyn Stream<Item = reqwest::Result<Bytes>> + Send>>, buffe...` — OpenAI-compatible API for fast LLM inference.
-  `GroqStreamChunk` struct L702-706 — `{ id: String, model: String, choices: Vec<GroqStreamChoice> }` — OpenAI-compatible API for fast LLM inference.
-  `GroqStreamChoice` struct L709-712 — `{ delta: Option<GroqStreamDelta>, finish_reason: Option<String> }` — OpenAI-compatible API for fast LLM inference.
-  `GroqStreamDelta` struct L715-717 — `{ content: Option<String> }` — OpenAI-compatible API for fast LLM inference.
-  `tests` module L725-859 — `-` — OpenAI-compatible API for fast LLM inference.
-  `test_config_new` function L729-733 — `()` — OpenAI-compatible API for fast LLM inference.
-  `test_config_with_base_url` function L736-739 — `()` — OpenAI-compatible API for fast LLM inference.
-  `test_config_with_timeout` function L742-745 — `()` — OpenAI-compatible API for fast LLM inference.
-  `test_completions_url` function L748-755 — `()` — OpenAI-compatible API for fast LLM inference.
-  `test_backend_name` function L758-762 — `()` — OpenAI-compatible API for fast LLM inference.
-  `test_is_retryable` function L765-769 — `()` — OpenAI-compatible API for fast LLM inference.
-  `test_groq_response_conversion` function L772-795 — `()` — OpenAI-compatible API for fast LLM inference.
-  `test_groq_response_with_tool_calls` function L798-829 — `()` — OpenAI-compatible API for fast LLM inference.
-  `test_to_groq_request_request_model_wins_over_default` function L832-847 — `()` — OpenAI-compatible API for fast LLM inference.
-  `test_to_groq_request_falls_back_to_default_when_request_model_empty` function L850-858 — `()` — OpenAI-compatible API for fast LLM inference.

#### crates/muninn-rlm/src/lib.rs

- pub `anthropic` module L10 — `-` — This crate provides the Recursive Language Model gateway for Muninn:
- pub `backend` module L11 — `-` — - Sub-query spawning with context isolation
- pub `context` module L12 — `-` — - Sub-query spawning with context isolation
- pub `doc_tools` module L13 — `-` — - Sub-query spawning with context isolation
- pub `engine` module L14 — `-` — - Sub-query spawning with context isolation
- pub `error` module L15 — `-` — - Sub-query spawning with context isolation
- pub `fs` module L16 — `-` — - Sub-query spawning with context isolation
- pub `fs_tools` module L17 — `-` — - Sub-query spawning with context isolation
- pub `graph_tools` module L18 — `-` — - Sub-query spawning with context isolation
- pub `groq` module L19 — `-` — - Sub-query spawning with context isolation
- pub `mcp` module L20 — `-` — - Sub-query spawning with context isolation
- pub `mcp_engine_server` module L21 — `-` — - Sub-query spawning with context isolation
- pub `oauth` module L22 — `-` — - Sub-query spawning with context isolation
- pub `ollama` module L23 — `-` — - Sub-query spawning with context isolation
- pub `passthrough` module L24 — `-` — - Sub-query spawning with context isolation
- pub `prompts` module L25 — `-` — - Sub-query spawning with context isolation
- pub `proxy` module L26 — `-` — - Sub-query spawning with context isolation
- pub `repl_tools` module L27 — `-` — - Sub-query spawning with context isolation
- pub `router` module L28 — `-` — - Sub-query spawning with context isolation
- pub `subquery` module L29 — `-` — - Sub-query spawning with context isolation
- pub `token_manager` module L30 — `-` — - Sub-query spawning with context isolation
- pub `tools` module L31 — `-` — - Sub-query spawning with context isolation
- pub `types` module L32 — `-` — - Sub-query spawning with context isolation
- pub `testing` module L36 — `-` — - Sub-query spawning with context isolation
- pub `daemon` module L100-102 — `-` — Local-IPC engine daemon — server, client, and socket-path helpers.

#### crates/muninn-rlm/src/mcp.rs

- pub `McpServerConfig` struct L32-39 — `{ name: String, version: String, instructions: Option<String> }` — Configuration for the MCP server.
- pub `new` function L53-58 — `(name: impl Into<String>) -> Self` — Create a new configuration with the given name.
- pub `with_version` function L61-64 — `(mut self, version: impl Into<String>) -> Self` — Set the server version.
- pub `with_instructions` function L67-70 — `(mut self, instructions: impl Into<String>) -> Self` — Set instructions for the LLM.
- pub `RlmServerHandler` struct L78-80 — `{ tools: Arc<dyn ToolEnvironment> }` — MCP server handler that bridges `ToolEnvironment` to MCP protocol.
- pub `new` function L84-87 — `(tools: Arc<dyn ToolEnvironment>) -> Self` — Create a new handler with the given tool environment.
- pub `run_mcp_server` function L179-223 — `( tools: Arc<dyn ToolEnvironment>, config: McpServerConfig, ) -> Result<()>` — Run an MCP server on stdio transport with the given tool environment.
-  `McpServerConfig` type L41-49 — `impl Default for McpServerConfig` — Uses `rust-mcp-sdk` for protocol handling.
-  `default` function L42-48 — `() -> Self` — Uses `rust-mcp-sdk` for protocol handling.
-  `McpServerConfig` type L51-71 — `= McpServerConfig` — Uses `rust-mcp-sdk` for protocol handling.
-  `RlmServerHandler` type L82-88 — `= RlmServerHandler` — Uses `rust-mcp-sdk` for protocol handling.
-  `RlmServerHandler` type L91-172 — `impl ServerHandler for RlmServerHandler` — Uses `rust-mcp-sdk` for protocol handling.
-  `handle_list_tools_request` function L92-129 — `( &self, _params: Option<PaginatedRequestParams>, _runtime: Arc<dyn McpServer>, ...` — Uses `rust-mcp-sdk` for protocol handling.
-  `handle_call_tool_request` function L131-171 — `( &self, params: CallToolRequestParams, _runtime: Arc<dyn McpServer>, ) -> std::...` — Uses `rust-mcp-sdk` for protocol handling.
-  `tests` module L230-273 — `-` — Uses `rust-mcp-sdk` for protocol handling.
-  `mock_env` function L236-248 — `() -> Arc<dyn ToolEnvironment>` — Uses `rust-mcp-sdk` for protocol handling.
-  `test_config_default` function L251-255 — `()` — Uses `rust-mcp-sdk` for protocol handling.
-  `test_config_builder` function L258-266 — `()` — Uses `rust-mcp-sdk` for protocol handling.
-  `test_handler_creation` function L269-272 — `()` — Uses `rust-mcp-sdk` for protocol handling.

#### crates/muninn-rlm/src/mcp_engine_server.rs

- pub `EngineServerHandler` struct L43-45 — `{ engine: SharedEngine }` — MCP server handler that bridges a [`MuninnEngine`] to MCP protocol.
- pub `new` function L49-51 — `(engine: SharedEngine) -> Self` — Create a new handler wrapping the given engine.
- pub `run_engine_mcp_server` function L170-218 — `(engine: SharedEngine) -> Result<()>` — Run a stdio MCP server backed by the given engine.
-  `EngineServerHandler` type L47-52 — `= EngineServerHandler` — servers solve different problems and run independently.
-  `tool_error` function L58-65 — `(message: impl Into<String>) -> CallToolResult` — Helper: convert any engine error to an MCP tool error response.
-  `tool_ok` function L73-85 — `(value: Value) -> CallToolResult` — Helper: convert a successful JSON result into a tool success.
-  `EngineServerHandler` type L88-163 — `impl ServerHandler for EngineServerHandler` — servers solve different problems and run independently.
-  `handle_list_tools_request` function L89-122 — `( &self, _params: Option<PaginatedRequestParams>, _runtime: Arc<dyn McpServer>, ...` — servers solve different problems and run independently.
-  `handle_call_tool_request` function L124-162 — `( &self, params: CallToolRequestParams, _runtime: Arc<dyn McpServer>, ) -> std::...` — servers solve different problems and run independently.
-  `tests` module L221-322 — `-` — servers solve different problems and run independently.
-  `StubEngine` struct L231 — `-` — Stub engine whose search_code returns a fixed hit so we can
-  `StubEngine` type L234-261 — `impl MuninnEngine for StubEngine` — servers solve different problems and run independently.
-  `complete` function L235-239 — `(&self, _r: CompletionRequest) -> CoreResult<CompletionResponse>` — servers solve different problems and run independently.
-  `search_code` function L240-249 — `(&self, q: SearchQuery) -> CoreResult<SearchResult>` — servers solve different problems and run independently.
-  `explore` function L250-254 — `(&self, _r: ExploreRequest) -> CoreResult<ExploreResult>` — servers solve different problems and run independently.
-  `query_graph` function L255-260 — `(&self, _q: GraphQuery) -> CoreResult<GraphResult>` — servers solve different problems and run independently.
-  `handler` function L263-265 — `() -> EngineServerHandler` — servers solve different problems and run independently.
-  `list_tools_returns_curated_set` function L268-281 — `()` — servers solve different problems and run independently.
-  `dispatch_search_code_roundtrips_result` function L284-300 — `()` — servers solve different problems and run independently.
-  `tool_ok_serializes_pretty_and_carries_structured_content` function L303-308 — `()` — servers solve different problems and run independently.
-  `tool_ok_drops_structured_content_for_non_objects` function L311-315 — `()` — servers solve different problems and run independently.
-  `tool_error_marks_is_error_true` function L318-321 — `()` — servers solve different problems and run independently.

#### crates/muninn-rlm/src/oauth.rs

- pub `OAuthConfig` struct L16-27 — `{ client_id: String, authorize_url: String, token_url: String, redirect_uri: Str...` — OAuth configuration for Anthropic MAX plan.
- pub `anthropic_max` function L37-45 — `() -> Self` — Create OAuth config for Anthropic MAX plan.
- pub `PkceChallenge` struct L50-55 — `{ verifier: String, challenge: String }` — PKCE code verifier and challenge pair.
- pub `generate` function L59-75 — `() -> Self` — Generate a new PKCE challenge pair.
- pub `generate_state` function L79-83 — `() -> String` — Generate a random state string for CSRF protection.
- pub `build_authorization_url` function L86-105 — `(config: &OAuthConfig, challenge: &str, state: &str) -> String` — Build the authorization URL for the OAuth flow.
- pub `OAuthTokens` struct L109-126 — `{ access_token: String, refresh_token: String, expires_in: u64, token_type: Stri...` — OAuth tokens returned from token exchange.
- pub `exchange_code_for_tokens` function L148-197 — `( config: &OAuthConfig, code: &str, verifier: &str, state: &str, ) -> Result<OAu...` — Exchange an authorization code for OAuth tokens.
- pub `refresh_access_token` function L200-244 — `( config: &OAuthConfig, refresh_token: &str, ) -> Result<OAuthTokens>` — Refresh an access token using a refresh token.
- pub `parse_code_state` function L247-263 — `(input: &str) -> Result<(String, String)>` — Parse the code#state response from the OAuth callback.
-  `OAuthConfig` type L29-33 — `impl Default for OAuthConfig` — for authenticating with Anthropic's MAX plan API.
-  `default` function L30-32 — `() -> Self` — for authenticating with Anthropic's MAX plan API.
-  `OAuthConfig` type L35-46 — `= OAuthConfig` — for authenticating with Anthropic's MAX plan API.
-  `PkceChallenge` type L57-76 — `= PkceChallenge` — for authenticating with Anthropic's MAX plan API.
-  `TokenExchangeRequest` struct L130-137 — `{ code: String, state: String, grant_type: String, client_id: String, redirect_u...` — Request body for token exchange.
-  `TokenRefreshRequest` struct L141-145 — `{ grant_type: String, client_id: String, refresh_token: String }` — Request body for token refresh.
-  `tests` module L266-326 — `-` — for authenticating with Anthropic's MAX plan API.
-  `test_pkce_generation` function L270-276 — `()` — for authenticating with Anthropic's MAX plan API.
-  `test_state_generation` function L279-285 — `()` — for authenticating with Anthropic's MAX plan API.
-  `test_authorization_url` function L288-297 — `()` — for authenticating with Anthropic's MAX plan API.
-  `test_parse_code_state_valid` function L300-304 — `()` — for authenticating with Anthropic's MAX plan API.
-  `test_parse_code_state_with_whitespace` function L307-311 — `()` — for authenticating with Anthropic's MAX plan API.
-  `test_parse_code_state_invalid` function L314-318 — `()` — for authenticating with Anthropic's MAX plan API.
-  `test_oauth_config_default` function L321-325 — `()` — for authenticating with Anthropic's MAX plan API.

#### crates/muninn-rlm/src/ollama.rs

- pub `OllamaConfig` struct L28-50 — `{ base_url: String, api_key: Option<String>, model: String, timeout: Duration, m...` — Configuration for the Ollama backend.
- pub `new` function L67-69 — `() -> Self` — Create a new config with defaults.
- pub `with_model` function L72-75 — `(mut self, model: impl Into<String>) -> Self` — Set the model to use.
- pub `with_base_url` function L78-81 — `(mut self, url: impl Into<String>) -> Self` — Set a custom base URL.
- pub `with_timeout` function L84-87 — `(mut self, timeout: Duration) -> Self` — Set request timeout.
- pub `with_max_retries` function L90-93 — `(mut self, retries: u32) -> Self` — Set max retries.
- pub `with_api_key` function L96-99 — `(mut self, api_key: impl Into<String>) -> Self` — Set the API key (required for Ollama Cloud).
- pub `cloud` function L102-106 — `(api_key: impl Into<String>) -> Self` — Configuration preset for Ollama Cloud.
- pub `local` function L109-111 — `() -> Self` — Configuration preset for local Ollama.
- pub `OllamaBackend` struct L115-118 — `{ client: Client, config: OllamaConfig }` — Ollama API backend.
- pub `new` function L122-129 — `(config: OllamaConfig) -> Result<Self>` — Create a new Ollama backend with the given configuration.
-  `DEFAULT_API_BASE` variable L17 — `: &str` — Default Ollama API base URL (local).
-  `DEFAULT_TIMEOUT_SECS` variable L20 — `: u64` — Default timeout for requests (longer for local inference).
-  `DEFAULT_MODEL` variable L24 — `: &str` — Default model for Ollama backend.
-  `OllamaConfig` type L52-63 — `impl Default for OllamaConfig` — OpenAI-compatible API for local LLM inference.
-  `default` function L53-62 — `() -> Self` — OpenAI-compatible API for local LLM inference.
-  `OllamaConfig` type L65-112 — `= OllamaConfig` — OpenAI-compatible API for local LLM inference.
-  `OllamaBackend` type L120-384 — `= OllamaBackend` — OpenAI-compatible API for local LLM inference.
-  `completions_url` function L132-134 — `(&self) -> String` — Build the chat completions endpoint URL.
-  `add_headers` function L137-144 — `(&self, builder: reqwest::RequestBuilder) -> reqwest::RequestBuilder` — Add headers to a request.
-  `to_ollama_request` function L147-284 — `(&self, request: &CompletionRequest) -> OllamaChatRequest` — Convert our CompletionRequest to Ollama's OpenAI-compatible format.
-  `parse_response` function L287-347 — `(&self, response: OllamaChatResponse) -> CompletionResponse` — Parse Ollama response into our format.
-  `send_request` function L350-383 — `(&self, request: &CompletionRequest) -> Result<CompletionResponse>` — Make a non-streaming request.
-  `OllamaBackend` type L387-439 — `impl LLMBackend for OllamaBackend` — OpenAI-compatible API for local LLM inference.
-  `complete` function L388-396 — `(&self, request: CompletionRequest) -> Result<CompletionResponse>` — OpenAI-compatible API for local LLM inference.
-  `complete_stream` function L398-416 — `(&self, request: CompletionRequest) -> Result<ResponseStream>` — OpenAI-compatible API for local LLM inference.
-  `name` function L418-420 — `(&self) -> &str` — OpenAI-compatible API for local LLM inference.
-  `health_check` function L422-433 — `(&self) -> Result<()>` — OpenAI-compatible API for local LLM inference.
-  `supports_native_tools` function L435-438 — `(&self) -> bool` — OpenAI-compatible API for local LLM inference.
-  `OllamaChatRequest` struct L446-457 — `{ model: String, messages: Vec<OllamaMessage>, max_tokens: Option<u32>, temperat...` — OpenAI-compatible API for local LLM inference.
-  `OllamaMessage` struct L460-468 — `{ role: String, content: Option<String>, tool_calls: Option<Vec<OllamaToolCall>>...` — OpenAI-compatible API for local LLM inference.
-  `OllamaToolCall` struct L471-476 — `{ id: String, call_type: String, function: OllamaFunctionCall }` — OpenAI-compatible API for local LLM inference.
-  `OllamaFunctionCall` struct L479-482 — `{ name: String, arguments: String }` — OpenAI-compatible API for local LLM inference.
-  `OllamaTool` struct L485-489 — `{ tool_type: String, function: OllamaFunction }` — OpenAI-compatible API for local LLM inference.
-  `OllamaFunction` struct L492-496 — `{ name: String, description: Option<String>, parameters: serde_json::Value }` — OpenAI-compatible API for local LLM inference.
-  `OllamaChatResponse` struct L499-504 — `{ id: String, model: String, choices: Vec<OllamaChoice>, usage: Option<OllamaUsa...` — OpenAI-compatible API for local LLM inference.
-  `OllamaChoice` struct L507-510 — `{ message: OllamaMessage, finish_reason: Option<String> }` — OpenAI-compatible API for local LLM inference.
-  `OllamaUsage` struct L513-516 — `{ prompt_tokens: u32, completion_tokens: u32 }` — OpenAI-compatible API for local LLM inference.
-  `tests` module L519-553 — `-` — OpenAI-compatible API for local LLM inference.
-  `test_config_defaults` function L523-528 — `()` — OpenAI-compatible API for local LLM inference.
-  `test_config_builder` function L531-538 — `()` — OpenAI-compatible API for local LLM inference.
-  `test_cloud_preset` function L541-545 — `()` — OpenAI-compatible API for local LLM inference.
-  `test_local_preset_keyless` function L548-552 — `()` — OpenAI-compatible API for local LLM inference.

#### crates/muninn-rlm/src/passthrough.rs

- pub `ApiProvider` enum L23-30 — `Anthropic | OpenAI | Custom` — Known API providers with their default configurations.
- pub `ANTHROPIC_API_URL` variable L33 — `: &str` — Default Anthropic API base URL.
- pub `OPENAI_API_URL` variable L35 — `: &str` — Default OpenAI API base URL.
- pub `ANTHROPIC_VERSION` variable L38 — `: &str` — Anthropic API version header value.
- pub `ANTHROPIC_BETA` variable L40 — `: &str` — Required anthropic-beta header for OAuth/MAX plan.
- pub `CLAUDE_CODE_SYSTEM_PROMPT` variable L44-45 — `: &str` — Required system prompt text for Claude Code with MAX plan.
- pub `AuthMode` enum L49-56 — `ApiKey | OAuth | OAuthWithFallback` — Authentication mode for passthrough requests.
- pub `PassthroughConfig` struct L60-75 — `{ base_url: String, provider: ApiProvider, messages_path: String, auth_header: S...` — Configuration for the passthrough client.
- pub `anthropic` function L79-95 — `() -> Self` — Create config for Anthropic API with API key auth.
- pub `anthropic_oauth` function L98-115 — `() -> Self` — Create config for Anthropic API with OAuth (MAX plan).
- pub `openai` function L118-128 — `() -> Self` — Create config for OpenAI-compatible API.
- pub `custom` function L131-141 — `(base_url: impl Into<String>) -> Self` — Create config for a custom endpoint.
- pub `with_base_url` function L144-147 — `(mut self, url: impl Into<String>) -> Self` — Set the base URL.
- pub `with_messages_path` function L150-153 — `(mut self, path: impl Into<String>) -> Self` — Set the messages endpoint path.
- pub `with_auth_header` function L156-159 — `(mut self, header: impl Into<String>) -> Self` — Set the auth header name.
- pub `with_header` function L162-165 — `(mut self, key: impl Into<String>, value: impl Into<String>) -> Self` — Add an extra header.
- pub `with_auth_mode` function L168-171 — `(mut self, mode: AuthMode) -> Self` — Set the authentication mode.
- pub `with_system_prompt_injection` function L174-177 — `(mut self, inject: bool) -> Self` — Enable or disable system prompt injection.
- pub `Passthrough` struct L189-194 — `{ client: Client, config: PassthroughConfig, token_manager: Option<SharedTokenMa...` — Passthrough client for forwarding requests to upstream APIs.
- pub `new` function L208-210 — `() -> Self` — Create a new passthrough client with default config (OAuth mode).
- pub `anthropic` function L213-215 — `() -> Self` — Create a new passthrough client for Anthropic with API key auth.
- pub `anthropic_oauth` function L218-220 — `() -> Self` — Create a new passthrough client for Anthropic with OAuth (MAX plan).
- pub `with_config` function L223-229 — `(config: PassthroughConfig) -> Self` — Create a new passthrough client with custom config.
- pub `with_token_manager` function L232-235 — `(mut self, manager: SharedTokenManager) -> Self` — Set the token manager for OAuth authentication.
- pub `with_base_url` function L238-240 — `(base_url: impl Into<String>) -> Self` — Create with a custom base URL (convenience method).
- pub `config` function L243-245 — `(&self) -> &PassthroughConfig` — Get the config.
- pub `token_manager` function L248-250 — `(&self) -> Option<&SharedTokenManager>` — Get the token manager if set.
- pub `forward` function L257-305 — `( &self, request: &CompletionRequest, api_key: Option<&str>, ) -> Result<Complet...` — Forward a completion request to the upstream API.
- pub `forward_raw` function L315-409 — `( &self, request: serde_json::Value, api_key: Option<&str>, ) -> Result<serde_js...` — Forward a raw JSON request to the upstream API.
- pub `forward_raw_stream` function L414-492 — `( &self, request: serde_json::Value, api_key: Option<&str>, ) -> Result<reqwest:...` — Forward a raw JSON streaming request to the upstream API.
- pub `AnthropicPassthrough` type L585 — `= Passthrough` — - Uses Bearer token authentication
- pub `SystemMessage` struct L726-735 — `{ msg_type: String, text: String, cache_control: Option<CacheControl> }` — System message structure for Anthropic API.
- pub `text` function L739-745 — `(content: impl Into<String>) -> Self` — Create a text system message.
- pub `text_with_cache` function L748-754 — `(content: impl Into<String>) -> Self` — Create a text system message with ephemeral cache control.
- pub `CacheControl` struct L759-763 — `{ cache_type: String }` — Cache control for system messages.
- pub `ephemeral` function L767-771 — `() -> Self` — Create ephemeral cache control.
-  `PassthroughConfig` type L77-178 — `= PassthroughConfig` — - Uses Bearer token authentication
-  `PassthroughConfig` type L180-185 — `impl Default for PassthroughConfig` — - Uses Bearer token authentication
-  `default` function L181-184 — `() -> Self` — - Uses Bearer token authentication
-  `Passthrough` type L196-204 — `impl Clone for Passthrough` — - Uses Bearer token authentication
-  `clone` function L197-203 — `(&self) -> Self` — - Uses Bearer token authentication
-  `Passthrough` type L206-576 — `= Passthrough` — - Uses Bearer token authentication
-  `get_auth_value` function L495-535 — `(&self, api_key: Option<&str>) -> Result<String>` — Get the authentication value based on the configured mode.
-  `format_auth_value` function L538-546 — `(&self, key: &str) -> String` — Format the auth value based on provider.
-  `prepare_request` function L549-558 — `(&self, request: &CompletionRequest) -> ForwardRequest` — Prepare the request for forwarding.
-  `prepare_raw_request` function L563-575 — `(&self, request: serde_json::Value) -> serde_json::Value` — Prepare a raw JSON request for forwarding.
-  `Passthrough` type L578-582 — `impl Default for Passthrough` — - Uses Bearer token authentication
-  `default` function L579-581 — `() -> Self` — - Uses Bearer token authentication
-  `strip_muninn_fields` function L588-624 — `(request: &CompletionRequest) -> ForwardRequest` — Strip muninn-specific fields from request before forwarding.
-  `inject_claude_code_system_prompt` function L627-643 — `(system: Option<Vec<SystemMessage>>) -> Vec<SystemMessage>` — Inject the required Claude Code system prompt at the beginning.
-  `VALID_REQUEST_FIELDS` variable L647-661 — `: &[&str]` — Valid top-level fields for Anthropic API requests.
-  `strip_unknown_fields_raw` function L664-678 — `(request: &serde_json::Value) -> serde_json::Value` — Strip unknown fields from a raw JSON request.
-  `inject_system_prompt_raw` function L681-722 — `(request: &mut serde_json::Value)` — Inject the required system prompt into a raw JSON request.
-  `SystemMessage` type L737-755 — `= SystemMessage` — - Uses Bearer token authentication
-  `CacheControl` type L765-772 — `= CacheControl` — - Uses Bearer token authentication
-  `ForwardRequest` struct L776-796 — `{ model: String, max_tokens: u32, messages: Vec<crate::types::Message>, system: ...` — Request structure for forwarding (without muninn fields).
-  `tests` module L799-898 — `-` — - Uses Bearer token authentication
-  `test_passthrough_default` function L803-810 — `()` — - Uses Bearer token authentication
-  `test_passthrough_anthropic` function L813-819 — `()` — - Uses Bearer token authentication
-  `test_passthrough_anthropic_oauth` function L822-829 — `()` — - Uses Bearer token authentication
-  `test_passthrough_custom_url` function L832-835 — `()` — - Uses Bearer token authentication
-  `test_config_builder` function L838-853 — `()` — - Uses Bearer token authentication
-  `test_openai_config` function L856-862 — `()` — - Uses Bearer token authentication
-  `test_system_message` function L865-870 — `()` — - Uses Bearer token authentication
-  `test_inject_system_prompt_empty` function L873-877 — `()` — - Uses Bearer token authentication
-  `test_inject_system_prompt_prepend` function L880-886 — `()` — - Uses Bearer token authentication
-  `test_inject_system_prompt_already_present` function L889-897 — `()` — - Uses Bearer token authentication

#### crates/muninn-rlm/src/prompts.rs

- pub `CORE_RLM_BEHAVIOR` variable L12-80 — `: &str` — Core RLM behavior prompt - describes strategy and guidelines.
-  `tests` module L83-94 — `-` — 3.
-  `test_core_rlm_behavior_contains_key_sections` function L87-93 — `()` — 3.

#### crates/muninn-rlm/src/proxy.rs

- pub `ProxyRequestTraceData` struct L40-49 — `{ model: String, streaming: bool, explicit_recursive: bool, message_count: usize...` — Trace data for incoming proxy requests.
- pub `ProxyCompletionTraceData` struct L53-62 — `{ handling: String, success: bool, error: Option<String>, total_time_ms: u64 }` — Trace data for proxy request completion.
- pub `ProxyConfig` struct L66-85 — `{ bind_addr: SocketAddr, enable_cors: bool, enable_tracing: bool, passthrough: P...` — Configuration for the proxy server.
- pub `new` function L121-126 — `(bind_addr: SocketAddr) -> Self` — Create a new proxy config with the given bind address.
- pub `with_bind_addr` function L129-132 — `(mut self, addr: SocketAddr) -> Self` — Set the bind address.
- pub `with_cors` function L135-138 — `(mut self, enable: bool) -> Self` — Enable or disable CORS.
- pub `with_passthrough` function L141-144 — `(mut self, config: PassthroughConfig) -> Self` — Set the passthrough configuration.
- pub `with_token_manager` function L147-150 — `(mut self, manager: SharedTokenManager) -> Self` — Set the token manager for OAuth authentication.
- pub `with_budget` function L153-156 — `(mut self, budget: crate::types::BudgetConfig) -> Self` — Set the budget configuration for recursive exploration.
- pub `with_work_dir` function L159-162 — `(mut self, path: impl Into<std::path::PathBuf>) -> Self` — Set the working directory for RLM context.
- pub `with_trace_writer` function L165-168 — `(mut self, config: muninn_tracing::WriterConfig) -> Self` — Set the trace writer configuration.
- pub `without_agentic_tracing` function L171-174 — `(mut self) -> Self` — Disable agentic tracing.
- pub `with_session_dir` function L177-180 — `(mut self, path: impl Into<std::path::PathBuf>) -> Self` — Set the session directory for session-based logging.
- pub `ProxyServer` struct L200-203 — `{ config: ProxyConfig, state: Arc<ProxyState> }` — The RLM proxy server.
- pub `new` function L220-247 — `( config: ProxyConfig, backend: Arc<dyn LLMBackend>, tools: Arc<dyn ToolEnvironm...` — Create a new proxy server with RLM backend.
- pub `passthrough_only` function L250-266 — `(config: ProxyConfig) -> Self` — Create a passthrough-only proxy (no RLM backend required).
- pub `with_router` function L269-297 — `( config: ProxyConfig, backend: Arc<dyn LLMBackend>, tools: Arc<dyn ToolEnvironm...` — Create a new proxy server with custom router configuration.
- pub `with_separate_backends` function L303-335 — `( config: ProxyConfig, router_backend: Arc<dyn LLMBackend>, rlm_backend: Arc<dyn...` — Create a new proxy server with separate backends for router and RLM.
- pub `with_engine` function L338-355 — `(config: ProxyConfig, engine: Arc<dyn MuninnEngine>) -> Self` — Create a proxy with an existing engine (any [`MuninnEngine`] impl).
- pub `router` function L358-379 — `(&self) -> AxumRouter` — Build the axum router for the proxy.
- pub `run` function L382-389 — `(self) -> std::io::Result<()>` — Run the proxy server.
- pub `run_with_shutdown` function L392-404 — `( self, shutdown: impl std::future::Future<Output = ()> + Send + 'static, ) -> s...` — Run the proxy server with graceful shutdown.
- pub `ProxyError` struct L738 — `-` — Error type for proxy responses.
-  `ProxyConfig` type L87-101 — `impl Clone for ProxyConfig` — - RLM mode: Use configured backend for recursive exploration
-  `clone` function L88-100 — `(&self) -> Self` — - RLM mode: Use configured backend for recursive exploration
-  `ProxyConfig` type L103-117 — `impl Default for ProxyConfig` — - RLM mode: Use configured backend for recursive exploration
-  `default` function L104-116 — `() -> Self` — - RLM mode: Use configured backend for recursive exploration
-  `ProxyConfig` type L119-181 — `= ProxyConfig` — - RLM mode: Use configured backend for recursive exploration
-  `ProxyState` struct L184-197 — `{ engine: Option<Arc<dyn MuninnEngine>>, router: Option<RlmRouter>, passthrough:...` — Shared state for the proxy server.
-  `ProxyServer` type L205-405 — `= ProxyServer` — - RLM mode: Use configured backend for recursive exploration
-  `create_trace_writer` function L207-217 — `(config: &ProxyConfig) -> Option<muninn_tracing::TraceWriter>` — Create a trace writer from config.
-  `handle_openai_chat` function L412-444 — `( State(state): State<Arc<ProxyState>>, headers: HeaderMap, body: String, ) -> R...` — Handle POST /v1/chat/completions (OpenAI-compatible endpoint)
-  `handle_messages` function L450-649 — `( State(state): State<Arc<ProxyState>>, headers: HeaderMap, body: String, ) -> R...` — Handle POST /v1/messages
-  `forward_passthrough` function L652-693 — `( passthrough: &Passthrough, request: serde_json::Value, api_key: Option<&str>, ...` — Forward a request through passthrough, handling both streaming and non-streaming.
-  `extract_api_key` function L696-726 — `(headers: &HeaderMap, config: &PassthroughConfig) -> Option<String>` — Extract API key from request headers based on passthrough config.
-  `handle_health` function L729-734 — `() -> impl IntoResponse` — Handle GET /health
-  `ProxyError` type L740-744 — `= ProxyError` — - RLM mode: Use configured backend for recursive exploration
-  `from` function L741-743 — `(err: RlmError) -> Self` — - RLM mode: Use configured backend for recursive exploration
-  `ProxyError` type L746-772 — `= ProxyError` — - RLM mode: Use configured backend for recursive exploration
-  `from` function L747-771 — `(err: muninn_core::MuninnCoreError) -> Self` — - RLM mode: Use configured backend for recursive exploration
-  `ProxyError` type L774-820 — `impl IntoResponse for ProxyError` — - RLM mode: Use configured backend for recursive exploration
-  `into_response` function L775-819 — `(self) -> axum::response::Response` — - RLM mode: Use configured backend for recursive exploration
-  `tests` module L823-1029 — `-` — - RLM mode: Use configured backend for recursive exploration
-  `create_test_server` function L834-843 — `(responses: Vec<CompletionResponse>) -> ProxyServer` — - RLM mode: Use configured backend for recursive exploration
-  `test_health_endpoint` function L846-862 — `()` — - RLM mode: Use configured backend for recursive exploration
-  `test_messages_endpoint_simple` function L865-905 — `()` — - RLM mode: Use configured backend for recursive exploration
-  `test_messages_endpoint_with_muninn` function L908-957 — `()` — - RLM mode: Use configured backend for recursive exploration
-  `test_messages_endpoint_invalid_json` function L960-978 — `()` — - RLM mode: Use configured backend for recursive exploration
-  `test_proxy_error_response` function L981-1013 — `()` — - RLM mode: Use configured backend for recursive exploration
-  `test_proxy_config_default` function L1016-1021 — `()` — - RLM mode: Use configured backend for recursive exploration
-  `test_proxy_config_builder` function L1024-1028 — `()` — - RLM mode: Use configured backend for recursive exploration

#### crates/muninn-rlm/src/repl_tools.rs

- pub `SandboxConfig` struct L27-40 — `{ timeout_secs: u64, max_output_bytes: usize, working_dir: Option<String>, env_v...` — Configuration for the sandbox environment.
- pub `new` function L57-59 — `() -> Self` — Create a new sandbox config with default settings.
- pub `with_timeout` function L62-65 — `(mut self, secs: u64) -> Self` — Set the timeout.
- pub `with_max_output` function L68-71 — `(mut self, bytes: usize) -> Self` — Set the maximum output size.
- pub `with_working_dir` function L74-77 — `(mut self, dir: impl Into<String>) -> Self` — Set the working directory.
- pub `with_env` function L80-83 — `(mut self, key: impl Into<String>, value: impl Into<String>) -> Self` — Add an environment variable.
- pub `ExecutionResult` struct L92-105 — `{ exit_code: i32, stdout: String, stderr: String, timed_out: bool, duration_ms: ...` — Result of code execution.
- pub `is_success` function L109-111 — `(&self) -> bool` — Check if execution was successful.
- pub `combined_output` function L114-122 — `(&self) -> String` — Get combined output (stdout + stderr).
- pub `Language` enum L131-134 — `Python | Shell` — Supported languages for code execution.
- pub `parse` function L138-144 — `(s: &str) -> Option<Self>` — Parse language from string.
- pub `interpreter` function L147-152 — `(&self) -> &'static str` — Get the interpreter command for this language.
- pub `eval_flag` function L155-160 — `(&self) -> &'static str` — Get the flag for executing code from string.
- pub `Sandbox` interface L169-175 — `{ fn execute(), fn is_available() }` — Trait for sandbox implementations.
- pub `SharedSandbox` type L178 — `= Arc<dyn Sandbox>` — Thread-safe sandbox reference.
- pub `ProcessSandbox` struct L193-195 — `{ config: SandboxConfig }` — Subprocess-based sandbox implementation.
- pub `new` function L199-201 — `(config: SandboxConfig) -> Self` — Create a new process sandbox with the given config.
- pub `default_sandbox` function L204-206 — `() -> Self` — Create with default config.
- pub `shared` function L209-211 — `(config: SandboxConfig) -> SharedSandbox` — Create a shared instance.
- pub `ExecuteCodeTool` struct L321-323 — `{ sandbox: SharedSandbox }` — Tool for executing code in a sandboxed environment.
- pub `new` function L327-329 — `(sandbox: SharedSandbox) -> Self` — Create a new execute code tool.
- pub `CheckLanguageTool` struct L419-421 — `{ sandbox: SharedSandbox }` — Tool for checking which languages are available.
- pub `new` function L424-426 — `(sandbox: SharedSandbox) -> Self` — - Support for multiple languages
- pub `create_repl_tools` function L475-480 — `(sandbox: SharedSandbox) -> Vec<Box<dyn Tool>>` — Create REPL tools with a given sandbox.
- pub `create_default_repl_tools` function L483-486 — `() -> Vec<Box<dyn Tool>>` — Create REPL tools with default configuration.
-  `SandboxConfig` type L42-53 — `impl Default for SandboxConfig` — - Support for multiple languages
-  `default` function L43-52 — `() -> Self` — - Support for multiple languages
-  `SandboxConfig` type L55-84 — `= SandboxConfig` — - Support for multiple languages
-  `ExecutionResult` type L107-123 — `= ExecutionResult` — - Support for multiple languages
-  `Language` type L136-161 — `= Language` — - Support for multiple languages
-  `ProcessSandbox` type L197-223 — `= ProcessSandbox` — - Support for multiple languages
-  `truncate_output` function L214-222 — `(&self, output: &[u8]) -> (String, bool)` — Truncate output if needed.
-  `ProcessSandbox` type L226-314 — `impl Sandbox for ProcessSandbox` — - Support for multiple languages
-  `execute` function L227-302 — `(&self, language: Language, code: &str) -> Result<ExecutionResult>` — - Support for multiple languages
-  `is_available` function L304-313 — `(&self, language: Language) -> bool` — - Support for multiple languages
-  `ExecuteCodeTool` type L325-330 — `= ExecuteCodeTool` — - Support for multiple languages
-  `ExecuteCodeTool` type L333-412 — `impl Tool for ExecuteCodeTool` — - Support for multiple languages
-  `name` function L334-336 — `(&self) -> &str` — - Support for multiple languages
-  `description` function L338-342 — `(&self) -> &str` — - Support for multiple languages
-  `parameters_schema` function L344-360 — `(&self) -> serde_json::Value` — - Support for multiple languages
-  `execute` function L362-411 — `(&self, params: serde_json::Value) -> Result<ToolResult>` — - Support for multiple languages
-  `CheckLanguageTool` type L423-427 — `= CheckLanguageTool` — - Support for multiple languages
-  `CheckLanguageTool` type L430-468 — `impl Tool for CheckLanguageTool` — - Support for multiple languages
-  `name` function L431-433 — `(&self) -> &str` — - Support for multiple languages
-  `description` function L435-437 — `(&self) -> &str` — - Support for multiple languages
-  `parameters_schema` function L439-444 — `(&self) -> serde_json::Value` — - Support for multiple languages
-  `execute` function L446-467 — `(&self, _params: serde_json::Value) -> Result<ToolResult>` — - Support for multiple languages
-  `tests` module L493-714 — `-` — - Support for multiple languages
-  `test_sandbox_config_builder` function L497-508 — `()` — - Support for multiple languages
-  `test_language_parsing` function L511-519 — `()` — - Support for multiple languages
-  `test_language_interpreter` function L522-525 — `()` — - Support for multiple languages
-  `test_execution_result_success` function L528-540 — `()` — - Support for multiple languages
-  `test_execution_result_with_stderr` function L543-556 — `()` — - Support for multiple languages
-  `test_execution_result_timeout` function L559-570 — `()` — - Support for multiple languages
-  `test_process_sandbox_python` function L573-588 — `()` — - Support for multiple languages
-  `test_process_sandbox_shell` function L591-606 — `()` — - Support for multiple languages
-  `test_process_sandbox_exit_code` function L609-620 — `()` — - Support for multiple languages
-  `test_process_sandbox_timeout` function L623-635 — `()` — - Support for multiple languages
-  `test_process_sandbox_stderr` function L638-651 — `()` — - Support for multiple languages
-  `test_create_repl_tools` function L654-661 — `()` — - Support for multiple languages
-  `test_execute_code_tool` function L664-685 — `()` — - Support for multiple languages
-  `test_execute_code_tool_invalid_language` function L688-700 — `()` — - Support for multiple languages
-  `test_check_language_tool` function L703-713 — `()` — - Support for multiple languages

#### crates/muninn-rlm/src/router.rs

- pub `RouterTraceData` struct L51-79 — `{ strategy: String, method: String, model: String, system_prompt: Option<String>...` — Trace data captured for router decisions.
- pub `RoutingTrainingRecord` struct L84-95 — `{ timestamp: String, request: String, decision: String, reason: String, method: ...` — Training data record for routing decisions.
- pub `RouteDecision` enum L103-111 — `Passthrough | Rlm` — The routing decision for a request.
- pub `passthrough` function L114-116 — `() -> Self` — Note: The JSON flag (`request.muninn.recursive`) is checked in proxy before routing.
- pub `rlm` function L118-122 — `(reason: impl Into<String>) -> Self` — Note: The JSON flag (`request.muninn.recursive`) is checked in proxy before routing.
- pub `is_rlm` function L124-126 — `(&self) -> bool` — Note: The JSON flag (`request.muninn.recursive`) is checked in proxy before routing.
- pub `is_passthrough` function L128-130 — `(&self) -> bool` — Note: The JSON flag (`request.muninn.recursive`) is checked in proxy before routing.
- pub `RouterStrategy` enum L139-147 — `Llm | AlwaysRlm | AlwaysPassthrough` — Strategy for making routing decisions.
- pub `RouterConfig` struct L151-158 — `{ strategy: RouterStrategy, enabled: bool, router_model: Option<String> }` — Configuration for the request router.
- pub `Router` struct L463-466 — `{ config: RouterConfig, llm: Option<Arc<dyn LLMBackend>> }` — Request router that decides between RLM and passthrough.
- pub `new` function L470-475 — `() -> Self` — Create a new router with default configuration.
- pub `with_config` function L478-480 — `(config: RouterConfig) -> Self` — Create with custom configuration.
- pub `with_llm` function L483-486 — `(mut self, llm: Arc<dyn LLMBackend>) -> Self` — Set the LLM backend for LLM-based routing.
- pub `route` function L499-568 — `(&self, request: &CompletionRequest) -> RouteDecision` — Route a request to either passthrough or RLM.
-  `RouteDecision` type L113-131 — `= RouteDecision` — Note: The JSON flag (`request.muninn.recursive`) is checked in proxy before routing.
-  `RouterConfig` type L160-168 — `impl Default for RouterConfig` — Note: The JSON flag (`request.muninn.recursive`) is checked in proxy before routing.
-  `default` function L161-167 — `() -> Self` — Note: The JSON flag (`request.muninn.recursive`) is checked in proxy before routing.
-  `RoutingInput` struct L176-179 — `{ text: String }` — Preprocessed input for routing decisions.
-  `CONTROL_TAG_PATTERNS` variable L183-188 — `: &[&str]` — Control tag patterns to strip from router input.
-  `strip_control_tags` function L191-212 — `(text: &str) -> String` — Strip XML control tags from text.
-  `extract_routing_input` function L221-246 — `(request: &CompletionRequest) -> Option<RoutingInput>` — Extract and clean the last user message for routing.
-  `PASSTHROUGH_BYPASS_PATTERNS` variable L253-256 — `: &[&str]` — Patterns that should always passthrough - internal Claude Code requests.
-  `should_bypass` function L259-272 — `(text: &str) -> bool` — Check if text matches internal bypass patterns (title gen, autocomplete).
-  `rlm_trigger_pattern` function L276-278 — `() -> Regex` — Regex pattern for explicit RLM trigger ({at}muninn explore).
-  `passthrough_trigger_pattern` function L282-284 — `() -> Regex` — Regex pattern for explicit passthrough trigger ({at}muninn passthrough).
-  `has_rlm_trigger` function L287-289 — `(text: &str) -> bool` — Check if text contains the explicit RLM trigger.
-  `has_passthrough_trigger` function L292-294 — `(text: &str) -> bool` — Check if text contains the explicit passthrough trigger.
-  `RouteDecisionInput` struct L302-305 — `{ route: String, reason: String }` — Tool input for parsing the route_decision tool response.
-  `ROUTER_SYSTEM_PROMPT` variable L316-331 — `: &str` — System prompt for the router LLM.
-  `build_router_user_message` function L334-379 — `(user_request: &str) -> String` — Build the user message for the router LLM.
-  `route_decision_tool` function L382-402 — `() -> ToolDefinition` — Create the route_decision tool definition.
-  `build_router_request` function L405-426 — `(user_message: &str, router_model: &Option<String>) -> CompletionRequest` — Build the CompletionRequest for the router LLM.
-  `parse_route_response` function L429-456 — `(response: &CompletionResponse) -> RouteDecision` — Parse the router LLM response into a RouteDecision.
-  `Router` type L468-627 — `= Router` — Note: The JSON flag (`request.muninn.recursive`) is checked in proxy before routing.
-  `route_via_llm` function L571-591 — `(&self, user_message: &str) -> RouteDecision` — Call the router LLM to make a routing decision.
-  `finish` function L594-626 — `( &self, decision: RouteDecision, method: &str, cleaned_message: Option<&str>, r...` — Emit trace data and return the decision.
-  `Router` type L629-633 — `impl Default for Router` — Note: The JSON flag (`request.muninn.recursive`) is checked in proxy before routing.
-  `default` function L630-632 — `() -> Self` — Note: The JSON flag (`request.muninn.recursive`) is checked in proxy before routing.
-  `tests` module L640-1014 — `-` — Note: The JSON flag (`request.muninn.recursive`) is checked in proxy before routing.
-  `make_request` function L645-669 — `(messages: Vec<(&str, &str)>) -> CompletionRequest` — Note: The JSON flag (`request.muninn.recursive`) is checked in proxy before routing.
-  `mock_route_response` function L671-692 — `(route: &str, reason: &str) -> CompletionResponse` — Note: The JSON flag (`request.muninn.recursive`) is checked in proxy before routing.
-  `test_llm_routes_passthrough` function L695-705 — `()` — Note: The JSON flag (`request.muninn.recursive`) is checked in proxy before routing.
-  `test_llm_routes_rlm` function L708-718 — `()` — Note: The JSON flag (`request.muninn.recursive`) is checked in proxy before routing.
-  `test_strategy_always_passthrough` function L721-732 — `()` — Note: The JSON flag (`request.muninn.recursive`) is checked in proxy before routing.
-  `test_strategy_always_rlm` function L735-746 — `()` — Note: The JSON flag (`request.muninn.recursive`) is checked in proxy before routing.
-  `test_router_disabled` function L749-760 — `()` — Note: The JSON flag (`request.muninn.recursive`) is checked in proxy before routing.
-  `test_rlm_trigger_forces_rlm` function L763-769 — `()` — Note: The JSON flag (`request.muninn.recursive`) is checked in proxy before routing.
-  `test_rlm_trigger_case_insensitive` function L772-778 — `()` — Note: The JSON flag (`request.muninn.recursive`) is checked in proxy before routing.
-  `test_rlm_trigger_requires_line_start` function L781-788 — `()` — Note: The JSON flag (`request.muninn.recursive`) is checked in proxy before routing.
-  `test_rlm_trigger_works_on_newline` function L791-798 — `()` — Note: The JSON flag (`request.muninn.recursive`) is checked in proxy before routing.
-  `test_passthrough_trigger_forces_passthrough` function L801-813 — `()` — Note: The JSON flag (`request.muninn.recursive`) is checked in proxy before routing.
-  `test_passthrough_trigger_case_insensitive` function L816-822 — `()` — Note: The JSON flag (`request.muninn.recursive`) is checked in proxy before routing.
-  `test_passthrough_trigger_requires_line_start` function L825-833 — `()` — Note: The JSON flag (`request.muninn.recursive`) is checked in proxy before routing.
-  `test_passthrough_trigger_works_on_newline` function L836-847 — `()` — Note: The JSON flag (`request.muninn.recursive`) is checked in proxy before routing.
-  `test_no_llm_configured_defaults_to_passthrough` function L850-856 — `()` — Note: The JSON flag (`request.muninn.recursive`) is checked in proxy before routing.
-  `test_bypass_title_generation` function L859-868 — `()` — Note: The JSON flag (`request.muninn.recursive`) is checked in proxy before routing.
-  `test_bypass_prompt_suggestion` function L871-880 — `()` — Note: The JSON flag (`request.muninn.recursive`) is checked in proxy before routing.
-  `test_strip_control_tags` function L883-887 — `()` — Note: The JSON flag (`request.muninn.recursive`) is checked in proxy before routing.
-  `test_empty_after_stripping_passthrough` function L890-899 — `()` — Note: The JSON flag (`request.muninn.recursive`) is checked in proxy before routing.
-  `test_has_rlm_trigger` function L902-914 — `()` — Note: The JSON flag (`request.muninn.recursive`) is checked in proxy before routing.
-  `test_has_passthrough_trigger` function L917-931 — `()` — Note: The JSON flag (`request.muninn.recursive`) is checked in proxy before routing.
-  `test_should_bypass` function L934-942 — `()` — Note: The JSON flag (`request.muninn.recursive`) is checked in proxy before routing.
-  `extract_routing_input_preserves_long_user_messages` function L954-961 — `()` — Regression for the false-bug report (PROJEC-T-0045) that
-  `extract_routing_input_preserves_blocks_form` function L968-990 — `()` — Same contract, but with the structured-blocks form Claude
-  `extract_routing_input_strips_only_control_tags` function L997-1013 — `()` — Control-tag stripping must not eat normal user content that

#### crates/muninn-rlm/src/subquery.rs

- pub `SubQuery` struct L17-35 — `{ question: String, system: Option<String>, allowed_tools: Vec<String>, budget: ...` — Configuration for spawning a sub-query.
- pub `new` function L39-48 — `(question: impl Into<String>) -> Self` — Create a new sub-query with the given question.
- pub `default_sub_budget` function L51-58 — `() -> BudgetConfig` — Default budget for sub-queries (more restrictive than parent).
- pub `with_system` function L61-64 — `(mut self, system: impl Into<String>) -> Self` — Set the system prompt.
- pub `with_allowed_tools` function L67-70 — `(mut self, tools: Vec<String>) -> Self` — Restrict to specific tools.
- pub `with_budget` function L73-76 — `(mut self, budget: BudgetConfig) -> Self` — Set the budget.
- pub `with_summarization` function L79-82 — `(mut self) -> Self` — Enable result summarization.
- pub `with_model` function L85-88 — `(mut self, model: impl Into<String>) -> Self` — Set a specific model.
- pub `SubQueryResult` struct L93-105 — `{ answer: String, tokens_used: u64, tool_calls: u32, depth_reached: u32 }` — Result from a sub-query execution.
- pub `SubQueryExecutor` struct L108-112 — `{ backend: Arc<dyn LLMBackend>, tools: Arc<dyn ToolEnvironment>, parent_model: S...` — Sub-query executor that manages isolated exploration sessions.
- pub `new` function L116-126 — `( backend: Arc<dyn LLMBackend>, tools: Arc<dyn ToolEnvironment>, parent_model: S...` — Create a new sub-query executor.
- pub `execute` function L129-175 — `(&self, subquery: SubQuery) -> Result<SubQueryResult>` — Execute a sub-query with isolated context.
- pub `spawn_subquery_tool` function L219-249 — `() -> ToolDefinition` — Helper function to create a spawn_subquery tool definition.
-  `SubQuery` type L37-89 — `= SubQuery` — can be used to decompose complex questions.
-  `SubQueryExecutor` type L114-176 — `= SubQueryExecutor` — can be used to decompose complex questions.
-  `FilteredToolEnvironment` struct L179-182 — `{ inner: Arc<dyn ToolEnvironment>, allowed: Vec<String> }` — A tool environment that filters available tools.
-  `FilteredToolEnvironment` type L184-188 — `= FilteredToolEnvironment` — can be used to decompose complex questions.
-  `new` function L185-187 — `(inner: Arc<dyn ToolEnvironment>, allowed: Vec<String>) -> Self` — can be used to decompose complex questions.
-  `FilteredToolEnvironment` type L191-216 — `impl ToolEnvironment for FilteredToolEnvironment` — can be used to decompose complex questions.
-  `execute_tool` function L192-207 — `( &self, tool_use: &crate::types::ToolUseBlock, ) -> Result<crate::types::ToolRe...` — can be used to decompose complex questions.
-  `available_tools` function L209-215 — `(&self) -> Vec<ToolDefinition>` — can be used to decompose complex questions.
-  `tests` module L252-396 — `-` — can be used to decompose complex questions.
-  `test_subquery_simple` function L259-280 — `()` — can be used to decompose complex questions.
-  `test_subquery_with_filtered_tools` function L283-308 — `()` — can be used to decompose complex questions.
-  `test_subquery_with_custom_model` function L311-331 — `()` — can be used to decompose complex questions.
-  `test_subquery_builder` function L334-349 — `()` — can be used to decompose complex questions.
-  `test_default_sub_budget` function L352-358 — `()` — can be used to decompose complex questions.
-  `test_spawn_subquery_tool` function L361-365 — `()` — can be used to decompose complex questions.
-  `test_filtered_tool_environment` function L368-395 — `()` — can be used to decompose complex questions.

#### crates/muninn-rlm/src/token_manager.rs

- pub `TOKEN_FILE` variable L22 — `: &str` — Default token file name within the .muninn directory.
- pub `TokenManager` interface L36-57 — `{ fn get_valid_access_token(), fn has_tokens(), fn save_tokens(), fn load_tokens...` — Trait for managing OAuth token lifecycle.
- pub `FileTokenManager` struct L67-74 — `{ token_path: PathBuf, config: OAuthConfig, cached_tokens: Arc<RwLock<Option<OAu...` — File-based token manager for production use.
- pub `new` function L81-87 — `(muninn_dir: &Path) -> Self` — Create a new file-based token manager.
- pub `with_path` function L90-96 — `(token_path: PathBuf) -> Self` — Create a token manager with a custom token path.
- pub `token_path` function L99-101 — `(&self) -> &Path` — Get the token file path.
- pub `is_token_expired` function L104-115 — `(tokens: &OAuthTokens) -> bool` — Check if tokens are expired (with buffer time).
- pub `InMemoryTokenManager` struct L247-252 — `{ tokens: RwLock<Option<OAuthTokens>>, refresh_count: AtomicU32 }` — In-memory token manager for testing.
- pub `new` function L256-261 — `() -> Self` — Create a new empty in-memory token manager.
- pub `with_tokens` function L264-269 — `(tokens: OAuthTokens) -> Self` — Create an in-memory token manager pre-loaded with tokens.
- pub `refresh_count` function L272-274 — `(&self) -> u32` — Get the number of refresh operations performed.
- pub `is_token_expired` function L277-279 — `(tokens: &OAuthTokens) -> bool` — Check if tokens are expired (with buffer time).
- pub `TokenInfo` struct L370-379 — `{ created_at: String, expires_in_secs: u64, is_expired: bool, scope: String }` — Information about stored tokens for display.
- pub `expires_in_display` function L383-391 — `(&self) -> String` — Format expiry time for display.
- pub `SharedTokenManager` type L402 — `= Arc<dyn TokenManager>` — Shared token manager for use across async contexts.
- pub `create_token_manager` function L405-407 — `(muninn_dir: &Path) -> SharedTokenManager` — Create a shared file-based token manager.
- pub `create_memory_token_manager` function L410-412 — `() -> SharedTokenManager` — Create a shared in-memory token manager (for testing).
- pub `create_memory_token_manager_with_tokens` function L415-417 — `(tokens: OAuthTokens) -> SharedTokenManager` — Create a shared in-memory token manager with pre-loaded tokens (for testing).
-  `REFRESH_BUFFER_MS` variable L25 — `: u64` — Buffer time before expiry to trigger refresh (5 minutes in milliseconds).
-  `FileTokenManager` type L76-116 — `= FileTokenManager` — - `InMemoryTokenManager` for testing without filesystem dependencies
-  `FileTokenManager` type L119-235 — `impl TokenManager for FileTokenManager` — - `InMemoryTokenManager` for testing without filesystem dependencies
-  `has_tokens` function L120-122 — `(&self) -> bool` — - `InMemoryTokenManager` for testing without filesystem dependencies
-  `save_tokens` function L124-144 — `(&self, tokens: &OAuthTokens) -> Result<()>` — - `InMemoryTokenManager` for testing without filesystem dependencies
-  `load_tokens` function L146-171 — `(&self) -> Result<Option<OAuthTokens>>` — - `InMemoryTokenManager` for testing without filesystem dependencies
-  `get_valid_access_token` function L173-193 — `(&self) -> Result<String>` — - `InMemoryTokenManager` for testing without filesystem dependencies
-  `clear_cache` function L195-198 — `(&self)` — - `InMemoryTokenManager` for testing without filesystem dependencies
-  `delete_tokens` function L200-207 — `(&self) -> Result<()>` — - `InMemoryTokenManager` for testing without filesystem dependencies
-  `get_token_info` function L209-234 — `(&self) -> Result<Option<TokenInfo>>` — - `InMemoryTokenManager` for testing without filesystem dependencies
-  `InMemoryTokenManager` type L254-280 — `= InMemoryTokenManager` — - `InMemoryTokenManager` for testing without filesystem dependencies
-  `InMemoryTokenManager` type L282-286 — `impl Default for InMemoryTokenManager` — - `InMemoryTokenManager` for testing without filesystem dependencies
-  `default` function L283-285 — `() -> Self` — - `InMemoryTokenManager` for testing without filesystem dependencies
-  `InMemoryTokenManager` type L289-362 — `impl TokenManager for InMemoryTokenManager` — - `InMemoryTokenManager` for testing without filesystem dependencies
-  `has_tokens` function L290-296 — `(&self) -> bool` — - `InMemoryTokenManager` for testing without filesystem dependencies
-  `save_tokens` function L298-302 — `(&self, tokens: &OAuthTokens) -> Result<()>` — - `InMemoryTokenManager` for testing without filesystem dependencies
-  `load_tokens` function L304-307 — `(&self) -> Result<Option<OAuthTokens>>` — - `InMemoryTokenManager` for testing without filesystem dependencies
-  `get_valid_access_token` function L309-323 — `(&self) -> Result<String>` — - `InMemoryTokenManager` for testing without filesystem dependencies
-  `clear_cache` function L325-329 — `(&self)` — - `InMemoryTokenManager` for testing without filesystem dependencies
-  `delete_tokens` function L331-334 — `(&self) -> Result<()>` — - `InMemoryTokenManager` for testing without filesystem dependencies
-  `get_token_info` function L336-361 — `(&self) -> Result<Option<TokenInfo>>` — - `InMemoryTokenManager` for testing without filesystem dependencies
-  `TokenInfo` type L381-392 — `= TokenInfo` — - `InMemoryTokenManager` for testing without filesystem dependencies
-  `tests` module L420-681 — `-` — - `InMemoryTokenManager` for testing without filesystem dependencies
-  `test_file_token_manager_new` function L429-433 — `()` — - `InMemoryTokenManager` for testing without filesystem dependencies
-  `test_file_save_and_load_tokens` function L436-456 — `()` — - `InMemoryTokenManager` for testing without filesystem dependencies
-  `test_is_token_expired` function L459-500 — `()` — - `InMemoryTokenManager` for testing without filesystem dependencies
-  `test_file_delete_tokens` function L503-522 — `()` — - `InMemoryTokenManager` for testing without filesystem dependencies
-  `test_inmemory_token_manager_new` function L529-533 — `()` — - `InMemoryTokenManager` for testing without filesystem dependencies
-  `test_inmemory_with_tokens` function L536-552 — `()` — - `InMemoryTokenManager` for testing without filesystem dependencies
-  `test_inmemory_save_and_load` function L555-573 — `()` — - `InMemoryTokenManager` for testing without filesystem dependencies
-  `test_inmemory_get_valid_access_token` function L576-596 — `()` — - `InMemoryTokenManager` for testing without filesystem dependencies
-  `test_inmemory_refresh_count_on_expired` function L599-618 — `()` — - `InMemoryTokenManager` for testing without filesystem dependencies
-  `test_inmemory_delete_tokens` function L621-637 — `()` — - `InMemoryTokenManager` for testing without filesystem dependencies
-  `test_inmemory_no_tokens_error` function L640-644 — `()` — - `InMemoryTokenManager` for testing without filesystem dependencies
-  `test_shared_token_manager_file` function L651-655 — `()` — - `InMemoryTokenManager` for testing without filesystem dependencies
-  `test_shared_token_manager_memory` function L658-661 — `()` — - `InMemoryTokenManager` for testing without filesystem dependencies
-  `test_shared_token_manager_with_tokens` function L664-680 — `()` — - `InMemoryTokenManager` for testing without filesystem dependencies

#### crates/muninn-rlm/src/tools.rs

- pub `Tool` interface L30-58 — `{ fn name(), fn description(), fn parameters_schema(), fn execute(), fn is_inter...` — A tool that can be executed by the RLM engine.
- pub `ToolResult` struct L62-67 — `{ content: ToolContent, metadata: ToolMetadata }` — Result from executing a tool.
- pub `text` function L71-76 — `(content: impl Into<String>) -> Self` — Create a successful text result.
- pub `json` function L79-84 — `(value: serde_json::Value) -> Self` — Create a successful JSON result.
- pub `file` function L87-100 — `( path: impl Into<String>, content: impl Into<String>, language: Option<String>,...` — Create a file content result.
- pub `error` function L103-111 — `(message: impl Into<String>, recoverable: bool) -> Self` — Create an error result.
- pub `with_metadata` function L114-117 — `(mut self, metadata: ToolMetadata) -> Self` — Add metadata to this result.
- pub `is_error` function L120-122 — `(&self) -> bool` — Check if this result is an error.
- pub `to_string_content` function L125-139 — `(&self) -> String` — Convert to a string representation for the LLM.
- pub `to_result_block` function L142-147 — `(&self, tool_use_id: &str) -> ToolResultBlock` — Convert to a ToolResultBlock for the API.
- pub `ToolContent` enum L152-165 — `Text | Json | FileContent | Error` — Content types that tools can return.
- pub `ToolMetadata` struct L169-178 — `{ source: Option<String>, relevance: Option<f32>, token_estimate: Option<usize>,...` — Metadata for tool results, used by the context aggregator.
- pub `with_source` function L182-187 — `(source: impl Into<String>) -> Self` — Create metadata with a source identifier.
- pub `with_relevance` function L190-193 — `(mut self, relevance: f32) -> Self` — Set the relevance score.
- pub `with_tokens` function L196-199 — `(mut self, tokens: usize) -> Self` — Set the token estimate.
- pub `with_tag` function L202-205 — `(mut self, tag: impl Into<String>) -> Self` — Add a tag.
- pub `ToolRegistry` struct L216-218 — `{ tools: HashMap<String, Arc<dyn Tool>> }` — Registry of tools that implements `ToolEnvironment`.
- pub `new` function L222-226 — `() -> Self` — Create a new empty registry.
- pub `register` function L229-232 — `(&mut self, tool: impl Tool + 'static)` — Register a tool with the registry.
- pub `register_arc` function L235-238 — `(&mut self, tool: Arc<dyn Tool>)` — Register a tool (Arc version).
- pub `get` function L241-243 — `(&self, name: &str) -> Option<&Arc<dyn Tool>>` — Get a tool by name.
- pub `len` function L246-248 — `(&self) -> usize` — Get the number of registered tools.
- pub `is_empty` function L251-253 — `(&self) -> bool` — Check if the registry is empty.
- pub `tool_names` function L256-258 — `(&self) -> Vec<&str>` — Get all tool names.
- pub `ToolEnvironment` interface L307-341 — `{ fn execute_tool(), fn available_tools(), fn available_tools_external(), fn fil...` — Trait for tool execution environments.
- pub `EmptyToolEnvironment` struct L347 — `-` — A tool environment that has no tools.
- pub `CompositeToolEnvironment` struct L364-367 — `{ environments: Vec<Arc<dyn ToolEnvironment>>, tool_map: HashMap<String, usize> ...` — A composite tool environment that combines multiple environments.
- pub `new` function L371-385 — `(environments: Vec<Arc<dyn ToolEnvironment>>) -> Self` — Create a new composite environment from multiple environments.
- pub `MockToolEnvironment` struct L411-415 — `{ tools: Vec<ToolDefinition>, responses: std::sync::Mutex<HashMap<String, String...` — A mock tool environment for testing.
- pub `new` function L419-425 — `(tools: Vec<ToolDefinition>) -> Self` — Create a new mock environment with the given tools.
- pub `set_response` function L428-433 — `(&self, tool_name: impl Into<String>, response: impl Into<String>)` — Set the response for a specific tool.
- pub `executions` function L436-438 — `(&self) -> Vec<ToolUseBlock>` — Get all tool executions that occurred.
- pub `execution_count` function L441-443 — `(&self) -> usize` — Get the number of tool executions.
- pub `SharedToolEnvironment` type L468 — `= Arc<dyn ToolEnvironment>` — A tool environment that can be shared across threads.
- pub `common_tools` module L471-581 — `-` — Helper to create common tool definitions.
- pub `read_file` function L476-491 — `() -> ToolDefinition` — Create a read_file tool definition.
- pub `list_files` function L494-513 — `() -> ToolDefinition` — Create a list_files tool definition.
- pub `search_code` function L516-535 — `() -> ToolDefinition` — Create a search_code tool definition.
- pub `query_graph` function L538-553 — `() -> ToolDefinition` — Create a query_graph tool definition.
- pub `spawn_subquery` function L556-580 — `() -> ToolDefinition` — Create a spawn_subquery tool definition.
-  `is_internal` function L50-52 — `(&self) -> bool` — Whether this tool is internal-only (not exposed via MCP).
-  `to_definition` function L55-57 — `(&self) -> ToolDefinition` — Convert this tool to an Anthropic-compatible tool definition.
-  `ToolResult` type L69-148 — `= ToolResult` — - `ToolResult`: Structured result from tool execution with metadata
-  `ToolMetadata` type L180-206 — `= ToolMetadata` — - `ToolResult`: Structured result from tool execution with metadata
-  `ToolRegistry` type L220-259 — `= ToolRegistry` — - `ToolResult`: Structured result from tool execution with metadata
-  `ToolRegistry` type L261-265 — `impl Default for ToolRegistry` — - `ToolResult`: Structured result from tool execution with metadata
-  `default` function L262-264 — `() -> Self` — - `ToolResult`: Structured result from tool execution with metadata
-  `ToolRegistry` type L268-292 — `impl ToolEnvironment for ToolRegistry` — - `ToolResult`: Structured result from tool execution with metadata
-  `execute_tool` function L269-279 — `(&self, tool_use: &ToolUseBlock) -> Result<ToolResultBlock>` — - `ToolResult`: Structured result from tool execution with metadata
-  `available_tools` function L281-283 — `(&self) -> Vec<ToolDefinition>` — - `ToolResult`: Structured result from tool execution with metadata
-  `available_tools_external` function L285-291 — `(&self) -> Vec<ToolDefinition>` — - `ToolResult`: Structured result from tool execution with metadata
-  `ToolRegistry` type L294-300 — `= ToolRegistry` — - `ToolResult`: Structured result from tool execution with metadata
-  `fmt` function L295-299 — `(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result` — - `ToolResult`: Structured result from tool execution with metadata
-  `available_tools_external` function L325-327 — `(&self) -> Vec<ToolDefinition>` — Get definitions of tools that should be exposed externally (via MCP).
-  `filter_tools` function L330-335 — `(&self, names: &[String]) -> Vec<ToolDefinition>` — Get a subset of tools by name.
-  `has_tool` function L338-340 — `(&self, name: &str) -> bool` — Check if a specific tool is available.
-  `EmptyToolEnvironment` type L350-361 — `impl ToolEnvironment for EmptyToolEnvironment` — - `ToolResult`: Structured result from tool execution with metadata
-  `execute_tool` function L351-356 — `(&self, tool_use: &ToolUseBlock) -> Result<ToolResultBlock>` — - `ToolResult`: Structured result from tool execution with metadata
-  `available_tools` function L358-360 — `(&self) -> Vec<ToolDefinition>` — - `ToolResult`: Structured result from tool execution with metadata
-  `CompositeToolEnvironment` type L369-386 — `= CompositeToolEnvironment` — - `ToolResult`: Structured result from tool execution with metadata
-  `CompositeToolEnvironment` type L389-407 — `impl ToolEnvironment for CompositeToolEnvironment` — - `ToolResult`: Structured result from tool execution with metadata
-  `execute_tool` function L390-399 — `(&self, tool_use: &ToolUseBlock) -> Result<ToolResultBlock>` — - `ToolResult`: Structured result from tool execution with metadata
-  `available_tools` function L401-406 — `(&self) -> Vec<ToolDefinition>` — - `ToolResult`: Structured result from tool execution with metadata
-  `MockToolEnvironment` type L417-444 — `= MockToolEnvironment` — - `ToolResult`: Structured result from tool execution with metadata
-  `MockToolEnvironment` type L447-465 — `impl ToolEnvironment for MockToolEnvironment` — - `ToolResult`: Structured result from tool execution with metadata
-  `execute_tool` function L448-460 — `(&self, tool_use: &ToolUseBlock) -> Result<ToolResultBlock>` — - `ToolResult`: Structured result from tool execution with metadata
-  `available_tools` function L462-464 — `(&self) -> Vec<ToolDefinition>` — - `ToolResult`: Structured result from tool execution with metadata
-  `tests` module L584-955 — `-` — - `ToolResult`: Structured result from tool execution with metadata
-  `test_tool` function L588-594 — `() -> ToolDefinition` — - `ToolResult`: Structured result from tool execution with metadata
-  `EchoTool` struct L597 — `-` — - `ToolResult`: Structured result from tool execution with metadata
-  `EchoTool` type L600-626 — `impl Tool for EchoTool` — - `ToolResult`: Structured result from tool execution with metadata
-  `name` function L601-603 — `(&self) -> &str` — - `ToolResult`: Structured result from tool execution with metadata
-  `description` function L605-607 — `(&self) -> &str` — - `ToolResult`: Structured result from tool execution with metadata
-  `parameters_schema` function L609-617 — `(&self) -> serde_json::Value` — - `ToolResult`: Structured result from tool execution with metadata
-  `execute` function L619-625 — `(&self, params: serde_json::Value) -> Result<ToolResult>` — - `ToolResult`: Structured result from tool execution with metadata
-  `test_tool_result_text` function L629-633 — `()` — - `ToolResult`: Structured result from tool execution with metadata
-  `test_tool_result_json` function L636-642 — `()` — - `ToolResult`: Structured result from tool execution with metadata
-  `test_tool_result_file` function L645-652 — `()` — - `ToolResult`: Structured result from tool execution with metadata
-  `test_tool_result_error` function L655-659 — `()` — - `ToolResult`: Structured result from tool execution with metadata
-  `test_tool_result_to_block` function L662-674 — `()` — - `ToolResult`: Structured result from tool execution with metadata
-  `test_tool_metadata` function L677-687 — `()` — - `ToolResult`: Structured result from tool execution with metadata
-  `test_tool_metadata_clamps_relevance` function L690-696 — `()` — - `ToolResult`: Structured result from tool execution with metadata
-  `test_tool_to_definition` function L699-704 — `()` — - `ToolResult`: Structured result from tool execution with metadata
-  `test_tool_registry_new` function L707-711 — `()` — - `ToolResult`: Structured result from tool execution with metadata
-  `test_tool_registry_register` function L714-721 — `()` — - `ToolResult`: Structured result from tool execution with metadata
-  `test_tool_registry_execute` function L724-742 — `()` — - `ToolResult`: Structured result from tool execution with metadata
-  `test_tool_registry_execute_unknown` function L745-762 — `()` — - `ToolResult`: Structured result from tool execution with metadata
-  `test_tool_registry_available_tools` function L765-772 — `()` — - `ToolResult`: Structured result from tool execution with metadata
-  `test_empty_tool_environment` function L775-787 — `()` — - `ToolResult`: Structured result from tool execution with metadata
-  `test_mock_tool_environment` function L790-812 — `()` — - `ToolResult`: Structured result from tool execution with metadata
-  `test_composite_tool_environment` function L815-867 — `()` — - `ToolResult`: Structured result from tool execution with metadata
-  `test_filter_tools` function L870-881 — `()` — - `ToolResult`: Structured result from tool execution with metadata
-  `test_has_tool` function L884-888 — `()` — - `ToolResult`: Structured result from tool execution with metadata
-  `test_common_tools` function L891-906 — `()` — - `ToolResult`: Structured result from tool execution with metadata
-  `InternalTool` struct L909 — `-` — - `ToolResult`: Structured result from tool execution with metadata
-  `InternalTool` type L912-932 — `impl Tool for InternalTool` — - `ToolResult`: Structured result from tool execution with metadata
-  `name` function L913-915 — `(&self) -> &str` — - `ToolResult`: Structured result from tool execution with metadata
-  `description` function L917-919 — `(&self) -> &str` — - `ToolResult`: Structured result from tool execution with metadata
-  `parameters_schema` function L921-923 — `(&self) -> serde_json::Value` — - `ToolResult`: Structured result from tool execution with metadata
-  `is_internal` function L925-927 — `(&self) -> bool` — - `ToolResult`: Structured result from tool execution with metadata
-  `execute` function L929-931 — `(&self, _params: serde_json::Value) -> Result<ToolResult>` — - `ToolResult`: Structured result from tool execution with metadata
-  `test_internal_tools_filtered_from_external` function L935-948 — `()` — - `ToolResult`: Structured result from tool execution with metadata
-  `test_default_is_external` function L951-954 — `()` — - `ToolResult`: Structured result from tool execution with metadata

#### crates/muninn-rlm/src/types.rs

- pub `SystemPrompt` enum L12-17 — `Text | Blocks` — System prompt - can be a string or array of text blocks.
- pub `SystemBlock` struct L21-30 — `{ text: String, block_type: String, cache_control: Option<CacheControl> }` — A text block in a system prompt.
- pub `to_text` function L34-43 — `(&self) -> String` — Get the text content of the system prompt.
- pub `CompletionRequest` struct L48-101 — `{ model: String, messages: Vec<Message>, max_tokens: u32, system: Option<SystemP...` — A completion request compatible with Anthropic Messages API.
- pub `new` function L105-122 — `(model: impl Into<String>, messages: Vec<Message>, max_tokens: u32) -> Self` — Create a new completion request with the given model and messages.
- pub `with_system` function L125-128 — `(mut self, system: impl Into<String>) -> Self` — Set the system prompt.
- pub `with_tools` function L131-134 — `(mut self, tools: Vec<ToolDefinition>) -> Self` — Add tools to the request.
- pub `with_streaming` function L137-140 — `(mut self) -> Self` — Enable streaming.
- pub `with_muninn` function L143-146 — `(mut self, config: MuninnConfig) -> Self` — Set Muninn configuration.
- pub `Message` struct L151-157 — `{ role: Role, content: Content }` — A message in the conversation.
- pub `user` function L161-166 — `(text: impl Into<String>) -> Self` — Create a user message with text content.
- pub `assistant` function L169-174 — `(text: impl Into<String>) -> Self` — Create an assistant message with text content.
- pub `assistant_blocks` function L177-182 — `(blocks: Vec<ContentBlock>) -> Self` — Create an assistant message with content blocks.
- pub `tool_results` function L185-190 — `(results: Vec<ToolResultBlock>) -> Self` — Create a user message with tool results.
- pub `Role` enum L196-199 — `User | Assistant` — The role of a message author.
- pub `Content` enum L204-209 — `Text | Blocks` — Message content - either a simple string or structured blocks.
- pub `as_text` function L213-218 — `(&self) -> Option<&str>` — Get the text content if this is simple text.
- pub `blocks` function L221-229 — `(&self) -> Vec<ContentBlock>` — Get the content blocks.
- pub `to_text` function L232-263 — `(&self) -> String` — Extract all text from the content.
- pub `CacheControl` enum L269-272 — `Ephemeral` — Cache control for prompt caching.
- pub `ContentBlock` enum L281-323 — `Text | ToolUse | ToolResult | Thinking` — A content block in a message.
- pub `ToolResultContent` enum L328-331 — `Text | Blocks` — Tool result content - can be a string or array of content blocks.
- pub `ToolUseBlock` struct L337-344 — `{ id: String, name: String, input: serde_json::Value }` — Convenience struct for creating tool use blocks.
- pub `ToolResultBlock` struct L361-370 — `{ tool_use_id: String, content: Option<ToolResultContent>, is_error: bool }` — Convenience struct for creating tool result blocks.
- pub `success` function L374-380 — `(tool_use_id: impl Into<String>, content: impl Into<String>) -> Self` — Create a successful tool result.
- pub `error` function L383-389 — `(tool_use_id: impl Into<String>, error: impl Into<String>) -> Self` — Create an error tool result.
- pub `text` function L405-410 — `(content: impl Into<String>) -> Self` — Create a text content block.
- pub `tool_use` function L413-424 — `( id: impl Into<String>, name: impl Into<String>, input: serde_json::Value, ) ->...` — Create a tool use content block.
- pub `tool_result_success` function L427-434 — `(tool_use_id: impl Into<String>, content: impl Into<String>) -> Self` — Create a successful tool result block.
- pub `tool_result_error` function L437-444 — `(tool_use_id: impl Into<String>, error: impl Into<String>) -> Self` — Create an error tool result block.
- pub `ToolDefinition` struct L449-458 — `{ name: String, description: String, input_schema: serde_json::Value }` — Definition of a tool available to the model.
- pub `new` function L462-472 — `( name: impl Into<String>, description: impl Into<String>, input_schema: serde_j...` — Create a new tool definition.
- pub `ToolChoice` enum L478-487 — `Auto | Any | Tool | None` — How the model should choose which tool to use.
- pub `CompletionResponse` struct L491-517 — `{ id: String, response_type: String, role: Role, content: Vec<ContentBlock>, mod...` — A completion response from the model.
- pub `new` function L525-542 — `( id: impl Into<String>, model: impl Into<String>, content: Vec<ContentBlock>, s...` — Create a new completion response.
- pub `tool_uses` function L545-562 — `(&self) -> Vec<ToolUseBlock>` — Get all tool use blocks from the response.
- pub `text` function L565-577 — `(&self) -> String` — Get the text content from the response.
- pub `has_tool_use` function L580-584 — `(&self) -> bool` — Check if the response contains tool use requests.
- pub `StopReason` enum L590-599 — `EndTurn | ToolUse | MaxTokens | StopSequence` — Why the model stopped generating.
- pub `Usage` struct L603-614 — `{ input_tokens: u32, output_tokens: u32, cache_creation_input_tokens: u32, cache...` — Token usage statistics.
- pub `new` function L618-625 — `(input_tokens: u32, output_tokens: u32) -> Self` — Create new usage statistics.
- pub `total` function L628-630 — `(&self) -> u32` — Total tokens used.
- pub `MuninnConfig` struct L635-647 — `{ recursive: bool, budget: BudgetConfig, include_metadata: bool }` — Muninn-specific configuration for recursive exploration.
- pub `recursive` function L665-671 — `() -> Self` — Create a new Muninn config with recursive exploration enabled.
- pub `with_budget` function L674-677 — `(mut self, budget: BudgetConfig) -> Self` — Set the budget configuration.
- pub `BudgetConfig` struct L682-698 — `{ max_tokens: Option<u64>, max_duration_secs: Option<u64>, max_depth: Option<u32...` — Budget configuration for recursive exploration.
- pub `ExplorationMetadata` struct L713-722 — `{ depth_reached: u32, tokens_used: u64, tool_calls: u32, duration_ms: u64 }` — Metadata about recursive exploration.
-  `SystemPrompt` type L32-44 — `= SystemPrompt` — while supporting Muninn-specific extensions for recursive exploration.
-  `CompletionRequest` type L103-147 — `= CompletionRequest` — while supporting Muninn-specific extensions for recursive exploration.
-  `Message` type L159-191 — `= Message` — while supporting Muninn-specific extensions for recursive exploration.
-  `Content` type L211-264 — `= Content` — while supporting Muninn-specific extensions for recursive exploration.
-  `ContentBlock` type L346-355 — `= ContentBlock` — while supporting Muninn-specific extensions for recursive exploration.
-  `from` function L347-354 — `(block: ToolUseBlock) -> Self` — while supporting Muninn-specific extensions for recursive exploration.
-  `ToolResultBlock` type L372-390 — `= ToolResultBlock` — while supporting Muninn-specific extensions for recursive exploration.
-  `ContentBlock` type L392-401 — `= ContentBlock` — while supporting Muninn-specific extensions for recursive exploration.
-  `from` function L393-400 — `(block: ToolResultBlock) -> Self` — while supporting Muninn-specific extensions for recursive exploration.
-  `ContentBlock` type L403-445 — `= ContentBlock` — while supporting Muninn-specific extensions for recursive exploration.
-  `ToolDefinition` type L460-473 — `= ToolDefinition` — while supporting Muninn-specific extensions for recursive exploration.
-  `default_message_type` function L519-521 — `() -> String` — while supporting Muninn-specific extensions for recursive exploration.
-  `CompletionResponse` type L523-585 — `= CompletionResponse` — while supporting Muninn-specific extensions for recursive exploration.
-  `Usage` type L616-631 — `= Usage` — while supporting Muninn-specific extensions for recursive exploration.
-  `default_true` function L649-651 — `() -> bool` — while supporting Muninn-specific extensions for recursive exploration.
-  `MuninnConfig` type L653-661 — `impl Default for MuninnConfig` — while supporting Muninn-specific extensions for recursive exploration.
-  `default` function L654-660 — `() -> Self` — while supporting Muninn-specific extensions for recursive exploration.
-  `MuninnConfig` type L663-678 — `= MuninnConfig` — while supporting Muninn-specific extensions for recursive exploration.
-  `BudgetConfig` type L700-709 — `impl Default for BudgetConfig` — while supporting Muninn-specific extensions for recursive exploration.
-  `default` function L701-708 — `() -> Self` — while supporting Muninn-specific extensions for recursive exploration.
-  `tests` module L725-843 — `-` — while supporting Muninn-specific extensions for recursive exploration.
-  `test_message_user` function L729-733 — `()` — while supporting Muninn-specific extensions for recursive exploration.
-  `test_message_assistant` function L736-740 — `()` — while supporting Muninn-specific extensions for recursive exploration.
-  `test_completion_request_builder` function L743-756 — `()` — while supporting Muninn-specific extensions for recursive exploration.
-  `test_completion_response_tool_uses` function L759-786 — `()` — while supporting Muninn-specific extensions for recursive exploration.
-  `test_tool_result_block` function L789-799 — `()` — while supporting Muninn-specific extensions for recursive exploration.
-  `test_serialize_deserialize_request` function L802-815 — `()` — while supporting Muninn-specific extensions for recursive exploration.
-  `test_budget_config_default` function L818-824 — `()` — while supporting Muninn-specific extensions for recursive exploration.
-  `test_content_blocks` function L827-842 — `()` — while supporting Muninn-specific extensions for recursive exploration.

### crates/muninn-rlm/src/engine

> *Semantic summary to be generated by AI agent.*

#### crates/muninn-rlm/src/engine/budget.rs

- pub `BudgetTracker` struct L13-19 — `{ config: BudgetConfig, started_at: Instant, tokens_used: u64, tool_calls: u32, ...` — Tracks resource usage against configured budget limits.
- pub `new` function L23-31 — `(config: BudgetConfig) -> Self` — Create a new budget tracker with the given configuration.
- pub `check_budget` function L34-77 — `(&self) -> Result<()>` — Check if any budget limit has been exceeded.
- pub `record_tokens` function L79-81 — `(&mut self, tokens: u64)` — during recursive exploration: tokens, time, depth, and tool calls.
- pub `record_tool_calls` function L83-85 — `(&mut self, count: u32)` — during recursive exploration: tokens, time, depth, and tool calls.
- pub `increment_depth` function L87-89 — `(&mut self)` — during recursive exploration: tokens, time, depth, and tool calls.
- pub `depth` function L91-93 — `(&self) -> u32` — during recursive exploration: tokens, time, depth, and tool calls.
- pub `tokens_used` function L95-97 — `(&self) -> u64` — during recursive exploration: tokens, time, depth, and tool calls.
- pub `tool_calls` function L99-101 — `(&self) -> u32` — during recursive exploration: tokens, time, depth, and tool calls.
- pub `elapsed` function L103-105 — `(&self) -> Duration` — during recursive exploration: tokens, time, depth, and tool calls.
- pub `is_last_turn` function L107-111 — `(&self) -> bool` — during recursive exploration: tokens, time, depth, and tool calls.
- pub `would_exceed_depth` function L113-117 — `(&self) -> bool` — during recursive exploration: tokens, time, depth, and tool calls.
- pub `config` function L119-121 — `(&self) -> &BudgetConfig` — during recursive exploration: tokens, time, depth, and tool calls.
- pub `summary` function L123-134 — `(&self) -> BudgetSummary` — during recursive exploration: tokens, time, depth, and tool calls.
- pub `BudgetSummary` struct L139-148 — `{ tokens_used: u64, token_limit: Option<u64>, tool_calls: u32, tool_call_limit: ...` — Summary of budget usage for reporting.
-  `BudgetTracker` type L21-135 — `= BudgetTracker` — during recursive exploration: tokens, time, depth, and tool calls.
-  `tests` module L151-211 — `-` — during recursive exploration: tokens, time, depth, and tool calls.
-  `test_new_tracker` function L155-160 — `()` — during recursive exploration: tokens, time, depth, and tool calls.
-  `test_record_tokens` function L163-168 — `()` — during recursive exploration: tokens, time, depth, and tool calls.
-  `test_check_budget_tokens_exceeded` function L171-182 — `()` — during recursive exploration: tokens, time, depth, and tool calls.
-  `test_is_last_turn` function L185-195 — `()` — during recursive exploration: tokens, time, depth, and tool calls.
-  `test_summary` function L198-210 — `()` — during recursive exploration: tokens, time, depth, and tool calls.

#### crates/muninn-rlm/src/engine/context.rs

- pub `ExplorationContext` struct L13-17 — `{ original_request: CompletionRequest, messages: Vec<Message>, budget: BudgetTra...` — Context for tracking exploration state.
- pub `new` function L20-26 — `(request: CompletionRequest, budget: BudgetConfig) -> Self` — Exploration context for tracking state during recursive exploration.
- pub `build_request` function L28-45 — `(&self) -> CompletionRequest` — Exploration context for tracking state during recursive exploration.
- pub `check_budget` function L47-49 — `(&self) -> crate::error::Result<()>` — Exploration context for tracking state during recursive exploration.
- pub `add_usage` function L51-53 — `(&mut self, usage: &Usage)` — Exploration context for tracking state during recursive exploration.
- pub `add_tool_interaction` function L55-64 — `( &mut self, response: CompletionResponse, results: Vec<ToolResultBlock>, )` — Exploration context for tracking state during recursive exploration.
- pub `increment_depth` function L66-68 — `(&mut self)` — Exploration context for tracking state during recursive exploration.
- pub `depth` function L70-72 — `(&self) -> u32` — Exploration context for tracking state during recursive exploration.
- pub `tool_call_count` function L74-76 — `(&self) -> u32` — Exploration context for tracking state during recursive exploration.
- pub `tokens_used` function L78-80 — `(&self) -> u64` — Exploration context for tracking state during recursive exploration.
- pub `is_last_turn` function L82-84 — `(&self) -> bool` — Exploration context for tracking state during recursive exploration.
- pub `would_exceed_depth` function L86-88 — `(&self) -> bool` — Exploration context for tracking state during recursive exploration.
- pub `inject_last_turn_warning` function L90-99 — `(&mut self)` — Exploration context for tracking state during recursive exploration.
- pub `elapsed` function L101-103 — `(&self) -> Duration` — Exploration context for tracking state during recursive exploration.
- pub `budget_config` function L105-107 — `(&self) -> &BudgetConfig` — Exploration context for tracking state during recursive exploration.
- pub `build_metadata` function L109-116 — `(&self) -> ExplorationMetadata` — Exploration context for tracking state during recursive exploration.
- pub `finalize` function L118-128 — `(&self, mut response: CompletionResponse) -> CompletionResponse` — Exploration context for tracking state during recursive exploration.
- pub `finalize_with_answer` function L130-149 — `( &self, mut response: CompletionResponse, answer: String, ) -> CompletionRespon...` — Exploration context for tracking state during recursive exploration.
-  `ExplorationContext` type L19-150 — `= ExplorationContext` — Exploration context for tracking state during recursive exploration.
-  `tests` module L153-225 — `-` — Exploration context for tracking state during recursive exploration.
-  `make_request` function L157-159 — `() -> CompletionRequest` — Exploration context for tracking state during recursive exploration.
-  `test_context_creation` function L162-167 — `()` — Exploration context for tracking state during recursive exploration.
-  `test_build_request` function L170-179 — `()` — Exploration context for tracking state during recursive exploration.
-  `test_add_usage` function L182-187 — `()` — Exploration context for tracking state during recursive exploration.
-  `test_finalize_with_metadata` function L190-206 — `()` — Exploration context for tracking state during recursive exploration.
-  `test_finalize_with_answer` function L209-224 — `()` — Exploration context for tracking state during recursive exploration.

#### crates/muninn-rlm/src/engine/dir_tree.rs

- pub `generate_dir_tree` function L11-21 — `(work_dir: &Path) -> Option<String>` — Generate a compact directory tree string for a given path.
-  `walk_dir` function L23-60 — `(dir: &Path, output: &mut String, depth: usize, max_depth: usize)` — to include in system prompts for project context.
-  `tests` module L63-123 — `-` — to include in system prompts for project context.
-  `test_generate_dir_tree_nonexistent` function L69-72 — `()` — to include in system prompts for project context.
-  `test_generate_dir_tree_basic` function L75-90 — `()` — to include in system prompts for project context.
-  `test_generate_dir_tree_filters_hidden` function L93-106 — `()` — to include in system prompts for project context.
-  `test_generate_dir_tree_filters_noise_dirs` function L109-122 — `()` — to include in system prompts for project context.

#### crates/muninn-rlm/src/engine/mod.rs

- pub `default_engine` function L46-53 — `( backend: Arc<dyn LLMBackend>, tools: Arc<dyn ToolEnvironment>, budget: Option<...` — Build a default [`MuninnEngine`] from the given backend, tools, and
- pub `default_engine_with_graph` function L58-77 — `( backend: Arc<dyn LLMBackend>, tools: Arc<dyn ToolEnvironment>, budget: Option<...` — Like [`default_engine`], but also wires a shared graph store
- pub `EngineDeps` struct L81-89 — `{ backend: Arc<dyn LLMBackend>, tools: Arc<dyn ToolEnvironment>, file_system: Op...` — Dependencies for the recursive engine.
- pub `new` function L92-99 — `(backend: Arc<dyn LLMBackend>, tools: Arc<dyn ToolEnvironment>) -> Self` — tracks budget usage, and handles termination conditions.
- pub `with_file_system` function L101-104 — `(mut self, fs: SharedFileSystem) -> Self` — tracks budget usage, and handles termination conditions.
- pub `with_graph_store` function L106-109 — `(mut self, store: crate::graph_tools::SharedGraphStore) -> Self` — tracks budget usage, and handles termination conditions.
- pub `file_system` function L111-115 — `(&self) -> SharedFileSystem` — tracks budget usage, and handles termination conditions.
- pub `EngineConfig` struct L130-135 — `{ budget: BudgetConfig, work_dir: Option<PathBuf>, temperature: Option<f32>, inj...` — Configuration for the recursive engine.
- pub `new` function L149-151 — `() -> Self` — tracks budget usage, and handles termination conditions.
- pub `with_budget` function L153-156 — `(mut self, budget: BudgetConfig) -> Self` — tracks budget usage, and handles termination conditions.
- pub `with_work_dir` function L158-161 — `(mut self, path: impl Into<PathBuf>) -> Self` — tracks budget usage, and handles termination conditions.
- pub `with_temperature` function L163-166 — `(mut self, temp: f32) -> Self` — tracks budget usage, and handles termination conditions.
- pub `without_temperature` function L168-171 — `(mut self) -> Self` — tracks budget usage, and handles termination conditions.
- pub `with_system_prompt_injection` function L173-176 — `(mut self, inject: bool) -> Self` — tracks budget usage, and handles termination conditions.
- pub `RecursiveEngine` struct L180-192 — `{ backend: Arc<dyn LLMBackend>, tools: Arc<dyn ToolEnvironment>, tool_executor: ...` — Recursive exploration engine.
- pub `new` function L195-209 — `(deps: EngineDeps, config: EngineConfig) -> Self` — tracks budget usage, and handles termination conditions.
- pub `with_deps` function L211-213 — `(deps: EngineDeps) -> Self` — tracks budget usage, and handles termination conditions.
- pub `from_components` function L215-217 — `(backend: Arc<dyn LLMBackend>, tools: Arc<dyn ToolEnvironment>) -> Self` — tracks budget usage, and handles termination conditions.
- pub `with_default_budget` function L220-223 — `(mut self, budget: BudgetConfig) -> Self` — tracks budget usage, and handles termination conditions.
- pub `with_work_dir` function L226-229 — `(mut self, path: impl Into<PathBuf>) -> Self` — tracks budget usage, and handles termination conditions.
- pub `complete` function L231-248 — `(&self, request: CompletionRequest) -> Result<CompletionResponse>` — tracks budget usage, and handles termination conditions.
-  `budget` module L7 — `-` — This module implements the core recursive exploration loop that orchestrates
-  `context` module L8 — `-` — tracks budget usage, and handles termination conditions.
-  `dir_tree` module L9 — `-` — tracks budget usage, and handles termination conditions.
-  `muninn_engine_impl` module L10 — `-` — tracks budget usage, and handles termination conditions.
-  `tool_executor` module L11 — `-` — tracks budget usage, and handles termination conditions.
-  `trace` module L12 — `-` — tracks budget usage, and handles termination conditions.
-  `tests` module L15 — `-` — tracks budget usage, and handles termination conditions.
-  `EngineDeps` type L91-116 — `= EngineDeps` — tracks budget usage, and handles termination conditions.
-  `EngineDeps` type L118-126 — `= EngineDeps` — tracks budget usage, and handles termination conditions.
-  `fmt` function L119-125 — `(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result` — tracks budget usage, and handles termination conditions.
-  `EngineConfig` type L137-146 — `impl Default for EngineConfig` — tracks budget usage, and handles termination conditions.
-  `default` function L138-145 — `() -> Self` — tracks budget usage, and handles termination conditions.
-  `EngineConfig` type L148-177 — `= EngineConfig` — tracks budget usage, and handles termination conditions.
-  `RecursiveEngine` type L194-444 — `= RecursiveEngine` — tracks budget usage, and handles termination conditions.
-  `prepare_recursive_request` function L250-304 — `(&self, mut request: CompletionRequest) -> CompletionRequest` — tracks budget usage, and handles termination conditions.
-  `RLM_CONTEXT_USER_MESSAGES` variable L257 — `: usize` — tracks budget usage, and handles termination conditions.
-  `run_exploration_loop` function L306-382 — `( &self, context: &mut ExplorationContext, ) -> Result<CompletionResponse>` — tracks budget usage, and handles termination conditions.
-  `end_rlm_span` function L384-395 — `(&self, context: &ExplorationContext, reason: &str, has_final: bool)` — tracks budget usage, and handles termination conditions.
-  `extract_final_pattern` function L397-407 — `(response: &CompletionResponse) -> Option<String>` — tracks budget usage, and handles termination conditions.
-  `extract_final_answer_tool` function L409-418 — `(response: &CompletionResponse) -> Option<String>` — tracks budget usage, and handles termination conditions.
-  `truncate_to_last_n_user_messages` function L422-443 — `(messages: Vec<Message>, n: usize) -> Vec<Message>` — Truncate messages to the last N user messages plus intervening assistant/tool messages.

#### crates/muninn-rlm/src/engine/muninn_engine_impl.rs

-  `RecursiveEngine` type L29-62 — `impl MuninnEngine for RecursiveEngine` — internal exploration tools may use it.
-  `complete` function L30-36 — `(&self, request: CompletionRequest) -> CoreResult<CompletionResponse>` — internal exploration tools may use it.
-  `search_code` function L38-46 — `(&self, query: SearchQuery) -> CoreResult<SearchResult>` — internal exploration tools may use it.
-  `explore` function L48-52 — `(&self, _request: ExploreRequest) -> CoreResult<ExploreResult>` — internal exploration tools may use it.
-  `query_graph` function L54-61 — `(&self, query: GraphQuery) -> CoreResult<GraphResult>` — internal exploration tools may use it.
-  `run_graph_query` function L75-157 — `( store: &crate::graph_tools::SharedGraphStore, query: muninn_core::types::Graph...` — Translate a [`GraphQuery`] into the appropriate
-  `extract_id` function L161-173 — `(value: &graphqlite::Value) -> Option<String>` — Pull the `id` string out of a graphqlite node Value.
-  `extract_location` function L177-194 — `(value: &graphqlite::Value) -> Option<String>` — Best-effort `file:line` extraction for the [`GraphNode::location`]
-  `rlm_to_core` function L197-208 — `(e: RlmError) -> MuninnCoreError` — Map a muninn-rlm `RlmError` to the adapter-neutral `MuninnCoreError`.
-  `format_budget` function L210-215 — `(b: &BudgetExceededError) -> String` — internal exploration tools may use it.

#### crates/muninn-rlm/src/engine/tests.rs

-  `create_engine` function L17-26 — `( responses: Vec<CompletionResponse>, tools: Vec<ToolDefinition>, ) -> (Recursiv...` — Tests for the recursive exploration engine.
-  `test_simple_completion` function L29-47 — `()` — Tests for the recursive exploration engine.
-  `test_tool_use_loop` function L50-96 — `()` — Tests for the recursive exploration engine.
-  `test_multiple_tool_calls` function L99-145 — `()` — Tests for the recursive exploration engine.
-  `test_exploration_metadata` function L148-186 — `()` — Tests for the recursive exploration engine.
-  `test_is_recursive` function L189-203 — `()` — Tests for the recursive exploration engine.
-  `test_engine_deps_creation` function L206-212 — `()` — Tests for the recursive exploration engine.
-  `test_engine_deps_with_file_system` function L215-225 — `()` — Tests for the recursive exploration engine.
-  `test_engine_config_default` function L228-236 — `()` — Tests for the recursive exploration engine.
-  `test_engine_config_builder` function L239-255 — `()` — Tests for the recursive exploration engine.
-  `test_engine_with_mocked_deps_simple` function L258-282 — `()` — Tests for the recursive exploration engine.
-  `test_engine_with_custom_budget` function L285-314 — `()` — Tests for the recursive exploration engine.
-  `test_from_components_convenience` function L317-323 — `()` — Tests for the recursive exploration engine.

#### crates/muninn-rlm/src/engine/tool_executor.rs

- pub `ToolExecutor` struct L20-22 — `{ tools: Arc<dyn ToolEnvironment> }` — Executes tool calls and collects results.
- pub `new` function L26-28 — `(tools: Arc<dyn ToolEnvironment>) -> Self` — Create a new tool executor with the given tool environment.
- pub `execute_tools` function L34-73 — `( &self, response: &CompletionResponse, ) -> Result<Vec<ToolResultBlock>>` — Execute all tool use requests from a response.
-  `ToolExecutor` type L24-99 — `= ToolExecutor` — requested by the LLM during exploration.
-  `extract_result_preview` function L76-85 — `(content: &Option<ToolResultContent>, max_len: usize) -> String` — Extract a preview from tool result content.
-  `truncate_string` function L88-98 — `(content: &str, max_len: usize) -> String` — Truncate a string for trace preview.
-  `tests` module L102-210 — `-` — requested by the LLM during exploration.
-  `create_tool_response` function L108-121 — `(tool_name: &str, tool_id: &str) -> CompletionResponse` — requested by the LLM during exploration.
-  `test_execute_single_tool` function L124-139 — `()` — requested by the LLM during exploration.
-  `test_execute_multiple_tools` function L142-173 — `()` — requested by the LLM during exploration.
-  `test_truncate_string_short` function L176-179 — `()` — requested by the LLM during exploration.
-  `test_truncate_string_long` function L182-187 — `()` — requested by the LLM during exploration.
-  `test_extract_result_preview_text` function L190-194 — `()` — requested by the LLM during exploration.
-  `test_extract_result_preview_none` function L197-200 — `()` — requested by the LLM during exploration.
-  `test_extract_result_preview_blocks` function L203-209 — `()` — requested by the LLM during exploration.

#### crates/muninn-rlm/src/engine/trace.rs

- pub `RlmCycleTraceData` struct L10-19 — `{ model: String, is_recursive: bool, initial_message_count: usize, system_prompt...` — Trace data captured at the start of an RLM exploration cycle.
- pub `RlmIterationTraceData` struct L23-38 — `{ depth: u32, is_last_turn: bool, message_count: usize, llm_latency_ms: u64, inp...` — Trace data for a single LLM iteration within exploration.
- pub `ToolExecutionTraceData` struct L42-55 — `{ tool_name: String, tool_id: String, input: serde_json::Value, success: bool, o...` — Trace data for tool execution.
- pub `RlmCompletionTraceData` struct L59-72 — `{ termination_reason: String, depth_reached: u32, tool_calls: u32, tokens_used: ...` — Trace data for exploration completion.
-  `tests` module L75-138 — `-` — These structures are used for observability, debugging, and performance analysis.
-  `test_cycle_trace_serialization` function L79-90 — `()` — These structures are used for observability, debugging, and performance analysis.
-  `test_iteration_trace_serialization` function L93-106 — `()` — These structures are used for observability, debugging, and performance analysis.
-  `test_tool_execution_trace_serialization` function L109-121 — `()` — These structures are used for observability, debugging, and performance analysis.
-  `test_completion_trace_serialization` function L124-137 — `()` — These structures are used for observability, debugging, and performance analysis.

### crates/muninn-rlm/src/testing

> *Semantic summary to be generated by AI agent.*

#### crates/muninn-rlm/src/testing/fixtures.rs

- pub `user_message` function L16-18 — `(content: &str) -> Message` — Create a user message with text content.
- pub `assistant_message` function L21-23 — `(content: &str) -> Message` — Create an assistant message with text content.
- pub `tool_result_message` function L26-28 — `(tool_use_id: &str, content: &str) -> Message` — Create a tool result message.
- pub `tool_error_message` function L31-33 — `(tool_use_id: &str, error: &str) -> Message` — Create an error tool result message.
- pub `simple_request` function L40-42 — `() -> CompletionRequest` — Create a simple completion request.
- pub `request_with_system` function L45-47 — `(system: &str) -> CompletionRequest` — Create a request with a system prompt.
- pub `recursive_request` function L50-57 — `() -> CompletionRequest` — Create a recursive exploration request.
- pub `request_with_tools` function L60-67 — `(tool_names: &[&str]) -> CompletionRequest` — Create a request with specific tools.
- pub `text_response` function L70-81 — `(content: &str) -> CompletionResponse` — Create a simple text response.
- pub `text_response_with_usage` function L84-95 — `(content: &str, input: u32, output: u32) -> CompletionResponse` — Create a response with custom usage.
- pub `tool_use_response` function L98-111 — `(tool_name: &str, args: serde_json::Value) -> CompletionResponse` — Create a tool use response.
- pub `multi_tool_response` function L114-133 — `(tools: Vec<(&str, serde_json::Value)>) -> CompletionResponse` — Create a response with multiple tool uses.
- pub `error_response` function L136-147 — `(error_msg: &str) -> CompletionResponse` — Create an error response (simulated by text with error indication).
- pub `tool_then_answer_responses` function L150-159 — `( tool_name: &str, tool_args: serde_json::Value, final_answer: &str, ) -> Vec<Co...` — Create a response sequence for tool use followed by final answer.
- pub `streaming_text_response` function L162-183 — `(content: &str) -> Vec<StreamEvent>` — Create a sequence of streaming events for text content.
- pub `streaming_text_chunked` function L186-213 — `(chunks: &[&str]) -> Vec<StreamEvent>` — Create streaming events with chunked text (simulates real streaming).
- pub `ResponseBuilder` struct L223-229 — `{ id: String, model: String, content: Vec<ContentBlock>, stop_reason: StopReason...` — Builder for creating custom completion responses.
- pub `new` function L233-241 — `() -> Self` — Create a new response builder.
- pub `with_id` function L244-247 — `(mut self, id: impl Into<String>) -> Self` — Set the response ID.
- pub `with_model` function L250-253 — `(mut self, model: impl Into<String>) -> Self` — Set the model name.
- pub `with_text` function L256-262 — `(mut self, text: impl Into<String>) -> Self` — Add text content.
- pub `with_tool_use` function L265-274 — `(mut self, name: impl Into<String>, input: serde_json::Value) -> Self` — Add tool use content.
- pub `with_stop_reason` function L277-280 — `(mut self, reason: StopReason) -> Self` — Set the stop reason.
- pub `with_usage` function L283-286 — `(mut self, input: u32, output: u32) -> Self` — Set usage statistics.
- pub `build` function L289-297 — `(self) -> CompletionResponse` — Build the completion response.
- pub `RequestBuilder` struct L311-318 — `{ model: String, messages: Vec<Message>, max_tokens: u32, system: Option<String>...` — Builder for creating custom completion requests.
- pub `new` function L322-331 — `() -> Self` — Create a new request builder with defaults.
- pub `model` function L334-337 — `(mut self, model: impl Into<String>) -> Self` — Set the model name.
- pub `message` function L340-343 — `(mut self, msg: Message) -> Self` — Add a message to the request.
- pub `user` function L346-348 — `(self, content: impl Into<String>) -> Self` — Add a user message.
- pub `assistant` function L351-353 — `(self, content: impl Into<String>) -> Self` — Add an assistant message.
- pub `system` function L356-359 — `(mut self, prompt: impl Into<String>) -> Self` — Set the system prompt.
- pub `max_tokens` function L362-365 — `(mut self, tokens: u32) -> Self` — Set max tokens.
- pub `recursive` function L368-371 — `(mut self) -> Self` — Enable recursive mode.
- pub `tool` function L374-377 — `(mut self, tool: ToolDefinition) -> Self` — Add a tool definition.
- pub `with_tools` function L380-389 — `(mut self, tool_names: &[&str]) -> Self` — Add multiple tools by name (creates simple tool definitions).
- pub `build` function L392-408 — `(self) -> CompletionRequest` — Build the completion request.
-  `uuid_v4_stub` function L216-220 — `() -> String` — Simple stub for generating unique-ish IDs in tests.
-  `COUNTER` variable L218 — `: AtomicU64` — Provides pre-built requests and responses to reduce test boilerplate.
-  `ResponseBuilder` type L231-298 — `= ResponseBuilder` — Provides pre-built requests and responses to reduce test boilerplate.
-  `ResponseBuilder` type L300-304 — `impl Default for ResponseBuilder` — Provides pre-built requests and responses to reduce test boilerplate.
-  `default` function L301-303 — `() -> Self` — Provides pre-built requests and responses to reduce test boilerplate.
-  `RequestBuilder` type L320-409 — `= RequestBuilder` — Provides pre-built requests and responses to reduce test boilerplate.
-  `RequestBuilder` type L411-415 — `impl Default for RequestBuilder` — Provides pre-built requests and responses to reduce test boilerplate.
-  `default` function L412-414 — `() -> Self` — Provides pre-built requests and responses to reduce test boilerplate.
-  `tests` module L418-593 — `-` — Provides pre-built requests and responses to reduce test boilerplate.
-  `test_simple_request` function L422-426 — `()` — Provides pre-built requests and responses to reduce test boilerplate.
-  `test_recursive_request` function L429-433 — `()` — Provides pre-built requests and responses to reduce test boilerplate.
-  `test_text_response` function L436-440 — `()` — Provides pre-built requests and responses to reduce test boilerplate.
-  `test_tool_use_response` function L443-450 — `()` — Provides pre-built requests and responses to reduce test boilerplate.
-  `test_response_builder` function L453-466 — `()` — Provides pre-built requests and responses to reduce test boilerplate.
-  `test_response_builder_with_tool` function L469-476 — `()` — Provides pre-built requests and responses to reduce test boilerplate.
-  `test_multi_tool_response` function L479-487 — `()` — Provides pre-built requests and responses to reduce test boilerplate.
-  `test_tool_then_answer_responses` function L490-500 — `()` — Provides pre-built requests and responses to reduce test boilerplate.
-  `test_user_message` function L503-506 — `()` — Provides pre-built requests and responses to reduce test boilerplate.
-  `test_assistant_message` function L509-512 — `()` — Provides pre-built requests and responses to reduce test boilerplate.
-  `test_tool_result_message` function L515-520 — `()` — Provides pre-built requests and responses to reduce test boilerplate.
-  `test_streaming_text_response` function L523-528 — `()` — Provides pre-built requests and responses to reduce test boilerplate.
-  `test_streaming_text_chunked` function L531-535 — `()` — Provides pre-built requests and responses to reduce test boilerplate.
-  `test_request_builder_basic` function L538-548 — `()` — Provides pre-built requests and responses to reduce test boilerplate.
-  `test_request_builder_with_system` function L551-558 — `()` — Provides pre-built requests and responses to reduce test boilerplate.
-  `test_request_builder_recursive` function L561-569 — `()` — Provides pre-built requests and responses to reduce test boilerplate.
-  `test_request_builder_with_tools` function L572-581 — `()` — Provides pre-built requests and responses to reduce test boilerplate.
-  `test_request_builder_conversation` function L584-592 — `()` — Provides pre-built requests and responses to reduce test boilerplate.

#### crates/muninn-rlm/src/testing/mock_backend.rs

- pub `MockLLMBackend` struct L36-47 — `{ responses: Arc<Mutex<VecDeque<CompletionResponse>>>, requests: Arc<Mutex<Vec<C...` — An enhanced mock LLM backend for testing.
- pub `new` function L51-59 — `() -> Self` — Create a new empty mock backend.
- pub `with_response` function L62-65 — `(self, response: CompletionResponse) -> Self` — Add a single response to the queue.
- pub `with_responses` function L68-75 — `(self, responses: Vec<CompletionResponse>) -> Self` — Add multiple responses to the queue.
- pub `with_tool_support` function L78-81 — `(mut self, enabled: bool) -> Self` — Enable or disable native tool support.
- pub `with_latency` function L84-87 — `(mut self, latency: Duration) -> Self` — Set simulated latency for responses.
- pub `with_name` function L90-93 — `(mut self, name: impl Into<String>) -> Self` — Set the backend name.
- pub `captured_requests` function L96-98 — `(&self) -> Vec<CompletionRequest>` — Get all captured requests.
- pub `request_count` function L101-103 — `(&self) -> usize` — Get the number of captured requests.
- pub `assert_request_count` function L110-117 — `(&self, expected: usize)` — Assert that exactly N requests were made.
- pub `last_request` function L120-122 — `(&self) -> Option<CompletionRequest>` — Get the last captured request.
- pub `clear_requests` function L125-127 — `(&self)` — Clear all captured requests.
- pub `queue_response` function L130-132 — `(&self, response: CompletionResponse)` — Queue a response for the next request.
- pub `remaining_responses` function L135-137 — `(&self) -> usize` — Get the number of remaining queued responses.
- pub `has_responses` function L140-142 — `(&self) -> bool` — Check if there are any remaining responses.
- pub `RequestMatcher` struct L224-227 — `{ model_pattern: Option<String>, message_contains: Option<String> }` — A request matcher for conditional responses.
- pub `any` function L231-236 — `() -> Self` — Match any request.
- pub `model` function L239-244 — `(model: impl Into<String>) -> Self` — Match requests to a specific model.
- pub `contains` function L247-252 — `(text: impl Into<String>) -> Self` — Match requests containing specific text.
- pub `matches` function L255-275 — `(&self, request: &CompletionRequest) -> bool` — Check if a request matches.
-  `MockLLMBackend` type L49-143 — `= MockLLMBackend` — pre-configured responses.
-  `MockLLMBackend` type L145-149 — `impl Default for MockLLMBackend` — pre-configured responses.
-  `default` function L146-148 — `() -> Self` — pre-configured responses.
-  `MockLLMBackend` type L151-161 — `impl Clone for MockLLMBackend` — pre-configured responses.
-  `clone` function L152-160 — `(&self) -> Self` — pre-configured responses.
-  `MockLLMBackend` type L164-221 — `impl LLMBackend for MockLLMBackend` — pre-configured responses.
-  `complete` function L165-179 — `(&self, request: CompletionRequest) -> Result<CompletionResponse>` — pre-configured responses.
-  `complete_stream` function L181-208 — `(&self, request: CompletionRequest) -> Result<ResponseStream>` — pre-configured responses.
-  `name` function L210-212 — `(&self) -> &str` — pre-configured responses.
-  `health_check` function L214-216 — `(&self) -> Result<()>` — pre-configured responses.
-  `supports_native_tools` function L218-220 — `(&self) -> bool` — pre-configured responses.
-  `RequestMatcher` type L229-276 — `= RequestMatcher` — pre-configured responses.
-  `tests` module L279-400 — `-` — pre-configured responses.
-  `test_mock_backend_single_response` function L285-293 — `()` — pre-configured responses.
-  `test_mock_backend_multiple_responses` function L296-307 — `()` — pre-configured responses.
-  `test_mock_backend_exhausted` function L310-315 — `()` — pre-configured responses.
-  `test_mock_backend_captured_requests` function L318-328 — `()` — pre-configured responses.
-  `test_mock_backend_queue_response` function L331-340 — `()` — pre-configured responses.
-  `test_mock_backend_with_tool_support` function L343-349 — `()` — pre-configured responses.
-  `test_mock_backend_streaming` function L352-370 — `()` — pre-configured responses.
-  `test_request_matcher_any` function L373-377 — `()` — pre-configured responses.
-  `test_request_matcher_model` function L380-387 — `()` — pre-configured responses.
-  `test_request_matcher_contains` function L390-399 — `()` — pre-configured responses.

#### crates/muninn-rlm/src/testing/mock_server.rs

- pub `MockLLMServer` struct L40-49 — `{ addr: SocketAddr, backend: Arc<MockLLMBackend>, shutdown_tx: Option<oneshot::S...` — An HTTP mock server for LLM API testing.
- pub `start` function L53-55 — `() -> Self` — Start a new mock server on a random available port.
- pub `start_with_backend` function L58-96 — `(backend: MockLLMBackend) -> Self` — Start a mock server with a pre-configured backend.
- pub `url` function L99-101 — `(&self) -> String` — Get the server's base URL.
- pub `addr` function L104-106 — `(&self) -> SocketAddr` — Get the server's address.
- pub `queue_response` function L109-111 — `(&self, response: CompletionResponse)` — Queue a response to be returned.
- pub `captured_requests` function L114-116 — `(&self) -> Vec<CompletionRequest>` — Get captured requests.
- pub `request_count` function L119-121 — `(&self) -> usize` — Get the number of requests made.
- pub `assert_request_count` function L124-126 — `(&self, expected: usize)` — Assert that exactly N requests were made.
- pub `clear_requests` function L129-131 — `(&self)` — Clear captured requests.
- pub `shutdown` function L134-141 — `(mut self)` — Shutdown the server.
-  `MockLLMServer` type L51-142 — `= MockLLMServer` — the full request/response cycle without real API calls.
-  `handle_messages` function L145-161 — `( State(backend): State<Arc<MockLLMBackend>>, Json(request): Json<CompletionRequ...` — Handle POST /v1/messages
-  `handle_health` function L164-166 — `() -> impl IntoResponse` — Handle GET /health
-  `tests` module L169-314 — `-` — the full request/response cycle without real API calls.
-  `test_mock_server_start_and_shutdown` function L174-179 — `()` — the full request/response cycle without real API calls.
-  `test_mock_server_health_check` function L182-198 — `()` — the full request/response cycle without real API calls.
-  `test_mock_server_completion_request` function L201-222 — `()` — the full request/response cycle without real API calls.
-  `test_mock_server_multiple_requests` function L225-258 — `()` — the full request/response cycle without real API calls.
-  `test_mock_server_no_response_error` function L261-286 — `()` — the full request/response cycle without real API calls.
-  `test_mock_server_captures_requests` function L289-313 — `()` — the full request/response cycle without real API calls.

#### crates/muninn-rlm/src/testing/mod.rs

- pub `fixtures` module L12 — `-` — This module provides mock implementations and test fixtures for testing
- pub `mock_backend` module L13 — `-` — - [`mock_server`]: HTTP mock server for integration tests
- pub `mock_server` module L14 — `-` — - [`mock_server`]: HTTP mock server for integration tests

### crates/muninn-rlm/tests

> *Semantic summary to be generated by AI agent.*

#### crates/muninn-rlm/tests/integration.rs

-  `get_test_port` function L14-18 — `() -> u16` — Get an available port for testing.
-  `test_proxy_health_check` function L22-69 — `()` — Test that the proxy server starts and handles health checks.
-  `test_proxy_completion_request` function L73-138 — `()` — Test that the proxy server handles completion requests.
-  `test_proxy_with_tools` function L142-234 — `()` — Test that tools are exposed and can be executed.
-  `test_passthrough_mode` function L238-289 — `()` — Test passthrough mode - requests go directly to upstream without RLM processing.
-  `test_text_trigger_forces_rlm` function L293-357 — `()` — Test text trigger forces RLM mode regardless of router.
-  `test_router_llm_decision` function L361-430 — `()` — Test router LLM makes routing decisions.
-  `test_graph_tools_integration` function L434-540 — `()` — Test graph tools integration through RLM.
-  `test_budget_depth_limit` function L544-632 — `()` — Test budget enforcement through proxy - depth limit.
-  `test_budget_tool_calls_limit` function L636-744 — `()` — Test budget enforcement - tool calls limit.
-  `test_malformed_request` function L748-785 — `()` — Test that malformed requests are handled gracefully.

### crates/muninn-tracing/examples

> *Semantic summary to be generated by AI agent.*

#### crates/muninn-tracing/examples/demo_trace.rs

-  `ProxyRequestData` struct L12-16 — `{ model: String, streaming: bool, message_count: usize }` — Demo of the tracing system simulating a proxy -> router -> RLM flow.
-  `RouterDecisionData` struct L19-24 — `{ strategy: String, decision: String, reason: Option<String>, decision_time_ms: ...` — Demo of the tracing system simulating a proxy -> router -> RLM flow.
-  `RlmIterationData` struct L27-32 — `{ depth: u32, llm_latency_ms: u64, input_tokens: u32, output_tokens: u32 }` — Demo of the tracing system simulating a proxy -> router -> RLM flow.
-  `ToolExecutionData` struct L35-39 — `{ tool_name: String, success: bool, execution_time_ms: u64 }` — Demo of the tracing system simulating a proxy -> router -> RLM flow.
-  `simulate_tool_call` function L41-51 — `(name: &str)` — Demo of the tracing system simulating a proxy -> router -> RLM flow.
-  `simulate_rlm_iteration` function L53-67 — `(depth: u32)` — Demo of the tracing system simulating a proxy -> router -> RLM flow.
-  `simulate_request` function L69-118 — `() -> String` — Demo of the tracing system simulating a proxy -> router -> RLM flow.
-  `main` function L121-148 — `() -> Result<(), Box<dyn std::error::Error>>` — Demo of the tracing system simulating a proxy -> router -> RLM flow.

### crates/muninn-tracing/src

> *Semantic summary to be generated by AI agent.*

#### crates/muninn-tracing/src/collector.rs

- pub `TraceCollector` struct L18-22 — `{ trace: Trace, start_instant: Instant, span_stack: Vec<Span> }` — Collects trace data during a request/operation lifecycle.
- pub `new` function L26-32 — `() -> Self` — Create a new collector with a random trace ID.
- pub `with_trace_id` function L35-41 — `(trace_id: impl Into<String>) -> Self` — Create a new collector with a specific trace ID.
- pub `add_metadata` function L44-48 — `(&mut self, key: impl Into<String>, value: impl serde::Serialize)` — Add metadata to the trace.
- pub `start_span` function L51-53 — `(&mut self, name: impl Into<String>)` — Start a new span.
- pub `start_span_with_data` function L56-58 — `(&mut self, name: impl Into<String>, data: impl serde::Serialize)` — Start a span with attached data.
- pub `record_event` function L61-65 — `(&mut self, name: impl Into<String>, data: Option<impl serde::Serialize>)` — Record an event in the current span.
- pub `set_current_timing` function L68-72 — `(&mut self, timing: Timing)` — Set timing breakdown for the current span.
- pub `end_span_ok` function L75-80 — `(&mut self)` — End the current span successfully.
- pub `end_span_error` function L83-88 — `(&mut self, message: impl Into<String>)` — End the current span with an error.
- pub `add_span` function L91-93 — `(&mut self, span: Span)` — Add a complete span directly.
- pub `finalize` function L105-114 — `(mut self) -> Trace` — Finalize the trace and return it.
- pub `trace_id` function L117-119 — `(&self) -> &str` — Get the trace ID.
- pub `elapsed_ms` function L122-124 — `(&self) -> u64` — Get elapsed time since trace started.
- pub `with_tracing` function L136-150 — `(f: F) -> (T, Trace)` — Execute an async operation with tracing enabled.
- pub `with_tracing_id` function L153-168 — `(trace_id: impl Into<String>, f: F) -> (T, Trace)` — Execute an async operation with tracing, using a specific trace ID.
- pub `is_tracing_active` function L171-173 — `() -> bool` — Check if tracing is active in the current task.
- pub `add_metadata` function L176-178 — `(key: impl Into<String>, value: impl serde::Serialize)` — Add metadata to the current trace (no-op if tracing not active).
- pub `start_span` function L181-183 — `(name: impl Into<String>)` — Start a new span in the current trace (no-op if tracing not active).
- pub `start_span_with_data` function L186-188 — `(name: impl Into<String>, data: impl serde::Serialize)` — Start a span with data in the current trace (no-op if tracing not active).
- pub `record_event` function L191-193 — `(name: impl Into<String>, data: Option<impl serde::Serialize>)` — Record an event in the current span (no-op if tracing not active).
- pub `set_timing` function L196-198 — `(timing: Timing)` — Set timing for the current span (no-op if tracing not active).
- pub `end_span_ok` function L201-203 — `()` — End the current span successfully (no-op if tracing not active).
- pub `end_span_error` function L206-208 — `(message: impl Into<String>)` — End the current span with an error (no-op if tracing not active).
- pub `current_trace_id` function L211-215 — `() -> Option<String>` — Get the current trace ID (returns None if tracing not active).
-  `TraceCollector` type L24-125 — `= TraceCollector` — Consumers create spans and events; the collector aggregates them into a Trace.
-  `attach_span` function L95-102 — `(&mut self, span: Span)` — Consumers create spans and events; the collector aggregates them into a Trace.
-  `TraceCollector` type L127-131 — `impl Default for TraceCollector` — Consumers create spans and events; the collector aggregates them into a Trace.
-  `default` function L128-130 — `() -> Self` — Consumers create spans and events; the collector aggregates them into a Trace.
-  `tests` module L218-249 — `-` — Consumers create spans and events; the collector aggregates them into a Trace.
-  `test_with_tracing` function L222-238 — `()` — Consumers create spans and events; the collector aggregates them into a Trace.
-  `test_no_tracing_context` function L241-248 — `()` — Consumers create spans and events; the collector aggregates them into a Trace.

#### crates/muninn-tracing/src/lib.rs

- pub `collector` module L49 — `-` — This crate provides the foundation for structured tracing of agentic operations:
- pub `types` module L50 — `-` — ```
- pub `writer` module L51 — `-` — ```

#### crates/muninn-tracing/src/types.rs

- pub `Trace` struct L12-31 — `{ trace_id: String, started_at: DateTime<Utc>, ended_at: Option<DateTime<Utc>>, ...` — A complete trace representing one logical operation (e.g., one request lifecycle).
- pub `Span` struct L37-69 — `{ span_id: String, name: String, started_at: DateTime<Utc>, ended_at: Option<Dat...` — A named, timed operation within a trace.
- pub `SpanOutcome` enum L74-82 — `Ok | Error` — Outcome of a span's execution.
- pub `Event` struct L86-96 — `{ name: String, timestamp: DateTime<Utc>, data: Option<serde_json::Value> }` — A point-in-time occurrence within a span.
- pub `Timing` struct L100-107 — `{ total_ms: u64, segments: HashMap<String, u64> }` — Timing breakdown for granular performance analysis.
- pub `new` function L111-120 — `(trace_id: impl Into<String>) -> Self` — Create a new trace with the given ID.
- pub `new_random` function L123-125 — `() -> Self` — Generate a new trace with a random UUID.
- pub `with_metadata` function L128-133 — `(mut self, key: impl Into<String>, value: impl Serialize) -> Self` — Add metadata to the trace.
- pub `complete` function L136-140 — `(&mut self)` — Mark the trace as complete.
- pub `add_span` function L143-145 — `(&mut self, span: Span)` — Add a span to the trace.
- pub `new` function L150-162 — `(name: impl Into<String>) -> Self` — Create a new span.
- pub `with_data` function L165-168 — `(mut self, data: impl Serialize) -> Self` — Attach domain-specific data to the span.
- pub `complete_ok` function L171-175 — `(&mut self)` — Mark the span as complete with success.
- pub `complete_error` function L178-184 — `(&mut self, message: impl Into<String>)` — Mark the span as complete with an error.
- pub `add_event` function L187-189 — `(&mut self, event: Event)` — Add an event to the span.
- pub `record_event` function L192-198 — `(&mut self, name: impl Into<String>, data: Option<impl Serialize>)` — Record an event with the given name and optional data.
- pub `add_child` function L201-203 — `(&mut self, child: Span)` — Add a child span.
- pub `set_timing` function L206-208 — `(&mut self, timing: Timing)` — Set timing breakdown.
- pub `new` function L227-232 — `(total_ms: u64) -> Self` — Create a new timing with total milliseconds.
- pub `with_segment` function L235-238 — `(mut self, name: impl Into<String>, ms: u64) -> Self` — Add a named timing segment.
-  `Trace` type L109-146 — `= Trace` — define their domain-specific data and attach it as serializable payloads.
-  `Span` type L148-223 — `= Span` — define their domain-specific data and attach it as serializable payloads.
-  `calculate_timing` function L210-222 — `(&mut self)` — define their domain-specific data and attach it as serializable payloads.
-  `Timing` type L225-239 — `= Timing` — define their domain-specific data and attach it as serializable payloads.
-  `tests` module L242-281 — `-` — define their domain-specific data and attach it as serializable payloads.
-  `test_trace_creation` function L246-250 — `()` — define their domain-specific data and attach it as serializable payloads.
-  `test_span_with_data` function L253-261 — `()` — define their domain-specific data and attach it as serializable payloads.
-  `MyData` struct L255-257 — `{ value: i32 }` — define their domain-specific data and attach it as serializable payloads.
-  `test_trace_serialization` function L264-280 — `()` — define their domain-specific data and attach it as serializable payloads.

#### crates/muninn-tracing/src/writer.rs

- pub `WriteError` enum L18-24 — `Io | Serialization` — Error type for trace writing operations.
- pub `WriterConfig` struct L28-39 — `{ trace_path: PathBuf, enabled: bool, session_mode: bool }` — Configuration for the trace writer.
- pub `session` function L49-55 — `(trace_file: impl Into<PathBuf>) -> Self` — Create a config for session-based logging (single file).
- pub `daily_rotation` function L58-64 — `(trace_dir: impl Into<PathBuf>) -> Self` — Create a config for daily rotation (legacy mode).
- pub `new` function L67-69 — `(trace_dir: impl Into<PathBuf>) -> Self` — Create a new config with the given trace directory (legacy API).
- pub `disabled` function L72-78 — `() -> Self` — Disable tracing.
- pub `TraceWriter` struct L84-87 — `{ config: WriterConfig, current_file: Mutex<Option<CurrentFile>> }` — Writes traces to JSONL files.
- pub `new` function L97-114 — `(config: WriterConfig) -> Result<Self, WriteError>` — Create a new trace writer with the given configuration.
- pub `with_defaults` function L117-119 — `() -> Result<Self, WriteError>` — Create a trace writer with default configuration.
- pub `write` function L122-138 — `(&self, trace: &Trace) -> Result<(), WriteError>` — Write a trace to the appropriate file.
- pub `current_file_path` function L201-208 — `(&self) -> PathBuf` — Get the path to the current trace file.
- pub `list_trace_files` function L212-233 — `(&self) -> Result<Vec<PathBuf>, WriteError>` — List all trace files in the trace directory.
- pub `read_traces` function L236-244 — `(path: &Path) -> Result<Vec<Trace>, WriteError>` — Read traces from a specific file.
-  `WriterConfig` type L41-45 — `impl Default for WriterConfig` — - **Daily rotation**: Writes to dated files (e.g., `traces/2026-01-11.jsonl`)
-  `default` function L42-44 — `() -> Self` — - **Daily rotation**: Writes to dated files (e.g., `traces/2026-01-11.jsonl`)
-  `WriterConfig` type L47-79 — `= WriterConfig` — - **Daily rotation**: Writes to dated files (e.g., `traces/2026-01-11.jsonl`)
-  `CurrentFile` struct L89-93 — `{ key: String, writer: BufWriter<File> }` — - **Daily rotation**: Writes to dated files (e.g., `traces/2026-01-11.jsonl`)
-  `TraceWriter` type L95-245 — `= TraceWriter` — - **Daily rotation**: Writes to dated files (e.g., `traces/2026-01-11.jsonl`)
-  `write_session_mode` function L140-164 — `( &self, guard: &mut Option<CurrentFile>, trace: &Trace, ) -> Result<(), WriteEr...` — - **Daily rotation**: Writes to dated files (e.g., `traces/2026-01-11.jsonl`)
-  `write_daily_mode` function L166-198 — `( &self, guard: &mut Option<CurrentFile>, trace: &Trace, ) -> Result<(), WriteEr...` — - **Daily rotation**: Writes to dated files (e.g., `traces/2026-01-11.jsonl`)
-  `tests` module L248-320 — `-` — - **Daily rotation**: Writes to dated files (e.g., `traces/2026-01-11.jsonl`)
-  `test_write_and_read_trace_daily` function L253-269 — `()` — - **Daily rotation**: Writes to dated files (e.g., `traces/2026-01-11.jsonl`)
-  `test_write_and_read_trace_session` function L272-294 — `()` — - **Daily rotation**: Writes to dated files (e.g., `traces/2026-01-11.jsonl`)
-  `test_disabled_writer` function L297-310 — `()` — - **Daily rotation**: Writes to dated files (e.g., `traces/2026-01-11.jsonl`)
-  `test_legacy_api_compatibility` function L313-319 — `()` — - **Daily rotation**: Writes to dated files (e.g., `traces/2026-01-11.jsonl`)

### crates/tests/tests

> *Semantic summary to be generated by AI agent.*

#### crates/tests/tests/cross_crate.rs

-  `get_test_port` function L15-18 — `() -> u16` — Get an available port for testing.
-  `test_e2e_passthrough_flow` function L27-87 — `()` — E2E Test: Full passthrough flow through the proxy
-  `test_e2e_rlm_recursive_flow` function L98-205 — `()` — E2E Test: Full RLM recursive flow through the proxy
-  `test_e2e_graph_tools_integration` function L212-315 — `()` — E2E Test: Graph tools integration across crates

### tools

> *Semantic summary to be generated by AI agent.*

#### tools/capture_proxy.py

- pub `CaptureHandler` class L23-121 — `(BaseHTTPRequestHandler) { do_POST, do_GET, log_message }`
- pub `do_POST` method L24-102 — `def do_POST(self)`
- pub `do_GET` method L104-117 — `def do_GET(self)`
- pub `log_message` method L119-121 — `def log_message(self, format, *args)`

