Orchestrata Ultimate › Tests › Reference › agents › test_tool_registry

Tests reference — tests/agents/test_tool_registry.py

Module of tests/agents, split out because the directory page would be too large.

Prose pending.

tests/agents/test_tool_registry.py

source · 94 tests · 1367 lines

Behavioral tests for orchestrata_ultimate.agents.tool_registry.

Covers: agents.tool_registry, postman.postman, tools.base, tools.registry, core.packet/ (package)

Kind Name Line Description
function test_all_tools_have_unique_function_names 67
function test_get_agent_tools_filters_to_the_alias_allowlist 78
function test_get_agent_tools_unknown_alias_returns_empty_list 85
function test_deterministic_volk_has_no_tools_not_even_messaging 89
function test_every_llm_volk_can_message_peers 95
function test_path_escaping_the_workspace_is_rejected 106
function test_execute_unknown_tool_name_reports_clearly 117
function test_execute_catches_unexpected_errors_from_a_tool 123
function test_message_volk_without_postman_reports_clearly 136
function test_message_volk_requires_a_recipient 144
function test_message_volk_extracts_text_from_a_dict_payload 151
function test_message_volk_delivers_with_no_reply 170
function test_message_volk_stringifies_a_non_dict_payload 179
function test_pubsub_tools_appear_in_every_llm_volk_toolset 203
function test_pubsub_tools_in_get_agent_tools_schema 213
function test_publish_topic_without_postman_reports_clearly 218
function test_subscribe_topic_without_postman_reports_clearly 228
function test_unsubscribe_topic_without_postman_reports_clearly 236
function test_publish_topic_requires_topic 244
function test_subscribe_topic_requires_topic_pattern 251
function test_unsubscribe_topic_requires_topic_pattern 258
function test_unsubscribe_topic_not_subscribed_reports_clearly 265
function test_subscribe_then_publish_via_tools_end_to_end 272 A real Postman: U:BA subscribes via the tool, then U:Cd publishes via
function test_unsubscribe_topic_stops_further_delivery 303
function test_subscribe_topic_with_filters_and_ttl 325
function test_read_file_returns_full_content_by_default 348
function test_read_file_honors_start_line_and_max_lines 357
function test_read_file_missing_file_reports_not_found 368
function test_write_file_creates_parent_dirs_and_writes_content 374
function test_list_dir_defaults_to_workspace_root 385
function test_list_dir_with_explicit_relative_path 398
function test_search_code_finds_a_real_match 413
function test_search_code_reports_no_matches_found 422
function test_search_code_honors_explicit_path_and_include 434
function test_search_code_catches_subprocess_spawn_errors 447
function test_run_shell_blocks_dangerous_commands 460
function test_run_shell_executes_a_real_command 468
function test_run_shell_honors_explicit_cwd 476
function test_run_shell_reports_nonzero_exit_code 487
function test_run_shell_catches_spawn_errors_from_bad_cwd 493
function test_ast_query_summary_default_command 516
function test_ast_query_find_appends_class_name 522
function test_ast_query_inheritance_appends_class_name 530
function test_ast_query_unknown_subcommand_fails_with_empty_stdout 538
function test_ast_query_catches_subprocess_spawn_errors 548
function test_check_coverage_runs_the_real_subprocess 586
function test_check_coverage_kills_grandchildren_on_timeout 647
function test_check_coverage_catches_subprocess_spawn_errors 662
function test_check_coverage_reports_success_when_the_tool_succeeds 675
function test_validate_mermaid_accepts_a_well_formed_diagram 715
function test_validate_mermaid_strips_a_code_fence 724
function test_validate_mermaid_requires_a_diagram 731
function test_validate_mermaid_skips_leading_comment_lines 737
function test_validate_mermaid_rejects_a_comment_only_diagram 744
function test_validate_mermaid_rejects_unknown_diagram_type 755
function test_validate_mermaid_rejects_a_closer_with_no_opener 763
function test_validate_mermaid_rejects_unclosed_brackets 773
function test_check_doc_links_passes_when_local_link_resolves 787
function test_check_doc_links_reports_a_missing_file 797
function test_check_doc_links_honors_base_dir 805
function test_check_doc_links_ignores_anchors_and_external_links 816
function test_check_doc_links_rejects_empty_content 825
function test_check_doc_links_strips_a_link_title 831
function test_check_doc_links_treats_an_escaping_target_as_missing 841
function test_check_doc_links_is_a_registered_tool 854
function test_resolve_ddg_href_empty_string_returns_empty 863
function test_resolve_ddg_href_whitespace_only_returns_empty 867
function test_is_blocked_address_treats_unparsable_ip_as_blocked 871
function test_load_design_patterns_catalog_second_cache_check 875 Cover the double-checked locking path inside the catalog loader.
function test_ast_query_reports_error_when_child_exits_silently 937
function test_check_coverage_reports_error_when_child_exits_silently 966
function test_build_tool_registry_wraps_every_legacy_tool 1002
function test_build_tool_registry_registers_native_wave_tools 1011 SPEC-063..071 native tools land in the unified registry.
function test_build_tool_registry_native_tool_executes 1027 A native wave tool is dispatchable through the registry, end to end.
function test_build_tool_registry_maps_categories_and_approval_flags 1037
function test_build_tool_registry_executes_against_the_real_workspace 1049
function test_get_agent_tools_includes_native_schemas_alongside_legacy 1067 (a) get_agent_tools for U:SD (senior_dev) surfaces repl/lsp/worktree
function test_get_agent_tools_native_additions_present_for_every_settled_volk 1084 The SETTLED exposure map (per volk): every native tool name actually
function test_volk_not_in_the_native_exposure_map_does_not_gain_native_tools 1109 (d) U:Cx (concierge) was not given any native tools in the SETTLED
function test_codebase_query_tools_exposed_to_ar_cd_sd_with_valid_schemas 1138 U:Ar, U:Cd, U:SD (the impact-closure consumers -- design,
function test_codebase_query_tools_ba_gets_only_impact_and_module_deps 1155 U:BA (analysis) gets exactly the blast-radius/dependency-shape pair --
function test_codebase_query_tools_absent_for_deterministic_and_unlisted_volks 1166 U:Cp (deterministic, no LLM) must stay empty; a volk never given the
function test_native_tool_lsp_executes_end_to_end_via_tool_executor 1174 (b) ToolExecutor.execute('lsp', ...) dispatches through the native-tool
function test_native_tool_task_output_bad_id_uses_executor_error_convention 1192 (c) executor.execute('task_output', bad id) degrades the same way the
function test_tool_executor_builds_its_native_registry_once 1205 The lazily-built native-tool registry is constructed once per executor
function test_native_code_executing_tools_flagged_approval_like_write_file 1214 (e) The UNCONFINED tools surface requires_approval=True — repl doesn't
function test_native_tool_repl_still_executes_through_the_approval_wrapper 1236 Dispatch through the unified registry now REFUSES repl without an
function test_search_tools_registered_and_indexes_the_full_registry 1266 SPEC-072 wiring: register_native_tools registers a live ToolSearchTool
class TestToolExecutorApprovalEnforcement 1285 Approval is enforced on BOTH of ToolExecutor.execute's dispatch paths.
method TestToolExecutorApprovalEnforcement.test_legacy_run_shell_runs_for_a_granted_volk 1300 U:Cd is granted run_shell, so the handler must actually run.
method TestToolExecutorApprovalEnforcement.test_legacy_run_shell_refused_for_an_ungranted_volk 1309 U:Ux is not granted run_shell; the refusal must name the predicate.
method TestToolExecutorApprovalEnforcement.test_legacy_run_shell_refused_for_an_unattributed_caller 1319 No alias means no grant -- and the message must say so plainly.
method TestToolExecutorApprovalEnforcement.test_native_repl_refused_for_an_ungranted_volk 1330 The registry half: U:Ux sees no repl grant either.
method TestToolExecutorApprovalEnforcement.test_native_repl_reaches_the_tool_for_a_granted_volk 1339 U:Qa is granted repl, so dispatch must reach the tool itself.
method TestToolExecutorApprovalEnforcement.test_unflagged_tools_are_untouched 1355 A tool that does not require approval must not need a grant.