The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.
Rust agent-orchestrationai-agentsai-assistantdesktopllmlocal-firstmcppersonal-aiprivacyrustsecond-braintauri
chore: files changed crates/openhuman-core/src/agent/tinyagents/middleware/repeated_failure.rs,crate
Steven Enamakel8eda5f0d4380
diff --git a/crates/openhuman-core/src/agent/tinyagents/middleware/repeated_failure.rs b/crates/openhuman-core/src/agent/tinyagents/middleware/repeated_failure.rsindex 22ebe375ee..44d3d50e2f 100644--- a/crates/openhuman-core/src/agent/tinyagents/middleware/repeated_failure.rs+++ b/crates/openhuman-core/src/agent/tinyagents/middleware/repeated_failure.rs@@ -10,9 +10,9 @@ use async_trait::async_trait;use tinyagents_harness::context::RunContext;use tinyagents_harness::error::Result as TaResult;use tinyagents_harness::middleware::{- FailureScope, FailureScopeMiddleware, FailureScopePolicy, FailureStopKind, Middleware,- ToolFactsLookup, ToolInvocationIdentity, call_effect, dispatch_target, is_repeat_call_exempt,- repeat_guard_marker,+ call_effect, dispatch_target, is_repeat_call_exempt, repeat_guard_marker, FailureScope,+ FailureScopeMiddleware, FailureScopePolicy, FailureStopKind, Middleware, ToolFactsLookup,+ ToolInvocationIdentity,};use tinyagents_harness::no_progress::FailurePolicy;use tinyagents_harness::steering::SteeringHandle;@@ -32,7 +32,7 @@ use tinyinference_llm::failure::is_recoverable_failure_text as is_recoverable_to#[cfg(test)]use tinyagents_harness::no_progress::{- ClassifiedFailureTracker, ClassifiedStep, RecoverableFailureLadder, classified_step,+ classified_step, ClassifiedFailureTracker, ClassifiedStep, RecoverableFailureLadder,};/// `after_tool`: stop (or nudge) the run when tool calls keep failing with nodiff --git a/crates/openhuman-core/src/memory/backfill.rs b/crates/openhuman-core/src/memory/backfill.rsindex b312dec2ff..c61b4013a2 100644--- a/crates/openhuman-core/src/memory/backfill.rs+++ b/crates/openhuman-core/src/memory/backfill.rs@@ -21,8 +21,8 @@ use tinymemory_tools::backfill::{use tinymemory_tools::layout::identity::Identity;pub use tinymemory_tools::backfill::{- BACKFILL_TAG, BackfillPhase, BackfillState, BackfillView, MAIN_AGENT, PastTurn, pending_range,- turns_of,+ pending_range, turns_of, BackfillPhase, BackfillState, BackfillView, PastTurn, BACKFILL_TAG,+ MAIN_AGENT,};/// `memory_conversations_backfill_start` params.diff --git a/crates/openhuman-core/src/memory/backfill_tests.rs b/crates/openhuman-core/src/memory/backfill_tests.rsindex 586134dee7..d02550f67c 100644--- a/crates/openhuman-core/src/memory/backfill_tests.rs+++ b/crates/openhuman-core/src/memory/backfill_tests.rs@@ -349,11 +349,12 @@ async fn a_peer_driver_blocks_backfill_without_claiming_its_slot_or_state() {assert_eq!(blocked.state.phase, BackfillPhase::Idle);assert_eq!((blocked.pending_threads, blocked.pending_turns), (1, 1));assert!(!is_running(&workspace));- assert!(- crate::memory::state_store::load::<BackfillFile>(&workspace, "conversations_backfill")- .unwrap()- .is_none()- );+ assert!(crate::memory::state_store::load::<BackfillFile>(+ &workspace,+ "conversations_backfill"+ )+ .unwrap()+ .is_none());drop(peer_guard);let started = start(@@ -367,10 +368,11 @@ async fn a_peer_driver_blocks_backfill_without_claiming_its_slot_or_state() {let done = wait_done(&config).await;assert_eq!(done.state.phase, BackfillPhase::Done, "{:?}", done.state);assert_eq!(done.state.items_stored, 2);- assert!(- crate::memory::state_store::load::<BackfillFile>(&workspace, "conversations_backfill")- .unwrap()- .is_some()- );+ assert!(crate::memory::state_store::load::<BackfillFile>(+ &workspace,+ "conversations_backfill"+ )+ .unwrap()+ .is_some());}}diff --git a/crates/openhuman-core/src/memory/brain.rs b/crates/openhuman-core/src/memory/brain.rsindex d6ba64d3fb..caee994556 100644--- a/crates/openhuman-core/src/memory/brain.rs+++ b/crates/openhuman-core/src/memory/brain.rs@@ -17,8 +17,8 @@ use tinymemory_integrations::documents::RawDocument;use tinymemory_tools::layout::placement::{brain_node_with, files_source};use tinymemory_tools::{Brain, BrainSource, BrainSourcesView, MemoryLayout};-use crate::config::Config;use crate::config::schema::MemorySourceKind;+use crate::config::Config;use super::engine;use super::lifecycle::jobs;diff --git a/crates/openhuman-core/src/memory/brain_tests.rs b/crates/openhuman-core/src/memory/brain_tests.rsindex d65760fecb..a6571a7683 100644--- a/crates/openhuman-core/src/memory/brain_tests.rs+++ b/crates/openhuman-core/src/memory/brain_tests.rs@@ -207,19 +207,17 @@ async fn ingest_refuses_bad_input() {Err(Error::InvalidRequest(_))));}- assert!(- search(- &config,- &tinymemory_tools::layout::identity::Identity::root(),- BrainSearchParams {- query: " ".into(),- source: None,- limit: None- }- )- .await- .is_err()- );+ assert!(search(+ &config,+ &tinymemory_tools::layout::identity::Identity::root(),+ BrainSearchParams {+ query: " ".into(),+ source: None,+ limit: None+ }+ )+ .await+ .is_err());}#[tokio::test]@@ -296,8 +294,8 @@ async fn a_file_is_converted_and_filed_under_files() {#[tokio::test]async fn an_ingest_queues_a_belief_build_only_for_an_engine_that_waits_for_one() {use std::sync::Arc;- use tinymemory_api::Consolidation;use tinymemory_api::conformance::ReferenceEngine;+ use tinymemory_api::Consolidation;for (consolidation, queued) in [(Consolidation::OnDemand, 1), (Consolidation::Automatic, 0)] {let tmp = tempfile::tempdir().unwrap();diff --git a/crates/openhuman-core/src/memory/bus_tests.rs b/crates/openhuman-core/src/memory/bus_tests.rsindex e44c385b3b..b066b757cc 100644--- a/crates/openhuman-core/src/memory/bus_tests.rs+++ b/crates/openhuman-core/src/memory/bus_tests.rs@@ -61,7 +61,7 @@ fn the_deletions_subscriber_listens_on_auth() {#[tokio::test]async fn a_sign_in_drains_the_deletions_queued_while_signed_out() {- use crate::memory::deletion::{PendingDeletion, enqueue, pending};+ use crate::memory::deletion::{enqueue, pending, PendingDeletion};let tmp = tempfile::tempdir().unwrap();let config = config_in(&tmp);@@ -86,7 +86,7 @@ async fn a_sign_in_drains_the_deletions_queued_while_signed_out() {#[tokio::test]async fn the_background_job_retries_pending_deletions() {- use crate::memory::deletion::{PendingDeletion, enqueue, pending};+ use crate::memory::deletion::{enqueue, pending, PendingDeletion};let tmp = tempfile::tempdir().unwrap();let config = config_in(&tmp);diff --git a/crates/openhuman-core/src/memory/confinement_tests.rs b/crates/openhuman-core/src/memory/confinement_tests.rsindex f216ed1c38..bf98d178da 100644--- a/crates/openhuman-core/src/memory/confinement_tests.rs+++ b/crates/openhuman-core/src/memory/confinement_tests.rs@@ -131,12 +131,10 @@ async fn rpc_list_fetch_and_recall_never_read_another_root() {).await.unwrap();- assert!(- answer- .citations- .iter()- .all(|citation| citation.id.0 != theirs)- );+ assert!(answer+ .citations+ .iter()+ .all(|citation| citation.id.0 != theirs));}#[tokio::test]diff --git a/crates/openhuman-core/src/memory/deletion_tests.rs b/crates/openhuman-core/src/memory/deletion_tests.rsindex 4e7078e7e9..1087526616 100644--- a/crates/openhuman-core/src/memory/deletion_tests.rs+++ b/crates/openhuman-core/src/memory/deletion_tests.rs@@ -24,7 +24,7 @@ fn thread(id: &str) -> PendingDeletion {#[tokio::test]async fn offline_conversation_purge_queues_exact_thread_ids_in_its_workspace() {- use crate::threads::store::{CreateConversationThread, ensure_thread, purge_threads};+ use crate::threads::store::{ensure_thread, purge_threads, CreateConversationThread};let tmp = tempfile::tempdir().unwrap();let config = config_in(&tmp);@@ -102,15 +102,12 @@ async fn offline_conversation_purge_queues_exact_thread_ids_in_its_workspace() {let left = stored(&engine, MetaFilter::default()).await;assert_eq!(left.len(), 3);- assert!(- left.iter()- .any(|item| { item.kind == ItemKind::Learning && item.text == "durable preference" })- );- assert!(- left.iter().any(|item| {- item.kind == ItemKind::Document && item.text == "durable brain document"- })- );+ assert!(left+ .iter()+ .any(|item| { item.kind == ItemKind::Learning && item.text == "durable preference" }));+ assert!(left+ .iter()+ .any(|item| { item.kind == ItemKind::Document && item.text == "durable brain document" }));assert!(left.iter().any(|item| {item.kind == ItemKind::Conversation&& item.meta.thread_id.as_deref() == Some("unrelated-thread")diff --git a/crates/openhuman-core/src/memory/engine.rs b/crates/openhuman-core/src/memory/engine.rsindex b217dd2db0..202053dede 100644--- a/crates/openhuman-core/src/memory/engine.rs+++ b/crates/openhuman-core/src/memory/engine.rs@@ -46,8 +46,8 @@ pub use tinymemory_integrations::{BearerSource, Binding, BoundEngine, EngineBinder, EngineCredential, EngineSettings,};-use crate::config::Config;use crate::config::schema::MEMORY_CORTEXDB_KEY_NAME;+use crate::config::Config;use crate::security::credentials::{AuthService, DEFAULT_AUTH_PROFILE_NAME};use tinymemory_api::{Error, Result};diff --git a/crates/openhuman-core/src/memory/engine_registry_tests.rs b/crates/openhuman-core/src/memory/engine_registry_tests.rsindex d09364fc8e..58319cdfcf 100644--- a/crates/openhuman-core/src/memory/engine_registry_tests.rs+++ b/crates/openhuman-core/src/memory/engine_registry_tests.rs@@ -2,8 +2,8 @@ use super::*;use crate::memory::billing::free_period_active;use crate::memory::engine::{bind_with_root, resolve};use crate::memory::test_fixtures::config_in;-use std::sync::Mutex;use std::sync::atomic::{AtomicBool, Ordering};+use std::sync::Mutex;use tinymemory_api::conformance::ReferenceEngine;const ID: &str = "registry-test-engine";diff --git a/crates/openhuman-core/src/memory/explore.rs b/crates/openhuman-core/src/memory/explore.rsindex edb012ed1c..cb8bb4f4fe 100644--- a/crates/openhuman-core/src/memory/explore.rs+++ b/crates/openhuman-core/src/memory/explore.rs@@ -19,7 +19,7 @@ use tinymemory_tools::ops::ExploreOptions;use crate::config::Config;use super::engine;-pub use tinymemory_tools::ops::{DEFAULT_BUCKETS, MAX_PATH_STEPS, PathStep, narrowed};+pub use tinymemory_tools::ops::{narrowed, PathStep, DEFAULT_BUCKETS, MAX_PATH_STEPS};/// `memory_explore` params.#[derive(Debug, Clone, Deserialize)]diff --git a/crates/openhuman-core/src/memory/guard_tests.rs b/crates/openhuman-core/src/memory/guard_tests.rsindex f53a2e488d..8589826f70 100644--- a/crates/openhuman-core/src/memory/guard_tests.rs+++ b/crates/openhuman-core/src/memory/guard_tests.rs@@ -1,8 +1,8 @@use std::sync::Arc;use tinymemory_api::{MemoryEngine, StoreItem};+use tinymemory_integrations::safety::{scrub_item_with, Policy};use tinymemory_integrations::EngineBinder;-use tinymemory_integrations::safety::{Policy, scrub_item_with};fn wrap(engine: Arc<dyn MemoryEngine>) -> Arc<dyn MemoryEngine> {EngineBinder::default()diff --git a/crates/openhuman-core/src/memory/import_tests.rs b/crates/openhuman-core/src/memory/import_tests.rsindex c764a34aa1..dba2945dff 100644--- a/crates/openhuman-core/src/memory/import_tests.rs+++ b/crates/openhuman-core/src/memory/import_tests.rs@@ -128,7 +128,7 @@ async fn a_paused_scheduler_leaves_an_interrupted_import_for_later() {#[tokio::test]async fn a_live_import_blocks_migration_and_does_not_make_a_stale_migration_look_live() {- use crate::memory::layout_migration::{self, Phase, Trigger, state, test_host::FakeHost};+ use crate::memory::layout_migration::{self, state, test_host::FakeHost, Phase, Trigger};let tmp = tempfile::tempdir().unwrap();let config = config_in(&tmp);@@ -198,14 +198,12 @@ async fn a_credit_paused_import_waits_for_billing_and_records_a_resume_failure());let stopped = read_file(&config.workspace_dir);assert_eq!(stopped.state.phase, ImportPhase::Error);- assert!(- stopped- .state- .error- .as_deref()- .unwrap()- .contains("could not resume")- );+ assert!(stopped+ .state+ .error+ .as_deref()+ .unwrap()+ .contains("could not resume"));assert!(!stopped.paused_for_credits);assert!(!is_running(&config.workspace_dir));}diff --git a/crates/openhuman-core/src/memory/layout_migration/app_host_tests.rs b/crates/openhuman-core/src/memory/layout_migration/app_host_tests.rsindex 97504afa6b..36724271af 100644--- a/crates/openhuman-core/src/memory/layout_migration/app_host_tests.rs+++ b/crates/openhuman-core/src/memory/layout_migration/app_host_tests.rs@@ -1,7 +1,7 @@use std::sync::Arc;-use tinymemory_api::MemoryEngine;use tinymemory_api::conformance::ReferenceEngine;+use tinymemory_api::MemoryEngine;use super::*;use crate::memory::engine::install_test_engine_for_root;diff --git a/crates/openhuman-core/src/memory/layout_migration/mod.rs b/crates/openhuman-core/src/memory/layout_migration/mod.rsindex ee3927c315..bd2337ca8c 100644--- a/crates/openhuman-core/src/memory/layout_migration/mod.rs+++ b/crates/openhuman-core/src/memory/layout_migration/mod.rs@@ -11,7 +11,7 @@ pub mod state;pub(crate) mod test_host;pub use app_host::AppHost;-pub use ops::{StartParams, retry, scan, start, status, tick};+pub use ops::{retry, scan, start, status, tick, StartParams};pub use state::FileStateStore;pub use state::StateKvMigrationStore;pub use tinymemory_tools::layout_migration::{diff --git a/crates/openhuman-core/src/memory/layout_migration/ops.rs b/crates/openhuman-core/src/memory/layout_migration/ops.rsindex f85022dc64..79df46226f 100644--- a/crates/openhuman-core/src/memory/layout_migration/ops.rs+++ b/crates/openhuman-core/src/memory/layout_migration/ops.rs@@ -9,7 +9,7 @@ use std::sync::Arc;use tinymemory_tools::layout_migration as lm;use tinymemory_tools::layout_migration::{MigrationSpawner, MigrationTask};-use super::app_host::{AppHost, from_module};+use super::app_host::{from_module, AppHost};use super::{LayoutHost, MigrationState, MigrationStatus, ScanView, Trigger};use crate::config::Config;use crate::core::runtime::DispatchCtx;diff --git a/crates/openhuman-core/src/memory/layout_migration/ops_tests.rs b/crates/openhuman-core/src/memory/layout_migration/ops_tests.rsindex 16909dcf3e..90cc4f6b64 100644--- a/crates/openhuman-core/src/memory/layout_migration/ops_tests.rs+++ b/crates/openhuman-core/src/memory/layout_migration/ops_tests.rs@@ -1,11 +1,11 @@-use std::sync::Arc;use std::sync::atomic::Ordering;+use std::sync::Arc;use tinymemory_api::MemoryEngine;use super::*;-use crate::memory::layout_migration::test_host::{FakeHost, count, fact};-use crate::memory::layout_migration::{Phase, state};+use crate::memory::layout_migration::test_host::{count, fact, FakeHost};+use crate::memory::layout_migration::{state, Phase};fn never() -> Arc<dyn Fn() -> bool + Send + Sync> {Arc::new(|| false)diff --git a/crates/openhuman-core/src/memory/layout_migration/test_host.rs b/crates/openhuman-core/src/memory/layout_migration/test_host.rsindex 4e45ab13a4..965e754450 100644--- a/crates/openhuman-core/src/memory/layout_migration/test_host.rs+++ b/crates/openhuman-core/src/memory/layout_migration/test_host.rs@@ -7,11 +7,11 @@ use tinymemory_api::conformance::ReferenceEngine;use tinymemory_api::{LearningKind, ListRequest, MemoryEngine, MemoryMeta, MetaFilter, Namespace, StoreItem,};-use tinymemory_tools::MemoryLayout;use tinymemory_tools::layout_migration::{Engines, FlowPlacement, FsLegacyClaim, LayoutHost, LegacyClaim, MigrationStateStore, Placement,Result,};+use tinymemory_tools::MemoryLayout;use super::state::StateKvMigrationStore;use crate::config::Config;diff --git a/crates/openhuman-core/src/memory/lifecycle/adapter_tests.rs b/crates/openhuman-core/src/memory/lifecycle/adapter_tests.rsindex 40121b6824..d246119df1 100644--- a/crates/openhuman-core/src/memory/lifecycle/adapter_tests.rs+++ b/crates/openhuman-core/src/memory/lifecycle/adapter_tests.rs@@ -52,22 +52,20 @@ async fn background_prefetch_records_citations_only_when_returning_the_pack() {.resolve(&crate::memory::scope::identity_pins(&config));let ctx = crate::core::runtime::DispatchCtx::ambient();- assert!(- super::super::super::prefetch::pre_turn(- &ctx,- config.clone(),- identity.clone(),- "citation-thread".into(),- 0,- "what colour is preferred?".into(),- 0,- Utc::now(),- false,- None,- None,- )- .is_none()- );+ assert!(super::super::super::prefetch::pre_turn(+ &ctx,+ config.clone(),+ identity.clone(),+ "citation-thread".into(),+ 0,+ "what colour is preferred?".into(),+ 0,+ Utc::now(),+ false,+ None,+ None,+ )+ .is_none());assert!(crate::web_chat::citations::take_turn_citations(&ctx, "citation-thread").is_empty());super::super::super::prefetch::settle_for_test(diff --git a/crates/openhuman-core/src/memory/lifecycle/hooks.rs b/crates/openhuman-core/src/memory/lifecycle/hooks.rsindex 26d383e825..d901874a38 100644--- a/crates/openhuman-core/src/memory/lifecycle/hooks.rs+++ b/crates/openhuman-core/src/memory/lifecycle/hooks.rs@@ -19,7 +19,7 @@ use crate::config::Config;use crate::core::runtime::{CoreContext, DispatchCtx};use crate::memory::engine;-pub use native_turn::{CLOSE_TAG, MAX_TOOL_LINE_CHARS, OPEN_TAG, user_turn_index};+pub use native_turn::{user_turn_index, CLOSE_TAG, MAX_TOOL_LINE_CHARS, OPEN_TAG};/// A native turn pack with the citation view used by OpenHuman's chat UI.#[derive(Debug, Clone, PartialEq, Serialize)]diff --git a/crates/openhuman-core/src/memory/lifecycle/hooks_tests.rs b/crates/openhuman-core/src/memory/lifecycle/hooks_tests.rsindex 2fa57e628b..ccc320b2d2 100644--- a/crates/openhuman-core/src/memory/lifecycle/hooks_tests.rs+++ b/crates/openhuman-core/src/memory/lifecycle/hooks_tests.rs@@ -181,16 +181,14 @@ async fn recall_off_still_logs_and_logging_off_still_recalls() {config.memory.recall.enabled = false;let quiet = tinymemory_tools::layout::identity::Identity::agent("a").resolve(&crate::memory::scope::identity_pins(&config));- assert!(- run_pre_turn(- &crate::core::runtime::DispatchCtx::ambient(),- &config,- &quiet,- input("t", 0, "when do deploys happen?")- )- .await- .is_none()- );+ assert!(run_pre_turn(+ &crate::core::runtime::DispatchCtx::ambient(),+ &config,+ &quiet,+ input("t", 0, "when do deploys happen?")+ )+ .await+ .is_none());assert_eq!(stored(&engine, MetaFilter::kinds([ItemKind::Conversation])).await@@ -221,16 +219,14 @@ async fn recall_off_still_logs_and_logging_off_still_recalls() {config.memory.recall.enabled = false;let none = tinymemory_tools::layout::identity::Identity::agent("a").resolve(&crate::memory::scope::identity_pins(&config));- assert!(- run_pre_turn(- &crate::core::runtime::DispatchCtx::ambient(),- &config,- &none,- input("t", 4, "hi")- )- .await- .is_none()- );+ assert!(run_pre_turn(+ &crate::core::runtime::DispatchCtx::ambient(),+ &config,+ &none,+ input("t", 4, "hi")+ )+ .await+ .is_none());}#[tokio::test]@@ -239,16 +235,14 @@ async fn pre_turn_without_an_engine_runs_the_turn_without_a_pack() {let config = config_in(&tmp);let identity = tinymemory_tools::layout::identity::Identity::agent("a").resolve(&crate::memory::scope::identity_pins(&config));- assert!(- run_pre_turn(- &crate::core::runtime::DispatchCtx::ambient(),- &config,- &identity,- input("t", 0, "hello")- )- .await- .is_none()- );+ assert!(run_pre_turn(+ &crate::core::runtime::DispatchCtx::ambient(),+ &config,+ &identity,+ input("t", 0, "hello")+ )+ .await+ .is_none());run_post_turn(&config, &identity, reply("t", 1, "hi")).await;}@@ -319,17 +313,15 @@ async fn compaction_recalls_from_the_dropped_turns() {).await;assert!(pack.expect("a pack").markdown.contains("Heron"));- assert!(- compaction_work(- &crate::core::runtime::DispatchCtx::ambient(),- &config,- &identity,- "t",- Vec::new()- )- .await- .is_none()- );+ assert!(compaction_work(+ &crate::core::runtime::DispatchCtx::ambient(),+ &config,+ &identity,+ "t",+ Vec::new()+ )+ .await+ .is_none());}#[tokio::test]@@ -399,16 +391,14 @@ async fn an_engine_fault_that_is_not_account_wide_injects_nothing() {let identity = tinymemory_tools::layout::identity::Identity::agent("orchestrator").resolve(&crate::memory::scope::identity_pins(&config));- assert!(- run_pre_turn(- &crate::core::runtime::DispatchCtx::ambient(),- &config,- &identity,- input("t", 0, "hello")- )- .await- .is_none()- );+ assert!(run_pre_turn(+ &crate::core::runtime::DispatchCtx::ambient(),+ &config,+ &identity,+ input("t", 0, "hello")+ )+ .await+ .is_none());}// ── the pack's token budget against a large store (#6718, #7023) ────────────@@ -606,16 +596,14 @@ async fn a_blank_turn_is_refused_without_a_pack_with_or_without_logging() {let engine = bind_reference(&config);let identity = tinymemory_tools::layout::identity::Identity::agent("orchestrator").resolve(&crate::memory::scope::identity_pins(&config));- assert!(- run_pre_turn(- &crate::core::runtime::DispatchCtx::ambient(),- &config,- &identity,- input("t-blank", 0, " ")- )- .await- .is_none()- );+ assert!(run_pre_turn(+ &crate::core::runtime::DispatchCtx::ambient(),+ &config,+ &identity,+ input("t-blank", 0, " ")+ )+ .await+ .is_none());assert!(stored(&engine, MetaFilter::kinds([ItemKind::Conversation])).await@@ -626,28 +614,24 @@ async fn a_blank_turn_is_refused_without_a_pack_with_or_without_logging() {config.memory.conversations.enabled = false;let reader = tinymemory_tools::layout::identity::Identity::agent("orchestrator").resolve(&crate::memory::scope::identity_pins(&config));- assert!(- run_pre_turn(- &crate::core::runtime::DispatchCtx::ambient(),- &config,- &reader,- input("t-blank", 2, " ")- )- .await- .is_none()- );+ assert!(run_pre_turn(+ &crate::core::runtime::DispatchCtx::ambient(),+ &config,+ &reader,+ input("t-blank", 2, " ")+ )+ .await+ .is_none());let mut resumed = input(" ", 4, "where were we?");resumed.5 = true;- assert!(- run_pre_turn(- &crate::core::runtime::DispatchCtx::ambient(),- &config,- &reader,- resumed- )- .await- .is_none()- );+ assert!(run_pre_turn(+ &crate::core::runtime::DispatchCtx::ambient(),+ &config,+ &reader,+ resumed+ )+ .await+ .is_none());}/// With `date_hint` on, the turn's text goes to the chat model with the datediff --git a/crates/openhuman-core/src/memory/lifecycle/jobs.rs b/crates/openhuman-core/src/memory/lifecycle/jobs.rsindex 7cb576b932..e47c551f72 100644--- a/crates/openhuman-core/src/memory/lifecycle/jobs.rs+++ b/crates/openhuman-core/src/memory/lifecycle/jobs.rs@@ -22,8 +22,8 @@ use std::path::{Path, PathBuf};use std::sync::{Arc, LazyLock, Mutex, Weak};use tinymemory_api::Namespace;-use tinymemory_tools::BackgroundJob;use tinymemory_tools::queue::{JobQueue as Queue, QueueError, QueueState, QueueStore};+use tinymemory_tools::BackgroundJob;use tinymemory_tools::queue::{JobRun, Selection};diff --git a/crates/openhuman-core/src/memory/lifecycle/jobs_tests.rs b/crates/openhuman-core/src/memory/lifecycle/jobs_tests.rsindex dcadd7952d..c5327f5a4f 100644--- a/crates/openhuman-core/src/memory/lifecycle/jobs_tests.rs+++ b/crates/openhuman-core/src/memory/lifecycle/jobs_tests.rs@@ -1,6 +1,6 @@use super::*;-use tinymemory_tools::queue::MAX_ATTEMPTS;use tinymemory_tools::queue::QueueState;+use tinymemory_tools::queue::MAX_ATTEMPTS;use tinymemory_api::{ConsolidateRequest, ItemKind, Reach};@@ -23,11 +23,9 @@ fn workspace_queues_are_released_after_the_last_holder_drops() {drop(queue_of(&sentinel));let queues = QUEUES.lock().unwrap();- assert!(- workspaces- .iter()- .all(|workspace| !queues.contains_key(workspace))- );+ assert!(workspaces+ .iter()+ .all(|workspace| !queues.contains_key(workspace)));}fn build(agent: &str) -> BackgroundJob {diff --git a/crates/openhuman-core/src/memory/lifecycle/mod.rs b/crates/openhuman-core/src/memory/lifecycle/mod.rsindex 09d996729f..ea89630045 100644--- a/crates/openhuman-core/src/memory/lifecycle/mod.rs+++ b/crates/openhuman-core/src/memory/lifecycle/mod.rs@@ -27,8 +27,8 @@ use std::sync::Arc;use tinymemory_api::MemoryEngine;use tinymemory_tools::{AgentMemory, RecallPolicy};-use crate::config::Config;use crate::config::schema::RecallSettings;+use crate::config::Config;use super::engine;use tinymemory_api::{Error, Result};diff --git a/crates/openhuman-core/src/memory/lifecycle/prefetch.rs b/crates/openhuman-core/src/memory/lifecycle/prefetch.rsindex 0b8ee7546d..bf30cf4f08 100644--- a/crates/openhuman-core/src/memory/lifecycle/prefetch.rs+++ b/crates/openhuman-core/src/memory/lifecycle/prefetch.rs@@ -13,7 +13,7 @@ use tinymemory_tools::prefetch::{};use crate::config::Config;-use crate::core::runtime::{DispatchCtx, slot_for};+use crate::core::runtime::{slot_for, DispatchCtx};use tinymemory_tools::layout::identity::ResolvedIdentity;use super::hooks::{self, TurnPack};diff --git a/crates/openhuman-core/src/memory/lifecycle/prefetch_tests.rs b/crates/openhuman-core/src/memory/lifecycle/prefetch_tests.rsindex ec56f462be..a79d9e0da3 100644--- a/crates/openhuman-core/src/memory/lifecycle/prefetch_tests.rs+++ b/crates/openhuman-core/src/memory/lifecycle/prefetch_tests.rs@@ -123,22 +123,20 @@ async fn pre_turn_logs_channel_metadata_without_writing_legacy_thread_map() {let key = Key::new(&config, &identity, thread_id, false);let cache = cache(&crate::core::runtime::DispatchCtx::ambient());- assert!(- pre_turn(- &crate::core::runtime::DispatchCtx::ambient(),- config.clone(),- identity,- thread_id.into(),- 0,- "hello from telegram".into(),- 0,- chrono::Utc::now(),- false,- None,- Some("telegram".into()),- )- .is_none()- );+ assert!(pre_turn(+ &crate::core::runtime::DispatchCtx::ambient(),+ config.clone(),+ identity,+ thread_id.into(),+ 0,+ "hello from telegram".into(),+ 0,+ chrono::Utc::now(),+ false,+ None,+ Some("telegram".into()),+ )+ .is_none());drain(&cache, &key).await;let turns = stored(diff --git a/crates/openhuman-core/src/memory/lifecycle/views_tests.rs b/crates/openhuman-core/src/memory/lifecycle/views_tests.rsindex e788f4e227..4a065cb193 100644--- a/crates/openhuman-core/src/memory/lifecycle/views_tests.rs+++ b/crates/openhuman-core/src/memory/lifecycle/views_tests.rs@@ -251,22 +251,18 @@ async fn jobs_run_needs_an_engine_and_names_an_unknown_job() {let config = config_in(&tmp);assert!(jobs_run(&config, JobsRunParams::default()).await.is_err());bind_reference(&config);- assert!(- jobs_run(&config, JobsRunParams::default())- .await- .unwrap()- .runs- .is_empty()- );- assert!(- jobs_run(- &config,- JobsRunParams {- id: Some("x".into())- }- )+ assert!(jobs_run(&config, JobsRunParams::default()).await- .is_err()- );+ .unwrap()+ .runs+ .is_empty());+ assert!(jobs_run(+ &config,+ JobsRunParams {+ id: Some("x".into())+ }+ )+ .await+ .is_err());assert!(jobs_list(&config).await.pending.is_empty());}diff --git a/crates/openhuman-core/src/memory/mod.rs b/crates/openhuman-core/src/memory/mod.rsindex fc8e1fbfe3..e5e072fd19 100644--- a/crates/openhuman-core/src/memory/mod.rs+++ b/crates/openhuman-core/src/memory/mod.rs@@ -58,4 +58,4 @@ pub use schemas::{all_controller_schemas as all_memory_controller_schemas,all_registered_controllers as all_memory_registered_controllers,};-pub use tools::{MEMORY_TOOL_NAME, MemoryTool};+pub use tools::{MemoryTool, MEMORY_TOOL_NAME};diff --git a/crates/openhuman-core/src/memory/ops_compat_tests.rs b/crates/openhuman-core/src/memory/ops_compat_tests.rsindex 1245e43504..722092347f 100644--- a/crates/openhuman-core/src/memory/ops_compat_tests.rs+++ b/crates/openhuman-core/src/memory/ops_compat_tests.rs@@ -83,12 +83,10 @@ async fn single_user_reads_writes_and_forgets_ancestor_and_service_memory() {).await.unwrap();- assert!(- service_reader- .items- .iter()- .any(|item| item.id.0 == service_id)- );+ assert!(service_reader+ .items+ .iter()+ .any(|item| item.id.0 == service_id));let service_item = stored(&engine,MetaFilter {@@ -112,16 +110,14 @@ async fn single_user_reads_writes_and_forgets_ancestor_and_service_memory() {.await.unwrap();assert_eq!(forgotten.forgotten, 1);- assert!(- stored(- &engine,- MetaFilter {- reach: Some(tinymemory_api::Reach::exact(service_item.meta.namespace)),- ..MetaFilter::default()- },- )- .await- .iter()- .all(|item| item.id.0 != service_id)- );+ assert!(stored(+ &engine,+ MetaFilter {+ reach: Some(tinymemory_api::Reach::exact(service_item.meta.namespace)),+ ..MetaFilter::default()+ },+ )+ .await+ .iter()+ .all(|item| item.id.0 != service_id));}diff --git a/crates/openhuman-core/src/memory/ops_saas_tests.rs b/crates/openhuman-core/src/memory/ops_saas_tests.rsindex 3a2739cc53..ec938c90e8 100644--- a/crates/openhuman-core/src/memory/ops_saas_tests.rs+++ b/crates/openhuman-core/src/memory/ops_saas_tests.rs@@ -1,8 +1,8 @@use super::*;use crate::memory::test_fixtures::{bind_reference, config_in};use std::sync::{- Arc,atomic::{AtomicUsize, Ordering},+ Arc,};use tinymemory_api::conformance::ReferenceEngine;use tinymemory_api::{@@ -277,12 +277,10 @@ fn valid_saas_identity_clamps_memory_operations_in_an_isolated_process() {).await.unwrap();- assert!(- recalled- .citations- .iter()- .all(|citation| citation.id.0 != foreign)- );+ assert!(recalled+ .citations+ .iter()+ .all(|citation| citation.id.0 != foreign));let learned = learn(&config,diff --git a/crates/openhuman-core/src/memory/ops_tests.rs b/crates/openhuman-core/src/memory/ops_tests.rsindex 529a0c577a..c41743a6fe 100644--- a/crates/openhuman-core/src/memory/ops_tests.rs+++ b/crates/openhuman-core/src/memory/ops_tests.rs@@ -369,11 +369,9 @@ async fn stores_are_scrubbed_of_secrets() {.unwrap();let items = stored(&engine, MetaFilter::default()).await;assert_eq!(items.len(), 1);- assert!(- !items[0]- .text- .contains("abcdefghijklmnopqrstuvwxyz0123456789")- );+ assert!(!items[0]+ .text+ .contains("abcdefghijklmnopqrstuvwxyz0123456789"));}#[test]diff --git a/crates/openhuman-core/src/memory/schemas.rs b/crates/openhuman-core/src/memory/schemas.rsindex c2cbe7a778..5996f1c821 100644--- a/crates/openhuman-core/src/memory/schemas.rs+++ b/crates/openhuman-core/src/memory/schemas.rs@@ -3,10 +3,10 @@mod defs;mod handlers;-use crate::core::ControllerSchema;use crate::core::all::RegisteredController;+use crate::core::ControllerSchema;-pub use defs::{FUNCTIONS, schema};+pub use defs::{schema, FUNCTIONS};/// Every memory function paired with the handler it dispatches to.const HANDLERS: &[(&str, crate::core::all::ControllerHandler)] = &[diff --git a/crates/openhuman-core/src/memory/schemas/handlers.rs b/crates/openhuman-core/src/memory/schemas/handlers.rsindex 6fb09fdc95..1338a725c2 100644--- a/crates/openhuman-core/src/memory/schemas/handlers.rs+++ b/crates/openhuman-core/src/memory/schemas/handlers.rs@@ -17,9 +17,9 @@ use crate::memory::types::{SourcesSyncView,};use crate::memory::{backfill, brain, engine, import, layout_migration, ops, sources};-use serde::Serialize;use serde::de::DeserializeOwned;-use serde_json::{Map, Value, json};+use serde::Serialize;+use serde_json::{json, Map, Value};use tinymemory_api::{Error, Reach, Result};use tinymemory_tools::confine::{Confinement, Policy};use tinymemory_tools::layout::identity::Identity;diff --git a/crates/openhuman-core/src/memory/schemas_tests.rs b/crates/openhuman-core/src/memory/schemas_tests.rsindex cd85d9d51d..3cdcf0d509 100644--- a/crates/openhuman-core/src/memory/schemas_tests.rs+++ b/crates/openhuman-core/src/memory/schemas_tests.rs@@ -1,10 +1,10 @@use super::*;use crate::config::Config;+use crate::core::runtime::context::CoreContext;use crate::core::runtime::DispatchCtx;use crate::core::runtime::DomainSet;-use crate::core::runtime::context::CoreContext;use crate::memory::test_fixtures::{bind_reference, config_in};-use serde_json::{Map, Value, json};+use serde_json::{json, Map, Value};use tinymemory_api::MemoryEngine;/// Every method of the spec's RPC table (`docs/specs/memory-v2.md`), exactly.@@ -470,12 +470,10 @@ async fn lifecycle_handlers_answer_over_a_bound_engine() {.unwrap();let preview = preview.get("result").unwrap_or(&preview);assert_eq!(preview["mode"], "turn");- assert!(- preview["pack"]["markdown"]- .as_str()- .unwrap()- .contains("9:30")- );+ assert!(preview["pack"]["markdown"]+ .as_str()+ .unwrap()+ .contains("9:30"));let ran = call(&config, "jobs_run", json!({})).await.unwrap();assert_eq!(@@ -557,22 +555,20 @@ async fn rpc_learn_invalidates_a_cached_prefetch_pack() {let config = Arc::new(config.clone());let (thread_id, turn_index, user_text, in_prompt_from, at, resumed, observed_actor) =input();- assert!(- crate::memory::lifecycle::prefetch::pre_turn(- &dispatch,- config.clone(),- identity.clone(),- thread_id,- turn_index,- user_text,- in_prompt_from,- at,- resumed,- observed_actor,- None,- )- .is_none()- );+ assert!(crate::memory::lifecycle::prefetch::pre_turn(+ &dispatch,+ config.clone(),+ identity.clone(),+ thread_id,+ turn_index,+ user_text,+ in_prompt_from,+ at,+ resumed,+ observed_actor,+ None,+ )+ .is_none());crate::memory::lifecycle::prefetch::settle_for_test(&dispatch, &config, &identity, thread, false,)diff --git a/crates/openhuman-core/src/memory/scope_tests.rs b/crates/openhuman-core/src/memory/scope_tests.rsindex c309839735..7931494e94 100644--- a/crates/openhuman-core/src/memory/scope_tests.rs+++ b/crates/openhuman-core/src/memory/scope_tests.rs@@ -4,8 +4,8 @@ use crate::config::schema::MemoryAgentConfig;use tinymemory_api::{MetaFilter, Namespace, Reach};use tinymemory_tools::confine::{Confinement, Policy};use tinymemory_tools::layout::identity::{- DEFAULT_AGENT_ID, Identity, ResolvedIdentity, account_root, actor_of_root, chat_node,- validate_root,+ account_root, actor_of_root, chat_node, validate_root, Identity, ResolvedIdentity,+ DEFAULT_AGENT_ID,};fn ns(value: &str) -> Namespace {@@ -73,13 +73,12 @@ fn upstream_identity_and_confinement_keep_embedded_root_and_rpc_policy() {.reach,Some(Reach::exact(narrow)));- assert!(- rpc.filter(Some(MetaFilter {+ assert!(rpc+ .filter(Some(MetaFilter {reach: Some(Reach::subtree(ns("project:embed/team:other"))),..MetaFilter::default()}))- .is_err()- );+ .is_err());let saas = Confinement {allowed,diff --git a/crates/openhuman-core/src/memory/sources/mod.rs b/crates/openhuman-core/src/memory/sources/mod.rsindex 027a04bca0..f55910daa0 100644--- a/crates/openhuman-core/src/memory/sources/mod.rs+++ b/crates/openhuman-core/src/memory/sources/mod.rs@@ -14,8 +14,8 @@ use tinymemory_integrations::sources::SourceState;use tinymemory_integrations::sources::{Error as SourceError, SourceSpec};use tinymemory_tools::ops::MemoryOps;-use crate::config::Config;use crate::config::schema::{MemorySourceConfig, MemorySourceKind};+use crate::config::Config;use super::engine;use super::types::{SourceView, SourcesAddParams};diff --git a/crates/openhuman-core/src/memory/sources/sync.rs b/crates/openhuman-core/src/memory/sources/sync.rsindex 6951112ad3..2fbbf07246 100644--- a/crates/openhuman-core/src/memory/sources/sync.rs+++ b/crates/openhuman-core/src/memory/sources/sync.rs@@ -11,15 +11,15 @@ use std::path::PathBuf;use std::sync::{Arc, LazyLock, Mutex, PoisonError};use chrono::{DateTime, Utc};-use tinymemory_integrations::sources::SourceKind;-use tinymemory_integrations::sources::SourceStatus;use tinymemory_integrations::sources::sync::{self as module, RegisteredSource, SourceRegistry, SyncError, SyncState, SyncStatus, SyncUpdate,Syncer,};+use tinymemory_integrations::sources::SourceKind;+use tinymemory_integrations::sources::SourceStatus;-use crate::config::Config;use crate::config::schema::{MemorySourceConfig, MemorySourceKind};+use crate::config::Config;use crate::memory::engine;use tinymemory_api::{Error, Result};diff --git a/crates/openhuman-core/src/memory/sources/sync_tests.rs b/crates/openhuman-core/src/memory/sources/sync_tests.rsindex 129e75be63..eed0b49518 100644--- a/crates/openhuman-core/src/memory/sources/sync_tests.rs+++ b/crates/openhuman-core/src/memory/sources/sync_tests.rs@@ -102,11 +102,9 @@ async fn sync_one_reports_memory_off_and_unreadable_sources() {bind_reference(&config);let missing = config.action_dir.join("does-not-exist");- assert!(- sync_one(&config, &folder_source("s", &missing, None))- .await- .is_err()- );+ assert!(sync_one(&config, &folder_source("s", &missing, None))+ .await+ .is_err());}#[tokio::test]@@ -199,15 +197,13 @@ async fn a_source_already_syncing_is_not_started_twice() {// Hold a claim as a running sync would: a second request starts nothing.let held = syncer_for(&config).start(Some("src-once")).unwrap();assert_eq!(held.len(), 1);- assert!(- start_sync(- &crate::core::runtime::DispatchCtx::ambient(),- &config,- Some("src-once")- )- .unwrap()- .is_empty()- );+ assert!(start_sync(+ &crate::core::runtime::DispatchCtx::ambient(),+ &config,+ Some("src-once")+ )+ .unwrap()+ .is_empty());drop(held);assert_eq!(start_sync(@@ -270,14 +266,12 @@ fn sync_due_with_memory_off_starts_nothing() {.memory.sources.push(folder_source("s", tmp.path(), Some(15)));- assert!(- sync_due(- &crate::core::runtime::DispatchCtx::ambient(),- &config,- Utc::now()- )- .is_empty()- );+ assert!(sync_due(+ &crate::core::runtime::DispatchCtx::ambient(),+ &config,+ Utc::now()+ )+ .is_empty());}#[test]@@ -302,8 +296,8 @@ fn reset_interrupted_marks_syncing_sources_idle() {#[tokio::test]async fn a_sync_queues_a_belief_build_only_for_an_engine_that_waits_for_one() {use std::sync::Arc;- use tinymemory_api::Consolidation;use tinymemory_api::conformance::ReferenceEngine;+ use tinymemory_api::Consolidation;let note = || {tinymemory_api::StoreItem::document(diff --git a/crates/openhuman-core/src/memory/state_store.rs b/crates/openhuman-core/src/memory/state_store.rsindex c9b0d71cba..8f10ba609b 100644--- a/crates/openhuman-core/src/memory/state_store.rs+++ b/crates/openhuman-core/src/memory/state_store.rs@@ -11,8 +11,8 @@use std::path::{Path, PathBuf};use anyhow::Result;-use serde::Serialize;use serde::de::DeserializeOwned;+use serde::Serialize;use crate::storage::state_kv::StateKv;diff --git a/crates/openhuman-core/src/memory/tool_budget_tests.rs b/crates/openhuman-core/src/memory/tool_budget_tests.rsindex 612385d1b8..626e7d36eb 100644--- a/crates/openhuman-core/src/memory/tool_budget_tests.rs+++ b/crates/openhuman-core/src/memory/tool_budget_tests.rs@@ -148,12 +148,10 @@ async fn parallel_memory_reads_reserve_from_the_same_time_budget() {async fn completed_run_tracking_is_bounded() {let budget = budget();for i in 0..200 {- assert!(- budget- .run(Some(&format!("turn-{i}")), async { "ok" })- .await- .is_ok()- );+ assert!(budget+ .run(Some(&format!("turn-{i}")), async { "ok" })+ .await+ .is_ok());}// The first idle record was evicted, so it receives a fresh call allowance.for _ in 0..8 {@@ -172,12 +170,10 @@ async fn an_outstanding_memory_call_survives_other_runs_and_keeps_its_timeout_citokio::pin!(call);assert!(futures::poll!(call.as_mut()).is_pending());for i in 0..128 {- assert!(- budget- .run(Some(&format!("other-{i}")), async { "ok" })- .await- .is_ok()- );+ assert!(budget+ .run(Some(&format!("other-{i}")), async { "ok" })+ .await+ .is_ok());}assert_eq!(call.await, Err(Refusal::TimedOut));assert_eq!(diff --git a/crates/openhuman-core/src/memory/tool_writes.rs b/crates/openhuman-core/src/memory/tool_writes.rsindex 7faa076201..c1ede0a0db 100644--- a/crates/openhuman-core/src/memory/tool_writes.rs+++ b/crates/openhuman-core/src/memory/tool_writes.rs@@ -20,14 +20,14 @@ use async_trait::async_trait;use serde::Deserialize;use sha2::{Digest, Sha256};use tinymemory_api::{Namespace, Reach, StoreItem, WriteOptions};-use tinymemory_tools::ToolScope;-use tinymemory_tools::WriteSink;use tinymemory_tools::confine::Policy;use tinymemory_tools::list_store::{ListStore, StoreError};use tinymemory_tools::pending::{Ack, Binding, Entry, Epoch, FenceToken, Limits, PendingError, PendingWrites, WriteExecutor,WriteGate, WriteOperation,};+use tinymemory_tools::ToolScope;+use tinymemory_tools::WriteSink;use super::types::ForgetParams;use crate::config::Config;diff --git a/crates/openhuman-core/src/memory/tool_writes_tests.rs b/crates/openhuman-core/src/memory/tool_writes_tests.rsindex 35f364f735..8d4bd33046 100644--- a/crates/openhuman-core/src/memory/tool_writes_tests.rs+++ b/crates/openhuman-core/src/memory/tool_writes_tests.rs@@ -1,5 +1,5 @@use super::*;-use crate::memory::test_fixtures::{RefusingEngine, bind_reference, config_in, stored};+use crate::memory::test_fixtures::{bind_reference, config_in, stored, RefusingEngine};use crate::memory::tools::CallFacts;use serde_json::json;use tinymemory_api::{MetaFilter, Namespace, Reach};@@ -221,14 +221,12 @@ fn private_outbox_is_scrubbed_before_persistence_and_has_a_size_limit() {"the queue is a storage value, not a file");let huge = "x".repeat(MAX_BYTES);- assert!(- enqueue(- &config,- &json!({"action":"learn","text":huge}),- &facts(&config)- )- .is_err()- );+ assert!(enqueue(+ &config,+ &json!({"action":"learn","text":huge}),+ &facts(&config)+ )+ .is_err());assert_eq!(read(&config.workspace_dir).unwrap().len(), 1);}@@ -344,14 +342,12 @@ fn corrupt_existing_outbox_is_preserved_and_refuses_new_writes() {let file = path(&config.workspace_dir);std::fs::create_dir_all(file.parent().unwrap()).unwrap();std::fs::write(&file, b"corrupt existing state").unwrap();- assert!(- enqueue(- &config,- &json!({"action":"learn","text":"Prefers tea"}),- &facts(&config)- )- .is_err()- );+ assert!(enqueue(+ &config,+ &json!({"action":"learn","text":"Prefers tea"}),+ &facts(&config)+ )+ .is_err());assert_eq!(std::fs::read(&file).unwrap(), b"corrupt existing state");}@@ -420,14 +416,12 @@ fn a_full_outbox_keeps_existing_writes_and_refuses_a_new_one() {let mut entries = read(&config.workspace_dir).unwrap();entries.resize(MAX_PENDING, entries[0].clone());write(&config.workspace_dir, &entries).unwrap();- assert!(- enqueue(- &config,- &json!({"action":"learn","text":"new"}),- &facts(&config)- )- .is_err()- );+ assert!(enqueue(+ &config,+ &json!({"action":"learn","text":"new"}),+ &facts(&config)+ )+ .is_err());assert_eq!(read(&config.workspace_dir).unwrap().len(), MAX_PENDING);}@@ -656,16 +650,12 @@ async fn erasing_one_owner_fences_pending_writes_from_every_team_root() {let fence = fence_and_clear(&crate::core::runtime::DispatchCtx::ambient(), &first).await.unwrap();- assert!(- read_at(&queue_path(&first, &facts(&first).reach.at))- .unwrap()- .is_empty()- );- assert!(- read_at(&queue_path(&second, &facts(&second).reach.at))- .unwrap()- .is_empty()- );+ assert!(read_at(&queue_path(&first, &facts(&first).reach.at))+ .unwrap()+ .is_empty());+ assert!(read_at(&queue_path(&second, &facts(&second).reach.at))+ .unwrap()+ .is_empty());drop(fence);let engine = bind_reference(&first);assert_eq!(drain(&first).await, 0);diff --git a/crates/openhuman-core/src/memory/tools.rs b/crates/openhuman-core/src/memory/tools.rsindex f72d99e966..f524cf431d 100644--- a/crates/openhuman-core/src/memory/tools.rs+++ b/crates/openhuman-core/src/memory/tools.rs@@ -6,11 +6,11 @@ use std::sync::Arc;use std::time::Duration;use async_trait::async_trait;-use serde_json::{Value, json};+use serde_json::{json, Value};use tinymemory_api::{Namespace, Reach, ThreadWindow, ToolCallRef};use tinymemory_tools::{- CallContext, ConcurrencyClass, MemoryTools, PermissionClass, Refusal, RunBudget, SingleTool,- ToolScope, concurrency_for, is_write_action, permission_for,+ concurrency_for, is_write_action, permission_for, CallContext, ConcurrencyClass, MemoryTools,+ PermissionClass, Refusal, RunBudget, SingleTool, ToolScope,};use tinytools::{PermissionLevel, Tool, ToolCallOptions, ToolResult, ToolRunContext};diff --git a/crates/openhuman-core/src/memory/tools_offline_tests.rs b/crates/openhuman-core/src/memory/tools_offline_tests.rsindex f9c6e89283..85d2a98125 100644--- a/crates/openhuman-core/src/memory/tools_offline_tests.rs+++ b/crates/openhuman-core/src/memory/tools_offline_tests.rs@@ -40,11 +40,9 @@ async fn queued_writes_work_without_an_available_engine_but_not_when_explicitly_&pending[1].operation,tinymemory_tools::pending::WriteOperation::Forget { .. }));- assert!(- pending- .iter()- .all(|entry| entry.scope_root == facts.reach.at)- );+ assert!(pending+ .iter()+ .all(|entry| entry.scope_root == facts.reach.at));let mut disabled = config.clone();disabled.components.memory = false;diff --git a/crates/openhuman-core/src/memory/tools_saas_tests.rs b/crates/openhuman-core/src/memory/tools_saas_tests.rsindex 39c1f5e382..1a4e76739e 100644--- a/crates/openhuman-core/src/memory/tools_saas_tests.rs+++ b/crates/openhuman-core/src/memory/tools_saas_tests.rs@@ -2,8 +2,8 @@ use super::*;use crate::config::schema::MemoryAgentConfig;use crate::memory::test_fixtures::config_in;use std::sync::{- Arc,atomic::{AtomicUsize, Ordering},+ Arc,};use tinymemory_api::conformance::ReferenceEngine;use tinymemory_api::{@@ -225,18 +225,14 @@ fn valid_saas_root_keeps_tool_reads_inside_the_authenticated_namespace() {.unwrap();assert!(!recall.is_error, "{}", recall.text());let evidence: Value = serde_json::from_str(&recall.text()).unwrap();- assert!(- evidence["evidence"]- .as_str()- .unwrap()- .contains("acme boundary marker")- );- assert!(- !evidence["evidence"]- .as_str()- .unwrap()- .contains("foreign boundary marker")- );+ assert!(evidence["evidence"]+ .as_str()+ .unwrap()+ .contains("acme boundary marker"));+ assert!(!evidence["evidence"]+ .as_str()+ .unwrap()+ .contains("foreign boundary marker"));let fetch = tool.execute_with_context(@@ -248,18 +244,14 @@ fn valid_saas_root_keeps_tool_reads_inside_the_authenticated_namespace() {.unwrap();assert!(!fetch.is_error, "{}", fetch.text());let page: Value = serde_json::from_str(&fetch.text()).unwrap();- assert!(- page["matches"]- .as_str()- .unwrap()- .contains("acme boundary marker")- );- assert!(- !page["matches"]- .as_str()- .unwrap()- .contains("foreign boundary marker")- );+ assert!(page["matches"]+ .as_str()+ .unwrap()+ .contains("acme boundary marker"));+ assert!(!page["matches"]+ .as_str()+ .unwrap()+ .contains("foreign boundary marker"));assert_eq!(reads.load(Ordering::SeqCst), 2);});println!("SAAS_MEMORY_TOOL_VALID_ROOT_CHILD_PASSED");diff --git a/crates/openhuman-core/src/memory/tools_test_support.rs b/crates/openhuman-core/src/memory/tools_test_support.rsindex 63b0a93362..1ca289bf2a 100644--- a/crates/openhuman-core/src/memory/tools_test_support.rs+++ b/crates/openhuman-core/src/memory/tools_test_support.rs@@ -1,6 +1,6 @@//! Shared test adapters for the memory tool's native facade.-use super::{CallFacts, MemoryTool, is_write_action};+use super::{is_write_action, CallFacts, MemoryTool};use crate::config::Config;use crate::core::runtime::DispatchCtx;use serde_json::Value;diff --git a/crates/openhuman-core/src/memory/tools_tests.rs b/crates/openhuman-core/src/memory/tools_tests.rsindex 568dc97f0b..4006bfce81 100644--- a/crates/openhuman-core/src/memory/tools_tests.rs+++ b/crates/openhuman-core/src/memory/tools_tests.rs@@ -456,11 +456,9 @@ async fn learnings_are_shared_under_a_root_and_a_team_root_is_kept_apart() {);assert!(after_forget.iter().any(|hit| hit.id == main_item.id));assert!(after_forget.iter().any(|hit| hit.text.contains("arxiv")));- assert!(- after_forget- .iter()- .any(|hit| hit.text.contains("british english"))- );+ assert!(after_forget+ .iter()+ .any(|hit| hit.text.contains("british english")));}/// The reference engine, recording how far each single store waited.diff --git a/crates/openhuman-embed/src/host_internals.rs b/crates/openhuman-embed/src/host_internals.rsindex 6651bc12c7..f45ff840e2 100644--- a/crates/openhuman-embed/src/host_internals.rs+++ b/crates/openhuman-embed/src/host_internals.rs@@ -20,16 +20,16 @@ pub use openhuman_core::run_core_from_args;/// Shared by tinyhumans (hosted controllers) and rpc (`http_host`, `/health`).pub mod core {pub use openhuman_core::core::{- ControllerSchema, FieldSchema, Outcome, StructuredRpcError, TypeSchema, unwrap_rpc,+ unwrap_rpc, ControllerSchema, FieldSchema, Outcome, StructuredRpcError, TypeSchema,};pub mod all {// tinyhumans: hosted controller extension; rpc: http_host + `/health`.pub use openhuman_core::core::all::{- ControllerExtension, ControllerFuture, DomainGroup, RegisteredController,all_controller_schemas, all_http_method_schemas, cli_handler_for_namespace,namespace_description, register_controller_extension, rpc_method_from_parts,- schema_for_rpc_method,+ schema_for_rpc_method, ControllerExtension, ControllerFuture, DomainGroup,+ RegisteredController,};}@@ -37,31 +37,31 @@ pub mod core {/// RPC handler and classifier (rpc).pub mod observability {pub use openhuman_core::core::observability::{- API_KEY_REJECTED_PREFIX, BACKEND_UNAVAILABLE_PREFIX, ExpectedErrorKind,- REPORT_ERROR_TRACING_TARGET, USAGE_PROBE_BACKOFF_PREFIX,contains_transient_transport_phrase, expected_error_kind, is_api_key_rejected_message,is_session_expired_message, is_suppressed_usage_probe_backoff,is_transient_http_status_code, is_transient_message_failure, report_error,- report_error_or_expected, report_warning_message,+ report_error_or_expected, report_warning_message, ExpectedErrorKind,+ API_KEY_REJECTED_PREFIX, BACKEND_UNAVAILABLE_PREFIX, REPORT_ERROR_TRACING_TARGET,+ USAGE_PROBE_BACKOFF_PREFIX,};}// rpc server only, below.pub mod auth {pub use openhuman_core::core::auth::{- CORE_TOKEN_ENV_VAR, bearer_matches, get_rpc_token, init_rpc_token,- init_rpc_token_with_value, verify_bearer_token,+ bearer_matches, get_rpc_token, init_rpc_token, init_rpc_token_with_value,+ verify_bearer_token, CORE_TOKEN_ENV_VAR,};}pub mod bus {- pub use openhuman_core::core::bus::{BUS, init};+ pub use openhuman_core::core::bus::{init, BUS};}pub mod cli {pub use openhuman_core::core::cli::load_dotenv_for_cli;}pub mod dispatch {pub use openhuman_core::core::dispatch::{- UNKNOWN_METHOD_PREFIX, is_known_probe_method, unknown_method_name,+ is_known_probe_method, unknown_method_name, UNKNOWN_METHOD_PREFIX,};}pub mod event_bind_tokens {@@ -81,14 +81,14 @@ pub mod core {}pub mod runtime {pub use openhuman_core::core::runtime::{- CoreContext, CoreRuntime, DispatchCtx, Mode, SaasConfig, current_tenant, is_saas,+ current_tenant, is_saas, CoreContext, CoreRuntime, DispatchCtx, Mode, SaasConfig,};pub mod saas {pub use openhuman_core::core::runtime::saas::build;}}pub mod server_launcher {- pub use openhuman_core::core::server_launcher::{ServeRequest, install_server_launcher};+ pub use openhuman_core::core::server_launcher::{install_server_launcher, ServeRequest};}pub mod session_expiry {pub use openhuman_core::core::session_expiry::is_session_expired_error;@@ -109,15 +109,15 @@ pub mod core {/// tinyhumans (every hosted controller loads its config) and rpc (server).pub mod config {pub use openhuman_core::config::{- Config, MODEL_MANAGED_DEFAULT, PrivacyMode, active_workspace_dir,- active_workspace_dir_cached, active_workspace_snapshot,+ active_workspace_dir, active_workspace_dir_cached, active_workspace_snapshot,build_runtime_proxy_client_with_timeouts, load_config_with_timeout, workspace_handle,+ Config, PrivacyMode, MODEL_MANAGED_DEFAULT,};pub mod app_env {// tinyhumans: backend URL selection.pub use openhuman_core::config::app_env::{- APP_ENV_VAR, VITE_APP_ENV_VAR, app_env_from_env, is_staging_app_env,+ app_env_from_env, is_staging_app_env, APP_ENV_VAR, VITE_APP_ENV_VAR,};}pub mod ops {@@ -170,8 +170,8 @@ pub mod agent {}pub mod session_store {pub use openhuman_core::storage::sessions::{- ReboundSessionStores, WorkspaceSessionStores, context_workspace_dir, install,- installed, restore,+ context_workspace_dir, install, installed, restore, ReboundSessionStores,+ WorkspaceSessionStores,};}}@@ -188,8 +188,8 @@ pub mod channels {pub mod inference {pub mod embedding_host {pub use openhuman_core::inference::embedding_host::{- SharedEmbeddingModel, default_embedding_provider_for_chat,- default_embedding_provider_with_config,+ default_embedding_provider_for_chat, default_embedding_provider_with_config,+ SharedEmbeddingModel,};}pub mod provider {@@ -198,9 +198,9 @@ pub mod inference {}}pub mod http {- pub use openhuman_core::inference::http::EXTERNAL_OPENAI_COMPAT_PROVIDER;#[cfg(feature = "http-server")]pub use openhuman_core::inference::http::router;+ pub use openhuman_core::inference::http::EXTERNAL_OPENAI_COMPAT_PROVIDER;}}@@ -222,16 +222,16 @@ pub mod security {/// Host-supplied secret storage and encryption-key sources.pub mod secret_storage {pub use openhuman_core::security::secret_storage::{- EncryptedFileBackend, MasterKeySource, SecretBackend, SecretStorageError,clear_master_key_source, clear_secret_backend, init_workspace,install_master_key_source, install_secret_backend, installed_master_key_source,installed_secret_backend, is_available, store::workspace_dir_for_file_backend,+ EncryptedFileBackend, MasterKeySource, SecretBackend, SecretStorageError,};}pub mod credentials {pub use openhuman_core::security::credentials::{- APP_SESSION_PROVIDER, AuthService, DEFAULT_AUTH_PROFILE_NAME,- channel_credential_provider,+ channel_credential_provider, AuthService, APP_SESSION_PROVIDER,+ DEFAULT_AUTH_PROFILE_NAME,};pub mod ops {pub use openhuman_core::security::credentials::ops::{@@ -240,11 +240,11 @@ pub mod security {}pub mod session_support {pub use openhuman_core::security::credentials::session_support::{- BackendCredential, LOCAL_SESSION_BACKEND_UNAVAILABLE,+ build_session_state, classify_session_token, current_session_is_local,+ get_session_token, is_local_session_token, load_app_session_profile,+ publish_local_session_expiry, resolve_backend_credential, BackendCredential,+ SessionTokenCheck, LOCAL_SESSION_BACKEND_UNAVAILABLE,LOCAL_SESSION_MANAGED_INFERENCE_UNAVAILABLE, SESSION_EXPIRES_AT_META,- SessionTokenCheck, build_session_state, classify_session_token,- current_session_is_local, get_session_token, is_local_session_token,- load_app_session_profile, publish_local_session_expiry, resolve_backend_credential,};}pub mod api_key {@@ -296,17 +296,17 @@ pub mod util {/// Tool sources: tools an outside crate appends to the agent catalogue.pub mod tool_sources {pub use openhuman_core::tools::sources::{- ANCHOR_AFTER_DELEGATE, ANCHOR_AFTER_SEARCH, ToolSourceCtx, ToolSourceFactory,- ToolSourcePlacement, register_tool_source, register_tool_source_at,- register_tool_source_in, registered_tool_source_placements, unregister_tool_source,+ register_tool_source, register_tool_source_at, register_tool_source_in,+ registered_tool_source_placements, unregister_tool_source, ToolSourceCtx,+ ToolSourceFactory, ToolSourcePlacement, ANCHOR_AFTER_DELEGATE, ANCHOR_AFTER_SEARCH,};}/// The artifact publisher slot: the service that shares an artifact version.pub mod artifact_publisher {pub use openhuman_core::artifacts::{- ArtifactPublisherFactory, register_artifact_publisher, register_artifact_publisher_in,- unregister_artifact_publisher,+ register_artifact_publisher, register_artifact_publisher_in, unregister_artifact_publisher,+ ArtifactPublisherFactory,};// tinyhumans file-storage publisher: the protected-path guard it re-checks// before upload, and the store its tests save artifacts into.@@ -318,8 +318,8 @@ pub mod artifact_publisher {/// Egress disclosure, for hosted calls that leave the machine.pub mod egress {pub use openhuman_core::security::egress::{- DataKind, EgressDescriptor, EgressLedger, EgressReason, IdentificationRisk,emit_external_transfer, emit_external_transfer_in, enforce_egress, local_only_blocks,+ DataKind, EgressDescriptor, EgressLedger, EgressReason, IdentificationRisk,};}@@ -327,20 +327,20 @@ pub mod egress {pub mod config_enrichers {pub use openhuman_core::config::schema::resolved_endpoints::ResolvedEndpoints;pub use openhuman_core::config::{- ConfigEnricher, register_enricher, register_enricher_in, run_enrichers, unregister_enricher,+ register_enricher, register_enricher_in, run_enrichers, unregister_enricher, ConfigEnricher,};}/// Composio route builders (`composio.mode` -> route).pub mod composio {pub use openhuman_core::integrations::composio::client::{- ComposioRoute, ComposioRouteBuilder, register_composio_route_builder,- unregister_composio_route_builder,+ register_composio_route_builder, unregister_composio_route_builder, ComposioRoute,+ ComposioRouteBuilder,};// The proxy route's target (origin + bearer) for `composio.mode = backend`.#[cfg(feature = "modules")]pub use openhuman_core::modules::connectors::{- ProxyTarget, ProxyTargetResolver, register_proxy_target, unregister_proxy_target,+ register_proxy_target, unregister_proxy_target, ProxyTarget, ProxyTargetResolver,};}@@ -349,7 +349,7 @@ pub mod composio {pub mod media {pub mod generation {pub use openhuman_core::media::generation::{- GeneratorRouter, MediaGenerators, MediaReferenceAllowlist, media_tools_for_config,+ media_tools_for_config, GeneratorRouter, MediaGenerators, MediaReferenceAllowlist,};}}@@ -358,8 +358,8 @@ pub mod media {#[cfg(feature = "web3")]pub mod wallet_backend {pub use openhuman_core::modules::wallet_backend::{- WalletBackendCall, WalletBackendFuture, WalletBackendHandler, register_wallet_backend,- register_wallet_backend_in, unregister_wallet_backend,+ register_wallet_backend, register_wallet_backend_in, unregister_wallet_backend,+ WalletBackendCall, WalletBackendFuture, WalletBackendHandler,};}@@ -368,23 +368,23 @@ pub mod inference_registry {pub use openhuman_core::inference::provider::factory::PROVIDER_OPENHUMAN;pub use openhuman_core::inference::provider::openhuman_backend_model::REASONING_OFF_METADATA_KEY;pub use openhuman_core::inference::registry::{- BoxFuture, CatalogEntry, CatalogLimits, CatalogListing, CatalogRequest, ChatModelEntry,- ChatModelFactory, ChatModelRequest, EmbeddingFactory, EmbeddingRequest, ReadinessProbe,register_catalog, register_catalog_in, register_chat_model, register_chat_model_in,register_embedding, register_embedding_in, unregister_catalog, unregister_chat_model,- unregister_embedding,+ unregister_embedding, BoxFuture, CatalogEntry, CatalogLimits, CatalogListing,+ CatalogRequest, ChatModelEntry, ChatModelFactory, ChatModelRequest, EmbeddingFactory,+ EmbeddingRequest, ReadinessProbe,};}/// Memory engines by id, and the free-background-work predicate.pub mod memory_engines {pub use openhuman_core::memory::engine::{- BearerSource, Binding, BoundEngine, EngineCredential, EngineSettings, TINYHUMANS_ENGINE,- build_cached, rooted,+ build_cached, rooted, BearerSource, Binding, BoundEngine, EngineCredential, EngineSettings,+ TINYHUMANS_ENGINE,};pub use openhuman_core::memory::engine_registry::{- EngineBuilder, EngineEntry, EngineFuture, EngineRequest, FreeBackground, bound_engine,- register_memory_engine, register_memory_engine_in, unregister_memory_engine,+ bound_engine, register_memory_engine, register_memory_engine_in, unregister_memory_engine,+ EngineBuilder, EngineEntry, EngineFuture, EngineRequest, FreeBackground,};}@@ -392,8 +392,8 @@ pub mod memory_engines {#[cfg(feature = "channels")]pub mod channel_callback {pub use openhuman_core::channels::callback_slot::{- CallbackFuture, ChannelCallback, ChannelCallbackCtx, register_channel_callback,- register_channel_callback_in, unregister_channel_callback,+ register_channel_callback, register_channel_callback_in, unregister_channel_callback,+ CallbackFuture, ChannelCallback, ChannelCallbackCtx,};}@@ -404,21 +404,21 @@ pub mod voice_registry {LIVE_PROVIDER_ELEVENLABS_HOSTED, LIVE_PROVIDER_GEMINI_HOSTED,};pub use openhuman_core::voice::factory::registry::{- SttProviderFactory, TtsProviderFactory, register_stt_provider, register_stt_provider_in,- register_tts_provider, register_tts_provider_in, unregister_stt_provider,- unregister_tts_provider,+ register_stt_provider, register_stt_provider_in, register_tts_provider,+ register_tts_provider_in, unregister_stt_provider, unregister_tts_provider,+ SttProviderFactory, TtsProviderFactory,};pub use openhuman_core::voice::factory::{- SttProvider, SttResult, TtsProvider, create_stt_provider, create_tts_provider,+ create_stt_provider, create_tts_provider, SttProvider, SttResult, TtsProvider,};pub use openhuman_core::voice::live::ops::live_providers;pub use openhuman_core::voice::live::registry::{- ConfigureFn, ConfiguredFn, LiveFuture, LiveProviderEntry, LiveProviderPlacement, PrepareFn,- register_live_provider, register_live_provider_in, unregister_live_provider,+ register_live_provider, register_live_provider_in, unregister_live_provider, ConfigureFn,+ ConfiguredFn, LiveFuture, LiveProviderEntry, LiveProviderPlacement, PrepareFn,};pub use openhuman_core::voice::live::types::{LiveProviderInfo, LiveProviderKind};pub use openhuman_core::voice::live::{- GEMINI_LANGUAGES, GEMINI_VOICES, LiveVoiceError, PreparedProvider,+ LiveVoiceError, PreparedProvider, GEMINI_LANGUAGES, GEMINI_VOICES,};}@@ -447,7 +447,7 @@ pub mod platform {pub mod connectivity {pub mod rpc {pub use openhuman_core::platform::connectivity::rpc::{- OccupiedByCore, pick_listen_port_for_host_with,+ pick_listen_port_for_host_with, OccupiedByCore,};}}@@ -458,8 +458,8 @@ pub mod platform {pub mod storage {pub use openhuman_core::storage::{- STORAGE_URL_VAR, StorageBackend, block_on, block_on_anyhow, clear, configured_url,- driver_is_shared, install, install_for_url, installed, open, url_from,+ block_on, block_on_anyhow, clear, configured_url, driver_is_shared, install,+ install_for_url, installed, open, url_from, StorageBackend, STORAGE_URL_VAR,};/// The layout v1 -> v2 migration the host runs at boot when@@ -472,8 +472,8 @@ pub mod storage {pub mod profiles {pub mod gateway {pub use openhuman_core::profiles::gateway::{- GatewayRefusal, GatewayScope, HeldBy, PROFILE_HELD, PROFILE_OWNER_HEADER, USER_HEADER,- USER_SIG_HEADER, resolve_scope, sign, verify,+ resolve_scope, sign, verify, GatewayRefusal, GatewayScope, HeldBy, PROFILE_HELD,+ PROFILE_OWNER_HEADER, USER_HEADER, USER_SIG_HEADER,};}pub mod host {@@ -502,9 +502,9 @@ pub mod web3 {pub mod web_chat {pub use openhuman_core::web_chat::{- ChatRequestMetadata, GuardrailPayload, StartChatError, WebChannelEvent,approval_request_event, cancel_chat_scoped, plan_review_request_event,publish_web_channel_event, start_chat, subscribe_web_channel_events, unix_epoch_ms,+ ChatRequestMetadata, GuardrailPayload, StartChatError, WebChannelEvent,};}