Skip to content

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

test(schemas): add missing test files for memory schema modules

Steven Enamakel46cd54633271
diff --git a/crates/openhuman-core/src/memory/schemas/documents_tests.rs b/crates/openhuman-core/src/memory/schemas/documents_tests.rs
index 8e48385008..dbeca523be 100644
--- a/crates/openhuman-core/src/memory/schemas/documents_tests.rs
+++ b/crates/openhuman-core/src/memory/schemas/documents_tests.rs
@@ -30,11 +30,6 @@ fn capability_partitions_are_disjoint_and_total() {
}
}
-#[test]
-fn unknown_document_schema_returns_none() {
- assert!(schema("not_real").is_none());
-}
-
#[test]
fn query_namespace_schema_requires_namespace_and_query() {
let schema = schema("query_namespace").unwrap();
diff --git a/crates/openhuman-core/src/memory/schemas/files_tests.rs b/crates/openhuman-core/src/memory/schemas/files_tests.rs
index 1f378c4d90..3a3663a328 100644
--- a/crates/openhuman-core/src/memory/schemas/files_tests.rs
+++ b/crates/openhuman-core/src/memory/schemas/files_tests.rs
@@ -6,11 +6,6 @@ fn file_schema_exposes_all_functions() {
assert_eq!(controllers().len(), FUNCTIONS.len());
}
-#[test]
-fn unknown_file_schema_returns_none() {
- assert!(schema("not_real").is_none());
-}
-
#[test]
fn write_file_schema_requires_path_and_content() {
let schema = schema("write_file").unwrap();
diff --git a/crates/openhuman-core/src/memory/schemas/kv_graph_tests.rs b/crates/openhuman-core/src/memory/schemas/kv_graph_tests.rs
index 187859ffa8..cd35a1d863 100644
--- a/crates/openhuman-core/src/memory/schemas/kv_graph_tests.rs
+++ b/crates/openhuman-core/src/memory/schemas/kv_graph_tests.rs
@@ -16,11 +16,6 @@ fn kv_graph_schema_exposes_all_functions() {
assert_eq!(controllers().len(), FUNCTIONS.len());
}
-#[test]
-fn unknown_kv_graph_schema_returns_none() {
- assert!(schema("not_real").is_none());
-}
-
#[test]
fn graph_upsert_schema_requires_subject_predicate_and_object() {
let schema = schema("graph_upsert").unwrap();
diff --git a/crates/openhuman-core/src/memory/schemas/learn_tests.rs b/crates/openhuman-core/src/memory/schemas/learn_tests.rs
index 15d5119853..57f3ae517e 100644
--- a/crates/openhuman-core/src/memory/schemas/learn_tests.rs
+++ b/crates/openhuman-core/src/memory/schemas/learn_tests.rs
@@ -6,11 +6,6 @@ fn learn_schema_only_exposes_learn_all() {
assert_eq!(controllers().len(), 1);
}
-#[test]
-fn unknown_learn_schema_returns_none() {
- assert!(schema("not_real").is_none());
-}
-
#[test]
fn learn_all_schema_has_optional_namespaces_input() {
let schema = schema("learn_all").unwrap();
diff --git a/crates/openhuman-core/src/memory/schemas/provider_tests.rs b/crates/openhuman-core/src/memory/schemas/provider_tests.rs
index a2192ac913..d078f8a52e 100644
--- a/crates/openhuman-core/src/memory/schemas/provider_tests.rs
+++ b/crates/openhuman-core/src/memory/schemas/provider_tests.rs
@@ -20,11 +20,6 @@ fn provider_family_exposes_status_and_the_engine_selector() {
}
}
-#[test]
-fn unknown_provider_schema_returns_none() {
- assert!(schema("not_real").is_none());
-}
-
#[test]
fn provider_status_schema_has_no_inputs_and_names_the_status_fields() {
let schema = schema("provider_status").unwrap();
diff --git a/crates/openhuman-core/src/memory/schemas/sync_tests.rs b/crates/openhuman-core/src/memory/schemas/sync_tests.rs
index 8f15f29f87..43365fdcd2 100644
--- a/crates/openhuman-core/src/memory/schemas/sync_tests.rs
+++ b/crates/openhuman-core/src/memory/schemas/sync_tests.rs
@@ -14,11 +14,6 @@ fn sync_schema_exposes_all_functions() {
assert_eq!(controllers().len(), FUNCTIONS.len());
}
-#[test]
-fn unknown_sync_schema_returns_none() {
- assert!(schema("not_real").is_none());
-}
-
#[test]
fn sync_channel_schema_requires_channel_id() {
let schema = schema("sync_channel").unwrap();
diff --git a/crates/openhuman-core/src/memory/schemas/tool_memory_tests.rs b/crates/openhuman-core/src/memory/schemas/tool_memory_tests.rs
index eb028a91c4..c333da5ea8 100644
--- a/crates/openhuman-core/src/memory/schemas/tool_memory_tests.rs
+++ b/crates/openhuman-core/src/memory/schemas/tool_memory_tests.rs
@@ -23,11 +23,6 @@ fn controllers_match_function_count() {
assert!(registered.iter().all(|c| c.schema.namespace == "memory"));
}
-#[test]
-fn schema_returns_none_for_unknown_function() {
- assert!(schema("not_real").is_none());
-}
-
#[test]
fn tool_rule_put_schema_requires_tool_name_and_rule() {
let schema = schema("tool_rule_put").unwrap();
diff --git a/crates/openhuman-core/src/memory/schemas_tests.rs b/crates/openhuman-core/src/memory/schemas_tests.rs
index 222df909af..c333da26a5 100644
--- a/crates/openhuman-core/src/memory/schemas_tests.rs
+++ b/crates/openhuman-core/src/memory/schemas_tests.rs
@@ -262,28 +262,6 @@ fn each_family_pairs_its_schemas_with_its_controllers() {
);
}
-#[test]
-fn all_controller_schemas_has_entry_per_supported_function() {
- let names: Vec<_> = all_controller_schemas()
- .into_iter()
- .map(|s| s.function)
- .collect();
- assert_eq!(names.len(), ALL_FUNCTIONS.len());
- for expected in ALL_FUNCTIONS {
- assert!(names.contains(expected), "missing schema for {expected}");
- }
-}
-
-#[test]
-fn all_registered_controllers_has_handler_per_schema() {
- let controllers = all_registered_controllers();
- assert_eq!(controllers.len(), ALL_FUNCTIONS.len());
- let names: Vec<_> = controllers.iter().map(|c| c.schema.function).collect();
- for expected in ALL_FUNCTIONS {
- assert!(names.contains(expected), "missing handler for {expected}");
- }
-}
-
#[test]
fn every_schema_uses_memory_namespace() {
for s in all_controller_schemas() {
@@ -345,36 +323,9 @@ fn parse_params_surfaces_deserialization_errors_with_context() {
// ── sync / learn schema shape tests ─────────────────────────────────────
-#[test]
-fn sync_channel_schema_requires_channel_id() {
- let s = schemas("sync_channel");
- assert_eq!(s.namespace, "memory");
- assert_eq!(s.function, "sync_channel");
- let required: Vec<_> = s
- .inputs
- .iter()
- .filter(|f| f.required)
- .map(|f| f.name)
- .collect();
- assert!(
- required.contains(&"channel_id"),
- "channel_id must be required"
- );
-}
-
#[test]
fn sync_all_schema_has_no_inputs() {
let s = schemas("sync_all");
assert_eq!(s.function, "sync_all");
assert!(s.inputs.is_empty(), "sync_all takes no inputs");
}
-
-#[test]
-fn learn_all_schema_namespaces_is_optional() {
- let s = schemas("learn_all");
- assert_eq!(s.function, "learn_all");
- assert_eq!(s.inputs.len(), 1);
- let ns_field = &s.inputs[0];
- assert_eq!(ns_field.name, "namespaces");
- assert!(!ns_field.required, "namespaces must be optional");
-}