Orchestrata Ultimate › Tests › Reference › tools

Tests reference — tests/tools

tests/tools — 21 test modules, 700 test functions. Source tree: tests/tools at commit 8a2cb42ad. Generated from the tests AST snapshot by scripts/gen-data-pages.py.

Prose pending.

Modules

Module Tests Covers
test_approval.py 11 4
test_approval_coverage.py 5 2
test_ast_pipeline.py 12 1
test_ast_pipeline_coverage.py 3 1
test_ast_query_cli.py 42 2
test_base.py 3 1
test_codebase_query_tools.py 16 5
test_codebase_tools.py 30 1
test_context_tools.py 13 6
test_context_tools_coverage.py 25 4
test_conversation_tools.py 7 6
test_lsp_tool.py 82 2
test_mcp_resource_tools.py 24 3
test_registry.py 24 3
test_remote_trigger_tool.py 81 3
test_repl_tool.py 49 2
test_schedule_cron_tool.py 76 4
test_search.py 81 7
test_task_tools.py 74 3
test_worktree_tools.py 42 2

Module details

tests/tools/test_approval.py

source · 11 tests · 199 lines

Tests for orchestrata_ultimate.tools.approval - PrologApprovalGate.

Covers: agents.tool_registry, governance.prolog_client, infra.prolog_bridge, tools.approval

Kind Name Line Description
class TestPrologApprovalGate 38 The gate's verdicts, against the shipped rulebase.
method TestPrologApprovalGate.test_grants_repl_to_a_volk_the_rulebase_names 41 U:Qa holds repl in AGENT_TOOLS, so a fact must grant it.
method TestPrologApprovalGate.test_denies_repl_to_a_volk_the_rulebase_does_not_name 45 U:Ux never holds repl, and absence of a fact is a denial.
method TestPrologApprovalGate.test_denies_an_unattributed_caller 54 A call with no volk alias cannot be attributed to a granted volk.
method TestPrologApprovalGate.test_grants_are_per_tool_not_per_volk 59 Holding one flagged tool must not confer the others.
method TestPrologApprovalGate.test_denies_an_unknown_actor 76 An alias that is not a volk at all gets nothing.
method TestPrologApprovalGate.test_denies_a_tool_no_fact_mentions 85 A flagged tool added later, before anyone grants it, is refused.
method TestPrologApprovalGate.test_arguments_do_not_change_the_verdict 92 The grant is per (volk, tool); arguments are not consulted.
class TestStrictPredicateIsNotThePermissiveOne 103 The discriminating test: may_execute_tool/2 must NOT be may_execute/2.
method TestStrictPredicateIsNotThePermissiveOne.test_may_execute_allows_what_may_execute_tool_denies 106 The two predicates answer different questions, and must keep doing so.
method TestStrictPredicateIsNotThePermissiveOne.test_every_client_shares_one_process_global_rulebase 143 A second client sees the rules the first one consulted.
class TestGrantsMirrorTheToolGrants 165 The rulebase and AGENT_TOOLS must not drift apart.
method TestGrantsMirrorTheToolGrants.test_every_volk_holding_a_flagged_tool_is_granted_it 168 A volk that can SEE a flagged tool must be able to USE it.
method TestGrantsMirrorTheToolGrants.test_no_volk_is_granted_a_flagged_tool_it_cannot_see 185 A grant for a tool the volk is never offered is dead policy.

tests/tools/test_approval_coverage.py

source · 5 tests · 88 lines

Coverage tests for the two paths tests/tools/test_approval.py never reaches.

Covers: governance.prolog_client, tools.approval

Kind Name Line Description
class TestSharedGovernanceClient 24 The lazy process-global client production gates query through.
method TestSharedGovernanceClient.test_builds_a_real_client_with_the_rule_corpus_consulted 27 The lazy load must produce a working client, not just any object.
method TestSharedGovernanceClient.test_is_built_once_and_shared 39 Every call returns the one cached client (the fast path at L40).
class TestGateWithoutInjectedClient 48 A gate constructed the way production constructs it: actor only.
method TestGateWithoutInjectedClient.test_grants_and_denies_through_the_shared_client 51 client=None must route to the shared client (ternary else-path).
method TestGateWithoutInjectedClient.test_unattributed_caller_is_denied_through_the_shared_client 60 No alias can be attributed to a granted volk, whoever asks.
class TestFailClosedOnQueryFailure 65 Lines 86-95: an approval gate that cannot reach its rulebase denies.
method TestFailClosedOnQueryFailure.test_approve_denies_and_logs_when_the_query_raises 68 Any exception from the client must become a denial, never a grant.

tests/tools/test_ast_pipeline.py

source · 12 tests · 340 lines

Behavioral tests for orchestrata_ultimate.tools.ast_pipeline.

Covers: tools.ast_pipeline

Kind Name Line Description
function test_run_success_does_not_exit 40 A real, successful serializer invocation (--help) returns quietly.
function test_run_failure_exits_with_subprocess_returncode 47 A real failing invocation makes run call sys.exit with that code.
function test_main_returns_1_when_serializer_missing 58 If the AST serializer script genuinely isn't on disk, main() bails out.
function test_main_skips_monorepo_and_deep_compare_when_source_missing 80 Ultimate is serialized for real; the monorepo + deep-compare steps are
function test_main_runs_full_pipeline_when_both_sources_exist 128 When both source trees exist, all three real pipeline steps run and
function test_module_constants_point_at_real_repo_layout 184 The default (unpatched) constants resolve to real, existing repo paths.
function test_the_snapshot_covers_tests_and_scripts_as_well_as_src 199 Mohamed, 2026-08-08: "the ast must see tests and scripts too."
function test_the_snapshot_covers_the_deployed_claude_machinery 216 claude/ is the context-injection machinery, and it was blind to itself.
function test_extra_root_ids_cannot_collide_with_the_primary_tree 236 Both claude/ and src/orchestrata_ultimate/ contain a tools/.
function test_source_trees_is_read_at_call_time_not_frozen_at_import 255 The seam every caller of :func:main relies on.
function test_snapshot_only_writes_snapshot_and_skips_monorepo_and_deep_compare 274 --snapshot-only runs step 1 and stops.
function test_main_parses_its_own_argv_not_the_hosting_process_argv 323 main(argv) must read the list it is GIVEN.

tests/tools/test_ast_pipeline_coverage.py

source · 3 tests · 196 lines

Coverage tests for the two ast_pipeline.main() branches the behavioral

Covers: tools.ast_pipeline

Kind Name Line Description
function test_output_dir_seeds_cold_target_from_committed_snapshot 40 A cold --output-dir target is seeded from the committed snapshot.
function test_output_dir_without_committed_snapshot_skips_seeding 95 No committed snapshot -> nothing to seed from -> a plain cold run.
function test_tests_tree_in_scope_derives_ast_tests_projection 138 A tests tree in EXTRA_SOURCE_TREES yields ast-tests.json.

tests/tools/test_ast_query_cli.py

source · 42 tests · 725 lines

Behavioral tests for orchestrata_ultimate.tools.ast_query_cli.

Covers: tools.ast_query, tools.ast_query_cli

Kind Name Line Description
function test_summary_text_and_json 224
function test_modules 236
function test_stats 243
function test_summary_warns_on_stderr_when_stale 276
function test_modules_no_warning_when_root_path_absent 286
function test_stats_warns_on_stderr_when_stale 294
function test_stubs_heuristic_nonempty 304
function test_stubs_heuristic_empty 313
function test_stubs_with_compare_json_output 320
function test_find_found_text_and_json 341
function test_find_not_found 352
function test_search_matches_text 361
function test_search_matches_json 368
function test_search_no_matches 379
function test_search_case_sensitive 385
function test_largest 394
function test_connected 404
function test_largest_top_flag_matches_positional_and_limits_rows 414 --top N is flag-consistent with serialize_codebase_ast.py's --top,
function test_connected_top_flag_matches_positional_and_limits_rows 430
function test_inheritance_found 446
function test_inheritance_not_found 459
function test_category_filter_commands 480
function test_abstract_with_and_without_bases 495
function test_abstract_json_output 502
function test_diff_found 513
function test_diff_found_json 528
function test_diff_not_found 545
function test_unmapped_with_data_over_30 563
function test_unmapped_with_data_json 574
function test_unmapped_no_data 589
function test_unmapped_empty_compare_file 598
function test_coverage_with_data 611
function test_coverage_with_data_json 621
function test_coverage_no_data 636
function test_output_json_scalar_with_dict_attr 648
function test_output_json_scalar_without_dict_attr 662
function test_output_list_of_dicts 672
function test_output_list_of_scalars 679
function test_output_plain_dict 685
function test_output_fallback_scalar 691
function test_print_dict_all_branches 697
function test_main_invokes_app 717

tests/tools/test_base.py

source · 3 tests · 53 lines

Tests for orchestrata_ultimate.tools.base — the Tool Protocol.

Covers: tools.base

Kind Name Line Description
class TestToolProtocol 35
method TestToolProtocol.test_runtime_checkable_isinstance 36
method TestToolProtocol.test_object_without_execute_is_not_a_tool 40
method TestToolProtocol.test_execute_returns_tool_result 47

tests/tools/test_codebase_query_tools.py

source · 16 tests · 540 lines

Tests for orchestrata_ultimate.tools.codebase_query_tools — the SPEC-062/072

Covers: agents.tool_registry, tools.base, tools.codebase_query_tools, tools.codebase_tools, tools.registry

Kind Name Line Description
function test_registration_presence_and_metadata_shape 113
function test_registered_into_native_tool_wave 147 SPEC-072 wiring: build_tool_registry()/register_native_tools() picks
function test_registration_never_constructs_codebase_tools 164 Merely registering the tools must not consult Prolog -- the shared
function test_independent_construction_gets_its_own_private_lazy_handle 181 Each Tool class is independently constructible (register_* is a
function test_first_real_query_constructs_janus_backed_kb_no_silent_fallback 190 The first actual query lazily constructs a real CodebaseTools -- and it
function test_lifecycle_auto_indexes_from_fixture_snapshot_on_first_query 255 A fresh registry (no injected kb) auto-indexes from the fixture
function test_lifecycle_second_instance_attaches_without_reindexing 278 A second, independent registry pointed at the same kb_dir/snapshot
function test_lifecycle_stale_facts_triggers_reindex 307 A facts.pl older than the snapshot is treated as stale and rebuilt --
function test_lifecycle_missing_snapshot_fails_cleanly_not_a_crash 333 No facts.pl and no snapshot -> a failed ToolResult carrying the real,
function test_lifecycle_default_paths_are_project_root_anchored 354 With no ORCHESTRATA_CODEBASE_KB_DIR/ORCHESTRATA_AST_SNAPSHOT override,
function test_module_deps_and_dep_path_real_query_through_registry 400
function test_find_cycles_and_impact_real_query_through_registry 438
function test_missing_required_arguments_fail_cleanly 470
function test_invalid_limit_argument_fails_cleanly_not_a_crash 493 Regression: a non-numeric 'limit' must become a failed ToolResult, not
function test_not_loaded_kb_surfaces_structured_error_not_a_crash 519
function test_unknown_module_surfaces_structured_error 531

tests/tools/test_codebase_tools.py

source · 30 tests · 1295 lines

Tests for orchestrata_ultimate.tools.codebase_tools — CodebaseTools, the

Covers: tools.codebase_tools

Kind Name Line Description
function test_default_and_explicit_construction_resolve_prolog_file 296
function test_not_loaded_guard_returns_structured_error 321 Every public query method guards on self._loaded BEFORE assembling
function test_prolog_val_scalar_conversions 343 _prolog_val is the single seam that turns Python scalars into
function test_reindex_builds_kb_with_exact_counts 360
function test_reindex_subprocess_transport_matches_janus_transport 376 SPEC-023 parity proof, permanent regression test: reindexing the SAME
function test_reindex_janus_transport_reports_structured_error_on_bad_path 411 A nonexistent AST JSON path makes load_codebase/2 raise a real
function test_finalize_facts_write_is_same_directory_rename_and_preserves_on_abandon 440 Direct unit proof of the atomic-write contract:
function test_reindex_janus_leaves_previous_facts_untouched_on_failed_reindex 477 A SECOND reindex() call against a bad AST path, on an instance
function test_reindex_subprocess_leaves_previous_facts_untouched_on_failed_reindex 500 Subprocess-transport parity for the test directly above: swipl fails
function test_reindex_leaves_no_scratch_tmp_file_after_success 530 After a SUCCESSFUL reindex (either transport), the scratch tmp file
function test_find_symbol_impact_and_symbol_context 560
function test_complexity_end_line_hotspots_and_call_chain 633
function test_module_graph_props_api_externals_and_unused 678
function test_isolation_between_instances_and_attach_without_reindex 771
function test_default_transport_is_janus_and_subprocess_is_explicit_opt_in 807 No auto/fallback mode: default construction is "janus" (fail-loud if
function test_assert_free_threaded_injection_seam 831 _assert_free_threaded is the janus-transport constructor's GIL-on
function test_transport_parity_janus_vs_subprocess 847 The janus and subprocess transports answer the IDENTICAL query with
function test_normalize_janus_value_null_branch 910 normalize_janus_value's 'null' branch: no tool* predicate in
function test_run_janus_failure_isolation 922 _run_janus must never raise to the caller: a genuine Prolog goal
function test_facts_switching_under_janus_isolates_interleaved_instances 943 Two janus-transport instances with DIFFERENT fixture KBs, queried in
function test_tabling_invalidation_on_reindex_under_janus 1000 Query impact() under janus, reindex the SAME instance with a fixture
function test_thread_smoke_concurrent_janus_queries 1031 4 threads x 10 queries through ONE janus-transport CodebaseTools
function test_absolute_package_qualified_import_resolves_to_a_caller 1094 A call reached through a function-local, package-qualified import.
function test_an_external_import_is_not_rewritten_onto_a_local_module 1116 Only the ROOT-PACKAGE prefix is stripped, never any leading segment.
function test_literals_reports_the_enclosing_symbol_of_a_declared_constant 1173 literals answers "where does this constant come from".
function test_literals_does_not_match_a_value_that_is_never_declared 1195 Empty means "not declared", and the caller must be able to trust it.
function test_affected_symbols_closes_over_inheritance_and_calls 1213 Blast radius as CLASSES and METHODS, not just modules.
function test_affected_tests_returns_a_runnable_path 1237 The runnable half of blast radius: a path the runner can take.
function test_freshness_is_fresh_immediately_after_a_reindex 1254
function test_freshness_names_the_module_that_changed_under_it 1265 A stale KB must say WHICH module drifted, not merely that one did.

tests/tools/test_context_tools.py

source · 13 tests · 372 lines

Behavioral tests for on-demand context tools (SPEC-107 FR-007).

Covers: agents.tool_registry, core.graph.config, semantic_graph.config, tools.context_tools, tools.registry, core.graph/ (package)

Kind Name Line Description
function test_split_entity_id_variants 79
function test_get_code_returns_file_content 99
function test_get_code_returns_class_signature 129
function test_get_code_missing_entity_returns_error 163
function test_get_code_no_repo_degrades_gracefully 170
function test_get_tests_returns_covering_tests 193
function test_get_tests_empty_for_unknown_entity 228
function test_get_requirements_returns_traced_chain 241 The seed is CANONICAL: every requirement tier carries project_id.
function test_search_code_semantic_degrades_when_memgraph_down 312
function test_search_code_semantic_no_query_returns_error 328
function test_register_context_tools_populates_registry 340
function test_context_tools_exposed_to_relevant_volks 349
function test_get_agent_tools_includes_context_schemas 363

tests/tools/test_context_tools_coverage.py

source · 25 tests · 601 lines

Branch-coverage tests for on-demand context tools (SPEC-107 FR-007).

Covers: core.graph_factory, semantic_graph.config, tools.context_tools, core.graph/ (package)

Kind Name Line Description
function test_lazy_repo_creates_real_repository_on_demand 134
function test_lazy_repo_failed_state_returns_none_without_retry 145
function test_get_code_requires_entity_id 156
function test_get_code_repo_unavailable_degrades 164
function test_get_code_default_project_for_bare_path 172 A bare-path entity id uses the ambient project default and resolves
function test_get_code_fallback_file_not_found 204
function test_get_code_fallback_resolves_dotted_qualname_leaf 211 qualname 'Klass.method' misses as-is, then resolves by the leaf name.
function test_get_code_fallback_symbol_not_found 247 File resolves but no DEFINES-ed symbol matches either candidate name.
function test_get_code_survives_backend_failure 272
function test_get_code_fallback_helper_degrades_on_backend_failure 279 The fallback helper itself swallows backend errors and returns [].
function test_get_tests_requires_entity_id 293
function test_get_tests_repo_unavailable_degrades 301
function test_get_tests_fallback_resolves_by_path_and_leaf_name 309 The canonical id has no node, so the path+name fallback must run.
function test_get_tests_fallback_file_entity_without_qualname 359 Unknown bare-path entity id: the fallback applies the ambient project
function test_get_tests_survives_backend_failure 371
function test_get_tests_fallback_helper_degrades_on_backend_failure 378
function test_get_requirements_requires_entity_id 391
function test_get_requirements_repo_unavailable_degrades 399
function test_get_requirements_fallback_resolves_by_path_and_leaf_name 407 Entity id has no node and no TRACES_TO: the file+name fallback finds
function test_get_requirements_fallback_default_project_for_bare_path 459 Bare-path entity id: project falls back to the ambient env default;
function test_get_requirements_fallback_file_entity_without_qualname 493 Unknown entity id without '::': fallback short-circuits on qualname
function test_get_requirements_collectors_degrade_on_backend_failure 510 Both item-id collectors swallow backend errors; the tool still answers
function test_search_code_rejects_invalid_target_files 529
function test_search_code_no_matching_chunks_returns_empty_message 537 Real Memgraph reachable, but nothing matches the unique term.
function test_search_code_returns_seeded_chunk 568 Seed one real CodestralChunk in the semantic graph; the tool must find

tests/tools/test_conversation_tools.py

source · 7 tests · 195 lines

Tests for tools.conversation_tools — ConvStatusTool / ConvSyncTool (SPEC-021).

Covers: core.graph.interfaces, core.graph.repository, knowledge_graph.conversation_consumer, tools.base, tools.conversation_tools, tools.registry

Kind Name Line Description
class TestConvStatusTool 109
method TestConvStatusTool.test_metadata 110
method TestConvStatusTool.test_execute_reports_depth 115
method TestConvStatusTool.test_execute_redis_down_is_non_blocking 136 A REAL redis.Redis client pointed at a dead port — success=False,
class TestConvSyncTool 152
method TestConvSyncTool.test_metadata 153
method TestConvSyncTool.test_execute_flushes_and_reports_summary 158
method TestConvSyncTool.test_execute_never_raises_on_broken_redis 172
class TestRegisterConversationTools 186
method TestRegisterConversationTools.test_registers_both_tools_sharing_one_consumer 187

tests/tools/test_lsp_tool.py

source · 82 tests · 836 lines

Tests for orchestrata_ultimate.tools.lsp_tool — LSPTool (SPEC-065).

Covers: tools.base, tools.lsp_tool

Kind Name Line Description
function test_position_to_dict 96
function test_range_to_dict 101
function test_lsp_location_to_dict 109
function test_document_symbol_info_to_dict 119
function test_lsp_hover_to_dict_without_range 128
function test_lsp_hover_to_dict_with_range 133
function test_lsp_diagnostic_to_dict_minimal 139
function test_lsp_diagnostic_to_dict_full 148
function test_lsp_diagnostics_to_dict 161
function test_uri_to_path_bare_path 176
function test_uri_to_path_file_scheme 180
function test_uri_to_path_blank_raises 185
function test_uri_to_path_unsupported_scheme_raises 191
function test_uri_to_path_empty_after_file_scheme_raises 197
function test_path_to_uri_roundtrip 203
function test_ensure_python_file_accepts_py 209
function test_ensure_python_file_rejects_other_suffix 213
function test_iter_python_files_single_file 221
function test_iter_python_files_directory 225
function test_iter_python_files_missing_path 238
function test_resolve_search_paths_defaults_to_target 242
function test_resolve_search_paths_with_directory 247
function test_resolve_search_paths_rejects_non_list 254
function test_resolve_search_paths_skips_non_string_entries 260
function test_identifier_at_finds_function_name 268
function test_identifier_at_out_of_range_line_returns_none 276
function test_identifier_at_out_of_range_column_returns_none 282
function test_identifier_at_no_identifier_at_position 288
function test_find_definition_function 297
function test_find_definition_class 306
function test_find_definition_method 313
function test_find_definition_module_assignment 319
function test_find_definition_not_found_returns_none 325
function test_find_definition_skips_unreadable_paths 330
function test_find_definition_skips_syntax_error_file 340
function test_find_definition_multiline_def_falls_back_to_col_offset 350
function test_find_references_function_calls 367
function test_find_references_attribute_use 375
function test_find_references_across_multiple_files 382
function test_find_references_no_matches_returns_empty 394
function test_find_references_skips_unreadable_and_broken_files 399
function test_document_symbols_lists_module_members 414
function test_document_symbols_qualifies_methods 423
function test_document_symbols_kinds 430
function test_hover_function_includes_signature_and_docstring 441
function test_hover_class_includes_signature 449
function test_hover_class_with_bases 456
function test_hover_not_found_returns_none 465
function test_hover_skips_unreadable_and_broken_files 470
function test_hover_without_docstring 482
function test_attribute_reference_has_correct_column 494
function test_pyright_backend_available 509
function test_pyright_backend_unavailable_command 514
function test_pyright_diagnostics_reports_type_error 519
function test_pyright_diagnostics_clean_file_has_no_errors 528
function test_pyright_diagnostics_missing_binary_raises_server_not_found 535
function test_pyright_diagnostics_missing_file_raises_file_read_error 544
function test_pyright_diagnostics_timeout_raises_request_timeout 553
function test_pyright_diagnostics_malformed_output_raises_server_error 562
function test_lsp_tool_metadata_name_and_category 577
function test_lsp_tool_metadata_parameters_require_action_and_uri 582
function test_lsp_tool_to_function_schema 589
function test_lsp_tool_name_description_category_properties 595
function test_execute_definition 605
function test_execute_references 619
function test_execute_document_symbols 634
function test_execute_hover 645
function test_execute_diagnostics 659
function test_execute_with_file_uri_scheme 669
function test_execute_references_with_search_paths 679
function test_execute_definition_not_found_returns_null 702
function test_execute_unknown_action 722
function test_execute_missing_uri 729
function test_execute_blank_uri 736
function test_execute_unsupported_language 743
function test_execute_missing_position_for_definition 758
function test_execute_malformed_position 767
function test_execute_no_identifier_at_position 782
function test_execute_diagnostics_missing_file 797
function test_execute_diagnostics_server_not_found 808
function test_execute_invalid_uri_scheme 818
function test_execute_unforeseen_exception_becomes_failed_result 827

tests/tools/test_mcp_resource_tools.py

source · 24 tests · 451 lines

Tests for orchestrata_ultimate.tools.mcp_resource_tools and .mcp_stdio_client.

Covers: tools.base, tools.mcp_resource_tools, tools.mcp_stdio_client

Kind Name Line Description
class TestListMcpResourcesToolMetadata 145
method TestListMcpResourcesToolMetadata.test_metadata_identity_and_category 146
method TestListMcpResourcesToolMetadata.test_to_function_schema 152
class TestListMcpResourcesToolExecute 160
method TestListMcpResourcesToolExecute.test_lists_all_resources 161
method TestListMcpResourcesToolExecute.test_filter_by_mime_type_prefix 178
method TestListMcpResourcesToolExecute.test_pagination_limit_and_offset 195
method TestListMcpResourcesToolExecute.test_missing_command_is_validation_error 215
method TestListMcpResourcesToolExecute.test_bad_args_type_is_validation_error 222
method TestListMcpResourcesToolExecute.test_server_unreachable_reports_error_code 229
method TestListMcpResourcesToolExecute.test_hanging_server_times_out 239
class TestReadMcpResourceToolMetadata 253
method TestReadMcpResourceToolMetadata.test_metadata_identity_and_category 254
class TestReadMcpResourceToolExecute 261
method TestReadMcpResourceToolExecute.test_reads_full_text_content 262
method TestReadMcpResourceToolExecute.test_offset_and_limit_slice_text 279
method TestReadMcpResourceToolExecute.test_reads_binary_blob_content 298
method TestReadMcpResourceToolExecute.test_offset_and_limit_slice_binary 318
method TestReadMcpResourceToolExecute.test_resource_not_found_reports_error_code 338
method TestReadMcpResourceToolExecute.test_missing_command_is_validation_error 355
method TestReadMcpResourceToolExecute.test_missing_resource_uri_is_validation_error 362
method TestReadMcpResourceToolExecute.test_bad_args_type_is_validation_error 369
method TestReadMcpResourceToolExecute.test_server_unreachable_reports_error_code 378
class TestMcpStdioClientDirect 395
method TestMcpStdioClientDirect.test_connect_populates_server_info_and_close_terminates 396
method TestMcpStdioClientDirect.test_close_is_a_noop_when_never_connected 411
method TestMcpStdioClientDirect.test_close_kills_a_hanging_process 415
method TestMcpStdioClientDirect.test_malformed_json_line_raises_server_error 426
method TestMcpStdioClientDirect.test_connect_failure_raises_server_unreachable 443

tests/tools/test_registry.py

source · 24 tests · 390 lines

Tests for the unified tool framework + registry (SPEC-062).

Covers: agents.tool_registry, tools.base, tools.registry

Kind Name Line Description
function test_metadata_to_function_schema_shape 59
function test_metadata_defaults 66
function test_base_tool_convenience_properties_delegate_to_metadata 75 BaseTool.name/description/category mirror metadata.
function test_register_get_has_names 87
function test_duplicate_registration_raises_unless_replace 99
function test_unregister 108
function test_list_filters_by_category_tag_priority 116
function test_metadata_index 128
function test_getitem_missing_raises_keyerror 134
function test_iter_yields_registered_tools 140
function test_clear_removes_all_tools 148
function test_execute_dispatches_to_tool 160
function test_execute_unknown_tool_returns_failure 168
function test_to_function_schemas_all_and_subset 178
function test_default_registry_singleton_and_register_tool 189
function test_build_tool_registry_populates_all_legacy_tools 203
function test_legacy_registry_schemas_round_trip_all_tools 225
function test_legacy_registry_executes_against_real_filesystem 234
function test_approval_required_tool_is_refused_without_a_gate 285 Fail closed: no gate installed means the call does not run.
function test_approval_required_tool_runs_when_the_gate_grants 303 The gate is a real decision point, not a permanent block.
function test_approval_required_tool_is_refused_when_the_gate_denies 317
function test_a_tool_without_requires_approval_is_not_gated 331 The gate must narrow to flagged tools only.
function test_registry_wide_gate_applies_without_a_per_call_gate 346 A gate installed on the registry covers every call through it.
function test_exactly_the_unconfined_tools_require_approval 360 The flagged set is pinned in BOTH directions, and the set is the policy.

tests/tools/test_remote_trigger_tool.py

source · 81 tests · 1210 lines

Tests for orchestrata_ultimate.tools.remote_trigger_tool (SPEC-067).

Covers: tools.base, tools.registry, tools.remote_trigger_tool

Kind Name Line Description
function test_execute_get_success 208
function test_execute_post_json_body_and_headers 224
function test_execute_post_scalar_body 242
function test_execute_post_raw_string_body 257 A raw (non-JSON) string body is sent as-is, not JSON-encoded.
function test_methods_reach_server 274
function test_query_params_reach_server 288
function test_invalid_method_rejected 302
function test_invalid_url_rejected 308
function test_invalid_url_missing_scheme 314
function test_malformed_retry_config_raises_invalid_config 320
function test_auth_api_key_header 336
function test_auth_api_key_query 354
function test_auth_bearer_literal 373
function test_auth_bearer_env_injection_via_execute_simple 386 The token (and the SSRF opt-in) come from an injected env mapping —
function test_auth_bearer_env_injection_via_run 406
function test_auth_bearer_missing_token_raises_auth_failed 422
function test_auth_basic 437
function test_auth_hmac_signs_body 457
function test_auth_oauth2_client_credentials 475
function test_auth_oauth2_token_endpoint_error_status 494
function test_auth_oauth2_missing_access_token_in_response 512
function test_auth_oauth2_token_url_connection_error 531
function test_invalid_auth_type_rejected 552
function test_retry_on_server_error_then_success 563
function test_retry_exhausted_reports_error 577
function test_no_retry_when_disabled 590
function test_retry_respects_retry_after_header 605
function test_parse_retry_after_used_as_delay 629 Unit-level: a numeric Retry-After caps/overrides the backoff delay.
function test_timeout_returns_error_fast 639
function test_timeout_retry_on_timeout 659 Every attempt times out -> exhausts retries and reports a timeout error.
function test_connection_error_when_nothing_listening 682
function test_ssrf_blocks_loopback_by_default 701
function test_ssrf_allow_internal_permits_request 708
function test_ssrf_guard_blocks_metadata_ip 716
function test_ssrf_guard_allows_public_looking_address 726
function test_ssrf_guard_blocks_literal_metadata_hostname 732
function test_ssrf_guard_dns_resolution_failure 740 An unresolvable hostname (RFC 2606 .invalid TLD) -> DNS_FAILURE, fast.
function test_is_blocked_address_variants 751
function test_validation_expected_status_failure 762
function test_validation_response_time_bounds 776
function test_validation_json_schema_pass 790
function test_validation_json_schema_fail 808
function test_validation_signature_verification_pass 828
function test_validation_signature_verification_fail 852
function test_verify_signature_tool_method 873
function test_response_extract_fields 887
function test_response_text_fallback_for_non_json 904
function test_response_malformed_json_falls_back_to_text 913 content-type says JSON but the body isn't valid JSON -> raw text.
function test_verify_ssl_disabled_logs_warning_and_still_works 929
function test_parse_response_json 943
function test_parse_response_with_validation 954
function test_execute_simple_happy_path 969
function test_execute_simple_invalid_url 985
function test_status_error_message_mapping 1007
function test_status_error_message_retry_exhausted 1014
function test_validate_schema_type_mismatch 1023
function test_validate_schema_required_missing 1028
function test_validate_schema_nested_properties 1033
function test_validate_schema_array_items 1042
function test_type_matches_bool_excludes_number 1049
function test_extract_fields_non_dict_body_returns_empty 1058
function test_sanitize_headers_redacts_authorization 1063
function test_sanitize_url_strips_query 1069
function test_parse_retry_after_valid_and_invalid 1073
function test_compute_delay_backoff_growth 1079
function test_compute_delay_capped_by_max_delay 1088
function test_compute_delay_jitter_stays_in_bounds 1093
function test_hmac_digest_and_verify_roundtrip 1101
function test_verify_hmac_rejects_wrong_secret 1107
function test_hmac_digest_unsupported_algorithm_raises 1112
function test_verify_hmac_bad_algorithm_returns_false 1119
function test_auth_config_from_dict_unknown_type_raises 1123
function test_resolve_secret_missing_raises 1130
function test_resolve_secret_env_missing_var_raises 1137
function test_resolve_secret_literal_used_when_no_env_name 1144
function test_resolve_secret_env_mapping_used 1148
function test_response_validator_min_and_max_response_time 1152
function test_response_validator_signature_secret_env_missing_reports_error 1164 A configured signature_secret_env that isn't set fails gracefully
function test_trigger_response_to_json_roundtrip 1183
function test_register_remote_trigger_tool_metadata 1194
function test_tool_function_schema_shape 1206

tests/tools/test_repl_tool.py

source · 49 tests · 628 lines

Tests for orchestrata_ultimate.tools.repl_tool — REPLTool (SPEC-063).

Covers: tools.base, tools.repl_tool

Kind Name Line Description
function test_metadata_identity 55
function test_metadata_function_schema_shape 63
function test_base_tool_convenience_properties 69
function test_create_session_python_returns_expected_fields 78
function test_create_session_bash_and_shell_alias 87
function test_create_session_javascript 95
function test_create_session_custom_resource_limits 100
function test_create_session_unsupported_language 121
function test_create_session_duplicate_id_rejected 128
function test_create_session_invalid_id_pattern_rejected 139
function test_create_session_concurrent_limit 149
function test_create_session_sandbox_mode_invalid_falls_back_to_standard 158
function test_execute_python_expression_result 171
function test_execute_python_captures_stdout 183
function test_execute_python_state_persists_across_calls 194
function test_execute_python_function_definitions_persist 207
function test_execute_python_error_reports_stderr_and_failure 223
function test_execute_python_syntax_error_reports_failure 232
function test_execute_bash_captures_stdout 244
function test_execute_bash_state_persists_across_calls 253
function test_execute_bash_nonzero_exit_is_failure_with_stderr 264
function test_execute_bash_resource_limits_applied 278
function test_execute_javascript_expression_result 291
function test_execute_javascript_multiline_function_persists 300
function test_execute_javascript_console_log_captured 322
function test_execute_javascript_error_reports_failure 331
function test_execute_python_timeout_kills_and_reports 348
function test_execute_bash_timeout_kills_and_reports 363
function test_execute_after_timeout_respawns_fresh_interpreter 378 State is lost after a timeout-kill (documented tradeoff): the next
function test_execute_output_truncated_when_over_limit 400
function test_execute_max_expressions_limit_enforced 415
function test_strict_mode_blocks_dangerous_python_import 427
function test_standard_mode_allows_import_that_strict_blocks 442
function test_catastrophic_bash_pattern_blocked_in_any_mode 456
function test_get_session_not_found 469
function test_execute_on_missing_session_id_is_invalid 476
function test_get_session_marks_idle_without_terminating 483 get_session (unlike execute) just flags idle-expired sessions as
function test_execute_idle_timeout_terminates_and_errors 493
function test_execute_on_terminated_session_fails 508
function test_execute_invalid_code_input_rejected 519
function test_terminate_session_frees_workdir 530
function test_terminate_nonexistent_session_not_found 540
function test_terminate_session_before_any_execute 549 A session that never executed anything has no subprocess yet; terminate must still work.
function test_get_history_pagination 559
function test_get_history_empty_session 575
function test_get_history_not_found 582
function test_unknown_action_returns_invalid_request 592
function test_missing_action_returns_invalid_request 599
function test_shutdown_terminates_all_active_sessions 609

tests/tools/test_schedule_cron_tool.py

source · 76 tests · 837 lines

Tests for orchestrata_ultimate.tools.schedule_cron_tool (SPEC-068).

Covers: core.redis_factory, tools.base, tools.registry, tools.schedule_cron_tool

Kind Name Line Description
function test_id 51
function test_parse_basic_five_field 69
function test_parse_step 77
function test_parse_list 82
function test_parse_range 87
function test_parse_named_month_list 92
function test_parse_named_weekday_range 97
function test_parse_weekday_sunday_seven_remaps_to_zero 102
function test_parse_wrong_field_count_raises 107
function test_parse_blank_raises 112
function test_parse_out_of_range_raises 117
function test_parse_bad_range_order_raises 122
function test_parse_day_l_or_w_not_supported 127
function test_parse_weekday_hash_not_supported 132
function test_parse_weekday_name_containing_w_not_false_flagged 137
function test_parse_invalid_step_raises 143
function test_parse_invalid_token_raises 148
function test_next_fire_time_utc_daily 153
function test_next_fire_time_weekly_sunday 163
function test_next_fire_time_timezone_conversion 175
function test_schedule_job_success 192
function test_schedule_job_invalid_cron 207
function test_schedule_job_invalid_timezone 215
function test_schedule_job_invalid_name 226
function test_schedule_job_invalid_policy 234
function test_schedule_job_duplicate_name_rejected 245
function test_schedule_job_duplicate_name_allowed_with_force 258
function test_schedule_job_disabled_has_no_next_run 271
function test_unschedule_job_success 287
function test_unschedule_job_not_found 297
function test_list_jobs_returns_created_jobs 303
function test_list_jobs_enabled_only_filter 316
function test_list_jobs_tag_filter 332
function test_list_jobs_limit 347
function test_get_job_status_success 356
function test_get_job_status_not_found_raises 367
function test_update_job_changes_cron 377
function test_update_job_not_found 387
function test_update_job_unknown_field_rejected 393
function test_update_job_invalid_cron_rejected 402
function test_pause_then_resume_job 411
function test_pause_job_not_found 428
function test_get_next_runs_returns_count 438
function test_get_next_runs_not_found_raises 449
function test_validate_cron_expression_valid_case 454
function test_validate_cron_expression_invalid_expression 461
function test_validate_cron_expression_invalid_timezone 467
function test_run_job_now_success 478
function test_run_job_now_failure_records_execution 495
function test_run_job_now_retries_then_succeeds 509
function test_run_job_now_disabled_requires_force 530
function test_run_job_now_not_found_raises 545
function test_run_job_now_forbid_concurrency_blocks_second_call 550
function test_cancel_job_cancels_running_execution 569
function test_cancel_job_no_running_execution 588
function test_cancel_job_not_found 599
function test_get_execution_history_status_filter 605
function test_clear_history_removes_old_entries 624
function test_clear_history_respects_cutoff 638
function test_execute_schedule_job_action 656
function test_execute_unknown_action 672
function test_execute_invalid_params_type_error 678
function test_execute_job_not_found_becomes_failed_result 686
function test_execute_get_next_runs_returns_list 694
function test_metadata_shape 710
function test_register_schedule_cron_tool 716
function test_missed_job_policy_values 732
function test_concurrency_policy_values 742
function test_job_status_values 746
function test_purge_namespace_removes_all_keys 755
function test_parse_field_blank_raises_directly 770
function test_json_default_unsupported_type_raises 775
function test_run_job_now_missing_executable_fails 780
function test_run_job_now_timeout 797
function test_unschedule_job_after_run_clears_execution_records 810
function test_get_execution_history_across_all_jobs_without_job_id 826

tests/tools/test_search.py

source · 81 tests · 1169 lines

Tests for orchestrata_ultimate.tools.search — ToolSearchTool (SPEC-072).

Covers: agents.tool_registry, core.lru_cache, core.tracing.tracer, memory.embedding, tools.base, tools.registry, tools.search

Kind Name Line Description
class TestFR001NaturalLanguageQuery 170
method TestFR001NaturalLanguageQuery.test_execute_returns_success_with_relevant_tool 171
method TestFR001NaturalLanguageQuery.test_execute_unknown_query_returns_empty_results 188
class TestFR002FuzzyMatching 216
method TestFR002FuzzyMatching.test_fuzzy_rescues_typo_of_tool_name 217
method TestFR002FuzzyMatching.test_fuzzy_threshold_1_0_admits_exact_only 226
method TestFR002FuzzyMatching.test_fuzzy_lower_threshold_admits_the_typo 234
class TestFR003Filters 246
method TestFR003Filters.test_category_filter_restricts_results 247
method TestFR003Filters.test_combined_category_and_tag_filters_and_together 256
method TestFR003Filters.test_apply_filters_relevance_order_preserved 269
class TestFR004Pagination 291
method TestFR004Pagination.test_limit_offset_returns_correct_slice 292
method TestFR004Pagination.test_has_more_flag 305
class TestFR005RelevanceScoring 316
method TestFR005RelevanceScoring.test_scores_within_unit_range_and_sorted_descending 317
method TestFR005RelevanceScoring.test_ranker_applies_the_five_signal_weights 327
method TestFR005RelevanceScoring.test_rank_by_option_overrides_default_relevance_sort 348
class TestFR006Suggestions 362
method TestFR006Suggestions.test_no_suggestions_before_three_queries 363
method TestFR006Suggestions.test_suggestions_appear_after_three_queries 369
class TestFR007Facets 383
method TestFR007Facets.test_category_facets_sum_to_matched_count 384
method TestFR007Facets.test_facets_method_builds_category_and_tag_counts 392
class TestFR008SemanticSimilarity 421
method TestFR008SemanticSimilarity.test_semantic_strategy_scores_synonymous_description_higher 422
method TestFR008SemanticSimilarity.test_semantic_available_true_when_embeddings_composed 443
class TestFR009KeywordFallback 451
method TestFR009KeywordFallback.test_search_still_works_without_semantic_strategy 452
class TestFR010CompoundQueries 480
method TestFR010CompoundQueries.test_parser_yields_or_of_and_groups 481
method TestFR010CompoundQueries.test_search_honours_and_or_semantics 485
class TestFR011to013IndexManagement 498
method TestFR011to013IndexManagement.test_rebuild_indexes_every_registered_tool 499
method TestFR011to013IndexManagement.test_sync_adds_and_updates_only_changed_entries 515
method TestFR011to013IndexManagement.test_remove_deletes_entry_and_reports_absence 544
method TestFR011to013IndexManagement.test_create_rebuilds_on_startup_without_explicit_call 553
class TestFR014And015Persistence 564
method TestFR014And015Persistence.test_save_then_load_round_trips_entries 565
method TestFR014And015Persistence.test_load_of_corrupted_file_returns_false_and_stays_rebuildable 581
method TestFR014And015Persistence.test_incremental_sync_touches_only_one_changed_tool 590
class TestFR016to020Caching 605
method TestFR016to020Caching.test_second_identical_search_is_served_from_cache 606
method TestFR016to020Caching.test_cache_invalidate_by_tool_id_evicts_only_matching_keys 619
method TestFR016to020Caching.test_cache_warming_on_create_makes_first_search_a_hit 637
method TestFR016to020Caching.test_cache_stats_reports_size_hits_misses 647
method TestFR016to020Caching.test_cache_invalidated_after_index_update 661
class TestFR021to023Performance 674
method TestFR021to023Performance.test_search_completes_quickly_over_a_sized_index 676 Mechanism test: search over a few hundred synthetic tools stays
method TestFR021to023Performance.test_index_supports_10k_tools 709
method TestFR021to023Performance.test_concurrent_searches_are_thread_safe 735
class TestFR024Wildcards 763
method TestFR024Wildcards.test_wildcard_prefix_matches 764
method TestFR024Wildcards.test_bare_wildcard_is_rejected 770
class TestErrorConditions 779
method TestErrorConditions.test_err101_blank_query_rejected 780
method TestErrorConditions.test_err101_query_too_long_rejected 785
method TestErrorConditions.test_err102_invalid_return_type_filter 790
method TestErrorConditions.test_err103_invalid_pagination_limit 799
method TestErrorConditions.test_err103_invalid_pagination_offset 804
method TestErrorConditions.test_err104_index_not_ready_raises 809
method TestErrorConditions.test_err105_corrupted_index_load_reports_false 827
method TestErrorConditions.test_err106_remove_of_unknown_tool_returns_false 833
method TestErrorConditions.test_err107_cache_get_survives_a_broken_underlying_cache 837
method TestErrorConditions.test_err108_semantic_unavailable_score_is_zero_not_an_error 845
method TestErrorConditions.test_err109_and_err110_are_documented_governance_seam 851 RATE_LIMIT_EXCEEDED / PERMISSION_DENIED are enforced at the
method TestErrorConditions.test_err111_invalid_rank_by 860
method TestErrorConditions.test_err112_timeout_raises_when_nothing_scored_in_time 867
class TestInputValidation 879
method TestInputValidation.test_sanitize_strips_disallowed_characters 880
method TestInputValidation.test_sanitize_preserves_and_or_and_wildcards 886
method TestInputValidation.test_validate_rejects_query_over_500_chars 892
method TestInputValidation.test_validate_rejects_min_success_rate_out_of_range 898
method TestInputValidation.test_validate_accepts_a_well_formed_query 905
class TestSearchQueryFromArguments 914
method TestSearchQueryFromArguments.test_from_arguments_applies_defaults 915
method TestSearchQueryFromArguments.test_from_arguments_parses_filters_and_options 922
method TestSearchQueryFromArguments.test_from_arguments_missing_query_raises 936
class TestDataModels 945
method TestDataModels.test_from_metadata_derives_neutral_defaults 946
method TestDataModels.test_search_response_to_json_matches_spec_shape 964
class TestRegistrationWiring 990
method TestRegistrationWiring.test_register_search_tool_populates_registry 991
method TestRegistrationWiring.test_registered_tool_is_dispatchable_via_registry_execute 996
method TestRegistrationWiring.test_create_with_explicit_trace_config_binds_a_dedicated_tracer 1005
method TestRegistrationWiring.test_metadata_is_a_read_only_property_not_a_plain_attribute 1013
class TestRemainingBranches 1028
method TestRemainingBranches.test_from_arguments_malformed_options_raises_invalid_filter 1029
method TestRemainingBranches.test_parser_collapses_a_doubled_or_into_a_literal_term 1036
method TestRemainingBranches.test_validator_rejects_blank_query_directly 1043
method TestRemainingBranches.test_validator_rejects_fuzzy_threshold_out_of_range 1048
method TestRemainingBranches.test_bare_wildcard_term_inside_an_and_group_never_matches 1054
method TestRemainingBranches.test_fuzzy_strategy_skips_empty_group_and_bare_wildcard_term 1063
method TestRemainingBranches.test_rank_by_recency_and_success_rate 1071
method TestRemainingBranches.test_recency_score_handles_malformed_and_naive_timestamps 1085
method TestRemainingBranches.test_index_stats_reports_count_and_readiness 1091
method TestRemainingBranches.test_cache_put_survives_a_broken_underlying_cache 1099
method TestRemainingBranches.test_cache_clear_empties_cache_and_tool_index 1111
method TestRemainingBranches.test_cache_warm_skips_blank_queries_and_errored_queries 1122
method TestRemainingBranches.test_suggest_caps_at_five_suggestions 1133
method TestRemainingBranches.test_apply_filters_return_type_author_and_min_success_rate 1141
method TestRemainingBranches.test_execute_converts_unforeseen_exception_into_a_failed_result 1164

tests/tools/test_task_tools.py

source · 74 tests · 845 lines

Tests for orchestrata_ultimate.tools.task_tools (SPEC-069).

Covers: tools.base, tools.registry, tools.task_tools

Kind Name Line Description
function test_create_generates_valid_task_id 88
function test_create_rejects_blank_name 96
function test_create_sanitizes_name 102
function test_create_rejects_name_over_max_length 107
function test_create_id_collision_retries_then_succeeds 113 A deterministic id_factory that returns a used id once, then a fresh one.
function test_create_id_collision_exhausted_raises 127
function test_list_filters_by_name_and_status 135
function test_update_unknown_task_raises 148
function test_update_bumps_version_and_progress 154
function test_append_output_unknown_task_raises 176
function test_name_matches_exact_prefix_suffix_regex 185
function test_name_matches_invalid_regex_returns_false 196
function test_stop_graceful_real_process 203
function test_stop_forced_real_process 213
function test_stop_graceful_escalates_to_sigkill 222
function test_stop_logical_task_without_process 235
function test_stop_termination_failed_when_process_wont_die 244 retry_attempts=0 means: signal, then immediately check poll() with no wait.
function test_stop_cancel_mode_on_running_process_sigkills 257
function test_stop_cancel_mode_on_already_exited_process 266
function test_stop_cancel_mode_pending_no_process 276
function test_stop_cancel_on_terminal_task_raises 285
function test_stop_not_found 294
function test_stop_already_stopped_raises_not_running 300
function test_stop_permission_denied_for_non_owner 308
function test_stop_admin_overrides_ownership 316
function test_stop_critical_task_requires_admin 324
function test_stop_protected_task_requires_admin 335
function test_concurrent_stop_is_idempotent_exactly_one_wins 342
function test_stop_by_pattern_batch_with_failures_and_protection 370
function test_stop_by_pattern_admin_includes_protected 385
function test_output_full_mode 406
function test_output_tail_mode 416
function test_output_lines_mode_valid_range 424
function test_output_lines_mode_missing_lines_raises 433
function test_output_lines_mode_invalid_range_raises 440
function test_output_stream_mode_tracks_position 447
function test_output_combined_only_hides_stdout_stderr 461
function test_output_too_large_raises 469
function test_output_not_available_when_no_lines 476
function test_output_not_found_task 483
function test_output_tail_zero_raises_invalid_input 489
function test_status_of_with_real_process_reports_metrics 499
function test_status_of_stopped_task_has_no_pid 516
function test_status_of_unknown_task_raises 525
function test_check_rate_limit_exceeded 534
function test_check_rate_limit_per_agent_independent 543
function test_check_rate_limit_evicts_expired_bucket_entries 549 A real, already-expired entry (>60s old) must be evicted, not counted.
function test_purge_expired_output_removes_old_lines 558
function test_purge_expired_output_keeps_recent_lines 568
function test_audit_log_records_stop_attempts 577
function test_task_stop_tool_metadata 596
function test_task_stop_tool_execute_by_id 604
function test_task_stop_tool_execute_forced 617
function test_task_stop_tool_execute_by_name 631
function test_task_stop_tool_missing_agent_id_fails 645
function test_task_stop_tool_missing_target_fails 651
function test_task_stop_tool_bad_task_id_pattern_fails 657
function test_task_stop_tool_not_found_fails 667
function test_task_stop_tool_invalid_mode_value_fails 675
function test_task_stop_tool_explicit_cancel_mode 689
function test_task_output_tool_metadata 711
function test_task_output_tool_execute_full 716
function test_task_output_tool_execute_tail 727
function test_task_output_tool_execute_lines 736
function test_task_output_tool_execute_stream 747
function test_task_output_tool_execute_status 758
function test_task_output_tool_missing_task_id_fails 771
function test_task_output_tool_bad_task_id_fails 779
function test_task_output_tool_invalid_mode_value_fails 784
function test_task_output_tool_output_not_available_fails 793
function test_task_output_tool_unexpected_exception_becomes_failed_result 802 A malformed (non-indexable-by-int) 'lines' payload raises KeyError, not
function test_task_output_tool_rate_limited 814
function test_register_task_tools_wires_both_into_registry 828
function test_register_task_tools_shares_manager_across_both_tools 838

tests/tools/test_worktree_tools.py

source · 42 tests · 831 lines

Tests for orchestrata_ultimate.tools.worktree_tools — EnterWorktreeTool and

Covers: tools.base, tools.worktree_tools

Kind Name Line Description
function test_enter_tool_metadata 66
function test_exit_tool_metadata 76
function test_enter_missing_session_id_is_missing_parameter 86
function test_enter_not_a_git_repo 93
function test_enter_list_only_single_worktree 107
function test_list_worktrees_helper_parses_multiple_entries 120
function test_enter_existing_worktree_success 139
function test_enter_existing_worktree_relative_path 157
function test_enter_nonexistent_worktree_not_found 176
function test_enter_unregistered_directory 191
function test_enter_locked_worktree_is_blocked_then_forceable 204
function test_create_and_enter_new_worktree 231
function test_create_without_branch_is_branch_required 256
function test_create_on_protected_branch_is_blocked 271
function test_create_on_custom_protected_pattern_is_blocked 289
function test_default_protected_branches_constant 307
function test_create_with_path_outside_repo_is_rejected 311
function test_create_with_invalid_branch_name 329
function test_create_branch_not_found_without_create_branch_flag 346
function test_create_duplicate_worktree_for_branch_is_blocked 363
function test_create_worktree_already_exists 394
function test_enter_works_from_nested_directory 413 FR-034: git commands anchored at a nested subdirectory still resolve.
function test_enter_uses_session_state_as_anchor_when_no_cwd_given 451
function test_exit_returns_to_main 487
function test_exit_idempotent_from_main 513
function test_exit_with_uncommitted_changes_is_blocked 523
function test_exit_with_stash_changes_succeeds_and_stashes 549
function test_exit_with_force_succeeds_and_leaves_changes 576
function test_exit_with_remove_deletes_worktree 600
function test_exit_with_prune_cleans_abandoned_worktree 625 Cleanup of abandoned worktrees: directory deleted out-of-band, then pruned.
function test_exit_missing_session_id 647
function test_exit_main_worktree_unavailable 654 If both the anchor and the recorded main path vanish, report MAIN_WORKTREE_UNAVAILABLE.
function test_worktree_tool_error_to_result_includes_details_and_suggestions 686
function test_worktree_tool_error_without_details_or_suggestions 704
function test_list_worktrees_detached_head_entry 716
function test_enter_invalid_path_whitespace 727
function test_create_checkout_existing_branch_without_create_branch_flag 737 create=True with create_branch=False checks out an already-existing branch.
function test_create_forced_git_command_failure 761 force=True bypasses our own WORKTREE_ALREADY_EXISTS check, but git itself
function test_exit_force_and_remove_together_on_dirty_worktree 786
function test_exit_not_a_git_repo_without_prior_session_state 813 _list_with_fallback: no session state exists, so the original error propagates.
function test_uncommitted_changes_for_nonexistent_path_is_empty 825
function test_uncommitted_changes_for_clean_repo_is_empty 829

Support files

Fixtures, package markers and helpers without test functions.