Skip to content

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

chore: files changed crates/openhuman-core/src/core/all_registry_tests.rs,crates/openhuman-core/src/

Steven Enamakel977b0e6e0251
diff --git a/crates/openhuman-core/src/core/all_registry_tests.rs b/crates/openhuman-core/src/core/all_registry_tests.rs
index 220ef289c2..c545b2176a 100644
--- a/crates/openhuman-core/src/core/all_registry_tests.rs
+++ b/crates/openhuman-core/src/core/all_registry_tests.rs
@@ -40,7 +40,7 @@ async fn doctor_report_is_in_both_scoped_saas_dispatch_and_schema_surfaces() {
let (unscoped_methods, unscoped_schemas) = (
all_registered_controllers()
.iter()
- .map(RegisteredController::rpc_method_name)
+ .map(ControllerEntry::rpc_method_name
.collect::<Vec<_>>(),
all_controller_schemas()
.iter()
@@ -52,7 +52,7 @@ async fn doctor_report_is_in_both_scoped_saas_dispatch_and_schema_surfaces() {
(
all_registered_controllers()
.iter()
- .map(RegisteredController::rpc_method_name)
+ .map(ControllerEntry::rpc_method_name
.collect::<Vec<_>>(),
all_controller_schemas()
.iter()
@@ -65,7 +65,7 @@ async fn doctor_report_is_in_both_scoped_saas_dispatch_and_schema_surfaces() {
(
all_registered_controllers()
.iter()
- .map(RegisteredController::rpc_method_name)
+ .map(ControllerEntry::rpc_method_name
.collect::<Vec<_>>(),
all_controller_schemas()
.iter()
diff --git a/crates/openhuman-core/src/doctor/checks/channels.rs b/crates/openhuman-core/src/doctor/checks/channels.rs
index 0a21079e46..8a9475d0c4 100644
--- a/crates/openhuman-core/src/doctor/checks/channels.rs
+++ b/crates/openhuman-core/src/doctor/checks/channels.rs
@@ -136,7 +136,9 @@ impl ChannelHealthCheck {
};
let label = channel_label(&self.provider);
match report.state {
- ChannelHealthState::Healthy => Finding::pass(&self.id, format!("{label} is healthy.")),
+ ChannelHealthState::Healthy => {
+ Finding::pass(&self.id, format!("{label} is healthy."))
+ }
ChannelHealthState::Unhealthy => Finding::error(
&self.id,
format!("{label} is unhealthy (auth/config/network)."),
diff --git a/crates/openhuman-core/src/doctor/checks/channels_tests.rs b/crates/openhuman-core/src/doctor/checks/channels_tests.rs
index 8925e93955..dcfd683fa4 100644
--- a/crates/openhuman-core/src/doctor/checks/channels_tests.rs
+++ b/crates/openhuman-core/src/doctor/checks/channels_tests.rs
@@ -1,8 +1,8 @@
use super::*;
use crate::doctor::contract::{DoctorCtx, FindingSeverity};
use std::sync::{
- atomic::{AtomicUsize, Ordering},
Arc,
+ atomic::{AtomicUsize, Ordering},
};
use tinychannels_bus::{ChannelHealthReport, ChannelHealthState, HttpProxyPolicy};
diff --git a/crates/openhuman-core/src/doctor/checks/config_file.rs b/crates/openhuman-core/src/doctor/checks/config_file.rs
index d1f4a28fdf..b1e61aaa3c 100644
--- a/crates/openhuman-core/src/doctor/checks/config_file.rs
+++ b/crates/openhuman-core/src/doctor/checks/config_file.rs
@@ -5,8 +5,8 @@ use std::sync::Arc;
use async_trait::async_trait;
use serde_json::Value;
-use crate::config::schema::load::ConfigLoadFallback;
use crate::config::Config;
+use crate::config::schema::load::ConfigLoadFallback;
use crate::doctor::contract::{DoctorCheck, DoctorCtx, DoctorTier, Finding, FindingSeverity};
const CATEGORY: &str = "configuration";
diff --git a/crates/openhuman-core/src/doctor/checks/config_file_tests.rs b/crates/openhuman-core/src/doctor/checks/config_file_tests.rs
index 5ff9188ef8..7424c87bad 100644
--- a/crates/openhuman-core/src/doctor/checks/config_file_tests.rs
+++ b/crates/openhuman-core/src/doctor/checks/config_file_tests.rs
@@ -77,9 +77,11 @@ async fn typed_parse_error_reports_field_path_and_backup_fallback_safely() {
error.message
);
assert!(!error.message.contains("837465"));
- assert!(!error
- .message
- .contains(&directory.path().display().to_string()));
+ assert!(
+ !error
+ .message
+ .contains(&directory.path().display().to_string())
+ );
}
#[tokio::test]
diff --git a/crates/openhuman-core/src/doctor/checks/config_provenance_tests.rs b/crates/openhuman-core/src/doctor/checks/config_provenance_tests.rs
index 537b774b8f..cfdbf2ef73 100644
--- a/crates/openhuman-core/src/doctor/checks/config_provenance_tests.rs
+++ b/crates/openhuman-core/src/doctor/checks/config_provenance_tests.rs
@@ -1,5 +1,5 @@
-use crate::config::schema::load::{DotenvLoadProvenance, ProvenanceSource};
use crate::config::Config;
+use crate::config::schema::load::{DotenvLoadProvenance, ProvenanceSource};
use super::contract::{
DoctorCtx, DoctorOptions, DoctorTier, Finding, FindingSeverity, ValueSource,
diff --git a/crates/openhuman-core/src/doctor/checks/config_semantics.rs b/crates/openhuman-core/src/doctor/checks/config_semantics.rs
index 1058cc7043..b999bea0f0 100644
--- a/crates/openhuman-core/src/doctor/checks/config_semantics.rs
+++ b/crates/openhuman-core/src/doctor/checks/config_semantics.rs
@@ -6,7 +6,7 @@ use async_trait::async_trait;
use crate::config::Config;
use crate::doctor::contract::{DoctorCheck, DoctorCtx, DoctorTier, Finding, FindingSeverity};
-use crate::storage::{StorageUrl, STORAGE_URL_VAR};
+use crate::storage::{STORAGE_URL_VAR, StorageUrl};
use tinystoragedrivers::{BlobConfig, StorageConfig};
const COMPONENTS_ID: &str = "components/referenced-but-disabled";
diff --git a/crates/openhuman-core/src/doctor/checks/config_semantics_tests.rs b/crates/openhuman-core/src/doctor/checks/config_semantics_tests.rs
index 3c39f4b390..c5c7658010 100644
--- a/crates/openhuman-core/src/doctor/checks/config_semantics_tests.rs
+++ b/crates/openhuman-core/src/doctor/checks/config_semantics_tests.rs
@@ -1,4 +1,4 @@
-use crate::config::{test_env::EnvVarGuard, Config};
+use crate::config::{Config, test_env::EnvVarGuard};
use crate::doctor::contract::{DoctorCtx, DoctorOptions, Finding, FindingSeverity};
use crate::doctor::runner;
@@ -84,9 +84,11 @@ async fn disabled_memory_component_ignores_an_implicit_default_engine() {
let findings = run_check(config, "components/referenced-but-disabled").await;
- assert!(!findings
- .iter()
- .any(|finding| finding.severity == FindingSeverity::Warn));
+ assert!(
+ !findings
+ .iter()
+ .any(|finding| finding.severity == FindingSeverity::Warn)
+ );
}
#[tokio::test]
@@ -120,9 +122,11 @@ async fn disabled_memory_component_does_not_warn_for_explicit_none_engine() {
let findings = run_check(config, "components/referenced-but-disabled").await;
- assert!(!findings
- .iter()
- .any(|finding| finding.severity == FindingSeverity::Warn));
+ assert!(
+ !findings
+ .iter()
+ .any(|finding| finding.severity == FindingSeverity::Warn)
+ );
}
#[tokio::test]
@@ -200,9 +204,11 @@ async fn missing_storage_driver_is_reported_without_opening_the_backend() {
assert!(!error.message.contains("db.internal"));
}
#[cfg(feature = "storage-mongodb")]
- assert!(findings
- .iter()
- .any(|finding| finding.severity == FindingSeverity::Pass));
+ assert!(
+ findings
+ .iter()
+ .any(|finding| finding.severity == FindingSeverity::Pass)
+ );
}
#[cfg(not(feature = "storage-sqlite"))]
@@ -214,9 +220,11 @@ async fn sqlite_is_not_reported_missing_when_only_the_core_marker_is_off() {
let findings = run_check(config, "storage/url").await;
- assert!(findings
- .iter()
- .any(|finding| finding.severity == FindingSeverity::Pass));
+ assert!(
+ findings
+ .iter()
+ .any(|finding| finding.severity == FindingSeverity::Pass)
+ );
}
#[tokio::test]
@@ -308,9 +316,11 @@ async fn both_master_key_environment_sources_are_reported_without_initializing_k
let error = finding(&findings, FindingSeverity::Error);
assert!(!error.message.contains("do-not-read-inline"));
- assert!(!error
- .message
- .contains(&supplied_key_file.display().to_string()));
+ assert!(
+ !error
+ .message
+ .contains(&supplied_key_file.display().to_string())
+ );
assert_eq!(workspace_entries(workspace.path()), entries_before);
assert!(!supplied_key_file.exists());
assert!(!workspace.path().join("keyring/master.key").exists());
@@ -329,9 +339,11 @@ async fn empty_master_key_environment_sources_are_treated_as_unset() {
let findings = run_check(Config::default(), "secrets/master-key-env").await;
- assert!(findings
- .iter()
- .any(|finding| finding.severity == FindingSeverity::Pass));
+ assert!(
+ findings
+ .iter()
+ .any(|finding| finding.severity == FindingSeverity::Pass)
+ );
}
#[tokio::test]
diff --git a/crates/openhuman-core/src/doctor/checks/embeddings_live.rs b/crates/openhuman-core/src/doctor/checks/embeddings_live.rs
index 5c0113ea29..351e9173e8 100644
--- a/crates/openhuman-core/src/doctor/checks/embeddings_live.rs
+++ b/crates/openhuman-core/src/doctor/checks/embeddings_live.rs
@@ -3,7 +3,7 @@
use async_trait::async_trait;
use crate::doctor::{ComponentId, DoctorCheck, DoctorCtx, DoctorTier, Finding};
-use crate::inference::embedding_host::{probe_dimensions_for_inspection, InspectionEmbeddingError};
+use crate::inference::embedding_host::{InspectionEmbeddingError, probe_dimensions_for_inspection};
pub(super) struct EmbeddingsLiveCheck;
diff --git a/crates/openhuman-core/src/doctor/checks/embeddings_live_tests.rs b/crates/openhuman-core/src/doctor/checks/embeddings_live_tests.rs
index 468e2fc79d..89b18ddf04 100644
--- a/crates/openhuman-core/src/doctor/checks/embeddings_live_tests.rs
+++ b/crates/openhuman-core/src/doctor/checks/embeddings_live_tests.rs
@@ -5,10 +5,10 @@ use crate::core::slots::Extensions;
use crate::doctor::contract::{DoctorCheck, DoctorCtx, FindingSeverity};
use crate::inference::embedding_host::create_embedding_provider_for_inspection;
use crate::inference::provider::factory::PROVIDER_OPENHUMAN;
-use axum::{extract::State, routing::post, Json, Router};
+use axum::{Json, Router, extract::State, routing::post};
use std::sync::{
- atomic::{AtomicUsize, Ordering},
Arc,
+ atomic::{AtomicUsize, Ordering},
};
use tempfile::TempDir;
@@ -107,10 +107,12 @@ async fn managed_inspection_does_not_fall_back_to_the_mutable_provider_factory()
None,
)
.expect("inspection factory returns its unavailable placeholder");
- assert!(model
- .embed(&["fixed doctor probe".to_owned()])
- .await
- .is_err());
+ assert!(
+ model
+ .embed(&["fixed doctor probe".to_owned()])
+ .await
+ .is_err()
+ );
})
.await;
diff --git a/crates/openhuman-core/src/doctor/checks/embeddings_tests.rs b/crates/openhuman-core/src/doctor/checks/embeddings_tests.rs
index 2642cdc89e..56926a03bf 100644
--- a/crates/openhuman-core/src/doctor/checks/embeddings_tests.rs
+++ b/crates/openhuman-core/src/doctor/checks/embeddings_tests.rs
@@ -1,4 +1,4 @@
-use super::{model_matches, ConfiguredModelCheck};
+use super::{ConfiguredModelCheck, model_matches};
use crate::config::Config;
use crate::doctor::runner;
use crate::doctor::{DoctorCheck, DoctorCtx, DoctorOptions, DoctorTier, Finding, FindingSeverity};
@@ -63,10 +63,12 @@ async fn missing_embedding_model_and_dimensions_are_reported() {
paths.contains(&"memory.embedding_dimensions"),
"missing dimensions path in findings: {findings:#?}"
);
- assert!(findings
- .iter()
- .filter(|result| result.check_id == EMBEDDINGS_CONFIG)
- .all(|result| result.severity == FindingSeverity::Error));
+ assert!(
+ findings
+ .iter()
+ .filter(|result| result.check_id == EMBEDDINGS_CONFIG)
+ .all(|result| result.severity == FindingSeverity::Error)
+ );
}
#[tokio::test]
@@ -157,14 +159,18 @@ async fn configured_ollama_model_uses_each_selected_config_base_url() {
finding.check_id == "embeddings/configured-model"
&& finding.severity == FindingSeverity::Error
}));
- assert!(request_a
- .await
- .expect("fake Ollama A request")
- .starts_with("GET /api/tags "));
- assert!(request_b
- .await
- .expect("fake Ollama B request")
- .starts_with("GET /api/tags "));
+ assert!(
+ request_a
+ .await
+ .expect("fake Ollama A request")
+ .starts_with("GET /api/tags ")
+ );
+ assert!(
+ request_b
+ .await
+ .expect("fake Ollama B request")
+ .starts_with("GET /api/tags ")
+ );
}
#[tokio::test]
@@ -181,9 +187,11 @@ async fn non_ollama_embedding_provider_is_skipped_instead_of_reported_healthy()
finding.check_id == "embeddings/configured-model"
&& finding.severity == FindingSeverity::Skipped
}));
- assert!(findings
- .iter()
- .all(|finding| finding.severity != FindingSeverity::Pass));
+ assert!(
+ findings
+ .iter()
+ .all(|finding| finding.severity != FindingSeverity::Pass)
+ );
}
#[tokio::test]
diff --git a/crates/openhuman-core/src/doctor/checks/inference_catalog.rs b/crates/openhuman-core/src/doctor/checks/inference_catalog.rs
index a8c75413aa..8a1ceff54b 100644
--- a/crates/openhuman-core/src/doctor/checks/inference_catalog.rs
+++ b/crates/openhuman-core/src/doctor/checks/inference_catalog.rs
@@ -8,13 +8,13 @@ use std::time::{Duration, Instant};
use async_trait::async_trait;
use crate::config::schema::cloud_providers::{AuthStyle, CloudProviderCreds};
-use crate::core::{runtime::CoreContext, Outcome};
+use crate::core::{Outcome, runtime::CoreContext};
use crate::doctor::{
contract::{DoctorCheck, DoctorCtx, DoctorTier, Finding, FindingSeverity},
core::{ModelProbeEntry, ModelProbeOutcome, ModelProbeReport, ModelProbeSummary},
};
use crate::inference::registry::{
- inspection_catalog, CatalogRequest, InspectionCatalogError, PreparedInspectionCatalog,
+ CatalogRequest, InspectionCatalogError, PreparedInspectionCatalog, inspection_catalog,
};
const CACHE_TTL: Duration = Duration::from_secs(60);
diff --git a/crates/openhuman-core/src/doctor/checks/inference_live.rs b/crates/openhuman-core/src/doctor/checks/inference_live.rs
index 3c223e081a..ac5213d6cc 100644
--- a/crates/openhuman-core/src/doctor/checks/inference_live.rs
+++ b/crates/openhuman-core/src/doctor/checks/inference_live.rs
@@ -13,8 +13,8 @@ use crate::config::Config;
use crate::core::runtime::DispatchCtx;
use crate::doctor::{DoctorCheck, DoctorCtx, DoctorTier, Finding, FindingSeverity};
use crate::inference::provider::factory::{
- create_chat_model_with_identity_in_for_inspection, InspectionRequestIdentity,
- PreparedInspectionChatModel,
+ InspectionRequestIdentity, PreparedInspectionChatModel,
+ create_chat_model_with_identity_in_for_inspection,
};
const CATEGORY: &str = "live inference";
diff --git a/crates/openhuman-core/src/doctor/checks/inference_live_budget_tests.rs b/crates/openhuman-core/src/doctor/checks/inference_live_budget_tests.rs
index 3fc1ef3e59..53018a2d05 100644
--- a/crates/openhuman-core/src/doctor/checks/inference_live_budget_tests.rs
+++ b/crates/openhuman-core/src/doctor/checks/inference_live_budget_tests.rs
@@ -1,12 +1,12 @@
//! Output-budget capability tests for live inference checks.
-use super::inference_live::{probe_prepared_model, LiveProbeCache};
+use super::inference_live::{LiveProbeCache, probe_prepared_model};
use crate::doctor::FindingSeverity;
use crate::inference::provider::factory::{
InspectionOutputBudgetCapability, InspectionRequestIdentity, PreparedInspectionChatModel,
};
-use std::sync::atomic::{AtomicUsize, Ordering};
use std::sync::Arc;
+use std::sync::atomic::{AtomicUsize, Ordering};
use tinyinference_llm::model::{ChatModel, ModelRequest, ModelResponse};
struct InvocationCounter(Arc<AtomicUsize>);
diff --git a/crates/openhuman-core/src/doctor/checks/inference_live_tests.rs b/crates/openhuman-core/src/doctor/checks/inference_live_tests.rs
index aaa618de6a..81ee66821b 100644
--- a/crates/openhuman-core/src/doctor/checks/inference_live_tests.rs
+++ b/crates/openhuman-core/src/doctor/checks/inference_live_tests.rs
@@ -1,11 +1,11 @@
//! Behaviour tests for the opt-in live inference checks.
-use crate::config::schema::cloud_providers::{AuthStyle, CloudProviderCreds};
-use crate::config::schema::ephemeral_route::{apply as apply_ephemeral_route, EphemeralRoute};
use crate::config::Config;
+use crate::config::schema::cloud_providers::{AuthStyle, CloudProviderCreds};
+use crate::config::schema::ephemeral_route::{EphemeralRoute, apply as apply_ephemeral_route};
use crate::core::runtime::{CoreContext, DomainSet};
use crate::doctor::{DoctorCtx, DoctorOptions, DoctorTier, Finding, FindingSeverity};
-use serde_json::{json, Value};
+use serde_json::{Value, json};
use wiremock::matchers::{method, path};
use wiremock::{Mock, MockServer, ResponseTemplate};
@@ -228,9 +228,11 @@ async fn live_chat_sends_the_fixed_short_prompt_and_reports_only_safe_metadata()
let body: Value = serde_json::from_slice(&requests[0].body).expect("request is JSON");
assert_eq!(body["messages"].as_array().unwrap().len(), 1);
assert_eq!(body["messages"][0]["content"], "Reply OK");
- assert!(body["max_tokens"]
- .as_u64()
- .is_some_and(|value| (1..=5).contains(&value)));
+ assert!(
+ body["max_tokens"]
+ .as_u64()
+ .is_some_and(|value| (1..=5).contains(&value))
+ );
assert_eq!(
requests[0]
.headers
@@ -298,11 +300,11 @@ async fn live_probe_uses_selected_doctor_config_inside_another_ambient_context()
#[tokio::test]
async fn managed_chat_probe_uses_the_inspection_only_factory_callback() {
use crate::inference::registry::{
- register_inspection_chat_model_in, ChatModelRequest, InspectionChatModelFactory,
+ ChatModelRequest, InspectionChatModelFactory, register_inspection_chat_model_in,
};
use std::sync::{
- atomic::{AtomicUsize, Ordering},
Arc,
+ atomic::{AtomicUsize, Ordering},
};
use tinyinference_llm::model::{ChatModel, ModelRequest, ModelResponse};
@@ -317,9 +319,11 @@ async fn managed_chat_probe_uses_the_inspection_only_factory_callback() {
self.0.fetch_add(1, Ordering::SeqCst);
assert_eq!(request.messages.len(), 1);
assert_eq!(request.messages[0].text(), "Reply OK");
- assert!(request
- .max_tokens
- .is_some_and(|value| (1..=5).contains(&value)));
+ assert!(
+ request
+ .max_tokens
+ .is_some_and(|value| (1..=5).contains(&value))
+ );
Ok(ModelResponse::assistant("OK"))
}
}
@@ -672,11 +676,13 @@ async fn connect_tier_skips_live_chat_without_sending_a_completion() {
assert!(!report.findings.iter().any(|result| {
result.check_id == "doctor/selection" && result.severity == FindingSeverity::Error
}));
- assert!(server
- .received_requests()
- .await
- .expect("mock records calls")
- .is_empty());
+ assert!(
+ server
+ .received_requests()
+ .await
+ .expect("mock records calls")
+ .is_empty()
+ );
}
#[test]
diff --git a/crates/openhuman-core/src/doctor/checks/inference_tests.rs b/crates/openhuman-core/src/doctor/checks/inference_tests.rs
index e7088fc6c5..1c014abf29 100644
--- a/crates/openhuman-core/src/doctor/checks/inference_tests.rs
+++ b/crates/openhuman-core/src/doctor/checks/inference_tests.rs
@@ -1,9 +1,9 @@
-use crate::config::schema::cloud_providers::{AuthStyle, CloudProviderCreds};
use crate::config::Config;
+use crate::config::schema::cloud_providers::{AuthStyle, CloudProviderCreds};
use crate::doctor::runner;
use crate::doctor::{DoctorCtx, DoctorOptions, DoctorTier, Finding, FindingSeverity};
-use std::sync::atomic::{AtomicUsize, Ordering};
use std::sync::Arc;
+use std::sync::atomic::{AtomicUsize, Ordering};
use tinyinference_llm::model::{ChatModel, ModelRequest, ModelResponse};
const PROVIDER_REF: &str = "inference/provider-ref";
@@ -397,7 +397,7 @@ async fn a_fully_configured_managed_default_constructs_cleanly() {
use crate::config::schema::cloud_providers::{AuthStyle, CloudProviderCreds};
use crate::config::test_env::EnvVarGuard;
use crate::inference::provider::factory::PROVIDER_OPENHUMAN;
- use crate::inference::registry::{register_inspection_chat_model, InspectionChatModelFactory};
+ use crate::inference::registry::{InspectionChatModelFactory, register_inspection_chat_model};
struct ManagedModel {
generations: Arc<AtomicUsize>,
@@ -470,9 +470,11 @@ async fn a_fully_configured_managed_default_constructs_cleanly() {
"the managed provider factory must be consulted"
);
assert_eq!(generations.load(Ordering::SeqCst), 0);
- assert!(findings
- .iter()
- .all(|result| !result.message.contains("doctor-test-session-token")));
+ assert!(
+ findings
+ .iter()
+ .all(|result| !result.message.contains("doctor-test-session-token"))
+ );
assert!(!temp.path().join("auth-profiles.json").exists());
assert!(!temp.path().join("auth-profiles.lock").exists());
}
@@ -519,7 +521,7 @@ impl Drop for RegisterManagedModel {
#[tokio::test]
async fn embedding_only_configuration_does_not_construct_a_chat_model_for_embeddings() {
- use crate::inference::registry::{register_inspection_chat_model, InspectionChatModelFactory};
+ use crate::inference::registry::{InspectionChatModelFactory, register_inspection_chat_model};
let _inference_guard = crate::inference::inference_test_guard_async().await;
diff --git a/crates/openhuman-core/src/doctor/checks/integrations.rs b/crates/openhuman-core/src/doctor/checks/integrations.rs
index 037c55a9d8..4d243be366 100644
--- a/crates/openhuman-core/src/doctor/checks/integrations.rs
+++ b/crates/openhuman-core/src/doctor/checks/integrations.rs
@@ -4,8 +4,8 @@ use std::sync::Arc;
use async_trait::async_trait;
use tinyconnectors_bus::{
- names::methods, ComposioConnectedIntegrationsMode, ComposioConnectedIntegrationsResponse,
- ComposioListConnectedIntegrationsRequest,
+ ComposioConnectedIntegrationsMode, ComposioConnectedIntegrationsResponse,
+ ComposioListConnectedIntegrationsRequest, names::methods,
};
use crate::config::Config;
@@ -97,9 +97,20 @@ impl DoctorCheck for ComposioCheck {
)
} else {
match self.probe.list_existing(ctx.config()).await {
- Ok(Some(())) => Finding::pass(self.id(), "The existing Composio connector answered a read-only connection check."),
- Ok(None) => Finding::skipped(self.id(), "No matching ready Composio connector is available for the selected configuration.", "Open Integrations normally, then rerun doctor."),
- Err(()) => Finding::error(self.id(), "The ready Composio connector could not complete its read-only check.", "Check the Composio connection in Integrations, then rerun doctor."),
+ Ok(Some(())) => Finding::pass(
+ self.id(),
+ "The existing Composio connector answered a read-only connection check.",
+ ),
+ Ok(None) => Finding::skipped(
+ self.id(),
+ "No matching ready Composio connector is available for the selected configuration.",
+ "Open Integrations normally, then rerun doctor.",
+ ),
+ Err(()) => Finding::error(
+ self.id(),
+ "The ready Composio connector could not complete its read-only check.",
+ "Check the Composio connection in Integrations, then rerun doctor.",
+ ),
}
};
vec![finding]
diff --git a/crates/openhuman-core/src/doctor/checks/integrations_tests.rs b/crates/openhuman-core/src/doctor/checks/integrations_tests.rs
index a21aedcd70..bb3a5e2644 100644
--- a/crates/openhuman-core/src/doctor/checks/integrations_tests.rs
+++ b/crates/openhuman-core/src/doctor/checks/integrations_tests.rs
@@ -1,8 +1,8 @@
use super::*;
use crate::doctor::contract::{DoctorCtx, FindingSeverity};
use std::sync::{
- atomic::{AtomicUsize, Ordering},
Arc,
+ atomic::{AtomicUsize, Ordering},
};
struct ExistingList {
diff --git a/crates/openhuman-core/src/doctor/checks/memory_live.rs b/crates/openhuman-core/src/doctor/checks/memory_live.rs
index 8bd5ad5d02..7b703bb1aa 100644
--- a/crates/openhuman-core/src/doctor/checks/memory_live.rs
+++ b/crates/openhuman-core/src/doctor/checks/memory_live.rs
@@ -148,11 +148,10 @@ impl Drop for ScopedScratchCleanup {
async fn roundtrip(engine: Arc<dyn MemoryEngine>, fetch_mode: FetchMode) -> Result<(), Finding> {
let nonce = uuid::Uuid::new_v4().simple().to_string();
- let namespace = Namespace::new(vec![Segment::new(
- SegmentKind::Service,
- format!("openhuman-doctor-{nonce}"),
- )
- .expect("generated service namespace is valid")])
+ let namespace = Namespace::new(vec![
+ Segment::new(SegmentKind::Service, format!("openhuman-doctor-{nonce}"))
+ .expect("generated service namespace is valid"),
+ ])
.expect("one service namespace segment is valid");
let item = StoreItem::document(
"OpenHuman doctor memory roundtrip probe",
diff --git a/crates/openhuman-core/src/doctor/checks/memory_live_tests.rs b/crates/openhuman-core/src/doctor/checks/memory_live_tests.rs
index c1046bacf8..11f99ad840 100644
--- a/crates/openhuman-core/src/doctor/checks/memory_live_tests.rs
+++ b/crates/openhuman-core/src/doctor/checks/memory_live_tests.rs
@@ -1,4 +1,4 @@
-use super::{failure_finding, MemoryRoundtripCheck, Operation};
+use super::{MemoryRoundtripCheck, Operation, failure_finding};
use crate::config::Config;
use crate::core::runtime::{CoreContext, DomainSet};
use crate::core::slots::Extensions;
@@ -6,8 +6,8 @@ use crate::doctor::contract::{DoctorCheck, DoctorCtx, FindingSeverity};
use crate::memory::test_fixtures::stored;
use async_trait::async_trait;
use std::sync::{
- atomic::{AtomicUsize, Ordering},
Arc, Mutex,
+ atomic::{AtomicUsize, Ordering},
};
use tempfile::TempDir;
use tinymemory_api::conformance::ReferenceEngine;
@@ -270,9 +270,11 @@ async fn fetch_failure_still_cleans_the_unique_service_scoped_item() {
let (scratch_id, namespace) = &calls.stored[0];
assert_ne!(scratch_id, &real_id);
assert_ne!(scratch_id.as_str(), "doctor:probe");
- assert!(namespace
- .to_string()
- .starts_with("service:openhuman-doctor-"));
+ assert!(
+ namespace
+ .to_string()
+ .starts_with("service:openhuman-doctor-")
+ );
assert!(!Reach::subtree(Namespace::ROOT).admits(namespace));
assert_eq!(calls.scoped_forgets.len(), 1);
assert_eq!(calls.scoped_forgets[0].0, vec![scratch_id.clone()]);
@@ -347,17 +349,23 @@ fn plan_required_memory_failure_has_safe_plan_guidance_and_cleanup_warning() {
);
assert_eq!(finding.severity, FindingSeverity::Error);
- assert!(finding
- .message
- .contains("not included in the selected account's plan"));
+ assert!(
+ finding
+ .message
+ .contains("not included in the selected account's plan")
+ );
assert!(!finding.message.contains("MEMORY_PLAN_REQUIRED"));
assert!(!finding.message.contains("private-host.example"));
- assert!(finding
- .fix_hint
- .contains("Upgrade to a plan that includes memory"));
- assert!(finding
- .fix_hint
- .contains("could not confirm scratch cleanup"));
+ assert!(
+ finding
+ .fix_hint
+ .contains("Upgrade to a plan that includes memory")
+ );
+ assert!(
+ finding
+ .fix_hint
+ .contains("could not confirm scratch cleanup")
+ );
}
#[tokio::test]
diff --git a/crates/openhuman-core/src/doctor/checks/memory_tests.rs b/crates/openhuman-core/src/doctor/checks/memory_tests.rs
index 00c9f6954d..443b9ed6f5 100644
--- a/crates/openhuman-core/src/doctor/checks/memory_tests.rs
+++ b/crates/openhuman-core/src/doctor/checks/memory_tests.rs
@@ -3,13 +3,13 @@ use crate::core::runtime::ComponentSet;
use crate::core::runtime::{CoreContext, DomainSet};
use crate::core::slots::Extensions;
use crate::doctor::contract::{DoctorConfigSource, DoctorCtx, FindingSeverity};
-use crate::memory::engine::{Binding, EngineHealth, DISABLED_ENGINE};
+use crate::memory::engine::{Binding, DISABLED_ENGINE, EngineHealth};
use crate::memory::engine_registry::{
- register_memory_engine_in, register_memory_health_probe_in, EngineEntry, EngineFuture,
- ReadOnlyHealthProbe,
+ EngineEntry, EngineFuture, ReadOnlyHealthProbe, register_memory_engine_in,
+ register_memory_health_probe_in,
};
-use std::sync::atomic::{AtomicUsize, Ordering};
use std::sync::Arc;
+use std::sync::atomic::{AtomicUsize, Ordering};
fn context(engine: &str) -> DoctorCtx {
let mut config = crate::config::Config::default();
diff --git a/crates/openhuman-core/src/doctor/checks/runtime_settings_tests.rs b/crates/openhuman-core/src/doctor/checks/runtime_settings_tests.rs
index 69449b8d90..3e8d3a9d69 100644
--- a/crates/openhuman-core/src/doctor/checks/runtime_settings_tests.rs
+++ b/crates/openhuman-core/src/doctor/checks/runtime_settings_tests.rs
@@ -60,19 +60,23 @@ async fn former_runtime_settings_findings_keep_their_paths_without_exposing_valu
"missing {path} finding: {findings:#?}"
);
}
- assert!(findings
- .iter()
- .filter(|finding| finding.check_id == ID)
- .all(|finding| finding.severity == FindingSeverity::Warn
- && !finding.fix_hint.trim().is_empty()));
+ assert!(
+ findings
+ .iter()
+ .filter(|finding| finding.check_id == ID)
+ .all(|finding| finding.severity == FindingSeverity::Warn
+ && !finding.fix_hint.trim().is_empty())
+ );
assert!(findings.iter().all(|finding| {
!finding.message.contains("private-model-name")
&& !finding.message.contains("private-route-name")
&& !finding.message.contains("private-agent-name")
}));
- assert!(!findings
- .iter()
- .any(|finding| finding.check_id == "doctor/selection"));
+ assert!(
+ !findings
+ .iter()
+ .any(|finding| finding.check_id == "doctor/selection")
+ );
}
#[tokio::test]
diff --git a/crates/openhuman-core/src/doctor/checks/runtime_tests.rs b/crates/openhuman-core/src/doctor/checks/runtime_tests.rs
index 464d97cc62..5370f21712 100644
--- a/crates/openhuman-core/src/doctor/checks/runtime_tests.rs
+++ b/crates/openhuman-core/src/doctor/checks/runtime_tests.rs
@@ -42,9 +42,11 @@ fn environment_check_resolves_git_and_curl_from_path_without_running_them() {
&& finding.severity == FindingSeverity::Pass
&& finding.config_path.as_deref() == Some("PATH/curl")
}));
- assert!(findings
- .iter()
- .all(|finding| !finding.message.contains("/isolated/home")));
+ assert!(
+ findings
+ .iter()
+ .all(|finding| !finding.message.contains("/isolated/home"))
+ );
assert!(
!marker.exists(),
"static environment checks must not spawn tools"
diff --git a/crates/openhuman-core/src/doctor/checks/sandbox.rs b/crates/openhuman-core/src/doctor/checks/sandbox.rs
index 68fcb25894..821ae6e6da 100644
--- a/crates/openhuman-core/src/doctor/checks/sandbox.rs
+++ b/crates/openhuman-core/src/doctor/checks/sandbox.rs
@@ -44,9 +44,9 @@ impl SandboxProbe for HostSandboxProbe {
async fn landlock_status(&self) -> LandlockStatus {
#[cfg(all(target_os = "linux", feature = "modules"))]
{
- use crate::modules::runtime::{call_if_ready, ExistingModuleCallError};
- use crate::modules::tinybox::contract::names::JAIL_STATUS;
+ use crate::modules::runtime::{ExistingModuleCallError, call_if_ready};
use crate::modules::tinybox::contract::JailStatus;
+ use crate::modules::tinybox::contract::names::JAIL_STATUS;
return match call_if_ready::<_, JailStatus>(
crate::modules::tinybox::MODULE_ID,
diff --git a/crates/openhuman-core/src/doctor/checks/search.rs b/crates/openhuman-core/src/doctor/checks/search.rs
index d0838fb679..92aa5a356b 100644
--- a/crates/openhuman-core/src/doctor/checks/search.rs
+++ b/crates/openhuman-core/src/doctor/checks/search.rs
@@ -165,12 +165,11 @@ fn direct_key_path(provider: &str) -> String {
/// token.
fn managed_credential_available(config: &Config) -> bool {
use crate::security::credentials::{
- api_key,
+ APP_SESSION_PROVIDER, AuthService, api_key,
session_support::{
- check_session_backend, classify_session_token, is_local_session_token,
- SessionTokenCheck,
+ SessionTokenCheck, check_session_backend, classify_session_token,
+ is_local_session_token,
},
- AuthService, APP_SESSION_PROVIDER,
};
if api_key::get_api_key_read_only(config)
diff --git a/crates/openhuman-core/src/doctor/checks/search_tests.rs b/crates/openhuman-core/src/doctor/checks/search_tests.rs
index 2a3bab5da5..e960eebf9f 100644
--- a/crates/openhuman-core/src/doctor/checks/search_tests.rs
+++ b/crates/openhuman-core/src/doctor/checks/search_tests.rs
@@ -4,8 +4,8 @@ use crate::config::{
};
use crate::doctor::contract::{DoctorCtx, FindingSeverity};
use std::sync::{
- atomic::{AtomicUsize, Ordering},
Arc,
+ atomic::{AtomicUsize, Ordering},
};
struct FixedManagedResolver {
diff --git a/crates/openhuman-core/src/doctor/checks/skills_tests.rs b/crates/openhuman-core/src/doctor/checks/skills_tests.rs
index 765a559145..764b49ac0b 100644
--- a/crates/openhuman-core/src/doctor/checks/skills_tests.rs
+++ b/crates/openhuman-core/src/doctor/checks/skills_tests.rs
@@ -35,9 +35,11 @@ async fn github_preflight_is_not_registered_when_no_skill_requires_it() {
.await;
assert!(checks.iter().any(|check| check.id() == "skills/discovery"));
- assert!(checks
- .iter()
- .all(|check| check.id() != "skills/github-preflight"));
+ assert!(
+ checks
+ .iter()
+ .all(|check| check.id() != "skills/github-preflight")
+ );
}
#[derive(Default)]
@@ -92,9 +94,11 @@ async fn required_github_preflight_uses_fake_probes_and_redacts_error_details()
.await;
let required = required.expect("the workflow explicitly requires GitHub");
assert_eq!(required.path, manifest);
- assert!(checks
- .iter()
- .any(|check| check.id() == "skills/github-preflight"));
+ assert!(
+ checks
+ .iter()
+ .any(|check| check.id() == "skills/github-preflight")
+ );
let check = GithubPreflightCheck {
required: required.config,
@@ -107,9 +111,11 @@ async fn required_github_preflight_uses_fake_probes_and_redacts_error_details()
.remove(0);
assert_eq!(finding.severity, FindingSeverity::Error);
- assert!(finding
- .message
- .contains("GitHub integration is not connected"));
+ assert!(
+ finding
+ .message
+ .contains("GitHub integration is not connected")
+ );
assert!(!finding.message.contains("private"));
assert!(!finding.message.contains("example.test"));
assert_eq!(
@@ -119,8 +125,8 @@ async fn required_github_preflight_uses_fake_probes_and_redacts_error_details()
}
#[tokio::test]
-async fn production_github_preflight_skips_expired_profile_without_mutating_credentials_or_loading_connectors(
-) {
+async fn production_github_preflight_skips_expired_profile_without_mutating_credentials_or_loading_connectors()
+ {
let scratch = tempfile::tempdir().expect("create isolated preflight fixture");
let config = config_in(scratch.path());
let _env = crate::config::test_env::EnvVarGuard::locked_async()
@@ -202,8 +208,8 @@ async fn production_github_preflight_skips_expired_profile_without_mutating_cred
}
#[tokio::test]
-async fn production_github_preflight_skips_malformed_profile_without_quarantining_or_loading_connectors(
-) {
+async fn production_github_preflight_skips_malformed_profile_without_quarantining_or_loading_connectors()
+ {
let scratch = tempfile::tempdir().expect("create isolated preflight fixture");
let config = config_in(scratch.path());
let _env = crate::config::test_env::EnvVarGuard::locked_async()
@@ -247,12 +253,14 @@ async fn production_github_preflight_skips_malformed_profile_without_quarantinin
assert_eq!(std::fs::read(&profiles).unwrap(), malformed);
assert!(!scratch.path().join("auth-profiles.lock").exists());
- assert!(!scratch
- .path()
- .read_dir()
- .unwrap()
- .filter_map(Result::ok)
- .any(|entry| entry.file_name().to_string_lossy().contains("corrupt")));
+ assert!(
+ !scratch
+ .path()
+ .read_dir()
+ .unwrap()
+ .filter_map(Result::ok)
+ .any(|entry| entry.file_name().to_string_lossy().contains("corrupt"))
+ );
assert_eq!(findings.len(), 1);
assert_eq!(findings[0].severity, FindingSeverity::Skipped);
assert!(findings[0].message.contains("unavailable"));
diff --git a/crates/openhuman-core/src/doctor/checks/voice.rs b/crates/openhuman-core/src/doctor/checks/voice.rs
index e7dd90ced4..f4656b439b 100644
--- a/crates/openhuman-core/src/doctor/checks/voice.rs
+++ b/crates/openhuman-core/src/doctor/checks/voice.rs
@@ -203,7 +203,7 @@ fn is_hosted_slug(slug: &str) -> bool {
}
fn provider_credential_present_read_only(config: &Config, slug: &str) -> bool {
- use crate::security::credentials::{profiles::AuthProfileKind, AuthService};
+ use crate::security::credentials::{AuthService, profiles::AuthProfileKind};
let key = crate::inference::provider::factory::auth_key_for_slug(slug);
for provider in [key.as_str(), slug] {
diff --git a/crates/openhuman-core/src/doctor/checks/voice_tests.rs b/crates/openhuman-core/src/doctor/checks/voice_tests.rs
index c7001f4c3f..55ae7cad6d 100644
--- a/crates/openhuman-core/src/doctor/checks/voice_tests.rs
+++ b/crates/openhuman-core/src/doctor/checks/voice_tests.rs
@@ -1,8 +1,8 @@
use super::*;
use crate::doctor::contract::{DoctorCtx, FindingSeverity};
use std::sync::{
- atomic::{AtomicUsize, Ordering},
Arc,
+ atomic::{AtomicUsize, Ordering},
};
struct FixedVoiceStatus {
@@ -90,9 +90,11 @@ async fn voice_checks_inspect_the_selected_config_without_starting_audio_runtime
})
.await;
assert_eq!(findings.len(), 2);
- assert!(findings
- .iter()
- .all(|finding| finding.severity == FindingSeverity::Pass));
+ assert!(
+ findings
+ .iter()
+ .all(|finding| finding.severity == FindingSeverity::Pass)
+ );
assert_eq!(calls.load(Ordering::SeqCst), 2);
assert_eq!(
*probe.workspace.lock().unwrap(),
diff --git a/crates/openhuman-core/src/doctor/checks/wallet_tests.rs b/crates/openhuman-core/src/doctor/checks/wallet_tests.rs
index 8f1824e35f..cd1a46af03 100644
--- a/crates/openhuman-core/src/doctor/checks/wallet_tests.rs
+++ b/crates/openhuman-core/src/doctor/checks/wallet_tests.rs
@@ -2,8 +2,8 @@ use super::*;
use crate::doctor::contract::{DoctorCtx, FindingSeverity};
#[cfg(feature = "web3")]
use std::sync::{
- atomic::{AtomicUsize, Ordering},
Arc,
+ atomic::{AtomicUsize, Ordering},
};
#[cfg(feature = "web3")]
diff --git a/crates/openhuman-core/src/doctor/checks/workspace_tests.rs b/crates/openhuman-core/src/doctor/checks/workspace_tests.rs
index 1adb3011d0..4b47f6758d 100644
--- a/crates/openhuman-core/src/doctor/checks/workspace_tests.rs
+++ b/crates/openhuman-core/src/doctor/checks/workspace_tests.rs
@@ -143,14 +143,18 @@ async fn writable_probe_succeeds_and_leaves_the_selected_workspace_unchanged() {
let report = run_only(config, "workspace/writable").await;
- assert!(report
- .checks_run
- .iter()
- .any(|id| id == "workspace/writable"));
- assert!(!report
- .findings
- .iter()
- .any(|finding| finding.check_id == "doctor/selection"));
+ assert!(
+ report
+ .checks_run
+ .iter()
+ .any(|id| id == "workspace/writable")
+ );
+ assert!(
+ !report
+ .findings
+ .iter()
+ .any(|finding| finding.check_id == "doctor/selection")
+ );
assert!(report.findings.iter().any(|finding| {
finding.check_id == "workspace/writable" && finding.severity == FindingSeverity::Pass
}));
@@ -177,14 +181,18 @@ async fn read_only_workspace_is_reported_by_the_native_writable_check() {
before, after,
"the static probe must clean up its scratch file"
);
- assert!(report
- .checks_run
- .iter()
- .any(|id| id == "workspace/writable"));
- assert!(!report
- .findings
- .iter()
- .any(|finding| finding.check_id == "doctor/selection"));
+ assert!(
+ report
+ .checks_run
+ .iter()
+ .any(|id| id == "workspace/writable")
+ );
+ assert!(
+ !report
+ .findings
+ .iter()
+ .any(|finding| finding.check_id == "doctor/selection")
+ );
let finding = report
.findings
.iter()
@@ -270,10 +278,12 @@ async fn workspace_layout_finding_uses_the_registered_native_id() {
let report = run_only(config, "workspace/layout").await;
assert!(report.checks_run.iter().any(|id| id == "workspace/layout"));
- assert!(!report
- .findings
- .iter()
- .any(|finding| finding.check_id == "doctor/selection"));
+ assert!(
+ !report
+ .findings
+ .iter()
+ .any(|finding| finding.check_id == "doctor/selection")
+ );
assert!(report.findings.iter().any(|finding| {
finding.check_id == "workspace/layout" && finding.severity == FindingSeverity::Warn
}));
diff --git a/crates/openhuman-core/src/doctor/config_file_tests.rs b/crates/openhuman-core/src/doctor/config_file_tests.rs
index 5ff9188ef8..7424c87bad 100644
--- a/crates/openhuman-core/src/doctor/config_file_tests.rs
+++ b/crates/openhuman-core/src/doctor/config_file_tests.rs
@@ -77,9 +77,11 @@ async fn typed_parse_error_reports_field_path_and_backup_fallback_safely() {
error.message
);
assert!(!error.message.contains("837465"));
- assert!(!error
- .message
- .contains(&directory.path().display().to_string()));
+ assert!(
+ !error
+ .message
+ .contains(&directory.path().display().to_string())
+ );
}
#[tokio::test]
diff --git a/crates/openhuman-core/src/doctor/config_provenance_tests.rs b/crates/openhuman-core/src/doctor/config_provenance_tests.rs
index dc5489f59a..06ced1d218 100644
--- a/crates/openhuman-core/src/doctor/config_provenance_tests.rs
+++ b/crates/openhuman-core/src/doctor/config_provenance_tests.rs
@@ -1,5 +1,5 @@
-use crate::config::schema::load::{DotenvLoadProvenance, ProvenanceSource};
use crate::config::Config;
+use crate::config::schema::load::{DotenvLoadProvenance, ProvenanceSource};
use super::contract::{DoctorCtx, DoctorOptions, DoctorTier, Finding, FindingSeverity};
use super::runner;
diff --git a/crates/openhuman-core/src/doctor/config_semantics_tests.rs b/crates/openhuman-core/src/doctor/config_semantics_tests.rs
index 2445d5bcb1..ea8566b04e 100644
--- a/crates/openhuman-core/src/doctor/config_semantics_tests.rs
+++ b/crates/openhuman-core/src/doctor/config_semantics_tests.rs
@@ -1,4 +1,4 @@
-use crate::config::{test_env::EnvVarGuard, Config};
+use crate::config::{Config, test_env::EnvVarGuard};
use crate::doctor::contract::{DoctorCtx, DoctorOptions, Finding, FindingSeverity};
use crate::doctor::runner;
@@ -130,9 +130,11 @@ async fn missing_storage_driver_is_reported_without_opening_the_backend() {
assert!(!error.message.contains("db.internal"));
}
#[cfg(feature = "storage-mongodb")]
- assert!(findings
- .iter()
- .any(|finding| finding.severity == FindingSeverity::Pass));
+ assert!(
+ findings
+ .iter()
+ .any(|finding| finding.severity == FindingSeverity::Pass)
+ );
}
#[tokio::test]
@@ -210,9 +212,11 @@ async fn both_master_key_environment_sources_are_reported_without_initializing_k
let error = finding(&findings, FindingSeverity::Error);
assert!(!error.message.contains("do-not-read-inline"));
- assert!(!error
- .message
- .contains(&supplied_key_file.display().to_string()));
+ assert!(
+ !error
+ .message
+ .contains(&supplied_key_file.display().to_string())
+ );
assert_eq!(workspace_entries(workspace.path()), entries_before);
assert!(!supplied_key_file.exists());
assert!(!workspace.path().join("keyring/master.key").exists());
diff --git a/crates/openhuman-core/src/doctor/connectivity_tests.rs b/crates/openhuman-core/src/doctor/connectivity_tests.rs
index 00894d9557..310d6b8474 100644
--- a/crates/openhuman-core/src/doctor/connectivity_tests.rs
+++ b/crates/openhuman-core/src/doctor/connectivity_tests.rs
@@ -4,8 +4,8 @@ use async_trait::async_trait;
use super::contract::{DoctorCtx, DoctorOptions, FindingSeverity};
use super::runner;
-use crate::config::schema::StorageConfig;
use crate::config::Config;
+use crate::config::schema::StorageConfig;
struct DownMemoryEngine {
inner: tinymemory_api::conformance::ReferenceEngine,
diff --git a/crates/openhuman-core/src/doctor/contract.rs b/crates/openhuman-core/src/doctor/contract.rs
index 99a3048ba7..fb260be98f 100644
--- a/crates/openhuman-core/src/doctor/contract.rs
+++ b/crates/openhuman-core/src/doctor/contract.rs
@@ -6,9 +6,9 @@ use std::time::Duration;
use async_trait::async_trait;
use serde::{Deserialize, Serialize};
+use crate::config::Config;
use crate::config::schema::load::ProvenanceSource;
use crate::config::schema::profile_layout::LayoutVersion;
-use crate::config::Config;
use crate::core::runtime::{ComponentSet, CoreContext};
/// The maximum cost a caller permits for a doctor run.
diff --git a/crates/openhuman-core/src/doctor/embeddings_config_tests.rs b/crates/openhuman-core/src/doctor/embeddings_config_tests.rs
index 11eafd5094..9b87619121 100644
--- a/crates/openhuman-core/src/doctor/embeddings_config_tests.rs
+++ b/crates/openhuman-core/src/doctor/embeddings_config_tests.rs
@@ -62,8 +62,10 @@ async fn missing_embedding_model_and_dimensions_are_reported() {
paths.contains(&"memory.embedding_dimensions"),
"missing dimensions path in findings: {findings:#?}"
);
- assert!(findings
- .iter()
- .filter(|result| result.check_id == EMBEDDINGS_CONFIG)
- .all(|result| result.severity == FindingSeverity::Error));
+ assert!(
+ findings
+ .iter()
+ .filter(|result| result.check_id == EMBEDDINGS_CONFIG)
+ .all(|result| result.severity == FindingSeverity::Error)
+ );
}
diff --git a/crates/openhuman-core/src/doctor/inference_auth_error_tests.rs b/crates/openhuman-core/src/doctor/inference_auth_error_tests.rs
index 4996597705..c284e82345 100644
--- a/crates/openhuman-core/src/doctor/inference_auth_error_tests.rs
+++ b/crates/openhuman-core/src/doctor/inference_auth_error_tests.rs
@@ -1,17 +1,17 @@
-use super::{ops::doctor_report_with_options, DoctorOptions, FindingSeverity};
-use crate::config::schema::cloud_providers::{AuthStyle, CloudProviderCreds};
+use super::{DoctorOptions, FindingSeverity, ops::doctor_report_with_options};
use crate::config::Config;
+use crate::config::schema::cloud_providers::{AuthStyle, CloudProviderCreds};
use crate::security::credentials::{AuthService, DEFAULT_AUTH_PROFILE_NAME};
use axum::{
+ Json, Router,
extract::State,
http::{HeaderMap, StatusCode},
response::{IntoResponse, Response},
routing::get,
- Json, Router,
};
use std::sync::{
- atomic::{AtomicUsize, Ordering},
Arc,
+ atomic::{AtomicUsize, Ordering},
};
use std::time::Duration;
@@ -193,8 +193,8 @@ fn register_test_inspection_catalog(
endpoint: String,
) -> Arc<AtomicUsize> {
use crate::inference::registry::{
- register_inspection_catalog_in, InspectionCatalogError, InspectionCatalogListing,
- PreparedInspectionCatalog,
+ InspectionCatalogError, InspectionCatalogListing, PreparedInspectionCatalog,
+ register_inspection_catalog_in,
};
let requests = Arc::new(AtomicUsize::new(0));
@@ -306,31 +306,37 @@ async fn process_auth_error_is_not_attributed_across_desktop_workspaces() {
},
)
.await;
- assert!(report_b_without_failure
- .value
- .checks_run
- .iter()
- .any(|id| id == "inference/auth-errors"));
- assert!(report_b_without_failure
- .value
- .findings
- .iter()
- .all(|finding| {
- finding.check_id != "inference/auth-errors"
- || finding.severity != FindingSeverity::Error
- }));
- assert!(report_b_without_failure
- .value
- .findings
- .iter()
- .all(|finding| {
- !finding
- .message
- .contains(config_a.workspace_dir.to_string_lossy().as_ref())
- && !finding
+ assert!(
+ report_b_without_failure
+ .value
+ .checks_run
+ .iter()
+ .any(|id| id == "inference/auth-errors")
+ );
+ assert!(
+ report_b_without_failure
+ .value
+ .findings
+ .iter()
+ .all(|finding| {
+ finding.check_id != "inference/auth-errors"
+ || finding.severity != FindingSeverity::Error
+ })
+ );
+ assert!(
+ report_b_without_failure
+ .value
+ .findings
+ .iter()
+ .all(|finding| {
+ !finding
.message
- .contains(config_b.workspace_dir.to_string_lossy().as_ref())
- }));
+ .contains(config_a.workspace_dir.to_string_lossy().as_ref())
+ && !finding
+ .message
+ .contains(config_b.workspace_dir.to_string_lossy().as_ref())
+ })
+ );
let report_a = report_for_context(
&config_a,
@@ -375,14 +381,16 @@ async fn process_auth_error_is_not_attributed_across_desktop_workspaces() {
},
)
.await;
- assert!(report_a_after_b_failure
- .value
- .findings
- .iter()
- .any(|finding| {
- finding.check_id == "inference/auth-errors"
- && finding.severity == FindingSeverity::Error
- }));
+ assert!(
+ report_a_after_b_failure
+ .value
+ .findings
+ .iter()
+ .any(|finding| {
+ finding.check_id == "inference/auth-errors"
+ && finding.severity == FindingSeverity::Error
+ })
+ );
assert_eq!(
crate::inference::auth_error_registry::snapshot()
.iter()
@@ -492,26 +500,32 @@ async fn process_auth_error_is_attributed_to_the_matching_saas_profile() {
},
)
.await;
- assert!(report_b_without_failure
- .value
- .checks_run
- .iter()
- .any(|id| id == "inference/auth-errors"));
- assert!(report_b_without_failure
- .value
- .findings
- .iter()
- .all(|finding| {
- finding.check_id != "inference/auth-errors"
- || finding.severity != FindingSeverity::Error
- }));
- assert!(report_b_without_failure
- .value
- .findings
- .iter()
- .all(|finding| {
- !finding.message.contains("tenant-a") && !finding.message.contains("tenant-b")
- }));
+ assert!(
+ report_b_without_failure
+ .value
+ .checks_run
+ .iter()
+ .any(|id| id == "inference/auth-errors")
+ );
+ assert!(
+ report_b_without_failure
+ .value
+ .findings
+ .iter()
+ .all(|finding| {
+ finding.check_id != "inference/auth-errors"
+ || finding.severity != FindingSeverity::Error
+ })
+ );
+ assert!(
+ report_b_without_failure
+ .value
+ .findings
+ .iter()
+ .all(|finding| {
+ !finding.message.contains("tenant-a") && !finding.message.contains("tenant-b")
+ })
+ );
let report_a = report_for_profile(
&config,
@@ -553,14 +567,16 @@ async fn process_auth_error_is_attributed_to_the_matching_saas_profile() {
},
)
.await;
- assert!(report_a_after_b_failure
- .value
- .findings
- .iter()
- .any(|finding| {
- finding.check_id == "inference/auth-errors"
- && finding.severity == FindingSeverity::Error
- }));
+ assert!(
+ report_a_after_b_failure
+ .value
+ .findings
+ .iter()
+ .any(|finding| {
+ finding.check_id == "inference/auth-errors"
+ && finding.severity == FindingSeverity::Error
+ })
+ );
assert_eq!(
crate::inference::auth_error_registry::snapshot()
.iter()
@@ -588,11 +604,13 @@ async fn an_unscoped_legacy_auth_error_is_reported_without_blame_to_profile_b()
)
.await;
- assert!(report
- .value
- .checks_run
- .iter()
- .any(|id| id == "inference/auth-errors"));
+ assert!(
+ report
+ .value
+ .checks_run
+ .iter()
+ .any(|id| id == "inference/auth-errors")
+ );
assert!(report.value.findings.iter().any(|finding| {
finding.check_id == "inference/auth-errors"
&& finding.severity == FindingSeverity::Info
diff --git a/crates/openhuman-core/src/doctor/inference_catalog_test_support.rs b/crates/openhuman-core/src/doctor/inference_catalog_test_support.rs
index f3ea1698da..961594754e 100644
--- a/crates/openhuman-core/src/doctor/inference_catalog_test_support.rs
+++ b/crates/openhuman-core/src/doctor/inference_catalog_test_support.rs
@@ -1,17 +1,17 @@
-use super::{ops::doctor_report_with_options, DoctorOptions};
-use crate::config::schema::cloud_providers::{AuthStyle, CloudProviderCreds};
+use super::{DoctorOptions, ops::doctor_report_with_options};
use crate::config::Config;
+use crate::config::schema::cloud_providers::{AuthStyle, CloudProviderCreds};
use crate::security::credentials::{AuthService, DEFAULT_AUTH_PROFILE_NAME};
use axum::{
+ Json, Router,
extract::State,
http::{HeaderMap, StatusCode},
response::{IntoResponse, Response},
routing::get,
- Json, Router,
};
use std::sync::{
- atomic::{AtomicUsize, Ordering},
Arc,
+ atomic::{AtomicUsize, Ordering},
};
use std::time::Duration;
@@ -200,8 +200,8 @@ pub(super) fn register_test_inspection_catalog(
endpoint: String,
) -> Arc<AtomicUsize> {
use crate::inference::registry::{
- register_inspection_catalog_in, InspectionCatalogError, InspectionCatalogListing,
- PreparedInspectionCatalog,
+ InspectionCatalogError, InspectionCatalogListing, PreparedInspectionCatalog,
+ register_inspection_catalog_in,
};
let requests = Arc::new(AtomicUsize::new(0));
diff --git a/crates/openhuman-core/src/doctor/inference_catalog_tests.rs b/crates/openhuman-core/src/doctor/inference_catalog_tests.rs
index 4909d945ef..c2647ebdba 100644
--- a/crates/openhuman-core/src/doctor/inference_catalog_tests.rs
+++ b/crates/openhuman-core/src/doctor/inference_catalog_tests.rs
@@ -1,19 +1,19 @@
use super::{
- ops::{doctor_models, doctor_report_with_options},
DoctorOptions, FindingSeverity, ModelProbeOutcome,
+ ops::{doctor_models, doctor_report_with_options},
};
-use crate::config::schema::cloud_providers::{AuthStyle, CloudProviderCreds};
use crate::config::Config;
+use crate::config::schema::cloud_providers::{AuthStyle, CloudProviderCreds};
use axum::{
+ Json, Router,
extract::State,
http::{HeaderMap, StatusCode},
response::{IntoResponse, Response},
routing::get,
- Json, Router,
};
use std::sync::{
- atomic::{AtomicUsize, Ordering},
Arc,
+ atomic::{AtomicUsize, Ordering},
};
use std::time::Duration;
@@ -217,8 +217,8 @@ fn register_test_inspection_catalog(
endpoint: String,
) -> Arc<AtomicUsize> {
use crate::inference::registry::{
- register_inspection_catalog_in, InspectionCatalogError, InspectionCatalogListing,
- PreparedInspectionCatalog,
+ InspectionCatalogError, InspectionCatalogListing, PreparedInspectionCatalog,
+ register_inspection_catalog_in,
};
let requests = Arc::new(AtomicUsize::new(0));
@@ -517,10 +517,10 @@ async fn a_slow_provider_times_out_without_blocking_the_other_catalog() {
#[tokio::test]
async fn doctor_models_uses_read_only_http_without_calling_the_mutable_catalog() {
+ use crate::core::Outcome;
use crate::core::runtime::{CoreContext, DomainSet};
use crate::core::slots::Extensions;
- use crate::core::Outcome;
- use crate::inference::registry::{register_catalog_in, CatalogEntry, CatalogListing};
+ use crate::inference::registry::{CatalogEntry, CatalogListing, register_catalog_in};
let (endpoint, server) =
spawn_catalog_server(StatusCode::OK, catalog_body(&["must-not-be-used"]), true).await;
diff --git a/crates/openhuman-core/src/doctor/inference_config_tests.rs b/crates/openhuman-core/src/doctor/inference_config_tests.rs
index f679392dde..7426043f4b 100644
--- a/crates/openhuman-core/src/doctor/inference_config_tests.rs
+++ b/crates/openhuman-core/src/doctor/inference_config_tests.rs
@@ -1,8 +1,8 @@
use crate::config::Config;
use crate::doctor::runner;
use crate::doctor::{DoctorCtx, DoctorOptions, DoctorTier, Finding, FindingSeverity};
-use std::sync::atomic::{AtomicUsize, Ordering};
use std::sync::Arc;
+use std::sync::atomic::{AtomicUsize, Ordering};
use tinyinference_llm::model::{ChatModel, ModelRequest, ModelResponse};
const PROVIDER_REF: &str = "inference/provider-ref";
@@ -138,7 +138,7 @@ async fn a_fully_configured_managed_default_constructs_cleanly() {
use crate::config::schema::cloud_providers::{AuthStyle, CloudProviderCreds};
use crate::config::test_env::EnvVarGuard;
use crate::inference::provider::factory::PROVIDER_OPENHUMAN;
- use crate::inference::registry::{register_inspection_chat_model, InspectionChatModelFactory};
+ use crate::inference::registry::{InspectionChatModelFactory, register_inspection_chat_model};
struct ManagedModel {
generations: Arc<AtomicUsize>,
@@ -210,9 +210,11 @@ async fn a_fully_configured_managed_default_constructs_cleanly() {
"the managed provider factory must be consulted"
);
assert_eq!(generations.load(Ordering::SeqCst), 0);
- assert!(findings
- .iter()
- .all(|result| !result.message.contains("doctor-test-session-token")));
+ assert!(
+ findings
+ .iter()
+ .all(|result| !result.message.contains("doctor-test-session-token"))
+ );
assert!(!temp.path().join("auth-profiles.json").exists());
assert!(!temp.path().join("auth-profiles.lock").exists());
}
diff --git a/crates/openhuman-core/src/doctor/inference_model_catalog_tests.rs b/crates/openhuman-core/src/doctor/inference_model_catalog_tests.rs
index 6d9b2a7e38..ac0bb9fd0e 100644
--- a/crates/openhuman-core/src/doctor/inference_model_catalog_tests.rs
+++ b/crates/openhuman-core/src/doctor/inference_model_catalog_tests.rs
@@ -1,21 +1,21 @@
use super::{
- ops::{doctor_models, doctor_report_with_options},
DoctorOptions, FindingSeverity, ModelProbeOutcome,
+ ops::{doctor_models, doctor_report_with_options},
};
-use crate::config::schema::cloud_providers::{AuthStyle, CloudProviderCreds};
-use crate::config::schema::ModelRouteConfig;
use crate::config::Config;
+use crate::config::schema::ModelRouteConfig;
+use crate::config::schema::cloud_providers::{AuthStyle, CloudProviderCreds};
use crate::security::credentials::{AuthService, DEFAULT_AUTH_PROFILE_NAME};
use axum::{
+ Json, Router,
extract::State,
http::{HeaderMap, StatusCode},
response::{IntoResponse, Response},
routing::get,
- Json, Router,
};
use std::sync::{
- atomic::{AtomicUsize, Ordering},
Arc,
+ atomic::{AtomicUsize, Ordering},
};
use std::time::Duration;
@@ -199,8 +199,8 @@ fn register_test_inspection_catalog(
endpoint: String,
) -> Arc<AtomicUsize> {
use crate::inference::registry::{
- register_inspection_catalog_in, InspectionCatalogError, InspectionCatalogListing,
- PreparedInspectionCatalog,
+ InspectionCatalogError, InspectionCatalogListing, PreparedInspectionCatalog,
+ register_inspection_catalog_in,
};
let requests = Arc::new(AtomicUsize::new(0));
@@ -339,10 +339,12 @@ async fn doctor_models_skips_a_provider_without_a_models_route() {
assert_eq!(report.value.summary.skipped, 1);
assert_eq!(report.value.summary.errors, 0);
assert_eq!(report.value.entries[0].outcome, ModelProbeOutcome::Skipped);
- assert!(report.value.entries[0]
- .message
- .as_deref()
- .is_some_and(|message| message.to_ascii_lowercase().contains("models")));
+ assert!(
+ report.value.entries[0]
+ .message
+ .as_deref()
+ .is_some_and(|message| message.to_ascii_lowercase().contains("models"))
+ );
assert_eq!(server.requests.load(Ordering::SeqCst), 1);
}
@@ -376,11 +378,13 @@ async fn model_in_catalog_check_skips_a_provider_without_a_models_route() {
.await
.expect("scoped doctor report");
- assert!(report
- .value
- .checks_run
- .iter()
- .any(|id| id == "inference/model-in-catalog"));
+ assert!(
+ report
+ .value
+ .checks_run
+ .iter()
+ .any(|id| id == "inference/model-in-catalog")
+ );
assert!(report.value.findings.iter().any(|finding| {
finding.check_id == "inference/model-in-catalog"
&& finding.severity == FindingSeverity::Skipped
@@ -453,11 +457,13 @@ async fn missing_default_and_route_models_are_warned_by_the_inference_check() {
assert_eq!(catalog.value.entries[0].outcome, ModelProbeOutcome::Ok);
assert_eq!(report.value.profile.as_deref(), Some("doctor-profile-b"));
- assert!(report
- .value
- .checks_run
- .iter()
- .any(|id| id == "inference/model-in-catalog"));
+ assert!(
+ report
+ .value
+ .checks_run
+ .iter()
+ .any(|id| id == "inference/model-in-catalog")
+ );
let missing_default = report.value.findings.iter().find(|finding| {
finding.check_id == "inference/model-in-catalog"
&& finding.severity == FindingSeverity::Warn
diff --git a/crates/openhuman-core/src/doctor/mod.rs b/crates/openhuman-core/src/doctor/mod.rs
index a730117135..83a1f56426 100644
--- a/crates/openhuman-core/src/doctor/mod.rs
+++ b/crates/openhuman-core/src/doctor/mod.rs
@@ -20,6 +20,8 @@ pub use registry::{
DoctorCheckSource, register_check_source, register_check_source_in, registered_checks_for,
};
pub(crate) use schemas::all_controller_entries as all_doctor_controller_entries;
+#[cfg(test)]
+pub(crate) use schemas::doctor_parameter_contracts;
pub use schemas::{
all_controller_schemas as all_doctor_controller_schemas,
all_registered_controllers as all_doctor_registered_controllers,
diff --git a/crates/openhuman-core/src/doctor/ops.rs b/crates/openhuman-core/src/doctor/ops.rs
index eeb33304ea..6af65a68c5 100644
--- a/crates/openhuman-core/src/doctor/ops.rs
+++ b/crates/openhuman-core/src/doctor/ops.rs
@@ -8,8 +8,8 @@ use super::contract::DoctorProfileStatus;
use super::profile::DesktopProfileSelection;
use crate::config::Config;
use crate::core::{
- runtime::{ComponentSet, CoreContext, DispatchCtx},
Outcome,
+ runtime::{ComponentSet, CoreContext, DispatchCtx},
};
use crate::doctor::{
DoctorConfigSource, DoctorCtx, DoctorOptions, DoctorReport, DoctorSummary, DoctorTier, Finding,
diff --git a/crates/openhuman-core/src/doctor/ops_tests.rs b/crates/openhuman-core/src/doctor/ops_tests.rs
index aafc293743..52e9ca1d7d 100644
--- a/crates/openhuman-core/src/doctor/ops_tests.rs
+++ b/crates/openhuman-core/src/doctor/ops_tests.rs
@@ -1,14 +1,14 @@
use super::*;
-use std::sync::atomic::{AtomicUsize, Ordering};
use std::sync::Arc;
+use std::sync::atomic::{AtomicUsize, Ordering};
use crate::core::runtime::{CoreContext, DomainSet};
use crate::core::slots::Extensions;
use crate::memory::engine::{Binding, EngineHealth};
use crate::memory::engine_registry::{
- register_memory_engine_in, register_memory_health_probe_in, EngineEntry, EngineFuture,
- ReadOnlyHealthProbe,
+ EngineEntry, EngineFuture, ReadOnlyHealthProbe, register_memory_engine_in,
+ register_memory_health_probe_in,
};
#[tokio::test]
diff --git a/crates/openhuman-core/src/doctor/profile.rs b/crates/openhuman-core/src/doctor/profile.rs
index 106596f3f6..2e6ebbc4b5 100644
--- a/crates/openhuman-core/src/doctor/profile.rs
+++ b/crates/openhuman-core/src/doctor/profile.rs
@@ -5,9 +5,9 @@ use std::sync::Arc;
use async_trait::async_trait;
+use crate::config::Config;
use crate::config::schema::load::ConfigResolutionSource;
use crate::config::schema::profile_layout::LayoutVersion;
-use crate::config::Config;
use crate::doctor::contract::{DoctorCheck, DoctorCtx, DoctorProfileStatus, DoctorTier, Finding};
use crate::profiles::ProfileLayout;
diff --git a/crates/openhuman-core/src/doctor/profile_inspection_tests.rs b/crates/openhuman-core/src/doctor/profile_inspection_tests.rs
index 3d32d900fb..6119c6aa71 100644
--- a/crates/openhuman-core/src/doctor/profile_inspection_tests.rs
+++ b/crates/openhuman-core/src/doctor/profile_inspection_tests.rs
@@ -79,14 +79,18 @@ async fn selected_profile_reports_preserve_parent_check_sources_without_using_pa
.unwrap();
for report in [explicit_outcome.value, selection_outcome.value] {
- assert!(!report
- .findings
- .iter()
- .any(|finding| finding.check_id == "doctor/selection"));
- assert!(report
- .checks_run
- .iter()
- .any(|id| id == "hosted/selected-profile-context"));
+ assert!(
+ !report
+ .findings
+ .iter()
+ .any(|finding| finding.check_id == "doctor/selection")
+ );
+ assert!(
+ report
+ .checks_run
+ .iter()
+ .any(|id| id == "hosted/selected-profile-context")
+ );
assert_eq!(report.profile.as_deref(), Some("account-b"));
}
let observations = observed.lock().unwrap();
diff --git a/crates/openhuman-core/src/doctor/profile_tests.rs b/crates/openhuman-core/src/doctor/profile_tests.rs
index be08888d41..65ba9f74a0 100644
--- a/crates/openhuman-core/src/doctor/profile_tests.rs
+++ b/crates/openhuman-core/src/doctor/profile_tests.rs
@@ -7,7 +7,7 @@ use tempfile::TempDir;
use crate::config::Config;
use crate::doctor::profile::{
- load_desktop_profile, resolve_desktop_profile_for_doctor, DesktopProfileError,
+ DesktopProfileError, load_desktop_profile, resolve_desktop_profile_for_doctor,
};
use crate::doctor::{
DoctorCheck, DoctorCheckSource, DoctorConfigSource, DoctorCtx, DoctorOptions, DoctorTier,
@@ -15,8 +15,8 @@ use crate::doctor::{
};
use crate::profiles::ProfileLayout;
use crate::security::credentials::{
- session_support::get_session_token, AuthService, APP_SESSION_PROVIDER,
- DEFAULT_AUTH_PROFILE_NAME,
+ APP_SESSION_PROVIDER, AuthService, DEFAULT_AUTH_PROFILE_NAME,
+ session_support::get_session_token,
};
fn config_for(layout: &ProfileLayout) -> Config {
@@ -125,8 +125,8 @@ async fn explicit_profile_reads_its_own_session_without_switching_active_user()
}
#[tokio::test]
-async fn inspecting_selected_profile_credentials_does_not_quarantine_corrupt_auth_store(
-) -> Result<(), String> {
+async fn inspecting_selected_profile_credentials_does_not_quarantine_corrupt_auth_store()
+-> Result<(), String> {
let _env_guard = crate::config::TEST_ENV_LOCK.lock().await;
let _workspace_override = WorkspaceOverrideGuard::clear();
let temp = TempDir::new().unwrap();
@@ -557,11 +557,13 @@ async fn selected_profile_applies_in_memory_legacy_migrations_without_saving_the
selected.config.inference_url.as_deref(),
Some("https://custom.example/v1/chat/completions")
);
- assert!(selected
- .config
- .load_diagnostics()
- .migrated_keys
- .contains(&"api_url".to_string()));
+ assert!(
+ selected
+ .config
+ .load_diagnostics()
+ .migrated_keys
+ .contains(&"api_url".to_string())
+ );
assert_eq!(
tokio::fs::read_to_string(&layout.config_path)
.await
diff --git a/crates/openhuman-core/src/doctor/runner_tests.rs b/crates/openhuman-core/src/doctor/runner_tests.rs
index 182f879ff0..8560469124 100644
--- a/crates/openhuman-core/src/doctor/runner_tests.rs
+++ b/crates/openhuman-core/src/doctor/runner_tests.rs
@@ -1,6 +1,6 @@
use std::path::Path;
-use std::sync::atomic::{AtomicUsize, Ordering};
use std::sync::Arc;
+use std::sync::atomic::{AtomicUsize, Ordering};
use std::time::Duration;
use crate::config::Config;
@@ -11,7 +11,7 @@ use async_trait::async_trait;
use super::contract::{
DoctorCheck, DoctorConfigSource, DoctorCtx, DoctorOptions, DoctorTier, Finding, FindingSeverity,
};
-use super::registry::{register_check_source_in, DoctorCheckSource};
+use super::registry::{DoctorCheckSource, register_check_source_in};
use super::runner;
use super::test_support::{FakeCheck, FakeCheckSource};
@@ -124,10 +124,12 @@ async fn a_context_check_source_is_reported_with_its_check_id() {
let config_source: DoctorConfigSource = report.config_source;
assert_eq!(config_source, DoctorConfigSource::Profile);
assert!(report.checks_run.iter().any(|id| id == "hosted/ready"));
- assert!(report
- .findings
- .iter()
- .any(|finding| finding.check_id == "hosted/ready"));
+ assert!(
+ report
+ .findings
+ .iter()
+ .any(|finding| finding.check_id == "hosted/ready")
+ );
}
#[tokio::test]
@@ -156,10 +158,12 @@ async fn hierarchical_check_ids_are_registered_and_selected_exactly() {
.expect("hierarchical id is valid and selected as one exact id");
assert_eq!(report.checks_run, vec!["inference/live/role".to_owned()]);
- assert!(report
- .findings
- .iter()
- .any(|finding| finding.check_id == "inference/live/role"));
+ assert!(
+ report
+ .findings
+ .iter()
+ .any(|finding| finding.check_id == "inference/live/role")
+ );
}
#[tokio::test]
@@ -393,10 +397,10 @@ async fn native_checks_use_the_selected_config_and_respect_its_component_gates()
#[tokio::test]
async fn connect_tier_skips_live_embedding_without_calling_the_provider() {
- use axum::{extract::State, routing::post, Json, Router};
+ use axum::{Json, Router, extract::State, routing::post};
use std::sync::atomic::AtomicUsize;
use tempfile::TempDir;
- use tinymemory_api::{conformance::ReferenceEngine, MemoryEngine};
+ use tinymemory_api::{MemoryEngine, conformance::ReferenceEngine};
let tmp = TempDir::new().expect("temporary config and workspace");
let workspace = tmp.path().join("workspace");
@@ -471,12 +475,16 @@ async fn connect_tier_skips_live_embedding_without_calling_the_provider() {
0,
"live memory was not bound"
);
- assert!(report
- .checks_skipped
- .contains(&"embeddings/live".to_owned()));
- assert!(report
- .checks_skipped
- .contains(&"memory/roundtrip".to_owned()));
+ assert!(
+ report
+ .checks_skipped
+ .contains(&"embeddings/live".to_owned())
+ );
+ assert!(
+ report
+ .checks_skipped
+ .contains(&"memory/roundtrip".to_owned())
+ );
}
#[tokio::test]
@@ -512,11 +520,13 @@ async fn only_filters_exact_ids_and_unknown_ids_get_a_selection_finding() {
.expect("unknown selection is a report finding");
assert_eq!(report.checks_run, vec!["config/temperature".to_owned()]);
- assert!(report
- .findings
- .iter()
- .any(|finding| finding.check_id == "doctor/selection"
- && finding.severity == FindingSeverity::Error));
+ assert!(
+ report
+ .findings
+ .iter()
+ .any(|finding| finding.check_id == "doctor/selection"
+ && finding.severity == FindingSeverity::Error)
+ );
assert_eq!(report.schema_version, 2);
assert_eq!(report.summary.pass, 1);
assert_eq!(report.summary.error, 1);
@@ -546,10 +556,12 @@ async fn module_status_checks_are_registered_with_their_native_id() {
report.findings
);
assert!(report.checks_run.iter().any(|id| id == "modules/tinymcp"));
- assert!(report
- .findings
- .iter()
- .any(|finding| finding.check_id == "modules/tinymcp"));
+ assert!(
+ report
+ .findings
+ .iter()
+ .any(|finding| finding.check_id == "modules/tinymcp")
+ );
}
#[tokio::test]
@@ -601,14 +613,18 @@ async fn mcp_server_check_ids_come_from_the_selected_config() {
report.checks_skipped.iter().any(|id| id == "mcp/server-b")
|| report.checks_run.iter().any(|id| id == "mcp/server-b")
);
- assert!(report
- .findings
- .iter()
- .any(|finding| finding.check_id == "mcp/server-b"));
- assert!(!report
- .findings
- .iter()
- .any(|finding| finding.check_id == "mcp/server-a"));
+ assert!(
+ report
+ .findings
+ .iter()
+ .any(|finding| finding.check_id == "mcp/server-b")
+ );
+ assert!(
+ !report
+ .findings
+ .iter()
+ .any(|finding| finding.check_id == "mcp/server-a")
+ );
}
#[tokio::test]
diff --git a/crates/openhuman-core/src/doctor/test_support.rs b/crates/openhuman-core/src/doctor/test_support.rs
index 50e99aa51e..76123729b3 100644
--- a/crates/openhuman-core/src/doctor/test_support.rs
+++ b/crates/openhuman-core/src/doctor/test_support.rs
@@ -1,7 +1,7 @@
//! Reusable fake checks and sources for doctor framework tests.
-use std::sync::atomic::{AtomicUsize, Ordering};
use std::sync::Arc;
+use std::sync::atomic::{AtomicUsize, Ordering};
use std::time::Duration;
use async_trait::async_trait;