The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.
Rust agent-orchestrationai-agentsai-assistantdesktopllmlocal-firstmcppersonal-aiprivacyrustsecond-braintauri
docs(architecture): fix markdown table formatting
Steven Enamakel9a16b3984fbd
diff --git a/AGENTS.md b/AGENTS.mdindex 40b3cbb1e4..e2ae8e2346 100644--- a/AGENTS.md+++ b/AGENTS.md@@ -17,7 +17,6 @@ Architecture: [overview](gitbooks/developing/architecture.md),| `crates/openhuman-core/` | Package `openhuman`: business domains under `src/<domain>/`, the controller contract, dispatch and auth under `src/core/` || `crates/openhuman-core/src/<domain>/` | Flat business-domain modules (agent, memory, tools, security, channels, ...) || `crates/openhuman-core/src/storage/` | The process's storage backend on the `tinystoragedrivers` ports: URL resolution (`OPENHUMAN_STORAGE_URL` / `[storage] url`), the install slot, agent scopes (`local` for the operator), and the base the domain stores build on. Features `storage-sqlite`, `storage-file`, `storage-mongodb`; see `gitbooks/developing/architecture/storage.md` |-| `crates/openhuman-core/src/storage/` | The process's storage backend on the `tinystoragedrivers` ports: URL resolution (`OPENHUMAN_STORAGE_URL` / `[storage] url`), the install slot, agent scopes (`local` for the operator), and the base the domain stores build on. Features `storage-sqlite`, `storage-file`, `storage-mongodb`; see `gitbooks/developing/architecture/storage.md` || `crates/openhuman-core/src/core/` | CLI, controller contract (`Outcome`, schemas) and in-process dispatch, controller registry, event bus, runtime composition; no business logic and no JSON-RPC server || `crates/openhuman-cli/` | The `openhuman-core` binary (`src/main.rs`, `openhuman_rpc::host::cli`), the ops bins (`src/bin/`: `openhuman-fleet`, `test-mcp-stub`), and every root `tests/*.rs` / `examples/*.rs` target. Normal dependency: `openhuman-rpc` only; the tests reach core, embed and tinyhumans through `[dev-dependencies]`. The benchmark bins live in the openhuman-benchmarks repository || `crates/openhuman-embed/` | Library facade over the core (depends on core only): `Runtime`/`RuntimeBuilder` with host presets, `embed::process` (tokio runtime, logging, dotenv, master key, Sentry options), and the curated facades hosts use (`config`, `artifacts`, `chat_surface`, `modules`, `identity`). Its doc-hidden `__host` list is for tinyhumans and rpc only |diff --git a/gitbooks/developing/architecture.md b/gitbooks/developing/architecture.mdindex ccf72c1b37..01fd760840 100644--- a/gitbooks/developing/architecture.md+++ b/gitbooks/developing/architecture.md@@ -17,21 +17,21 @@ OpenHuman ships for desktop only: Windows, macOS and Linux. Web is not a support## Repository layout (monorepo)-| Path | Contents |-| --------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |-| `app/` | pnpm workspace `openhuman-app`: Vite/React UI (`app/src/`), Vitest and WDIO tests. The Tauri shell itself is the Rust crate `crates/openhuman-app/` (below). |-| `crates/openhuman-app/` | Thin Tauri v2 desktop host (Cargo package `openhuman-app`). Built from its own manifest and lockfile, excluded from the root workspace; depends on `openhuman-rpc` only and hosts the core as an in-process tokio task (`src/core_process.rs`, `openhuman_rpc::host::desktop`). |-| `crates/openhuman-core/` | Cargo package `openhuman`, library `openhuman_core`, with no `tinyhumans-sdk` dependency. The hosted backend is reached through the `backend::transport::BackendTransport` port, except hosted memory, which `vendor/tinymemory`'s own HTTP client calls (see `memory/engine.rs`). Flat domain modules directly under `src/` (`agent`, `backend`, `channels`, `config`, `cron`, `desktop`, `flows`, `hooks`, `hosting`, `inference`, `integrations`, `mcp`, `media`, `memory`, `modules`, `platform`, `runtime`, `sandbox`, `search`, `security`, `skills`, `threads`, `tools`, `util`, `voice`, `web3`, `web_chat`, …). `src/core/` holds the CLI (`cli.rs`), dispatch, controller registry (`all.rs`), event bus (`bus.rs`), `runtime/` (`CoreBuilder`/`CoreRuntime`) and `subsystem/`. |-| `crates/openhuman-rpc/` | Top of the library chain (depends on `openhuman-tinyhumans`): JSON-RPC 2.0 envelopes, the server (router, Socket.IO, listener, `run_server*`), and the shared host boot `host::{cli, desktop, tui}` the three hosts call; re-exports `embed` and `tinyhumans` as their curated facade. The `http-client` feature (default on; off for root-workspace consumers) adds `post_json_rpc`, `bearer_header`, `redact_url_for_log`, `HttpRpcResponse`. Used by the Tauri shell (`core_rpc.rs` → `relay_http_rpc`) and the TUI (envelope decoding). The core does not depend on this crate and does not re-export it: the controller contract (`Outcome`, `ControllerSchema`, `StructuredRpcError`, params rules, in-process dispatch) lives in `crates/openhuman-core/src/core/`, and this crate sits above it. Behind `server` it also owns the `http_host` static-directory file server and registers its controllers as a core extension. |-| `crates/openhuman-embed/` | Typed library facade (`Runtime`/`RuntimeBuilder` → `Agent`, host presets, `embed::process`, and the `config` / `artifacts` / `chat_surface` / `modules` facades) for embedding the core in another product; forwards the core's feature gates. Installs no backend transport itself. |-| `crates/openhuman-tinyhumans/` | The TinyHumans layer above embed: `SdkBackendTransport` (the only crate that depends on the vendored `tinyhumans-sdk`), `install()` for hosts that boot the core themselves, a `RuntimeBuilder` that boots an embed runtime connected, the hosted RPC proxies (`hosted/`, all on the SDK's typed clients through one `hosted::client::HostedClient`: billing, team and usage, referral, announcements, webhook tunnels, managed Telegram/Discord linking, and backend-brokered OAuth; registered into the core's controller registry as an extension, some sharing the core's `auth` / `channels` / `webhooks` namespaces), and the host-side login/session owner (`session/`). A user without a TinyHumans account gets the core's `BACKEND_UNAVAILABLE:` sentinel from these without a request. |-| `crates/openhuman-cli/` | The `openhuman-core` binary (`openhuman_rpc::host::cli`), the ops bins, and every root `tests/*.rs` / `examples/*.rs` target (which reach the core through dev-dependencies). The benchmark bins live in [openhuman-benchmarks](https://github.com/tinyhumansai/openhuman-benchmarks). |-| `crates/openhuman-tui/` | Standalone ratatui terminal frontend. Boots the core in-process via `openhuman_rpc::host::tui` (every domain, no background services), no HTTP. |-| `Cargo.toml` (root) | Virtual workspace for `openhuman-core`, `openhuman-embed`, `openhuman-rpc`, `openhuman-tinyhumans`, `openhuman-cli`, and `openhuman-tui` (`cargo build -p openhuman-cli --bin openhuman-core` builds the standalone CLI/server); `vendor/`, `worktrees/`, `crates/openhuman-app`, `app/src-tauri-mobile`, and `packages/tauri-plugin-ptt` are excluded. Holds the `[patch]` tables for vendored crates. There is no sidecar: the desktop bundle links the core in-process. |-| `crates/openhuman-core/src/skills/` | Skill metadata and run orchestration (`ops_create`, `ops_discover`, `ops_install`, `ops_parse`, `catalog/`, `registry`, `runtime/`, `schemas/`, `types`, `bundled/`, `webhooks/`). Skills contribute metadata and tool descriptors that are injected into agent prompts. Tool execution flows through native Rust handlers and Node-backed helpers via `runtime::node` (Cargo feature `runtime-node`). |-| `gitbooks/` | This book (public product and contributor documentation). |-| `docs/` | Internal maintainer documentation (test-coverage matrix, release smoke checklist, library benchmarking notes). |-| `vendor/` | Recursive git submodules for the `tiny*` crate family (`tinyagents`, `tinyflows`, `tinychannels`, `tinyjuice`, `tinymemory`, `tinymcp`, `tinybus`, `tinybox`, `tinycomputer`, `tinyruntime`, `tinydocs`, `tinysearch`, `tinyskills`, `tinyvoice`, `tinywallet`, `tinyhosts`, `tinyconnectors`, `tinyhumans-sdk`) plus `motosan-ai-oauth`. |+| Path | Contents |+| ----------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |+| `app/` | pnpm workspace `openhuman-app`: Vite/React UI (`app/src/`), Vitest and WDIO tests. The Tauri shell itself is the Rust crate `crates/openhuman-app/` (below). |+| `crates/openhuman-app/` | Thin Tauri v2 desktop host (Cargo package `openhuman-app`). Built from its own manifest and lockfile, excluded from the root workspace; depends on `openhuman-rpc` only and hosts the core as an in-process tokio task (`src/core_process.rs`, `openhuman_rpc::host::desktop`). |+| `crates/openhuman-core/` | Cargo package `openhuman`, library `openhuman_core`, with no `tinyhumans-sdk` dependency. The hosted backend is reached through the `backend::transport::BackendTransport` port, except hosted memory, which `vendor/tinymemory`'s own HTTP client calls (see `memory/engine.rs`). Flat domain modules directly under `src/` (`agent`, `backend`, `channels`, `config`, `cron`, `desktop`, `flows`, `hooks`, `hosting`, `inference`, `integrations`, `mcp`, `media`, `memory`, `modules`, `platform`, `runtime`, `sandbox`, `search`, `security`, `skills`, `threads`, `tools`, `util`, `voice`, `web3`, `web_chat`, …). `src/core/` holds the CLI (`cli.rs`), dispatch, controller registry (`all.rs`), event bus (`bus.rs`), `runtime/` (`CoreBuilder`/`CoreRuntime`) and `subsystem/`. |+| `crates/openhuman-rpc/` | Top of the library chain (depends on `openhuman-tinyhumans`): JSON-RPC 2.0 envelopes, the server (router, Socket.IO, listener, `run_server*`), and the shared host boot `host::{cli, desktop, tui}` the three hosts call; re-exports `embed` and `tinyhumans` as their curated facade. The `http-client` feature (default on; off for root-workspace consumers) adds `post_json_rpc`, `bearer_header`, `redact_url_for_log`, `HttpRpcResponse`. Used by the Tauri shell (`core_rpc.rs` → `relay_http_rpc`) and the TUI (envelope decoding). The core does not depend on this crate and does not re-export it: the controller contract (`Outcome`, `ControllerSchema`, `StructuredRpcError`, params rules, in-process dispatch) lives in `crates/openhuman-core/src/core/`, and this crate sits above it. Behind `server` it also owns the `http_host` static-directory file server and registers its controllers as a core extension. |+| `crates/openhuman-embed/` | Typed library facade (`Runtime`/`RuntimeBuilder` → `Agent`, host presets, `embed::process`, and the `config` / `artifacts` / `chat_surface` / `modules` facades) for embedding the core in another product; forwards the core's feature gates. Installs no backend transport itself. |+| `crates/openhuman-tinyhumans/` | The TinyHumans layer above embed: `SdkBackendTransport` (the only crate that depends on the vendored `tinyhumans-sdk`), `install()` for hosts that boot the core themselves, a `RuntimeBuilder` that boots an embed runtime connected, the hosted RPC proxies (`hosted/`, all on the SDK's typed clients through one `hosted::client::HostedClient`: billing, team and usage, referral, announcements, webhook tunnels, managed Telegram/Discord linking, and backend-brokered OAuth; registered into the core's controller registry as an extension, some sharing the core's `auth` / `channels` / `webhooks` namespaces), and the host-side login/session owner (`session/`). A user without a TinyHumans account gets the core's `BACKEND_UNAVAILABLE:` sentinel from these without a request. |+| `crates/openhuman-cli/` | The `openhuman-core` binary (`openhuman_rpc::host::cli`), the ops bins, and every root `tests/*.rs` / `examples/*.rs` target (which reach the core through dev-dependencies). The benchmark bins live in [openhuman-benchmarks](https://github.com/tinyhumansai/openhuman-benchmarks). |+| `crates/openhuman-tui/` | Standalone ratatui terminal frontend. Boots the core in-process via `openhuman_rpc::host::tui` (every domain, no background services), no HTTP. |+| `Cargo.toml` (root) | Virtual workspace for `openhuman-core`, `openhuman-embed`, `openhuman-rpc`, `openhuman-tinyhumans`, `openhuman-cli`, and `openhuman-tui` (`cargo build -p openhuman-cli --bin openhuman-core` builds the standalone CLI/server); `vendor/`, `worktrees/`, `crates/openhuman-app`, `app/src-tauri-mobile`, and `packages/tauri-plugin-ptt` are excluded. Holds the `[patch]` tables for vendored crates. There is no sidecar: the desktop bundle links the core in-process. |+| `crates/openhuman-core/src/skills/` | Skill metadata and run orchestration (`ops_create`, `ops_discover`, `ops_install`, `ops_parse`, `catalog/`, `registry`, `runtime/`, `schemas/`, `types`, `bundled/`, `webhooks/`). Skills contribute metadata and tool descriptors that are injected into agent prompts. Tool execution flows through native Rust handlers and Node-backed helpers via `runtime::node` (Cargo feature `runtime-node`). |+| `gitbooks/` | This book (public product and contributor documentation). |+| `docs/` | Internal maintainer documentation (test-coverage matrix, release smoke checklist, library benchmarking notes). |+| `vendor/` | Recursive git submodules for the `tiny*` crate family (`tinyagents`, `tinyflows`, `tinychannels`, `tinyjuice`, `tinymemory`, `tinymcp`, `tinybus`, `tinybox`, `tinycomputer`, `tinyruntime`, `tinydocs`, `tinysearch`, `tinyskills`, `tinyvoice`, `tinywallet`, `tinyhosts`, `tinyconnectors`, `tinyhumans-sdk`) plus `motosan-ai-oauth`. |The desktop app's webview loads the UI from `app/`. RPC, agents and skills run in the `openhuman_core` core, hosted in-process as a tokio task by the Tauri shell (`crates/openhuman-app/src/core_process.rs`, `openhuman_rpc::host::desktop`) and reachable over loopback HTTP. The renderer's `coreRpcClient` `fetch()`es `http://127.0.0.1:<port>/rpc` directly. The `relay_http_rpc` Tauri command (backed by `openhuman_rpc::post_json_rpc`) is only the fallback for non-loopback plain-`http://` runtimes that the webview would block as mixed content. The standalone `openhuman-core serve` binary is the CLI/debug path.@@ -145,7 +145,7 @@ OpenHuman uses Tauri and Rust instead of Electron for performance and security.| Metric | OpenHuman (Tauri + Rust) | Typical Electron App || ------------------------- | -------------------------------------------------------------------------- | ---------------------------------------- |-| Binary size | Feature-dependent (native Wry webview; no bundled Chromium) | ~150 MB+ |+| Binary size | Feature-dependent (native Wry webview; no bundled Chromium) | ~150 MB+ || Memory per tool execution | Native Rust (no per-tool VM); shared managed Node runtime for helper calls | ~150 MB+ (Chromium renderer per process) || Cold startup | Sub-500ms | 2-5 seconds || Garbage collection pauses | None (Rust ownership model) | V8 GC pauses |@@ -192,10 +192,10 @@ Skills are `SKILL.md` packages (metadata, instructions, and optional bundled scrThree domains share the work:-| Domain | Role |-| ------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- |-| `crates/openhuman-core/src/skills/` | Skill metadata: create/discover/install/parse `SKILL.md` and inject descriptors into agent prompts (`ops_create`, `ops_discover`, `ops_install`, `ops_parse`, `registry`, `tools`). |-| `crates/openhuman-core/src/skills/catalog/` | Registry of installed skills. |+| Domain | Role |+| ------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |+| `crates/openhuman-core/src/skills/` | Skill metadata: create/discover/install/parse `SKILL.md` and inject descriptors into agent prompts (`ops_create`, `ops_discover`, `ops_install`, `ops_parse`, `registry`, `tools`). |+| `crates/openhuman-core/src/skills/catalog/` | Registry of installed skills. || `crates/openhuman-core/src/skills/runtime/` | Execution of installed `SKILL.md` workflows: starts/cancels runs, reads run metadata/logs, resolves language runtimes. The orchestrator runs an installed skill itself through `run_workflow`. |Skill discovery uses `SKILL.md` plus optional bundled resources:@@ -310,25 +310,25 @@ Core subsystems run on `tiny*` crates, vendored as git submodules under `vendor/## Technology stack-| Layer | Technology | Why |-| -------------- | ---------------------------------- | --------------------------------------------------------- |-| Frontend | React 19, TypeScript 5.8 | Modern component model, type safety |-| State | Redux Toolkit + Persist | Predictable state with offline persistence |-| Build | Vite 7 | Sub-second HMR, optimized production builds |-| Styling | Tailwind CSS | Utility-first, consistent design system |-| Framework | Tauri v2 | Native cross-platform with minimal overhead |-| Language | Rust (2021 edition) | Memory safety, zero-cost abstractions |-| Async | Tokio | High-performance async I/O runtime |-| JS Runtime | Node.js | Managed V8 runtime for tool helpers and skill-adjacent JS |-| Database | SQLite (rusqlite) | Embedded, zero-config, per-domain stores |-| WebSocket | tokio-tungstenite + rustls | Persistent connections with native TLS |-| HTTP | reqwest | Async HTTP with rustls + native-TLS support |+| Layer | Technology | Why |+| ---------- | -------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |+| Frontend | React 19, TypeScript 5.8 | Modern component model, type safety |+| State | Redux Toolkit + Persist | Predictable state with offline persistence |+| Build | Vite 7 | Sub-second HMR, optimized production builds |+| Styling | Tailwind CSS | Utility-first, consistent design system |+| Framework | Tauri v2 | Native cross-platform with minimal overhead |+| Language | Rust (2021 edition) | Memory safety, zero-cost abstractions |+| Async | Tokio | High-performance async I/O runtime |+| JS Runtime | Node.js | Managed V8 runtime for tool helpers and skill-adjacent JS |+| Database | SQLite (rusqlite) | Embedded, zero-config, per-domain stores |+| WebSocket | tokio-tungstenite + rustls | Persistent connections with native TLS |+| HTTP | reqwest | Async HTTP with rustls + native-TLS support || Encryption | chacha20poly1305 (secret store), aes-gcm + argon2 (`security/encryption/`) | Config-field secrets use ChaCha20-Poly1305 under a keychain-backed master key (`enc2:` prefix); the separate user-facing encryption facility uses AES-256-GCM with Argon2id |-| Scheduling | cron crate + `cron` domain | Standard cron expressions, `scheduler_gate`-gated |-| Telegram | `tinychannels` Bot API driver | Transport in vendored `tinychannels`; host keeps bus/approval glue |-| Realtime | Socket.io (client) | Bidirectional event-based communication |-| AI | MCP (JSON-RPC 2.0) | Standardized tool protocol for LLM integration |-| Search | OpenAI embeddings + SQLite FTS5 | Hybrid semantic + keyword search |+| Scheduling | cron crate + `cron` domain | Standard cron expressions, `scheduler_gate`-gated |+| Telegram | `tinychannels` Bot API driver | Transport in vendored `tinychannels`; host keeps bus/approval glue |+| Realtime | Socket.io (client) | Bidirectional event-based communication |+| AI | MCP (JSON-RPC 2.0) | Standardized tool protocol for LLM integration |+| Search | OpenAI embeddings + SQLite FTS5 | Hybrid semantic + keyword search |---@@ -360,14 +360,14 @@ Transport is selected by `ConnectionProfile` stored in secure storage. On pairin### Key paths-| Path | Purpose |-| --------------------------------- | ------------------------------------------------------- |+| Path | Purpose |+| --------------------------------------------- | ------------------------------------------------------- || `crates/openhuman-core/src/security/devices/` | Rust devices domain (pairing, store, crypto, event bus) |-| `app/src/services/transport/` | TS transport strategies + manager |-| `app/src/lib/tunnel/` | TS tunnel crypto (X25519 + XChaCha20-Poly1305) |-| `app/src/pages/ios/` | iOS-specific screens (PairScreen, MascotScreen) |-| `packages/tauri-plugin-ptt/` | Swift PTT plugin (AVAudioEngine + SFSpeechRecognizer) |-| `app/src-tauri-mobile/Info.plist` | Privacy strings for the iOS Info.plist |+| `app/src/services/transport/` | TS transport strategies + manager |+| `app/src/lib/tunnel/` | TS tunnel crypto (X25519 + XChaCha20-Poly1305) |+| `app/src/pages/ios/` | iOS-specific screens (PairScreen, MascotScreen) |+| `packages/tauri-plugin-ptt/` | Swift PTT plugin (AVAudioEngine + SFSpeechRecognizer) |+| `app/src-tauri-mobile/Info.plist` | Privacy strings for the iOS Info.plist |### Securitydiff --git a/gitbooks/developing/architecture/storage.md b/gitbooks/developing/architecture/storage.mdindex 153d7ddbfa..4d3f37668c 100644--- a/gitbooks/developing/architecture/storage.md+++ b/gitbooks/developing/architecture/storage.md@@ -15,13 +15,13 @@ With no URL configured, which is the desktop default, nothing here is opened andA backend is a `StorageBackend`. It hands out a `ScopedStorage` for each `Scope`, and every handle on it is already bound to that scope, so no method takes a scope argument.-| Port | Holds | Used for |-| --- | --- | --- |+| Port | Holds | Used for |+| --------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- || `DocumentStore` | Versioned JSON documents in named collections, with filters, paging, unique indexes, compare-and-swap (`Precondition`), atomic `claim` and optional expiry | Approvals, devices, notifications, task sources, cron jobs and runs, the flow catalog, graph checkpoints, encrypted secrets |-| `StreamStore` | Append-only logs with dense offsets | Transcripts, journals |-| `BlobStore` | Opaque bytes by key | Attachments, artifacts |-| `SearchIndex` | Full-text membership | Where the driver supports it |-| `SecretStore` | Encrypted values (`enc2:` envelope) | Keyring user secrets and the credential stores |+| `StreamStore` | Append-only logs with dense offsets | Transcripts, journals |+| `BlobStore` | Opaque bytes by key | Attachments, artifacts |+| `SearchIndex` | Full-text membership | Where the driver supports it |+| `SecretStore` | Encrypted values (`enc2:` envelope) | Keyring user secrets and the credential stores |The core's stores are mostly synchronous, so `storage::block_on` runs a storage future on one shared runtime thread. It never uses `block_in_place`, which panics on a current-thread runtime. `storage::documents::Repo` is the base the domain stores build on. It declares a domain's collections once per process and runs each call.@@ -35,12 +35,12 @@ The storage URL is the first of these that is set. Blank values count as unset.`[storage]` is bootstrap configuration. It is always read from the environment or the file and never from storage itself.-| URL | Driver | Cargo feature |-| --- | --- | --- |-| `memory` | In-process maps, keeps nothing | Always |-| `sqlite:<path>` (a `.db` file, or a directory with one file per database) | SQLite | `storage-sqlite` |-| `file:<dir>` | JSON documents, JSONL streams and raw files | `storage-file` |-| `mongodb://…/<db>`, `mongodb+srv://…/<db>` | MongoDB, one database shared by every scope | `storage-mongodb` |+| URL | Driver | Cargo feature |+| ------------------------------------------------------------------------- | ------------------------------------------- | ----------------- |+| `memory` | In-process maps, keeps nothing | Always |+| `sqlite:<path>` (a `.db` file, or a directory with one file per database) | SQLite | `storage-sqlite` |+| `file:<dir>` | JSON documents, JSONL streams and raw files | `storage-file` |+| `mongodb://…/<db>`, `mongodb+srv://…/<db>` | MongoDB, one database shared by every scope | `storage-mongodb` |A URL for a driver the build lacks fails at `storage::open`, and the error names the Cargo feature. A misconfigured deployment therefore stops at boot rather than at its first write. Credentials in a URL are redacted in logs and in `Debug` output.@@ -68,13 +68,13 @@ On a shared backend (MongoDB) other processes may write the same records, so boo## Drivers and on-disk layout-| Driver | Where the data lives |-| --- | --- |-| `memory` | Nowhere. Records last as long as the backend value. |-| `sqlite:<dir>` | One SQLite file per named database inside `<dir>`, in WAL mode, with a single writer and a reader pool per file. The large relational stores keep their tables through the driver's native mode. |-| `sqlite:<file>.db` | One database file for everything. |-| `file:<dir>` | JSON documents, JSONL streams and blobs as files under `<dir>`. |-| `mongodb://…/<db>` | One database. Each named database is a collection prefix, and every record carries its scope. |+| Driver | Where the data lives |+| ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |+| `memory` | Nowhere. Records last as long as the backend value. |+| `sqlite:<dir>` | One SQLite file per named database inside `<dir>`, in WAL mode, with a single writer and a reader pool per file. The large relational stores keep their tables through the driver's native mode. |+| `sqlite:<file>.db` | One database file for everything. |+| `file:<dir>` | JSON documents, JSONL streams and blobs as files under `<dir>`. |+| `mongodb://…/<db>` | One database. Each named database is a collection prefix, and every record carries its scope. |Without a URL, the classic layout is unchanged: per-domain SQLite databases (`approval/approval.db`, `devices/devices.db`, `notifications/notifications.db`, `task_sources/sources.db`, `cron/jobs.db`, `flows/flows.db`, `graph_checkpoints.db`), JSON and JSONL files, and the OS keyring or `secrets.enc`. Records written to a configured backend are not copied back to those files, and the files are not imported into the backend.@@ -84,11 +84,11 @@ Secrets with a backend installed are encrypted documents in the acting agent's sEvery storage test target runs the same body once per driver, and each run is a separate test case named after the driver (`memory::…`, `sqlite::…`, `file::…`, `mongodb::…`), so a failure says which driver broke. The shared helper is `tests/support/storage_drivers.rs`.-| Driver | Runs |-| --- | --- |-| `memory` | Always |-| `sqlite`, `file` | When `storage-sqlite` or `storage-file` is compiled in, on temp directories |-| `mongodb` | When `storage-mongodb` is compiled in and `TSD_MONGO_URL` is set. Each case uses a database of its own. |+| Driver | Runs |+| ---------------- | ------------------------------------------------------------------------------------------------------- |+| `memory` | Always |+| `sqlite`, `file` | When `storage-sqlite` or `storage-file` is compiled in, on temp directories |+| `mongodb` | When `storage-mongodb` is compiled in and `TSD_MONGO_URL` is set. Each case uses a database of its own. |The targets are `storage_approvals_e2e`, `storage_domains_e2e`, `storage_flows_e2e`, `storage_secrets_e2e`, `storage_scope_e2e`, `storage_agent_scopes_e2e`, `storage_delegation_e2e` and `cli_storage_url_e2e`. Run one locally with the drivers you want: