The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.
Rust agent-orchestrationai-agentsai-assistantdesktopllmlocal-firstmcppersonal-aiprivacyrustsecond-braintauri
test(storage): add host cdylib and linked storage tests
Steven Enamakeldcbb09812cf7
diff --git a/crates/openhuman-core/src/modules/storage_host_cdylib_stream_tests.rs b/crates/openhuman-core/src/modules/storage_host_cdylib_stream_tests.rsindex 7e7a1e27c6..5e8ac858a0 100644--- a/crates/openhuman-core/src/modules/storage_host_cdylib_stream_tests.rs+++ b/crates/openhuman-core/src/modules/storage_host_cdylib_stream_tests.rs@@ -138,7 +138,7 @@ async fn an_inline_blob_no_frame_can_carry_fails_fast_instead_of_hanging() {async fn a_watch_signal_reaches_the_module_that_opened_the_watch() {let _turn = TURN.lock().await;let rig = rig("tinymcp").await;- let seen = rig.member("WatchPut", ("mcp_servers", "watched")).await;+ let seen = rig.member("WatchPut", ("mcp.servers", "watched")).await;assert_eq!(seen["ok"], "invalidated", "{seen}");// A collection the grant never declared cannot be watched.let refused = rig@@ -184,7 +184,7 @@ async fn a_second_module_cannot_receive_the_first_modules_watch_signals() {.unwrap();let own_id = own["watch_id"].as_str().unwrap().to_string();// The first module opens a watch and changes its document.- let first = rig.member("WatchPut", ("mcp_servers", "w1")).await;+ let first = rig.member("WatchPut", ("mcp.servers", "w1")).await;assert_eq!(first["ok"], "invalidated", "{first}");// The second module's own change reaches the second module.let _: Value = documentsdiff --git a/crates/openhuman-core/src/modules/storage_host_cdylib_tests.rs b/crates/openhuman-core/src/modules/storage_host_cdylib_tests.rsindex e9a1a6e474..bc1416eb01 100644--- a/crates/openhuman-core/src/modules/storage_host_cdylib_tests.rs+++ b/crates/openhuman-core/src/modules/storage_host_cdylib_tests.rs@@ -289,12 +289,12 @@ async fn a_loaded_module_reads_and_writes_its_own_granted_collection() {.call("Documents","Put",- put("mcp_servers", "files", &json!({"qualified_name": "files"})),+ put("mcp.servers", "files", &json!({"qualified_name": "files"})),).await;assert!(stored.get("ok").is_some(), "{stored}");let read = rig- .call("Documents", "Get", get("mcp_servers", "files"))+ .call("Documents", "Get", get("mcp.servers", "files")).await;assert!(read.get("ok").is_some(), "{read}");assert!(read.to_string().contains("qualified_name"), "{read}");@@ -302,7 +302,7 @@ async fn a_loaded_module_reads_and_writes_its_own_granted_collection() {let own = rig.backend.for_scope(&rig.scope("tinymcp")).unwrap();assert!(own.documents()- .get("mcp_servers", "files")+ .get("mcp.servers", "files").await.unwrap().is_some());@@ -399,7 +399,7 @@ async fn a_loaded_module_cannot_name_or_reach_another_scope() {handle.documents().put(- "mcp_servers",+ "mcp.servers","victim",json!({"marker": "OTHER-SCOPE-SECRET"}),Default::default(),@@ -409,13 +409,13 @@ async fn a_loaded_module_cannot_name_or_reach_another_scope() {}// Same id, own scope: not found, not the other scope's document.let read = rig- .call("Documents", "Get", get("mcp_servers", "victim"))+ .call("Documents", "Get", get("mcp.servers", "victim")).await;assert!(read["ok"].is_null(), "{read}");assert!(!read.to_string().contains("OTHER-SCOPE-SECRET"), "{read}");// A scope smuggled into the request is not a selector the wire knows.for field in ["scope", "agent", "module", "profile"] {- let mut request = get("mcp_servers", "victim");+ let mut request = get("mcp.servers", "victim");request[field] = json!("local");let answer = rig.call("Documents", "Get", request).await;assert!(answer.get("err").is_some(), "{field}: {answer}");@@ -426,7 +426,7 @@ async fn a_loaded_module_cannot_name_or_reach_another_scope() {.call("Documents","Put",- put("mcp_servers", "mine", &json!({"qualified_name": "mine"})),+ put("mcp.servers", "mine", &json!({"qualified_name": "mine"})),).await;assert!(wrote.get("ok").is_some(), "{wrote}");@@ -434,7 +434,7 @@ async fn a_loaded_module_cannot_name_or_reach_another_scope() {let handle = rig.backend.for_scope(&scope).unwrap();assert!(handle.documents()- .get("mcp_servers", "mine")+ .get("mcp.servers", "mine").await.unwrap().is_none());@@ -478,7 +478,7 @@ async fn a_loaded_module_cannot_use_a_collection_it_never_declared() {.call("Documents","DropCollection",- json!({"collection": "mcp_servers"}),+ json!({"collection": "mcp.servers"}),).await;assert!(denied(&dropped, "schema-is-host-only"), "{dropped}");@@ -531,7 +531,7 @@ async fn a_peer_that_is_not_a_registry_module_is_refused() {STORAGE_INTERFACE,).unwrap();- let refused: tinybus::Result<Value> = proxy.call("Get", (get("mcp_servers", "files"),)).await;+ let refused: tinybus::Result<Value> = proxy.call("Get", (get("mcp.servers", "files"),)).await;match refused {Err(tinybus::Error::MethodFailed { name, message }) => {assert_eq!(name, "ai.tinyhumans.tinystorage.Error.Denied");@@ -600,7 +600,7 @@ async fn every_call_is_audited_under_the_module_id_without_a_payload() {"Documents","Put",put(- "mcp_servers",+ "mcp.servers","audited",&json!({"marker": "PAYLOAD-MARKER"}),),diff --git a/crates/openhuman-core/src/modules/storage_host_linked_tests.rs b/crates/openhuman-core/src/modules/storage_host_linked_tests.rsindex a3193934ef..2e64a421d0 100644--- a/crates/openhuman-core/src/modules/storage_host_linked_tests.rs+++ b/crates/openhuman-core/src/modules/storage_host_linked_tests.rs@@ -120,7 +120,7 @@ impl Bus {.call("Put",(json!({- "collection": "mcp_servers",+ "collection": "mcp.servers","document_id": id,"document_json": json!({"qualified_name": id}).to_string(),"precondition": {"kind": "none"},@@ -134,7 +134,7 @@ impl Bus {self.object("Documents").call("Get",- (json!({"collection": "mcp_servers", "document_id": id}),),+ (json!({"collection": "mcp.servers", "document_id": id}),),).await}