Skip to content

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

feat: apply rustfmt formatting to entire codebase

Steven Enamakelcfc11365cccd
diff --git a/crates/openhuman-app/src/core_process.rs b/crates/openhuman-app/src/core_process.rs
index a1cf9234e7..e7a867baaa 100644
--- a/crates/openhuman-app/src/core_process.rs
+++ b/crates/openhuman-app/src/core_process.rs
@@ -223,9 +223,8 @@ impl CoreProcessHandle {
for startup_attempt in 0..=1u8 {
let mut retry_after_takeover = false;
let shutdown_token = self.fresh_shutdown_token().await;
- let (ready_tx, mut ready_rx) = tokio::sync::oneshot::channel::<
- openhuman_rpc::server::EmbeddedReadySignal,
- >();
+ let (ready_tx, mut ready_rx) =
+ tokio::sync::oneshot::channel::<openhuman_rpc::server::EmbeddedReadySignal>();
let mut received_ready = false;
{
diff --git a/crates/openhuman-core/src/agent/artifacts/ops.rs b/crates/openhuman-core/src/agent/artifacts/ops.rs
index 7e653ed202..ccf4aa046b 100644
--- a/crates/openhuman-core/src/agent/artifacts/ops.rs
+++ b/crates/openhuman-core/src/agent/artifacts/ops.rs
@@ -67,10 +67,7 @@ pub async fn ai_list_artifacts(
///
/// Returns the serialized `ArtifactMeta` plus an `absolute_path` field
/// pointing to the full on-disk location of the artifact files.
-pub async fn ai_get_artifact(
- config: &Config,
- artifact_id: &str,
-) -> Result<Outcome<Value>, String> {
+pub async fn ai_get_artifact(config: &Config, artifact_id: &str) -> Result<Outcome<Value>, String> {
log::debug!(
"[artifacts] ai_get_artifact: id={artifact_id} workspace={:?}",
config.workspace_dir
diff --git a/crates/openhuman-core/src/agent/artifacts/schemas.rs b/crates/openhuman-core/src/agent/artifacts/schemas.rs
index 3d78e60853..c3b2f57da2 100644
--- a/crates/openhuman-core/src/agent/artifacts/schemas.rs
+++ b/crates/openhuman-core/src/agent/artifacts/schemas.rs
@@ -3,8 +3,8 @@ use serde_json::{Map, Value};
use crate::config::rpc as config_rpc;
use crate::core::all::{ControllerFuture, RegisteredController};
-use crate::core::{ControllerSchema, FieldSchema, TypeSchema};
use crate::core::Outcome;
+use crate::core::{ControllerSchema, FieldSchema, TypeSchema};
pub fn all_controller_schemas() -> Vec<ControllerSchema> {
vec![
diff --git a/crates/openhuman-core/src/agent/experience/ops.rs b/crates/openhuman-core/src/agent/experience/ops.rs
index f52d39a020..97c1f5ce32 100644
--- a/crates/openhuman-core/src/agent/experience/ops.rs
+++ b/crates/openhuman-core/src/agent/experience/ops.rs
@@ -14,13 +14,13 @@ use crate::memory::api::health::MemoryHealth;
// are reached on a `dyn MemoryProvider` receiver, where supertrait methods are
// inherent object candidates rather than in-scope-trait candidates — so an
// import of either would be flagged unused and fail `clippy -D warnings`.
+use crate::core::Outcome;
use crate::memory::api::provider::MemoryProvider;
use crate::memory::api::recall::OwnedRecallOpts;
use crate::memory::api::types::{
MemoryCategory, MemoryEntry, MemoryTaint, NamespaceSummary, RecallOpts,
};
use crate::memory::Memory;
-use crate::core::Outcome;
use async_trait::async_trait;
use std::collections::BTreeMap;
use std::sync::Arc;
@@ -345,10 +345,7 @@ pub async fn list(_params: ListParams) -> Result<Outcome<Vec<AgentExperience>>,
.cmp(&a.updated_at_ms)
.then_with(|| a.id.cmp(&b.id))
});
- Ok(Outcome::single_log(
- experiences,
- "agent experiences listed",
- ))
+ Ok(Outcome::single_log(experiences, "agent experiences listed"))
}
pub async fn dismiss(params: DismissParams) -> Result<Outcome<DismissResult>, String> {
diff --git a/crates/openhuman-core/src/agent/experience/schemas.rs b/crates/openhuman-core/src/agent/experience/schemas.rs
index 4539c5d59e..2d4a64b815 100644
--- a/crates/openhuman-core/src/agent/experience/schemas.rs
+++ b/crates/openhuman-core/src/agent/experience/schemas.rs
@@ -3,8 +3,8 @@ use serde_json::{Map, Value};
use crate::agent::experience::ops::{CaptureParams, DismissParams, ListParams, RetrieveParams};
use crate::core::all::{ControllerFuture, RegisteredController};
-use crate::core::{ControllerSchema, FieldSchema, TypeSchema};
use crate::core::Outcome;
+use crate::core::{ControllerSchema, FieldSchema, TypeSchema};
pub fn all_controller_schemas() -> Vec<ControllerSchema> {
vec![
diff --git a/crates/openhuman-core/src/agent/orchestration/agent_teams/schemas.rs b/crates/openhuman-core/src/agent/orchestration/agent_teams/schemas.rs
index ffc4deb2d3..5626cd4a83 100644
--- a/crates/openhuman-core/src/agent/orchestration/agent_teams/schemas.rs
+++ b/crates/openhuman-core/src/agent/orchestration/agent_teams/schemas.rs
@@ -11,8 +11,8 @@ use serde_json::{Map, Value};
use crate::config::rpc as config_rpc;
use crate::core::all::{ControllerFuture, RegisteredController};
-use crate::core::{ControllerSchema, FieldSchema, TypeSchema};
use crate::core::Outcome;
+use crate::core::{ControllerSchema, FieldSchema, TypeSchema};
use tinyagents_session::run_ledger::AgentTeamListRequest;
use super::runtime;
diff --git a/crates/openhuman-core/src/agent/orchestration/command_center/schemas.rs b/crates/openhuman-core/src/agent/orchestration/command_center/schemas.rs
index 8d3b0065c6..a6959e0517 100644
--- a/crates/openhuman-core/src/agent/orchestration/command_center/schemas.rs
+++ b/crates/openhuman-core/src/agent/orchestration/command_center/schemas.rs
@@ -6,8 +6,8 @@ use serde_json::{Map, Value};
use crate::config::rpc as config_rpc;
use crate::core::all::{ControllerFuture, RegisteredController};
-use crate::core::{ControllerSchema, FieldSchema, TypeSchema};
use crate::core::Outcome;
+use crate::core::{ControllerSchema, FieldSchema, TypeSchema};
/// Controller schemas exposed by the command center.
pub fn all_controller_schemas() -> Vec<ControllerSchema> {
diff --git a/crates/openhuman-core/src/agent/orchestration/subagent_control.rs b/crates/openhuman-core/src/agent/orchestration/subagent_control.rs
index d1b65e3cd5..b12d8988d4 100644
--- a/crates/openhuman-core/src/agent/orchestration/subagent_control.rs
+++ b/crates/openhuman-core/src/agent/orchestration/subagent_control.rs
@@ -19,8 +19,8 @@ use serde_json::{json, Map, Value};
use crate::agent::orchestration::running_subagents::{CancelledSubagent, SteerError};
use crate::agent::orchestration::{background_completions, running_subagents, subagent_sessions};
use crate::core::all::{ControllerFuture, RegisteredController};
-use crate::core::{ControllerSchema, FieldSchema, TypeSchema};
use crate::core::Outcome;
+use crate::core::{ControllerSchema, FieldSchema, TypeSchema};
use tinyagents_harness::run_queue::QueueLane;
/// Controller schemas exposed for detached sub-agent control.
diff --git a/crates/openhuman-core/src/agent/orchestration/workflow_runs/schemas.rs b/crates/openhuman-core/src/agent/orchestration/workflow_runs/schemas.rs
index 13a79ada67..aee23895a5 100644
--- a/crates/openhuman-core/src/agent/orchestration/workflow_runs/schemas.rs
+++ b/crates/openhuman-core/src/agent/orchestration/workflow_runs/schemas.rs
@@ -9,8 +9,8 @@ use serde_json::{Map, Value};
use crate::config::rpc as config_rpc;
use crate::core::all::{ControllerFuture, RegisteredController};
-use crate::core::{ControllerSchema, FieldSchema, TypeSchema};
use crate::core::Outcome;
+use crate::core::{ControllerSchema, FieldSchema, TypeSchema};
use tinyagents_session::run_ledger::WorkflowRunListRequest;
/// Controller schemas exposed by the workflow-runs module.
diff --git a/crates/openhuman-core/src/agent/orchestration/worktree_schemas.rs b/crates/openhuman-core/src/agent/orchestration/worktree_schemas.rs
index ea97203b1f..0c9c7edbfe 100644
--- a/crates/openhuman-core/src/agent/orchestration/worktree_schemas.rs
+++ b/crates/openhuman-core/src/agent/orchestration/worktree_schemas.rs
@@ -21,8 +21,8 @@ use serde_json::{json, Map, Value};
use crate::config::rpc as config_rpc;
use crate::core::all::{ControllerFuture, RegisteredController};
-use crate::core::{ControllerSchema, FieldSchema, TypeSchema};
use crate::core::Outcome;
+use crate::core::{ControllerSchema, FieldSchema, TypeSchema};
use tinyagents_harness::workspace::{
detect_worktree_overlaps, git_worktree_diff_summary, git_worktree_status, list_git_worktrees,
remove_git_worktree, GitWorktreeError, GitWorktreeStatus, GIT_WORKTREE_SUBDIR,
diff --git a/crates/openhuman-core/src/agent/registry/rpc.rs b/crates/openhuman-core/src/agent/registry/rpc.rs
index 0899616543..17d7aa1859 100644
--- a/crates/openhuman-core/src/agent/registry/rpc.rs
+++ b/crates/openhuman-core/src/agent/registry/rpc.rs
@@ -110,9 +110,7 @@ impl CreateCustomRequest {
}
}
-pub async fn create_custom_rpc(
- req: CreateCustomRequest,
-) -> Result<Outcome<AgentResponse>, String> {
+pub async fn create_custom_rpc(req: CreateCustomRequest) -> Result<Outcome<AgentResponse>, String> {
Ok(Outcome::new(
AgentResponse {
agent: ops::upsert_custom_agent(req.into_entry()).await?,
@@ -131,9 +129,7 @@ pub struct AgentResponse {
pub agent: AgentRegistryEntry,
}
-pub async fn upsert_custom_rpc(
- req: UpsertCustomRequest,
-) -> Result<Outcome<AgentResponse>, String> {
+pub async fn upsert_custom_rpc(req: UpsertCustomRequest) -> Result<Outcome<AgentResponse>, String> {
Ok(Outcome::new(
AgentResponse {
agent: ops::upsert_custom_agent(req.agent).await?,
diff --git a/crates/openhuman-core/src/agent/registry/schemas.rs b/crates/openhuman-core/src/agent/registry/schemas.rs
index 326714abb9..6b3a06dc04 100644
--- a/crates/openhuman-core/src/agent/registry/schemas.rs
+++ b/crates/openhuman-core/src/agent/registry/schemas.rs
@@ -4,8 +4,8 @@ use serde::de::DeserializeOwned;
use serde_json::{Map, Value};
use crate::core::all::{ControllerFuture, RegisteredController};
-use crate::core::{ControllerSchema, FieldSchema, TypeSchema};
use crate::core::Outcome;
+use crate::core::{ControllerSchema, FieldSchema, TypeSchema};
use super::rpc;
diff --git a/crates/openhuman-core/src/agent/schemas.rs b/crates/openhuman-core/src/agent/schemas.rs
index c7b5f021c1..50f58c6998 100644
--- a/crates/openhuman-core/src/agent/schemas.rs
+++ b/crates/openhuman-core/src/agent/schemas.rs
@@ -4,8 +4,8 @@ use serde_json::{Map, Value};
use crate::config::rpc as config_rpc;
use crate::core::all::{ControllerFuture, RegisteredController};
-use crate::core::{ControllerSchema, FieldSchema, TypeSchema};
use crate::core::Outcome;
+use crate::core::{ControllerSchema, FieldSchema, TypeSchema};
/// Params for `agent.chat` and `agent.chat_simple`.
///
diff --git a/crates/openhuman-core/src/agent/session_db/schemas.rs b/crates/openhuman-core/src/agent/session_db/schemas.rs
index fe280df309..0b1bf17905 100644
--- a/crates/openhuman-core/src/agent/session_db/schemas.rs
+++ b/crates/openhuman-core/src/agent/session_db/schemas.rs
@@ -4,8 +4,8 @@ use serde_json::{Map, Value};
use crate::config::rpc as config_rpc;
use crate::core::all::{ControllerFuture, RegisteredController};
-use crate::core::{ControllerSchema, FieldSchema, TypeSchema};
use crate::core::Outcome;
+use crate::core::{ControllerSchema, FieldSchema, TypeSchema};
use tinyagents_session::run_ledger::{AgentRunListRequest, RunEventListRequest};
diff --git a/crates/openhuman-core/src/agent/session_import/schemas.rs b/crates/openhuman-core/src/agent/session_import/schemas.rs
index 61dc803f3c..856aff71bd 100644
--- a/crates/openhuman-core/src/agent/session_import/schemas.rs
+++ b/crates/openhuman-core/src/agent/session_import/schemas.rs
@@ -4,8 +4,8 @@ use serde::Deserialize;
use serde_json::{Map, Value};
use crate::core::all::{ControllerFuture, RegisteredController};
-use crate::core::{ControllerSchema, FieldSchema, TypeSchema};
use crate::core::Outcome;
+use crate::core::{ControllerSchema, FieldSchema, TypeSchema};
use super::ops::run_import;
use super::types::ImportOptions;
diff --git a/crates/openhuman-core/src/channels/controllers/schemas.rs b/crates/openhuman-core/src/channels/controllers/schemas.rs
index 0fee09aa63..7c91480049 100644
--- a/crates/openhuman-core/src/channels/controllers/schemas.rs
+++ b/crates/openhuman-core/src/channels/controllers/schemas.rs
@@ -7,8 +7,8 @@ use serde_json::{Map, Value};
use crate::config::rpc as config_rpc;
use crate::config::Config;
use crate::core::all::{ControllerFuture, RegisteredController};
-use crate::core::{ControllerSchema, FieldSchema, TypeSchema};
use crate::core::Outcome;
+use crate::core::{ControllerSchema, FieldSchema, TypeSchema};
use super::backend::OpenHumanChannelBackend;
use super::definitions::ChannelAuthMode;
diff --git a/crates/openhuman-core/src/channels/proactive.rs b/crates/openhuman-core/src/channels/proactive.rs
index ce72436a9e..7d19802790 100644
--- a/crates/openhuman-core/src/channels/proactive.rs
+++ b/crates/openhuman-core/src/channels/proactive.rs
@@ -21,8 +21,8 @@
use crate::channels::{Channel, ChannelSendExt, SendMessage};
use crate::core::events::DomainEvent;
-use crate::web_chat::WebChannelEvent;
use crate::web_chat::publish_web_channel_event;
+use crate::web_chat::WebChannelEvent;
use async_trait::async_trait;
use std::collections::HashMap;
use std::sync::{Arc, RwLock};
diff --git a/crates/openhuman-core/src/config/migration_helpers/schemas.rs b/crates/openhuman-core/src/config/migration_helpers/schemas.rs
index 45f598d43a..88ecb7e498 100644
--- a/crates/openhuman-core/src/config/migration_helpers/schemas.rs
+++ b/crates/openhuman-core/src/config/migration_helpers/schemas.rs
@@ -3,8 +3,8 @@ use serde_json::{Map, Value};
use crate::config::rpc as config_rpc;
use crate::core::all::{ControllerFuture, RegisteredController};
-use crate::core::{ControllerSchema, FieldSchema, TypeSchema};
use crate::core::Outcome;
+use crate::core::{ControllerSchema, FieldSchema, TypeSchema};
#[derive(Debug, Deserialize)]
struct MigrateOpenClawParams {
diff --git a/crates/openhuman-core/src/config/ops/agent.rs b/crates/openhuman-core/src/config/ops/agent.rs
index b7ff67c855..2151d9cda9 100644
--- a/crates/openhuman-core/src/config/ops/agent.rs
+++ b/crates/openhuman-core/src/config/ops/agent.rs
@@ -585,10 +585,7 @@ pub async fn get_activity_level_settings() -> Result<Outcome<serde_json::Value>,
"estimated_monthly_cost_min_usd": cost_min,
"estimated_monthly_cost_max_usd": cost_max,
});
- Ok(Outcome::single_log(
- value,
- "activity level settings read",
- ))
+ Ok(Outcome::single_log(value, "activity level settings read"))
}
/// Updates the agent activity level and pushes it into the scheduler gate.
diff --git a/crates/openhuman-core/src/config/ops/loader/reset_local_data.rs b/crates/openhuman-core/src/config/ops/loader/reset_local_data.rs
index cd7006f0ee..e33c32f10a 100644
--- a/crates/openhuman-core/src/config/ops/loader/reset_local_data.rs
+++ b/crates/openhuman-core/src/config/ops/loader/reset_local_data.rs
@@ -213,9 +213,7 @@ pub async fn get_data_paths() -> Result<Outcome<serde_json::Value>, String> {
/// let `Path::join` resolve a delete target OUTSIDE `<root>/users/<id>`. We
/// therefore reject anything that isn't a single plain path segment and, as
/// defense in depth, verify the resolved dir is a direct child of `users/`.
-pub async fn get_data_paths_for_user(
- user_id: &str,
-) -> Result<Outcome<serde_json::Value>, String> {
+pub async fn get_data_paths_for_user(user_id: &str) -> Result<Outcome<serde_json::Value>, String> {
if !is_plain_user_id(user_id) {
return Err(format!(
"refusing to resolve data paths for unsafe user id {user_id:?}: must be a single path segment with no separators, `.` or `..`"
diff --git a/crates/openhuman-core/src/config/ops/loader/snapshot.rs b/crates/openhuman-core/src/config/ops/loader/snapshot.rs
index 8dbbec5671..66cea8e3e7 100644
--- a/crates/openhuman-core/src/config/ops/loader/snapshot.rs
+++ b/crates/openhuman-core/src/config/ops/loader/snapshot.rs
@@ -130,8 +130,7 @@ pub fn client_config_json(config: &Config) -> serde_json::Value {
}
/// Loads config and returns the client-facing AI config slice.
-pub async fn load_and_get_client_config_snapshot() -> Result<Outcome<serde_json::Value>, String>
-{
+pub async fn load_and_get_client_config_snapshot() -> Result<Outcome<serde_json::Value>, String> {
let config = load_config_with_timeout().await?;
let snapshot = client_config_json(&config);
Ok(Outcome::new(
diff --git a/crates/openhuman-core/src/config/schemas/helpers.rs b/crates/openhuman-core/src/config/schemas/helpers.rs
index 832fb5d413..4b0dc248e9 100644
--- a/crates/openhuman-core/src/config/schemas/helpers.rs
+++ b/crates/openhuman-core/src/config/schemas/helpers.rs
@@ -2,8 +2,8 @@ use serde::de::{DeserializeOwned, Deserializer};
use serde::Deserialize;
use serde_json::{Map, Value};
-use crate::core::{FieldSchema, TypeSchema};
use crate::core::Outcome;
+use crate::core::{FieldSchema, TypeSchema};
pub(super) const DEFAULT_ONBOARDING_FLAG_NAME: &str = ".skip_onboarding";
diff --git a/crates/openhuman-core/src/config/schemas/mod.rs b/crates/openhuman-core/src/config/schemas/mod.rs
index ce6cb9aa21..36d4ebff1d 100644
--- a/crates/openhuman-core/src/config/schemas/mod.rs
+++ b/crates/openhuman-core/src/config/schemas/mod.rs
@@ -46,10 +46,10 @@ pub use controllers::{all_controller_schemas, all_registered_controllers};
// Re-export items that schemas_tests.rs accesses via `use super::*`.
// The test module is `schemas::tests` so `super::` resolves to `schemas`.
#[cfg(test)]
-use crate::core::TypeSchema;
-#[cfg(test)]
use crate::core::Outcome;
#[cfg(test)]
+use crate::core::TypeSchema;
+#[cfg(test)]
use controllers::{
handle_get_agent_paths, handle_get_autonomy_settings, handle_update_autonomy_settings,
};
diff --git a/crates/openhuman-core/src/config/schemas_tests.rs b/crates/openhuman-core/src/config/schemas_tests.rs
index 7e9cfa7b34..9e3449d447 100644
--- a/crates/openhuman-core/src/config/schemas_tests.rs
+++ b/crates/openhuman-core/src/config/schemas_tests.rs
@@ -78,8 +78,7 @@ fn json_output_helper_builds_required_json_field() {
#[test]
fn to_json_wraps_rpc_outcome() {
- let v =
- to_json(Outcome::single_log(serde_json::json!({"ok": true}), "l")).expect("serialize");
+ let v = to_json(Outcome::single_log(serde_json::json!({"ok": true}), "l")).expect("serialize");
assert!(v.get("logs").is_some() || v.get("result").is_some());
}
diff --git a/crates/openhuman-core/src/config/workspace/schemas.rs b/crates/openhuman-core/src/config/workspace/schemas.rs
index 5901b5ae0f..c3b7ad0bd4 100644
--- a/crates/openhuman-core/src/config/workspace/schemas.rs
+++ b/crates/openhuman-core/src/config/workspace/schemas.rs
@@ -4,8 +4,8 @@ use serde_json::{Map, Value};
use crate::config::rpc as config_rpc;
use crate::config::workspace::rpc as workspace_rpc;
use crate::core::all::{ControllerFuture, RegisteredController};
-use crate::core::{ControllerSchema, FieldSchema, TypeSchema};
use crate::core::Outcome;
+use crate::core::{ControllerSchema, FieldSchema, TypeSchema};
pub fn all_controller_schemas() -> Vec<ControllerSchema> {
vec![
diff --git a/crates/openhuman-core/src/core/auth.rs b/crates/openhuman-core/src/core/auth.rs
index 9e3d26f66d..e9e953d2c4 100644
--- a/crates/openhuman-core/src/core/auth.rs
+++ b/crates/openhuman-core/src/core/auth.rs
@@ -45,7 +45,6 @@ use std::os::unix::fs::OpenOptionsExt as _;
// transports and `CoreBuilder` call them in every build. `Config`/`AuthService`/
// the provider-id import are consumed only by the gated `/v1` helpers.
-
static RPC_TOKEN: OnceLock<String> = OnceLock::new();
/// Operator-supplied environment variable that carries the RPC bearer in
diff --git a/crates/openhuman-core/src/core/cli.rs b/crates/openhuman-core/src/core/cli.rs
index 19bcbdedfe..f9480e8980 100644
--- a/crates/openhuman-core/src/core/cli.rs
+++ b/crates/openhuman-core/src/core/cli.rs
@@ -11,8 +11,8 @@ use std::collections::BTreeMap;
use crate::core::all;
use crate::core::invoke::{default_state, invoke_method};
use crate::core::logging::CliLogDefault;
-use crate::core::{ControllerSchema, TypeSchema};
use crate::core::params::parse_json_params;
+use crate::core::{ControllerSchema, TypeSchema};
/// The ASCII banner displayed when the CLI starts.
const CLI_BANNER: &str = r#"
diff --git a/crates/openhuman-core/src/core/mod.rs b/crates/openhuman-core/src/core/mod.rs
index 40c7d01bf3..431e0daaae 100644
--- a/crates/openhuman-core/src/core/mod.rs
+++ b/crates/openhuman-core/src/core/mod.rs
@@ -32,9 +32,9 @@ pub mod rpc_log;
pub mod runtime;
#[cfg(feature = "crash-reporting")]
pub mod sentry_transport;
-pub mod shutdown;
pub mod server_launcher;
pub mod session_expiry;
+pub mod shutdown;
pub mod structured_error;
pub mod subsystem;
pub mod subsystems_cli;
diff --git a/crates/openhuman-core/src/core/observability.rs b/crates/openhuman-core/src/core/observability.rs
index ed19d7684b..06becf5a1b 100644
--- a/crates/openhuman-core/src/core/observability.rs
+++ b/crates/openhuman-core/src/core/observability.rs
@@ -2672,12 +2672,7 @@ pub(crate) fn report_error_message(
// reporting, #3567), so it has no caller in a slim build (#5048). Kept compiled
// for the crash-reporting carve-out; the allow keeps the disabled build quiet.
#[cfg_attr(not(feature = "http-server"), allow(dead_code))]
-pub fn report_warning_message(
- message: &str,
- domain: &str,
- operation: &str,
- extra: &[Tag<'_>],
-) {
+pub fn report_warning_message(message: &str, domain: &str, operation: &str, extra: &[Tag<'_>]) {
// Redact secret-looking spans before `message` reaches any log sink or
// Sentry event — see the note in `report_error_message`.
let scrubbed = crate::core::log_redaction::scrub_secrets(message);
diff --git a/crates/openhuman-core/src/core/runtime/builder.rs b/crates/openhuman-core/src/core/runtime/builder.rs
index 845ebf806d..ac2095c397 100644
--- a/crates/openhuman-core/src/core/runtime/builder.rs
+++ b/crates/openhuman-core/src/core/runtime/builder.rs
@@ -22,7 +22,6 @@
use std::sync::Arc;
-
use crate::config::Config;
use crate::core::all::DomainGroup;
use crate::core::runtime::context::CoreContext;
@@ -721,7 +720,11 @@ impl CoreRuntime {
log::trace!("[core-runtime] invoke_in method={method}");
CoreContext::scope(
ctx,
- crate::core::invoke::invoke_method(crate::core::invoke::default_state(), method, params),
+ crate::core::invoke::invoke_method(
+ crate::core::invoke::default_state(),
+ method,
+ params,
+ ),
)
.await
}
diff --git a/crates/openhuman-core/src/core/subsystem/schemas.rs b/crates/openhuman-core/src/core/subsystem/schemas.rs
index f12a6a70dc..3a7b78b2f7 100644
--- a/crates/openhuman-core/src/core/subsystem/schemas.rs
+++ b/crates/openhuman-core/src/core/subsystem/schemas.rs
@@ -22,8 +22,8 @@
use serde_json::{Map, Value};
use crate::core::all::{ControllerFuture, RegisteredController};
-use crate::core::{ControllerSchema, FieldSchema, TypeSchema};
use crate::core::Outcome;
+use crate::core::{ControllerSchema, FieldSchema, TypeSchema};
use super::status::SubsystemStatus;
@@ -79,8 +79,7 @@ fn handle_status(_params: Map<String, Value>) -> ControllerFuture {
Box::pin(async move {
let rows = subsystems_status().await;
log::debug!("[subsystem] status requested: {} slot(s)", rows.len());
- Outcome::new(serde_json::json!({ "subsystems": rows }), vec![])
- .into_cli_compatible_json()
+ Outcome::new(serde_json::json!({ "subsystems": rows }), vec![]).into_cli_compatible_json()
})
}
diff --git a/crates/openhuman-core/src/cron/ops.rs b/crates/openhuman-core/src/cron/ops.rs
index c6a7a3c4db..b49fa2afda 100644
--- a/crates/openhuman-core/src/cron/ops.rs
+++ b/crates/openhuman-core/src/cron/ops.rs
@@ -1,8 +1,8 @@
use crate::config::Config;
+use crate::core::Outcome;
use crate::cron::{
self, add_shell_job, get_job, update_job, CronJob, CronJobPatch, CronRun, Schedule,
};
-use crate::core::Outcome;
use crate::security::SecurityPolicy;
use anyhow::Result;
use once_cell::sync::Lazy;
@@ -205,10 +205,7 @@ pub async fn cron_remove(
))
}
-pub async fn cron_run(
- config: &Config,
- job_id: &str,
-) -> Result<Outcome<serde_json::Value>, String> {
+pub async fn cron_run(config: &Config, job_id: &str) -> Result<Outcome<serde_json::Value>, String> {
let job_id = job_id.trim();
if job_id.is_empty() {
return Err("Missing 'job_id' parameter".to_string());
diff --git a/crates/openhuman-core/src/cron/schemas.rs b/crates/openhuman-core/src/cron/schemas.rs
index 18d8e4ef04..3c2131049f 100644
--- a/crates/openhuman-core/src/cron/schemas.rs
+++ b/crates/openhuman-core/src/cron/schemas.rs
@@ -3,9 +3,9 @@ use serde_json::{Map, Value};
use crate::config::rpc as config_rpc;
use crate::core::all::{ControllerFuture, RegisteredController};
+use crate::core::Outcome;
use crate::core::{ControllerSchema, FieldSchema, TypeSchema};
use crate::cron::CronJobPatch;
-use crate::core::Outcome;
fn job_id_input(comment: &'static str) -> FieldSchema {
FieldSchema {
diff --git a/crates/openhuman-core/src/desktop/dashboard/schemas.rs b/crates/openhuman-core/src/desktop/dashboard/schemas.rs
index b6d179d2cb..76fc7075da 100644
--- a/crates/openhuman-core/src/desktop/dashboard/schemas.rs
+++ b/crates/openhuman-core/src/desktop/dashboard/schemas.rs
@@ -3,8 +3,8 @@
use serde_json::{Map, Value};
use crate::core::all::{ControllerFuture, RegisteredController};
-use crate::core::{ControllerSchema, FieldSchema, TypeSchema};
use crate::core::Outcome;
+use crate::core::{ControllerSchema, FieldSchema, TypeSchema};
use super::ops;
use super::types::ModelHealthResponse;
diff --git a/crates/openhuman-core/src/desktop/provider_surfaces/ops.rs b/crates/openhuman-core/src/desktop/provider_surfaces/ops.rs
index 592f6652c1..66b8c661f8 100644
--- a/crates/openhuman-core/src/desktop/provider_surfaces/ops.rs
+++ b/crates/openhuman-core/src/desktop/provider_surfaces/ops.rs
@@ -3,8 +3,8 @@
//! This initial cut keeps state in-memory so the RPC contract and UI wiring
//! can land before the SQLite-backed store arrives.
-use crate::memory::{ApiEnvelope, ApiMeta, EmptyRequest};
use crate::core::Outcome;
+use crate::memory::{ApiEnvelope, ApiMeta, EmptyRequest};
use serde::Serialize;
use std::collections::BTreeMap;
diff --git a/crates/openhuman-core/src/flows/ops.rs b/crates/openhuman-core/src/flows/ops.rs
index 1cc50feeb1..5a350721a9 100644
--- a/crates/openhuman-core/src/flows/ops.rs
+++ b/crates/openhuman-core/src/flows/ops.rs
@@ -57,6 +57,7 @@ use tokio_util::sync::CancellationToken;
use crate::agent::turn_origin::{with_origin, AgentTurnOrigin, TrustedAutomationSource};
use crate::config::Config;
+use crate::core::Outcome;
use crate::flows::bus;
use crate::flows::draft_store;
use crate::flows::run_registry;
@@ -65,7 +66,6 @@ use crate::flows::types::{
FlowConnection, FlowRunStep, FlowRunTrigger, FlowSuggestion, SuggestionStatus,
};
use crate::flows::{flow_namespace, Flow, FlowRun};
-use crate::core::Outcome;
use crate::security::approval::{
ApprovalChatContext, FlowRunContext, APPROVAL_CHAT_CONTEXT, APPROVAL_COPILOT_STREAM_CONTEXT,
APPROVAL_FLOW_RUN_CONTEXT,
diff --git a/crates/openhuman-core/src/flows/ops/discovery.rs b/crates/openhuman-core/src/flows/ops/discovery.rs
index 872b31c8ef..6672c881ef 100644
--- a/crates/openhuman-core/src/flows/ops/discovery.rs
+++ b/crates/openhuman-core/src/flows/ops/discovery.rs
@@ -116,10 +116,7 @@ pub async fn flows_discover(
count = suggestions.len(),
"[flows] flows_discover: returning active suggestions"
);
- Ok(Outcome::single_log(
- suggestions,
- "flow discovery complete",
- ))
+ Ok(Outcome::single_log(suggestions, "flow discovery complete"))
}
/// Lists persisted workflow suggestions. `status` filters to one lifecycle
@@ -135,10 +132,7 @@ pub async fn flows_list_suggestions(
/// Marks a suggestion `dismissed` (the user rejected the card). The row is kept
/// so a later discovery run dedupes against it and won't re-surface the idea.
-pub async fn flows_dismiss_suggestion(
- config: &Config,
- id: &str,
-) -> Result<Outcome<Value>, String> {
+pub async fn flows_dismiss_suggestion(config: &Config, id: &str) -> Result<Outcome<Value>, String> {
let found = store::set_suggestion_status(config, id, SuggestionStatus::Dismissed)
.map_err(|e| e.to_string())?;
Ok(Outcome::single_log(
diff --git a/crates/openhuman-core/src/flows/ops/drafts.rs b/crates/openhuman-core/src/flows/ops/drafts.rs
index 0b11e73251..b7f5e095f4 100644
--- a/crates/openhuman-core/src/flows/ops/drafts.rs
+++ b/crates/openhuman-core/src/flows/ops/drafts.rs
@@ -43,9 +43,7 @@ pub fn flows_draft_update(
}
/// Lists all drafts, newest-updated first.
-pub fn flows_draft_list(
- config: &Config,
-) -> Result<Outcome<Vec<crate::flows::FlowDraft>>, String> {
+pub fn flows_draft_list(config: &Config) -> Result<Outcome<Vec<crate::flows::FlowDraft>>, String> {
let drafts = draft_store::list_drafts(config).map_err(|e| e.to_string())?;
Ok(Outcome::single_log(drafts, "drafts listed"))
}
diff --git a/crates/openhuman-core/src/flows/schemas.rs b/crates/openhuman-core/src/flows/schemas.rs
index 497acd6035..1973fb8b3d 100644
--- a/crates/openhuman-core/src/flows/schemas.rs
+++ b/crates/openhuman-core/src/flows/schemas.rs
@@ -10,9 +10,9 @@ use serde_json::{Map, Value};
use crate::config::rpc as config_rpc;
use crate::core::all::{ControllerFuture, RegisteredController};
+use crate::core::Outcome;
use crate::core::{ControllerSchema, FieldSchema, TypeSchema};
use crate::flows::ops;
-use crate::core::Outcome;
fn id_input(comment: &'static str) -> FieldSchema {
FieldSchema {
diff --git a/crates/openhuman-core/src/http_host/rpc.rs b/crates/openhuman-core/src/http_host/rpc.rs
index 67c068625d..a1af3d5278 100644
--- a/crates/openhuman-core/src/http_host/rpc.rs
+++ b/crates/openhuman-core/src/http_host/rpc.rs
@@ -1,15 +1,13 @@
//! RPC adapters for the `http_host` domain.
+use crate::core::Outcome;
use crate::http_host::ops;
use crate::http_host::types::{
HostedDirGetResult, HostedDirListResult, HostedDirLookupParams, HostedDirStartResult,
HostedDirStopResult, StartHostedDirParams,
};
-use crate::core::Outcome;
-pub async fn start(
- params: StartHostedDirParams,
-) -> Result<Outcome<HostedDirStartResult>, String> {
+pub async fn start(params: StartHostedDirParams) -> Result<Outcome<HostedDirStartResult>, String> {
let server = ops::start_hosted_dir_server(params).await?;
Ok(Outcome::single_log(
HostedDirStartResult { server },
@@ -17,9 +15,7 @@ pub async fn start(
))
}
-pub async fn stop(
- params: HostedDirLookupParams,
-) -> Result<Outcome<HostedDirStopResult>, String> {
+pub async fn stop(params: HostedDirLookupParams) -> Result<Outcome<HostedDirStopResult>, String> {
let server = ops::stop_hosted_dir_server(&params.server_id).await?;
Ok(Outcome::single_log(
HostedDirStopResult {
diff --git a/crates/openhuman-core/src/inference/embedding_host/rpc/embed.rs b/crates/openhuman-core/src/inference/embedding_host/rpc/embed.rs
index acdaf7290c..2655fcf96d 100644
--- a/crates/openhuman-core/src/inference/embedding_host/rpc/embed.rs
+++ b/crates/openhuman-core/src/inference/embedding_host/rpc/embed.rs
@@ -130,10 +130,7 @@ pub async fn test_connection(
"requested_dimensions": dims,
"actual_dimensions": actual_dims,
});
- Ok(Outcome::new(
- payload,
- vec!["connection test passed".into()],
- ))
+ Ok(Outcome::new(payload, vec!["connection test passed".into()]))
}
Err(e) => {
let payload = serde_json::json!({
diff --git a/crates/openhuman-core/src/inference/embedding_host/schemas.rs b/crates/openhuman-core/src/inference/embedding_host/schemas.rs
index b3ed5a3c72..61a71e9a49 100644
--- a/crates/openhuman-core/src/inference/embedding_host/schemas.rs
+++ b/crates/openhuman-core/src/inference/embedding_host/schemas.rs
@@ -5,8 +5,8 @@ use serde_json::{Map, Value};
use crate::config::ops as config_rpc;
use crate::core::all::{ControllerFuture, RegisteredController};
-use crate::core::{ControllerSchema, FieldSchema, TypeSchema};
use crate::core::Outcome;
+use crate::core::{ControllerSchema, FieldSchema, TypeSchema};
pub fn all_controller_schemas() -> Vec<ControllerSchema> {
vec![
diff --git a/crates/openhuman-core/src/inference/host_runtime/ops/agent_chat.rs b/crates/openhuman-core/src/inference/host_runtime/ops/agent_chat.rs
index fccdc7703e..f8827b8b91 100644
--- a/crates/openhuman-core/src/inference/host_runtime/ops/agent_chat.rs
+++ b/crates/openhuman-core/src/inference/host_runtime/ops/agent_chat.rs
@@ -2,8 +2,8 @@
use crate::agent::OpenHumanSessionHost;
use crate::config::Config;
-use crate::inference::provider as providers;
use crate::core::Outcome;
+use crate::inference::provider as providers;
use super::turn_guards::{
effective_agent_chat_origin, enforce_user_prompt_or_reject, grant_turn_cwd,
@@ -376,8 +376,5 @@ pub async fn agent_chat_simple(
);
let response = run.await.map_err(|e| e.to_string())?.text();
- Ok(Outcome::single_log(
- response,
- "agent simple chat completed",
- ))
+ Ok(Outcome::single_log(response, "agent simple chat completed"))
}
diff --git a/crates/openhuman-core/src/inference/host_runtime/ops/chat.rs b/crates/openhuman-core/src/inference/host_runtime/ops/chat.rs
index 37004a11c4..70b294e84e 100644
--- a/crates/openhuman-core/src/inference/host_runtime/ops/chat.rs
+++ b/crates/openhuman-core/src/inference/host_runtime/ops/chat.rs
@@ -1,8 +1,8 @@
//! Multi-turn chat through the local model.
use crate::config::Config;
-use crate::inference::host_runtime as local_ai;
use crate::core::Outcome;
+use crate::inference::host_runtime as local_ai;
use super::turn_guards::enforce_user_prompt_or_reject;
diff --git a/crates/openhuman-core/src/inference/host_runtime/ops/reactions.rs b/crates/openhuman-core/src/inference/host_runtime/ops/reactions.rs
index 40c37c201e..cd353bd54f 100644
--- a/crates/openhuman-core/src/inference/host_runtime/ops/reactions.rs
+++ b/crates/openhuman-core/src/inference/host_runtime/ops/reactions.rs
@@ -2,8 +2,8 @@
//! extracting the emoji it picked.
use crate::config::Config;
-use crate::inference::host_runtime as local_ai;
use crate::core::Outcome;
+use crate::inference::host_runtime as local_ai;
/// Result of the reaction-decision prompt.
#[derive(Debug, serde::Serialize)]
@@ -114,10 +114,7 @@ pub async fn local_ai_should_react(
emoji = ?decision.emoji,
"[local_ai:should_react] decision"
);
- Ok(Outcome::single_log(
- decision,
- "reaction decision completed",
- ))
+ Ok(Outcome::single_log(decision, "reaction decision completed"))
}
/// Extract the first emoji from a string. Handles common emoji codepoints
diff --git a/crates/openhuman-core/src/inference/host_runtime/ops/runtime_ops.rs b/crates/openhuman-core/src/inference/host_runtime/ops/runtime_ops.rs
index 6c260ffd92..22e847b491 100644
--- a/crates/openhuman-core/src/inference/host_runtime/ops/runtime_ops.rs
+++ b/crates/openhuman-core/src/inference/host_runtime/ops/runtime_ops.rs
@@ -4,12 +4,12 @@
use chrono::Utc;
use crate::config::Config;
+use crate::core::Outcome;
use crate::inference::host_runtime as local_ai;
use crate::inference::{
LocalAiAssetsStatus, LocalAiDownloadsProgress, LocalAiEmbeddingResult, LocalAiSpeechResult,
LocalAiStatus, LocalAiTtsResult,
};
-use crate::core::Outcome;
use super::turn_guards::enforce_user_prompt_or_reject;
@@ -56,10 +56,7 @@ pub async fn local_ai_summarize(
.summarize_interactive(&runtime, text, max_tokens)
.await
.map_err(|e| e.to_string())?;
- Ok(Outcome::single_log(
- summary,
- "local ai summarize completed",
- ))
+ Ok(Outcome::single_log(summary, "local ai summarize completed"))
}
/// Executes a raw prompt directly against the local AI model.
@@ -127,10 +124,7 @@ pub async fn local_ai_embed(
.embed(&runtime, inputs)
.await
.map_err(|e| e.to_string())?;
- Ok(Outcome::single_log(
- output,
- "local ai embedding completed",
- ))
+ Ok(Outcome::single_log(output, "local ai embedding completed"))
}
/// Transcribes the audio file at the specified path.
diff --git a/crates/openhuman-core/src/inference/host_runtime/schemas.rs b/crates/openhuman-core/src/inference/host_runtime/schemas.rs
index 008faa859e..e96d170037 100644
--- a/crates/openhuman-core/src/inference/host_runtime/schemas.rs
+++ b/crates/openhuman-core/src/inference/host_runtime/schemas.rs
@@ -9,8 +9,8 @@ struct LocalAiTestConnectionParams {
use crate::config::rpc as config_rpc;
use crate::core::all::{ControllerFuture, RegisteredController};
-use crate::core::{ControllerSchema, FieldSchema, TypeSchema};
use crate::core::Outcome;
+use crate::core::{ControllerSchema, FieldSchema, TypeSchema};
/// Params for `inference.agent_chat` and `inference.agent_chat_simple`.
///
diff --git a/crates/openhuman-core/src/inference/host_runtime/schemas_tests.rs b/crates/openhuman-core/src/inference/host_runtime/schemas_tests.rs
index ca55bac6e6..ddf47a8f2b 100644
--- a/crates/openhuman-core/src/inference/host_runtime/schemas_tests.rs
+++ b/crates/openhuman-core/src/inference/host_runtime/schemas_tests.rs
@@ -76,8 +76,7 @@ fn field_builder_helpers_are_correct_shape() {
#[test]
fn to_json_wraps_rpc_outcome() {
- let v =
- to_json(Outcome::single_log(serde_json::json!({"ok": true}), "l")).expect("serialize");
+ let v = to_json(Outcome::single_log(serde_json::json!({"ok": true}), "l")).expect("serialize");
assert!(v.get("logs").is_some() || v.get("result").is_some() || v.get("ok").is_some());
}
diff --git a/crates/openhuman-core/src/inference/ops.rs b/crates/openhuman-core/src/inference/ops.rs
index 15a012085e..f5085b7902 100644
--- a/crates/openhuman-core/src/inference/ops.rs
+++ b/crates/openhuman-core/src/inference/ops.rs
@@ -3,11 +3,11 @@
use crate::config::ops::local_ai_presets;
use crate::config::rpc as config_rpc;
use crate::config::Config;
+use crate::core::Outcome;
use crate::inference::host_runtime as local_runtime;
use crate::inference::host_runtime::ops::ReactionDecision;
use crate::inference::provider as providers;
use crate::inference::{LocalAiEmbeddingResult, LocalAiStatus};
-use crate::core::Outcome;
use serde_json::{json, Value};
use tinyinference_llm::message::Message;
use tinyinference_llm::model::ModelRequest;
@@ -281,10 +281,7 @@ pub async fn inference_analyze_sentiment(
SentimentResult::neutral()
}
};
- let result = Ok(Outcome::single_log(
- result,
- "sentiment analysis completed",
- ));
+ let result = Ok(Outcome::single_log(result, "sentiment analysis completed"));
match &result {
Ok(outcome) => {
debug!(valence = %outcome.value.valence, "{LOG_PREFIX} analyze_sentiment:ok")
@@ -595,9 +592,7 @@ pub async fn inference_openai_oauth_status(config: &Config) -> Result<Outcome<Va
result
}
-pub async fn inference_openai_oauth_disconnect(
- config: &Config,
-) -> Result<Outcome<Value>, String> {
+pub async fn inference_openai_oauth_disconnect(config: &Config) -> Result<Outcome<Value>, String> {
debug!("{LOG_PREFIX} openai_oauth_disconnect:start");
let result = crate::security::credentials::openai_oauth::disconnect_openai_oauth(config)
.map(|payload| Outcome::single_log(payload, "openai oauth disconnected"));
diff --git a/crates/openhuman-core/src/integrations/client/budget_gate.rs b/crates/openhuman-core/src/integrations/client/budget_gate.rs
index adeebbbfe8..c981b96397 100644
--- a/crates/openhuman-core/src/integrations/client/budget_gate.rs
+++ b/crates/openhuman-core/src/integrations/client/budget_gate.rs
@@ -150,10 +150,7 @@ where
match fetch().await {
Ok(data) => {
cache.clear();
- Ok(Outcome::single_log(
- data,
- "team usage fetched from backend",
- ))
+ Ok(Outcome::single_log(data, "team usage fetched from backend"))
}
Err(err) => {
if crate::core::observability::is_session_expired_message(&err) {
diff --git a/crates/openhuman-core/src/integrations/task_sources/ops.rs b/crates/openhuman-core/src/integrations/task_sources/ops.rs
index bbe588042c..f615adad3b 100644
--- a/crates/openhuman-core/src/integrations/task_sources/ops.rs
+++ b/crates/openhuman-core/src/integrations/task_sources/ops.rs
@@ -8,8 +8,8 @@
use serde_json::{json, Value};
use crate::config::Config;
-use crate::integrations::composio::providers::{NormalizedTask, TaskContainer};
use crate::core::Outcome;
+use crate::integrations::composio::providers::{NormalizedTask, TaskContainer};
use super::types::{
FetchReason, FilterSpec, ProviderSlug, SourceTarget, TaskSource, TaskSourcePatch,
diff --git a/crates/openhuman-core/src/integrations/task_sources/schemas.rs b/crates/openhuman-core/src/integrations/task_sources/schemas.rs
index bb36f859de..69b8566392 100644
--- a/crates/openhuman-core/src/integrations/task_sources/schemas.rs
+++ b/crates/openhuman-core/src/integrations/task_sources/schemas.rs
@@ -9,8 +9,8 @@ use serde_json::{Map, Value};
use crate::config::rpc as config_rpc;
use crate::core::all::{ControllerFuture, RegisteredController};
-use crate::core::{ControllerSchema, FieldSchema, TypeSchema};
use crate::core::Outcome;
+use crate::core::{ControllerSchema, FieldSchema, TypeSchema};
use crate::util::{read_optional, read_required};
use super::ops;
diff --git a/crates/openhuman-core/src/mcp/registry/config_ops.rs b/crates/openhuman-core/src/mcp/registry/config_ops.rs
index ce0b9e6a72..b5a39769bc 100644
--- a/crates/openhuman-core/src/mcp/registry/config_ops.rs
+++ b/crates/openhuman-core/src/mcp/registry/config_ops.rs
@@ -50,10 +50,7 @@ pub async fn mcp_clients_config_get(config: &Config) -> Result<Outcome<Value>, S
/// Every added or rewritten server that is enabled is connected in the
/// background; the status poll reports how that went. The reply carries the
/// re-rendered document and what changed, so the editor can show both.
-pub async fn mcp_clients_config_set(
- config: &Config,
- doc: Value,
-) -> Result<Outcome<Value>, String> {
+pub async fn mcp_clients_config_set(config: &Config, doc: Value) -> Result<Outcome<Value>, String> {
let declared = config_doc::parse(&doc)?;
// Keys are trimmed on the way in, so two spellings of one name can collide
diff --git a/crates/openhuman-core/src/mcp/registry/ops.rs b/crates/openhuman-core/src/mcp/registry/ops.rs
index 2aa45d620e..d97df2d4b4 100644
--- a/crates/openhuman-core/src/mcp/registry/ops.rs
+++ b/crates/openhuman-core/src/mcp/registry/ops.rs
@@ -29,8 +29,8 @@ use serde_json::{json, Value};
use crate::config::Config;
use crate::core::bus::BUS;
use crate::core::events::DomainEvent;
-use crate::mcp::host;
use crate::core::Outcome;
+use crate::mcp::host;
use super::helpers::{encode, inject_required_env_keys, require, resolve};
@@ -346,9 +346,7 @@ pub async fn mcp_clients_update_env(
// ── registry settings ────────────────────────────────────────────────────────
-pub async fn mcp_clients_registry_settings_get(
- config: &Config,
-) -> Result<Outcome<Value>, String> {
+pub async fn mcp_clients_registry_settings_get(config: &Config) -> Result<Outcome<Value>, String> {
let settings = resolve(config)?.dynamic().registry_settings();
Ok(Outcome::new(
diff --git a/crates/openhuman-core/src/memory/goals/ops.rs b/crates/openhuman-core/src/memory/goals/ops.rs
index c78f13855a..6b0416f8c5 100644
--- a/crates/openhuman-core/src/memory/goals/ops.rs
+++ b/crates/openhuman-core/src/memory/goals/ops.rs
@@ -54,9 +54,9 @@
use serde::Serialize;
use crate::config::Config;
+use crate::core::Outcome;
use crate::memory::api::goals::GoalsDoc;
use crate::memory::api::provider::MemoryGoals;
-use crate::core::Outcome;
use super::doc;
@@ -148,10 +148,7 @@ pub async fn delete(goals: &dyn MemoryGoals, id: &str) -> Result<Outcome<GoalsDo
.await
.map_err(|e| format!("delete: {e}"))?;
let updated = read(goals, "delete").await?;
- Ok(Outcome::single_log(
- updated,
- format!("deleted goal {id}"),
- ))
+ Ok(Outcome::single_log(updated, format!("deleted goal {id}")))
}
/// On-demand enrichment: run the turn-based goals agent now, then return the
diff --git a/crates/openhuman-core/src/memory/goals/schemas.rs b/crates/openhuman-core/src/memory/goals/schemas.rs
index 5599f0b1cd..4188c9c1f9 100644
--- a/crates/openhuman-core/src/memory/goals/schemas.rs
+++ b/crates/openhuman-core/src/memory/goals/schemas.rs
@@ -18,10 +18,10 @@ use serde_json::{Map, Value};
use super::ops;
use crate::config::rpc as config_rpc;
use crate::core::all::{ControllerFuture, RegisteredController};
+use crate::core::Outcome;
use crate::core::{ControllerSchema, FieldSchema, TypeSchema};
use crate::memory::api::provider::MemoryProvider;
use crate::memory::ops::guard::active_memory_guard;
-use crate::core::Outcome;
/// All `memory_goals` controller schemas (advertised to CLI + RPC consumers).
pub fn all_memory_goals_controller_schemas() -> Vec<ControllerSchema> {
diff --git a/crates/openhuman-core/src/memory/ops/documents.rs b/crates/openhuman-core/src/memory/ops/documents.rs
index 19ebdb39b7..112b36a789 100644
--- a/crates/openhuman-core/src/memory/ops/documents.rs
+++ b/crates/openhuman-core/src/memory/ops/documents.rs
@@ -5,6 +5,7 @@
use serde::{Deserialize, Serialize};
+use crate::core::Outcome;
use crate::memory::api::provider::MemoryProvider;
use crate::memory::api::types::NamespaceDocumentInput;
use crate::memory::api::types::NamespaceRetrievalContext;
@@ -15,7 +16,6 @@ use crate::memory::{
QueryNamespaceResponse, RecallContextRequest, RecallContextResponse, RecallMemoriesRequest,
RecallMemoriesResponse,
};
-use crate::core::Outcome;
use super::envelope::{envelope, error_envelope, memory_counts};
use super::guard::active_memory_guard;
@@ -172,10 +172,7 @@ pub async fn namespace_list() -> Result<Outcome<Vec<String>>, String> {
.list_namespaces()
.await
.map_err(|error| error.to_string())?;
- Ok(Outcome::single_log(
- namespaces,
- "memory namespaces listed",
- ))
+ Ok(Outcome::single_log(namespaces, "memory namespaces listed"))
}
/// Upserts a document into a namespace.
@@ -225,9 +222,7 @@ pub async fn doc_put(params: PutDocParams) -> Result<Outcome<PutDocResult>, Stri
}
/// Ingests a document, performing chunking and embedding.
-pub async fn doc_ingest(
- params: IngestDocParams,
-) -> Result<Outcome<MemoryIngestionResult>, String> {
+pub async fn doc_ingest(params: IngestDocParams) -> Result<Outcome<MemoryIngestionResult>, String> {
let guard = active_memory_guard().await?;
let documents = guard
.as_documents()
diff --git a/crates/openhuman-core/src/memory/ops/envelope.rs b/crates/openhuman-core/src/memory/ops/envelope.rs
index 4054da0f64..2d4e867d72 100644
--- a/crates/openhuman-core/src/memory/ops/envelope.rs
+++ b/crates/openhuman-core/src/memory/ops/envelope.rs
@@ -8,8 +8,8 @@ use std::collections::BTreeMap;
use serde::Serialize;
-use crate::memory::{ApiEnvelope, ApiError, ApiMeta, PaginationMeta};
use crate::core::Outcome;
+use crate::memory::{ApiEnvelope, ApiError, ApiMeta, PaginationMeta};
/// Generates a unique request ID for memory operations.
///
@@ -57,10 +57,7 @@ pub(crate) fn envelope<T: Serialize>(
/// Wraps an error in an RPC API envelope.
///
/// This provides a consistent error reporting format for the memory system.
-pub(crate) fn error_envelope<T: Serialize>(
- code: &str,
- message: String,
-) -> Outcome<ApiEnvelope<T>> {
+pub(crate) fn error_envelope<T: Serialize>(code: &str, message: String) -> Outcome<ApiEnvelope<T>> {
Outcome::new(
ApiEnvelope {
data: None,
diff --git a/crates/openhuman-core/src/memory/ops/files.rs b/crates/openhuman-core/src/memory/ops/files.rs
index 6226e54c9a..d4e8984fbd 100644
--- a/crates/openhuman-core/src/memory/ops/files.rs
+++ b/crates/openhuman-core/src/memory/ops/files.rs
@@ -4,11 +4,11 @@
//! All filesystem I/O here is performed via `tokio::fs` so the handlers stay
//! async-friendly and never block the executor.
+use crate::core::Outcome;
use crate::memory::{
ApiEnvelope, ListMemoryFilesRequest, ListMemoryFilesResponse, ReadMemoryFileRequest,
ReadMemoryFileResponse, WriteMemoryFileRequest, WriteMemoryFileResponse,
};
-use crate::core::Outcome;
use super::envelope::{envelope, memory_counts};
use super::helpers::{
diff --git a/crates/openhuman-core/src/memory/ops/learn.rs b/crates/openhuman-core/src/memory/ops/learn.rs
index d2a15a3eab..7bb35d2eb6 100644
--- a/crates/openhuman-core/src/memory/ops/learn.rs
+++ b/crates/openhuman-core/src/memory/ops/learn.rs
@@ -2,8 +2,8 @@
use std::collections::BTreeSet;
-use crate::memory::api::provider::MemoryProvider;
use crate::core::Outcome;
+use crate::memory::api::provider::MemoryProvider;
use super::guard::active_memory_guard;
@@ -37,9 +37,7 @@ pub struct LearnAllParams {
/// `tree_summarizer_run`. Results are collected per-namespace; a failing
/// namespace does not abort the rest. Runs sequentially to avoid saturating
/// the local AI provider.
-pub async fn memory_learn_all(
- params: LearnAllParams,
-) -> Result<Outcome<LearnAllResult>, String> {
+pub async fn memory_learn_all(params: LearnAllParams) -> Result<Outcome<LearnAllResult>, String> {
tracing::info!(
"[memory.learn] memory_learn_all: entry namespaces={:?}",
params.namespaces
diff --git a/crates/openhuman-core/src/memory/ops/provider.rs b/crates/openhuman-core/src/memory/ops/provider.rs
index 462c6852ce..d71b8c1541 100644
--- a/crates/openhuman-core/src/memory/ops/provider.rs
+++ b/crates/openhuman-core/src/memory/ops/provider.rs
@@ -17,8 +17,8 @@
use crate::core::runtime::context::CoreContext;
use crate::core::subsystem::{DriverHealth, SubsystemStatus};
-use crate::memory::binding::{to_driver_health, MemoryBinding};
use crate::core::Outcome;
+use crate::memory::binding::{to_driver_health, MemoryBinding};
/// The status of the memory slot for the current dispatch context.
///
diff --git a/crates/openhuman-core/src/memory/ops/sync.rs b/crates/openhuman-core/src/memory/ops/sync.rs
index e068889376..2438563192 100644
--- a/crates/openhuman-core/src/memory/ops/sync.rs
+++ b/crates/openhuman-core/src/memory/ops/sync.rs
@@ -38,8 +38,8 @@
use crate::config::rpc as config_rpc;
use crate::config::Config;
-use crate::memory::sync::composio;
use crate::core::Outcome;
+use crate::memory::sync::composio;
use tinymemory_api::sync_events::{emit_sync_stage, MemorySyncStage, MemorySyncTrigger};
/// Parameters for `memory_sync_channel`.
diff --git a/crates/openhuman-core/src/memory/ops/tool_memory.rs b/crates/openhuman-core/src/memory/ops/tool_memory.rs
index acf8de82ac..cb3d0ec700 100644
--- a/crates/openhuman-core/src/memory/ops/tool_memory.rs
+++ b/crates/openhuman-core/src/memory/ops/tool_memory.rs
@@ -16,8 +16,8 @@ use std::sync::Arc;
use crate::memory::api::provider::MemoryProvider;
-use crate::memory::api::tool_memory::{ToolMemoryPriority, ToolMemoryRule, ToolMemorySource};
use crate::core::Outcome;
+use crate::memory::api::tool_memory::{ToolMemoryPriority, ToolMemoryRule, ToolMemorySource};
/// Parameters for `memory_tool_rule_put`.
#[derive(Debug, Deserialize)]
@@ -68,9 +68,7 @@ async fn tool_memory_guard() -> Result<Arc<crate::memory::guard::MemoryGuard>, S
}
/// Upsert a tool-scoped memory rule.
-pub async fn tool_rule_put(
- params: ToolRulePutParams,
-) -> Result<Outcome<ToolMemoryRule>, String> {
+pub async fn tool_rule_put(params: ToolRulePutParams) -> Result<Outcome<ToolMemoryRule>, String> {
log::debug!("[tool-memory] rpc tool_rule_put tool={}", params.tool_name);
let mut rule = ToolMemoryRule::new(
&params.tool_name,
diff --git a/crates/openhuman-core/src/memory/ops_tests.rs b/crates/openhuman-core/src/memory/ops_tests.rs
index 9842563245..00cad0ce1e 100644
--- a/crates/openhuman-core/src/memory/ops_tests.rs
+++ b/crates/openhuman-core/src/memory/ops_tests.rs
@@ -157,8 +157,8 @@ use super::{
extract_entity_type, maybe_retrieval_context, memory_counts, memory_request_id,
relation_identity, relation_metadata, timestamp_to_rfc3339, validate_memory_relative_path,
};
-use crate::memory::{ApiEnvelope, MemoryRetrievalContext};
use crate::core::Outcome;
+use crate::memory::{ApiEnvelope, MemoryRetrievalContext};
#[test]
fn memory_request_id_is_nonempty_and_unique() {
diff --git a/crates/openhuman-core/src/memory/people/rpc.rs b/crates/openhuman-core/src/memory/people/rpc.rs
index c2ecf73edf..6b4d98a93c 100644
--- a/crates/openhuman-core/src/memory/people/rpc.rs
+++ b/crates/openhuman-core/src/memory/people/rpc.rs
@@ -15,8 +15,8 @@
use serde_json::{json, Value};
-use crate::memory::api::provider::{MemoryPeople, PersonHandle, PersonRecord};
use crate::core::Outcome;
+use crate::memory::api::provider::{MemoryPeople, PersonHandle, PersonRecord};
/// Render one person plus their score into the published `people.*` shape.
fn person_json(person: &PersonRecord, score: &crate::memory::api::provider::PersonScore) -> Value {
diff --git a/crates/openhuman-core/src/memory/people/schemas.rs b/crates/openhuman-core/src/memory/people/schemas.rs
index 85b1d66fc4..569d48282f 100644
--- a/crates/openhuman-core/src/memory/people/schemas.rs
+++ b/crates/openhuman-core/src/memory/people/schemas.rs
@@ -9,11 +9,11 @@
use serde_json::{Map, Value};
use crate::core::all::{ControllerFuture, RegisteredController};
+use crate::core::Outcome;
use crate::core::{ControllerSchema, FieldSchema, TypeSchema};
use crate::memory::api::provider::{MemoryProvider, PersonHandle};
use crate::memory::ops::guard::active_memory_guard;
use crate::memory::people::rpc;
-use crate::core::Outcome;
pub fn all_controller_schemas() -> Vec<ControllerSchema> {
vec![
diff --git a/crates/openhuman-core/src/memory/read_rpc/admin.rs b/crates/openhuman-core/src/memory/read_rpc/admin.rs
index da06106c73..b31a133895 100644
--- a/crates/openhuman-core/src/memory/read_rpc/admin.rs
+++ b/crates/openhuman-core/src/memory/read_rpc/admin.rs
@@ -1,8 +1,8 @@
use anyhow::{Context, Result};
use crate::config::Config;
-use crate::memory::api::provider::ForgetSelector;
use crate::core::Outcome;
+use crate::memory::api::provider::ForgetSelector;
// The KV namespace the Composio sync pipelines keep their per-connection
// cursor state under, named at the **contract** (#5560).
//
diff --git a/crates/openhuman-core/src/memory/read_rpc/chunks.rs b/crates/openhuman-core/src/memory/read_rpc/chunks.rs
index 840057fa7f..2c2eb3b7d5 100644
--- a/crates/openhuman-core/src/memory/read_rpc/chunks.rs
+++ b/crates/openhuman-core/src/memory/read_rpc/chunks.rs
@@ -2,11 +2,11 @@ use anyhow::Result;
use std::collections::{HashMap, HashSet};
use crate::config::Config;
+use crate::core::Outcome;
use crate::memory::api::provider::retrieval::{
RetrievalNodeKind, RetrievalResponse, SourceRetrievalQuery,
};
use crate::memory::api::provider::{ChunkListRow, ChunkQuery, MemoryChunks};
-use crate::core::Outcome;
use tinymemory_api::chunks::SourceKind;
use super::types::{
diff --git a/crates/openhuman-core/src/memory/read_rpc/entities.rs b/crates/openhuman-core/src/memory/read_rpc/entities.rs
index de7b1b14aa..724d0fe804 100644
--- a/crates/openhuman-core/src/memory/read_rpc/entities.rs
+++ b/crates/openhuman-core/src/memory/read_rpc/entities.rs
@@ -1,8 +1,8 @@
use anyhow::Result;
use crate::config::Config;
-use crate::memory::binding::MemoryBinding;
use crate::core::Outcome;
+use crate::memory::binding::MemoryBinding;
use tinymemory_api::error::MemoryError;
use tinymemory_api::provider::chunks::ChunkScore;
use tinymemory_api::provider::types::{EntityOccurrence, ForgetSelector};
diff --git a/crates/openhuman-core/src/memory/read_rpc/graph.rs b/crates/openhuman-core/src/memory/read_rpc/graph.rs
index 1009626ed8..a04b4cb071 100644
--- a/crates/openhuman-core/src/memory/read_rpc/graph.rs
+++ b/crates/openhuman-core/src/memory/read_rpc/graph.rs
@@ -1,9 +1,9 @@
use serde::{Deserialize, Serialize};
use crate::config::Config;
+use crate::core::Outcome;
use crate::memory::api::provider::ChunkQuery;
use crate::memory::api::tree::{TreeLeaf, TreeSummary};
-use crate::core::Outcome;
// `MemoryGraph` in the contract is the key/value and relation tier, a different
// graph from the one exported here: the summary forest and its leaf chunks,
diff --git a/crates/openhuman-core/src/memory/read_rpc/vault.rs b/crates/openhuman-core/src/memory/read_rpc/vault.rs
index ca3ccae4ae..6ca8ea7f9c 100644
--- a/crates/openhuman-core/src/memory/read_rpc/vault.rs
+++ b/crates/openhuman-core/src/memory/read_rpc/vault.rs
@@ -14,8 +14,8 @@
use anyhow::Result;
use crate::config::Config;
-use crate::memory::obsidian_registry;
use crate::core::Outcome;
+use crate::memory::obsidian_registry;
use super::types::{ObsidianVaultStatusResponse, VaultHealthCheckResponse};
diff --git a/crates/openhuman-core/src/memory/schema/handlers.rs b/crates/openhuman-core/src/memory/schema/handlers.rs
index 8623b70520..c3962f03d5 100644
--- a/crates/openhuman-core/src/memory/schema/handlers.rs
+++ b/crates/openhuman-core/src/memory/schema/handlers.rs
@@ -9,9 +9,9 @@ use serde_json::{Map, Value};
use crate::config::rpc as config_rpc;
use crate::core::all::ControllerFuture;
+use crate::core::Outcome;
use crate::memory::read_rpc;
use crate::memory::tree::tree::rpc;
-use crate::core::Outcome;
// ── Write-side handlers (rpc::*) ─────────────────────────────────────────
diff --git a/crates/openhuman-core/src/memory/schemas/mod.rs b/crates/openhuman-core/src/memory/schemas/mod.rs
index dab1b48583..747c40db8e 100644
--- a/crates/openhuman-core/src/memory/schemas/mod.rs
+++ b/crates/openhuman-core/src/memory/schemas/mod.rs
@@ -28,8 +28,8 @@ use serde::de::DeserializeOwned;
use serde_json::{Map, Value};
use crate::core::all::RegisteredController;
-use crate::core::{ControllerSchema, FieldSchema, TypeSchema};
use crate::core::Outcome;
+use crate::core::{ControllerSchema, FieldSchema, TypeSchema};
mod documents;
mod files;
diff --git a/crates/openhuman-core/src/memory/sources/rpc/apply_all.rs b/crates/openhuman-core/src/memory/sources/rpc/apply_all.rs
index 8282c723f5..899c5bbe75 100644
--- a/crates/openhuman-core/src/memory/sources/rpc/apply_all.rs
+++ b/crates/openhuman-core/src/memory/sources/rpc/apply_all.rs
@@ -3,9 +3,9 @@
use super::source_sync::{sync_dispatch, SyncDispatch};
use crate::config::rpc as config_rpc;
+use crate::core::Outcome;
use crate::memory::sources::registry;
use crate::memory::sources::types::MemorySourceEntry;
-use crate::core::Outcome;
/// Response returned by `memory_sources_apply_all_in`.
#[derive(Debug, serde::Serialize)]
diff --git a/crates/openhuman-core/src/memory/sources/rpc/coding_sessions.rs b/crates/openhuman-core/src/memory/sources/rpc/coding_sessions.rs
index dfb61bc976..89591948c4 100644
--- a/crates/openhuman-core/src/memory/sources/rpc/coding_sessions.rs
+++ b/crates/openhuman-core/src/memory/sources/rpc/coding_sessions.rs
@@ -2,9 +2,9 @@
use crate::config::rpc as config_rpc;
use crate::config::Config;
+use crate::core::Outcome;
use crate::memory::api::provider::sessions::{CodingSessionIngestReport, CodingSessionSource};
use crate::memory::binding::MemoryBinding;
-use crate::core::Outcome;
/// The coding-session ingest request, under this domain's own name.
///
@@ -52,8 +52,7 @@ pub struct CodingSessionStatusResponse {
/// `CodingSessionSource::scan_truncated` is how a caller learns the counts are
/// a floor — the same field the engine's `CodingSessionSourceStatus` carried,
/// under the same name.
-pub async fn coding_session_status_rpc() -> Result<Outcome<CodingSessionStatusResponse>, String>
-{
+pub async fn coding_session_status_rpc() -> Result<Outcome<CodingSessionStatusResponse>, String> {
tracing::debug!("[memory_sources] coding_session_status_rpc: entry");
let config = config_rpc::load_config_with_timeout().await?;
let binding = crate::memory::binding::for_config(&config)?;
diff --git a/crates/openhuman-core/src/memory/sources/rpc/cost_reporting.rs b/crates/openhuman-core/src/memory/sources/rpc/cost_reporting.rs
index ca72ac547e..e81d6c13ef 100644
--- a/crates/openhuman-core/src/memory/sources/rpc/cost_reporting.rs
+++ b/crates/openhuman-core/src/memory/sources/rpc/cost_reporting.rs
@@ -2,11 +2,11 @@
use super::coding_sessions::unserved;
use crate::config::rpc as config_rpc;
+use crate::core::Outcome;
use crate::memory::api::provider::sync::SyncAuditEntry;
use crate::memory::sources::readers;
use crate::memory::sources::registry;
use crate::memory::sources::run_history;
-use crate::core::Outcome;
// ── Sync Audit Log ──
diff --git a/crates/openhuman-core/src/memory/sources/rpc/registry_crud.rs b/crates/openhuman-core/src/memory/sources/rpc/registry_crud.rs
index b3a3fffbd4..c5a0bfdf9b 100644
--- a/crates/openhuman-core/src/memory/sources/rpc/registry_crud.rs
+++ b/crates/openhuman-core/src/memory/sources/rpc/registry_crud.rs
@@ -3,11 +3,11 @@
//! `registry` and `readers` and never resolves a memory-driver binding.
use crate::config::rpc as config_rpc;
+use crate::core::Outcome;
use crate::memory::sources::apply_kind_defaults;
use crate::memory::sources::readers;
use crate::memory::sources::registry::{self, MemorySourcePatch};
use crate::memory::sources::types::{MemorySourceEntry, SourceKind};
-use crate::core::Outcome;
// ── List ──
@@ -246,9 +246,7 @@ pub struct ListItemsResponse {
pub items: Vec<crate::memory::sources::types::SourceItem>,
}
-pub async fn list_items_rpc(
- req: ListItemsRequest,
-) -> Result<Outcome<ListItemsResponse>, String> {
+pub async fn list_items_rpc(req: ListItemsRequest) -> Result<Outcome<ListItemsResponse>, String> {
tracing::debug!(source_id = %req.source_id, "[memory_sources] list_items_rpc: entry");
let source = registry::get_source(&req.source_id)
diff --git a/crates/openhuman-core/src/memory/sources/rpc/source_sync.rs b/crates/openhuman-core/src/memory/sources/rpc/source_sync.rs
index cff8b18aa6..2435953ed2 100644
--- a/crates/openhuman-core/src/memory/sources/rpc/source_sync.rs
+++ b/crates/openhuman-core/src/memory/sources/rpc/source_sync.rs
@@ -3,9 +3,9 @@
use super::coding_sessions::unserved;
use crate::config::rpc as config_rpc;
+use crate::core::Outcome;
use crate::memory::sources::registry;
use crate::memory::sources::types::MemorySourceEntry;
-use crate::core::Outcome;
// ── Sync ──
@@ -324,8 +324,5 @@ pub async fn reconcile_rpc(req: ReconcileRequest) -> Result<Outcome<ReconcileRes
}
}
- Ok(Outcome::new(
- ReconcileResponse { scopes: reports },
- vec![],
- ))
+ Ok(Outcome::new(ReconcileResponse { scopes: reports }, vec![]))
}
diff --git a/crates/openhuman-core/src/memory/sources/rpc/status_toolkits.rs b/crates/openhuman-core/src/memory/sources/rpc/status_toolkits.rs
index 71499cdff6..544aa679de 100644
--- a/crates/openhuman-core/src/memory/sources/rpc/status_toolkits.rs
+++ b/crates/openhuman-core/src/memory/sources/rpc/status_toolkits.rs
@@ -57,8 +57,5 @@ pub async fn supported_toolkits_rpc() -> Result<Outcome<SupportedToolkitsRespons
toolkits = ?toolkits,
"[memory_sources] supported_toolkits_rpc: resolved supported toolkit set"
);
- Ok(Outcome::new(
- SupportedToolkitsResponse { toolkits },
- vec![],
- ))
+ Ok(Outcome::new(SupportedToolkitsResponse { toolkits }, vec![]))
}
diff --git a/crates/openhuman-core/src/memory/sync/composio/providers/slack/rpc.rs b/crates/openhuman-core/src/memory/sync/composio/providers/slack/rpc.rs
index 18544da43e..091ece8149 100644
--- a/crates/openhuman-core/src/memory/sync/composio/providers/slack/rpc.rs
+++ b/crates/openhuman-core/src/memory/sync/composio/providers/slack/rpc.rs
@@ -36,13 +36,13 @@
use serde::{Deserialize, Serialize};
use crate::config::Config;
+use crate::core::Outcome;
use crate::integrations::composio::client::{
create_composio_client, direct_list_connections, ComposioClientKind,
};
use crate::integrations::composio::ops::run_sync_within_budget;
use crate::integrations::composio::providers::SyncOutcome;
use crate::integrations::composio::types::ComposioConnectionsResponse;
-use crate::core::Outcome;
/// Optional connection-id override for the trigger. When absent, all
/// active Slack connections are synced (serially, one-by-one).
diff --git a/crates/openhuman-core/src/memory/sync/composio/providers/slack/schemas.rs b/crates/openhuman-core/src/memory/sync/composio/providers/slack/schemas.rs
index 001dbb54c0..7c331aa028 100644
--- a/crates/openhuman-core/src/memory/sync/composio/providers/slack/schemas.rs
+++ b/crates/openhuman-core/src/memory/sync/composio/providers/slack/schemas.rs
@@ -16,8 +16,8 @@ use serde_json::{Map, Value};
use super::rpc as slack_rpc;
use crate::config::rpc as config_rpc;
use crate::core::all::{ControllerFuture, RegisteredController};
-use crate::core::{ControllerSchema, FieldSchema, TypeSchema};
use crate::core::Outcome;
+use crate::core::{ControllerSchema, FieldSchema, TypeSchema};
const NAMESPACE: &str = "slack_memory";
diff --git a/crates/openhuman-core/src/memory/sync/sync_status/schemas.rs b/crates/openhuman-core/src/memory/sync/sync_status/schemas.rs
index d75de1563b..f9f95007ed 100644
--- a/crates/openhuman-core/src/memory/sync/sync_status/schemas.rs
+++ b/crates/openhuman-core/src/memory/sync/sync_status/schemas.rs
@@ -14,8 +14,8 @@ use serde_json::{Map, Value};
use crate::config::ops::load_config_with_timeout;
use crate::core::all::{ControllerFuture, RegisteredController};
-use crate::core::{ControllerSchema, FieldSchema, TypeSchema};
use crate::core::Outcome;
+use crate::core::{ControllerSchema, FieldSchema, TypeSchema};
use super::rpc;
diff --git a/crates/openhuman-core/src/memory/tree/retrieval/rpc.rs b/crates/openhuman-core/src/memory/tree/retrieval/rpc.rs
index 99e556fd17..3d9bb24552 100644
--- a/crates/openhuman-core/src/memory/tree/retrieval/rpc.rs
+++ b/crates/openhuman-core/src/memory/tree/retrieval/rpc.rs
@@ -59,11 +59,11 @@ use crate::config::Config;
// The contract's retrieval vocabulary, not the engine's: these handlers return
// what the driver handed back. The two encode identically (see the module
// docs), so this is a Rust-type change and not a wire one.
+use crate::core::Outcome;
use crate::memory::api::provider::retrieval::{
CoverWindowQuery, EntityMatch, RetrievalHit, RetrievalResponse, SourceRetrievalQuery,
};
use crate::memory::source_scope::as_bus_scope;
-use crate::core::Outcome;
use tinymemory_api::chunks::SourceKind;
// ── query_source ──────────────────────────────────────────────────────
diff --git a/crates/openhuman-core/src/memory/tree/retrieval/schemas.rs b/crates/openhuman-core/src/memory/tree/retrieval/schemas.rs
index 10e0e54e3a..6d80ae3213 100644
--- a/crates/openhuman-core/src/memory/tree/retrieval/schemas.rs
+++ b/crates/openhuman-core/src/memory/tree/retrieval/schemas.rs
@@ -15,9 +15,9 @@ use serde_json::{Map, Value};
use crate::config::rpc as config_rpc;
use crate::core::all::{ControllerFuture, RegisteredController};
+use crate::core::Outcome;
use crate::core::{ControllerSchema, FieldSchema, TypeSchema};
use crate::memory::tree::retrieval::rpc as retrieval_rpc;
-use crate::core::Outcome;
const NAMESPACE: &str = "memory_tree";
diff --git a/crates/openhuman-core/src/memory/tree/tree/rpc/chunks.rs b/crates/openhuman-core/src/memory/tree/tree/rpc/chunks.rs
index 069b28730d..e893aecac0 100644
--- a/crates/openhuman-core/src/memory/tree/tree/rpc/chunks.rs
+++ b/crates/openhuman-core/src/memory/tree/tree/rpc/chunks.rs
@@ -3,8 +3,8 @@
use serde::{Deserialize, Serialize};
use crate::config::Config;
-use crate::memory::api::provider::ChunkQuery;
use crate::core::Outcome;
+use crate::memory::api::provider::ChunkQuery;
use tinymemory_api::chunks::{Chunk, SourceKind};
/// Query shape for the `list_chunks` RPC.
diff --git a/crates/openhuman-core/src/memory/tree/tree_runtime/ops.rs b/crates/openhuman-core/src/memory/tree/tree_runtime/ops.rs
index ab47283eff..2aa796b13a 100644
--- a/crates/openhuman-core/src/memory/tree/tree_runtime/ops.rs
+++ b/crates/openhuman-core/src/memory/tree/tree_runtime/ops.rs
@@ -20,9 +20,9 @@ use crate::memory::api::provider::{MemoryProvider, MemoryTree};
// under the path the module contract already uses, and no wire byte changes.
// The sibling `tree_runtime/mod.rs` re-exports the same set for the same
// reason; see its comment on the node model.
+use crate::core::Outcome;
use crate::memory::api::tree::{estimate_tokens, QueryResult};
use crate::memory::guard::MemoryGuard;
-use crate::core::Outcome;
// ── How these handlers reach the tree ───────────────────────────────────────
//
diff --git a/crates/openhuman-core/src/memory/tree/tree_runtime/schemas.rs b/crates/openhuman-core/src/memory/tree/tree_runtime/schemas.rs
index 9495c641d4..4243e52dde 100644
--- a/crates/openhuman-core/src/memory/tree/tree_runtime/schemas.rs
+++ b/crates/openhuman-core/src/memory/tree/tree_runtime/schemas.rs
@@ -5,8 +5,8 @@ use serde_json::{Map, Value};
use crate::config::rpc as config_rpc;
use crate::core::all::{ControllerFuture, RegisteredController};
-use crate::core::{ControllerSchema, FieldSchema, TypeSchema};
use crate::core::Outcome;
+use crate::core::{ControllerSchema, FieldSchema, TypeSchema};
pub fn all_controller_schemas() -> Vec<ControllerSchema> {
vec![
diff --git a/crates/openhuman-core/src/platform/about_app/schemas.rs b/crates/openhuman-core/src/platform/about_app/schemas.rs
index 854bcfc429..a3bc900942 100644
--- a/crates/openhuman-core/src/platform/about_app/schemas.rs
+++ b/crates/openhuman-core/src/platform/about_app/schemas.rs
@@ -5,9 +5,9 @@ use serde::Deserialize;
use serde_json::{Map, Value};
use crate::core::all::{ControllerFuture, RegisteredController};
+use crate::core::Outcome;
use crate::core::{ControllerSchema, FieldSchema, TypeSchema};
use crate::platform::about_app::CapabilityCategory;
-use crate::core::Outcome;
#[derive(Debug, Deserialize, Default)]
struct AboutAppListParams {
diff --git a/crates/openhuman-core/src/platform/connectivity/rpc.rs b/crates/openhuman-core/src/platform/connectivity/rpc.rs
index 4cfa559d9a..12cf2c82ad 100644
--- a/crates/openhuman-core/src/platform/connectivity/rpc.rs
+++ b/crates/openhuman-core/src/platform/connectivity/rpc.rs
@@ -13,8 +13,8 @@ use tokio::net::TcpListener;
use tokio::time::{sleep, Duration};
use tracing::{debug, warn};
-use crate::platform::socket::manager::global_socket_manager;
use crate::core::Outcome;
+use crate::platform::socket::manager::global_socket_manager;
use super::ops::is_port_in_use;
diff --git a/crates/openhuman-core/src/platform/cost/schemas.rs b/crates/openhuman-core/src/platform/cost/schemas.rs
index 58a7f6ed4d..f5eb667eda 100644
--- a/crates/openhuman-core/src/platform/cost/schemas.rs
+++ b/crates/openhuman-core/src/platform/cost/schemas.rs
@@ -5,8 +5,8 @@ use serde_json::{Map, Value};
use crate::config::rpc as config_rpc;
use crate::core::all::{ControllerFuture, RegisteredController};
-use crate::core::{ControllerSchema, FieldSchema, TypeSchema};
use crate::core::Outcome;
+use crate::core::{ControllerSchema, FieldSchema, TypeSchema};
use super::rpc as cost_rpc;
diff --git a/crates/openhuman-core/src/platform/doctor/ops.rs b/crates/openhuman-core/src/platform/doctor/ops.rs
index 2e855aaa2b..5c4f2ff2eb 100644
--- a/crates/openhuman-core/src/platform/doctor/ops.rs
+++ b/crates/openhuman-core/src/platform/doctor/ops.rs
@@ -5,8 +5,8 @@
//! is resolved here and passed down as a value.
use crate::config::Config;
-use crate::platform::doctor::{self, DoctorReport, MemoryChunkCount, ModelProbeReport};
use crate::core::Outcome;
+use crate::platform::doctor::{self, DoctorReport, MemoryChunkCount, ModelProbeReport};
pub async fn doctor_report(config: &Config) -> Result<Outcome<DoctorReport>, String> {
// Awaited before the blocking hop, not inside it: `doctor::run` may not
diff --git a/crates/openhuman-core/src/platform/doctor/schemas.rs b/crates/openhuman-core/src/platform/doctor/schemas.rs
index 923b9af225..1ed670c7a8 100644
--- a/crates/openhuman-core/src/platform/doctor/schemas.rs
+++ b/crates/openhuman-core/src/platform/doctor/schemas.rs
@@ -3,8 +3,8 @@ use serde_json::{Map, Value};
use crate::config::rpc as config_rpc;
use crate::core::all::{ControllerFuture, RegisteredController};
-use crate::core::{ControllerSchema, FieldSchema, TypeSchema};
use crate::core::Outcome;
+use crate::core::{ControllerSchema, FieldSchema, TypeSchema};
pub fn all_controller_schemas() -> Vec<ControllerSchema> {
vec![schemas("report"), schemas("models")]
diff --git a/crates/openhuman-core/src/platform/health/ops.rs b/crates/openhuman-core/src/platform/health/ops.rs
index 192de461b0..5699373896 100644
--- a/crates/openhuman-core/src/platform/health/ops.rs
+++ b/crates/openhuman-core/src/platform/health/ops.rs
@@ -2,8 +2,8 @@
use serde::Serialize;
-use crate::platform::health;
use crate::core::Outcome;
+use crate::platform::health;
pub fn health_snapshot() -> Outcome<serde_json::Value> {
Outcome::single_log(health::snapshot_json(), "health_snapshot requested")
diff --git a/crates/openhuman-core/src/platform/health/schemas.rs b/crates/openhuman-core/src/platform/health/schemas.rs
index 93a1388924..0ad0f50d87 100644
--- a/crates/openhuman-core/src/platform/health/schemas.rs
+++ b/crates/openhuman-core/src/platform/health/schemas.rs
@@ -1,8 +1,8 @@
use serde_json::{Map, Value};
use crate::core::all::{ControllerFuture, RegisteredController};
-use crate::core::{ControllerSchema, FieldSchema, TypeSchema};
use crate::core::Outcome;
+use crate::core::{ControllerSchema, FieldSchema, TypeSchema};
pub fn all_controller_schemas() -> Vec<ControllerSchema> {
vec![schemas("snapshot"), schemas("system_info")]
diff --git a/crates/openhuman-core/src/platform/service/ops.rs b/crates/openhuman-core/src/platform/service/ops.rs
index d66068ddf5..c00eeb24df 100644
--- a/crates/openhuman-core/src/platform/service/ops.rs
+++ b/crates/openhuman-core/src/platform/service/ops.rs
@@ -1,9 +1,9 @@
//! JSON-RPC / CLI controller surface for platform service install/lifecycle.
use crate::config::Config;
+use crate::core::Outcome;
use crate::platform::service::daemon_host::DaemonHostConfig;
use crate::platform::service::{self, daemon_host, ServiceStatus};
-use crate::core::Outcome;
/// Installs the OpenHuman daemon as a system service.
pub async fn service_install(config: &Config) -> Result<Outcome<ServiceStatus>, String> {
@@ -48,10 +48,7 @@ pub async fn service_shutdown(
/// Uninstalls the OpenHuman daemon system service.
pub async fn service_uninstall(config: &Config) -> Result<Outcome<ServiceStatus>, String> {
let status = service::uninstall(config).map_err(|e| e.to_string())?;
- Ok(Outcome::single_log(
- status,
- "service uninstall completed",
- ))
+ Ok(Outcome::single_log(status, "service uninstall completed"))
}
/// Reads the daemon host UI preferences from the configuration directory.
diff --git a/crates/openhuman-core/src/platform/service/schemas.rs b/crates/openhuman-core/src/platform/service/schemas.rs
index 7776b9fc06..8f725370c1 100644
--- a/crates/openhuman-core/src/platform/service/schemas.rs
+++ b/crates/openhuman-core/src/platform/service/schemas.rs
@@ -9,8 +9,8 @@ use serde_json::{Map, Value};
use crate::config::rpc as config_rpc;
use crate::core::all::{ControllerFuture, RegisteredController};
-use crate::core::{ControllerSchema, FieldSchema, TypeSchema};
use crate::core::Outcome;
+use crate::core::{ControllerSchema, FieldSchema, TypeSchema};
/// Returns a collection of all available controller schemas for the service domain.
///
diff --git a/crates/openhuman-core/src/platform/update/ops.rs b/crates/openhuman-core/src/platform/update/ops.rs
index ba5d35e62f..be02910376 100644
--- a/crates/openhuman-core/src/platform/update/ops.rs
+++ b/crates/openhuman-core/src/platform/update/ops.rs
@@ -5,9 +5,9 @@ use std::path::PathBuf;
use serde_json::Value;
use crate::config::{self, UpdateConfig, UpdateRestartStrategy};
+use crate::core::Outcome;
use crate::platform::update;
use crate::platform::update::types::{UpdateApplyResult, UpdateInfo, UpdateRunResult, VersionInfo};
-use crate::core::Outcome;
async fn load_update_policy() -> Result<UpdateConfig, String> {
config::rpc::load_config_with_timeout()
diff --git a/crates/openhuman-core/src/platform/update/schemas.rs b/crates/openhuman-core/src/platform/update/schemas.rs
index 2da160de31..5f6d5bce10 100644
--- a/crates/openhuman-core/src/platform/update/schemas.rs
+++ b/crates/openhuman-core/src/platform/update/schemas.rs
@@ -1,8 +1,8 @@
use serde_json::{Map, Value};
use crate::core::all::{ControllerFuture, RegisteredController};
-use crate::core::{ControllerSchema, FieldSchema, TypeSchema};
use crate::core::Outcome;
+use crate::core::{ControllerSchema, FieldSchema, TypeSchema};
pub fn all_controller_schemas() -> Vec<ControllerSchema> {
vec![
diff --git a/crates/openhuman-core/src/sandbox/schemas.rs b/crates/openhuman-core/src/sandbox/schemas.rs
index 94270f7c7a..39ba5bc8e4 100644
--- a/crates/openhuman-core/src/sandbox/schemas.rs
+++ b/crates/openhuman-core/src/sandbox/schemas.rs
@@ -4,8 +4,8 @@ use serde_json::{Map, Value};
use crate::config::rpc as config_rpc;
use crate::core::all::{ControllerFuture, RegisteredController};
-use crate::core::{ControllerSchema, FieldSchema, TypeSchema};
use crate::core::Outcome;
+use crate::core::{ControllerSchema, FieldSchema, TypeSchema};
pub fn all_controller_schemas() -> Vec<ControllerSchema> {
vec![
diff --git a/crates/openhuman-core/src/security/approval/schemas.rs b/crates/openhuman-core/src/security/approval/schemas.rs
index 5a9176ba7e..d300611c03 100644
--- a/crates/openhuman-core/src/security/approval/schemas.rs
+++ b/crates/openhuman-core/src/security/approval/schemas.rs
@@ -6,8 +6,8 @@
use serde_json::{Map, Value};
use crate::core::all::{ControllerFuture, RegisteredController};
-use crate::core::{ControllerSchema, FieldSchema, TypeSchema};
use crate::core::Outcome;
+use crate::core::{ControllerSchema, FieldSchema, TypeSchema};
use super::rpc as approval_rpc;
use super::types::ApprovalDecision;
diff --git a/crates/openhuman-core/src/security/credentials/ops/composio.rs b/crates/openhuman-core/src/security/credentials/ops/composio.rs
index a7b2441077..5be21bc2cd 100644
--- a/crates/openhuman-core/src/security/credentials/ops/composio.rs
+++ b/crates/openhuman-core/src/security/credentials/ops/composio.rs
@@ -76,9 +76,7 @@ pub async fn rpc_store_composio_api_key(
/// Remove the stored Composio direct-mode API key. Used when the user
/// switches back to backend mode and explicitly clears their key.
-pub async fn clear_composio_api_key(
- config: &Config,
-) -> Result<Outcome<serde_json::Value>, String> {
+pub async fn clear_composio_api_key(config: &Config) -> Result<Outcome<serde_json::Value>, String> {
tracing::debug!("[composio-direct] clearing stored api key");
let auth = AuthService::from_config(config);
let removed = auth
diff --git a/crates/openhuman-core/src/security/credentials/ops/login_tokens.rs b/crates/openhuman-core/src/security/credentials/ops/login_tokens.rs
index 193b3d10a0..4da6e95665 100644
--- a/crates/openhuman-core/src/security/credentials/ops/login_tokens.rs
+++ b/crates/openhuman-core/src/security/credentials/ops/login_tokens.rs
@@ -29,8 +29,5 @@ pub async fn auth_create_channel_link_token(
// keep their full anyhow chain.
.map_err(crate::api::flatten_authed_error)?;
- Ok(Outcome::single_log(
- payload,
- "channel link token created",
- ))
+ Ok(Outcome::single_log(payload, "channel link token created"))
}
diff --git a/crates/openhuman-core/src/security/credentials/ops/secrets.rs b/crates/openhuman-core/src/security/credentials/ops/secrets.rs
index 002a27d94e..126355cbbe 100644
--- a/crates/openhuman-core/src/security/credentials/ops/secrets.rs
+++ b/crates/openhuman-core/src/security/credentials/ops/secrets.rs
@@ -12,19 +12,13 @@ pub(crate) fn secret_store_for_config(config: &Config) -> SecretStore {
SecretStore::new(&data_dir, true)
}
-pub async fn encrypt_secret(
- config: &Config,
- plaintext: &str,
-) -> Result<Outcome<String>, String> {
+pub async fn encrypt_secret(config: &Config, plaintext: &str) -> Result<Outcome<String>, String> {
let store = secret_store_for_config(config);
let ciphertext = store.encrypt(plaintext).map_err(|e| e.to_string())?;
Ok(Outcome::single_log(ciphertext, "secret encrypted"))
}
-pub async fn decrypt_secret(
- config: &Config,
- ciphertext: &str,
-) -> Result<Outcome<String>, String> {
+pub async fn decrypt_secret(config: &Config, ciphertext: &str) -> Result<Outcome<String>, String> {
let store = secret_store_for_config(config);
let plaintext = store.decrypt(ciphertext).map_err(|e| e.to_string())?;
Ok(Outcome::single_log(plaintext, "secret decrypted"))
diff --git a/crates/openhuman-core/src/security/credentials/schemas.rs b/crates/openhuman-core/src/security/credentials/schemas.rs
index 135a0e4390..7d291289a4 100644
--- a/crates/openhuman-core/src/security/credentials/schemas.rs
+++ b/crates/openhuman-core/src/security/credentials/schemas.rs
@@ -4,8 +4,8 @@ use serde_json::{Map, Value};
use crate::config::rpc as config_rpc;
use crate::core::all::{ControllerFuture, RegisteredController};
-use crate::core::{ControllerSchema, FieldSchema, TypeSchema};
use crate::core::Outcome;
+use crate::core::{ControllerSchema, FieldSchema, TypeSchema};
#[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")]
diff --git a/crates/openhuman-core/src/security/devices/schemas.rs b/crates/openhuman-core/src/security/devices/schemas.rs
index d03b799667..a8d1c17981 100644
--- a/crates/openhuman-core/src/security/devices/schemas.rs
+++ b/crates/openhuman-core/src/security/devices/schemas.rs
@@ -7,8 +7,8 @@ use serde_json::{Map, Value};
use crate::config::rpc as config_rpc;
use crate::core::all::{ControllerFuture, RegisteredController};
-use crate::core::{ControllerSchema, FieldSchema, TypeSchema};
use crate::core::Outcome;
+use crate::core::{ControllerSchema, FieldSchema, TypeSchema};
// ---------------------------------------------------------------------------
// Public registry functions
diff --git a/crates/openhuman-core/src/security/encryption/ops.rs b/crates/openhuman-core/src/security/encryption/ops.rs
index ca8b77ca27..28d450b8dd 100644
--- a/crates/openhuman-core/src/security/encryption/ops.rs
+++ b/crates/openhuman-core/src/security/encryption/ops.rs
@@ -3,16 +3,10 @@
use crate::config::Config;
use crate::core::Outcome;
-pub async fn encrypt_secret(
- config: &Config,
- plaintext: &str,
-) -> Result<Outcome<String>, String> {
+pub async fn encrypt_secret(config: &Config, plaintext: &str) -> Result<Outcome<String>, String> {
crate::security::credentials::rpc::encrypt_secret(config, plaintext).await
}
-pub async fn decrypt_secret(
- config: &Config,
- ciphertext: &str,
-) -> Result<Outcome<String>, String> {
+pub async fn decrypt_secret(config: &Config, ciphertext: &str) -> Result<Outcome<String>, String> {
crate::security::credentials::rpc::decrypt_secret(config, ciphertext).await
}
diff --git a/crates/openhuman-core/src/security/encryption/schemas.rs b/crates/openhuman-core/src/security/encryption/schemas.rs
index 639dce8450..23c3dac89c 100644
--- a/crates/openhuman-core/src/security/encryption/schemas.rs
+++ b/crates/openhuman-core/src/security/encryption/schemas.rs
@@ -3,8 +3,8 @@ use serde_json::{Map, Value};
use crate::config::rpc as config_rpc;
use crate::core::all::{ControllerFuture, RegisteredController};
-use crate::core::{ControllerSchema, FieldSchema, TypeSchema};
use crate::core::Outcome;
+use crate::core::{ControllerSchema, FieldSchema, TypeSchema};
pub fn all_controller_schemas() -> Vec<ControllerSchema> {
vec![schemas("encrypt_secret"), schemas("decrypt_secret")]
diff --git a/crates/openhuman-core/src/security/schemas.rs b/crates/openhuman-core/src/security/schemas.rs
index 815b3484da..461f1c17e0 100644
--- a/crates/openhuman-core/src/security/schemas.rs
+++ b/crates/openhuman-core/src/security/schemas.rs
@@ -1,8 +1,8 @@
use serde_json::{Map, Value};
use crate::core::all::{ControllerFuture, RegisteredController};
-use crate::core::{ControllerSchema, FieldSchema, TypeSchema};
use crate::core::Outcome;
+use crate::core::{ControllerSchema, FieldSchema, TypeSchema};
pub fn all_controller_schemas() -> Vec<ControllerSchema> {
vec![schemas("policy_info")]
diff --git a/crates/openhuman-core/src/skills/runtime/schemas.rs b/crates/openhuman-core/src/skills/runtime/schemas.rs
index b8908e010d..749dd3a9a0 100644
--- a/crates/openhuman-core/src/skills/runtime/schemas.rs
+++ b/crates/openhuman-core/src/skills/runtime/schemas.rs
@@ -9,8 +9,8 @@ use serde::Deserialize;
use serde_json::{Map, Value};
use crate::core::all::{ControllerFuture, RegisteredController};
-use crate::core::{ControllerSchema, FieldSchema, TypeSchema};
use crate::core::Outcome;
+use crate::core::{ControllerSchema, FieldSchema, TypeSchema};
use crate::skills::run_log;
use crate::skills::schemas::resolve_workspace_dir;
diff --git a/crates/openhuman-core/src/skills/schemas/handlers.rs b/crates/openhuman-core/src/skills/schemas/handlers.rs
index dacb37bb57..a7a13ce5e3 100644
--- a/crates/openhuman-core/src/skills/schemas/handlers.rs
+++ b/crates/openhuman-core/src/skills/schemas/handlers.rs
@@ -144,10 +144,7 @@ pub(super) fn handle_skills_recent_runs(params: Map<String, Value>) -> Controlle
limit,
"[skills][rpc] recent_runs"
);
- to_json(Outcome::new(
- WorkflowsRecentRunsResult { runs },
- Vec::new(),
- ))
+ to_json(Outcome::new(WorkflowsRecentRunsResult { runs }, Vec::new()))
})
}
diff --git a/crates/openhuman-core/src/skills/webhooks/ops.rs b/crates/openhuman-core/src/skills/webhooks/ops.rs
index 6e8086ca94..93923141a2 100644
--- a/crates/openhuman-core/src/skills/webhooks/ops.rs
+++ b/crates/openhuman-core/src/skills/webhooks/ops.rs
@@ -72,9 +72,7 @@ pub async fn list_registrations() -> Result<Outcome<WebhookDebugRegistrationsRes
}
}
-pub async fn list_logs(
- limit: Option<usize>,
-) -> Result<Outcome<WebhookDebugLogListResult>, String> {
+pub async fn list_logs(limit: Option<usize>) -> Result<Outcome<WebhookDebugLogListResult>, String> {
match get_router() {
Ok(router) => {
let logs = router.list_logs(limit);
diff --git a/crates/openhuman-core/src/skills/webhooks/schemas.rs b/crates/openhuman-core/src/skills/webhooks/schemas.rs
index a6cbaa38ab..1006656e3d 100644
--- a/crates/openhuman-core/src/skills/webhooks/schemas.rs
+++ b/crates/openhuman-core/src/skills/webhooks/schemas.rs
@@ -3,8 +3,8 @@ use serde::Deserialize;
use serde_json::{Map, Value};
use crate::core::all::{ControllerFuture, RegisteredController};
-use crate::core::{ControllerSchema, FieldSchema, TypeSchema};
use crate::core::Outcome;
+use crate::core::{ControllerSchema, FieldSchema, TypeSchema};
#[derive(Debug, Deserialize)]
struct WebhookListLogsParams {
diff --git a/crates/openhuman-core/src/test_support/rpc.rs b/crates/openhuman-core/src/test_support/rpc.rs
index bd7c8af31f..b343fae01f 100644
--- a/crates/openhuman-core/src/test_support/rpc.rs
+++ b/crates/openhuman-core/src/test_support/rpc.rs
@@ -14,9 +14,9 @@ use serde_json::json;
use crate::config::Config;
use crate::config::{clear_active_user, default_root_openhuman_dir};
+use crate::core::Outcome;
use crate::cron;
use crate::memory::read_rpc;
-use crate::core::Outcome;
const E2E_MODE_ENV_VAR: &str = "OPENHUMAN_E2E_MODE";
diff --git a/crates/openhuman-core/src/test_support/schemas.rs b/crates/openhuman-core/src/test_support/schemas.rs
index 1045751e8e..44af17c255 100644
--- a/crates/openhuman-core/src/test_support/schemas.rs
+++ b/crates/openhuman-core/src/test_support/schemas.rs
@@ -1,8 +1,8 @@
use serde_json::{Map, Value};
use crate::core::all::{ControllerFuture, RegisteredController};
-use crate::core::{ControllerSchema, FieldSchema, TypeSchema};
use crate::core::Outcome;
+use crate::core::{ControllerSchema, FieldSchema, TypeSchema};
use crate::test_support::{introspect, rpc};
pub fn all_controller_schemas() -> Vec<ControllerSchema> {
diff --git a/crates/openhuman-core/src/threads/ops/crud.rs b/crates/openhuman-core/src/threads/ops/crud.rs
index 5845825e03..3591a3292c 100644
--- a/crates/openhuman-core/src/threads/ops/crud.rs
+++ b/crates/openhuman-core/src/threads/ops/crud.rs
@@ -5,6 +5,7 @@ use super::support::{
counts, envelope, message_to_record, record_to_message, run_to_completion, thread_to_summary,
workspace_dir,
};
+use crate::core::Outcome;
use crate::memory::conversations;
use crate::memory::conversations::{ConversationMessagePatch, CrossThreadHit};
use crate::memory::{
@@ -15,7 +16,6 @@ use crate::memory::{
UpdateConversationMessageRequest, UpdateConversationThreadLabelsRequest,
UpdateConversationThreadTitleRequest, UpsertConversationThreadRequest,
};
-use crate::core::Outcome;
use crate::threads::turn_state;
use crate::threads::ThreadsError;
use crate::web_chat as web_channel;
diff --git a/crates/openhuman-core/src/threads/ops/edit.rs b/crates/openhuman-core/src/threads/ops/edit.rs
index db133d21a2..4b3c0e5c28 100644
--- a/crates/openhuman-core/src/threads/ops/edit.rs
+++ b/crates/openhuman-core/src/threads/ops/edit.rs
@@ -46,8 +46,8 @@ use tinyagents_session::transcript::{
TranscriptMeta, TruncateCut,
};
-use crate::memory::conversations::{self, reply_run_id, run_reply_message_id};
use crate::core::Outcome;
+use crate::memory::conversations::{self, reply_run_id, run_reply_message_id};
use crate::threads::ThreadsError;
use super::support::workspace_dir;
diff --git a/crates/openhuman-core/src/threads/ops/live_state.rs b/crates/openhuman-core/src/threads/ops/live_state.rs
index 6c61e6a783..c23b779b48 100644
--- a/crates/openhuman-core/src/threads/ops/live_state.rs
+++ b/crates/openhuman-core/src/threads/ops/live_state.rs
@@ -9,8 +9,8 @@
use super::support::{envelope, workspace_dir};
use crate::agent::goals::goal_to_value;
use crate::agent::todos::ops::{self as todos_ops, TodoScope};
-use crate::memory::ApiEnvelope;
use crate::core::Outcome;
+use crate::memory::ApiEnvelope;
/// Request for [`goal_get`] / [`todos_get`]: the thread to read.
#[derive(Debug, Clone, serde::Deserialize)]
diff --git a/crates/openhuman-core/src/threads/ops/purge.rs b/crates/openhuman-core/src/threads/ops/purge.rs
index ef33320153..fd9e4736e5 100644
--- a/crates/openhuman-core/src/threads/ops/purge.rs
+++ b/crates/openhuman-core/src/threads/ops/purge.rs
@@ -1,9 +1,9 @@
//! Workspace-wide conversation purge.
use super::support::{envelope, run_to_completion, workspace_dir};
+use crate::core::Outcome;
use crate::memory::conversations;
use crate::memory::{ApiEnvelope, EmptyRequest, PurgeConversationThreadsResponse};
-use crate::core::Outcome;
use crate::threads::turn_state;
use std::path::PathBuf;
diff --git a/crates/openhuman-core/src/threads/ops/support.rs b/crates/openhuman-core/src/threads/ops/support.rs
index 522c2119cc..c7334c4059 100644
--- a/crates/openhuman-core/src/threads/ops/support.rs
+++ b/crates/openhuman-core/src/threads/ops/support.rs
@@ -4,12 +4,12 @@
use crate::config::Config;
use crate::core::runtime::context::CoreContext;
+use crate::core::Outcome;
use crate::memory::conversations;
use crate::memory::conversations::{ConversationMessage, ConversationThread};
use crate::memory::{
ApiEnvelope, ApiMeta, ConversationMessageRecord, ConversationThreadSummary, PaginationMeta,
};
-use crate::core::Outcome;
use crate::threads::title::{
title_from_user_message, title_log_fingerprint, THREAD_TITLE_LOG_PREFIX,
};
diff --git a/crates/openhuman-core/src/threads/ops/title_generation.rs b/crates/openhuman-core/src/threads/ops/title_generation.rs
index 7e28199950..3394a529d2 100644
--- a/crates/openhuman-core/src/threads/ops/title_generation.rs
+++ b/crates/openhuman-core/src/threads/ops/title_generation.rs
@@ -3,12 +3,12 @@
use super::support::{counts, envelope, thread_to_summary, update_thread_with_fallback_title};
use crate::config::Config;
+use crate::core::Outcome;
use crate::inference::provider;
use crate::memory::conversations;
use crate::memory::{
ApiEnvelope, ConversationThreadSummary, GenerateConversationThreadTitleRequest,
};
-use crate::core::Outcome;
use crate::threads::title::{
build_title_request, is_auto_generated_thread_title, sanitize_generated_title,
title_log_fingerprint, THREAD_TITLE_LOG_PREFIX,
diff --git a/crates/openhuman-core/src/threads/ops/transcript.rs b/crates/openhuman-core/src/threads/ops/transcript.rs
index 3c7f563704..4f7cd82abd 100644
--- a/crates/openhuman-core/src/threads/ops/transcript.rs
+++ b/crates/openhuman-core/src/threads/ops/transcript.rs
@@ -1,8 +1,8 @@
//! Paginated projection of a thread's settled transcript.
use super::support::{counts, envelope, workspace_dir};
-use crate::memory::{ApiEnvelope, PaginationMeta};
use crate::core::Outcome;
+use crate::memory::{ApiEnvelope, PaginationMeta};
/// Request for [`transcript_get`]: the thread to project, plus newest-first
/// pagination controls. `cursor` is the opaque token from a prior page's
diff --git a/crates/openhuman-core/src/threads/ops/turn_state_ops.rs b/crates/openhuman-core/src/threads/ops/turn_state_ops.rs
index 2a31ba6626..56e9f46dc4 100644
--- a/crates/openhuman-core/src/threads/ops/turn_state_ops.rs
+++ b/crates/openhuman-core/src/threads/ops/turn_state_ops.rs
@@ -1,8 +1,8 @@
//! RPC accessors over persisted in-flight turn snapshots.
use super::support::{counts, envelope, workspace_dir};
-use crate::memory::{ApiEnvelope, EmptyRequest};
use crate::core::Outcome;
+use crate::memory::{ApiEnvelope, EmptyRequest};
use crate::threads::turn_state::{
self, ClearTurnStateRequest, ClearTurnStateResponse, GetTurnStateForRequestRequest,
GetTurnStateRequest, GetTurnStateResponse, ListTurnStatesResponse,
diff --git a/crates/openhuman-core/src/threads/ops/usage.rs b/crates/openhuman-core/src/threads/ops/usage.rs
index a0962d1c9e..0a8f2a5ba2 100644
--- a/crates/openhuman-core/src/threads/ops/usage.rs
+++ b/crates/openhuman-core/src/threads/ops/usage.rs
@@ -1,8 +1,8 @@
//! Aggregated token/cost usage for a thread, re-audited at current pricing.
use super::support::{counts, envelope, workspace_dir};
-use crate::memory::ApiEnvelope;
use crate::core::Outcome;
+use crate::memory::ApiEnvelope;
use std::collections::BTreeMap;
use std::path::Path;
use tinyagents_session::transcript::{
diff --git a/crates/openhuman-core/src/tools/registry/ops.rs b/crates/openhuman-core/src/tools/registry/ops.rs
index 7eb3a8bf2e..c138d68a39 100644
--- a/crates/openhuman-core/src/tools/registry/ops.rs
+++ b/crates/openhuman-core/src/tools/registry/ops.rs
@@ -4,10 +4,10 @@ use serde_json::{json, Map, Value};
use crate::config::Config;
use crate::core::all;
+use crate::core::Outcome;
use crate::core::{ControllerSchema, FieldSchema, TypeSchema};
use crate::mcp::audit::McpWriteListQuery;
use crate::mcp::server::McpToolSpec;
-use crate::core::Outcome;
use super::providers::capability_provider_diagnostics;
use super::types::{
diff --git a/crates/openhuman-core/src/tools/registry/schemas.rs b/crates/openhuman-core/src/tools/registry/schemas.rs
index a1d2030894..4051f10732 100644
--- a/crates/openhuman-core/src/tools/registry/schemas.rs
+++ b/crates/openhuman-core/src/tools/registry/schemas.rs
@@ -1,8 +1,8 @@
use serde_json::{Map, Value};
use crate::core::all::{ControllerFuture, RegisteredController};
-use crate::core::{ControllerSchema, FieldSchema, TypeSchema};
use crate::core::Outcome;
+use crate::core::{ControllerSchema, FieldSchema, TypeSchema};
/// Declared controller schemas for the `tool_registry` namespace.
pub fn all_controller_schemas() -> Vec<ControllerSchema> {
diff --git a/crates/openhuman-core/src/voice/audio_toolkit/schemas.rs b/crates/openhuman-core/src/voice/audio_toolkit/schemas.rs
index d39463436a..6432b755f2 100644
--- a/crates/openhuman-core/src/voice/audio_toolkit/schemas.rs
+++ b/crates/openhuman-core/src/voice/audio_toolkit/schemas.rs
@@ -3,8 +3,8 @@ use serde_json::{Map, Value};
use crate::config::rpc as config_rpc;
use crate::core::all::{ControllerFuture, RegisteredController};
-use crate::core::{ControllerSchema, FieldSchema, TypeSchema};
use crate::core::Outcome;
+use crate::core::{ControllerSchema, FieldSchema, TypeSchema};
use crate::voice::audio_toolkit::types::{AudioFormat, AudioGenerateRequest, EmailPodcastRequest};
#[derive(Debug, Deserialize)]
diff --git a/crates/openhuman-core/src/voice/ops.rs b/crates/openhuman-core/src/voice/ops.rs
index 51f298d915..506ac35e65 100644
--- a/crates/openhuman-core/src/voice/ops.rs
+++ b/crates/openhuman-core/src/voice/ops.rs
@@ -8,8 +8,8 @@ use log::{debug, warn};
use std::time::Instant;
use crate::config::Config;
-use crate::inference::host_runtime as local_ai;
use crate::core::Outcome;
+use crate::inference::host_runtime as local_ai;
use tinyinference_local::models as model_ids;
use super::factory::{create_stt_provider, effective_stt_provider};
diff --git a/crates/openhuman-core/src/voice/schemas/helpers.rs b/crates/openhuman-core/src/voice/schemas/helpers.rs
index 7a29d8c845..5fd56e4721 100644
--- a/crates/openhuman-core/src/voice/schemas/helpers.rs
+++ b/crates/openhuman-core/src/voice/schemas/helpers.rs
@@ -3,8 +3,8 @@
use serde::de::DeserializeOwned;
use serde_json::{Map, Value};
-use crate::core::{FieldSchema, TypeSchema};
use crate::core::Outcome;
+use crate::core::{FieldSchema, TypeSchema};
pub(super) fn to_json<T: serde::Serialize>(outcome: Outcome<T>) -> Result<Value, String> {
let json_val =
diff --git a/crates/openhuman-core/src/web3/mod.rs b/crates/openhuman-core/src/web3/mod.rs
index f08080c440..d16242c957 100644
--- a/crates/openhuman-core/src/web3/mod.rs
+++ b/crates/openhuman-core/src/web3/mod.rs
@@ -54,10 +54,10 @@ use serde::Serialize;
#[cfg(feature = "web3")]
use crate::core::all::RegisteredController;
#[cfg(feature = "web3")]
-use crate::core::{ControllerSchema, FieldSchema, TypeSchema};
-#[cfg(feature = "web3")]
use crate::core::Outcome;
#[cfg(feature = "web3")]
+use crate::core::{ControllerSchema, FieldSchema, TypeSchema};
+#[cfg(feature = "web3")]
use tinytools::{Tool, ToolResult};
// ---------------------------------------------------------------------------
diff --git a/crates/openhuman-core/src/web3/wallet/execution/tx_lookup.rs b/crates/openhuman-core/src/web3/wallet/execution/tx_lookup.rs
index 9b7562f400..a3cdf3e2c4 100644
--- a/crates/openhuman-core/src/web3/wallet/execution/tx_lookup.rs
+++ b/crates/openhuman-core/src/web3/wallet/execution/tx_lookup.rs
@@ -107,8 +107,5 @@ pub async fn lookup_tx(
hash,
info.found
);
- Ok(Outcome::new(
- info,
- vec!["wallet tx looked up".to_string()],
- ))
+ Ok(Outcome::new(info, vec!["wallet tx looked up".to_string()]))
}
diff --git a/crates/openhuman-core/src/web3/wallet/ops.rs b/crates/openhuman-core/src/web3/wallet/ops.rs
index 3bff63913a..18adadf11d 100644
--- a/crates/openhuman-core/src/web3/wallet/ops.rs
+++ b/crates/openhuman-core/src/web3/wallet/ops.rs
@@ -154,10 +154,7 @@ pub async fn setup(params: WalletSetupParams) -> Result<Outcome<WalletStatus>, S
status.secret_stored
);
- Ok(Outcome::new(
- status,
- vec!["wallet setup saved".to_string()],
- ))
+ Ok(Outcome::new(status, vec!["wallet setup saved".to_string()]))
}
/// Decrypt and return the stored recovery phrase for the current wallet.
diff --git a/crates/openhuman-core/src/web_chat/mod.rs b/crates/openhuman-core/src/web_chat/mod.rs
index 37865e04df..c683b4444a 100644
--- a/crates/openhuman-core/src/web_chat/mod.rs
+++ b/crates/openhuman-core/src/web_chat/mod.rs
@@ -53,8 +53,10 @@ pub(crate) use web_errors::{
};
// Public API — event bus
-pub use progress_bridge::unix_epoch_ms;
-pub use channel_event::{ChatSuggestion, GuardrailPayload, GuardrailReason, QueueItemPayload, SubagentProgressDetail, SubagentUsagePayload, TurnTimingPayload, TurnUsagePayload, WebChannelEvent};
+pub use channel_event::{
+ ChatSuggestion, GuardrailPayload, GuardrailReason, QueueItemPayload, SubagentProgressDetail,
+ SubagentUsagePayload, TurnTimingPayload, TurnUsagePayload, WebChannelEvent,
+};
pub use egress_surface::register_egress_surface_subscriber;
pub use event_bus::{
approval_request_event, plan_review_request_event, publish_web_channel_event,
@@ -62,6 +64,7 @@ pub use event_bus::{
register_artifact_surface_subscriber, register_memory_activity_surface_subscriber,
subscribe_web_channel_events,
};
+pub use progress_bridge::unix_epoch_ms;
// Test-only: OnceLock-bypassing approval bridge for per-runtime integration tests.
// Compiled only in debug builds so it cannot be linked into a release binary.
diff --git a/crates/openhuman-core/src/web_chat/ops/channel_ops.rs b/crates/openhuman-core/src/web_chat/ops/channel_ops.rs
index 8a1865add3..dbc3b1d309 100644
--- a/crates/openhuman-core/src/web_chat/ops/channel_ops.rs
+++ b/crates/openhuman-core/src/web_chat/ops/channel_ops.rs
@@ -4,8 +4,8 @@
use serde_json::{json, Value};
-use crate::web_chat::WebChannelEvent;
use crate::core::Outcome;
+use crate::web_chat::WebChannelEvent;
use super::super::event_bus::publish_web_channel_event;
use super::super::types::ChatRequestMetadata;
diff --git a/crates/openhuman-core/src/web_chat/ops/start_chat.rs b/crates/openhuman-core/src/web_chat/ops/start_chat.rs
index eca608dea6..41cc9fb6cb 100644
--- a/crates/openhuman-core/src/web_chat/ops/start_chat.rs
+++ b/crates/openhuman-core/src/web_chat/ops/start_chat.rs
@@ -10,10 +10,10 @@ use tokio_util::sync::CancellationToken;
use uuid::Uuid;
use crate::core::events::DomainEvent;
-use crate::web_chat::WebChannelEvent;
use crate::security::prompt_injection::{
enforce_prompt_input, PromptEnforcementAction, PromptEnforcementContext,
};
+use crate::web_chat::WebChannelEvent;
use super::super::event_bus::publish_web_channel_event;
use super::super::run_task::run_chat_task;
diff --git a/crates/openhuman-core/src/web_chat/progress_bridge.rs b/crates/openhuman-core/src/web_chat/progress_bridge.rs
index bc21018e65..0f3c50b136 100644
--- a/crates/openhuman-core/src/web_chat/progress_bridge.rs
+++ b/crates/openhuman-core/src/web_chat/progress_bridge.rs
@@ -5,8 +5,8 @@
use serde_json::json;
-use crate::web_chat::{SubagentProgressDetail, WebChannelEvent};
use crate::threads::turn_state::{TurnStateMirror, TurnStateStore};
+use crate::web_chat::{SubagentProgressDetail, WebChannelEvent};
use super::event_bus::publish_web_channel_event;
use super::types::ChatRequestMetadata;
diff --git a/crates/openhuman-core/src/web_chat/schemas.rs b/crates/openhuman-core/src/web_chat/schemas.rs
index efc5b5fc42..cfd1ce1f3f 100644
--- a/crates/openhuman-core/src/web_chat/schemas.rs
+++ b/crates/openhuman-core/src/web_chat/schemas.rs
@@ -5,8 +5,8 @@
use serde_json::{Map, Value};
use crate::core::all::{ControllerFuture, RegisteredController};
-use crate::core::{ControllerSchema, FieldSchema, TypeSchema};
use crate::core::Outcome;
+use crate::core::{ControllerSchema, FieldSchema, TypeSchema};
use super::ops::{
channel_web_cancel, channel_web_chat, channel_web_queue_clear, channel_web_queue_remove,
diff --git a/crates/openhuman-core/src/web_chat/suggestions.rs b/crates/openhuman-core/src/web_chat/suggestions.rs
index 0545600536..f77381d6f6 100644
--- a/crates/openhuman-core/src/web_chat/suggestions.rs
+++ b/crates/openhuman-core/src/web_chat/suggestions.rs
@@ -35,8 +35,8 @@ use tinyinference_llm::message::Message;
use tinyinference_llm::model::ModelRequest;
use crate::config::rpc as config_rpc;
-use crate::web_chat::{ChatSuggestion, WebChannelEvent};
use crate::inference::provider;
+use crate::web_chat::{ChatSuggestion, WebChannelEvent};
use super::publish_web_channel_event;
diff --git a/crates/openhuman-rpc/src/server/classify.rs b/crates/openhuman-rpc/src/server/classify.rs
index 766c5a8af1..983e078506 100644
--- a/crates/openhuman-rpc/src/server/classify.rs
+++ b/crates/openhuman-rpc/src/server/classify.rs
@@ -116,7 +116,9 @@ pub(super) fn classify_failure(message: &str, expected_user_state: bool) -> Fail
FailureDisposition::UsageProbeBackoff
} else if observability::is_transient_message_failure(message) {
FailureDisposition::TransientDownstream
- } else if let Some(unknown_method) = openhuman_core::core::dispatch::unknown_method_name(message) {
+ } else if let Some(unknown_method) =
+ openhuman_core::core::dispatch::unknown_method_name(message)
+ {
FailureDisposition::UnknownMethod {
probe: openhuman_core::core::dispatch::is_known_probe_method(unknown_method),
}
diff --git a/crates/openhuman-rpc/src/server/classify_tests.rs b/crates/openhuman-rpc/src/server/classify_tests.rs
index ea6b480fb2..c5d12eed3b 100644
--- a/crates/openhuman-rpc/src/server/classify_tests.rs
+++ b/crates/openhuman-rpc/src/server/classify_tests.rs
@@ -50,12 +50,19 @@ fn classify_failure_expected_user_state_flag_wins() {
#[test]
fn classify_failure_routes_each_boundary_class() {
assert_eq!(
- classify_failure(openhuman_core::web3::wallet::WALLET_NOT_CONFIGURED_MESSAGE, false),
+ classify_failure(
+ openhuman_core::web3::wallet::WALLET_NOT_CONFIGURED_MESSAGE,
+ false
+ ),
FailureDisposition::WalletNotConfigured
);
assert_eq!(
classify_failure(
- &openhuman_core::core::params::unknown_param_message("api_key", "config", "update_model_settings"),
+ &openhuman_core::core::params::unknown_param_message(
+ "api_key",
+ "config",
+ "update_model_settings"
+ ),
false
),
FailureDisposition::ParamValidation
@@ -87,7 +94,10 @@ fn classify_failure_param_validation_outranks_session_expiry() {
// could have expired anything.
assert_eq!(
classify_failure(
- &openhuman_core::core::params::missing_required_param_message("token", "Session expired token"),
+ &openhuman_core::core::params::missing_required_param_message(
+ "token",
+ "Session expired token"
+ ),
false
),
FailureDisposition::ParamValidation
diff --git a/crates/openhuman-rpc/src/server/http/events.rs b/crates/openhuman-rpc/src/server/http/events.rs
index 8d113e42dd..e4494da6fd 100644
--- a/crates/openhuman-rpc/src/server/http/events.rs
+++ b/crates/openhuman-rpc/src/server/http/events.rs
@@ -245,7 +245,9 @@ pub(super) async fn domain_events_handler(headers: axum::http::HeaderMap) -> Res
// publishes, so it should not want to. `None` means "not resolved
// since the last workspace marker write", which the client treats as
// unknown rather than as a mismatch.
- let workspace = event.workspace_dir().map(openhuman_core::config::workspace_handle);
+ let workspace = event
+ .workspace_dir()
+ .map(openhuman_core::config::workspace_handle);
let active = openhuman_core::config::active_workspace_dir_cached()
.map(|dir| openhuman_core::config::workspace_handle(&dir));
let data = json!({
diff --git a/crates/openhuman-rpc/src/server/http/inference_route_tests.rs b/crates/openhuman-rpc/src/server/http/inference_route_tests.rs
index 8aa2783442..8f1c44b06a 100644
--- a/crates/openhuman-rpc/src/server/http/inference_route_tests.rs
+++ b/crates/openhuman-rpc/src/server/http/inference_route_tests.rs
@@ -36,7 +36,8 @@ fn ensure_test_rpc_auth() -> String {
// binaries don't collide (they run in separate processes anyway).
unsafe { std::env::set_var(CORE_TOKEN_ENV_VAR, TEST_RPC_TOKEN) };
let tmp = tempfile::tempdir().expect("tempdir for token file");
- openhuman_core::core::auth::init_rpc_token(tmp.path()).expect("init rpc auth token for http tests");
+ openhuman_core::core::auth::init_rpc_token(tmp.path())
+ .expect("init rpc auth token for http tests");
});
openhuman_core::core::auth::get_rpc_token()
.expect("rpc bearer must be installed after ensure_test_rpc_auth")
diff --git a/crates/openhuman-rpc/src/server/http/mod.rs b/crates/openhuman-rpc/src/server/http/mod.rs
index 547371a565..00947a4090 100644
--- a/crates/openhuman-rpc/src/server/http/mod.rs
+++ b/crates/openhuman-rpc/src/server/http/mod.rs
@@ -84,7 +84,9 @@ pub fn build_core_http_router(socketio_enabled: bool) -> Router {
let router = router
.fallback(not_found_handler)
.layer(middleware::from_fn(http_request_log_middleware))
- .layer(middleware::from_fn(crate::server::auth::rpc_auth_middleware))
+ .layer(middleware::from_fn(
+ crate::server::auth::rpc_auth_middleware,
+ ))
.layer(middleware::from_fn(cors::cors_middleware));
if socketio_enabled {
diff --git a/crates/openhuman-rpc/src/server/http/rpc_handler_tests.rs b/crates/openhuman-rpc/src/server/http/rpc_handler_tests.rs
index 9e209d1c8e..d8a09c47f0 100644
--- a/crates/openhuman-rpc/src/server/http/rpc_handler_tests.rs
+++ b/crates/openhuman-rpc/src/server/http/rpc_handler_tests.rs
@@ -3,8 +3,8 @@ use serde_json::json;
use std::sync::Arc;
use super::rpc_handler;
-use openhuman_core::core::invoke::default_state;
use crate::server::testing::EnvVarGuard;
+use openhuman_core::core::invoke::default_state;
#[tokio::test(flavor = "current_thread")]
async fn structured_rpc_error_envelope_passes_through_generic_dispatch() {
@@ -80,7 +80,8 @@ async fn thread_not_found_rpc_error_does_not_report_to_sentry() {
// `report_error_message` are captured directly via
// `sentry::capture_message` and must not be picked up here too
// (otherwise this test sees double events).
- if metadata.target() == openhuman_core::core::observability::REPORT_ERROR_TRACING_TARGET {
+ if metadata.target() == openhuman_core::core::observability::REPORT_ERROR_TRACING_TARGET
+ {
return sentry::integrations::tracing::EventFilter::Ignore;
}
match *metadata.level() {
@@ -197,7 +198,8 @@ async fn unknown_method_severity_split_by_probe_allow_list() {
// Mirror production: diagnostics from the report_* helpers are
// captured directly via `sentry::capture_message`, so the bridge
// must ignore their marker target to avoid double events.
- if metadata.target() == openhuman_core::core::observability::REPORT_ERROR_TRACING_TARGET {
+ if metadata.target() == openhuman_core::core::observability::REPORT_ERROR_TRACING_TARGET
+ {
return sentry::integrations::tracing::EventFilter::Ignore;
}
match *metadata.level() {
@@ -306,7 +308,8 @@ async fn invalid_ingest_payload_is_captured_at_warn_not_error() {
let subscriber = tracing_subscriber::registry().with(
sentry::integrations::tracing::layer().event_filter(|metadata| {
- if metadata.target() == openhuman_core::core::observability::REPORT_ERROR_TRACING_TARGET {
+ if metadata.target() == openhuman_core::core::observability::REPORT_ERROR_TRACING_TARGET
+ {
return sentry::integrations::tracing::EventFilter::Ignore;
}
match *metadata.level() {
diff --git a/crates/openhuman-rpc/src/server/mod.rs b/crates/openhuman-rpc/src/server/mod.rs
index 75bf70dba4..0db23a41fa 100644
--- a/crates/openhuman-rpc/src/server/mod.rs
+++ b/crates/openhuman-rpc/src/server/mod.rs
@@ -29,5 +29,7 @@ mod testing;
pub use cli::install_cli_server;
pub use http::{build_core_http_router, rpc_handler};
pub use serve::{serve, EmbeddedReadySignal};
-pub use shims::{run_server, run_server_embedded, run_server_embedded_with_ready, run_server_headless};
+pub use shims::{
+ run_server, run_server_embedded, run_server_embedded_with_ready, run_server_headless,
+};
pub use socketio::publish_companion_state_changed;
diff --git a/crates/openhuman-rpc/src/server/serve.rs b/crates/openhuman-rpc/src/server/serve.rs
index dbd1114edd..2d1dd2fd19 100644
--- a/crates/openhuman-rpc/src/server/serve.rs
+++ b/crates/openhuman-rpc/src/server/serve.rs
@@ -35,165 +35,167 @@ pub async fn serve(
return Ok(());
}
- // --- Host / port resolution ---
- let (resolved_port, port_source) = match runtime.port() {
- Some(p) => (p, "builder port"),
- None => (
- super::shims::core_port(),
- if std::env::var("OPENHUMAN_CORE_PORT").is_ok() {
- "env OPENHUMAN_CORE_PORT"
- } else {
- "default"
- },
- ),
- };
- let (resolved_host, host_source) = match runtime.host() {
- Some(h) => (h.to_string(), "builder host"),
- None => (
- super::shims::core_host(),
- if std::env::var("OPENHUMAN_CORE_HOST")
- .ok()
- .filter(|s| !s.is_empty())
- .is_some()
- {
- "env OPENHUMAN_CORE_HOST"
- } else {
- "default"
- },
- ),
- };
-
- log::debug!(
+ // --- Host / port resolution ---
+ let (resolved_port, port_source) = match runtime.port() {
+ Some(p) => (p, "builder port"),
+ None => (
+ super::shims::core_port(),
+ if std::env::var("OPENHUMAN_CORE_PORT").is_ok() {
+ "env OPENHUMAN_CORE_PORT"
+ } else {
+ "default"
+ },
+ ),
+ };
+ let (resolved_host, host_source) = match runtime.host() {
+ Some(h) => (h.to_string(), "builder host"),
+ None => (
+ super::shims::core_host(),
+ if std::env::var("OPENHUMAN_CORE_HOST")
+ .ok()
+ .filter(|s| !s.is_empty())
+ .is_some()
+ {
+ "env OPENHUMAN_CORE_HOST"
+ } else {
+ "default"
+ },
+ ),
+ };
+
+ log::debug!(
"[core] Bind resolution: host={resolved_host} (from {host_source}), port={resolved_port} (from {port_source})"
);
- // Safety check: refuse to bind on a non-loopback address without an
- // explicit operator-supplied RPC token. Without this, the entire RPC
- // surface (tool execution, file access, credentials) is unauthenticated
- // and reachable from the network. See issue #1919. The self-generated
- // {workspace}/core.token does NOT count — remote clients cannot read it,
- // so treating it as "explicit" would be fail-open.
- if openhuman_core::security::pairing::is_public_bind(&resolved_host) && !runtime.has_operator_token() {
- log::error!(
- "[core] SECURITY: refusing to bind on public address {resolved_host} without an \
+ // Safety check: refuse to bind on a non-loopback address without an
+ // explicit operator-supplied RPC token. Without this, the entire RPC
+ // surface (tool execution, file access, credentials) is unauthenticated
+ // and reachable from the network. See issue #1919. The self-generated
+ // {workspace}/core.token does NOT count — remote clients cannot read it,
+ // so treating it as "explicit" would be fail-open.
+ if openhuman_core::security::pairing::is_public_bind(&resolved_host)
+ && !runtime.has_operator_token()
+ {
+ log::error!(
+ "[core] SECURITY: refusing to bind on public address {resolved_host} without an \
explicit operator-supplied RPC token. Set {} in your environment (or hand the \
bearer in-memory via the embedded core handle) to secure the RPC endpoint.",
- openhuman_core::core::auth::CORE_TOKEN_ENV_VAR
- );
- eprintln!(
- "\n\x1b[1;31m[SECURITY]\x1b[0m Refusing to bind on {resolved_host} without {}.\n\
+ openhuman_core::core::auth::CORE_TOKEN_ENV_VAR
+ );
+ eprintln!(
+ "\n\x1b[1;31m[SECURITY]\x1b[0m Refusing to bind on {resolved_host} without {}.\n\
The auto-generated {{workspace}}/core.token does NOT secure a public bind —\n\
remote clients cannot read it. Set {} in your environment to secure the\n\
RPC endpoint, or bind on a loopback address.\n",
- openhuman_core::core::auth::CORE_TOKEN_ENV_VAR,
- openhuman_core::core::auth::CORE_TOKEN_ENV_VAR
- );
- anyhow::bail!(
- "refusing to bind on non-loopback address {resolved_host} without an explicit \
+ openhuman_core::core::auth::CORE_TOKEN_ENV_VAR,
+ openhuman_core::core::auth::CORE_TOKEN_ENV_VAR
+ );
+ anyhow::bail!(
+ "refusing to bind on non-loopback address {resolved_host} without an explicit \
operator-supplied RPC token ({})",
- openhuman_core::core::auth::CORE_TOKEN_ENV_VAR
- );
- }
-
- let preferred_port = resolved_port;
- let host = resolved_host;
- // The desktop shell hands in `ready_tx` and owns the stale-listener
- // takeover (#1130) for its own leftover core. A headless `serve` has
- // nothing to take over: another live core on the port (the desktop
- // app's, another checkout's) is a neighbour, so move to a free port.
- let occupied_by_core = if ready_tx.is_some() {
- openhuman_core::platform::connectivity::rpc::OccupiedByCore::Takeover
- } else {
- openhuman_core::platform::connectivity::rpc::OccupiedByCore::Fallback
- };
- let pick = openhuman_core::platform::connectivity::rpc::pick_listen_port_for_host_with(
- host.as_str(),
- preferred_port,
- occupied_by_core,
- )
- .await
- .map_err(|err| {
- log::error!("[core] Failed to bind to {host}:{preferred_port}: {err}");
- anyhow::Error::new(err)
- })?;
- let listen_port = pick.port;
- let bind_addr = format!("{host}:{listen_port}");
- let listener = pick.listener;
- if let Ok(local_addr) = listener.local_addr() {
- runtime.listener_bound(local_addr);
- }
-
- // Synchronize OPENHUMAN_CORE_RPC_URL with the actual bound port so
- // connectivity::rpc::resolve_listen_port() reports the live listener
- // instead of the originally-requested port when fallback engaged.
- //
- // SAFETY: set_var is process-global; this runs once during bind. Flagged
- // in the pluggable-core drift ledger as single-runtime-per-process.
- unsafe {
- std::env::set_var("OPENHUMAN_CORE_RPC_URL", format!("http://{bind_addr}/rpc"));
- }
-
- let ctx = Arc::clone(runtime.context());
- let app = super::http::build_core_http_router(runtime.services().socketio).layer(
- axum::middleware::from_fn(
- move |req: axum::extract::Request, next: axum::middleware::Next| {
- let ctx = Arc::clone(&ctx);
- async move { openhuman_core::core::runtime::CoreContext::scope(ctx, next.run(req)).await }
- },
- ),
+ openhuman_core::core::auth::CORE_TOKEN_ENV_VAR
);
+ }
- // Await startup migrations before publishing readiness or allowing
- // background writers to touch their crate-backed stores.
- runtime.start_services().await;
+ let preferred_port = resolved_port;
+ let host = resolved_host;
+ // The desktop shell hands in `ready_tx` and owns the stale-listener
+ // takeover (#1130) for its own leftover core. A headless `serve` has
+ // nothing to take over: another live core on the port (the desktop
+ // app's, another checkout's) is a neighbour, so move to a free port.
+ let occupied_by_core = if ready_tx.is_some() {
+ openhuman_core::platform::connectivity::rpc::OccupiedByCore::Takeover
+ } else {
+ openhuman_core::platform::connectivity::rpc::OccupiedByCore::Fallback
+ };
+ let pick = openhuman_core::platform::connectivity::rpc::pick_listen_port_for_host_with(
+ host.as_str(),
+ preferred_port,
+ occupied_by_core,
+ )
+ .await
+ .map_err(|err| {
+ log::error!("[core] Failed to bind to {host}:{preferred_port}: {err}");
+ anyhow::Error::new(err)
+ })?;
+ let listen_port = pick.port;
+ let bind_addr = format!("{host}:{listen_port}");
+ let listener = pick.listener;
+ if let Ok(local_addr) = listener.local_addr() {
+ runtime.listener_bound(local_addr);
+ }
- log::info!(
- "[core] OpenHuman core is ready — listening on http://{bind_addr} (version {})",
- openhuman_core::core::invoke::default_state().core_version
- );
- log::info!("[rpc:http] JSON-RPC — POST http://{bind_addr}/rpc (JSON-RPC 2.0)");
- if runtime.services().socketio {
- log::info!("[rpc:socketio] Socket.IO — ws://{bind_addr}/socket.io/ (same HTTP server)");
- } else {
- log::info!("[rpc:socketio] disabled (--jsonrpc-only)");
- }
-
- if let Some(tx) = ready_tx {
- let _ = tx.send(EmbeddedReadySignal {
- port: listen_port,
- fallback_from: pick.fallback_from,
- });
- }
-
- runtime.serving_started();
-
- // The serve result is held, not propagated, until the exit work below
- // has run. A `?` here on a server error would skip the memory teardown
- // on exactly the exits where a wedged store is likeliest, and the
- // callers only forward the error — nobody else runs the cleanup.
- let served = if let Some(shutdown_token) = shutdown_token {
- log::info!(
- "[core] embedded server waiting on cancellation token for graceful shutdown"
- );
- axum::serve(listener, app)
- .with_graceful_shutdown(async move {
- shutdown_token.cancelled().await;
- })
- .await
- } else {
- axum::serve(listener, app)
- .with_graceful_shutdown(openhuman_core::core::shutdown::signal())
- .await
- };
- if let Err(error) = &served {
- log::warn!(
- "[core] embedded server ended with an error; running exit cleanup before \
+ // Synchronize OPENHUMAN_CORE_RPC_URL with the actual bound port so
+ // connectivity::rpc::resolve_listen_port() reports the live listener
+ // instead of the originally-requested port when fallback engaged.
+ //
+ // SAFETY: set_var is process-global; this runs once during bind. Flagged
+ // in the pluggable-core drift ledger as single-runtime-per-process.
+ unsafe {
+ std::env::set_var("OPENHUMAN_CORE_RPC_URL", format!("http://{bind_addr}/rpc"));
+ }
+
+ let ctx = Arc::clone(runtime.context());
+ let app = super::http::build_core_http_router(runtime.services().socketio).layer(
+ axum::middleware::from_fn(
+ move |req: axum::extract::Request, next: axum::middleware::Next| {
+ let ctx = Arc::clone(&ctx);
+ async move {
+ openhuman_core::core::runtime::CoreContext::scope(ctx, next.run(req)).await
+ }
+ },
+ ),
+ );
+
+ // Await startup migrations before publishing readiness or allowing
+ // background writers to touch their crate-backed stores.
+ runtime.start_services().await;
+
+ log::info!(
+ "[core] OpenHuman core is ready — listening on http://{bind_addr} (version {})",
+ openhuman_core::core::invoke::default_state().core_version
+ );
+ log::info!("[rpc:http] JSON-RPC — POST http://{bind_addr}/rpc (JSON-RPC 2.0)");
+ if runtime.services().socketio {
+ log::info!("[rpc:socketio] Socket.IO — ws://{bind_addr}/socket.io/ (same HTTP server)");
+ } else {
+ log::info!("[rpc:socketio] disabled (--jsonrpc-only)");
+ }
+
+ if let Some(tx) = ready_tx {
+ let _ = tx.send(EmbeddedReadySignal {
+ port: listen_port,
+ fallback_from: pick.fallback_from,
+ });
+ }
+
+ runtime.serving_started();
+
+ // The serve result is held, not propagated, until the exit work below
+ // has run. A `?` here on a server error would skip the memory teardown
+ // on exactly the exits where a wedged store is likeliest, and the
+ // callers only forward the error — nobody else runs the cleanup.
+ let served = if let Some(shutdown_token) = shutdown_token {
+ log::info!("[core] embedded server waiting on cancellation token for graceful shutdown");
+ axum::serve(listener, app)
+ .with_graceful_shutdown(async move {
+ shutdown_token.cancelled().await;
+ })
+ .await
+ } else {
+ axum::serve(listener, app)
+ .with_graceful_shutdown(openhuman_core::core::shutdown::signal())
+ .await
+ };
+ if let Err(error) = &served {
+ log::warn!(
+ "[core] embedded server ended with an error; running exit cleanup before \
reporting it: {error}"
- );
- }
+ );
+ }
- runtime.exit_cleanup().await;
+ runtime.exit_cleanup().await;
- served?;
- Ok(())
+ served?;
+ Ok(())
}
diff --git a/crates/openhuman-rpc/src/server/shims_tests.rs b/crates/openhuman-rpc/src/server/shims_tests.rs
index 323568f83d..e0dc341cf0 100644
--- a/crates/openhuman-rpc/src/server/shims_tests.rs
+++ b/crates/openhuman-rpc/src/server/shims_tests.rs
@@ -8,7 +8,8 @@ use crate::server::testing::EnvVarGuard;
#[test]
fn e2e_environment_enables_advertised_tool_groups() {
let _guard = EnvVarGuard::set_many(vec![("OPENHUMAN_E2E", "1".into())]);
- let builder = openhuman_core::core::runtime::CoreBuilder::new(openhuman_core::core::types::HostKind::Cli);
+ let builder =
+ openhuman_core::core::runtime::CoreBuilder::new(openhuman_core::core::types::HostKind::Cli);
let _ = super::apply_e2e_tool_groups(builder);
}
diff --git a/crates/openhuman-rpc/src/server/socketio.rs b/crates/openhuman-rpc/src/server/socketio.rs
index 26d184ea1e..5367ab9f24 100644
--- a/crates/openhuman-rpc/src/server/socketio.rs
+++ b/crates/openhuman-rpc/src/server/socketio.rs
@@ -32,8 +32,8 @@
use serde::Deserialize;
use serde::Serialize;
-use serde_json::Value;
use serde_json::json;
+use serde_json::Value;
use socketioxide::extract::{AckSender, Data, SocketRef, TryData};
use socketioxide::SocketIo;
@@ -107,9 +107,7 @@ struct HandshakeAuth {
pub(crate) fn origin_is_allowed(origin: Option<&str>) -> bool {
origin_is_allowed_with_extra(
origin,
- std::env::var(crate::ALLOWED_ORIGINS_ENV)
- .ok()
- .as_deref(),
+ std::env::var(crate::ALLOWED_ORIGINS_ENV).ok().as_deref(),
)
}
@@ -726,13 +724,18 @@ pub fn spawn_web_channel_bridge(io: SocketIo) {
let Some(event) = rx.recv().await else {
break;
};
- if let openhuman_core::core::events::DomainEvent::SessionExpired { source, reason } = event {
+ if let openhuman_core::core::events::DomainEvent::SessionExpired { source, reason } =
+ event
+ {
// Other publishers may emit a backend 401 while this core is
// using its offline local credential. The auth subscriber
// correctly keeps that credential, so the UI must not receive
// a contradictory sign-out event from this independent bus
// consumer. Real JWT expiry still broadcasts as before.
- if openhuman_core::security::credentials::session_support::current_session_is_local().await {
+ if openhuman_core::security::credentials::session_support::current_session_is_local(
+ )
+ .await
+ {
log::info!(
"[socketio] suppress auth:session_expired for local offline credential source={}",
source
@@ -1126,7 +1129,10 @@ pub fn spawn_web_channel_bridge(io: SocketIo) {
None,
))
}
- openhuman_core::core::events::DomainEvent::ChannelDisconnected { channel, reason } => {
+ openhuman_core::core::events::DomainEvent::ChannelDisconnected {
+ channel,
+ reason,
+ } => {
log::debug!(
"[socketio] broadcast channel:connection-updated {channel} -> error reason_len={}",
reason.len()
@@ -1338,7 +1344,8 @@ fn replay_parked_approval(socket: &SocketRef, thread_id: &str) {
/// plan review is a live, in-memory park (no SQLite row), but it reaches the
/// UI the same fire-and-forget way, so the same reconciliation applies.
fn replay_parked_plan_review(socket: &SocketRef, thread_id: &str) {
- let Some(row) = openhuman_core::agent::plan_review::gate::global().parked_review_for_thread(thread_id)
+ let Some(row) =
+ openhuman_core::agent::plan_review::gate::global().parked_review_for_thread(thread_id)
else {
return;
};
diff --git a/crates/openhuman-rpc/src/server/testing.rs b/crates/openhuman-rpc/src/server/testing.rs
index 56078e6dca..f8325b23a7 100644
--- a/crates/openhuman-rpc/src/server/testing.rs
+++ b/crates/openhuman-rpc/src/server/testing.rs
@@ -14,9 +14,7 @@ pub(crate) struct EnvVarGuard {
impl EnvVarGuard {
pub(crate) fn set_many(vars: Vec<(&'static str, OsString)>) -> Self {
- let lock = TEST_ENV_LOCK
- .lock()
- .expect("test env lock poisoned");
+ let lock = TEST_ENV_LOCK.lock().expect("test env lock poisoned");
let mut old_values = Vec::with_capacity(vars.len());
for (key, value) in vars {
let old = std::env::var_os(key);
diff --git a/crates/openhuman-tinyhumans/src/hosted/announcements/schemas.rs b/crates/openhuman-tinyhumans/src/hosted/announcements/schemas.rs
index bb0f50be7c..b8b6f6c375 100644
--- a/crates/openhuman-tinyhumans/src/hosted/announcements/schemas.rs
+++ b/crates/openhuman-tinyhumans/src/hosted/announcements/schemas.rs
@@ -2,8 +2,8 @@ use serde_json::{Map, Value};
use openhuman_core::config::rpc as config_rpc;
use openhuman_core::core::all::{ControllerFuture, RegisteredController};
-use openhuman_core::core::{ControllerSchema, FieldSchema, TypeSchema};
use openhuman_core::core::Outcome;
+use openhuman_core::core::{ControllerSchema, FieldSchema, TypeSchema};
pub fn all_announcements_controller_schemas() -> Vec<ControllerSchema> {
vec![announcements_schemas("announcements_get_latest")]
diff --git a/crates/openhuman-tinyhumans/src/hosted/billing/ops.rs b/crates/openhuman-tinyhumans/src/hosted/billing/ops.rs
index 6e73cd1bd7..d9682ddaa4 100644
--- a/crates/openhuman-tinyhumans/src/hosted/billing/ops.rs
+++ b/crates/openhuman-tinyhumans/src/hosted/billing/ops.rs
@@ -86,10 +86,7 @@ pub async fn get_transactions(
pub async fn get_auto_recharge(config: &Config) -> Result<Outcome<Value>, String> {
let data =
get_authed_value(config, Method::GET, "/payments/credits/auto-recharge", None).await?;
- Ok(Outcome::single_log(
- data,
- "auto recharge settings fetched",
- ))
+ Ok(Outcome::single_log(data, "auto recharge settings fetched"))
}
pub async fn update_auto_recharge(
@@ -103,10 +100,7 @@ pub async fn update_auto_recharge(
Some(payload),
)
.await?;
- Ok(Outcome::single_log(
- data,
- "auto recharge settings updated",
- ))
+ Ok(Outcome::single_log(data, "auto recharge settings updated"))
}
pub async fn get_cards(config: &Config) -> Result<Outcome<Value>, String> {
@@ -185,18 +179,12 @@ pub async fn purchase_plan(config: &Config, plan: &str) -> Result<Outcome<Value>
)
.await?;
- Ok(Outcome::single_log(
- data,
- "plan purchase session created",
- ))
+ Ok(Outcome::single_log(data, "plan purchase session created"))
}
pub async fn create_portal_session(config: &Config) -> Result<Outcome<Value>, String> {
let data = get_authed_value(config, Method::POST, "/payments/stripe/portal", None).await?;
- Ok(Outcome::single_log(
- data,
- "customer portal session created",
- ))
+ Ok(Outcome::single_log(data, "customer portal session created"))
}
#[derive(Debug, Serialize)]
@@ -290,10 +278,7 @@ pub async fn create_coinbase_charge(
)
.await?;
- Ok(Outcome::single_log(
- data,
- "Coinbase payment link created",
- ))
+ Ok(Outcome::single_log(data, "Coinbase payment link created"))
}
// ── Coupon operations ──────────────────────────────────────────────────────
diff --git a/crates/openhuman-tinyhumans/src/hosted/billing/schemas.rs b/crates/openhuman-tinyhumans/src/hosted/billing/schemas.rs
index f122ec8dc2..b5d87c376f 100644
--- a/crates/openhuman-tinyhumans/src/hosted/billing/schemas.rs
+++ b/crates/openhuman-tinyhumans/src/hosted/billing/schemas.rs
@@ -4,8 +4,8 @@ use serde_json::{Map, Value};
use openhuman_core::config::rpc as config_rpc;
use openhuman_core::core::all::{ControllerFuture, RegisteredController};
-use openhuman_core::core::{ControllerSchema, FieldSchema, TypeSchema};
use openhuman_core::core::Outcome;
+use openhuman_core::core::{ControllerSchema, FieldSchema, TypeSchema};
#[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")]
diff --git a/crates/openhuman-tinyhumans/src/hosted/referral/schemas.rs b/crates/openhuman-tinyhumans/src/hosted/referral/schemas.rs
index 226a1c5455..f7f2ce49de 100644
--- a/crates/openhuman-tinyhumans/src/hosted/referral/schemas.rs
+++ b/crates/openhuman-tinyhumans/src/hosted/referral/schemas.rs
@@ -4,8 +4,8 @@ use serde_json::{Map, Value};
use openhuman_core::config::rpc as config_rpc;
use openhuman_core::core::all::{ControllerFuture, RegisteredController};
-use openhuman_core::core::{ControllerSchema, FieldSchema, TypeSchema};
use openhuman_core::core::Outcome;
+use openhuman_core::core::{ControllerSchema, FieldSchema, TypeSchema};
#[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")]
diff --git a/crates/openhuman-tinyhumans/src/hosted/team/ops.rs b/crates/openhuman-tinyhumans/src/hosted/team/ops.rs
index 5a084f26d7..d8a243f289 100644
--- a/crates/openhuman-tinyhumans/src/hosted/team/ops.rs
+++ b/crates/openhuman-tinyhumans/src/hosted/team/ops.rs
@@ -197,10 +197,7 @@ pub async fn create_invite(
expires_in_days,
});
let data = get_authed_value(config, Method::POST, &path, Some(body)).await?;
- Ok(Outcome::single_log(
- data,
- "team invite created via backend",
- ))
+ Ok(Outcome::single_log(data, "team invite created via backend"))
}
pub async fn remove_member(
@@ -212,10 +209,7 @@ pub async fn remove_member(
let user_id = normalize_id(user_id, "userId")?;
let path = build_api_path(&["teams", &team_id, "members", &user_id])?;
let data = get_authed_value(config, Method::DELETE, &path, None).await?;
- Ok(Outcome::single_log(
- data,
- "team member removed via backend",
- ))
+ Ok(Outcome::single_log(data, "team member removed via backend"))
}
pub async fn change_member_role(
@@ -259,10 +253,7 @@ pub async fn revoke_invite(
let invite_id = normalize_id(invite_id, "inviteId")?;
let path = build_api_path(&["teams", &team_id, "invites", &invite_id])?;
let data = get_authed_value(config, Method::DELETE, &path, None).await?;
- Ok(Outcome::single_log(
- data,
- "team invite revoked via backend",
- ))
+ Ok(Outcome::single_log(data, "team invite revoked via backend"))
}
#[cfg(test)]
diff --git a/crates/openhuman-tinyhumans/src/hosted/team/schemas.rs b/crates/openhuman-tinyhumans/src/hosted/team/schemas.rs
index b6dc07e5b9..368a16de8f 100644
--- a/crates/openhuman-tinyhumans/src/hosted/team/schemas.rs
+++ b/crates/openhuman-tinyhumans/src/hosted/team/schemas.rs
@@ -4,8 +4,8 @@ use serde_json::{Map, Value};
use openhuman_core::config::rpc as config_rpc;
use openhuman_core::core::all::{ControllerFuture, RegisteredController};
-use openhuman_core::core::{ControllerSchema, FieldSchema, TypeSchema};
use openhuman_core::core::Outcome;
+use openhuman_core::core::{ControllerSchema, FieldSchema, TypeSchema};
#[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")]
diff --git a/crates/openhuman-tui/src/app.rs b/crates/openhuman-tui/src/app.rs
index ba8615f127..85b51eda9b 100644
--- a/crates/openhuman-tui/src/app.rs
+++ b/crates/openhuman-tui/src/app.rs
@@ -23,8 +23,8 @@ use serde_json::json;
use tokio::sync::broadcast;
use openhuman_core::core::runtime::CoreRuntime;
-use openhuman_core::web_chat::WebChannelEvent;
use openhuman_core::web_chat;
+use openhuman_core::web_chat::WebChannelEvent;
use super::cockpit::{
array_at, row_from_value, Overlay, OverlayKind, OverlayRow, PendingApproval, PendingPlanReview,
diff --git a/tests/config_auth_app_state_connectivity_e2e.rs b/tests/config_auth_app_state_connectivity_e2e.rs
index 8902e63d99..3ed5de0898 100644
--- a/tests/config_auth_app_state_connectivity_e2e.rs
+++ b/tests/config_auth_app_state_connectivity_e2e.rs
@@ -42,7 +42,6 @@ use openhuman_core::config::{
};
use openhuman_core::core::auth::{init_rpc_token, CORE_TOKEN_ENV_VAR};
use openhuman_core::core::events::DomainEvent;
-use openhuman_rpc::server::build_core_http_router;
use openhuman_core::desktop::app_state::app_state_schemas;
use openhuman_core::platform::connectivity::{
all_connectivity_controller_schemas, all_connectivity_registered_controllers,
@@ -60,6 +59,7 @@ use openhuman_core::security::credentials::{
list_provider_credentials_by_prefix, normalize_provider, rpc_store_composio_api_key,
store_composio_api_key, AuthService, APP_SESSION_PROVIDER, COMPOSIO_DIRECT_PROVIDER,
};
+use openhuman_rpc::server::build_core_http_router;
use tinybus::EventHandler;
const TEST_RPC_TOKEN: &str = "worker-a-domain-e2e-token";
diff --git a/tests/json_rpc_e2e.rs b/tests/json_rpc_e2e.rs
index 88969a09b2..66d492d9d8 100644
--- a/tests/json_rpc_e2e.rs
+++ b/tests/json_rpc_e2e.rs
@@ -26,9 +26,9 @@ use tinyinference_llm::message::Message;
use tinyinference_llm::model::ModelRequest;
use openhuman_core::core::auth::{init_rpc_token, CORE_TOKEN_ENV_VAR};
-use openhuman_rpc::server::build_core_http_router;
use openhuman_core::memory::tree::all_memory_tree_registered_controllers;
use openhuman_core::platform::connectivity::rpc::pick_listen_port;
+use openhuman_rpc::server::build_core_http_router;
const TEST_RPC_TOKEN: &str = "json-rpc-e2e-local-token";
static JSON_RPC_AUTH_INIT: OnceLock<()> = OnceLock::new();
diff --git a/tests/raw_coverage/agent_orchestration_e2e.rs b/tests/raw_coverage/agent_orchestration_e2e.rs
index f94757a39a..227930db3b 100644
--- a/tests/raw_coverage/agent_orchestration_e2e.rs
+++ b/tests/raw_coverage/agent_orchestration_e2e.rs
@@ -258,7 +258,6 @@ impl Harness {
}
async fn setup() -> Harness {
-
crate::tinyhumans_boot::boot();
let tmp = tempdir().expect("tempdir");
let home = tmp.path().to_path_buf();
@@ -398,7 +397,11 @@ async fn workflow_run_stop_then_resume_preserves_the_phase_ledger() {
);
let resumed = h
- .ok(3004, "openhuman.workflow_run_resume", json!({ "id": run_id }))
+ .ok(
+ 3004,
+ "openhuman.workflow_run_resume",
+ json!({ "id": run_id }),
+ )
.await;
let resumed_run = resumed
.get("workflowRun")
@@ -445,9 +448,7 @@ async fn workflow_run_stop_is_idempotent_where_resume_is_not() {
)
.await;
assert!(
- stopped
- .get("workflowRun")
- .is_some_and(Value::is_null),
+ stopped.get("workflowRun").is_some_and(Value::is_null),
"stopping an unknown run yields a null run, not an error: {stopped}"
);
@@ -619,7 +620,10 @@ async fn agent_team_close_flips_the_status_the_list_filter_selects_on() {
Some("planner")
);
assert_eq!(
- created.pointer("/members").and_then(Value::as_array).map(Vec::len),
+ created
+ .pointer("/members")
+ .and_then(Value::as_array)
+ .map(Vec::len),
Some(2),
"both seeded members are created: {created}"
);
@@ -1119,7 +1123,9 @@ async fn agent_experience_capture_list_retrieve_and_dismiss_round_trip() {
.as_array()
.expect("retrieve array")
.iter()
- .any(|hit| hit.pointer("/experience/id").and_then(Value::as_str) == Some("w1exp-deploy")),
+ .any(
+ |hit| hit.pointer("/experience/id").and_then(Value::as_str) == Some("w1exp-deploy")
+ ),
"a dismissed experience is out of retrieval: {after}"
);
diff --git a/tests/raw_coverage/automation_scheduling_e2e.rs b/tests/raw_coverage/automation_scheduling_e2e.rs
index 708c2d7efb..5af5afc7cb 100644
--- a/tests/raw_coverage/automation_scheduling_e2e.rs
+++ b/tests/raw_coverage/automation_scheduling_e2e.rs
@@ -460,9 +460,7 @@ async fn cron_controllers_reject_absent_and_blank_job_ids() {
(2121, "openhuman.cron_remove"),
(2122, "openhuman.cron_run"),
] {
- let unknown = h
- .err(id, method, json!({ "job_id": "no-such-job" }))
- .await;
+ let unknown = h.err(id, method, json!({ "job_id": "no-such-job" })).await;
assert!(
unknown.contains("no-such-job"),
"{method} names the unknown job: {unknown}"
@@ -531,7 +529,11 @@ async fn task_sources_sync_reports_one_outcome_per_enabled_source() {
let synced = h.ok(2203, "openhuman.task_sources_sync", json!({})).await;
let outcomes = synced.as_array().expect("sync returns an outcomes array");
- assert_eq!(outcomes.len(), 1, "one outcome per enabled source: {synced}");
+ assert_eq!(
+ outcomes.len(),
+ 1,
+ "one outcome per enabled source: {synced}"
+ );
let outcome = &outcomes[0];
assert_eq!(
outcome.get("sourceId").and_then(Value::as_str),
@@ -676,7 +678,9 @@ async fn hooks_reload_list_and_test_round_trip_a_deny_rule() {
"no hooks.json anywhere means an empty config: {bare}"
);
assert_eq!(
- bare.pointer("/hooks/warnings").and_then(Value::as_array).map(Vec::len),
+ bare.pointer("/hooks/warnings")
+ .and_then(Value::as_array)
+ .map(Vec::len),
Some(0),
"a missing file is not a warning: {bare}"
);
@@ -757,7 +761,9 @@ async fn hooks_reload_list_and_test_round_trip_a_deny_rule() {
Some("beforeShellExecution")
);
assert_eq!(
- denied.pointer("/result/decision/permission").and_then(Value::as_str),
+ denied
+ .pointer("/result/decision/permission")
+ .and_then(Value::as_str),
Some("deny"),
"the matching hook's verdict is the merged decision: {denied}"
);
@@ -790,7 +796,10 @@ async fn hooks_reload_list_and_test_round_trip_a_deny_rule() {
)
.await;
assert_eq!(
- allowed.pointer("/result/runs").and_then(Value::as_array).map(Vec::len),
+ allowed
+ .pointer("/result/runs")
+ .and_then(Value::as_array)
+ .map(Vec::len),
Some(0),
"the matcher gates which occurrences reach the hook: {allowed}"
);
@@ -810,7 +819,10 @@ async fn hooks_reload_list_and_test_round_trip_a_deny_rule() {
)
.await;
assert_eq!(
- other_event.pointer("/result/runs").and_then(Value::as_array).map(Vec::len),
+ other_event
+ .pointer("/result/runs")
+ .and_then(Value::as_array)
+ .map(Vec::len),
Some(0),
"an event with no hooks configured runs nothing: {other_event}"
);
@@ -927,15 +939,15 @@ async fn harness_init_run_completes_offline_and_force_bypasses_the_probes() {
let _lock = env_lock();
let h = setup().await;
- let snapshot = h
- .ok(2701, "openhuman.harness_init_run", json!({}))
- .await;
+ let snapshot = h.ok(2701, "openhuman.harness_init_run", json!({})).await;
let steps = snapshot
.pointer("/snapshot/steps")
.and_then(Value::as_array)
.unwrap_or_else(|| panic!("the snapshot carries a steps array: {snapshot}"));
assert_eq!(
- snapshot.pointer("/snapshot/overall").and_then(Value::as_str),
+ snapshot
+ .pointer("/snapshot/overall")
+ .and_then(Value::as_str),
Some("done"),
"no required step can fail when every backend is off: {snapshot}"
);
@@ -1000,7 +1012,10 @@ async fn harness_init_run_completes_offline_and_force_bypasses_the_probes() {
);
}
assert!(
- forced.pointer("/snapshot/finished_at").and_then(Value::as_str).is_some(),
+ forced
+ .pointer("/snapshot/finished_at")
+ .and_then(Value::as_str)
+ .is_some(),
"a finished run is stamped: {forced}"
);
@@ -1013,7 +1028,10 @@ async fn harness_init_run_completes_offline_and_force_bypasses_the_probes() {
"status reads the store the run wrote: {status}"
);
assert_eq!(
- status.pointer("/snapshot/steps").and_then(Value::as_array).map(Vec::len),
+ status
+ .pointer("/snapshot/steps")
+ .and_then(Value::as_array)
+ .map(Vec::len),
forced_steps.len().into(),
"status and run agree on the step list: {status}"
);
diff --git a/tests/raw_coverage/channel_socket_e2e.rs b/tests/raw_coverage/channel_socket_e2e.rs
index ec91af363c..b54aa817a0 100644
--- a/tests/raw_coverage/channel_socket_e2e.rs
+++ b/tests/raw_coverage/channel_socket_e2e.rs
@@ -36,10 +36,10 @@ use serde_json::{json, Value};
use tempfile::tempdir;
use openhuman_core::core::auth::{get_rpc_token, init_rpc_token};
-use openhuman_rpc::server::build_core_http_router;
use openhuman_core::platform::socket::{
global_socket_manager, set_global_socket_manager, SocketManager,
};
+use openhuman_rpc::server::build_core_http_router;
// ── env serialisation ────────────────────────────────────────────────────────
@@ -73,7 +73,6 @@ fn rpc_bearer() -> &'static str {
}
fn ensure_rpc_auth() {
-
crate::tinyhumans_boot::boot();
let _ = rpc_bearer();
}
@@ -352,7 +351,10 @@ async fn socket_state_and_parameter_guards() {
);
let still_down = post_json_rpc(&h.rpc_base, 8005, "openhuman.socket_state", json!({})).await;
- let result = peel(assert_no_jsonrpc_error(&still_down, "socket_state after guards"));
+ let result = peel(assert_no_jsonrpc_error(
+ &still_down,
+ "socket_state after guards",
+ ));
assert_eq!(
result.get("status").and_then(Value::as_str),
Some("disconnected"),
@@ -368,7 +370,8 @@ async fn socket_state_and_parameter_guards() {
)
.await;
assert!(
- jsonrpc_error_message(&emit_offline, "socket_emit while disconnected").contains("Not connected"),
+ jsonrpc_error_message(&emit_offline, "socket_emit while disconnected")
+ .contains("Not connected"),
"emitting with no connection must be an error, not a silent success"
);
@@ -422,7 +425,8 @@ async fn socket_connect_then_disconnect_round_trips_state() {
(`\"Connecting\"`) and the split was #6111: {result}"
);
- let disconnected = post_json_rpc(&h.rpc_base, 8102, "openhuman.socket_disconnect", json!({})).await;
+ let disconnected =
+ post_json_rpc(&h.rpc_base, 8102, "openhuman.socket_disconnect", json!({})).await;
let result = peel(assert_no_jsonrpc_error(&disconnected, "socket_disconnect"));
assert_eq!(
result.get("status").and_then(Value::as_str),
@@ -431,7 +435,10 @@ async fn socket_connect_then_disconnect_round_trips_state() {
);
let state = post_json_rpc(&h.rpc_base, 8103, "openhuman.socket_state", json!({})).await;
- let result = peel(assert_no_jsonrpc_error(&state, "socket_state after disconnect"));
+ let result = peel(assert_no_jsonrpc_error(
+ &state,
+ "socket_state after disconnect",
+ ));
assert_eq!(
result.get("status").and_then(Value::as_str),
Some("disconnected"),
@@ -631,8 +638,14 @@ async fn channel_queue_controllers_report_an_idle_thread() {
json!({ "client_id": "e2e-client", "thread_id": canonical, "request_id": "req-that-never-ran" }),
)
.await;
- let result = peel(assert_no_jsonrpc_error(&scoped, "channel_web_cancel scoped"));
- assert_eq!(result.get("cancelled").and_then(Value::as_bool), Some(false));
+ let result = peel(assert_no_jsonrpc_error(
+ &scoped,
+ "channel_web_cancel scoped",
+ ));
+ assert_eq!(
+ result.get("cancelled").and_then(Value::as_bool),
+ Some(false)
+ );
h.stop();
}
diff --git a/tests/raw_coverage/channels_large_round25_raw_coverage_e2e.rs b/tests/raw_coverage/channels_large_round25_raw_coverage_e2e.rs
index d77bda7995..729b97bc2e 100644
--- a/tests/raw_coverage/channels_large_round25_raw_coverage_e2e.rs
+++ b/tests/raw_coverage/channels_large_round25_raw_coverage_e2e.rs
@@ -9,7 +9,6 @@ use axum::{
routing::{get, post},
Json, Router,
};
-use openhuman_core::web_chat::WebChannelEvent;
use openhuman_core::channels::providers::email_channel::{
test_support as email_support, EmailChannel, EmailConfig,
};
@@ -18,12 +17,13 @@ use openhuman_core::channels::providers::mattermost::{
test_support as mattermost_support, MattermostChannel,
};
use openhuman_core::channels::providers::telegram::test_support as telegram_support;
-use openhuman_core::web_chat::{self as web, test_support as web_support};
use openhuman_core::channels::test_support::{
build_channel_context_block_for_test, run_dispatch_harness,
select_acknowledgment_reaction_for_test, DispatchHarnessOptions, TestMemoryEntry,
};
use openhuman_core::channels::traits::{Channel, ChannelMessage, SendMessage};
+use openhuman_core::web_chat::WebChannelEvent;
+use openhuman_core::web_chat::{self as web, test_support as web_support};
use serde_json::{json, Value};
use std::sync::{Arc, Mutex};
use tokio::sync::broadcast::error::RecvError;
diff --git a/tests/raw_coverage/connectivity_raw_coverage_e2e.rs b/tests/raw_coverage/connectivity_raw_coverage_e2e.rs
index 9218dbbdaa..273528a9d2 100644
--- a/tests/raw_coverage/connectivity_raw_coverage_e2e.rs
+++ b/tests/raw_coverage/connectivity_raw_coverage_e2e.rs
@@ -15,7 +15,6 @@ use tempfile::{tempdir, TempDir};
use tokio::io::{AsyncReadExt, AsyncWriteExt};
use openhuman_core::core::auth::{init_rpc_token, CORE_TOKEN_ENV_VAR};
-use openhuman_rpc::server::build_core_http_router;
use openhuman_core::platform::connectivity::ops::is_port_in_use;
use openhuman_core::platform::connectivity::rpc::{
diag, pick_listen_port, pick_listen_port_for_host, PickListenPortError,
@@ -25,6 +24,7 @@ use openhuman_core::platform::connectivity::{
connectivity_controller_schema,
};
use openhuman_core::platform::socket::{set_global_socket_manager, SocketManager};
+use openhuman_rpc::server::build_core_http_router;
const TEST_RPC_TOKEN: &str = "connectivity-raw-coverage-e2e-token";
diff --git a/tests/raw_coverage/flows_lifecycle_e2e.rs b/tests/raw_coverage/flows_lifecycle_e2e.rs
index 4265bc3b69..fc18c378ab 100644
--- a/tests/raw_coverage/flows_lifecycle_e2e.rs
+++ b/tests/raw_coverage/flows_lifecycle_e2e.rs
@@ -222,7 +222,6 @@ impl Harness {
}
async fn setup() -> Harness {
-
crate::tinyhumans_boot::boot();
let tmp = tempdir().expect("tempdir");
let home = tmp.path();
@@ -309,7 +308,10 @@ async fn flows_draft_surface_round_trips_and_promotes_into_a_saved_flow() {
"an unlinked draft carries no flow_id: {draft}"
);
assert_eq!(
- draft.pointer("/graph/nodes").and_then(Value::as_array).map(Vec::len),
+ draft
+ .pointer("/graph/nodes")
+ .and_then(Value::as_array)
+ .map(Vec::len),
Some(1),
"draft_create stores the graph verbatim: {draft}"
);
@@ -345,7 +347,10 @@ async fn flows_draft_surface_round_trips_and_promotes_into_a_saved_flow() {
.await;
assert_eq!(str_at(&updated, "/name"), "Draft Renamed");
assert_eq!(
- updated.pointer("/graph/nodes").and_then(Value::as_array).map(Vec::len),
+ updated
+ .pointer("/graph/nodes")
+ .and_then(Value::as_array)
+ .map(Vec::len),
Some(2),
"draft_update replaces the graph: {updated}"
);
@@ -399,7 +404,10 @@ async fn flows_draft_surface_round_trips_and_promotes_into_a_saved_flow() {
json!({ "id": draft_id }),
)
.await;
- assert_eq!(deleted.get("id").and_then(Value::as_str), Some(draft_id.as_str()));
+ assert_eq!(
+ deleted.get("id").and_then(Value::as_str),
+ Some(draft_id.as_str())
+ );
assert_eq!(
deleted.get("deleted").and_then(Value::as_bool),
Some(false),
@@ -521,7 +529,9 @@ async fn flows_duplicate_copies_the_graph_and_lands_disabled() {
"a duplicate is born disabled: {copy}"
);
assert_eq!(
- copy.pointer("/graph/nodes").and_then(Value::as_array).map(Vec::len),
+ copy.pointer("/graph/nodes")
+ .and_then(Value::as_array)
+ .map(Vec::len),
Some(2),
"the copy carries the source graph: {copy}"
);
@@ -668,7 +678,10 @@ async fn flows_history_records_prior_graphs_and_rollback_restores_them() {
Some(flow_id.as_str())
);
assert_eq!(
- revision.pointer("/graph/nodes").and_then(Value::as_array).map(Vec::len),
+ revision
+ .pointer("/graph/nodes")
+ .and_then(Value::as_array)
+ .map(Vec::len),
Some(1),
"the snapshot holds the ORIGINAL one-node graph, not the new one: {revision}"
);
@@ -681,7 +694,10 @@ async fn flows_history_records_prior_graphs_and_rollback_restores_them() {
)
.await;
assert_eq!(
- rolled.pointer("/graph/nodes").and_then(Value::as_array).map(Vec::len),
+ rolled
+ .pointer("/graph/nodes")
+ .and_then(Value::as_array)
+ .map(Vec::len),
Some(1),
"rollback restored the one-node graph: {rolled}"
);
@@ -755,8 +771,10 @@ async fn flows_list_all_runs_spans_flows_and_prune_reports_the_retention_cap() {
.await;
let second_id = str_at(&second, "/id").to_string();
- h.ok(1503, "openhuman.flows_run", json!({ "id": first_id })).await;
- h.ok(1504, "openhuman.flows_run", json!({ "id": second_id })).await;
+ h.ok(1503, "openhuman.flows_run", json!({ "id": first_id }))
+ .await;
+ h.ok(1504, "openhuman.flows_run", json!({ "id": second_id }))
+ .await;
let all = h.ok(1505, "openhuman.flows_list_all_runs", json!({})).await;
let runs = all.as_array().expect("list_all_runs returns an array");
@@ -812,9 +830,7 @@ async fn flows_list_all_runs_spans_flows_and_prune_reports_the_retention_cap() {
"a no-op prune must not delete live history: {still_there}"
);
- let missing_id = h
- .err(1509, "openhuman.flows_prune_runs", json!({}))
- .await;
+ let missing_id = h.err(1509, "openhuman.flows_prune_runs", json!({})).await;
assert!(
missing_id.contains("id"),
"prune_runs names its required param: {missing_id}"
@@ -885,17 +901,17 @@ async fn flows_approval_manifest_classifies_every_gated_node_kind() {
assert_eq!(code.get("class").and_then(Value::as_str), Some("Write"));
assert!(
- entries
- .iter()
- .any(|entry| entry.get("kind").and_then(Value::as_str) == Some("dynamic")
- && entry.get("node_id").and_then(Value::as_str) == Some("dyn")),
+ entries.iter().any(
+ |entry| entry.get("kind").and_then(Value::as_str) == Some("dynamic")
+ && entry.get("node_id").and_then(Value::as_str) == Some("dyn")
+ ),
"an `=` slug cannot be pre-approved and must be disclosed as dynamic: {manifest}"
);
assert!(
- entries
- .iter()
- .any(|entry| entry.get("kind").and_then(Value::as_str) == Some("agent")
- && entry.get("node_id").and_then(Value::as_str) == Some("ai")),
+ entries.iter().any(
+ |entry| entry.get("kind").and_then(Value::as_str) == Some("agent")
+ && entry.get("node_id").and_then(Value::as_str) == Some("ai")
+ ),
"an agent node's inner tool calls are unknowable and must be disclosed: {manifest}"
);
@@ -1021,7 +1037,10 @@ async fn flows_required_connections_lists_only_composio_toolkits() {
1,
"only the Composio slug needs a connection — `oh:` and http_request do not: {out}"
);
- assert_eq!(required[0].get("toolkit").and_then(Value::as_str), Some("gmail"));
+ assert_eq!(
+ required[0].get("toolkit").and_then(Value::as_str),
+ Some("gmail")
+ );
assert_eq!(
required[0].get("status").and_then(Value::as_str),
Some("missing"),
@@ -1036,7 +1055,9 @@ async fn flows_required_connections_lists_only_composio_toolkits() {
)
.await;
assert_eq!(
- none.get("required_connections").and_then(Value::as_array).map(Vec::len),
+ none.get("required_connections")
+ .and_then(Value::as_array)
+ .map(Vec::len),
Some(0),
"a trigger-only graph needs no connection: {none}"
);
@@ -1185,9 +1206,7 @@ async fn flows_build_cancel_reports_no_turn_in_flight_without_erroring() {
"a scoped cancel for an unregistered turn is also a no-op: {scoped}"
);
- let no_thread = h
- .err(1903, "openhuman.flows_build_cancel", json!({}))
- .await;
+ let no_thread = h.err(1903, "openhuman.flows_build_cancel", json!({})).await;
assert!(
no_thread.contains("thread_id"),
"the required `thread_id` param is named: {no_thread}"
diff --git a/tests/raw_coverage/inference_provider_auth_e2e.rs b/tests/raw_coverage/inference_provider_auth_e2e.rs
index 474ba3513b..ede81f5949 100644
--- a/tests/raw_coverage/inference_provider_auth_e2e.rs
+++ b/tests/raw_coverage/inference_provider_auth_e2e.rs
@@ -38,8 +38,8 @@ use serde_json::{json, Value};
use tempfile::{tempdir, TempDir};
use openhuman_core::core::auth::{get_rpc_token, init_rpc_token, CORE_TOKEN_ENV_VAR};
-use openhuman_rpc::server::build_core_http_router;
use openhuman_core::inference::auth_error_registry;
+use openhuman_rpc::server::build_core_http_router;
const TEST_RPC_TOKEN: &str = "inference-provider-auth-e2e-token";
diff --git a/tests/raw_coverage/learning_facets_e2e.rs b/tests/raw_coverage/learning_facets_e2e.rs
index c3b7c67b67..d8e067f701 100644
--- a/tests/raw_coverage/learning_facets_e2e.rs
+++ b/tests/raw_coverage/learning_facets_e2e.rs
@@ -39,12 +39,12 @@ use reqwest::StatusCode;
use serde_json::{json, Value};
use tempfile::TempDir;
-use openhuman_core::core::auth::{init_rpc_token, CORE_TOKEN_ENV_VAR};
-use openhuman_rpc::server::build_core_http_router;
use openhuman_core::agent::learning::candidate::{
self, CueFamily, EvidenceRef, FacetClass, LearningCandidate,
};
use openhuman_core::config::Config;
+use openhuman_core::core::auth::{init_rpc_token, CORE_TOKEN_ENV_VAR};
+use openhuman_rpc::server::build_core_http_router;
/// Preferred bearer. Only the real one if this module wins the process-global
/// `OnceLock` race — send [`rpc_bearer`], never this.
@@ -421,7 +421,11 @@ async fn learning_facet_lifecycle_from_rebuild_to_reset() {
);
assert_eq!(seeded.get("class").and_then(Value::as_str), Some("style"));
assert!(
- seeded.get("stability").and_then(Value::as_f64).unwrap_or(0.0) > 0.0,
+ seeded
+ .get("stability")
+ .and_then(Value::as_f64)
+ .unwrap_or(0.0)
+ > 0.0,
"a promoted facet carries a positive stability: {seeded}"
);
assert!(
diff --git a/tests/raw_coverage/memory_goals_people_e2e.rs b/tests/raw_coverage/memory_goals_people_e2e.rs
index 5575c5da0e..c8fbe8b7b5 100644
--- a/tests/raw_coverage/memory_goals_people_e2e.rs
+++ b/tests/raw_coverage/memory_goals_people_e2e.rs
@@ -39,9 +39,9 @@ use reqwest::StatusCode;
use serde_json::{json, Value};
use tempfile::TempDir;
+use openhuman_core::config::Config;
use openhuman_core::core::auth::{init_rpc_token, CORE_TOKEN_ENV_VAR};
use openhuman_rpc::server::build_core_http_router;
-use openhuman_core::config::Config;
/// Preferred bearer. Only the real one if this module wins the process-global
/// `OnceLock` race — send [`rpc_bearer`], never this.
@@ -961,7 +961,13 @@ async fn tree_summarizer_run_and_rebuild_refuse_without_summarization_consent()
(43_101_i64, "openhuman.tree_summarizer_run", "run"),
(43_102, "openhuman.tree_summarizer_rebuild", "rebuild"),
] {
- let response = rpc(&harness.rpc_base, id, method, json!({ "namespace": namespace })).await;
+ let response = rpc(
+ &harness.rpc_base,
+ id,
+ method,
+ json!({ "namespace": namespace }),
+ )
+ .await;
let message = error_message(&response, context);
assert!(
message.contains("no summarization provider"),
diff --git a/tests/raw_coverage/notification_platform_e2e.rs b/tests/raw_coverage/notification_platform_e2e.rs
index 76f9f8742a..5049c9715a 100644
--- a/tests/raw_coverage/notification_platform_e2e.rs
+++ b/tests/raw_coverage/notification_platform_e2e.rs
@@ -30,14 +30,14 @@ use axum::{Json, Router};
use serde_json::{json, Value};
use tempfile::tempdir;
-use openhuman_core::core::auth::{get_rpc_token, init_rpc_token};
-use openhuman_rpc::server::build_core_http_router;
use openhuman_core::config::rpc::load_config_with_timeout;
+use openhuman_core::core::auth::{get_rpc_token, init_rpc_token};
use openhuman_core::desktop::notifications::store as notification_store;
use openhuman_core::desktop::notifications::types::{
CoreNotificationCategory, CoreNotificationEvent,
};
use openhuman_core::platform::health::{mark_component_error, mark_component_ok};
+use openhuman_rpc::server::build_core_http_router;
// ── env serialisation ────────────────────────────────────────────────────────
@@ -72,7 +72,6 @@ fn rpc_bearer() -> &'static str {
}
fn ensure_rpc_auth() {
-
crate::tinyhumans_boot::boot();
let _ = rpc_bearer();
}
@@ -179,7 +178,9 @@ async fn mock_composio_connections(
if !is_authed(&headers) {
return Err(unauthorized());
}
- Ok(Json(json!({ "success": true, "data": (*state.connections).clone() })))
+ Ok(Json(
+ json!({ "success": true, "data": (*state.connections).clone() }),
+ ))
}
fn mock_backend_router(state: BackendState) -> Router {
@@ -433,7 +434,10 @@ async fn notification_centre_lifecycle_over_rpc() {
Some("The Q3 numbers are attached.")
);
assert_eq!(row.get("provider").and_then(Value::as_str), Some("gmail"));
- assert_eq!(row.get("account_id").and_then(Value::as_str), Some("acct-e2e"));
+ assert_eq!(
+ row.get("account_id").and_then(Value::as_str),
+ Some("acct-e2e")
+ );
assert_eq!(
row.get("raw_payload").and_then(|p| p.get("messageId")),
Some(&json!("m-1")),
@@ -828,7 +832,10 @@ async fn health_snapshot_and_system_info_report_this_process() {
let h = Harness::start(default_state()).await;
mark_component_ok("e2e_platform_probe_ok");
- mark_component_error("e2e_platform_probe_bad", "synthetic failure for the e2e probe");
+ mark_component_error(
+ "e2e_platform_probe_bad",
+ "synthetic failure for the e2e probe",
+ );
let snapshot = post_json_rpc(&h.rpc_base, 9201, "openhuman.health_snapshot", json!({})).await;
let result = peel(assert_no_jsonrpc_error(&snapshot, "health_snapshot"));
@@ -875,7 +882,10 @@ async fn health_snapshot_and_system_info_report_this_process() {
"the snapshot describes *this* process"
);
assert!(
- result.get("uptime_seconds").and_then(Value::as_u64).is_some(),
+ result
+ .get("uptime_seconds")
+ .and_then(Value::as_u64)
+ .is_some(),
"snapshot must carry uptime_seconds: {result}"
);
assert!(
@@ -1038,9 +1048,12 @@ async fn doctor_report_and_models_are_internally_consistent() {
.unwrap_or_else(|| panic!("doctor_models must return a summary: {result}"));
let total: u64 = ["ok", "skipped", "auth_or_access", "errors"]
.iter()
- .map(|k| summary.get(*k).and_then(Value::as_u64).unwrap_or_else(|| {
- panic!("summary must carry {k}: {result}")
- }))
+ .map(|k| {
+ summary
+ .get(*k)
+ .and_then(Value::as_u64)
+ .unwrap_or_else(|| panic!("summary must carry {k}: {result}"))
+ })
.sum();
assert_eq!(
total,
@@ -1151,9 +1164,12 @@ async fn service_daemon_host_preferences_round_trip_to_disk() {
)
.await;
assert_eq!(
- peel(assert_no_jsonrpc_error(&reread, "service_daemon_host_get after set"))
- .get("showTray")
- .and_then(Value::as_bool),
+ peel(assert_no_jsonrpc_error(
+ &reread,
+ "service_daemon_host_get after set"
+ ))
+ .get("showTray")
+ .and_then(Value::as_bool),
Some(false),
"get must read back what set wrote, not the default"
);
@@ -1497,7 +1513,10 @@ async fn announcements_get_latest_passes_through_and_folds_404_to_null() {
json!({}),
)
.await;
- let result = peel(assert_no_jsonrpc_error(&present, "announcements_get_latest"));
+ let result = peel(assert_no_jsonrpc_error(
+ &present,
+ "announcements_get_latest",
+ ));
assert_eq!(
result.get("id").and_then(Value::as_str),
Some("ann-1"),
diff --git a/tests/raw_coverage/tool_registry_approval_raw_coverage_e2e.rs b/tests/raw_coverage/tool_registry_approval_raw_coverage_e2e.rs
index 793063365b..1f146db839 100644
--- a/tests/raw_coverage/tool_registry_approval_raw_coverage_e2e.rs
+++ b/tests/raw_coverage/tool_registry_approval_raw_coverage_e2e.rs
@@ -15,9 +15,12 @@ use rusqlite::{params, Connection};
use serde_json::{json, Map, Value};
use tempfile::{tempdir, TempDir};
-use openhuman_core::core::auth::{init_rpc_token, CORE_TOKEN_ENV_VAR};
-use openhuman_rpc::server::build_core_http_router;
use openhuman_core::agent::turn_origin::{self, AgentTurnOrigin};
+use openhuman_core::config::schema::{CapabilityProviderConfig, CapabilityProviderTrustState};
+use openhuman_core::config::Config;
+use openhuman_core::core::auth::{init_rpc_token, CORE_TOKEN_ENV_VAR};
+use openhuman_core::mcp::registry::connections;
+use openhuman_core::mcp::registry::types::{CommandKind, InstalledServer, Transport};
use openhuman_core::security::approval::gate::{
parse_approval_reply, ApprovalChatContext, ApprovalGate, APPROVAL_CHAT_CONTEXT,
};
@@ -26,12 +29,6 @@ use openhuman_core::security::approval::{
all_approval_controller_schemas, all_approval_registered_controllers, redact_args,
summarize_action, ApprovalDecision, ExecutionOutcome, GateOutcome, PendingApproval,
};
-use openhuman_core::config::schema::{
- CapabilityProviderConfig, CapabilityProviderTrustState,
-};
-use openhuman_core::config::Config;
-use openhuman_core::mcp::registry::connections;
-use openhuman_core::mcp::registry::types::{CommandKind, InstalledServer, Transport};
use openhuman_core::security::{live_policy, SecurityPolicy};
use openhuman_core::tools::registry::{
all_tool_registry_controller_schemas, all_tool_registry_registered_controllers,
@@ -40,6 +37,7 @@ use openhuman_core::tools::registry::{
list_tools, normalize_capability_provider_id, registry_entries, registry_entries_for_config,
CapabilityProviderRegistryError,
};
+use openhuman_rpc::server::build_core_http_router;
const TEST_RPC_TOKEN: &str = "tool-registry-approval-raw-e2e-token";
@@ -95,7 +93,6 @@ fn env_lock() -> std::sync::MutexGuard<'static, ()> {
}
fn ensure_rpc_auth() {
-
crate::tinyhumans_boot::boot();
AUTH_INIT.get_or_init(|| {
std::env::set_var(CORE_TOKEN_ENV_VAR, TEST_RPC_TOKEN);
@@ -180,7 +177,6 @@ disallowed_tools = ["write_file"]
}
async fn setup(capability_providers: &str) -> TestHarness {
-
crate::tinyhumans_boot::boot();
let tmp = tempdir().expect("tempdir");
let home = tmp.path();
@@ -612,10 +608,9 @@ fn tool_registry_diagnostics_for_config_reports_audit_success_and_policy_shape()
..Config::default()
};
- let diagnostics =
- openhuman_core::tools::registry::ops::diagnostics_for_config(&config)
- .into_cli_compatible_json()
- .expect("diagnostics json");
+ let diagnostics = openhuman_core::tools::registry::ops::diagnostics_for_config(&config)
+ .into_cli_compatible_json()
+ .expect("diagnostics json");
assert!(diagnostics
.get("total_tools")
.and_then(Value::as_u64)
@@ -704,9 +699,9 @@ async fn tool_registry_entries_include_connected_mcp_client_tools() {
// The other workspace's server must NOT leak in. This is the assertion that
// fails if a config-scoped lookup falls back to the process default.
assert!(
- !entries.iter().any(
- |entry| entry.tool_id == format!("mcp-client::{}::echo", other_server.server_id)
- ),
+ !entries
+ .iter()
+ .any(|entry| entry.tool_id == format!("mcp-client::{}::echo", other_server.server_id)),
"entries for one workspace must not include another workspace's server"
);
diff --git a/tests/raw_coverage/tools_approval_channels_raw_coverage_e2e.rs b/tests/raw_coverage/tools_approval_channels_raw_coverage_e2e.rs
index c186192847..9a42da0bdd 100644
--- a/tests/raw_coverage/tools_approval_channels_raw_coverage_e2e.rs
+++ b/tests/raw_coverage/tools_approval_channels_raw_coverage_e2e.rs
@@ -19,16 +19,12 @@ use reqwest::StatusCode as ReqwestStatusCode;
use serde_json::{json, Value};
use tempfile::{tempdir, TempDir};
-use openhuman_core::core::auth::{init_rpc_token, CORE_TOKEN_ENV_VAR};
-use openhuman_core::core::events::DomainEvent;
-use tinybus::EventHandler;
-use openhuman_rpc::server::build_core_http_router;
-use openhuman_core::web_chat::WebChannelEvent;
use openhuman_core::agent::harness::definition::{
AgentDefinition, AgentDefinitionRegistry, AgentTier, DefinitionSource, ModelSpec, PromptSource,
SandboxMode, SkillsWildcard, SubagentEntry, ToolScope as AgentToolScope,
};
use openhuman_core::agent::host_runtime::NativeRuntime;
+use openhuman_core::agent::prompts::ConnectedIntegration;
use openhuman_core::channels::email_channel::EmailConfig;
use openhuman_core::channels::irc::IrcChannelConfig;
use openhuman_core::channels::proactive::ProactiveMessageSubscriber;
@@ -37,9 +33,7 @@ use openhuman_core::channels::yuanbao::config::YuanbaoConfig;
use openhuman_core::channels::yuanbao::errors::{
AUTH_FAILED_CODES, AUTH_RETRYABLE_CODES, NO_RECONNECT_CLOSE_CODES,
};
-use openhuman_core::channels::yuanbao::inbound::{
- InboundPipeline, PipelineOutcome, PipelineState,
-};
+use openhuman_core::channels::yuanbao::inbound::{InboundPipeline, PipelineOutcome, PipelineState};
use openhuman_core::channels::yuanbao::media::{
build_file_msg_body, build_image_msg_body, guess_mime_type, image_format_code, is_image,
parse_image_size,
@@ -73,21 +67,25 @@ use openhuman_core::channels::{
IrcChannel, LinqChannel, MattermostChannel, QQChannel, SendMessage, SignalChannel,
SlackChannel, WhatsAppChannel,
};
-use openhuman_core::integrations::composio::all_composio_agent_tools;
use openhuman_core::config::schema::{
CapabilityProviderConfig, CapabilityProviderTrustState, NodeConfig, WhatsAppConfig,
};
use openhuman_core::config::{Config, IMessageConfig, WebhookConfig};
-use openhuman_core::agent::prompts::ConnectedIntegration;
+use openhuman_core::core::auth::{init_rpc_token, CORE_TOKEN_ENV_VAR};
+use openhuman_core::core::events::DomainEvent;
+use openhuman_core::inference::tokenjuice::AgentTokenjuiceCompression;
+use openhuman_core::integrations::composio::all_composio_agent_tools;
+use openhuman_core::memory::{Memory, MemoryCategory, MemoryEntry, NamespaceSummary, RecallOpts};
+use openhuman_core::runtime::javascript::NodeBootstrap;
use openhuman_core::security::credentials::{
AuthService, APP_SESSION_PROVIDER, DEFAULT_AUTH_PROFILE_NAME,
};
-use openhuman_core::runtime::javascript::NodeBootstrap;
-use openhuman_core::memory::{
- Memory, MemoryCategory, MemoryEntry, NamespaceSummary, RecallOpts,
-};
use openhuman_core::security::{AuditLogger, AutonomyLevel, SecurityPolicy};
-use openhuman_core::inference::tokenjuice::AgentTokenjuiceCompression;
+use openhuman_core::tools::generated::{
+ admit_generated_tool_definitions, generated_tools_from_definitions, GeneratedToolAdapter,
+ GeneratedToolAdmissionConfig, GeneratedToolDefinition, GeneratedToolRisk,
+};
+use openhuman_core::tools::orchestrator_tools::collect_orchestrator_tools;
use openhuman_core::tools::registry::ops::diagnostics_for_config;
use openhuman_core::tools::registry::{
all_tool_registry_controller_schemas, all_tool_registry_registered_controllers,
@@ -96,20 +94,19 @@ use openhuman_core::tools::registry::{
list_tools, normalize_capability_provider_id, registry_entries,
CapabilityProviderRegistryError,
};
-use openhuman_core::tools::generated::{
- admit_generated_tool_definitions, generated_tools_from_definitions, GeneratedToolAdapter,
- GeneratedToolAdmissionConfig, GeneratedToolDefinition, GeneratedToolRisk,
-};
-use openhuman_core::tools::orchestrator_tools::collect_orchestrator_tools;
-use tinytools::{PermissionLevel, Tool, ToolResult, ToolScope, ToolCategory, ToolCallOptions};
use openhuman_core::tools::{
- all_tools, all_tools_controller_schemas, all_tools_registered_controllers,
- default_tools, ApplyPatchTool, BrowserTool, CleaningStrategy,
- ComputerUseConfig, CsvExportTool, CurrentTimeTool, DefaultToolPolicy, DetectToolsTool,
- EditFileTool, FileReadTool, FileWriteTool, GitbooksGetPageTool, GitbooksSearchTool, GlobTool,
- GrepTool, InsertSqlRecordTool, ListFilesTool, LspTool, NodeExecTool, NpmExecTool,
- PolicyDecision, ProxyConfigTool, ReadDiffTool, RunLinterTool, RunTestsTool,
- SchemaCleanr, ToolPolicy, UpdateApplyTool, UpdateMemoryMdTool, WebFetchTool, WorkspaceStateTool};
+ all_tools, all_tools_controller_schemas, all_tools_registered_controllers, default_tools,
+ ApplyPatchTool, BrowserTool, CleaningStrategy, ComputerUseConfig, CsvExportTool,
+ CurrentTimeTool, DefaultToolPolicy, DetectToolsTool, EditFileTool, FileReadTool, FileWriteTool,
+ GitbooksGetPageTool, GitbooksSearchTool, GlobTool, GrepTool, InsertSqlRecordTool,
+ ListFilesTool, LspTool, NodeExecTool, NpmExecTool, PolicyDecision, ProxyConfigTool,
+ ReadDiffTool, RunLinterTool, RunTestsTool, SchemaCleanr, ToolPolicy, UpdateApplyTool,
+ UpdateMemoryMdTool, WebFetchTool, WorkspaceStateTool,
+};
+use openhuman_core::web_chat::WebChannelEvent;
+use openhuman_rpc::server::build_core_http_router;
+use tinybus::EventHandler;
+use tinytools::{PermissionLevel, Tool, ToolCallOptions, ToolCategory, ToolResult, ToolScope};
const TEST_RPC_TOKEN: &str = "tools-approval-channels-raw-e2e-token";
@@ -360,7 +357,6 @@ fn env_lock() -> std::sync::MutexGuard<'static, ()> {
}
fn ensure_rpc_auth() {
-
crate::tinyhumans_boot::boot();
AUTH_INIT.get_or_init(|| {
std::env::set_var(CORE_TOKEN_ENV_VAR, TEST_RPC_TOKEN);
@@ -693,7 +689,6 @@ disallowed_tools = ["write_file"]
}
async fn setup() -> Harness {
-
crate::tinyhumans_boot::boot();
let tmp = tempdir().expect("tempdir");
let home = tmp.path();
@@ -1575,11 +1570,13 @@ fn tools_and_tool_registry_public_surfaces_cover_schema_and_assembly_paths() {
assert!(!default_tool.is_concurrency_safe(&json!({})));
assert!(!default_tool.external_effect());
assert!(!default_tool.external_effect_with_args(&json!({})));
- assert!(openhuman_core::tools::host_extensions::generated_runtime_context(
- &default_tool,
- &json!({})
- )
- .is_none());
+ assert!(
+ openhuman_core::tools::host_extensions::generated_runtime_context(
+ &default_tool,
+ &json!({})
+ )
+ .is_none()
+ );
assert!(default_tool.max_result_size_chars().is_none());
let computer = ComputerUseConfig {
@@ -2121,11 +2118,9 @@ async fn web_channel_public_paths_cover_event_delivery_and_validation_errors() {
.is_none()
);
openhuman_core::web_chat::invalidate_thread_sessions("thread-1").await;
- assert!(
- openhuman_core::web_chat::in_flight_entries_for_test()
- .await
- .is_empty()
- );
+ assert!(openhuman_core::web_chat::in_flight_entries_for_test()
+ .await
+ .is_empty());
}
#[tokio::test]
diff --git a/tests/raw_coverage/tools_network_channels_raw_coverage_e2e.rs b/tests/raw_coverage/tools_network_channels_raw_coverage_e2e.rs
index a4d6ddc19f..d3c5e479af 100644
--- a/tests/raw_coverage/tools_network_channels_raw_coverage_e2e.rs
+++ b/tests/raw_coverage/tools_network_channels_raw_coverage_e2e.rs
@@ -18,17 +18,16 @@ use serde_json::json;
use tempfile::{tempdir, TempDir};
use tokio::time::timeout;
+use openhuman_core::config::{AutonomyConfig, Config};
+use openhuman_core::security::{AutonomyLevel, SecurityPolicy};
+use openhuman_core::tools::{ComposioTool, GitOperationsTool, ScheduleTool};
use openhuman_core::web_chat::WebChannelEvent;
use openhuman_core::web_chat::{
all_web_channel_controller_schemas, all_web_channel_registered_controllers, cancel_chat,
channel_web_cancel, publish_web_channel_event, schemas as web_channel_schema, start_chat,
subscribe_web_channel_events, ChatRequestMetadata,
};
-use openhuman_core::config::{AutonomyConfig, Config};
-use openhuman_core::security::{AutonomyLevel, SecurityPolicy};
use tinytools::{Tool, ToolCallOptions};
-use openhuman_core::tools::{
- ComposioTool, GitOperationsTool, ScheduleTool};
#[derive(Clone, Debug)]
struct MockRequest {
diff --git a/tests/raw_coverage/w4_shared/mod.rs b/tests/raw_coverage/w4_shared/mod.rs
index b82c38c3f0..3b9eb96279 100644
--- a/tests/raw_coverage/w4_shared/mod.rs
+++ b/tests/raw_coverage/w4_shared/mod.rs
@@ -67,7 +67,8 @@ pub fn env_lock() -> std::sync::MutexGuard<'static, ()> {
/// fresh token into a per-process directory, so we add no env racer of our own.
fn rpc_token() -> &'static str {
AUTH_INIT.get_or_init(|| {
- let token_dir = std::env::temp_dir().join(format!("openhuman-w4-e2e-{}", std::process::id()));
+ let token_dir =
+ std::env::temp_dir().join(format!("openhuman-w4-e2e-{}", std::process::id()));
std::fs::create_dir_all(&token_dir).expect("create the rpc token dir");
init_rpc_token(&token_dir).expect("init the core rpc auth token");
get_rpc_token()
@@ -225,8 +226,7 @@ encrypt = false
// itself, instead of surfacing as "the RPC handler ignored my config".
let declared: toml::Value =
toml::from_str(extra_toml).expect("the extra TOML fixture must parse on its own");
- let merged: toml::Value =
- toml::from_str(&cfg).expect("the assembled config.toml must parse");
+ let merged: toml::Value = toml::from_str(&cfg).expect("the assembled config.toml must parse");
if let (Some(declared), Some(merged)) = (declared.as_table(), merged.as_table()) {
for key in declared.keys() {
assert!(
@@ -511,7 +511,11 @@ async fn credits_setup_intent(
headers: HeaderMap,
) -> Result<Json<Value>, (StatusCode, Json<Value>)> {
require_session(&headers)?;
- log.record("POST", "/payments/credits/auto-recharge/cards/setup-intent", None);
+ log.record(
+ "POST",
+ "/payments/credits/auto-recharge/cards/setup-intent",
+ None,
+ );
Ok(Json(json!({
"success": true,
"data": { "clientSecret": "seti_w4_secret", "setupIntentId": "seti_w4" }
@@ -600,7 +604,10 @@ async fn referral_claim(
log.record("POST", "/referral/claim", Some(&body));
let code = body.get("code").and_then(Value::as_str).unwrap_or_default();
if code.is_empty() {
- return Err(err_json(StatusCode::BAD_REQUEST, "referral code is required"));
+ return Err(err_json(
+ StatusCode::BAD_REQUEST,
+ "referral code is required",
+ ));
}
Ok(Json(json!({
"success": true,
@@ -667,7 +674,9 @@ async fn team_delete(
) -> Result<Json<Value>, (StatusCode, Json<Value>)> {
require_session(&headers)?;
log.record("DELETE", &format!("/teams/{team_id}"), None);
- Ok(Json(json!({ "success": true, "data": { "deleted": team_id } })))
+ Ok(Json(
+ json!({ "success": true, "data": { "deleted": team_id } }),
+ ))
}
async fn team_switch(
@@ -690,7 +699,9 @@ async fn team_leave(
) -> Result<Json<Value>, (StatusCode, Json<Value>)> {
require_session(&headers)?;
log.record("POST", &format!("/teams/{team_id}/leave"), None);
- Ok(Json(json!({ "success": true, "data": { "left": team_id } })))
+ Ok(Json(
+ json!({ "success": true, "data": { "left": team_id } }),
+ ))
}
async fn team_join(
diff --git a/tests/raw_coverage/webhooks_ingress_e2e.rs b/tests/raw_coverage/webhooks_ingress_e2e.rs
index ae18a8ad05..7c9ed87ae4 100644
--- a/tests/raw_coverage/webhooks_ingress_e2e.rs
+++ b/tests/raw_coverage/webhooks_ingress_e2e.rs
@@ -49,11 +49,11 @@ use serde_json::{json, Value};
use tempfile::tempdir;
use openhuman_core::core::auth::{get_rpc_token, init_rpc_token};
-use openhuman_rpc::server::build_core_http_router;
use openhuman_core::platform::socket::{
global_socket_manager, set_global_socket_manager, SocketManager,
};
use openhuman_core::skills::webhooks::{WebhookRequest, WebhookRouter};
+use openhuman_rpc::server::build_core_http_router;
// ── env serialisation ────────────────────────────────────────────────────────
//
@@ -91,7 +91,6 @@ fn rpc_bearer() -> &'static str {
}
fn ensure_rpc_auth() {
-
crate::tinyhumans_boot::boot();
let _ = rpc_bearer();
}
@@ -177,10 +176,7 @@ impl BackendState {
}
fn calls(&self) -> Vec<RecordedCall> {
- self.calls
- .lock()
- .unwrap_or_else(|p| p.into_inner())
- .clone()
+ self.calls.lock().unwrap_or_else(|p| p.into_inner()).clone()
}
}
@@ -301,7 +297,9 @@ async fn mock_delete_tunnel(
return Err(unauthorized());
}
state.record("DELETE", &format!("/webhooks/core/{id}"), None);
- Ok(Json(json!({ "success": true, "data": { "deleted": true, "id": id } })))
+ Ok(Json(
+ json!({ "success": true, "data": { "deleted": true, "id": id } }),
+ ))
}
async fn mock_bandwidth(
@@ -489,7 +487,10 @@ async fn webhooks_registration_lifecycle_and_ownership_guards() {
json!({ "tunnel_uuid": echo_uuid, "tunnel_name": "Echo Tunnel", "backend_tunnel_id": "bt-9" }),
)
.await;
- let result = peel(assert_no_jsonrpc_error(&registered, "webhooks_register_echo"));
+ let result = peel(assert_no_jsonrpc_error(
+ &registered,
+ "webhooks_register_echo",
+ ));
let row = registration(result, echo_uuid).expect("echo registration present in response");
assert_eq!(
row.get("target_kind").and_then(Value::as_str),
@@ -531,7 +532,10 @@ async fn webhooks_registration_lifecycle_and_ownership_guards() {
.await;
let result = peel(assert_no_jsonrpc_error(&agent, "webhooks_register_agent"));
let row = registration(result, agent_uuid).expect("agent registration present");
- assert_eq!(row.get("target_kind").and_then(Value::as_str), Some("agent"));
+ assert_eq!(
+ row.get("target_kind").and_then(Value::as_str),
+ Some("agent")
+ );
assert_eq!(row.get("agent_id").and_then(Value::as_str), Some("agent-a"));
let rebind = post_json_rpc(
@@ -662,7 +666,10 @@ async fn webhooks_debug_log_ring_records_and_clears() {
json!({ "limit": 50 }),
)
.await;
- let result = peel(assert_no_jsonrpc_error(&empty, "webhooks_list_logs (empty)"));
+ let result = peel(assert_no_jsonrpc_error(
+ &empty,
+ "webhooks_list_logs (empty)",
+ ));
assert_eq!(
result.get("logs").and_then(Value::as_array).map(Vec::len),
Some(0),
@@ -687,7 +694,11 @@ async fn webhooks_debug_log_ring_records_and_clears() {
.get("logs")
.and_then(Value::as_array)
.expect("logs array");
- assert_eq!(logs.len(), 1, "one recorded request → one log entry: {result}");
+ assert_eq!(
+ logs.len(),
+ 1,
+ "one recorded request → one log entry: {result}"
+ );
let entry = &logs[0];
assert_eq!(
entry.get("correlation_id").and_then(Value::as_str),
@@ -716,7 +727,10 @@ async fn webhooks_debug_log_ring_records_and_clears() {
json!({ "limit": 0 }),
)
.await;
- let result = peel(assert_no_jsonrpc_error(&zero, "webhooks_list_logs (limit 0)"));
+ let result = peel(assert_no_jsonrpc_error(
+ &zero,
+ "webhooks_list_logs (limit 0)",
+ ));
assert_eq!(
result.get("logs").and_then(Value::as_array).map(Vec::len),
Some(0),
@@ -731,7 +745,10 @@ async fn webhooks_debug_log_ring_records_and_clears() {
json!({ "limit": 1 }),
)
.await;
- let result = peel(assert_no_jsonrpc_error(&one, "webhooks_list_logs (limit 1)"));
+ let result = peel(assert_no_jsonrpc_error(
+ &one,
+ "webhooks_list_logs (limit 1)",
+ ));
assert_eq!(
result.get("logs").and_then(Value::as_array).map(Vec::len),
Some(1),
@@ -748,7 +765,10 @@ async fn webhooks_debug_log_ring_records_and_clears() {
);
let after = post_json_rpc(&rpc_base, 7105, "openhuman.webhooks_list_logs", json!({})).await;
- let result = peel(assert_no_jsonrpc_error(&after, "webhooks_list_logs (after)"));
+ let result = peel(assert_no_jsonrpc_error(
+ &after,
+ "webhooks_list_logs (after)",
+ ));
assert_eq!(
result.get("logs").and_then(Value::as_array).map(Vec::len),
Some(0)
@@ -876,7 +896,10 @@ async fn webhooks_backend_tunnel_crud_roundtrip() {
.find(|c| c.method == "POST" && c.path == "/webhooks/core")
.expect("a POST /webhooks/core was issued");
let body = create_call.body.expect("create body");
- assert_eq!(body.get("name").and_then(Value::as_str), Some("Payments Hook"));
+ assert_eq!(
+ body.get("name").and_then(Value::as_str),
+ Some("Payments Hook")
+ );
assert!(
body.get("description").is_none(),
"a whitespace-only description must be omitted from the body, not sent empty: {body}"
@@ -959,7 +982,11 @@ async fn webhooks_backend_tunnel_crud_roundtrip() {
.get("tunnels")
.and_then(Value::as_array)
.expect("tunnels array");
- assert_eq!(tunnels.len(), 1, "list_tunnels must surface the backend rows: {result}");
+ assert_eq!(
+ tunnels.len(),
+ 1,
+ "list_tunnels must surface the backend rows: {result}"
+ );
assert_eq!(tunnels[0].get("id").and_then(Value::as_str), Some("tun-1"));
// ── bandwidth: its own path, not the `{id}` capture.
@@ -970,7 +997,10 @@ async fn webhooks_backend_tunnel_crud_roundtrip() {
json!({}),
)
.await;
- let result = peel(assert_no_jsonrpc_error(&bandwidth, "webhooks_get_bandwidth"));
+ let result = peel(assert_no_jsonrpc_error(
+ &bandwidth,
+ "webhooks_get_bandwidth",
+ ));
assert_eq!(
result.get("bytesIn").and_then(Value::as_u64),
Some(4096),
@@ -1006,7 +1036,8 @@ async fn webhooks_backend_tunnel_crud_roundtrip() {
)
.await;
assert!(
- jsonrpc_error_message(&blank_name, "create_tunnel with a blank name").contains("name is required"),
+ jsonrpc_error_message(&blank_name, "create_tunnel with a blank name")
+ .contains("name is required"),
"a whitespace-only name must be rejected locally"
);
@@ -1031,7 +1062,8 @@ async fn webhooks_backend_tunnel_crud_roundtrip() {
)
.await;
assert!(
- jsonrpc_error_message(&blank_delete, "delete_tunnel with a blank id").contains("id is required")
+ jsonrpc_error_message(&blank_delete, "delete_tunnel with a blank id")
+ .contains("id is required")
);
assert_eq!(
state.calls().len(),
diff --git a/tests/raw_coverage/worker_b_raw_coverage_e2e.rs b/tests/raw_coverage/worker_b_raw_coverage_e2e.rs
index 84d7bee988..8b3e1dab54 100644
--- a/tests/raw_coverage/worker_b_raw_coverage_e2e.rs
+++ b/tests/raw_coverage/worker_b_raw_coverage_e2e.rs
@@ -19,17 +19,17 @@ use reqwest::StatusCode;
use serde_json::{json, Value};
use tempfile::{tempdir, TempDir};
-use openhuman_core::core::auth::{init_rpc_token, CORE_TOKEN_ENV_VAR};
-use openhuman_rpc::server::build_core_http_router;
use openhuman_core::agent::turn_origin::{self, AgentTurnOrigin};
+use openhuman_core::config::Config;
+use openhuman_core::core::auth::{init_rpc_token, CORE_TOKEN_ENV_VAR};
use openhuman_core::security::approval::gate::{
ApprovalChatContext, ApprovalGate, APPROVAL_CHAT_CONTEXT,
};
use openhuman_core::security::approval::types::{ExecutionOutcome, GateOutcome};
-use openhuman_core::config::Config;
use openhuman_core::security::credentials::{
AuthService, APP_SESSION_PROVIDER, DEFAULT_AUTH_PROFILE_NAME,
};
+use openhuman_rpc::server::build_core_http_router;
const TEST_RPC_TOKEN: &str = "worker-b-raw-coverage-e2e-token";
@@ -281,8 +281,7 @@ async fn setup() -> TestHarness {
EnvVarGuard::set("OPENHUMAN_MEMORY_EMBED_MODEL", ""),
];
- let _ =
- openhuman_core::agent::harness::AgentDefinitionRegistry::init_global_builtins();
+ let _ = openhuman_core::agent::harness::AgentDefinitionRegistry::init_global_builtins();
let (addr, rpc_join) = serve_rpc().await;
TestHarness {
@@ -512,7 +511,6 @@ async fn tools_web_search_success_path_uses_backend_session_and_shapes_results()
mock.join.abort();
}
-
#[tokio::test]
async fn approval_gate_rpc_decision_resumes_parked_tool_and_records_execution() {
let _lock = env_lock();