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): cover tiny connector, juice, and wallet imports
Steven Enamakel193ab7a09a70
diff --git a/crates/openhuman-core/src/modules/storage_grant_tinybox_tests.rs b/crates/openhuman-core/src/modules/storage_grant_tinybox_tests.rsindex 2dddd0bdb7..3112be684f 100644--- a/crates/openhuman-core/src/modules/storage_grant_tinybox_tests.rs+++ b/crates/openhuman-core/src/modules/storage_grant_tinybox_tests.rs@@ -38,7 +38,12 @@ fn box_records_and_the_jail_index_are_reachable() {);}assert_eq!(grant().collections.len(), 2);- for other in ["tinybox_host_import", "tinybox_boxes_x", "approvals", "_secrets"] {+ for other in [+ "tinybox_host_import",+ "tinybox_boxes_x",+ "approvals",+ "_secrets",+ ] {assert_eq!(authorize(&grant(),diff --git a/crates/openhuman-core/src/modules/storage_grant_tinyconnectors_tests.rs b/crates/openhuman-core/src/modules/storage_grant_tinyconnectors_tests.rsindex e0a1200e04..9b2fc9a391 100644--- a/crates/openhuman-core/src/modules/storage_grant_tinyconnectors_tests.rs+++ b/crates/openhuman-core/src/modules/storage_grant_tinyconnectors_tests.rs@@ -34,17 +34,32 @@ fn only_its_own_collection_and_trigger_streams_are_reachable() {json!({"collection": "composio-user-scopes", "id": "gmail"})));for day in ["triggers/2026-10-13", "triggers/x"] {- assert!(allowed(Object::Streams, "Append", json!({"stream": day})), "{day}");- assert!(allowed(Object::Streams, "Len", json!({"stream": day})), "{day}");+ assert!(+ allowed(Object::Streams, "Append", json!({"stream": day})),+ "{day}"+ );+ assert!(+ allowed(Object::Streams, "Len", json!({"stream": day})),+ "{day}"+ );}for other in ["trigger", "mcp_audit", "x402.payments", "_secrets"] {assert_eq!(- authorize(&grant(), Object::Streams, "Append", &json!({"stream": other})),+ authorize(+ &grant(),+ Object::Streams,+ "Append",+ &json!({"stream": other})+ ),Err(Denied::Target),"{other}");}- for other in ["composio-user-scopes-x", "tinyconnectors_host_import", "approvals"] {+ for other in [+ "composio-user-scopes-x",+ "tinyconnectors_host_import",+ "approvals",+ ] {assert_eq!(authorize(&grant(),diff --git a/crates/openhuman-core/src/modules/storage_grant_tinyjuice_tests.rs b/crates/openhuman-core/src/modules/storage_grant_tinyjuice_tests.rsindex 328ebe3961..632aa08ce4 100644--- a/crates/openhuman-core/src/modules/storage_grant_tinyjuice_tests.rs+++ b/crates/openhuman-core/src/modules/storage_grant_tinyjuice_tests.rs@@ -37,7 +37,12 @@ fn only_ccr_blobs_are_reachable() {"{selector}");}- for other in ["tinyjuice_ccr", "tinyjuice_ccr_x/a", "ccr/a", "../tinyjuice_ccr/a"] {+ for other in [+ "tinyjuice_ccr",+ "tinyjuice_ccr_x/a",+ "ccr/a",+ "../tinyjuice_ccr/a",+ ] {assert_eq!(authorize(&grant(), Object::Blobs, "Get", &json!({"key": other})),Err(Denied::Target),@@ -56,7 +61,7 @@ fn documents_streams_and_secrets_are_not_granted() {"Get",&json!({"collection": "tinyjuice_host_import", "id": "x"})),- Err(Denied::Target)+ Err(Denied::Object));assert_eq!(authorize(&grant(), Object::Streams, "Append", &json!({"stream": "s"})),diff --git a/crates/openhuman-core/src/modules/storage_grant_tinywallet_tests.rs b/crates/openhuman-core/src/modules/storage_grant_tinywallet_tests.rsindex 59d9eed2c4..541acc4e25 100644--- a/crates/openhuman-core/src/modules/storage_grant_tinywallet_tests.rs+++ b/crates/openhuman-core/src/modules/storage_grant_tinywallet_tests.rs@@ -54,7 +54,12 @@ fn the_payments_stream_and_the_budget_hold_document_are_reachable() {#[test]fn nothing_else_is_reachable() {- for other in ["x402_budget_extra", "tinywallet_host_import", "approvals", "_secrets"] {+ for other in [+ "x402_budget_extra",+ "tinywallet_host_import",+ "approvals",+ "_secrets",+ ] {assert_eq!(authorize(&grant(),@@ -67,7 +72,12 @@ fn nothing_else_is_reachable() {);}assert_eq!(- authorize(&grant(), Object::Streams, "Append", &json!({"stream": "mcp_audit"})),+ authorize(+ &grant(),+ Object::Streams,+ "Append",+ &json!({"stream": "mcp_audit"})+ ),Err(Denied::Target));assert_eq!(diff --git a/crates/openhuman-core/src/modules/storage_grants_tests.rs b/crates/openhuman-core/src/modules/storage_grants_tests.rsindex 189f25e6f0..5cda5be750 100644--- a/crates/openhuman-core/src/modules/storage_grants_tests.rs+++ b/crates/openhuman-core/src/modules/storage_grants_tests.rs@@ -333,7 +333,15 @@ fn only_modules_with_a_declared_grant_have_storage() {for record in crate::modules::registry::ALL {assert_eq!(declared(record.id).is_some(),- matches!(record.id, "tinymcp" | "tinychannels"),+ matches!(+ record.id,+ "tinymcp"+ | "tinychannels"+ | "tinyconnectors"+ | "tinywallet"+ | "tinybox"+ | "tinyjuice"+ ),"{}",record.id);diff --git a/crates/openhuman-core/src/modules/storage_import_tinyconnectors.rs b/crates/openhuman-core/src/modules/storage_import_tinyconnectors.rsindex 7f9fa4eb71..0d955ea436 100644--- a/crates/openhuman-core/src/modules/storage_import_tinyconnectors.rs+++ b/crates/openhuman-core/src/modules/storage_import_tinyconnectors.rs@@ -26,9 +26,7 @@ use anyhow::{anyhow, Context, Result};use serde_json::{json, Value};use tinystoragedrivers::{CollectionSpec, ScopedStorage};-use super::storage_grant_tinyconnectors::{- MODULE_ID, PREFS_COLLECTION, TRIGGER_STREAM_PREFIX,-};+use super::storage_grant_tinyconnectors::{MODULE_ID, PREFS_COLLECTION, TRIGGER_STREAM_PREFIX};use super::storage_import_support as support;const LOG_PREFIX: &str = "[connectors-import]";@@ -140,7 +138,9 @@ fn files_with_extension(dir: &Path, extension: &str) -> Result<Vec<std::path::Pa};let mut files = Vec::new();for entry in entries {- let path = entry.with_context(|| format!("list {}", dir.display()))?.path();+ let path = entry+ .with_context(|| format!("list {}", dir.display()))?+ .path();if path.is_file() && path.extension().is_some_and(|found| found == extension) {files.push(path);}@@ -157,8 +157,8 @@ fn read_legacy(prefs_dir: &Path, triggers_dir: &Path) -> Result<Legacy> {skipped += 1;continue;};- let text = std::fs::read_to_string(&path)- .with_context(|| format!("read {}", path.display()))?;+ let text =+ std::fs::read_to_string(&path).with_context(|| format!("read {}", path.display()))?;match serde_json::from_str::<Value>(&text) {Ok(value) => prefs.push(LegacyPref {key: key.to_owned(),@@ -180,8 +180,8 @@ fn read_legacy(prefs_dir: &Path, triggers_dir: &Path) -> Result<Legacy> {skipped += 1;continue;};- let text = std::fs::read_to_string(&path)- .with_context(|| format!("read {}", path.display()))?;+ let text =+ std::fs::read_to_string(&path).with_context(|| format!("read {}", path.display()))?;let (records, bad) = support::parse_jsonl(&text);skipped += bad;days.push(LegacyDay {@@ -200,13 +200,10 @@ fn read_legacy(prefs_dir: &Path, triggers_dir: &Path) -> Result<Legacy> {fn is_day(name: &str) -> bool {let bytes = name.as_bytes();bytes.len() == 10- && bytes- .iter()- .enumerate()- .all(|(index, byte)| match index {- 4 | 7 => *byte == b'-',- _ => byte.is_ascii_digit(),- })+ && bytes.iter().enumerate().all(|(index, byte)| match index {+ 4 | 7 => *byte == b'-',+ _ => byte.is_ascii_digit(),+ })}#[cfg(test)]diff --git a/crates/openhuman-core/src/modules/storage_import_tinyconnectors_tests.rs b/crates/openhuman-core/src/modules/storage_import_tinyconnectors_tests.rsindex 9c7b049596..69f809db19 100644--- a/crates/openhuman-core/src/modules/storage_import_tinyconnectors_tests.rs+++ b/crates/openhuman-core/src/modules/storage_import_tinyconnectors_tests.rs@@ -234,7 +234,14 @@ async fn an_unreadable_preference_file_is_retried_instead_of_marked_done() {#[test]fn only_calendar_days_name_an_archive_stream() {assert!(is_day("2026-10-13"));- for name in ["2026-1-13", "20261013", "2026-10-1x", "README", "2026-10-130", ""] {+ for name in [+ "2026-1-13",+ "20261013",+ "2026-10-1x",+ "README",+ "2026-10-130",+ "",+ ] {assert!(!is_day(name), "{name}");}}diff --git a/crates/openhuman-core/src/modules/storage_import_tinyjuice.rs b/crates/openhuman-core/src/modules/storage_import_tinyjuice.rsindex 9f3b2b3873..e36f454119 100644--- a/crates/openhuman-core/src/modules/storage_import_tinyjuice.rs+++ b/crates/openhuman-core/src/modules/storage_import_tinyjuice.rs@@ -120,7 +120,11 @@ async fn import_into(}let bytes = original.text.into_bytes();match remaining {- Some(left) => blobs.put_expiring(&key, bytes, Some(CONTENT_TYPE), left).await,+ Some(left) => {+ blobs+ .put_expiring(&key, bytes, Some(CONTENT_TYPE), left)+ .await+ }None => blobs.put(&key, bytes, Some(CONTENT_TYPE)).await,}.map_err(|error| anyhow!("write a blob: {:?}", error.kind()))?;diff --git a/crates/openhuman-core/src/modules/storage_import_tinyjuice_tests.rs b/crates/openhuman-core/src/modules/storage_import_tinyjuice_tests.rsindex 9933afe603..05511ed528 100644--- a/crates/openhuman-core/src/modules/storage_import_tinyjuice_tests.rs+++ b/crates/openhuman-core/src/modules/storage_import_tinyjuice_tests.rs@@ -170,7 +170,12 @@ async fn a_missing_directory_writes_no_marker() {#[test]fn only_hex_tokens_of_the_hash_length_are_ccr_names() {assert!(is_token(FRESH));- for name in ["", "abc", "zz112233445566778899aabbccddeeff", "../etc/passwd"] {+ for name in [+ "",+ "abc",+ "zz112233445566778899aabbccddeeff",+ "../etc/passwd",+ ] {assert!(!is_token(name), "{name}");}}diff --git a/crates/openhuman-core/src/modules/storage_import_tinywallet_tests.rs b/crates/openhuman-core/src/modules/storage_import_tinywallet_tests.rsindex a34fe1a012..4b1c3ea6da 100644--- a/crates/openhuman-core/src/modules/storage_import_tinywallet_tests.rs+++ b/crates/openhuman-core/src/modules/storage_import_tinywallet_tests.rs@@ -99,7 +99,10 @@ async fn a_stream_the_module_already_wrote_is_not_preceded_by_old_records() {let scoped = scoped();scoped.streams()- .append(PAYMENTS_STREAM, serde_json::from_str(&record("live", "settled")).unwrap())+ .append(+ PAYMENTS_STREAM,+ serde_json::from_str(&record("live", "settled")).unwrap(),+ ).await.unwrap();assert_eq!(