Skip to content

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

chore(cargo): consolidate tinymemory dependencies into a single facade

Steven Enamakel7278b0520bcf
diff --git a/crates/openhuman-core/Cargo.toml b/crates/openhuman-core/Cargo.toml
index 8ade119f3e..8fa549e431 100644
--- a/crates/openhuman-core/Cargo.toml
+++ b/crates/openhuman-core/Cargo.toml
@@ -33,25 +33,8 @@ autotests = false
autoexamples = false
autobenches = false
-# `cargo machete` reports a dependency as unused when no `use` names it, and
-# this list is empty because there is nothing left to excuse (#5560).
-#
-# It used to hold `tinymemory` (the facade) and `tinymemory-tinycortex` (the
-# TinyCortex adapter), on the reasoning that both were load-bearing for DRIVER
-# ADMISSION — the memory subsystem resolved its engine through `tinymemory`'s
-# driver registry, and the adapter made TinyCortex admissible as that engine —
-# so that dropping either would compile clean and fail at runtime.
-#
-# **That reasoning expired rather than being wrong.** `memory::binding::admit`
-# is pure string matching against `MODULE_ID` and refuses
-# `DriverClass::Embedded` outright, so nothing here resolves an engine through
-# the facade's registry any more; the engine runs in the `tinymemory` TinyBus
-# module. The facade is deleted and the adapter moved to `[dev-dependencies]`,
-# where its only consumers (test fixtures) already lived.
-#
-# The principle it was written to protect still holds for whatever lands here
-# next: an unsuppressed false positive is how a real finding gets ignored the
-# time after.
+# `cargo machete` reports a dependency as unused when no `use` names it; the
+# list is empty because there is nothing to excuse.
[package.metadata.cargo-machete]
ignored = []
@@ -202,25 +185,6 @@ tinytools-std = { path = "../../vendor/tinyagents/vendor/tinytools/crates/tinyto
# identical item through the contract. Its `[patch]` entry stays too, for the
# reason given above.
-# tinymemory — the engine-neutral memory layer
-# (https://github.com/tinyhumansai/tinymemory). Owns the parts of the memory
-# subsystem that are true for *any* engine: the driver-admission rules
-# (`tinymemory::registry`) and the three mandatory capability families composed
-# over the `Memory` storage trait (`tinymemory::mandatory`). TinyCortex stays
-# the engine; this is the layer a second engine would enter through.
-#
-# Vendored as a git submodule under `vendor/` beside the other tiny* crates and
-# consumed by path: the crate is not published to crates.io, so there is no
-# `[patch.crates-io]` entry for it, and for the same reason
-# `crates/openhuman-app/Cargo.toml` needs no `../../` twin — an unpublished path
-# dependency resolves transitively through this manifest.
-#
-# `tinymemory-tinycortex` is the seam between TinyCortex's contract types and
-# TinyMemory's. It names `tinycortex` by version requirement, so the
-# `[patch.crates-io]` entry below unifies it onto *this* checkout's engine
-# rather than the one pinned inside the tinymemory submodule.
-#
-# After cloning: `git submodule update --init --recursive vendor/tinymemory`.
# tinyruntime — the runtime router
# (https://github.com/tinyhumansai/tinyruntime). Only the *contract* crate is
# taken here, never the router itself: the router ships as a loadable TinyBus
@@ -242,16 +206,14 @@ tinyruntime-bus = { path = "../../vendor/tinyruntime/crates/tinyruntime-bus" }
# the crate itself; see `scripts/ci/module-pin-exemptions.json`.
tinyruntime-pyserver = { path = "../../vendor/tinyruntime/crates/tinyruntime-pyserver" }
-# The `tinymemory` facade is gone: no file in `src/` ever named it. It was
-# kept for driver admission, but `memory::binding::admit` is pure string
-# matching against `MODULE_ID` and refuses `DriverClass::Embedded` outright,
-# so nothing here resolves an engine through the facade's registry.
-tinymemory-api = { path = "../../vendor/tinymemory/crates/tinymemory-api" }
-# The engine factory + migration over every remote engine (deliberately NOT the
-# in-memory `tinycortex` one, which would link the embedded engine), over the same `tinymemory-api`. Optional: only
-# the `memory-remote` gate (remote memory engines: TinyHumans-hosted CortexDB,
-# Supermemory, Mem0, Cognee, CortexDB, AgentMemory) links the HTTP adapter.
-tinymemory = { path = "../../vendor/tinymemory/crates/tinymemory", default-features = false, features = ["factory", "supermemory", "mem0", "cognee", "cortex", "agentmemory", "tinyhumans"], optional = true }
+# TinyMemory v2 (https://github.com/tinyhumansai/tinymemory): the memory
+# engine contract (`MemoryEngine`: recall / fetch / store / forget / list), the
+# CortexDB engines (`cortexdb` direct, `tinyhumans` hosted), and the optional
+# subsystems this host composes — document conversion, source readers (with the
+# SSRF-guarded network readers), secret/PII scrubbing, the `context.md`
+# compiler and the read-only v1 workspace importer. One facade, one feature per
+# subsystem; `memory::` is the only module that names it.
+tinymemory = { path = "../../vendor/tinymemory/crates/tinymemory", default-features = false, features = ["documents", "sources-network", "safety", "context", "legacy-import"] }
# tinyconnectors-bus — the OAuth connector wire contract
# (https://github.com/tinyhumansai/tinyconnectors). Payload types and member
# names for the connector surface, with no transport and no behaviour: this
@@ -271,72 +233,6 @@ tinyconnectors-bus = { path = "../../vendor/tinyconnectors/crates/tinyconnectors
# ABI export is compiled into the host (and no second copy of `tinybus` enters
# the graph). Live connector calls still go over the bus to the loaded module.
tinyconnectors = { path = "../../vendor/tinyconnectors/crates/tinyconnectors", default-features = false }
-# tinymemory-bus is the wire contract (method names, ABI). Normally transitive
-# through tinymemory-api, but modules/memory.rs names the method constants
-# directly (EXTRACT_ENTITIES, EMBED_TEXT, EMBEDDER_SLUG) — prefer compile
-# errors on renaming over MemberNotFound at runtime.
-tinymemory-bus = { path = "../../vendor/tinymemory/crates/tinymemory-bus" }
-# `tinymemory-conversations` is the workspace conversation store (JSONL
-# threads/messages, cross-thread inverted index). A pure library: serde,
-# parking_lot, uuid, chrono, async-trait, sha2. No SQLite/HTTP/engine crate.
-tinymemory-conversations = { path = "../../vendor/tinymemory/crates/tinymemory-conversations" }
-# The fake memory drivers the host's tests bind in place of an in-process engine
-# (openhuman#6161): `RecordingProvider` serves every optional family, so a
-# handler that asks for one by accessor gets `Some`; `InMemoryProvider` retains
-# and substring-recalls; `FixedRecallProvider` answers a constant recall. A
-# regular dependency, not a dev-dependency, because `memory::guard::in_memory`
-# is `pub` and compiled into the lib: the debug-build channel harness
-# (`channels::runtime::test_support`, used by root integration targets that link
-# the lib without `cfg(test)`) builds its guards through it.
-#
-# It costs this manifest nothing. The crate is `publish = false` and reached by
-# path like `tinymemory-api`, and its only dependencies are `tinymemory-api`,
-# `async-trait`, `serde_json` and `anyhow` — all already in the product graph.
-# By construction it cannot pull an engine back in: `tinymemory-conformance`
-# refuses to depend on `tinymemory-core`, and its CI asserts that.
-tinymemory-conformance = { path = "../../vendor/tinymemory/crates/tinymemory-conformance" }
-# `tinymemory-guard` is the policy decorator over any `MemoryProvider`
-# (`GuardedProvider<P: GuardPolicy>`): the seven-step enforcement chain and the
-# per-family decorators. The facts it consults — the live `SecurityPolicy` tier,
-# the task-local source scope, the sanitizer, egress disclosure, the audit event
-# — stay here, behind `memory::guard::HostGuardPolicy`. Only `tinymemory-api`,
-# `async-trait`, `serde_json`, `chrono`, `log` and `tracing`, all already here.
-tinymemory-guard = { path = "../../vendor/tinymemory/crates/tinymemory-guard" }
-# `tinymemory-import` holds the OpenClaw / Hermes workspace importers behind
-# `config::migration_helpers`. It writes into whichever `Memory` the host
-# opens (`target_memory_backend`, which refuses a null driver) and adds no
-# dependency beyond rusqlite, already linked here.
-tinymemory-import = { path = "../../vendor/tinymemory/crates/tinymemory-import" }
-# `tinymemory-tools` holds the memory agent tools (tree retrieval, raw chunk and
-# entity search, hybrid and vector search, tool-scoped rules) as
-# `tinytools::Tool`s generic over a host; `memory::tools::host` is this host.
-# Its one extra dependency is `tinytools`, which the root `[patch]` points at
-# the copy vendored through tinyagents, so there is still exactly one `Tool`.
-tinymemory-tools = { path = "../../vendor/tinymemory/crates/tinymemory-tools" }
-# `tinymemory-safety` is the secret and PII scrubber (credential patterns,
-# sensitive-key classifier, checksum-gated multilingual national-ID redaction)
-# that `memory::safety` used to carry a private copy of. `regex`, `serde_json`
-# and `log` only, no engine. The host takes the default (strictest) policy.
-tinymemory-safety = { path = "../../vendor/tinymemory/crates/tinymemory-safety" }
-# `tinymemory-sources` is the source registry, its types and its readers, in a
-# crate of its own. Taken directly rather than through `tinymemory-core`
-# (OpenHuman#5560): `tinymemory_core::sources` is a thin layer over it —
-# `sources::types` is already a `pub use` of this crate, and `sources::registry`
-# is "the host's config path plus a write lock" around a `SourceRegistry` over
-# the host's own `sources.toml`. The host owns that file; it does not need the
-# engine to read it.
-#
-# It costs this crate no new dependency: serde, schemars, serde_json, anyhow,
-# `tinymemory-api`, async-trait, walkdir, toml and uuid are all already here,
-# and `network` adds reqwest / futures / tracing / chrono / tokio, which are
-# too. No `rusqlite`, no `tinycortex`.
-#
-# `network` matches what `tinymemory-core` enables, so the GitHub / RSS /
-# web-page readers exist. Their dispatch is deliberately NOT `reader_for` —
-# see that module's docs and `memory::sources`'s.
-tinymemory-sources = { path = "../../vendor/tinymemory/crates/tinymemory-sources", features = [
- "network",
-] }
# tinymcp — the Model Context Protocol client, extracted out of this tree
@@ -537,12 +433,9 @@ sentry = { version = "0.47.0", default-features = false, optional = true, featur
url = "2"
tempfile = "3"
fs2 = "0.4"
-# The scheduler gate: host power/CPU sampling and the cooperative wait that
-# keeps background LLM work from lagging a laptop. The cross-platform battery
-# probe (`starship-battery`) is its `battery` feature, forwarded by this crate's
-# `scheduler-gate` feature. The process-wide wiring stays in
-# `cron::scheduler_gate`.
-tinymemory-gate = { path = "../../vendor/tinymemory/crates/tinymemory-gate" }
+# The scheduler gate's battery/AC probe (`cron::scheduler_gate::signals`),
+# behind the `scheduler-gate` feature. CPU sampling uses `sysinfo` above.
+starship-battery = { version = "0.10", optional = true }
# The WhatsApp Web provider (and its `whatsapp-rust` / `wacore` / `serde-big-array`
# stack) now lives in the tinychannels crate; the `whatsapp-web` feature forwards