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(session): assert load_skill is scoped rather than shared\n\nThe three-spec-views test now asserts that load_skill is the one deliberate\nexception to leaf-schema sharing, since the visible view rewrites its pack\nindex and skill enum per session while the durable set stays unscoped. The\ntest also verifies the exception was actually exercised, so a future change\nthat mutates in place or deep-copies everything again cannot pass silently.\n\nAuto-committed-on: macbook\n
Steven Enamakele383f8e6a673
diff --git a/src/openhuman/agent/harness/session/builder/builder_tests_part_01_tests.rs b/src/openhuman/agent/harness/session/builder/builder_tests_part_01_tests.rsindex 5b2ba9c40e..6eabaa28c8 100644--- a/src/openhuman/agent/harness/session/builder/builder_tests_part_01_tests.rs+++ b/src/openhuman/agent/harness/session/builder/builder_tests_part_01_tests.rs@@ -724,6 +724,8 @@ fn from_config_keeps_build_time_delegation_tools_out_of_the_durable_registry() {/// `fleet` agent. Pointer identity is the property that keeps it at one copy,/// so assert it directly rather than asserting equal contents (which the old/// deep-cloning shape also satisfied).+///+/// One spec is exempt by design — see the `load_skill` branch below.#[test]fn the_three_spec_views_share_their_leaf_schemas() {crate::openhuman::agent::harness::AgentDefinitionRegistry::init_global_builtins().unwrap();@@ -759,16 +761,44 @@ fn the_three_spec_views_share_their_leaf_schemas() {!visible.is_empty(),"the orchestrator advertises tools, so the visible view is non-empty");+ // `load_skill` is the one deliberate exception, and it is deliberate in the+ // other direction: `visible_tool_specs_for_policy` rewrites its pack index+ // and `skill` enum down to the packs THIS session can actually call, so the+ // visible entry must NOT be the durable one — `durable_tool_specs` stays the+ // unscoped truth, and sharing the leaf would scope it for every view that+ // holds it. `use_skill` is filtered wholesale, never rewritten, so it shares+ // like everything else.+ //+ // Asserted rather than merely excluded: a future change that made the+ // rewrite mutate in place would silently scope the durable set, and a+ // change that deep-copied everything again would still pass an+ // exclusion-only test.+ let load_skill = crate::openhuman::tools::toolpacks::LOAD_SKILL;+ let mut saw_scoped_load_skill = false;+for spec in visible.iter() {let shared = all.iter().any(|candidate| std::sync::Arc::ptr_eq(candidate, spec));+ if spec.name == load_skill {+ assert!(+ !shared,+ "`{load_skill}` must be scoped into its own allocation — sharing the leaf would rewrite the durable set's copy too"+ );+ saw_scoped_load_skill = true;+ continue;+ }assert!(shared,"visible spec `{}` must point at the full view's allocation, not a deep copy",spec.name);}++ assert!(+ saw_scoped_load_skill,+ "the orchestrator advertises `{load_skill}`, so the scoped-copy exception above must actually have been exercised rather than vacuously skipped"+ );}/// Failure path: a duplicate name must not smuggle a *different* allocation