Skip to content

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

refactor: replace `crate::openhuman::memory::api` paths with `tinymemory_api`

Steven Enamakel34aa170022c0
diff --git a/src/core/all.rs b/src/core/all.rs
index 10b9507f71..e52d54c702 100644
--- a/src/core/all.rs
+++ b/src/core/all.rs
@@ -10,7 +10,7 @@ use std::sync::OnceLock;
use serde_json::{Map, Value};
-use crate::openhuman::memory::api::capabilities::{Capabilities, Capability};
+use tinymemory_api::capabilities::{Capabilities, Capability};
use crate::core::ControllerSchema;
@@ -239,7 +239,7 @@ struct GroupedController {
/// Absence, not a stub that errors — a registered-but-failing method
/// teaches a model that the capability exists and makes it retry. Same
/// reasoning as the `flows` compile-time gate (see CLAUDE.md) and as
- /// `crate::openhuman::memory::api::capabilities`' module docs.
+ /// `tinymemory_api::capabilities`' module docs.
capability: Option<Capability>,
controller: RegisteredController,
}
diff --git a/src/core/all_tests.rs b/src/core/all_tests.rs
index d91458afc8..d1f2d85dde 100644
--- a/src/core/all_tests.rs
+++ b/src/core/all_tests.rs
@@ -1608,7 +1608,7 @@ fn memory_controllers_form_one_contiguous_run_in_aggregator_order() {
// present and failing, because a registered-but-failing method teaches a model
// the capability exists and makes it retry.
-use crate::openhuman::memory::api::capabilities::Capability;
+use tinymemory_api::capabilities::Capability;
/// A workspace path unique to one test.
///
diff --git a/src/core/cli_capability.rs b/src/core/cli_capability.rs
index 2ddb1043a1..c501d3bc4a 100644
--- a/src/core/cli_capability.rs
+++ b/src/core/cli_capability.rs
@@ -37,7 +37,7 @@
//! static namespace/function names, never from user-supplied argument values,
//! and no memory content can reach this path at all.
-use crate::openhuman::memory::api::capabilities::{Capabilities, Capability};
+use tinymemory_api::capabilities::{Capabilities, Capability};
use anyhow::Result;
use crate::core::subsystem::DriverClass;
diff --git a/src/core/cli_tests.rs b/src/core/cli_tests.rs
index e3486f06e2..e0770b979f 100644
--- a/src/core/cli_tests.rs
+++ b/src/core/cli_tests.rs
@@ -366,7 +366,7 @@ use crate::core::all::{
capability_for_parts, capability_for_rpc_method, sole_capability_for_namespace,
};
use crate::core::cli_capability::capability_verdict;
-use crate::openhuman::memory::api::capabilities::Capabilities;
+use tinymemory_api::capabilities::Capabilities;
#[test]
fn capability_gated_namespace_reports_a_config_fact_not_a_typo() {
@@ -405,7 +405,7 @@ fn capability_gated_rpc_method_reports_its_family_unfiltered() {
assert_eq!(
capability_for_rpc_method("openhuman.memory_tree_wipe_all"),
Some(Some(
- crate::openhuman::memory::api::capabilities::Capability::Tree
+ tinymemory_api::capabilities::Capability::Tree
))
);
}
diff --git a/src/core/memory_cli.rs b/src/core/memory_cli.rs
index f17e7efdf5..5ad8a8100f 100644
--- a/src/core/memory_cli.rs
+++ b/src/core/memory_cli.rs
@@ -64,7 +64,7 @@ const SUBCOMMAND_CONTROLLER: &[(&str, &str)] = &[
/// controller registry, never from a local table.
fn required_capability(
subcommand: &str,
-) -> Option<crate::openhuman::memory::api::capabilities::Capability> {
+) -> Option<tinymemory_api::capabilities::Capability> {
let function = SUBCOMMAND_CONTROLLER
.iter()
.find(|(sub, _)| *sub == subcommand)
@@ -555,7 +555,7 @@ mod tests {
use super::*;
use crate::core::cli_capability::{capability_verdict, CAPABILITY_UNAVAILABLE_PREFIX};
use crate::core::subsystem::DriverClass;
- use crate::openhuman::memory::api::capabilities::{Capabilities, Capability};
+ use tinymemory_api::capabilities::{Capabilities, Capability};
/// Drift guard: a renamed controller function must break here rather than
/// silently un-gate a subcommand (`required_capability` would start
diff --git a/src/core/runtime/context.rs b/src/core/runtime/context.rs
index b1ff796af1..21847185fb 100644
--- a/src/core/runtime/context.rs
+++ b/src/core/runtime/context.rs
@@ -334,11 +334,11 @@ impl CoreContext {
/// would keep `memory_store` / `memory_recall` / `memory.list_documents`
/// answering off the embedded store the guarded re-point has not yet
/// covered. See [`MemoryBinding::disables_memory`](crate::openhuman::memory::binding::MemoryBinding::disables_memory).
- pub fn memory_capabilities(&self) -> crate::openhuman::memory::api::capabilities::Capabilities {
+ pub fn memory_capabilities(&self) -> tinymemory_api::capabilities::Capabilities {
self.memory_binding()
.map(|binding| {
if binding.disables_memory() {
- crate::openhuman::memory::api::capabilities::Capabilities::default()
+ tinymemory_api::capabilities::Capabilities::default()
} else {
binding.capabilities()
}
@@ -373,7 +373,7 @@ impl CoreContext {
/// there is no context at all. This is the direct analogue of
/// `core::all::group_allowed` and is the function a future capability
/// registration filter calls.
- pub fn current_memory_capabilities() -> crate::openhuman::memory::api::capabilities::Capabilities
+ pub fn current_memory_capabilities() -> tinymemory_api::capabilities::Capabilities
{
Self::current()
.map(|ctx| ctx.memory_capabilities())
@@ -1055,7 +1055,7 @@ mod tests {
assert!(ctx.memory_binding().is_err(), "no workspace ⇒ no binding");
assert_eq!(
ctx.memory_capabilities(),
- crate::openhuman::memory::api::capabilities::Capabilities::all(),
+ tinymemory_api::capabilities::Capabilities::all(),
"a context with no binding must not deny any capability"
);
}
@@ -1070,14 +1070,14 @@ mod tests {
fn current_memory_capabilities_defaults_open_without_a_context() {
assert_eq!(
crate::openhuman::memory::binding::unbound_default_capabilities(),
- crate::openhuman::memory::api::capabilities::Capabilities::all()
+ tinymemory_api::capabilities::Capabilities::all()
);
// And when a context *is* ambient, the call resolves through it rather
// than erroring.
let ctx = CoreContext::for_test(crate::core::runtime::DomainSet::full(), None, None);
assert_eq!(
ctx.memory_capabilities(),
- crate::openhuman::memory::api::capabilities::Capabilities::all()
+ tinymemory_api::capabilities::Capabilities::all()
);
}
@@ -1088,7 +1088,7 @@ mod tests {
let ctx = CoreContext::for_test(crate::core::runtime::DomainSet::harness(), None, None);
assert_eq!(
ctx.memory_capabilities(),
- crate::openhuman::memory::api::capabilities::Capabilities::all()
+ tinymemory_api::capabilities::Capabilities::all()
);
}
}
diff --git a/src/core/subsystem/driver.rs b/src/core/subsystem/driver.rs
index 1a75489b20..e4d09dc89d 100644
--- a/src/core/subsystem/driver.rs
+++ b/src/core/subsystem/driver.rs
@@ -34,7 +34,7 @@ use serde::{Deserialize, Serialize};
/// This is a **host configuration fact**, never something the driver reports.
///
/// Deliberately not `#[non_exhaustive]`, for the same reason
-/// `crate::openhuman::memory::api::capabilities::Capability` is not: adding a class must break
+/// `tinymemory_api::capabilities::Capability` is not: adding a class must break
/// every exhaustive `match` in the host, because those matches are where policy
/// (egress, trust, credential resolution) is decided per class.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
@@ -108,7 +108,7 @@ impl std::str::FromStr for DriverClass {
/// Liveness of a bound driver, in the kernel's generic vocabulary.
///
-/// Shaped one-for-one against `crate::openhuman::memory::api::health::MemoryHealth` — and
+/// Shaped one-for-one against `tinymemory_api::health::MemoryHealth` — and
/// against whatever the next subsystem's contract carries — so the boundary
/// conversion is a total three-arm `match` that cannot drift. Serializes as an
/// internally-tagged object with a stable snake_case `status` discriminant:
@@ -191,7 +191,7 @@ impl std::fmt::Display for DriverHealth {
/// The kernel deliberately does not know any subsystem's family vocabulary —
/// `"tree"` and `"tool_memory"` mean something to the memory subsystem and
/// nothing here. Each subsystem's adapter converts its own typed set (for
-/// memory: `crate::openhuman::memory::api::capabilities::Capabilities`) into this at bind
+/// memory: `tinymemory_api::capabilities::Capabilities`) into this at bind
/// time, and the kernel only ever asks "does the bound driver advertise this
/// string?" when deciding whether to register a controller or emit a tool.
///
diff --git a/src/core/subsystem/driver_tests.rs b/src/core/subsystem/driver_tests.rs
index 0c00d1d47d..bfed109867 100644
--- a/src/core/subsystem/driver_tests.rs
+++ b/src/core/subsystem/driver_tests.rs
@@ -97,7 +97,7 @@ fn driver_health_display_includes_the_reason() {
/// silently making the conversion partial.
#[test]
fn driver_health_shape_matches_memory_health_one_for_one() {
- use crate::openhuman::memory::api::health::MemoryHealth;
+ use tinymemory_api::health::MemoryHealth;
let pairs: Vec<(MemoryHealth, DriverHealth)> = vec![
(MemoryHealth::Ready, DriverHealth::Ready),
@@ -188,7 +188,7 @@ fn driver_capabilities_contains_all_is_subset_semantics() {
/// memory capability is.
#[test]
fn every_memory_contract_capability_string_maps_into_driver_capabilities() {
- use crate::openhuman::memory::api::capabilities::Capability;
+ use tinymemory_api::capabilities::Capability;
let caps: DriverCapabilities = Capability::ALL.iter().map(|cap| cap.as_str()).collect();
diff --git a/src/core/subsystem/mod.rs b/src/core/subsystem/mod.rs
index 53fb1de1bb..bc22aea2c6 100644
--- a/src/core/subsystem/mod.rs
+++ b/src/core/subsystem/mod.rs
@@ -13,7 +13,7 @@
//!
//! Since M2b the memory adapter exists in
//! [`crate::openhuman::memory::binding`] (it converts
-//! `crate::openhuman::memory::api::MemoryHealth` into [`DriverHealth`] and the contract's
+//! `tinymemory_api::MemoryHealth` into [`DriverHealth`] and the contract's
//! typed capability set into [`DriverCapabilities`]), and M2c added the
//! read-only [`status`] projection plus the `subsystems` RPC namespace and the
//! `openhuman subsystems` CLI table.
diff --git a/src/core/subsystem/status.rs b/src/core/subsystem/status.rs
index 00d6cacf02..b4bd9048f7 100644
--- a/src/core/subsystem/status.rs
+++ b/src/core/subsystem/status.rs
@@ -8,7 +8,7 @@
//!
//! ## Capabilities cross the wire as opaque strings, never as a typed set
//!
-//! A memory driver's typed set (`crate::openhuman::memory::api::capabilities::Capabilities`)
+//! A memory driver's typed set (`tinymemory_api::capabilities::Capabilities`)
//! is a `u16` bitset whose `Deserialize` rejects the **whole** array on a
//! single unrecognised family string. A driver speaking a newer minor contract
//! may legitimately advertise a family this build has never heard of, and
diff --git a/src/openhuman/agent/harness/archivist/boundary.rs b/src/openhuman/agent/harness/archivist/boundary.rs
index 7fa93c4258..623d602173 100644
--- a/src/openhuman/agent/harness/archivist/boundary.rs
+++ b/src/openhuman/agent/harness/archivist/boundary.rs
@@ -179,7 +179,7 @@ pub fn detect_boundary(
/// The part of a segment boundary detection reads.
///
/// A narrow view rather than the whole
-/// [`ConversationSegment`](crate::openhuman::memory::api::provider::episodic::ConversationSegment)
+/// [`ConversationSegment`](tinymemory_api::provider::episodic::ConversationSegment)
/// because the decision depends on four fields, and naming them makes it
/// checkable that nothing else influences it.
#[derive(Clone, Debug, Default)]
diff --git a/src/openhuman/agent/learning/cache.rs b/src/openhuman/agent/learning/cache.rs
index 0ab72ccfea..c23e6c36ee 100644
--- a/src/openhuman/agent/learning/cache.rs
+++ b/src/openhuman/agent/learning/cache.rs
@@ -7,7 +7,7 @@
use std::sync::Arc;
use crate::openhuman::agent::learning::candidate::FacetClass;
-use crate::openhuman::memory::api::provider::{
+use tinymemory_api::provider::{
MemoryProfile, MemoryProvider, ProfileFacet, UserState,
};
use crate::openhuman::memory::guard::MemoryGuard;
@@ -205,7 +205,7 @@ pub fn class_prefix(class: FacetClass) -> &'static str {
// ── Facet state enum re-export (convenience for callers of this module) ───────
-pub use crate::openhuman::memory::api::provider::{
+pub use tinymemory_api::provider::{
FacetState as CacheFacetState, UserState as CacheUserState,
};
diff --git a/src/openhuman/agent/learning/cache_tests.rs b/src/openhuman/agent/learning/cache_tests.rs
index 9680c7b797..a583a6d3df 100644
--- a/src/openhuman/agent/learning/cache_tests.rs
+++ b/src/openhuman/agent/learning/cache_tests.rs
@@ -2,8 +2,8 @@
use super::*;
use crate::openhuman::agent::learning::candidate::FacetClass;
-use crate::openhuman::memory::api::host::EvidenceRef;
-use crate::openhuman::memory::api::provider::{FacetState, FacetType, ProfileFacet, UserState};
+use tinymemory_api::host::EvidenceRef;
+use tinymemory_api::provider::{FacetState, FacetType, ProfileFacet, UserState};
fn make_cache() -> FacetCache {
crate::openhuman::agent::learning::test_profile::in_memory_cache()
diff --git a/src/openhuman/agent/learning/profile_md_renderer.rs b/src/openhuman/agent/learning/profile_md_renderer.rs
index 88eaf528a0..81ec883b16 100644
--- a/src/openhuman/agent/learning/profile_md_renderer.rs
+++ b/src/openhuman/agent/learning/profile_md_renderer.rs
@@ -43,7 +43,7 @@ use crate::core::bus::BUS;
use crate::core::events::DomainEvent;
use crate::openhuman::agent::learning::cache::FacetCache;
use crate::openhuman::integrations::composio::providers::profile_md::replace_managed_block;
-use crate::openhuman::memory::api::provider::UserState;
+use tinymemory_api::provider::UserState;
use tinybus::EventHandler;
use tinybus::SubscriptionHandle;
@@ -220,7 +220,7 @@ impl EventHandler<DomainEvent> for RendererSubscriber {
mod tests {
use super::*;
use crate::openhuman::integrations::composio::providers::profile_md::{block_end, block_start};
- use crate::openhuman::memory::api::provider::{FacetState, FacetType, ProfileFacet, UserState};
+ use tinymemory_api::provider::{FacetState, FacetType, ProfileFacet, UserState};
use std::sync::Arc;
use tempfile::TempDir;
diff --git a/src/openhuman/agent/learning/prompt_sections.rs b/src/openhuman/agent/learning/prompt_sections.rs
index a1e5c17ffa..ed318f0cb0 100644
--- a/src/openhuman/agent/learning/prompt_sections.rs
+++ b/src/openhuman/agent/learning/prompt_sections.rs
@@ -163,7 +163,7 @@ pub async fn load_learned_from_cache(
// Group by class prefix (portion before the first '/'), then sort within
// each class by stability descending, then by key alphabetically.
- use crate::openhuman::memory::api::provider::ProfileFacet;
+ use tinymemory_api::provider::ProfileFacet;
use std::collections::BTreeMap;
let mut by_class: BTreeMap<String, Vec<usize>> = BTreeMap::new();
@@ -197,7 +197,7 @@ pub async fn load_learned_from_cache(
// agent can parse the source. Goal class keeps value-only (full
// sentence, no key prefix). Pinned entries get a trailing suffix.
let pinned =
- if f.user_state == crate::openhuman::memory::api::provider::UserState::Pinned {
+ if f.user_state == tinymemory_api::provider::UserState::Pinned {
" *(pinned)*"
} else {
""
@@ -380,7 +380,7 @@ mod tests {
#[tokio::test]
async fn load_learned_from_cache_formats_active_facets() {
- use crate::openhuman::memory::api::provider::{
+ use tinymemory_api::provider::{
FacetState, FacetType, ProfileFacet, UserState,
};
let cache = crate::openhuman::agent::learning::test_profile::in_memory_cache();
diff --git a/src/openhuman/agent/learning/prompt_sections_tests.rs b/src/openhuman/agent/learning/prompt_sections_tests.rs
index 4b4edf0b3e..05d855955b 100644
--- a/src/openhuman/agent/learning/prompt_sections_tests.rs
+++ b/src/openhuman/agent/learning/prompt_sections_tests.rs
@@ -4,7 +4,7 @@
use super::load_learned_from_cache;
use crate::openhuman::agent::learning::cache::FacetCache;
-use crate::openhuman::memory::api::provider::{FacetState, FacetType, ProfileFacet, UserState};
+use tinymemory_api::provider::{FacetState, FacetType, ProfileFacet, UserState};
fn open_cache() -> FacetCache {
crate::openhuman::agent::learning::test_profile::in_memory_cache()
diff --git a/src/openhuman/agent/learning/schemas.rs b/src/openhuman/agent/learning/schemas.rs
index bc09d65bd8..55cfad728a 100644
--- a/src/openhuman/agent/learning/schemas.rs
+++ b/src/openhuman/agent/learning/schemas.rs
@@ -477,8 +477,8 @@ mod tests {
#[test]
fn facet_to_json_includes_cue_families_and_evidence_refs() {
- use crate::openhuman::memory::api::host::EvidenceRef;
- use crate::openhuman::memory::api::provider::{
+ use tinymemory_api::host::EvidenceRef;
+ use tinymemory_api::provider::{
FacetState, FacetType, ProfileFacet, UserState,
};
use std::collections::HashMap;
@@ -694,7 +694,7 @@ fn handle_rebuild_cache(_params: Map<String, Value>) -> ControllerFuture {
fn handle_cache_stats(_params: Map<String, Value>) -> ControllerFuture {
Box::pin(async move {
use crate::openhuman::agent::learning::cache::FacetCache;
- use crate::openhuman::memory::api::provider::FacetState;
+ use tinymemory_api::provider::FacetState;
tracing::debug!("[learning.cache_stats] cache stats requested via RPC");
@@ -780,7 +780,7 @@ fn full_key(class_str: &str, key_suffix: &str) -> String {
}
/// Serialize a [`ProfileFacet`] to a serde_json [`Value`] for RPC output.
-fn facet_to_json(f: &crate::openhuman::memory::api::provider::ProfileFacet) -> serde_json::Value {
+fn facet_to_json(f: &tinymemory_api::provider::ProfileFacet) -> serde_json::Value {
serde_json::json!({
"key": f.key,
"value": f.value,
@@ -805,7 +805,7 @@ fn facet_to_json(f: &crate::openhuman::memory::api::provider::ProfileFacet) -> s
fn handle_list_facets(params: Map<String, Value>) -> ControllerFuture {
Box::pin(async move {
- use crate::openhuman::memory::api::provider::FacetState;
+ use tinymemory_api::provider::FacetState;
tracing::debug!("[learning.list_facets] called");
@@ -889,7 +889,7 @@ fn handle_get_facet(params: Map<String, Value>) -> ControllerFuture {
fn handle_update_facet(params: Map<String, Value>) -> ControllerFuture {
Box::pin(async move {
- use crate::openhuman::memory::api::provider::UserState;
+ use tinymemory_api::provider::UserState;
let class_str = params
.get("class")
@@ -945,7 +945,7 @@ fn handle_update_facet(params: Map<String, Value>) -> ControllerFuture {
fn handle_pin_facet(params: Map<String, Value>) -> ControllerFuture {
Box::pin(async move {
- use crate::openhuman::memory::api::provider::UserState;
+ use tinymemory_api::provider::UserState;
let class_str = params
.get("class")
@@ -987,7 +987,7 @@ fn handle_pin_facet(params: Map<String, Value>) -> ControllerFuture {
fn handle_unpin_facet(params: Map<String, Value>) -> ControllerFuture {
Box::pin(async move {
- use crate::openhuman::memory::api::provider::UserState;
+ use tinymemory_api::provider::UserState;
let class_str = params
.get("class")
@@ -1029,7 +1029,7 @@ fn handle_unpin_facet(params: Map<String, Value>) -> ControllerFuture {
fn handle_forget_facet(params: Map<String, Value>) -> ControllerFuture {
Box::pin(async move {
- use crate::openhuman::memory::api::provider::{FacetState, UserState};
+ use tinymemory_api::provider::{FacetState, UserState};
let class_str = params
.get("class")
diff --git a/src/openhuman/agent/learning/stability_detector.rs b/src/openhuman/agent/learning/stability_detector.rs
index 226cf4adb0..0484e820e4 100644
--- a/src/openhuman/agent/learning/stability_detector.rs
+++ b/src/openhuman/agent/learning/stability_detector.rs
@@ -39,7 +39,7 @@ use crate::openhuman::agent::learning::cache::FacetCache;
use crate::openhuman::agent::learning::candidate::{
self, CueFamily, FacetClass, LearningCandidate,
};
-use crate::openhuman::memory::api::provider::{FacetState, FacetType, ProfileFacet, UserState};
+use tinymemory_api::provider::{FacetState, FacetType, ProfileFacet, UserState};
// ── Thresholds ────────────────────────────────────────────────────────────────
@@ -511,7 +511,7 @@ fn dominant_cue(cands: &[LearningCandidate], _existing: Option<&ProfileFacet>) -
/// `docs/specs/2026-08-13-memory-module-port.md`.
fn evidence_to_contract(
refs: &[candidate::EvidenceRef],
-) -> Vec<crate::openhuman::memory::api::host::EvidenceRef> {
+) -> Vec<tinymemory_api::host::EvidenceRef> {
refs.iter()
.filter_map(|r| {
serde_json::to_value(r)
@@ -523,7 +523,7 @@ fn evidence_to_contract(
/// The inverse of [`evidence_to_contract`].
fn evidence_from_contract(
- refs: &[crate::openhuman::memory::api::host::EvidenceRef],
+ refs: &[tinymemory_api::host::EvidenceRef],
) -> Vec<candidate::EvidenceRef> {
refs.iter()
.filter_map(|r| {
@@ -851,7 +851,7 @@ mod tests {
let now = 1_000_000.0;
// Manually insert a Pinned row.
- use crate::openhuman::memory::api::provider::{FacetState, FacetType, UserState};
+ use tinymemory_api::provider::{FacetState, FacetType, UserState};
let pinned = ProfileFacet {
facet_id: "f-pinned".into(),
facet_type: FacetType::Preference,
diff --git a/src/openhuman/agent/learning/test_profile.rs b/src/openhuman/agent/learning/test_profile.rs
index f65f8800ab..a09965a043 100644
--- a/src/openhuman/agent/learning/test_profile.rs
+++ b/src/openhuman/agent/learning/test_profile.rs
@@ -36,8 +36,8 @@ use async_trait::async_trait;
use parking_lot::Mutex;
use crate::openhuman::agent::learning::cache::FacetCache;
-use crate::openhuman::memory::api::error::MemoryError;
-use crate::openhuman::memory::api::provider::{FacetType, MemoryProfile, ProfileFacet, UserState};
+use tinymemory_api::error::MemoryError;
+use tinymemory_api::provider::{FacetType, MemoryProfile, ProfileFacet, UserState};
/// Facets held in memory, keyed by [`ProfileFacet::key`].
#[derive(Default)]
@@ -63,7 +63,7 @@ impl InMemoryProfile {
/// Facets sorted the way the engine returns them: stability descending,
/// then key ascending for a stable tie-break.
fn sorted(&self, active_only: bool) -> Vec<ProfileFacet> {
- use crate::openhuman::memory::api::provider::FacetState;
+ use tinymemory_api::provider::FacetState;
let facets = self.facets.lock();
let mut out: Vec<ProfileFacet> = facets
.values()
@@ -190,7 +190,7 @@ impl MemoryProfile for InMemoryProfile {
/// stays — and only **Pinned** is protected. A `Forgotten` facet is already
/// Dropped and is meant to go.
async fn drop_facets_below(&self, threshold: f64) -> Result<usize, MemoryError> {
- use crate::openhuman::memory::api::provider::FacetState;
+ use tinymemory_api::provider::FacetState;
let mut facets = self.facets.lock();
let doomed: Vec<String> = facets
.values()
diff --git a/src/openhuman/agent/learning/tools.rs b/src/openhuman/agent/learning/tools.rs
index d5afc64270..667540c539 100644
--- a/src/openhuman/agent/learning/tools.rs
+++ b/src/openhuman/agent/learning/tools.rs
@@ -23,7 +23,7 @@ use serde_json::json;
use crate::openhuman::agent::learning::cache::FacetCache;
use crate::openhuman::agent::learning::stability_detector::StabilityDetector;
use crate::openhuman::config::rpc as config_rpc;
-use crate::openhuman::memory::api::provider::{FacetState, ProfileFacet, UserState};
+use tinymemory_api::provider::{FacetState, ProfileFacet, UserState};
use crate::openhuman::tools::traits::{PermissionLevel, Tool, ToolResult};
/// Acquire the profile facet cache, mirroring `learning::schemas::get_cache`.
diff --git a/src/openhuman/agent/tools/remember_preference.rs b/src/openhuman/agent/tools/remember_preference.rs
index 458ff118b4..ed6f82d0c2 100644
--- a/src/openhuman/agent/tools/remember_preference.rs
+++ b/src/openhuman/agent/tools/remember_preference.rs
@@ -34,8 +34,8 @@
//! component. The preference is authoritative from the moment the tool
//! returns `Ok`.
-use crate::openhuman::memory::api::provider::MemoryCore;
-use crate::openhuman::memory::api::types::{MemoryCategory, MemoryTaint};
+use tinymemory_api::provider::MemoryCore;
+use tinymemory_api::types::{MemoryCategory, MemoryTaint};
use crate::openhuman::memory::ops::guard::active_memory_guard;
use crate::openhuman::security::policy::ToolOperation;
use crate::openhuman::security::SecurityPolicy;
diff --git a/src/openhuman/agent/tools/save_preference.rs b/src/openhuman/agent/tools/save_preference.rs
index 82a8154f75..654289b4b1 100644
--- a/src/openhuman/agent/tools/save_preference.rs
+++ b/src/openhuman/agent/tools/save_preference.rs
@@ -23,8 +23,8 @@ use std::sync::Arc;
use async_trait::async_trait;
use serde_json::json;
-use crate::openhuman::memory::api::provider::MemoryCore as _;
-use crate::openhuman::memory::api::types::MemoryCategory;
+use tinymemory_api::provider::MemoryCore as _;
+use tinymemory_api::types::MemoryCategory;
use crate::openhuman::memory::ops::guard::active_memory_guard;
use crate::openhuman::security::policy::ToolOperation;
use crate::openhuman::security::SecurityPolicy;
@@ -248,7 +248,7 @@ impl Tool for SavePreferenceTool {
value,
MemoryCategory::Core,
None,
- crate::openhuman::memory::api::types::MemoryTaint::Internal,
+ tinymemory_api::types::MemoryTaint::Internal,
)
.await
{
diff --git a/src/openhuman/channels/context.rs b/src/openhuman/channels/context.rs
index 68aa6a8615..0256a6f265 100644
--- a/src/openhuman/channels/context.rs
+++ b/src/openhuman/channels/context.rs
@@ -107,7 +107,7 @@ pub(crate) fn is_context_window_overflow_error(err: &anyhow::Error) -> bool {
tinychannels::context::is_context_window_overflow_message(&err.to_string())
}
-use crate::openhuman::memory::api::provider::MemoryRecall as _;
+use tinymemory_api::provider::MemoryRecall as _;
pub(crate) async fn build_memory_context(
mem: &crate::openhuman::memory::guard::MemoryGuard,
@@ -120,7 +120,7 @@ pub(crate) async fn build_memory_context(
.recall(
user_msg,
5,
- &crate::openhuman::memory::api::recall::OwnedRecallOpts::default(),
+ &tinymemory_api::recall::OwnedRecallOpts::default(),
// Unrestricted: a channel turn carries no ambient source scope, and
// the guard narrows against its own allowlist regardless.
None,
@@ -175,7 +175,7 @@ pub(crate) async fn build_memory_context(
mod tests {
use super::*;
use crate::openhuman::channels::traits;
- use crate::openhuman::memory::api::types::{MemoryCategory, MemoryEntry};
+ use tinymemory_api::types::{MemoryCategory, MemoryEntry};
use crate::openhuman::tools::{Tool, ToolResult};
use async_trait::async_trait;
diff --git a/src/openhuman/channels/runtime/dispatch/processor.rs b/src/openhuman/channels/runtime/dispatch/processor.rs
index 2d845ee44b..fd7653f6e1 100644
--- a/src/openhuman/channels/runtime/dispatch/processor.rs
+++ b/src/openhuman/channels/runtime/dispatch/processor.rs
@@ -26,7 +26,7 @@ use crate::openhuman::channels::routes::{
use crate::openhuman::channels::traits;
use crate::openhuman::channels::{ChannelSendExt, SendMessage};
use crate::openhuman::inference::provider;
-use crate::openhuman::memory::api::provider::MemoryCore as _;
+use tinymemory_api::provider::MemoryCore as _;
use crate::openhuman::util::truncate_with_ellipsis;
use std::sync::Arc;
use std::time::{Duration, Instant};
@@ -276,9 +276,9 @@ pub(crate) async fn process_channel_runtime_message(
crate::openhuman::agent::learning::transcript_ingest::CONVERSATION_RAW_NAMESPACE,
&autosave_key,
&msg.content,
- crate::openhuman::memory::api::types::MemoryCategory::Conversation,
+ tinymemory_api::types::MemoryCategory::Conversation,
None,
- crate::openhuman::memory::api::types::MemoryTaint::Internal,
+ tinymemory_api::types::MemoryTaint::Internal,
)
.await;
}
diff --git a/src/openhuman/channels/runtime/test_support.rs b/src/openhuman/channels/runtime/test_support.rs
index 7fc7b1023f..6ce420090f 100644
--- a/src/openhuman/channels/runtime/test_support.rs
+++ b/src/openhuman/channels/runtime/test_support.rs
@@ -17,7 +17,7 @@ use crate::openhuman::channels::traits::{ChannelMessage, SendMessage};
use crate::openhuman::channels::Channel;
use crate::openhuman::config::{MultimodalConfig, MultimodalFileConfig, ReliabilityConfig};
use crate::openhuman::inference::provider::ProviderRuntimeOptions;
-use crate::openhuman::memory::api::types::{MemoryCategory, MemoryEntry};
+use tinymemory_api::types::{MemoryCategory, MemoryEntry};
use crate::openhuman::tools::{Tool, ToolResult};
use anyhow::Result;
use async_trait::async_trait;
@@ -210,7 +210,7 @@ struct HarnessMemory {
}
#[async_trait]
-impl crate::openhuman::memory::api::provider::MemoryCore for HarnessMemory {
+impl tinymemory_api::provider::MemoryCore for HarnessMemory {
async fn store(
&self,
_namespace: &str,
@@ -218,8 +218,8 @@ impl crate::openhuman::memory::api::provider::MemoryCore for HarnessMemory {
_content: &str,
_category: MemoryCategory,
_session_id: Option<&str>,
- _taint: crate::openhuman::memory::api::types::MemoryTaint,
- ) -> std::result::Result<(), crate::openhuman::memory::api::error::MemoryError> {
+ _taint: tinymemory_api::types::MemoryTaint,
+ ) -> std::result::Result<(), tinymemory_api::error::MemoryError> {
Ok(())
}
@@ -227,7 +227,7 @@ impl crate::openhuman::memory::api::provider::MemoryCore for HarnessMemory {
&self,
_namespace: &str,
_key: &str,
- ) -> std::result::Result<Option<MemoryEntry>, crate::openhuman::memory::api::error::MemoryError>
+ ) -> std::result::Result<Option<MemoryEntry>, tinymemory_api::error::MemoryError>
{
Ok(None)
}
@@ -236,7 +236,7 @@ impl crate::openhuman::memory::api::provider::MemoryCore for HarnessMemory {
&self,
_namespace: &str,
_key: &str,
- ) -> std::result::Result<bool, crate::openhuman::memory::api::error::MemoryError> {
+ ) -> std::result::Result<bool, tinymemory_api::error::MemoryError> {
Ok(false)
}
@@ -245,7 +245,7 @@ impl crate::openhuman::memory::api::provider::MemoryCore for HarnessMemory {
_namespace: Option<&str>,
_category: Option<&MemoryCategory>,
_session_id: Option<&str>,
- ) -> std::result::Result<Vec<MemoryEntry>, crate::openhuman::memory::api::error::MemoryError>
+ ) -> std::result::Result<Vec<MemoryEntry>, tinymemory_api::error::MemoryError>
{
Ok(Vec::new())
}
@@ -253,67 +253,67 @@ impl crate::openhuman::memory::api::provider::MemoryCore for HarnessMemory {
async fn namespaces(
&self,
) -> std::result::Result<
- Vec<crate::openhuman::memory::api::types::NamespaceSummary>,
- crate::openhuman::memory::api::error::MemoryError,
+ Vec<tinymemory_api::types::NamespaceSummary>,
+ tinymemory_api::error::MemoryError,
> {
Ok(Vec::new())
}
}
#[async_trait]
-impl crate::openhuman::memory::api::provider::MemoryRecall for HarnessMemory {
+impl tinymemory_api::provider::MemoryRecall for HarnessMemory {
async fn recall(
&self,
_query: &str,
_limit: usize,
- _opts: &crate::openhuman::memory::api::recall::OwnedRecallOpts,
- _scope: Option<&crate::openhuman::memory::api::provider::types::SourceScope>,
- ) -> std::result::Result<Vec<MemoryEntry>, crate::openhuman::memory::api::error::MemoryError>
+ _opts: &tinymemory_api::recall::OwnedRecallOpts,
+ _scope: Option<&tinymemory_api::provider::types::SourceScope>,
+ ) -> std::result::Result<Vec<MemoryEntry>, tinymemory_api::error::MemoryError>
{
Ok(self.entries.clone())
}
}
#[async_trait]
-impl crate::openhuman::memory::api::provider::MemoryPortability for HarnessMemory {
+impl tinymemory_api::provider::MemoryPortability for HarnessMemory {
async fn export_page(
&self,
_cursor: Option<&str>,
_limit: usize,
) -> std::result::Result<
- crate::openhuman::memory::api::provider::types::ExportPage,
- crate::openhuman::memory::api::error::MemoryError,
+ tinymemory_api::provider::types::ExportPage,
+ tinymemory_api::error::MemoryError,
> {
- Err(crate::openhuman::memory::api::error::MemoryError::Other(
+ Err(tinymemory_api::error::MemoryError::Other(
anyhow::anyhow!("harness memory does not export"),
))
}
async fn import_records(
&self,
- _records: Vec<crate::openhuman::memory::api::provider::types::ExportRecord>,
+ _records: Vec<tinymemory_api::provider::types::ExportRecord>,
) -> std::result::Result<
- crate::openhuman::memory::api::provider::types::ImportOutcome,
- crate::openhuman::memory::api::error::MemoryError,
+ tinymemory_api::provider::types::ImportOutcome,
+ tinymemory_api::error::MemoryError,
> {
- Err(crate::openhuman::memory::api::error::MemoryError::Other(
+ Err(tinymemory_api::error::MemoryError::Other(
anyhow::anyhow!("harness memory does not import"),
))
}
}
#[async_trait]
-impl crate::openhuman::memory::api::provider::MemoryProvider for HarnessMemory {
+impl tinymemory_api::provider::MemoryProvider for HarnessMemory {
fn driver_id(&self) -> &str {
"harness-memory"
}
- fn capabilities(&self) -> crate::openhuman::memory::api::capabilities::Capabilities {
- crate::openhuman::memory::api::capabilities::Capabilities::mandatory()
+ fn capabilities(&self) -> tinymemory_api::capabilities::Capabilities {
+ tinymemory_api::capabilities::Capabilities::mandatory()
}
- async fn health(&self) -> crate::openhuman::memory::api::health::MemoryHealth {
- crate::openhuman::memory::api::health::MemoryHealth::Ready
+ async fn health(&self) -> tinymemory_api::health::MemoryHealth {
+ tinymemory_api::health::MemoryHealth::Ready
}
}
@@ -348,7 +348,7 @@ fn memory_entry(input: TestMemoryEntry) -> MemoryEntry {
timestamp: "now".to_string(),
session_id: None,
score: input.score,
- taint: crate::openhuman::memory::api::types::MemoryTaint::Internal,
+ taint: tinymemory_api::types::MemoryTaint::Internal,
}
}
diff --git a/src/openhuman/channels/tests/memory.rs b/src/openhuman/channels/tests/memory.rs
index fc952544d1..be94f64a3f 100644
--- a/src/openhuman/channels/tests/memory.rs
+++ b/src/openhuman/channels/tests/memory.rs
@@ -7,7 +7,7 @@ use super::super::{traits, Channel};
use super::common::{HistoryCaptureModel, RecordingChannel};
use crate::openhuman::inference::embeddings::NoopEmbedding;
use crate::openhuman::inference::provider;
-use crate::openhuman::memory::api::provider::MemoryCore as _;
+use tinymemory_api::provider::MemoryCore as _;
use crate::openhuman::memory::{Memory, MemoryCategory};
use std::collections::HashMap;
use std::sync::{Arc, Mutex};
@@ -114,9 +114,9 @@ async fn build_memory_context_includes_recalled_entries() {
"",
"age_fact",
"Age is 45",
- crate::openhuman::memory::api::types::MemoryCategory::Conversation,
+ tinymemory_api::types::MemoryCategory::Conversation,
None,
- crate::openhuman::memory::api::types::MemoryTaint::Internal,
+ tinymemory_api::types::MemoryTaint::Internal,
)
.await
.unwrap();
diff --git a/src/openhuman/flows/bus.rs b/src/openhuman/flows/bus.rs
index cc54a41233..9c985fb2bf 100644
--- a/src/openhuman/flows/bus.rs
+++ b/src/openhuman/flows/bus.rs
@@ -14,8 +14,8 @@ use crate::core::events::DomainEvent;
use crate::openhuman::config::Config;
use crate::openhuman::flows::store;
use crate::openhuman::flows::{flow_namespace, Flow, FlowRun};
-use crate::openhuman::memory::api::provider::MemoryCore;
-use crate::openhuman::memory::api::types::{MemoryCategory, MemoryTaint};
+use tinymemory_api::provider::MemoryCore;
+use tinymemory_api::types::{MemoryCategory, MemoryTaint};
use async_trait::async_trait;
use serde_json::Value;
use std::collections::{HashMap, HashSet};
diff --git a/src/openhuman/flows/memory_tools.rs b/src/openhuman/flows/memory_tools.rs
index 66c0e16ebc..238a562667 100644
--- a/src/openhuman/flows/memory_tools.rs
+++ b/src/openhuman/flows/memory_tools.rs
@@ -32,9 +32,9 @@ use async_trait::async_trait;
use serde_json::json;
use crate::openhuman::agent::turn_origin::{self, AgentTurnOrigin, TrustedAutomationSource};
-use crate::openhuman::memory::api::provider::{MemoryCore, MemoryRecall};
-use crate::openhuman::memory::api::recall::OwnedRecallOpts;
-use crate::openhuman::memory::api::types::{MemoryCategory, MemoryEntry, MemoryTaint};
+use tinymemory_api::provider::{MemoryCore, MemoryRecall};
+use tinymemory_api::recall::OwnedRecallOpts;
+use tinymemory_api::types::{MemoryCategory, MemoryEntry, MemoryTaint};
use crate::openhuman::memory::ops::guard::active_memory_guard;
use crate::openhuman::security::policy::ToolOperation;
use crate::openhuman::security::SecurityPolicy;
@@ -151,7 +151,7 @@ pub async fn cross_flow_recall(
limit: usize,
min_score: Option<f64>,
) -> anyhow::Result<Vec<MemoryEntry>> {
- use crate::openhuman::memory::api::provider::{MemoryCore, MemoryRecall};
+ use tinymemory_api::provider::{MemoryCore, MemoryRecall};
// `namespaces()` is the contract's name for what the engine trait called
// `namespace_summaries()` — identical signature and return type.
let summaries = memory.namespaces().await?;
@@ -160,7 +160,7 @@ pub async fn cross_flow_recall(
.iter()
.filter(|s| s.namespace.starts_with(FLOW_MEMORY_NAMESPACE_LISTED_PREFIX))
{
- let opts = crate::openhuman::memory::api::recall::OwnedRecallOpts {
+ let opts = tinymemory_api::recall::OwnedRecallOpts {
namespace: Some(summary.namespace.clone()),
min_score,
..Default::default()
diff --git a/src/openhuman/flows/ops.rs b/src/openhuman/flows/ops.rs
index 69b74e7a54..6c30ed279c 100644
--- a/src/openhuman/flows/ops.rs
+++ b/src/openhuman/flows/ops.rs
@@ -23,7 +23,7 @@ use crate::openhuman::flows::types::{
FlowConnection, FlowRunStep, FlowRunTrigger, FlowSuggestion, SuggestionStatus,
};
use crate::openhuman::flows::{flow_namespace, Flow, FlowRun};
-use crate::openhuman::memory::api::provider::MemoryProvider;
+use tinymemory_api::provider::MemoryProvider;
use crate::openhuman::security::approval::{
ApprovalChatContext, FlowRunContext, APPROVAL_CHAT_CONTEXT, APPROVAL_COPILOT_STREAM_CONTEXT,
APPROVAL_FLOW_RUN_CONTEXT,
diff --git a/src/openhuman/flows/tinyflows/memory_adapter.rs b/src/openhuman/flows/tinyflows/memory_adapter.rs
index 04ebf03e7f..6daaf05950 100644
--- a/src/openhuman/flows/tinyflows/memory_adapter.rs
+++ b/src/openhuman/flows/tinyflows/memory_adapter.rs
@@ -41,9 +41,9 @@ use crate::openhuman::agent::harness::memory_context_safety::{
use crate::openhuman::agent::turn_origin::{self, AgentTurnOrigin, TrustedAutomationSource};
use crate::openhuman::config::Config;
use crate::openhuman::flows::{cross_flow_recall, flow_namespace};
-use crate::openhuman::memory::api::provider::{MemoryCore, MemoryRecall};
-use crate::openhuman::memory::api::recall::OwnedRecallOpts;
-use crate::openhuman::memory::api::types::{MemoryCategory, MemoryEntry, MemoryTaint};
+use tinymemory_api::provider::{MemoryCore, MemoryRecall};
+use tinymemory_api::recall::OwnedRecallOpts;
+use tinymemory_api::types::{MemoryCategory, MemoryEntry, MemoryTaint};
use crate::openhuman::memory::tools::flavour::{lookup_flavour, FlavourLookup};
use crate::openhuman::security::approval::{
redact_args, summarize_action, ApprovalGate, ExecutionOutcome, GateOutcome,
@@ -387,7 +387,7 @@ impl MemoryProvider for OpenHumanMemory {
// Reads people through the bound driver, like every other people caller
// — the store moved behind the loaded module.
- use crate::openhuman::memory::api::provider::MemoryProvider;
+ use tinymemory_api::provider::MemoryProvider;
let guard = crate::openhuman::memory::ops::guard::active_memory_guard()
.await
.map_err(|e| {
diff --git a/src/openhuman/modules/memory.rs b/src/openhuman/modules/memory.rs
index e1b75fad49..07c14e0210 100644
--- a/src/openhuman/modules/memory.rs
+++ b/src/openhuman/modules/memory.rs
@@ -34,14 +34,14 @@
//!
//! # Errors round-trip through the shared table
//!
-//! `crate::openhuman::memory::api::wire` maps a `MemoryError` to a `(name, message)` pair and
+//! `tinymemory_api::wire` maps a `MemoryError` to a `(name, message)` pair and
//! back, and **both ends use it**. Reimplementing the mapping here is what would
//! let a `PathEscape` arrive as an `Invalid`, silently reclassifying a sandbox
//! escape as a caller mistake.
use std::sync::Arc;
-use crate::openhuman::memory::api::capabilities::{Capabilities, Capability};
+use tinymemory_api::capabilities::{Capabilities, Capability};
/// The release whose capability set [`ARTIFACT_CAPABILITIES`] was read from.
///
@@ -122,15 +122,15 @@ fn capabilities_for(assume_full: bool) -> Capabilities {
fn artifact_serves(capability: Capability) -> bool {
assume_full_capabilities() || ARTIFACT_CAPABILITIES.contains(&capability)
}
-use crate::openhuman::memory::api::chunks::Chunk;
-use crate::openhuman::memory::api::error::MemoryError;
-use crate::openhuman::memory::api::goals::GoalsDoc;
-use crate::openhuman::memory::api::health::MemoryHealth;
-use crate::openhuman::memory::api::provider::types::{
+use tinymemory_api::chunks::Chunk;
+use tinymemory_api::error::MemoryError;
+use tinymemory_api::goals::GoalsDoc;
+use tinymemory_api::health::MemoryHealth;
+use tinymemory_api::provider::types::{
DiffReport, EntityHit, ExportPage, ExportRecord, ImportOutcome, IngestItem, IngestOutcome,
MaintenanceReport, SnapshotRef, SourceItem, SourceScope,
};
-use crate::openhuman::memory::api::provider::{
+use tinymemory_api::provider::{
AddressBookSeedOutcome, ChunkDetail, ChunkEmbedding, ChunkQuery, CoverWindowQuery, EntityMatch,
FacetType, FastRetrieveQuery, MemoryChunks, MemoryCore, MemoryDiff, MemoryDocuments,
MemoryEntities, MemoryGoals, MemoryGraph, MemoryIngest, MemoryMaintenance, MemoryPeople,
@@ -139,15 +139,15 @@ use crate::openhuman::memory::api::provider::{
PersonScore, ProfileFacet, RankedPerson, ResolvedPerson, RetrievalHit, RetrievalResponse,
SourceRetrievalQuery, UserState,
};
-use crate::openhuman::memory::api::recall::OwnedRecallOpts;
-use crate::openhuman::memory::api::tool_memory::ToolMemoryRule;
-use crate::openhuman::memory::api::tree::{IngestRequest, QueryResult, TreeStatus};
-use crate::openhuman::memory::api::types::{
+use tinymemory_api::recall::OwnedRecallOpts;
+use tinymemory_api::tool_memory::ToolMemoryRule;
+use tinymemory_api::tree::{IngestRequest, QueryResult, TreeStatus};
+use tinymemory_api::types::{
GraphRelationRecord, MemoryCategory, MemoryEntry, MemoryKvRecord, MemoryTaint,
NamespaceDocumentInput, NamespaceMemoryHit, NamespaceRetrievalContext, NamespaceSummary,
StoredMemoryDocument,
};
-use crate::openhuman::memory::api::wire;
+use tinymemory_api::wire;
use async_trait::async_trait;
use super::{host, ops, registry};
diff --git a/src/openhuman/modules/memory_host.rs b/src/openhuman/modules/memory_host.rs
index e2948babda..f6e17331e1 100644
--- a/src/openhuman/modules/memory_host.rs
+++ b/src/openhuman/modules/memory_host.rs
@@ -2,7 +2,7 @@
use crate::core::bus::BUS;
use crate::openhuman::config::Config;
-use crate::openhuman::memory::api::host::{MemoryEvent, SpacyResponse};
+use tinymemory_api::host::{MemoryEvent, SpacyResponse};
use std::sync::Arc;
use tinyagents::harness::model::{ModelRequest, ModelResponse};
use tinybus::ObjectPath;
diff --git a/src/openhuman/modules/memory_tests.rs b/src/openhuman/modules/memory_tests.rs
index 69788758b5..65514fd5c1 100644
--- a/src/openhuman/modules/memory_tests.rs
+++ b/src/openhuman/modules/memory_tests.rs
@@ -9,9 +9,9 @@
use std::sync::Arc;
-use crate::openhuman::memory::api::capabilities::{Capabilities, Capability};
-use crate::openhuman::memory::api::error::MemoryError;
-use crate::openhuman::memory::api::provider::MemoryProvider;
+use tinymemory_api::capabilities::{Capabilities, Capability};
+use tinymemory_api::error::MemoryError;
+use tinymemory_api::provider::MemoryProvider;
use super::{from_bus, ModuleMemoryProvider, MODULE_ID};
use crate::openhuman::config::Config;
@@ -135,13 +135,13 @@ fn the_memory_record_publishes_one_asset_per_supported_host() {
fn a_not_found_survives_the_round_trip_as_not_found() {
// `get`'s contract makes a missing entry `Ok(None)` and an `Invalid` a real
// failure, so collapsing the two would be observable to a caller.
- let error = from_bus(&failure(crate::openhuman::memory::api::wire::NOT_FOUND));
+ let error = from_bus(&failure(tinymemory_api::wire::NOT_FOUND));
assert!(matches!(error, MemoryError::NotFound(_)), "{error:?}");
}
#[test]
fn an_invalid_input_is_reported_as_something_the_caller_can_fix() {
- let error = from_bus(&failure(crate::openhuman::memory::api::wire::INVALID));
+ let error = from_bus(&failure(tinymemory_api::wire::INVALID));
assert!(matches!(error, MemoryError::Invalid(_)), "{error:?}");
}
@@ -149,13 +149,13 @@ fn an_invalid_input_is_reported_as_something_the_caller_can_fix() {
fn a_path_escape_does_not_arrive_as_a_caller_mistake() {
// The mapping's most security-relevant case: a sandbox escape must not be
// reclassified as a malformed argument.
- let error = from_bus(&failure(crate::openhuman::memory::api::wire::PATH_ESCAPE));
+ let error = from_bus(&failure(tinymemory_api::wire::PATH_ESCAPE));
assert!(matches!(error, MemoryError::PathEscape(_)), "{error:?}");
}
#[test]
fn an_unsupported_capability_keeps_its_family_name() {
- let error = from_bus(&failure(crate::openhuman::memory::api::wire::UNSUPPORTED));
+ let error = from_bus(&failure(tinymemory_api::wire::UNSUPPORTED));
assert!(
matches!(error, MemoryError::Unsupported { .. }),
"{error:?}"
@@ -198,7 +198,7 @@ async fn a_disabled_host_reports_down_rather_than_erroring() {
assert!(
matches!(
health,
- crate::openhuman::memory::api::health::MemoryHealth::Down { .. }
+ tinymemory_api::health::MemoryHealth::Down { .. }
),
"a disabled module host must report Down, got {health:?}"
);
@@ -211,7 +211,7 @@ async fn a_call_against_a_disabled_host_fails_instead_of_hanging() {
let provider = ModuleMemoryProvider::new(Arc::new(config));
let outcome =
- crate::openhuman::memory::api::provider::mandatory::MemoryCore::get(&provider, "ns", "key")
+ tinymemory_api::provider::mandatory::MemoryCore::get(&provider, "ns", "key")
.await;
assert!(outcome.is_err(), "expected an error, got {outcome:?}");
}
@@ -253,7 +253,7 @@ fn the_advertised_set_does_not_over_claim_the_artifact() {
// The regression guard for #5598 proper: the driver must not advertise a
// family the pinned artifact cannot serve. Capabilities::all() is what the
// CONTRACT declares; the artifact is older and smaller.
- use crate::openhuman::memory::api::capabilities::{Capabilities, Capability};
+ use tinymemory_api::capabilities::{Capabilities, Capability};
// `capabilities_for(false)` rather than `artifact_capabilities()`: the
// invariant is a property of the pinned list, and reading the environment
diff --git a/src/openhuman/tools/impl/system/tool_stats.rs b/src/openhuman/tools/impl/system/tool_stats.rs
index b3ee26a638..2e226cd44a 100644
--- a/src/openhuman/tools/impl/system/tool_stats.rs
+++ b/src/openhuman/tools/impl/system/tool_stats.rs
@@ -1,8 +1,8 @@
//! Tool that lets the agent query its own tool effectiveness data.
use crate::openhuman::agent::learning::tool_tracker::ToolStats;
-use crate::openhuman::memory::api::provider::MemoryCore as _;
-use crate::openhuman::memory::api::types::MemoryCategory;
+use tinymemory_api::provider::MemoryCore as _;
+use tinymemory_api::types::MemoryCategory;
use crate::openhuman::memory::ops::guard::active_memory_guard;
use crate::openhuman::tools::traits::{Tool, ToolResult};
use async_trait::async_trait;
@@ -165,7 +165,7 @@ mod tests {
&serde_json::to_string(stats).unwrap(),
MemoryCategory::Custom("tool_effectiveness".into()),
None,
- crate::openhuman::memory::api::types::MemoryTaint::Internal,
+ tinymemory_api::types::MemoryTaint::Internal,
)
.await
.unwrap();
diff --git a/src/openhuman/tools/ops.rs b/src/openhuman/tools/ops.rs
index 468c98cfdf..49eef9730d 100644
--- a/src/openhuman/tools/ops.rs
+++ b/src/openhuman/tools/ops.rs
@@ -1564,8 +1564,8 @@ fn tool_group(name: &str) -> crate::core::all::DomainGroup {
/// about what the *model is told exists*, and the later re-point onto
/// `MemoryGuard` must not change the advertised surface. Assigning them `None`
/// to dodge the mismatch would bake the wrong contract in.
-fn tool_capability(name: &str) -> Option<crate::openhuman::memory::api::capabilities::Capability> {
- use crate::openhuman::memory::api::capabilities::Capability;
+fn tool_capability(name: &str) -> Option<tinymemory_api::capabilities::Capability> {
+ use tinymemory_api::capabilities::Capability;
// Not driver-backed. Each entry is an argued exception, not a fallthrough.
if name == "update_memory_md" // writes the workspace `MEMORY.md` file directly
diff --git a/src/openhuman/tools/ops_tests.rs b/src/openhuman/tools/ops_tests.rs
index 441b4b7764..adba71100d 100644
--- a/src/openhuman/tools/ops_tests.rs
+++ b/src/openhuman/tools/ops_tests.rs
@@ -2726,9 +2726,9 @@ const TOOL_LESS: &[crate::core::all::DomainGroup] = {
/// Driver-backed memory tools and the capability each requires.
const MEMORY_TOOL_CAPABILITIES: &[(
&str,
- crate::openhuman::memory::api::capabilities::Capability,
+ tinymemory_api::capabilities::Capability,
)] = {
- use crate::openhuman::memory::api::capabilities::Capability as C;
+ use tinymemory_api::capabilities::Capability as C;
&[
("memory_store", C::Core),
("memory_forget", C::Core),
@@ -2815,7 +2815,7 @@ fn every_memory_tool_has_an_explicit_capability_or_is_core() {
/// (the never-filtered bucket). Synthetic names matching only the prefix.
#[test]
fn no_prefix_family_memory_tool_silently_defaults_to_uncapped() {
- use crate::openhuman::memory::api::capabilities::Capability;
+ use tinymemory_api::capabilities::Capability;
for (name, want) in [
("goals_new_thing", Capability::Goals),
("memory_tree_new_thing", Capability::Tree),