Skip to content

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

chore: reorder imports to follow standard grouping\n\nReordered `use` statements across 42 files so that external crate imports appear after internal crate imports, and grouped related imports together. This is a purely cosmetic change with no effect on behaviour, done to align with the project's import style conventions.\n\nAuto-committed-on: dragonfly\n

Steven Enamakelc72dd0e9dd86
diff --git a/src/core/cli_capability.rs b/src/core/cli_capability.rs
index c501d3bc4a..65392ddc4d 100644
--- a/src/core/cli_capability.rs
+++ b/src/core/cli_capability.rs
@@ -37,8 +37,8 @@
//! static namespace/function names, never from user-supplied argument values,
//! and no memory content can reach this path at all.
-use tinymemory_api::capabilities::{Capabilities, Capability};
use anyhow::Result;
+use tinymemory_api::capabilities::{Capabilities, Capability};
use crate::core::subsystem::DriverClass;
diff --git a/src/core/cli_tests.rs b/src/core/cli_tests.rs
index e0770b979f..ff4e258b1d 100644
--- a/src/core/cli_tests.rs
+++ b/src/core/cli_tests.rs
@@ -404,9 +404,7 @@ fn capability_gated_function_reports_a_config_fact_not_a_typo() {
fn capability_gated_rpc_method_reports_its_family_unfiltered() {
assert_eq!(
capability_for_rpc_method("openhuman.memory_tree_wipe_all"),
- Some(Some(
- tinymemory_api::capabilities::Capability::Tree
- ))
+ Some(Some(tinymemory_api::capabilities::Capability::Tree))
);
}
diff --git a/src/core/memory_cli.rs b/src/core/memory_cli.rs
index 5ad8a8100f..64baf51c90 100644
--- a/src/core/memory_cli.rs
+++ b/src/core/memory_cli.rs
@@ -62,9 +62,7 @@ const SUBCOMMAND_CONTROLLER: &[(&str, &str)] = &[
/// The capability `openhuman memory <sub>` needs, if any. Resolved from the
/// controller registry, never from a local table.
-fn required_capability(
- subcommand: &str,
-) -> Option<tinymemory_api::capabilities::Capability> {
+fn required_capability(subcommand: &str) -> Option<tinymemory_api::capabilities::Capability> {
let function = SUBCOMMAND_CONTROLLER
.iter()
.find(|(sub, _)| *sub == subcommand)
diff --git a/src/core/runtime/context.rs b/src/core/runtime/context.rs
index 21847185fb..13a63a48d2 100644
--- a/src/core/runtime/context.rs
+++ b/src/core/runtime/context.rs
@@ -373,8 +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() -> tinymemory_api::capabilities::Capabilities
- {
+ pub fn current_memory_capabilities() -> tinymemory_api::capabilities::Capabilities {
Self::current()
.map(|ctx| ctx.memory_capabilities())
.unwrap_or_else(crate::openhuman::memory::binding::unbound_default_capabilities)
diff --git a/src/openhuman/agent/learning/cache.rs b/src/openhuman/agent/learning/cache.rs
index c23e6c36ee..429963d205 100644
--- a/src/openhuman/agent/learning/cache.rs
+++ b/src/openhuman/agent/learning/cache.rs
@@ -7,10 +7,8 @@
use std::sync::Arc;
use crate::openhuman::agent::learning::candidate::FacetClass;
-use tinymemory_api::provider::{
- MemoryProfile, MemoryProvider, ProfileFacet, UserState,
-};
use crate::openhuman::memory::guard::MemoryGuard;
+use tinymemory_api::provider::{MemoryProfile, MemoryProvider, ProfileFacet, UserState};
/// Thin wrapper around the profile facet store.
///
@@ -205,9 +203,7 @@ pub fn class_prefix(class: FacetClass) -> &'static str {
// ── Facet state enum re-export (convenience for callers of this module) ───────
-pub use tinymemory_api::provider::{
- FacetState as CacheFacetState, UserState as CacheUserState,
-};
+pub use tinymemory_api::provider::{FacetState as CacheFacetState, UserState as CacheUserState};
// ── Tests ─────────────────────────────────────────────────────────────────────
diff --git a/src/openhuman/agent/learning/profile_md_renderer.rs b/src/openhuman/agent/learning/profile_md_renderer.rs
index 81ec883b16..68de710a09 100644
--- a/src/openhuman/agent/learning/profile_md_renderer.rs
+++ b/src/openhuman/agent/learning/profile_md_renderer.rs
@@ -43,9 +43,9 @@ 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 tinymemory_api::provider::UserState;
use tinybus::EventHandler;
use tinybus::SubscriptionHandle;
+use tinymemory_api::provider::UserState;
// ── Class → block metadata ────────────────────────────────────────────────────
@@ -220,9 +220,9 @@ impl EventHandler<DomainEvent> for RendererSubscriber {
mod tests {
use super::*;
use crate::openhuman::integrations::composio::providers::profile_md::{block_end, block_start};
- use tinymemory_api::provider::{FacetState, FacetType, ProfileFacet, UserState};
use std::sync::Arc;
use tempfile::TempDir;
+ use tinymemory_api::provider::{FacetState, FacetType, ProfileFacet, UserState};
fn make_cache() -> Arc<FacetCache> {
Arc::new(crate::openhuman::agent::learning::test_profile::in_memory_cache())
diff --git a/src/openhuman/agent/learning/prompt_sections.rs b/src/openhuman/agent/learning/prompt_sections.rs
index ed318f0cb0..d09229cc17 100644
--- a/src/openhuman/agent/learning/prompt_sections.rs
+++ b/src/openhuman/agent/learning/prompt_sections.rs
@@ -163,8 +163,8 @@ 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 tinymemory_api::provider::ProfileFacet;
use std::collections::BTreeMap;
+ use tinymemory_api::provider::ProfileFacet;
let mut by_class: BTreeMap<String, Vec<usize>> = BTreeMap::new();
for (idx, f) in facets.iter().enumerate() {
@@ -196,12 +196,11 @@ pub async fn load_learned_from_cache(
// Phase 4: render in structured `class/key: value` form so the
// 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 == tinymemory_api::provider::UserState::Pinned {
- " *(pinned)*"
- } else {
- ""
- };
+ let pinned = if f.user_state == tinymemory_api::provider::UserState::Pinned {
+ " *(pinned)*"
+ } else {
+ ""
+ };
let entry = if f.key.starts_with("goal/") {
// Goal class: render just the value, it's a sentence.
format!("{}{}", f.value, pinned)
@@ -380,9 +379,7 @@ mod tests {
#[tokio::test]
async fn load_learned_from_cache_formats_active_facets() {
- use tinymemory_api::provider::{
- FacetState, FacetType, ProfileFacet, UserState,
- };
+ use tinymemory_api::provider::{FacetState, FacetType, ProfileFacet, UserState};
let cache = crate::openhuman::agent::learning::test_profile::in_memory_cache();
let make_facet = |id: &str, key: &str, value: &str, stab: f64| ProfileFacet {
diff --git a/src/openhuman/agent/learning/schemas.rs b/src/openhuman/agent/learning/schemas.rs
index 55cfad728a..466ca6ec41 100644
--- a/src/openhuman/agent/learning/schemas.rs
+++ b/src/openhuman/agent/learning/schemas.rs
@@ -477,11 +477,9 @@ mod tests {
#[test]
fn facet_to_json_includes_cue_families_and_evidence_refs() {
- use tinymemory_api::host::EvidenceRef;
- use tinymemory_api::provider::{
- FacetState, FacetType, ProfileFacet, UserState,
- };
use std::collections::HashMap;
+ use tinymemory_api::host::EvidenceRef;
+ use tinymemory_api::provider::{FacetState, FacetType, ProfileFacet, UserState};
let mut cue_families = HashMap::new();
cue_families.insert("explicit".to_string(), 3u32);
diff --git a/src/openhuman/agent/learning/stability_detector.rs b/src/openhuman/agent/learning/stability_detector.rs
index 0484e820e4..0e8ce5c3e3 100644
--- a/src/openhuman/agent/learning/stability_detector.rs
+++ b/src/openhuman/agent/learning/stability_detector.rs
@@ -509,9 +509,7 @@ fn dominant_cue(cands: &[LearningCandidate], _existing: Option<&ProfileFacet>) -
/// domain knowledge, not engine storage, and belongs host-side with the rest of
/// the learning subsystem. Tracked as stage 4 in
/// `docs/specs/2026-08-13-memory-module-port.md`.
-fn evidence_to_contract(
- refs: &[candidate::EvidenceRef],
-) -> Vec<tinymemory_api::host::EvidenceRef> {
+fn evidence_to_contract(refs: &[candidate::EvidenceRef]) -> Vec<tinymemory_api::host::EvidenceRef> {
refs.iter()
.filter_map(|r| {
serde_json::to_value(r)
diff --git a/src/openhuman/agent/learning/tools.rs b/src/openhuman/agent/learning/tools.rs
index 667540c539..7240a6f168 100644
--- a/src/openhuman/agent/learning/tools.rs
+++ b/src/openhuman/agent/learning/tools.rs
@@ -23,8 +23,8 @@ 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 tinymemory_api::provider::{FacetState, ProfileFacet, UserState};
use crate::openhuman::tools::traits::{PermissionLevel, Tool, ToolResult};
+use tinymemory_api::provider::{FacetState, ProfileFacet, UserState};
/// 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 ed6f82d0c2..2fa0f53165 100644
--- a/src/openhuman/agent/tools/remember_preference.rs
+++ b/src/openhuman/agent/tools/remember_preference.rs
@@ -34,8 +34,6 @@
//! component. The preference is authoritative from the moment the tool
//! returns `Ok`.
-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;
@@ -43,6 +41,8 @@ use crate::openhuman::tools::traits::{PermissionLevel, Tool, ToolResult};
use async_trait::async_trait;
use serde_json::json;
use std::sync::Arc;
+use tinymemory_api::provider::MemoryCore;
+use tinymemory_api::types::{MemoryCategory, MemoryTaint};
/// Valid facet classes that a pinned preference may belong to.
///
diff --git a/src/openhuman/agent/tools/save_preference.rs b/src/openhuman/agent/tools/save_preference.rs
index 654289b4b1..d8f0a6e2f3 100644
--- a/src/openhuman/agent/tools/save_preference.rs
+++ b/src/openhuman/agent/tools/save_preference.rs
@@ -23,12 +23,12 @@ use std::sync::Arc;
use async_trait::async_trait;
use serde_json::json;
-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;
use crate::openhuman::tools::traits::{PermissionLevel, Tool, ToolResult};
+use tinymemory_api::provider::MemoryCore as _;
+use tinymemory_api::types::MemoryCategory;
use tinymemory_core::store::safety;
// Namespace constants live in `memory::preferences` so the write path (here),
diff --git a/src/openhuman/channels/context.rs b/src/openhuman/channels/context.rs
index 0256a6f265..c4bc4c96a0 100644
--- a/src/openhuman/channels/context.rs
+++ b/src/openhuman/channels/context.rs
@@ -175,9 +175,9 @@ pub(crate) async fn build_memory_context(
mod tests {
use super::*;
use crate::openhuman::channels::traits;
- use tinymemory_api::types::{MemoryCategory, MemoryEntry};
use crate::openhuman::tools::{Tool, ToolResult};
use async_trait::async_trait;
+ use tinymemory_api::types::{MemoryCategory, MemoryEntry};
struct DummyTool;
diff --git a/src/openhuman/channels/controllers/ops/connect.rs b/src/openhuman/channels/controllers/ops/connect.rs
index 1e483c91f3..a053cf14b9 100644
--- a/src/openhuman/channels/controllers/ops/connect.rs
+++ b/src/openhuman/channels/controllers/ops/connect.rs
@@ -8,8 +8,8 @@ use crate::openhuman::channels::traits::Channel;
use crate::openhuman::config::{Config, DiscordConfig, IMessageConfig, TelegramConfig};
use crate::openhuman::security::credentials;
use crate::rpc::RpcOutcome;
-use tinymemory_core::store::chunks::store as memory_tree_store;
use tinymemory_api::chunks::SourceKind;
+use tinymemory_core::store::chunks::store as memory_tree_store;
use super::super::definitions::{
all_channel_definitions, find_channel_definition, ChannelAuthMode, ChannelDefinition,
diff --git a/src/openhuman/channels/controllers/ops_tests.rs b/src/openhuman/channels/controllers/ops_tests.rs
index 06e2347146..7bbd85dd64 100644
--- a/src/openhuman/channels/controllers/ops_tests.rs
+++ b/src/openhuman/channels/controllers/ops_tests.rs
@@ -4,8 +4,8 @@ use crate::openhuman::channels::providers::yuanbao::YuanbaoConfig;
use crate::openhuman::config::schema::{DiscordConfig, IMessageConfig};
use chrono::{TimeZone, Utc};
use tempfile::tempdir;
-use tinymemory_core::store::chunks::store as memory_tree_store;
use tinymemory_api::chunks::{chunk_id, Chunk, Metadata, SourceKind, SourceRef};
+use tinymemory_core::store::chunks::store as memory_tree_store;
fn isolated_test_config() -> (tempfile::TempDir, Config) {
let tmp = tempdir().expect("failed to create temp dir");
diff --git a/src/openhuman/channels/runtime/dispatch/processor.rs b/src/openhuman/channels/runtime/dispatch/processor.rs
index fd7653f6e1..cde3b6db8f 100644
--- a/src/openhuman/channels/runtime/dispatch/processor.rs
+++ b/src/openhuman/channels/runtime/dispatch/processor.rs
@@ -26,11 +26,11 @@ use crate::openhuman::channels::routes::{
use crate::openhuman::channels::traits;
use crate::openhuman::channels::{ChannelSendExt, SendMessage};
use crate::openhuman::inference::provider;
-use tinymemory_api::provider::MemoryCore as _;
use crate::openhuman::util::truncate_with_ellipsis;
use std::sync::Arc;
use std::time::{Duration, Instant};
use tinybus::NativeRequestError;
+use tinymemory_api::provider::MemoryCore as _;
use tokio_util::sync::CancellationToken;
use super::helpers::{
diff --git a/src/openhuman/channels/runtime/test_support.rs b/src/openhuman/channels/runtime/test_support.rs
index 6ce420090f..63b323ea93 100644
--- a/src/openhuman/channels/runtime/test_support.rs
+++ b/src/openhuman/channels/runtime/test_support.rs
@@ -17,7 +17,6 @@ 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 tinymemory_api::types::{MemoryCategory, MemoryEntry};
use crate::openhuman::tools::{Tool, ToolResult};
use anyhow::Result;
use async_trait::async_trait;
@@ -26,6 +25,7 @@ use std::sync::atomic::{AtomicUsize, Ordering};
use std::sync::{Arc, Mutex};
use std::time::Duration;
use tinyagents::harness::model::{ChatModel, ModelRequest, ModelResponse};
+use tinymemory_api::types::{MemoryCategory, MemoryEntry};
#[derive(Debug, Clone)]
pub struct DispatchHarnessOptions {
@@ -227,8 +227,7 @@ impl tinymemory_api::provider::MemoryCore for HarnessMemory {
&self,
_namespace: &str,
_key: &str,
- ) -> std::result::Result<Option<MemoryEntry>, tinymemory_api::error::MemoryError>
- {
+ ) -> std::result::Result<Option<MemoryEntry>, tinymemory_api::error::MemoryError> {
Ok(None)
}
@@ -245,8 +244,7 @@ impl tinymemory_api::provider::MemoryCore for HarnessMemory {
_namespace: Option<&str>,
_category: Option<&MemoryCategory>,
_session_id: Option<&str>,
- ) -> std::result::Result<Vec<MemoryEntry>, tinymemory_api::error::MemoryError>
- {
+ ) -> std::result::Result<Vec<MemoryEntry>, tinymemory_api::error::MemoryError> {
Ok(Vec::new())
}
@@ -268,8 +266,7 @@ impl tinymemory_api::provider::MemoryRecall for HarnessMemory {
_limit: usize,
_opts: &tinymemory_api::recall::OwnedRecallOpts,
_scope: Option<&tinymemory_api::provider::types::SourceScope>,
- ) -> std::result::Result<Vec<MemoryEntry>, tinymemory_api::error::MemoryError>
- {
+ ) -> std::result::Result<Vec<MemoryEntry>, tinymemory_api::error::MemoryError> {
Ok(self.entries.clone())
}
}
@@ -284,9 +281,9 @@ impl tinymemory_api::provider::MemoryPortability for HarnessMemory {
tinymemory_api::provider::types::ExportPage,
tinymemory_api::error::MemoryError,
> {
- Err(tinymemory_api::error::MemoryError::Other(
- anyhow::anyhow!("harness memory does not export"),
- ))
+ Err(tinymemory_api::error::MemoryError::Other(anyhow::anyhow!(
+ "harness memory does not export"
+ )))
}
async fn import_records(
@@ -296,9 +293,9 @@ impl tinymemory_api::provider::MemoryPortability for HarnessMemory {
tinymemory_api::provider::types::ImportOutcome,
tinymemory_api::error::MemoryError,
> {
- Err(tinymemory_api::error::MemoryError::Other(
- anyhow::anyhow!("harness memory does not import"),
- ))
+ Err(tinymemory_api::error::MemoryError::Other(anyhow::anyhow!(
+ "harness memory does not import"
+ )))
}
}
diff --git a/src/openhuman/channels/tests/memory.rs b/src/openhuman/channels/tests/memory.rs
index be94f64a3f..5468edfdb0 100644
--- a/src/openhuman/channels/tests/memory.rs
+++ b/src/openhuman/channels/tests/memory.rs
@@ -7,11 +7,11 @@ use super::super::{traits, Channel};
use super::common::{HistoryCaptureModel, RecordingChannel};
use crate::openhuman::inference::embeddings::NoopEmbedding;
use crate::openhuman::inference::provider;
-use tinymemory_api::provider::MemoryCore as _;
use crate::openhuman::memory::{Memory, MemoryCategory};
use std::collections::HashMap;
use std::sync::{Arc, Mutex};
use tempfile::TempDir;
+use tinymemory_api::provider::MemoryCore as _;
use tinymemory_core::store::UnifiedMemory;
fn conversation_memory_key_uses_message_id() {
diff --git a/src/openhuman/flows/bus.rs b/src/openhuman/flows/bus.rs
index 9c985fb2bf..b6e12c9e0f 100644
--- a/src/openhuman/flows/bus.rs
+++ b/src/openhuman/flows/bus.rs
@@ -14,8 +14,6 @@ use crate::core::events::DomainEvent;
use crate::openhuman::config::Config;
use crate::openhuman::flows::store;
use crate::openhuman::flows::{flow_namespace, Flow, FlowRun};
-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};
@@ -23,6 +21,8 @@ use std::sync::{Arc, LazyLock, Mutex};
use tinybus::EventHandler;
use tinyflows::model::{NodeKind, TriggerKind};
use tinyflows::nodes::control_flow::dedup as dedup_node;
+use tinymemory_api::provider::MemoryCore;
+use tinymemory_api::types::{MemoryCategory, MemoryTaint};
/// Reads `trigger_kind` from a flow's trigger node config, deserializing into
/// `tinyflows::model::TriggerKind`. Returns `None` when the flow doesn't have
diff --git a/src/openhuman/flows/memory_tools.rs b/src/openhuman/flows/memory_tools.rs
index 238a562667..d04a5c5724 100644
--- a/src/openhuman/flows/memory_tools.rs
+++ b/src/openhuman/flows/memory_tools.rs
@@ -32,13 +32,13 @@ use async_trait::async_trait;
use serde_json::json;
use crate::openhuman::agent::turn_origin::{self, AgentTurnOrigin, TrustedAutomationSource};
-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;
use crate::openhuman::tools::traits::{PermissionLevel, Tool, ToolResult};
+use tinymemory_api::provider::{MemoryCore, MemoryRecall};
+use tinymemory_api::recall::OwnedRecallOpts;
+use tinymemory_api::types::{MemoryCategory, MemoryEntry, MemoryTaint};
/// Returns the flow id the *run itself* is scoped under, when the current
/// agent turn is executing inside a saved-flow run
diff --git a/src/openhuman/flows/ops.rs b/src/openhuman/flows/ops.rs
index 6c30ed279c..ddb8597809 100644
--- a/src/openhuman/flows/ops.rs
+++ b/src/openhuman/flows/ops.rs
@@ -23,12 +23,12 @@ use crate::openhuman::flows::types::{
FlowConnection, FlowRunStep, FlowRunTrigger, FlowSuggestion, SuggestionStatus,
};
use crate::openhuman::flows::{flow_namespace, Flow, FlowRun};
-use tinymemory_api::provider::MemoryProvider;
use crate::openhuman::security::approval::{
ApprovalChatContext, FlowRunContext, APPROVAL_CHAT_CONTEXT, APPROVAL_COPILOT_STREAM_CONTEXT,
APPROVAL_FLOW_RUN_CONTEXT,
};
use crate::rpc::RpcOutcome;
+use tinymemory_api::provider::MemoryProvider;
use tinymemory_core::store::MemoryClientRef;
/// Overall safety bound on a single `flows_run` / `flows_resume`. Individual
diff --git a/src/openhuman/flows/tinyflows/memory_adapter.rs b/src/openhuman/flows/tinyflows/memory_adapter.rs
index 6daaf05950..e0859d5f27 100644
--- a/src/openhuman/flows/tinyflows/memory_adapter.rs
+++ b/src/openhuman/flows/tinyflows/memory_adapter.rs
@@ -41,14 +41,14 @@ 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 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,
};
use crate::openhuman::security::{CommandClass, SecurityPolicy};
+use tinymemory_api::provider::{MemoryCore, MemoryRecall};
+use tinymemory_api::recall::OwnedRecallOpts;
+use tinymemory_api::types::{MemoryCategory, MemoryEntry, MemoryTaint};
use super::caps::{enforce_node_tier_gate, gate_call_for_tier};
diff --git a/src/openhuman/integrations/composio/ops/memory_cleanup.rs b/src/openhuman/integrations/composio/ops/memory_cleanup.rs
index 58dde07dad..266261777e 100644
--- a/src/openhuman/integrations/composio/ops/memory_cleanup.rs
+++ b/src/openhuman/integrations/composio/ops/memory_cleanup.rs
@@ -3,8 +3,8 @@
use std::sync::Arc;
use crate::openhuman::config::Config;
-use tinymemory_core::store::chunks::store as memory_tree_store;
use tinymemory_api::chunks::SourceKind;
+use tinymemory_core::store::chunks::store as memory_tree_store;
use tinymemory_core::store::MemoryClientRef;
#[derive(Debug, Clone, PartialEq, Eq)]
diff --git a/src/openhuman/integrations/composio/ops_tests.rs b/src/openhuman/integrations/composio/ops_tests.rs
index f288b110af..9481cdbaf9 100644
--- a/src/openhuman/integrations/composio/ops_tests.rs
+++ b/src/openhuman/integrations/composio/ops_tests.rs
@@ -240,8 +240,8 @@ use axum::{
use chrono::{TimeZone, Utc};
use serde_json::{json, Value};
use std::collections::HashMap;
-use tinymemory_core::store::chunks::store as memory_tree_store;
use tinymemory_api::chunks::{chunk_id, Chunk, Metadata, SourceKind, SourceRef};
+use tinymemory_core::store::chunks::store as memory_tree_store;
struct WorkspaceEnvGuard {
previous: Option<std::ffi::OsString>,
diff --git a/src/openhuman/memory/guard/families_tests.rs b/src/openhuman/memory/guard/families_tests.rs
index 7d3a5a8d7c..ccc3fbdd33 100644
--- a/src/openhuman/memory/guard/families_tests.rs
+++ b/src/openhuman/memory/guard/families_tests.rs
@@ -11,9 +11,9 @@ use crate::openhuman::memory::api::types::MemoryTaint;
use crate::openhuman::memory::guard::test_support::{
document, embedded_policy, external_policy, guarded,
};
+use crate::openhuman::memory::source_scope::with_source_scope;
use crate::openhuman::security::live_policy;
use crate::openhuman::security::policy::{AutonomyLevel, SecurityPolicy};
-use crate::openhuman::memory::source_scope::with_source_scope;
fn ingest_request(content: &str) -> IngestRequest {
IngestRequest {
diff --git a/src/openhuman/memory/guard/policy.rs b/src/openhuman/memory/guard/policy.rs
index 16770e0676..e54440e30b 100644
--- a/src/openhuman/memory/guard/policy.rs
+++ b/src/openhuman/memory/guard/policy.rs
@@ -42,11 +42,11 @@ use crate::openhuman::memory::api::types::MemoryTaint;
use crate::core::subsystem::DriverClass;
use crate::openhuman::config::schema::MemoryHooksConfig;
+use crate::openhuman::memory::source_scope::current_source_scope;
use crate::openhuman::security::egress::emit_external_transfer;
use crate::openhuman::security::egress::types::{DataKind, EgressDescriptor, EgressReason};
use crate::openhuman::security::live_policy;
use crate::openhuman::security::policy::ToolOperation;
-use crate::openhuman::memory::source_scope::current_source_scope;
/// Prefix on every guard-authored error message, so a refusal that surfaces to
/// a caller is attributable to the guard rather than to the driver underneath.
diff --git a/src/openhuman/memory/guard/policy_tests.rs b/src/openhuman/memory/guard/policy_tests.rs
index 44c2ad61d0..e29f8a73f5 100644
--- a/src/openhuman/memory/guard/policy_tests.rs
+++ b/src/openhuman/memory/guard/policy_tests.rs
@@ -3,9 +3,9 @@
use super::*;
use std::sync::Arc;
+use crate::openhuman::memory::source_scope::with_source_scope;
use crate::openhuman::security::live_policy;
use crate::openhuman::security::policy::{AutonomyLevel, SecurityPolicy};
-use crate::openhuman::memory::source_scope::with_source_scope;
use crate::openhuman::memory::guard::test_support::{embedded_policy, external_policy};
diff --git a/src/openhuman/memory/read_rpc/admin.rs b/src/openhuman/memory/read_rpc/admin.rs
index bb58bcabdd..868b3bfa18 100644
--- a/src/openhuman/memory/read_rpc/admin.rs
+++ b/src/openhuman/memory/read_rpc/admin.rs
@@ -3,10 +3,10 @@ use rusqlite::params;
use crate::openhuman::config::Config;
use crate::rpc::RpcOutcome;
+use tinymemory_api::chunks::SourceKind;
use tinymemory_core::store::chunks::store::{
delete_chunks_by_source, delete_orphaned_source_tree, with_connection,
};
-use tinymemory_api::chunks::SourceKind;
use super::types::{
DeleteSourceResponse, FlushNowResponse, FlushSourceTreeResponse, ResetTreeResponse,
diff --git a/src/openhuman/memory/read_rpc/mod.rs b/src/openhuman/memory/read_rpc/mod.rs
index dd53cfe4b9..152f0778a5 100644
--- a/src/openhuman/memory/read_rpc/mod.rs
+++ b/src/openhuman/memory/read_rpc/mod.rs
@@ -40,9 +40,7 @@ pub use types::{
pub use vault::{obsidian_vault_status_rpc, vault_health_check_rpc};
#[allow(dead_code)]
-pub(crate) fn parse_source_kind_str(
- s: &str,
-) -> Option<tinymemory_api::chunks::SourceKind> {
+pub(crate) fn parse_source_kind_str(s: &str) -> Option<tinymemory_api::chunks::SourceKind> {
tinymemory_api::chunks::SourceKind::parse(s).ok()
}
@@ -51,9 +49,9 @@ pub(crate) use crate::openhuman::config::Config;
#[cfg(test)]
pub(crate) use admin::clear_composio_sync_state;
#[cfg(test)]
-pub(crate) use tinymemory_core::store::chunks::store::with_connection;
-#[cfg(test)]
pub(crate) use tinymemory_api::chunks::SourceKind;
+#[cfg(test)]
+pub(crate) use tinymemory_core::store::chunks::store::with_connection;
#[cfg(test)]
#[path = "../read_rpc_tests.rs"]
diff --git a/src/openhuman/memory/read_rpc_tests.rs b/src/openhuman/memory/read_rpc_tests.rs
index 54b1ce70a3..a2d5590166 100644
--- a/src/openhuman/memory/read_rpc_tests.rs
+++ b/src/openhuman/memory/read_rpc_tests.rs
@@ -1010,8 +1010,8 @@ async fn vault_health_check_reports_writable_and_obsidian_registered_when_ready(
/// seal jobs. This pins that a wipe leaves the gate empty so re-sync works.
#[tokio::test]
async fn wipe_all_clears_ingest_gate() {
- use tinymemory_core::store::chunks::store as chunk_store;
use tinymemory_api::chunks::SourceKind;
+ use tinymemory_core::store::chunks::store as chunk_store;
let (_tmp, cfg) = test_config();
let gate_key = "notion:conn-1:page-abc@1700000000000";
diff --git a/src/openhuman/memory/store_golden.rs b/src/openhuman/memory/store_golden.rs
index 94c9d419d4..e19af0b979 100644
--- a/src/openhuman/memory/store_golden.rs
+++ b/src/openhuman/memory/store_golden.rs
@@ -48,9 +48,9 @@ use crate::openhuman::memory::ops::{
doc_list, doc_put, graph_query, graph_upsert, kv_get, memory_query_namespace, GraphQueryParams,
GraphUpsertParams, KvGetDeleteParams, KvSetParams, NamespaceOnlyParams, PutDocParams,
};
+use tinymemory_api::chunks::{Chunk, Metadata, SourceKind, SourceRef};
use tinymemory_core::rpc_models::QueryNamespaceRequest;
use tinymemory_core::store::chunks;
-use tinymemory_api::chunks::{Chunk, Metadata, SourceKind, SourceRef};
use tinymemory_core::store::namespace_store::{events, fts5, profile, segments};
use tinymemory_core::store::trees;
use tinymemory_core::store::trees::types::{SummaryNode, Tree, TreeKind, TreeStatus};
diff --git a/src/openhuman/memory/sync_pipeline_e2e_tests.rs b/src/openhuman/memory/sync_pipeline_e2e_tests.rs
index 31ac64f67e..d1d701f6c0 100644
--- a/src/openhuman/memory/sync_pipeline_e2e_tests.rs
+++ b/src/openhuman/memory/sync_pipeline_e2e_tests.rs
@@ -28,13 +28,13 @@ use crate::openhuman::memory::tree::score::store::lookup_entity;
use tinybus::EventHandler;
use tinybus::SubscriptionHandle;
use tinycortex::memory::ingest::canonicalize::chat::{ChatBatch, ChatMessage};
+use tinymemory_api::sync_events::{emit_sync_stage, MemorySyncStage, MemorySyncTrigger};
use tinymemory_core::ingest_pipeline::ingest_chat;
use tinymemory_core::queue::{self as memory_queue, count_total, drain_until_idle, JobStatus};
use tinymemory_core::store::chunks::store::{
count_chunks, count_chunks_by_lifecycle_status, CHUNK_STATUS_BUFFERED,
};
use tinymemory_core::store::trees::{store as tree_store, types::TreeKind};
-use tinymemory_api::sync_events::{emit_sync_stage, MemorySyncStage, MemorySyncTrigger};
// ── helpers ─────────────────────────────────────────────────────────────
diff --git a/src/openhuman/memory/tools/search/chunk_context.rs b/src/openhuman/memory/tools/search/chunk_context.rs
index d88d778eb8..93fdf1e083 100644
--- a/src/openhuman/memory/tools/search/chunk_context.rs
+++ b/src/openhuman/memory/tools/search/chunk_context.rs
@@ -98,7 +98,10 @@ impl Tool for MemoryChunkContextTool {
// Per-profile memory-source gate: if the target chunk belongs to a
// source the active profile didn't allow, surface nothing (its window
// shares the same source). Non-source chunks always pass.
- if !crate::openhuman::memory::source_scope::chunk_source_allowed(&target.metadata.tags, &source_id) {
+ if !crate::openhuman::memory::source_scope::chunk_source_allowed(
+ &target.metadata.tags,
+ &source_id,
+ ) {
return Ok(ToolResult::success(
"Chunk is from a memory source not available to the active agent profile.",
));
diff --git a/src/openhuman/memory/tree/retrieval/rpc.rs b/src/openhuman/memory/tree/retrieval/rpc.rs
index 55953731ce..055c4aa210 100644
--- a/src/openhuman/memory/tree/retrieval/rpc.rs
+++ b/src/openhuman/memory/tree/retrieval/rpc.rs
@@ -249,8 +249,8 @@ pub async fn drill_down_rpc(
req.limit,
current_source_scope(),
)
- .await
- .map_err(|e| format!("drill_down: {e}"))?;
+ .await
+ .map_err(|e| format!("drill_down: {e}"))?;
let n = hits.len();
// node_id can embed source scope (e.g. "chat:slack:#eng:0") which may
// carry workspace hints — log only the structural prefix.
@@ -319,8 +319,8 @@ mod tests {
use super::*;
use chrono::{TimeZone, Utc};
use tempfile::TempDir;
- use tinymemory_core::store::chunks::store::upsert_chunks;
use tinymemory_api::chunks::{chunk_id, Chunk, Metadata, SourceRef};
+ use tinymemory_core::store::chunks::store::upsert_chunks;
use tinymemory_core::store::content as content_store;
fn stage_test_chunks(cfg: &Config, chunks: &[Chunk]) {
diff --git a/src/openhuman/memory/tree/tree/rpc.rs b/src/openhuman/memory/tree/tree/rpc.rs
index 31d26dbd30..86b745fa2b 100644
--- a/src/openhuman/memory/tree/tree/rpc.rs
+++ b/src/openhuman/memory/tree/tree/rpc.rs
@@ -16,12 +16,12 @@ use crate::rpc::RpcOutcome;
use tinycortex::memory::ingest::canonicalize::{
chat::ChatBatch, document::DocumentInput, email::EmailThread,
};
+use tinymemory_api::chunks::{Chunk, SourceKind};
use tinymemory_core::ingest_pipeline::{
ingest_chat as do_ingest_chat, ingest_document as do_ingest_document,
ingest_email as do_ingest_email, IngestResult,
};
use tinymemory_core::store::chunks::store::{self as chunk_store, ListChunksQuery};
-use tinymemory_api::chunks::{Chunk, SourceKind};
/// Unified ingest request. The `payload` shape is adapter-specific and is
/// validated inside the dispatch based on `source_kind`.
@@ -1105,8 +1105,8 @@ mod tests {
use serde_json::json;
use tempfile::TempDir;
use tinycortex::memory::ingest::canonicalize::document::DocumentInput;
- use tinymemory_core::queue as jobs;
use tinymemory_api::chunks::SourceKind;
+ use tinymemory_core::queue as jobs;
fn test_config() -> (TempDir, Config) {
let tmp = TempDir::new().unwrap();
diff --git a/src/openhuman/modules/memory.rs b/src/openhuman/modules/memory.rs
index d57a9d9a49..7d212fcd2f 100644
--- a/src/openhuman/modules/memory.rs
+++ b/src/openhuman/modules/memory.rs
@@ -140,6 +140,7 @@ fn capabilities_for(assume_full: bool) -> Capabilities {
fn artifact_serves(capability: Capability) -> bool {
assume_full_capabilities() || ARTIFACT_CAPABILITIES.contains(&capability)
}
+use async_trait::async_trait;
use tinymemory_api::chunks::Chunk;
use tinymemory_api::error::MemoryError;
use tinymemory_api::goals::GoalsDoc;
@@ -166,7 +167,6 @@ use tinymemory_api::types::{
StoredMemoryDocument,
};
use tinymemory_api::wire;
-use async_trait::async_trait;
use super::{host, ops, registry};
use crate::openhuman::config::Config;
diff --git a/src/openhuman/modules/memory_host.rs b/src/openhuman/modules/memory_host.rs
index f6e17331e1..f402d06d0e 100644
--- a/src/openhuman/modules/memory_host.rs
+++ b/src/openhuman/modules/memory_host.rs
@@ -2,10 +2,10 @@
use crate::core::bus::BUS;
use crate::openhuman::config::Config;
-use tinymemory_api::host::{MemoryEvent, SpacyResponse};
use std::sync::Arc;
use tinyagents::harness::model::{ModelRequest, ModelResponse};
use tinybus::ObjectPath;
+use tinymemory_api::host::{MemoryEvent, SpacyResponse};
const EMBEDDING_NAME: &str = "ai.tinyhumans.tinymemory.EmbeddingHost";
const EMBEDDING_PATH: &str = "/ai/tinyhumans/tinymemory/EmbeddingHost";
diff --git a/src/openhuman/modules/memory_tests.rs b/src/openhuman/modules/memory_tests.rs
index 9c20341325..95e3bf5528 100644
--- a/src/openhuman/modules/memory_tests.rs
+++ b/src/openhuman/modules/memory_tests.rs
@@ -196,10 +196,7 @@ async fn a_disabled_host_reports_down_rather_than_erroring() {
let provider = ModuleMemoryProvider::new(Arc::new(config));
let health = provider.health().await;
assert!(
- matches!(
- health,
- tinymemory_api::health::MemoryHealth::Down { .. }
- ),
+ matches!(health, tinymemory_api::health::MemoryHealth::Down { .. }),
"a disabled module host must report Down, got {health:?}"
);
}
@@ -211,8 +208,7 @@ async fn a_call_against_a_disabled_host_fails_instead_of_hanging() {
let provider = ModuleMemoryProvider::new(Arc::new(config));
let outcome =
- tinymemory_api::provider::mandatory::MemoryCore::get(&provider, "ns", "key")
- .await;
+ tinymemory_api::provider::mandatory::MemoryCore::get(&provider, "ns", "key").await;
assert!(outcome.is_err(), "expected an error, got {outcome:?}");
}
diff --git a/src/openhuman/security/credentials/ops_tests.rs b/src/openhuman/security/credentials/ops_tests.rs
index 6439cb7066..9b2f1c4d63 100644
--- a/src/openhuman/security/credentials/ops_tests.rs
+++ b/src/openhuman/security/credentials/ops_tests.rs
@@ -433,8 +433,8 @@ fn auth_me_store_validation_budget_reads_env_override() {
#[tokio::test]
async fn store_session_requeues_reembed_backfill_after_login() {
use chrono::TimeZone;
- use tinymemory_core::store::chunks::store::{upsert_chunks, upsert_staged_chunks_tx};
use tinymemory_api::chunks::{chunk_id, Chunk, Metadata, SourceKind, SourceRef};
+ use tinymemory_core::store::chunks::store::{upsert_chunks, upsert_staged_chunks_tx};
use tinymemory_core::store::content as content_store;
let _env_guard = crate::openhuman::config::TEST_ENV_LOCK
diff --git a/src/openhuman/tools/impl/system/tool_stats.rs b/src/openhuman/tools/impl/system/tool_stats.rs
index 2e226cd44a..2adfc6ec4d 100644
--- a/src/openhuman/tools/impl/system/tool_stats.rs
+++ b/src/openhuman/tools/impl/system/tool_stats.rs
@@ -1,11 +1,11 @@
//! Tool that lets the agent query its own tool effectiveness data.
use crate::openhuman::agent::learning::tool_tracker::ToolStats;
-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;
+use tinymemory_api::provider::MemoryCore as _;
+use tinymemory_api::types::MemoryCategory;
/// Holds no memory handle: it resolves the guarded driver per call, so the
/// tool registry no longer has to be handed an engine just to build this.
diff --git a/src/openhuman/tools/ops_tests.rs b/src/openhuman/tools/ops_tests.rs
index adba71100d..24587c4ba2 100644
--- a/src/openhuman/tools/ops_tests.rs
+++ b/src/openhuman/tools/ops_tests.rs
@@ -2724,10 +2724,7 @@ const TOOL_LESS: &[crate::core::all::DomainGroup] = {
// ---- tool_capability() drift guard (M5.3) ----------------------------------
/// Driver-backed memory tools and the capability each requires.
-const MEMORY_TOOL_CAPABILITIES: &[(
- &str,
- tinymemory_api::capabilities::Capability,
-)] = {
+const MEMORY_TOOL_CAPABILITIES: &[(&str, tinymemory_api::capabilities::Capability)] = {
use tinymemory_api::capabilities::Capability as C;
&[
("memory_store", C::Core),
diff --git a/src/openhuman/web_chat/run_task.rs b/src/openhuman/web_chat/run_task.rs
index 68e7d74864..1d25e9718e 100644
--- a/src/openhuman/web_chat/run_task.rs
+++ b/src/openhuman/web_chat/run_task.rs
@@ -258,7 +258,10 @@ pub(crate) async fn run_chat_task(
let turn = Box::pin(agent.run_single(message));
let result = match crate::openhuman::agent::tinyagents::thread_context::with_thread_id(
thread_id.to_string(),
- crate::openhuman::memory::source_scope::with_source_scope(profile.memory_sources.clone(), turn),
+ crate::openhuman::memory::source_scope::with_source_scope(
+ profile.memory_sources.clone(),
+ turn,
+ ),
)
.await
{