Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

docs: document storage backend paths for notifications, task sources, and devices

Steven Enamakelab4bce6307ab
diff --git a/crates/openhuman-core/src/desktop/notifications/README.md b/crates/openhuman-core/src/desktop/notifications/README.md
index 6c5eb04e18..688a5b55ec 100644
--- a/crates/openhuman-core/src/desktop/notifications/README.md
+++ b/crates/openhuman-core/src/desktop/notifications/README.md
@@ -85,6 +85,22 @@ SQLite DB at `{workspace_dir}/notifications/notifications.db`, opened per-call v
`insert_if_not_recent` runs a `BEGIN IMMEDIATE` transaction so concurrent duplicate ingests collapse to a single insert.
+### On a storage backend
+
+When the host configured a storage backend (`OPENHUMAN_STORAGE_URL` /
+`[storage] url`, see `crate::storage`), every `store` function uses
+`store_documents.rs` instead of `notifications.db`: the same operations on the
+`tinystoragedrivers` document port, under the current call's storage scope
+(the acting agent; `local` on a single-user host; refused in SaaS mode with
+no acting agent). Collections `integration_notifications`, `notification_dedup`,
+`notification_settings` and `core_notifications`. Every insert first
+advances a `notification_dedup` document (a hash of provider, account,
+title and body) under compare-and-swap, which replaces the SQL store's
+`BEGIN IMMEDIATE`: two processes ingesting the same content in the same
+minute insert it once. `stats` folds the counts in the store, since the
+port has no `GROUP BY`. With no backend configured (the desktop default)
+`notifications.db` is used as described above.
+
## Dependencies
- `crate::core::bus::BUS` and `crate::core::events::DomainEvent` (`BUS.subscribe` for the bridge, `BUS.publish` for triage results); the `EventHandler` trait comes from `tinybus`.
diff --git a/crates/openhuman-core/src/integrations/task_sources/README.md b/crates/openhuman-core/src/integrations/task_sources/README.md
index fd1e7c3862..88dcffacfc 100644
--- a/crates/openhuman-core/src/integrations/task_sources/README.md
+++ b/crates/openhuman-core/src/integrations/task_sources/README.md
@@ -124,6 +124,19 @@ SQLite at `<workspace_dir>/task_sources/sources.db` (WAL, 5s busy timeout, migra
The additive idempotent `ingested_tasks.card_id` migration preserves older databases. App-level defaults (enabled flag, default interval, per-fetch cap, auto_proactive) live in config (`TaskSourcesConfig`), not the store.
+### On a storage backend
+
+When the host configured a storage backend (`OPENHUMAN_STORAGE_URL` /
+`[storage] url`, see `crate::storage`), every `store` function uses
+`store_documents.rs` instead of `sources.db`: the same operations on the
+`tinystoragedrivers` document port, under the current call's storage scope
+(the acting agent; `local` on a single-user host; refused in SaaS mode with
+no acting agent). Collections `task_sources` (one per source) and `ingested_tasks` (one
+per `(source_id, external_id)`). `update_source` applies the patch under
+compare-and-swap, and removing a source removes its ledger entries (the
+SQL cascade). With no backend configured (the desktop default)
+`sources.db` is used as described above.
+
## Dependencies
- `crate::core::all`: `ControllerFuture`, `RegisteredController` for the RPC registry.
diff --git a/crates/openhuman-core/src/security/devices/README.md b/crates/openhuman-core/src/security/devices/README.md
index be1b061e5e..da398ea8a3 100644
--- a/crates/openhuman-core/src/security/devices/README.md
+++ b/crates/openhuman-core/src/security/devices/README.md
@@ -83,6 +83,18 @@ DDL is created idempotently on every connection open (`with_connection`). `peer_
Separately, encrypted X25519 private keys are persisted as `enc2:` strings (via `keyring::SecretStore`, ChaCha20-Poly1305) keyed by `channel_id` in the in-memory `PERSISTED_KEYPAIRS` map, allowing keypair reconstruction for reconnect handshakes.
+### On a storage backend
+
+When the host configured a storage backend (`OPENHUMAN_STORAGE_URL` /
+`[storage] url`, see `crate::storage`), every `store` function uses
+`store_documents.rs` instead of `devices.db`: the same operations on the
+`tinystoragedrivers` document port, under the current call's storage scope
+(the acting agent; `local` on a single-user host; refused in SaaS mode with
+no acting agent). One `paired_devices` document per `channel_id`. Pairing replaces the
+document; touching and revoking are compare-and-swap, so a touch never
+revives a device another process revoked. With no backend configured (the desktop default)
+`devices.db` is used as described above.
+
## Dependencies
- `crate::config` (`Config`, `config::rpc::load_config_with_timeout`): workspace paths and config loading for handlers.