Skip to content

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

test: add schema validation tests across multiple modules

Steven Enamakel04056a7d904c
diff --git a/crates/openhuman-core/src/commands/schemas_tests.rs b/crates/openhuman-core/src/commands/schemas_tests.rs
index 51c4c6e22c..7b9179a92c 100644
--- a/crates/openhuman-core/src/commands/schemas_tests.rs
+++ b/crates/openhuman-core/src/commands/schemas_tests.rs
@@ -19,13 +19,6 @@ fn list_schema_has_no_required_inputs() {
assert_eq!(schema.outputs[0].name, "commands");
}
-#[test]
-fn unknown_function_falls_back_to_an_error_schema() {
- let schema = schemas("does_not_exist");
- assert_eq!(schema.function, "unknown");
- assert_eq!(schema.outputs[0].name, "error");
-}
-
#[tokio::test]
async fn handle_list_returns_every_builtin() {
use serde_json::Map;
diff --git a/crates/openhuman-core/src/desktop/app_state/schemas_tests.rs b/crates/openhuman-core/src/desktop/app_state/schemas_tests.rs
index a481de9f7f..ef6ad9af18 100644
--- a/crates/openhuman-core/src/desktop/app_state/schemas_tests.rs
+++ b/crates/openhuman-core/src/desktop/app_state/schemas_tests.rs
@@ -30,13 +30,6 @@ fn update_local_state_schema() {
}
}
-#[test]
-fn unknown_function_returns_unknown() {
- let s = app_state_schemas("nonexistent");
- assert_eq!(s.function, "unknown");
- assert_eq!(s.namespace, "app_state");
-}
-
#[test]
fn schemas_and_controllers_match() {
let s = all_app_state_controller_schemas();
diff --git a/crates/openhuman-core/src/desktop/notifications/schemas_tests.rs b/crates/openhuman-core/src/desktop/notifications/schemas_tests.rs
index 013eab400d..5d7451b070 100644
--- a/crates/openhuman-core/src/desktop/notifications/schemas_tests.rs
+++ b/crates/openhuman-core/src/desktop/notifications/schemas_tests.rs
@@ -137,8 +137,3 @@ fn schemas_and_registered_controllers_have_bidirectional_parity() {
assert_eq!(schema_functions, handler_functions);
}
-#[test]
-fn schemas_unknown_returns_placeholder() {
- let s = schemas("does-not-exist");
- assert_eq!(s.function, "unknown");
-}
diff --git a/crates/openhuman-core/src/inference/embedding_host/schemas_tests.rs b/crates/openhuman-core/src/inference/embedding_host/schemas_tests.rs
index ccadfdb324..4969e73023 100644
--- a/crates/openhuman-core/src/inference/embedding_host/schemas_tests.rs
+++ b/crates/openhuman-core/src/inference/embedding_host/schemas_tests.rs
@@ -20,13 +20,6 @@ fn schemas_and_controllers_match() {
}
}
-#[test]
-fn unknown_function_returns_unknown() {
- let s = schemas("bad");
- assert_eq!(s.function, "unknown");
- assert_eq!(s.namespace, "embeddings");
-}
-
#[tokio::test]
async fn all_handlers_accept_empty_params_without_panic() {
// Every handler should return a result (Ok or Err) when called with
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 21913295d2..7fdd450ce4 100644
--- a/crates/openhuman-core/src/inference/host_runtime/schemas_tests.rs
+++ b/crates/openhuman-core/src/inference/host_runtime/schemas_tests.rs
@@ -9,13 +9,6 @@ fn all_schemas_use_inference_namespace_and_have_descriptions() {
}
}
-#[test]
-fn unknown_function_returns_unknown_schema() {
- let s = schemas("no_such_fn");
- assert_eq!(s.function, "unknown");
- assert_eq!(s.namespace, "inference");
-}
-
#[test]
fn every_registered_key_resolves_to_non_unknown_schema() {
let keys = [
diff --git a/crates/openhuman-core/src/platform/connectivity/schemas_tests.rs b/crates/openhuman-core/src/platform/connectivity/schemas_tests.rs
index b64c7bef59..29e53e6779 100644
--- a/crates/openhuman-core/src/platform/connectivity/schemas_tests.rs
+++ b/crates/openhuman-core/src/platform/connectivity/schemas_tests.rs
@@ -28,13 +28,6 @@ fn diag_schema_outputs_a_diag_payload_field() {
assert_eq!(s.outputs[0].name, "diag");
}
-#[test]
-fn unknown_function_returns_unknown_fallback() {
- let s = schemas("no_such");
- assert_eq!(s.function, "unknown");
- assert_eq!(s.namespace, "connectivity");
-}
-
#[tokio::test]
async fn handle_diag_returns_json_object() {
let value = handle_diag(Map::new()).await.expect("diag handler ok");
diff --git a/crates/openhuman-core/src/platform/cost/schemas_tests.rs b/crates/openhuman-core/src/platform/cost/schemas_tests.rs
index 0d1a7d956c..befab54bfa 100644
--- a/crates/openhuman-core/src/platform/cost/schemas_tests.rs
+++ b/crates/openhuman-core/src/platform/cost/schemas_tests.rs
@@ -60,13 +60,6 @@ fn schema_for_usage_log_has_days_and_limit_inputs() {
assert_eq!(s.outputs[0].name, "usage_log");
}
-#[test]
-fn schema_for_unknown_returns_error_shape() {
- let s = schema_for("cost_get_nonexistent");
- assert_eq!(s.function, "unknown");
- assert_eq!(s.outputs[0].name, "error");
-}
-
#[test]
fn new_correlation_id_returns_eight_hex_chars() {
let cid = new_correlation_id();
diff --git a/crates/openhuman-core/src/platform/doctor/schemas_tests.rs b/crates/openhuman-core/src/platform/doctor/schemas_tests.rs
index ddbf0d5c27..3a8e21e5eb 100644
--- a/crates/openhuman-core/src/platform/doctor/schemas_tests.rs
+++ b/crates/openhuman-core/src/platform/doctor/schemas_tests.rs
@@ -26,12 +26,6 @@ fn models_schema_has_optional_use_cache() {
assert!(use_cache.is_some_and(|f| !f.required));
}
-#[test]
-fn unknown_function_returns_unknown() {
- let s = schemas("nonexistent");
- assert_eq!(s.function, "unknown");
-}
-
#[test]
fn schemas_and_controllers_match() {
let s = all_controller_schemas();
diff --git a/crates/openhuman-core/src/platform/health/schemas_tests.rs b/crates/openhuman-core/src/platform/health/schemas_tests.rs
index 235e9c203c..2233c024d8 100644
--- a/crates/openhuman-core/src/platform/health/schemas_tests.rs
+++ b/crates/openhuman-core/src/platform/health/schemas_tests.rs
@@ -29,13 +29,6 @@ fn system_info_schema() {
assert_eq!(s.outputs.len(), 4);
}
-#[test]
-fn unknown_function_returns_unknown() {
- let s = schemas("bad");
- assert_eq!(s.function, "unknown");
- assert_eq!(s.namespace, "health");
-}
-
#[test]
fn schemas_and_controllers_match() {
let s = all_controller_schemas();
diff --git a/crates/openhuman-core/src/platform/service/schemas_tests.rs b/crates/openhuman-core/src/platform/service/schemas_tests.rs
index 882fb26cb7..7f0a34c558 100644
--- a/crates/openhuman-core/src/platform/service/schemas_tests.rs
+++ b/crates/openhuman-core/src/platform/service/schemas_tests.rs
@@ -60,13 +60,6 @@ fn daemon_host_set_requires_show_tray() {
assert!(s.inputs[0].required);
}
-#[test]
-fn unknown_function_returns_unknown() {
- let s = schemas("nonexistent");
- assert_eq!(s.function, "unknown");
- assert_eq!(s.namespace, "service");
-}
-
#[test]
fn schemas_and_controllers_match() {
let s = all_controller_schemas();
diff --git a/crates/openhuman-core/src/platform/socket/schemas_tests.rs b/crates/openhuman-core/src/platform/socket/schemas_tests.rs
index 2228b3cfd4..b05c7bfc1e 100644
--- a/crates/openhuman-core/src/platform/socket/schemas_tests.rs
+++ b/crates/openhuman-core/src/platform/socket/schemas_tests.rs
@@ -53,15 +53,6 @@ fn emit_schema_data_is_optional() {
assert!(!data.required);
}
-#[test]
-fn unknown_function_returns_unknown_fallback_schema() {
- let s = schemas("no_such_fn");
- assert_eq!(s.namespace, "socket");
- assert_eq!(s.function, "unknown");
- assert_eq!(s.outputs.len(), 1);
- assert_eq!(s.outputs[0].name, "error");
-}
-
#[test]
fn every_schema_has_at_least_one_output_field() {
for s in all_controller_schemas() {
diff --git a/crates/openhuman-core/src/platform/update/schemas_tests.rs b/crates/openhuman-core/src/platform/update/schemas_tests.rs
index 1f0cd0d2f5..d406c7be62 100644
--- a/crates/openhuman-core/src/platform/update/schemas_tests.rs
+++ b/crates/openhuman-core/src/platform/update/schemas_tests.rs
@@ -58,13 +58,6 @@ fn apply_schema_has_optional_staging_dir() {
assert!(staging.is_some_and(|f| !f.required));
}
-#[test]
-fn unknown_function_returns_unknown() {
- let s = schemas("nonexistent");
- assert_eq!(s.function, "unknown");
- assert_eq!(s.namespace, "update");
-}
-
#[test]
fn schemas_and_controllers_match() {
let s = all_controller_schemas();
diff --git a/crates/openhuman-core/src/security/approval/schemas_tests.rs b/crates/openhuman-core/src/security/approval/schemas_tests.rs
index 3ed568a217..8b1686ec95 100644
--- a/crates/openhuman-core/src/security/approval/schemas_tests.rs
+++ b/crates/openhuman-core/src/security/approval/schemas_tests.rs
@@ -18,13 +18,6 @@ fn schemas_decide_requires_request_id_and_decision() {
assert!(s.inputs.iter().all(|f| f.required));
}
-#[test]
-fn schemas_unknown_returns_placeholder() {
- let s = schemas("nope");
- assert_eq!(s.function, "unknown");
- assert_eq!(s.outputs[0].name, "error");
-}
-
#[test]
fn all_registered_controllers_has_handler_per_schema() {
let controllers = all_registered_controllers();
diff --git a/crates/openhuman-core/src/security/devices/schemas_tests.rs b/crates/openhuman-core/src/security/devices/schemas_tests.rs
index 380d6cd266..d41ac6455c 100644
--- a/crates/openhuman-core/src/security/devices/schemas_tests.rs
+++ b/crates/openhuman-core/src/security/devices/schemas_tests.rs
@@ -31,13 +31,6 @@ fn schemas_revoke_requires_channel_id() {
assert_eq!(s.outputs[0].name, "success");
}
-#[test]
-fn schemas_unknown_returns_error_placeholder() {
- let s = schemas("does-not-exist");
- assert_eq!(s.function, "unknown");
- assert_eq!(s.outputs[0].name, "error");
-}
-
#[test]
fn all_controller_schemas_covers_three_functions() {
let names: Vec<_> = all_controller_schemas()
diff --git a/crates/openhuman-core/src/security/encryption/schemas_tests.rs b/crates/openhuman-core/src/security/encryption/schemas_tests.rs
index e2e9a367df..f8ceed53fa 100644
--- a/crates/openhuman-core/src/security/encryption/schemas_tests.rs
+++ b/crates/openhuman-core/src/security/encryption/schemas_tests.rs
@@ -30,13 +30,6 @@ fn decrypt_schema_requires_ciphertext() {
assert_eq!(s.inputs[0].name, "ciphertext");
}
-#[test]
-fn unknown_function_returns_unknown() {
- let s = schemas("nonexistent");
- assert_eq!(s.function, "unknown");
- assert_eq!(s.namespace, "encryption");
-}
-
#[test]
fn schemas_and_controllers_match() {
let s = all_controller_schemas();
diff --git a/crates/openhuman-core/src/voice/schemas_tests.rs b/crates/openhuman-core/src/voice/schemas_tests.rs
index 390920368a..95dd5d910b 100644
--- a/crates/openhuman-core/src/voice/schemas_tests.rs
+++ b/crates/openhuman-core/src/voice/schemas_tests.rs
@@ -109,12 +109,6 @@ fn tts_schema_has_optional_output_path() {
assert!(!output_path.required);
}
-#[test]
-fn unknown_schema_returns_fallback() {
- let s = voice_schemas("voice_nonexistent");
- assert_eq!(s.function, "unknown");
-}
-
#[test]
fn deserialize_params_applies_defaults() {
let params = Map::from_iter([