Skip to content

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

refactor(core): simplify schema contract test logic

Steven Enamakel1a773003dd22
diff --git a/crates/openhuman-core/src/core/all_schema_contract_tests.rs b/crates/openhuman-core/src/core/all_schema_contract_tests.rs
index e70bc535ca..8d444189aa 100644
--- a/crates/openhuman-core/src/core/all_schema_contract_tests.rs
+++ b/crates/openhuman-core/src/core/all_schema_contract_tests.rs
@@ -160,24 +160,22 @@ fn representative_parameter_contracts() -> (Vec<RegisteredController>, Vec<Contr
let controllers = builtin_controller_snapshot()
.into_iter()
.filter(|controller| {
- (cfg!(feature = "voice") && controller.schema.namespace == "voice")
- || (cfg!(feature = "mcp")
- && controller.schema.method_name() == "mcp_clients.registry_get")
- || controller.schema.method_name() == "modules.computer_status"
+ (cfg!(feature = "mcp")
+ && controller.schema.method_name() == "mcp_clients.registry_get")
+ || (cfg!(feature = "modules")
+ && controller.schema.method_name() == "modules.computer_status")
})
.filter_map(|controller| controller.legacy_controller())
.collect();
+ #[cfg(feature = "modules")]
let contracts = vec![crate::modules::schemas::computer_status_parameter_contract()];
+ #[cfg(not(feature = "modules"))]
+ let contracts = Vec::new();
#[cfg(feature = "mcp")]
let contracts = contracts
.into_iter()
.chain([crate::mcp::registry::registry_get_parameter_contract()])
.collect::<Vec<_>>();
- #[cfg(feature = "voice")]
- let contracts = contracts
- .into_iter()
- .chain(crate::voice::parameter_contracts())
- .collect::<Vec<_>>();
(controllers, contracts)
}
@@ -225,8 +223,7 @@ fn every_covered_required_declaration_rejects_removal_and_optional_mutants() {
// computer-status adapter remains covered when both optional domains are
// disabled, but has no required field to mutate. Synthetic runner tests
// still exercise mutation rejection in that feature configuration.
- let expected_mutations =
- 20 * usize::from(cfg!(feature = "voice")) + 2 * usize::from(cfg!(feature = "mcp"));
+ let expected_mutations = 2 * usize::from(cfg!(feature = "mcp"));
assert_eq!(
mutations, expected_mutations,
"covered required-field mutations"