Skip to content

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

chore: reorder imports and doc comments across multiple files

Steven Enamakel8ef48a056ad3
diff --git a/crates/openhuman-core/src/agent/harness/session/transcript/jsonl.rs b/crates/openhuman-core/src/agent/harness/session/transcript/jsonl.rs
index 57edc44399..7e18e549b6 100644
--- a/crates/openhuman-core/src/agent/harness/session/transcript/jsonl.rs
+++ b/crates/openhuman-core/src/agent/harness/session/transcript/jsonl.rs
@@ -1,8 +1,9 @@
-use crate::agent::harness::session::transcript::metadata::turn_usage_from_metadata;
//! JSONL line shapes (`_meta`, message, and compaction records) and the
//! conversions between them and the public [`ChatMessage`] /
//! [`TranscriptMeta`] / [`DisplayMessage`] types.
+
+use crate::agent::harness::session::transcript::metadata::turn_usage_from_metadata;
use super::metadata::{attach_turn_usage_metadata, take_tool_failure};
use super::types::{
DisplayMessage, MessageUsage, TranscriptMeta, TurnUsage, TRANSCRIPT_SCHEMA_VERSION,
diff --git a/crates/openhuman-core/src/agent/tinyagents/turn_runner.rs b/crates/openhuman-core/src/agent/tinyagents/turn_runner.rs
index 9f25163f80..1b1edb1506 100644
--- a/crates/openhuman-core/src/agent/tinyagents/turn_runner.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/turn_runner.rs
@@ -1,12 +1,13 @@
-use crate::agent::tinyagents::model::ProfileOverrideModel;
-use crate::agent::tinyagents::model::TurnChatModel;
-use crate::agent::tinyagents::run_policy_for;
//! Drive an openhuman agent turn through the `tinyagents` agent-loop harness.
//!
//! [`run_turn_via_tinyagents_shared`] is the entry point the channel/session/
//! sub-agent routes use; [`run_turn_via_tinyagents`] is a thin test-only
//! variant with no middleware stack.
+
+use crate::agent::tinyagents::model::ProfileOverrideModel;
+use crate::agent::tinyagents::model::TurnChatModel;
+use crate::agent::tinyagents::run_policy_for;
use std::collections::HashSet;
use std::sync::Arc;
diff --git a/crates/openhuman-core/src/inference/provider/factory/cloud_slug.rs b/crates/openhuman-core/src/inference/provider/factory/cloud_slug.rs
index 2837c5bbfc..9eaf690043 100644
--- a/crates/openhuman-core/src/inference/provider/factory/cloud_slug.rs
+++ b/crates/openhuman-core/src/inference/provider/factory/cloud_slug.rs
@@ -1,11 +1,12 @@
+//! `<slug>:<model>` BYOK cloud providers: shared slug resolution (model fallback,
+//! abstract-tier remapping, credentials, codex routing) and the crate-native builders.
+
+
use crate::inference::provider::crate_anthropic;
use crate::inference::provider::crate_openai;
use crate::inference::provider::factory::access_gates::verify_backend_session_active;
use crate::inference::provider::factory::access_gates::verify_session_active;
use crate::inference::provider::fallback_diagnostics;
-//! `<slug>:<model>` BYOK cloud providers: shared slug resolution (model fallback,
-//! abstract-tier remapping, credentials, codex routing) and the crate-native builders.
-
use super::*;
/// Look up a `cloud_providers` entry by slug and build the provider.
diff --git a/crates/openhuman-core/src/inference/provider/factory/local_runtime.rs b/crates/openhuman-core/src/inference/provider/factory/local_runtime.rs
index 307ded6d11..3f882832d1 100644
--- a/crates/openhuman-core/src/inference/provider/factory/local_runtime.rs
+++ b/crates/openhuman-core/src/inference/provider/factory/local_runtime.rs
@@ -1,8 +1,9 @@
-use crate::inference::provider::crate_openai;
-use crate::inference::provider::factory::access_gates::verify_session_active;
//! Local OpenAI-compatible runtimes (Ollama / LM Studio / MLX / OMLX /
//! local-openai) as crate-native `ChatModel`s.
+
+use crate::inference::provider::crate_openai;
+use crate::inference::provider::factory::access_gates::verify_session_active;
use super::*;
/// Local OpenAI-compatible runtimes (Ollama / LM Studio / MLX / OMLX /
diff --git a/crates/openhuman-core/src/integrations/composio/catalog_tests.rs b/crates/openhuman-core/src/integrations/composio/catalog_tests.rs
index 90752335e2..6951536f65 100644
--- a/crates/openhuman-core/src/integrations/composio/catalog_tests.rs
+++ b/crates/openhuman-core/src/integrations/composio/catalog_tests.rs
@@ -1,4 +1,3 @@
-use crate::json_schema::compute_primary_array_path_from_value;
//! Unit tests for the live Composio catalog and the real-output probe.
//!
//! Moved here with the code they exercise. Two of them
@@ -8,6 +7,8 @@ use crate::json_schema::compute_primary_array_path_from_value;
//! a foreign test can call it would leak implementation surface to the whole
//! crate to satisfy a test.
+
+use crate::json_schema::compute_primary_array_path_from_value;
// `super` is `catalog` itself — this file is included as its child module — so
// the glob reaches its private helpers as well as its imports.
use super::*;
diff --git a/crates/openhuman-core/src/mcp/registry/schemas/setup_handlers.rs b/crates/openhuman-core/src/mcp/registry/schemas/setup_handlers.rs
index f6728932a8..10616b2b4c 100644
--- a/crates/openhuman-core/src/mcp/registry/schemas/setup_handlers.rs
+++ b/crates/openhuman-core/src/mcp/registry/schemas/setup_handlers.rs
@@ -1,9 +1,10 @@
-use crate::mcp::registry::schemas::params::read_optional_string;
-use crate::mcp::registry::schemas::params::read_optional_u32;
-use crate::mcp::registry::schemas::read_optional_u32;
//! `mcp_setup` handler implementations — deserialise params and delegate
//! to `setup_ops.rs`.
+
+use crate::mcp::registry::schemas::params::read_optional_string;
+use crate::mcp::registry::schemas::params::read_optional_u32;
+use crate::mcp::registry::schemas::read_optional_u32;
use serde_json::{Map, Value};
use crate::config::rpc as config_rpc;
diff --git a/crates/openhuman-core/src/memory/sources/rpc_tests.rs b/crates/openhuman-core/src/memory/sources/rpc_tests.rs
index 30a87a2c66..632eaf8e7e 100644
--- a/crates/openhuman-core/src/memory/sources/rpc_tests.rs
+++ b/crates/openhuman-core/src/memory/sources/rpc_tests.rs
@@ -1,8 +1,3 @@
-use crate::memory::sources::rpc::apply_all::trigger_enabled_syncs;
-use crate::memory::sources::rpc::coding_sessions::unserved;
-use crate::memory::sources::rpc::source_sync::SyncDispatch;
-use crate::memory::sources::rpc::source_sync::describe_source_sync_failure;
-use crate::memory::sources::rpc::source_sync::sync_dispatch;
//! Tests for the driver-backed handlers in [`super`].
//!
//! A sibling file rather than an inline `mod tests`, because the null-driver
@@ -12,6 +7,12 @@ use crate::memory::sources::rpc::source_sync::sync_dispatch;
//! that scanner guards is one that may shrink and must never grow — so the
//! honest fix is to put the test where the repo already puts tests.
+
+use crate::memory::sources::rpc::apply_all::trigger_enabled_syncs;
+use crate::memory::sources::rpc::coding_sessions::unserved;
+use crate::memory::sources::rpc::source_sync::SyncDispatch;
+use crate::memory::sources::rpc::source_sync::describe_source_sync_failure;
+use crate::memory::sources::rpc::source_sync::sync_dispatch;
use super::*;
use crate::core::subsystem::DriverClass;
use crate::memory::api::error::MemoryError;
diff --git a/crates/openhuman-core/src/memory/sync/composio/bus_tests.rs b/crates/openhuman-core/src/memory/sync/composio/bus_tests.rs
index 0b92958065..6aa55bbe7e 100644
--- a/crates/openhuman-core/src/memory/sync/composio/bus_tests.rs
+++ b/crates/openhuman-core/src/memory/sync/composio/bus_tests.rs
@@ -1,9 +1,10 @@
+//! Unit tests for the composio connection-created event handler's gating.
+
+
use crate::core::events::DomainEvent;
use crate::memory::sync::composio::bus::trigger_subscriber::TRIAGE_DISABLED_ENV;
use crate::memory::sync::composio::bus::trigger_subscriber::triage_disabled;
use crate::memory::sync::composio::bus::connection_created_subscriber::WaitError;
-//! Unit tests for the composio connection-created event handler's gating.
-
use super::toolkit_is_memory_source_registrable;
use super::*;
use serde_json::json;
diff --git a/crates/openhuman-core/src/modules/memory_tests.rs b/crates/openhuman-core/src/modules/memory_tests.rs
index 4200d74060..ea7f35fd15 100644
--- a/crates/openhuman-core/src/modules/memory_tests.rs
+++ b/crates/openhuman-core/src/modules/memory_tests.rs
@@ -1,5 +1,3 @@
-use crate::modules::memory::capabilities::capabilities_for;
-use crate::modules::memory::capabilities::ARTIFACT_CAPABILITIES_PIN;
//! Tests for the memory module client.
//!
//! Nothing here loads a module. What is testable without one is what decides a
@@ -9,6 +7,9 @@ use crate::modules::memory::capabilities::ARTIFACT_CAPABILITIES_PIN;
//! where they can be honest — `tinymemory`'s own loader E2E, against a real
//! broker and a real `dlopen`.
+
+use crate::modules::memory::capabilities::capabilities_for;
+use crate::modules::memory::capabilities::ARTIFACT_CAPABILITIES_PIN;
use std::sync::Arc;
use tinymemory_api::capabilities::{Capabilities, Capability};
diff --git a/crates/openhuman-core/src/platform/socket/ws_loop/dispatch.rs b/crates/openhuman-core/src/platform/socket/ws_loop/dispatch.rs
index 2f3be28591..2fc5184004 100644
--- a/crates/openhuman-core/src/platform/socket/ws_loop/dispatch.rs
+++ b/crates/openhuman-core/src/platform/socket/ws_loop/dispatch.rs
@@ -1,9 +1,10 @@
-use crate::platform::socket::manager::emit_state_change;
-use crate::platform::socket::medulla::workflows;
-use crate::platform::socket::types::ConnectionStatus;
//! Incoming-message dispatch: Engine.IO framing and Socket.IO packet/ack
//! parsing.
+
+use crate::platform::socket::manager::emit_state_change;
+use crate::platform::socket::medulla::workflows;
+use crate::platform::socket::types::ConnectionStatus;
use std::sync::Arc;
use tokio::sync::mpsc;
diff --git a/crates/openhuman-core/src/search/tools/tavily/extract_tool.rs b/crates/openhuman-core/src/search/tools/tavily/extract_tool.rs
index 385e02b000..a20b888046 100644
--- a/crates/openhuman-core/src/search/tools/tavily/extract_tool.rs
+++ b/crates/openhuman-core/src/search/tools/tavily/extract_tool.rs
@@ -1,7 +1,8 @@
-use crate::search::tools::tavily::types::escape_link_destination;
-use crate::search::tools::tavily::types::escape_link_text;
//! `TavilyExtractTool`: full page content retrieval via `POST /extract`.
+
+use crate::search::tools::tavily::types::escape_link_destination;
+use crate::search::tools::tavily::types::escape_link_text;
use super::client::TavilyClient;
use super::types::{copy_string, non_empty, TavilyExtractResponse, TavilyExtractResult};
use crate::tools::traits::{Tool, ToolCallOptions, ToolResult};