Skip to content

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

test(core): assert schema-controller parity in domain schema tests

Steven Enamakel8fb47d4234ac
diff --git a/crates/openhuman-core/src/flows/schemas_tests.rs b/crates/openhuman-core/src/flows/schemas_tests.rs
index 1e13451646..75f8c21645 100644
--- a/crates/openhuman-core/src/flows/schemas_tests.rs
+++ b/crates/openhuman-core/src/flows/schemas_tests.rs
@@ -1,9 +1,14 @@
use super::*;
-use crate::core::all::{expect_schema_fields, expect_schema_identity, expect_schema_input_order, expect_schema_output_names, expect_schema_required_inputs};
+use crate::core::all::{assert_schema_controller_parity, expect_schema_fields, expect_schema_identity, expect_schema_input_order, expect_schema_output_names, expect_schema_required_inputs};
use serde_json::json;
#[test]
fn flow_schema_wire_contracts_are_preserved() {
+ assert_schema_controller_parity(
+ &all_controller_schemas(),
+ &all_registered_controllers(),
+ "create",
+ );
let contracts = [
("import", &["graph"][..], &["format"][..]),
("create", &["name", "graph"][..], &["require_approval"][..]),
diff --git a/crates/openhuman-core/src/sandbox/schemas_tests.rs b/crates/openhuman-core/src/sandbox/schemas_tests.rs
index dc0fe1d5cf..c8ea6c9d1f 100644
--- a/crates/openhuman-core/src/sandbox/schemas_tests.rs
+++ b/crates/openhuman-core/src/sandbox/schemas_tests.rs
@@ -1,4 +1,5 @@
use super::*;
+use crate::core::all::assert_schema_controller_parity;
use crate::core::runtime::context::CoreContext;
use crate::core::runtime::DispatchCtx;
use crate::core::runtime::DomainSet;
@@ -10,6 +11,15 @@ fn scoped_ctx(config: crate::config::Config) -> std::sync::Arc<CoreContext> {
CoreContext::for_test_with_config(DomainSet::full(), config)
}
+#[test]
+fn sandbox_schema_catalog_matches_registered_controllers() {
+ assert_schema_controller_parity(
+ &all_controller_schemas(),
+ &all_registered_controllers(),
+ "status",
+ );
+}
+
#[tokio::test]
async fn handle_status_returns_json() {
let ctx = scoped_ctx(crate::config::Config::default());
diff --git a/crates/openhuman-core/src/security/devices/schemas_tests.rs b/crates/openhuman-core/src/security/devices/schemas_tests.rs
index d5e0bde070..6b585a2f11 100644
--- a/crates/openhuman-core/src/security/devices/schemas_tests.rs
+++ b/crates/openhuman-core/src/security/devices/schemas_tests.rs
@@ -1,12 +1,17 @@
use super::*;
use crate::core::all::{
- expect_schema_fields, expect_schema_identity, expect_schema_input_order,
+ assert_schema_controller_parity, expect_schema_fields, expect_schema_identity, expect_schema_input_order,
expect_schema_output_fields, expect_schema_output_names,
};
use serde_json::json;
#[test]
fn device_schema_wire_contracts_are_preserved() {
+ assert_schema_controller_parity(
+ &all_controller_schemas(),
+ &all_registered_controllers(),
+ "create_pairing",
+ );
let contracts = ["create_pairing", "list", "revoke"];
let names: Vec<_> = all_controller_schemas()
.into_iter()
diff --git a/crates/openhuman-core/src/tools/schemas_tests.rs b/crates/openhuman-core/src/tools/schemas_tests.rs
index 1d5e904731..add77715fe 100644
--- a/crates/openhuman-core/src/tools/schemas_tests.rs
+++ b/crates/openhuman-core/src/tools/schemas_tests.rs
@@ -1,6 +1,9 @@
use super::*;
-use crate::core::all::{expect_schema_fields, expect_schema_identity, expect_schema_output_fields};
+use crate::core::all::{
+ assert_schema_controller_parity, expect_schema_fields, expect_schema_identity,
+ expect_schema_output_fields,
+};
use crate::tools::schemas::registry::tools_schemas;
use serde_json::{json, Map};
const BASE_CONTROLLERS: usize = 5;
@@ -30,6 +33,11 @@ fn apify_linkedin_scrape_controller_is_retired() {
#[test]
fn tools_schema_wire_contracts_are_preserved() {
+ assert_schema_controller_parity(
+ &all_controller_schemas(),
+ &all_registered_controllers(),
+ "web_search",
+ );
let contracts: &[(&str, &[(&str, Option<bool>)])] = &[
("composio_execute", &[("action", Some(true))]),
("web_answer", &[("query", Some(true)), ("depth", None)]),
diff --git a/crates/openhuman-core/src/voice/schemas_tests.rs b/crates/openhuman-core/src/voice/schemas_tests.rs
index f732d5da77..439841d0b7 100644
--- a/crates/openhuman-core/src/voice/schemas_tests.rs
+++ b/crates/openhuman-core/src/voice/schemas_tests.rs
@@ -1,5 +1,5 @@
use super::*;
-use crate::core::all::expect_schema_required_inputs;
+use crate::core::all::{assert_schema_controller_parity, expect_schema_required_inputs};
use crate::core::runtime::DispatchCtx;
use serde_json::json;
@@ -82,9 +82,10 @@ fn voice_schema_wire_contracts_are_preserved() {
"voice.{expected} not registered"
);
}
- assert_eq!(
- all_voice_controller_schemas().len(),
- all_voice_registered_controllers().len()
+ assert_schema_controller_parity(
+ &all_voice_controller_schemas(),
+ &all_voice_registered_controllers(),
+ "status",
);
}