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(memory): tighten the add-source assertions, and say why the third path is not here
Shanu1e63524af579
diff --git a/src/openhuman/memory/sources/rpc_tests.rs b/src/openhuman/memory/sources/rpc_tests.rsindex 23b33bbd1f..cf8fffcf6e 100644--- a/src/openhuman/memory/sources/rpc_tests.rs+++ b/src/openhuman/memory/sources/rpc_tests.rs@@ -253,10 +253,19 @@ async fn add_generates_an_id_and_caps_a_request_that_left_its_limits_unset() {//// The caller never supplies one; a request that could name its own id would// let two sources collide by construction.+ let minted = added.id.strip_prefix("src_").unwrap_or_else(|| {+ panic!(+ "the handler must mint a `src_`-prefixed id, got {:?}",+ added.id+ )+ });assert!(- added.id.starts_with("src_") && added.id.len() == "src_".len() + 32,- "the handler must mint a `src_<uuid simple>` id, got {:?}",- added.id+ minted.len() == 32+ && minted+ .bytes()+ .all(|b| b.is_ascii_digit() || (b'a'..=b'f').contains(&b)),+ "the suffix must be a uuid-simple — 32 lowercase hex digits — and not \+ merely 32 characters, got {minted:?}");// ── the caps came from somewhere ────────────────────────────────────────@@ -280,9 +289,25 @@ async fn add_generates_an_id_and_caps_a_request_that_left_its_limits_unset() {.expect("get_rpc").value.source;+ let fetched = fetched.expect("the added source is not readable back from the registry");assert_eq!(- fetched.map(|s| s.id),- Some(added.id.clone()),- "the added source is not readable back from the registry"+ fetched.id, added.id,+ "the registry read back a different source"+ );++ // The id alone would be satisfied by a registry that persisted an entry+ // with every other field defaulted. These four are the request's+ // non-default fields, so each one is a mapping the handler had to carry.+ assert_eq!(+ fetched.kind,+ tinymemory_sources::types::SourceKind::GithubRepo,+ "the request's kind must survive the round trip"+ );+ assert_eq!(fetched.label, "A repository", "the request's label");+ assert!(fetched.enabled, "the request asked for an enabled source");+ assert_eq!(+ fetched.url.as_deref(),+ Some("https://github.invalid/owner/repo"),+ "the request's url");}diff --git a/src/openhuman/memory/sync/sync_status/rpc_tests.rs b/src/openhuman/memory/sync/sync_status/rpc_tests.rsindex 5c2329ed91..78bb7cc8ae 100644--- a/src/openhuman/memory/sync/sync_status/rpc_tests.rs+++ b/src/openhuman/memory/sync/sync_status/rpc_tests.rs@@ -25,6 +25,18 @@ fn response_keeps_top_level_statuses_array() {// that drove forty subjects through an in-process engine and went with it// (#6161). A later "tighten this into an RPC error" would turn a polled status// table into a visible failure, and no test would have objected (#6172).+//+// Two of the three are asserted below. The first — the binding itself failing+// to resolve — is deliberately not, because it cannot be reached from a unit+// test without damaging the rest of the binary. `binding::for_subtree` returns+// `Err` on exactly two conditions: the process-wide `BINDINGS` lock being+// poisoned, and the process-wide exit gate being raised. `memory::exit`'s own+// doc gives the reason that gate is a type with one production instance rather+// than a bare static — "a process-wide refusal to bind memory would reach every+// other test in the same process" — so a test that raised it would fail every+// test that binds memory after it. The arm is a two-line `warn` and `Vec::new()`+// in `rpc.rs`; what would have to change for it to start propagating is the+// `match` around it, which the two cases below already hold in place.use crate::openhuman::config::Config;use crate::openhuman::memory::api::provider::MemoryProvider;