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
refactor(core): split domain plan tests into their own module
Steven Enamakelaaf05c169bc0
diff --git a/crates/openhuman-core/src/core/all_domain_plan_tests.rs b/crates/openhuman-core/src/core/all_domain_plan_tests.rsnew file mode 100644index 0000000000..c4a9a85e74--- /dev/null+++ b/crates/openhuman-core/src/core/all_domain_plan_tests.rs@@ -0,0 +1,108 @@+use super::*;++/// Every group must be a decision in `StoreInitPlan`: either it owns a store+/// field, or it is explicitly declared store-less here. A new family that owns+/// a store but is not keyed will fail this until it is listed.+#[test]+fn every_domain_group_is_accounted_for_in_store_init_plan() {+ use crate::core::runtime::context::StoreInitPlan;++ // Groups that own a store field in StoreInitPlan.+ const OWNS_STORE: &[DomainGroup] =+ &[DomainGroup::Memory, DomainGroup::Agent, DomainGroup::Skills];+ // Groups with no store of their own. Adding a variant forces a choice+ // between these two lists — that is the point.+ const STORELESS: &[DomainGroup] = &[+ DomainGroup::Threads,+ DomainGroup::Config,+ DomainGroup::Security,+ DomainGroup::Flows,+ DomainGroup::Mcp,+ DomainGroup::Channels,+ DomainGroup::Web3,+ DomainGroup::Voice,+ DomainGroup::Media,+ DomainGroup::Inference,+ DomainGroup::Integrations,+ DomainGroup::Automation,+ DomainGroup::Runtimes,+ DomainGroup::Desktop,+ DomainGroup::Hosted,+ // The registry is a compiled-in `const` table and the loaded-module set+ // lives in tinybus's own `ModuleHost`, so there is nothing for+ // `init_stores` to stand up.+ DomainGroup::Modules,+ DomainGroup::Platform,+ // User agents live on disk under the SaaS root and are opened by the+ // agent host on demand; nothing is stood up at boot.+ DomainGroup::Operator,+ ];++ for g in DomainGroup::ALL {+ let owns = OWNS_STORE.contains(g);+ let storeless = STORELESS.contains(g);+ assert!(+ owns ^ storeless,+ "{g:?} is in neither (or both) of OWNS_STORE / STORELESS — decide \+ whether it needs a StoreInitPlan field and list it in exactly one"+ );+ }++ // And the owning groups actually gate their field: turning the group off+ // must turn the store off.+ let mut only_memory = crate::core::runtime::DomainSet::none();+ only_memory.memory = true;+ let plan = StoreInitPlan::for_domains(only_memory);+ assert!(plan.memory, "Memory on ⇒ memory store initialized");+ assert!(!plan.agent_attachments, "Agent off ⇒ attachments store off");+ assert!(!plan.skills_prune, "Skills off ⇒ skills prune off");+}++/// Same contract for `DomainSubscriberPlan`: every group either registers+/// subscribers or is declared subscriber-less.+#[test]+fn every_domain_group_is_accounted_for_in_subscriber_plan() {+ use crate::core::runtime::subscribers::DomainSubscriberPlan;++ const REGISTERS: &[DomainGroup] = &[+ DomainGroup::Platform,+ DomainGroup::Channels,+ DomainGroup::Flows,+ DomainGroup::Memory,+ DomainGroup::Agent,+ DomainGroup::Mcp,+ DomainGroup::Integrations,+ DomainGroup::Security,+ DomainGroup::Desktop,+ DomainGroup::Skills,+ ];+ const NO_SUBSCRIBERS: &[DomainGroup] = &[+ DomainGroup::Threads,+ DomainGroup::Config,+ DomainGroup::Web3,+ DomainGroup::Voice,+ DomainGroup::Media,+ DomainGroup::Inference,+ DomainGroup::Automation,+ DomainGroup::Runtimes,+ DomainGroup::Hosted,+ // Modules run on their own in-process broker, so they cannot publish a+ // `DomainEvent` and there is nothing on the core bus to subscribe to.+ DomainGroup::Modules,+ // The operator plane only answers provisioning calls.+ DomainGroup::Operator,+ ];++ for g in DomainGroup::ALL {+ assert!(+ REGISTERS.contains(g) ^ NO_SUBSCRIBERS.contains(g),+ "{g:?} is in neither (or both) of REGISTERS / NO_SUBSCRIBERS — decide \+ whether it registers event-bus subscribers and list it in exactly one"+ );+ }++ // full() must enable every registering group; none() must enable none.+ let full = DomainSubscriberPlan::for_domains(crate::core::runtime::DomainSet::full());+ let none = DomainSubscriberPlan::for_domains(crate::core::runtime::DomainSet::none());+ assert_ne!(full, none, "full() and none() must differ");+}diff --git a/crates/openhuman-core/src/core/all_tests.rs b/crates/openhuman-core/src/core/all_tests.rsindex 235cd486ea..5c5df5ed1b 100644--- a/crates/openhuman-core/src/core/all_tests.rs+++ b/crates/openhuman-core/src/core/all_tests.rs@@ -1456,113 +1456,6 @@ fn domain_group_all_lists_every_variant() {);}-/// Every group must be a decision in `StoreInitPlan`: either it owns a store-/// field, or it is explicitly declared store-less here. A new family that owns-/// a store but is not keyed will fail this until it is listed.-#[test]-fn every_domain_group_is_accounted_for_in_store_init_plan() {- use crate::core::runtime::context::StoreInitPlan;-- // Groups that own a store field in StoreInitPlan.- const OWNS_STORE: &[DomainGroup] =- &[DomainGroup::Memory, DomainGroup::Agent, DomainGroup::Skills];- // Groups with no store of their own. Adding a variant forces a choice- // between these two lists — that is the point.- const STORELESS: &[DomainGroup] = &[- DomainGroup::Threads,- DomainGroup::Config,- DomainGroup::Security,- DomainGroup::Flows,- DomainGroup::Mcp,- DomainGroup::Channels,- DomainGroup::Web3,- DomainGroup::Voice,- DomainGroup::Media,- DomainGroup::Inference,- DomainGroup::Integrations,- DomainGroup::Automation,- DomainGroup::Runtimes,- DomainGroup::Desktop,- DomainGroup::Hosted,- // The registry is a compiled-in `const` table and the loaded-module set- // lives in tinybus's own `ModuleHost`, so there is nothing for- // `init_stores` to stand up.- DomainGroup::Modules,- DomainGroup::Platform,- // User agents live on disk under the SaaS root and are opened by the- // agent host on demand; nothing is stood up at boot.- DomainGroup::Operator,- ];-- for g in DomainGroup::ALL {- let owns = OWNS_STORE.contains(g);- let storeless = STORELESS.contains(g);- assert!(- owns ^ storeless,- "{g:?} is in neither (or both) of OWNS_STORE / STORELESS — decide \- whether it needs a StoreInitPlan field and list it in exactly one"- );- }-- // And the owning groups actually gate their field: turning the group off- // must turn the store off.- let mut only_memory = crate::core::runtime::DomainSet::none();- only_memory.memory = true;- let plan = StoreInitPlan::for_domains(only_memory);- assert!(plan.memory, "Memory on ⇒ memory store initialized");- assert!(!plan.agent_attachments, "Agent off ⇒ attachments store off");- assert!(!plan.skills_prune, "Skills off ⇒ skills prune off");-}--/// Same contract for `DomainSubscriberPlan`: every group either registers-/// subscribers or is declared subscriber-less.-#[test]-fn every_domain_group_is_accounted_for_in_subscriber_plan() {- use crate::core::runtime::subscribers::DomainSubscriberPlan;-- const REGISTERS: &[DomainGroup] = &[- DomainGroup::Platform,- DomainGroup::Channels,- DomainGroup::Flows,- DomainGroup::Memory,- DomainGroup::Agent,- DomainGroup::Mcp,- DomainGroup::Integrations,- DomainGroup::Security,- DomainGroup::Desktop,- DomainGroup::Skills,- ];- const NO_SUBSCRIBERS: &[DomainGroup] = &[- DomainGroup::Threads,- DomainGroup::Config,- DomainGroup::Web3,- DomainGroup::Voice,- DomainGroup::Media,- DomainGroup::Inference,- DomainGroup::Automation,- DomainGroup::Runtimes,- DomainGroup::Hosted,- // Modules run on their own in-process broker, so they cannot publish a- // `DomainEvent` and there is nothing on the core bus to subscribe to.- DomainGroup::Modules,- // The operator plane only answers provisioning calls.- DomainGroup::Operator,- ];-- for g in DomainGroup::ALL {- assert!(- REGISTERS.contains(g) ^ NO_SUBSCRIBERS.contains(g),- "{g:?} is in neither (or both) of REGISTERS / NO_SUBSCRIBERS — decide \- whether it registers event-bus subscribers and list it in exactly one"- );- }-- // full() must enable every registering group; none() must enable none.- let full = DomainSubscriberPlan::for_domains(crate::core::runtime::DomainSet::full());- let none = DomainSubscriberPlan::for_domains(crate::core::runtime::DomainSet::none());- assert_ne!(full, none, "full() and none() must differ");-}-/// M5.1 split `memory::all_memory_registered_controllers()` into seven/// per-family pairs pushed separately in `build_registered_controllers`. This/// pins the observable result: the `memory` namespace still occupies one@@ -1635,3 +1528,6 @@ mod removed_tests;#[path = "all_registry_tests.rs"]mod registry_tests;++#[path = "all_domain_plan_tests.rs"]+mod domain_plan_tests;diff --git a/scripts/ci/check-openhuman-rust-layout.mjs b/scripts/ci/check-openhuman-rust-layout.mjsindex 55599ee7f2..405b59300f 100644--- a/scripts/ci/check-openhuman-rust-layout.mjs+++ b/scripts/ci/check-openhuman-rust-layout.mjs@@ -52,7 +52,7 @@ const LEGACY_LIMIT_ENTRIES = [// their current sizes while follow-up work separates their test concerns.// `core/` was pruned from the line limit by name until these pins; its// oversized files are pinned at the size they had when enforcement began.- ["crates/openhuman-core/src/core/all.rs", 1340],+ ["crates/openhuman-core/src/core/all.rs", 1347],["crates/openhuman-core/src/core/all_tests.rs", 1632],["crates/openhuman-core/src/core/events.rs", 1808],["crates/openhuman-core/src/core/events_tests.rs", 1003],