Orchestrata Ultimate › Tests › Reference › core

Tests reference — tests/core

tests/core — 95 test modules, 1594 test functions (cumulative over subdirectories). Source tree: tests/core at commit 8a2cb42ad. Generated from the tests AST snapshot by scripts/gen-data-pages.py.

Prose pending.

Subdirectories

Directory Modules Tests
base/ 3 46
config/ 1 5
domain/ 3 25
graph/ 8 81
monitoring/ 1 8
patterns/ 2 38
protocols/ 3 15
state/ 1 17
threading/ 19 314
tracing/ 4 67

Modules

Module Tests Covers
test_adapters.py 56 3
test_atomic_json.py 12 1
test_banned_libraries.py 13 1
test_base.py 40 2
test_base_error.py 8 1
test_base_repository.py 5 2
test_base_service.py 6 2
test_capability_mesh.py 14 3
test_claude_hooks_config.py 3 1
test_config.py 2 1
test_config_infra.py 1 1
test_config_manager.py 52 1
test_config_manager_extended.py 29 1
test_domain.py 26 3
test_enums.py 3 1
test_env_bootstrap.py 20 1
test_fact_scope.py 1 1
test_gate_policy.py 31 1
test_gate_waivers.py 16 1
test_graph_directives.py 5 1
test_graph_factory.py 17 1
test_infra_config.py 39 1
test_infra_env_rule.py 14 3
test_interfaces.py 61 3
test_interfaces_volk.py 3 1
test_isolation.py 7 1
test_janus_bootstrap.py 28 2
test_logging.py 23 1
test_lru_cache.py 13 1
test_monitoring.py 50 3
test_paths.py 8 1
test_patterns.py 26 1
test_prolog_adapter.py 13 1
test_protocols.py 61 4
test_protocols_agent.py 2 1
test_pyproject_contract.py 10 0
test_redis_factory.py 10 1
test_runtime_callgraph_coverage.py 18 1
test_spans.py 7 1
test_standards.py 14 1
test_state_manager.py 12 2
test_test_memgraph_routing.py 7 0
test_thread_pool.py 1 0
test_traceability.py 51 3
test_traceability_init_extended.py 44 1
test_tracing.py 80 4
test_uv_lock_contract.py 2 0
test_worker_database_mapping.py 7 1
test_worker_kg_grpc_port_mapping.py 7 0

Module details

tests/core/test_adapters.py

source · 56 tests · 849 lines

Covers: core.adapters.claude.hooks, core.adapters/ (package), core.adapters.claude/ (package)

Kind Name Line Description
function test_get_hook_manager_returns_hook_manager_instance 73 get_hook_manager() returns a real HookManager instance.
function test_get_hook_manager_forwards_arguments 80 Positional/keyword args reach the underlying HookManager.
function test_get_tool_interceptor_returns_tool_interceptor 87 get_tool_interceptor() returns a fresh ToolInterceptor.
function test_hook_manager_alias_is_hook_orchestrator 96 HookManager is exported as an alias of HookOrchestrator.
function test_hook_category_values 106 Enum values match the documented string identifiers.
function test_execution_priority_ordering 115 Priorities sort ascending from URGENT → LOW.
function test_interceptor_decision_values 125 Decision enum exposes the four documented outcomes.
function test_hook_descriptor_defaults 135 Unspecified fields receive the documented defaults.
function test_execution_outcome_defaults 152 Outcome dataclass supplies sane defaults.
function test_interceptor_result_defaults 161 Optional fields on InterceptorResult default correctly.
function test_interception_stats_defaults 176 Stats start at zero on construction.
function test_tool_interceptor_starts_empty 191 A fresh interceptor has no deny/permit entries and zero stats.
function test_tool_interceptor_deny_and_permit_mutually_exclusive 199 Denying a tool removes it from permit and vice versa.
function test_tool_interceptor_clear_lists_removes_tool 214 clear_lists removes the tool from both registries.
function test_tool_interceptor_attach_engine_and_session_manager 225 Attachment methods store the provided references.
function test_tool_interceptor_intercept_allow_by_default 243 With no policy configured, intercept returns ALLOW.
function test_tool_interceptor_intercept_deny_returns_block 255 A denied tool is blocked with an explanatory reason.
function test_tool_interceptor_intercept_permit_returns_allow 266 A permitted tool is allowed, short-circuiting default policy.
function test_tool_interceptor_transformer_modifies_params 277 A registered transformer produces a MODIFY outcome.
function test_tool_interceptor_transformer_exception_falls_through 292 A crashing transformer logs and then falls through to ALLOW.
function test_tool_interceptor_remove_transformer 304 remove_transformer cleanly removes the registration.
function test_tool_interceptor_stats_average_time_updates 315 Average time grows monotonically with successive intercepts.
function test_tool_interceptor_reset_statistics 327 reset_statistics zeroes all counters and timing.
function test_tool_interceptor_get_statistics_returns_snapshot 340 get_statistics yields a copy, not the internal object.
function test_tool_interceptor_session_manager_records_tool_call 355 When a session manager is attached, its record_tool_call fires.
function test_hook_orchestrator_starts_empty 377 A new orchestrator has no hooks in any category.
function test_hook_orchestrator_register_and_list 385 Registering a hook places it into the category list.
function test_hook_orchestrator_register_sorts_by_priority 402 Priority ordering is enforced on registration.
function test_hook_orchestrator_unregister_existing 417 Unregistering a known hook succeeds and clears it from the list.
function test_hook_orchestrator_unregister_missing_returns_false 425 Unregistering an unknown hook is a no-op that returns False.
function test_hook_orchestrator_activate_and_deactivate 431 Hooks can be toggled on and off by identifier.
function test_hook_orchestrator_activate_missing_returns_false 443 Toggling an unknown hook returns False.
function test_hook_orchestrator_constructor_accepts_interceptor 450 An externally supplied interceptor is attached to the orchestrator.
function test_hook_orchestrator_constructor_default_interceptor 457 With no interceptor given, a default one is created.
function test_hook_orchestrator_pre_tool_default_allow 468 With no hooks, the interceptor's default ALLOW is returned.
function test_hook_orchestrator_pre_tool_blocked_by_interceptor 475 A tool on the deny list is blocked before any hook runs.
function test_hook_orchestrator_pre_tool_hook_blocks_with_reason 493 A hook returning BLOCK propagates through run_pre_tool_hooks.
function test_hook_orchestrator_pre_tool_inactive_hook_skipped 513 Inactive hooks are not executed.
function test_hook_orchestrator_pre_tool_filter_excludes_non_matching 530 A tool_filter regex skips non-matching tools.
function test_hook_orchestrator_pre_tool_async_handler 550 Coroutine hook handlers are awaited correctly.
function test_hook_orchestrator_post_tool_runs_active_hooks 570 Post-tool hooks run for every matching active hook.
function test_hook_orchestrator_post_tool_skips_inactive_and_filtered 584 Post-tool hooks respect both active and tool_filter.
function test_hook_orchestrator_session_begin_and_finish 610 Session hooks are dispatched for their respective categories.
function test_hook_orchestrator_session_hooks_skip_inactive 633 Inactive session hooks are not invoked.
function test_hook_orchestrator_execution_history_records_outcome 657 Pre-tool hook results land in the execution history.
function test_hook_orchestrator_clear_history 671 clear_history empties the stored outcomes.
function test_hook_orchestrator_execution_history_returns_copy 682 get_execution_history yields a defensive copy.
function test_hook_orchestrator_execution_history_truncates_when_large 693 After 1000 outcomes the history is trimmed down to the last 500.
function test_hook_orchestrator_loads_configuration_file 722 Config file entries are parsed into HookDescriptors.
function test_hook_orchestrator_ignores_missing_config_file 761 A non-existent config file path is silently tolerated.
function test_hook_orchestrator_malformed_config_does_not_raise 769 Malformed JSON is logged but does not crash the orchestrator.
function test_hook_orchestrator_matches_filter_regex 782 _matches_filter applies anchored regex semantics.
function test_hook_orchestrator_execute_hook_reports_exceptions 790 A raising handler produces a non-successful outcome with the note.
function test_hook_orchestrator_execute_hook_plain_return_becomes_outcome 808 A plain (non-ExecutionOutcome) return is wrapped into an outcome.
function test_internal_now_helper_returns_utc 839 The helper used by the history-truncation test is UTC-aware.
function test_pytest_is_available 847 pytest is importable inside the test module.

tests/core/test_atomic_json.py

source · 12 tests · 292 lines

Tests for core.atomic_json — the write that cannot leave a spliced file.

Covers: core.atomic_json

Kind Name Line Description
function test_round_trips_a_document 29
function test_shorter_document_leaves_no_residue_of_a_longer_one 38 The exact corruption signature: small doc written over a large one.
function test_trailing_newline_is_opt_in 62
function test_creates_parent_directories 72
function test_unserialisable_payload_leaves_destination_untouched 80
function test_preserves_existing_file_mode 93 mkstemp creates 0600; a rewrite must not tighten a shared artifact.
function test_new_file_is_group_and_world_readable 104
function test_concurrent_writers_never_expose_a_partial_document 112 Two writers of very different sizes, hammering one path, plus a reader.
function test_a_truncating_write_sigbuses_a_live_mmap_reader 225 The mechanism behind two git update-index cores on 2026-08-19.
function test_dump_text_atomic_leaves_a_live_mmap_reader_intact 252 The fix: replace the target instead of truncating it.
function test_dump_text_atomic_round_trips_and_preserves_mode 270
function test_dump_text_atomic_appends_only_a_missing_trailing_newline 282

tests/core/test_banned_libraries.py

source · 13 tests · 164 lines

Tests for core.banned_libraries — the ONE reader of the ban registry.

Covers: core.banned_libraries

Kind Name Line Description
class TestReadingTheRegistry 42
method TestReadingTheRegistry.test_an_entry_carries_the_comment_block_above_it 43 A violation must be able to say WHY a package is banned, not only
method TestReadingTheRegistry.test_a_new_comment_block_resets_the_rationale 56 Without the reset, every reason accumulated the file header plus
method TestReadingTheRegistry.test_the_entries_divider_drops_the_file_header 75
method TestReadingTheRegistry.test_a_version_pin_is_stripped_to_the_name 84
method TestReadingTheRegistry.test_a_missing_registry_yields_no_entries 94 A checker that explodes on a missing config file is worse than one
class TestMatching 100
method TestMatching.test_both_granularities_are_offered 109
method TestMatching.test_a_dotless_entry_catches_every_submodule 114
method TestMatching.test_a_dotted_entry_catches_only_that_module 117 unittest.mock is banned; unittest is not. Folding to the top
method TestMatching.test_a_prefix_is_not_a_match 125 The bug prefix matching would reintroduce: docker claiming
method TestMatching.test_the_separator_is_normalised 130
class TestTheLiveRegistry 135 Against the real .claude/banned-libraries.txt, not a fixture.
method TestTheLiveRegistry.test_every_entry_carries_a_rationale 138 An entry with no reason is a ban nobody can act on or argue with.
method TestTheLiveRegistry.test_the_packages_this_project_actually_bans_are_present 145 Named explicitly: each was added because a specific class of failure
method TestTheLiveRegistry.test_unittest_itself_is_not_banned 161 The distinction the dotted form exists for. Banning unittest would

tests/core/test_base.py

source · 40 tests · 513 lines

Covers: core.base/ (package), core.interfaces/ (package)

Kind Name Line Description
function test_base_entity_auto_generates_id_and_timestamps 83
function test_base_entity_unique_ids_per_instance 92
function test_base_entity_touch_updates_updated_at 98
function test_base_entity_equality_by_id 107
function test_base_entity_inequality_by_id 114
function test_base_entity_not_equal_to_non_entity 120
function test_base_entity_hash_consistent_with_equality 127
function test_base_entity_hash_usable_in_set 134
function test_base_entity_repr_includes_class_name_and_id 144
function test_base_entity_to_dict_serializes_timestamps 151
function test_base_entity_to_dict_serializes_nested_entity 165
function test_base_entity_to_dict_preserves_plain_scalars 174
function test_base_entity_to_dict_serializes_entity_list 181
function test_base_entity_from_dict_roundtrip 192
function test_base_entity_from_dict_nested_entity_roundtrip 204
function test_base_entity_from_dict_list_of_entities 214
function test_base_entity_from_dict_ignores_unknown_fields 225
function test_base_error_basic_construction 242
function test_base_error_is_exception 251
function test_base_error_with_code_and_context 259
function test_base_error_context_defaults_to_empty_dict 269
function test_base_error_str_prefix_with_code 277
function test_base_error_str_no_code 282
function test_base_error_to_dict_basic 287
function test_base_error_to_dict_with_cause_chain 298
function test_base_error_to_dict_non_base_cause_is_stringified 313
function test_base_error_to_dict_respects_max_depth 325
function test_base_error_can_be_subclassed 337
function test_base_repository_is_runtime_protocol_compatible 375
function test_base_repository_save_get_delete_list_cycle 383
function test_base_repository_list_pagination 412
function test_base_service_default_config_is_empty_dict 437
function test_base_service_accepts_config 442
function test_base_service_has_logger_named_after_class 448
function test_base_service_has_threading_lock 454
function test_base_service_is_icomponent 461
function test_base_service_get_metadata_auto_populated 466
function test_base_service_lifecycle_default_implementations 476
function test_base_service_initialize_overrides_config 493
function test_base_service_subclass_can_override_health 503

tests/core/test_base_error.py

source · 8 tests · 55 lines

Tests for core/base/error.py — real implementation.

Covers: core.base.error

Kind Name Line Description
class TestBaseError 6
method TestBaseError.test_init_defaults 7
method TestBaseError.test_init_full 14
method TestBaseError.test_str_no_code 19
method TestBaseError.test_str_with_code 23
method TestBaseError.test_to_dict 27
method TestBaseError.test_to_dict_with_cause 36
method TestBaseError.test_to_dict_with_non_base_cause 44
method TestBaseError.test_to_dict_max_depth 50

tests/core/test_base_repository.py

source · 5 tests · 41 lines

Tests for core.base.repository.

Covers: core.base.entity, core.base.repository

Kind Name Line Description
class TestBaseRepository 20
method TestBaseRepository.test_init_creates_lock 21
method TestBaseRepository.test_get_stub_body_executes 25
method TestBaseRepository.test_save_stub_body_executes 30
method TestBaseRepository.test_delete_stub_body_executes 35
method TestBaseRepository.test_list_stub_body_executes 39

tests/core/test_base_service.py

source · 6 tests · 46 lines

Tests for core/base/service.py — real implementation.

Covers: core.base.service, core.interfaces/ (package)

Kind Name Line Description
class TestBaseService 13
method TestBaseService.test_init_defaults 14
method TestBaseService.test_init_with_config 20
method TestBaseService.test_initialize 25
method TestBaseService.test_start_stop 31
method TestBaseService.test_get_health 37
method TestBaseService.test_get_metadata 41

tests/core/test_capability_mesh.py

source · 14 tests · 178 lines

Tests for core.capability_mesh — the one capability resolver, and the

Covers: core.capability_mesh, kernel.pipeline_escalation, orchestrator.pipeline_escalation

Kind Name Line Description
class TestResolveCapability 50 Resolution order, and what None means.
method TestResolveCapability.test_a_registered_builtin_provider_wins 53
method TestResolveCapability.test_an_empty_capability_resolves_to_nothing 58
method TestResolveCapability.test_an_unknown_capability_resolves_to_nothing 61
method TestResolveCapability.test_no_provider_registered_resolves_to_nothing 64 The built-in table names U:Qa, but nothing is registered.
method TestResolveCapability.test_a_declared_capability_extends_the_mesh 68 A plugin volk provides a capability the built-in table lacks.
method TestResolveCapability.test_a_declared_capability_does_not_hijack_a_core_hop 73 A registered built-in provider beats a declaring plugin.
method TestResolveCapability.test_an_unregistered_builtin_falls_through_to_the_scan 82 The table naming U:Qa is not enough — U:Qa must be dispatchable.
method TestResolveCapability.test_a_volk_without_capabilities_is_skipped 92 getattr(volk, "capabilities", None) must tolerate its absence.
method TestResolveCapability.test_every_builtin_capability_resolves_when_registered 98
class TestBothMeshesShareOneTable 103 The duplication this module exists to remove must stay removed.
method TestBothMeshesShareOneTable.test_kernel_reexports_the_shared_table 106
method TestBothMeshesShareOneTable.test_orchestrator_reexports_the_shared_table 111
method TestBothMeshesShareOneTable.test_neither_mesh_carries_its_own_provider_literal 118 A re-declared table is the drift this consolidation prevents.
class TestThePacketStageBoundaryHolds 138 Each mesh keeps its own granularity; neither grows the other's idiom.
method TestThePacketStageBoundaryHolds.test_the_kernel_mesh_routes_packets_not_stages 147 Checked on the SYMBOL TABLE, not on module source text.
method TestThePacketStageBoundaryHolds.test_the_orchestrator_mesh_inserts_stages_not_packet_rewrites 167

tests/core/test_claude_hooks_config.py

source · 3 tests · 66 lines

Covers: core.adapters.claude.hooks

Kind Name Line Description
function test_config_hook_resolves_to_real_callable 30
function test_config_hook_without_handler_is_skipped 45
function test_config_hook_with_unresolvable_handler_is_skipped 54

tests/core/test_config.py

source · 2 tests · 39 lines

Tests for core.config re-export module.

Covers: core.config/ (package)

Kind Name Line Description
class TestCoreConfigReexport 31
method TestCoreConfigReexport.test_symbols_importable 32
method TestCoreConfigReexport.test_config_validation_error_is_class 38

tests/core/test_config_infra.py

source · 1 tests · 20 lines

Tests for core/config/infra.py — real implementation.

Covers: core.config.infra

Kind Name Line Description
function test_imports 6

tests/core/test_config_manager.py

source · 52 tests · 647 lines

Tests for orchestrata_ultimate.core.config.manager.

Covers: core.config.manager

Kind Name Line Description
function test_config_source_type_values 36 ConfigSourceType exposes the five expected members.
function test_config_source_defaults 45 ConfigSource defaults: format='auto', watch=False, priority=0.
function test_config_source_custom_values 53 ConfigSource accepts explicit format, watch, and priority.
function test_config_validation_error_defaults_to_error_severity 69 ConfigValidationError.severity defaults to 'error'.
function test_config_validation_error_custom_severity 77 ConfigValidationError accepts warning/info severities.
function test_manager_default_name 88 Default manager name is 'default'.
function test_manager_custom_name 95 Custom name is stored and used for logger naming.
function test_manager_registers_default_validators 103 On construction the manager has port/timeout/host validators.
function test_add_source_sorts_by_priority_desc 116 Sources are sorted so the highest priority is first.
function test_add_file_detects_json_format 128 add_file with a .json path sets format='json'.
function test_add_file_detects_yaml_format 135 add_file with .yaml or .yml sets format='yaml'.
function test_add_file_detects_env_format 144 add_file with .env sets format='env'.
function test_add_file_unknown_extension_stays_auto 151 add_file with unknown suffix keeps format='auto'.
function test_add_env_prefix_creates_env_source 158 add_env_prefix creates an ENV source with default priority 10.
function test_load_json_file 172 A real JSON config file is loaded and merged into the manager.
function test_load_yaml_file 183 A real YAML config file is parsed into a nested dict.
function test_load_env_file_with_nested_keys 194 .env files use double-underscore to build nested dicts.
function test_load_missing_file_is_tolerated 212 A nonexistent file yields an empty config, not an error.
function test_load_memory_source 220 A MEMORY source with a JSON string is loaded directly.
function test_load_priority_preserves_unique_keys_from_every_source 233 Every source's unique keys survive the load/merge pass.
function test_load_deep_merges_nested_dicts 256 Nested dicts are merged recursively across sources.
function test_load_clears_previous_config 273 Calling load() a second time reloads from scratch.
function test_env_file_value_conversion 293 Strings in .env files are coerced to bool/int/float/list.
function test_convert_value_bool_variants 308 _convert_value recognizes common truthy/falsy spellings.
function test_get_returns_default_when_missing 322 get() returns the supplied default when the key is absent.
function test_set_creates_nested_structure 329 set() creates intermediate dicts as needed.
function test_set_overwrites_existing_value 337 set() overwrites a prior scalar at the same path.
function test_set_schedules_listener_notification_without_running_loop 346 set() creates a task for listener notification under a running loop.
function test_to_dict_returns_copy 367 to_dict() returns a copy — mutations do not leak back.
function test_str_representation_is_json 376 str(manager) yields valid JSON of the current config.
function test_register_validator_stores_validator 389 register_validator adds to the validator map.
function test_validate_port_invalid_returns_error_string 400 The default port validator flags out-of-range integers.
function test_validate_port_non_integer_returns_error 413 The default port validator flags non-integer values.
function test_validate_host_empty_string_fails 421 The default host validator rejects empty strings.
function test_validate_passes_with_good_values 429 Valid port/timeout/host values produce no errors.
function test_validator_returning_list_of_errors 438 A validator may return a list of error strings.
function test_validator_returning_validation_error_objects 453 A validator may return ConfigValidationError objects directly.
function test_path_matches_pattern_exact 471 Exact pattern matches only the exact path.
function test_path_matches_pattern_single_segment_wildcard 478 A single '*' matches exactly one path segment.
function test_find_matching_paths_wildcard_enumerates_leaves 487 Wildcard patterns find every matching leaf path.
function test_find_matching_paths_exact_missing_returns_empty 497 An exact pattern for a missing key returns [].
function test_enumerate_paths_produces_dotted_leaves 503 _enumerate_paths yields one entry per leaf value.
function test_listeners_notified_after_load 515 load() notifies both sync and async listeners after loading.
function test_listener_exception_is_swallowed 537 A raising listener does not break load().
function test_shutdown_clears_listeners_and_watchers 563 shutdown() clears listeners and watchers collections.
function test_load_source_rejects_unsupported_type 578 _load_source raises ValueError for CONSUL/ETCD (unimplemented).
function test_parse_file_unsupported_format_raises 586 _parse_file raises for formats it does not know.
function test_detect_file_format_falls_back_to_content 595 With no hint/extension, format is detected from content.
function test_detect_file_format_respects_hint 606 An explicit format hint wins over extension and content.
function test_create_configuration_with_custom_file 619 Files passed in config_files are added when they exist.
function test_create_configuration_env_prefix_source 631 create_configuration always adds an env-prefix source.
function test_create_configuration_skips_missing_files 640 Nonexistent default paths are silently skipped.

tests/core/test_config_manager_extended.py

source · 29 tests · 419 lines

Tests for orchestrata_ultimate.core.config.manager — extended coverage.

Covers: core.config.manager

Kind Name Line Description
function test_load_logs_source_failure_and_continues 53 A malformed JSON file is logged as an error but does not abort load().
function test_load_source_unsupported_type_raises_in_load_source 67 _load_source itself raises ValueError for unsupported types.
function test_load_logs_validation_warning 80 Validators returning severity='warning' are logged via the warning branch.
function test_load_logs_validation_error 97 Validators returning severity='error' are logged via the error branch.
function test_load_ignores_validation_info_severity 107 Validators returning severity='info' fall through the error/warning branches
function test_detect_file_format_json_extension_with_auto_hint 128 _detect_file_format resolves .json to 'json' when hint is auto.
function test_detect_file_format_yaml_extension_with_auto_hint 136 _detect_file_format resolves .yaml to 'yaml' when hint is auto.
function test_detect_file_format_yml_extension_with_auto_hint 144 _detect_file_format resolves .yml to 'yaml' when hint is auto.
function test_detect_file_format_env_extension_with_auto_hint 152 _detect_file_format resolves .env to 'env' when hint is auto.
function test_load_env_file_deep_nesting_three_levels 165 .env files with three path segments build nested dicts correctly.
function test_load_env_file_deep_nesting_four_levels 175 .env files with four path segments build nested dicts correctly.
function test_set_without_running_event_loop 190 Calling set() from synchronous code must not crash when no loop exists.
function test_set_nested_without_running_event_loop 197 Calling set() with a nested key from synchronous code must not crash.
function test_validate_timeout_non_integer 209 The default *.timeout validator rejects non-integer values.
function test_validate_timeout_negative_integer 217 The default *.timeout validator rejects negative integers.
function test_validate_host_non_string 225 The default *.host validator rejects non-string values.
function test_load_with_watch_starts_file_watcher 238 Loading with watch=True registers a background watcher task.
function test_shutdown_cancels_active_watchers 249 shutdown() cancels watcher tasks and clears internal collections.
function test_start_file_watcher_skips_missing_file 262 _start_file_watcher silently returns when the file does not exist.
function test_start_file_watcher_creates_task_for_existing_file 271 _start_file_watcher creates an asyncio task for an existing file.
function test_file_watcher_detects_modification_and_reloads 284 A file modification detected by the watcher triggers load().
function test_set_triggers_path_validation 313 set() calls _validate_path and logs validation warnings.
function test_find_matching_paths_exact_existing 331 Exact pattern for an existing key returns a one-element list.
function test_enumerate_paths_empty_dict 338 _enumerate_paths on an empty dict returns [].
function test_load_memory_source_with_dict_path 349 A MEMORY source whose path is already a dict is loaded directly.
function test_deep_update_overwrites_non_dict_with_dict 367 _deep_update replaces a scalar with a dict when the source has a dict.
function test_deep_update_overwrites_dict_with_scalar 375 _deep_update replaces a dict with a scalar when the source has a scalar.
function test_get_intermediate_non_dict_returns_default 388 get() returns default when an intermediate path segment is not a dict.
function test_create_configuration_discovers_existing_default_file 400 Factory adds default config files when they exist on disk.

tests/core/test_domain.py

source · 26 tests · 266 lines

Covers: core.domain.domain_entity, core.domain.enums.fact_scope, core.enums/ (package)

Kind Name Line Description
function test_fact_scope_is_enum 48
function test_fact_scope_values 52
function test_fact_scope_has_expected_members 58
function test_fact_scope_lookup_by_value 63
function test_fact_scope_members_are_unique 69
function test_fact_scope_reexport_is_same_enum 74
function test_fact_scope_identity_across_imports 80
function test_domain_entity_generates_uuid_and_timestamps 109
function test_domain_entity_instances_have_unique_ids 118
function test_domain_entity_touch_advances_updated_at 124
function test_domain_entity_identity_equality 132
function test_domain_entity_distinct_ids_not_equal 139
function test_domain_entity_equality_with_non_entity 145
function test_domain_entity_hash_matches_id_hash 151
function test_domain_entity_usable_in_set 156
function test_domain_entity_repr_contains_class_and_id 165
function test_domain_entity_to_dict_serializes_datetimes 172
function test_domain_entity_to_dict_nested_entity 183
function test_domain_entity_to_dict_entity_list 192
function test_domain_entity_from_dict_roundtrip_preserves_scalar_fields 201
function test_domain_entity_from_dict_roundtrip_preserves_timestamps 211
function test_domain_entity_from_dict_nested_entity_roundtrip 219
function test_domain_entity_from_dict_list_of_entities 229
function test_domain_entity_from_dict_ignores_unknown_fields 240
function test_domain_entity_from_dict_allows_partial_data 252
function test_domain_entity_to_dict_contains_all_dataclass_fields 262

tests/core/test_enums.py

source · 3 tests · 38 lines

Tests for core.enums compatibility shim.

Covers: core.enums/ (package)

Kind Name Line Description
class TestCoreEnums 26
method TestCoreEnums.test_fact_scope_import 27
method TestCoreEnums.test_fact_scope_values 30
method TestCoreEnums.test_fact_scope_is_enum 35

tests/core/test_env_bootstrap.py

source · 20 tests · 379 lines

Tests for core.env_bootstrap — THE canonical RUL-019 two-phase loader.

Covers: core.env_bootstrap

Kind Name Line Description
function test_profile_overlay_overrides_dotenv_base 44 Phase 2 wins over phase 1. This is the whole contract: .env carries
function test_dotenv_phase_does_not_override_already_exported 62 Phase 1 is setdefault: a value the caller already exported wins over
function test_overlay_phase_overrides_already_exported 73 Phase 2 is a plain write, deliberately asymmetric with phase 1: the
function test_profile_selected_from_environ_and_pinned_back 87 The profile comes from ORCHESTRATA_ENV_PROFILE and is written back,
function test_profile_defaults_to_test_when_unset 107
function test_root_found_by_walking_upward 124 Entrypoints live several packages deep; the loader walks up to the repo
function test_no_env_files_is_not_an_error 139 A deployed container that injects the environment directly has neither
function test_unreadable_dotenv_is_treated_like_missing 153 A .env this process cannot READ is not the same as a missing one
function test_missing_overlay_leaves_dotenv_values 183 An unknown profile name has no overlay file; phase 1 still applies and
function test_comments_blanks_and_quotes_are_parsed 197
function test_value_containing_equals_is_kept_whole 220 Connection URIs and tokens contain =; only the FIRST one separates
function test_env_dir_alone_is_a_valid_root 231 Root detection accepts a tree with env/ but no .env — a checkout
function test_claimed_key_survives_the_profile_overlay 254
function test_claimed_key_survives_even_when_deliberately_blank 264 Membership, not truthiness — a claim may protect an EMPTY value.
function test_unclaimed_key_is_still_overridden_by_the_profile 284 A stale shell export must never outrank the profile.
function test_claim_without_a_value_does_not_block_the_overlay 299 Claiming a key the process never set leaves the profile authoritative.
function test_declare_owned_accumulates_across_calls 310 Three separate conftest sites claim keys; none may erase the others.
function test_owned_keys_is_empty_when_the_marker_is_unset_or_blank 322
function test_claim_travels_in_the_environment_so_both_loaders_see_it 328 The claim is stored in os.environ, not in a per-loader Python object.
function test_owned_keys_is_nonempty_in_a_real_worker_process 341 The RUL-019 write-side proof: a REAL process (not an injected dict)

tests/core/test_fact_scope.py

source · 1 tests · 9 lines

Tests for core/domain/enums/fact_scope.py — real implementation.

Covers: core.domain.enums.fact_scope

Kind Name Line Description
function test_fact_scope_values 6

tests/core/test_gate_policy.py

source · 31 tests · 322 lines

Tests for core.adapters.claude.gate_policy — the ADR-0032 admission-control

Covers: core.adapters.claude.gate_policy

Kind Name Line Description
class TestFailurePolicy 27
method TestFailurePolicy.test_two_members_only 28
method TestFailurePolicy.test_values 34
class TestGateOutcome 39
method TestGateOutcome.test_six_members 40
method TestGateOutcome.test_undetermined_members_are_distinct_from_determined 50
class TestGateDeclaration 60
method TestGateDeclaration.test_default_failure_policy_is_fail_closed 61
method TestGateDeclaration.test_default_fail_open_reason_is_empty 65
method TestGateDeclaration.test_is_frozen 69
method TestGateDeclaration.test_fail_open_without_reason_raises 74
method TestGateDeclaration.test_fail_open_with_whitespace_only_reason_raises 82
method TestGateDeclaration.test_fail_open_with_reason_is_valid 91
method TestGateDeclaration.test_fail_closed_with_reason_raises 101
method TestGateDeclaration.test_zero_timeout_raises 112
method TestGateDeclaration.test_negative_timeout_raises 116
class TestSelfExclusionSet 121
method TestSelfExclusionSet.test_non_empty 122
method TestSelfExclusionSet.test_shapes_are_tool_pattern_pairs 125
method TestSelfExclusionSet.test_covers_the_gate_scripts_and_this_module 133
class TestMatchesSelfExclusion 145
method TestMatchesSelfExclusion.test_matching_read_of_gate_script 146
method TestMatchesSelfExclusion.test_matching_edit_of_interceptor 151
method TestMatchesSelfExclusion.test_matching_bash_of_prolog_meta_lint 161
method TestMatchesSelfExclusion.test_unrelated_tool_does_not_match 166
method TestMatchesSelfExclusion.test_right_pattern_wrong_tool_does_not_match 171
method TestMatchesSelfExclusion.test_same_basename_different_directory_does_not_match 179
method TestMatchesSelfExclusion.test_empty_tool_input_does_not_match 186
method TestMatchesSelfExclusion.test_pattern_in_write_content_only_does_not_match 189
method TestMatchesSelfExclusion.test_pattern_in_edit_old_new_string_only_does_not_match 203
method TestMatchesSelfExclusion.test_pattern_in_bash_description_only_does_not_match 213
method TestMatchesSelfExclusion.test_non_mapping_tool_input_does_not_match 222
class TestResolveExhaustiveTable 232 Every GateOutcome x FailurePolicy cell of resolve().
method TestResolveExhaustiveTable.test_determined_outcomes_are_policy_independent 246
method TestResolveExhaustiveTable.test_undetermined_resolves_to_block_under_fail_closed 268
method TestResolveExhaustiveTable.test_undetermined_resolves_to_allow_under_fail_open 282
method TestResolveExhaustiveTable.test_full_cell_matrix_is_covered 291 Belt-and-braces: every (outcome, policy) pair produces exactly the

tests/core/test_gate_waivers.py

source · 16 tests · 132 lines

Tests for core.gate_waivers — the ONE reader of the # gate-ok: convention.

Covers: core.gate_waivers

Kind Name Line Description
class TestWhatCounts 28
method TestWhatCounts.test_a_reasoned_marker_waives_its_own_line 29
method TestWhatCounts.test_a_bare_marker_waives_nothing 34 An unexplained waiver is indistinguishable from a mute button, and
method TestWhatCounts.test_a_marker_with_only_whitespace_after_the_colon_waives_nothing 39
method TestWhatCounts.test_the_word_alone_is_not_a_marker 44 gate-ok without the colon is prose about the convention — this
method TestWhatCounts.test_spacing_around_the_hash_is_tolerated 49
class TestReach 53
method TestReach.test_a_marker_covers_the_line_below_it 54 The form the repo uses when the statement is too long to carry a
method TestReach.test_a_marker_does_not_reach_two_lines_down 61 Bounded on purpose. A waiver that drifted down a file would start
method TestReach.test_two_markers_cover_two_spans 71
class TestReasons 77
method TestReasons.test_the_reason_travels_with_the_line 78
method TestReasons.test_the_reason_reaches_the_covered_line_below 83
method TestReasons.test_the_first_marker_wins_an_overlapping_line 88 Two markers can both reach one line; the nearer-above one is the
method TestReasons.test_an_unreasoned_marker_contributes_no_reason 95
class TestOnDisk 99
method TestOnDisk.test_a_real_file_is_read_and_matched 100
method TestOnDisk.test_an_unreadable_file_waives_nothing 110 A checker that cannot read the source is in no position to accept a
class TestTheLiveConvention 116 Against the real tree, not a fixture.
method TestTheLiveConvention.test_the_repo_actually_uses_this_convention 119 If this ever returns nothing, the convention has been removed and
method TestTheLiveConvention.test_the_regex_matches_what_the_older_checkers_match 126 The five hand-written checkers each spell it #\s*gate-ok:\s*\S.

tests/core/test_graph_directives.py

source · 5 tests · 48 lines

Tests for core.graph_directives.

Covers: core.graph_directives

Kind Name Line Description
class TestExtractGraphContext 29
method TestExtractGraphContext.test_extracts_string 30
method TestExtractGraphContext.test_returns_none_when_missing 34
method TestExtractGraphContext.test_returns_none_when_empty 38
method TestExtractGraphContext.test_returns_none_when_whitespace 42
method TestExtractGraphContext.test_backward_compat_constant 47

tests/core/test_graph_factory.py

source · 17 tests · 167 lines

Tests for the graph driver factory.

Covers: core.graph_factory

Kind Name Line Description
class TestResolveAuth 36 Tests for _resolve_auth.
method TestResolveAuth.test_tuple_auth 39
method TestResolveAuth.test_explicit_non_tuple_auth 46
method TestResolveAuth.test_none_auth_yields_unauthenticated 53
method TestResolveAuth.test_no_auth_sentinel_yields_unauthenticated 61
method TestResolveAuth.test_explicit_credentials_still_authenticate 67
class TestResolveUri 78 Tests for _resolve_uri.
method TestResolveUri.test_explicit_uri 81
method TestResolveUri.test_none_uri_uses_env 84
method TestResolveUri.test_kg_uri_is_read_when_routing_uri_absent 89
method TestResolveUri.test_routing_uri_wins_over_kg_uri 93
method TestResolveUri.test_neo4j_uri_is_no_longer_read 103 NEO4J_URI must NOT resolve — it was retired with the containers.
method TestResolveUri.test_none_uri_raises_when_env_unset 114 No literal fallback: an unset URI must FAIL, not resolve.
class TestResolveKgDatabase 126 Tests for resolve_kg_database.
method TestResolveKgDatabase.test_explicit_database_wins 129
method TestResolveKgDatabase.test_reads_kg_database_from_env 134
method TestResolveKgDatabase.test_blank_value_is_treated_as_unset 137
method TestResolveKgDatabase.test_unset_raises_instead_of_defaulting_to_neo4j 141 No literal fallback: an unset database must FAIL, not resolve.
class TestCreateGraph 156 Tests for create_graph and create_async_graph.
method TestCreateGraph.test_create_graph_explicit 159
method TestCreateGraph.test_create_async_graph_explicit 165

tests/core/test_infra_config.py

source · 39 tests · 468 lines

Test Standards Compliance (see AGENTS.md § Test Standards):

Covers: core.infra_config

Kind Name Line Description
function test_volk_config_has_required_keys 61 VOLK_CONFIG covers every expected volk alias.
function test_volk_config_entries_have_provider_and_model 66 Each VOLK_CONFIG entry has both 'provider' and 'model' keys.
function test_get_volk_provider_known_volk 74 get_volk_provider returns the configured provider for a known volk.
function test_get_volk_provider_unknown_falls_back_to_default 80 Unknown volks fall back to LLM_PROVIDER.
function test_get_volk_model_known_volk 86 get_volk_model returns the configured model for a known volk.
function test_get_volk_model_unknown_falls_back_to_default 92 Unknown volks fall back to LLM_MODEL.
function test_junior_volk_provider_matches_config 98 JUNIOR_VOLK mirrors VOLK_CONFIG['J:Junior']['provider'].
function test_redis_host_from_env 108 REDIS_HOST is populated from the REDIS_HOST env var at import time.
function test_redis_port_is_int 113 REDIS_PORT is coerced to int on import.
function test_kg_uri_constant_reads_kg_routing_uri_not_neo4j_uri 131 GRAPH_URI mirrors KG_ROUTING_URI — the NEO4J_* env keys are retired.
function test_no_credentials_are_configured 143 Every remaining graph endpoint negotiates no auth, so both are blank.
function test_deprecated_neo4j_aliases_are_gone 154 The F10 NEO4J_* aliases were deleted once kg_design.py — their last
function test_prolog_rules_dir_is_string 165 PROLOG_RULES_DIR is a non-empty filesystem path string.
function test_workspace_dir_default_under_home_when_env_unset 171 WORKSPACE_DIR defaults to ~/workspace when ORCHESTRATA_WORKSPACE unset.
function test_project_workspace_root_equals_workspace_dir 181 PROJECT_WORKSPACE_ROOT is an alias of WORKSPACE_DIR.
function test_swarm_flags_are_correct_types 186 SWARM_ENABLED is bool, SWARM_MAX_RETRIES is int.
function test_provider_models_table_is_complete 193 _PROVIDER_MODELS has standard+reasoning for each provider.
function test_default_urls_are_https 200 Provider base URLs default to https://.
function test_coerce_swarm_enabled_accepts_truthy_strings 212 A string env value for SWARM_ENABLED coerces to True when it matches
function test_coerce_swarm_enabled_rejects_other_strings 220 A string env value outside the truthy set coerces to False (same
function test_validate_returns_list 233 validate() returns a list of warning strings.
function test_validate_does_not_warn_about_redis_host_when_set 241 With REDIS_HOST set in env, validate() does not warn about it.
function test_validate_warns_about_missing_api_keys_for_in_use_providers 248 For providers used in VOLK_CONFIG, a missing API key triggers a warning.
function test_validate_ignores_providers_not_in_volk_config 261 If no volk uses 'kimi', a missing KIMI_API_KEY must not warn.
function test_validate_warns_about_empty_redis_host 271 When REDIS_HOST resolves empty, validate() warns about it.
function test_llm_provider_override_updates_volk_config_and_warns 286 Setting ORCHESTRATA_LLM_PROVIDER reassigns every volk config entry to
function test_llm_provider_env_override_explicit_models_take_precedence 309 Explicit ORCHESTRATA_LLM_MODEL / _REASONING_MODEL override the
function test_llm_provider_env_override_anthropic_validate_warns 323 Overriding to the 'anthropic' provider makes validate() warn about a
function test_llm_provider_env_override_kimi_validate_warns 336 Overriding to the 'kimi' provider makes validate() warn about a
function test_resolve_bin_finds_existing_binary_via_path 354 When a binary is on PATH, shutil.which locates it.
function test_env_file_if_readable_returns_the_path_when_readable 368
function test_env_file_if_readable_returns_none_when_permission_denied 375 Path.exists() alone would see this file (stat only needs execute on
function test_env_file_if_readable_returns_none_when_missing 390
function test_resolve_bin_uses_env_var_path_directly_when_file_exists 396 When the env var points at an existing file, that path is returned
function test_resolve_bin_returns_name_when_nothing_found 413 When env var, PATH, and fallbacks all fail, the bare name is returned.
function test_resolve_bin_uses_fallback_dir_when_path_missing 425 A binary found in an explicit fallback dir is returned.
function test_resolve_bin_skips_env_var_if_file_missing 442 An env var pointing at a missing file is ignored and fallbacks kick in.
function test_resolve_bin_claude_code_path_resolved 459 CLAUDE_CODE_PATH is a non-empty string (name or absolute path).
function test_resolve_bin_aider_path_resolved 465 AIDER_PATH is a non-empty string (name or absolute path).

tests/core/test_infra_env_rule.py

source · 14 tests · 143 lines

Tests for core.infra_env_rule — the no-literal-fallback rule (RUL-003) for

Covers: core.infra_env_rule, verification.review.checks_safety, verification.review.engine

Kind Name Line Description
function test_required_keys_in_scope 25
function test_conversation_redis_keys_in_scope 39
function test_flags_literal_default_on_conversation_redis_key 52
function test_optional_keys_excluded 57
function test_flags_two_arg_get_with_literal_default 73
function test_flags_empty_string_default 80
function test_flags_setdefault 86
function test_receiver_agnostic 91
function test_allows_one_arg_get_no_default 98
function test_allows_non_infra_key_default 102
function test_allows_excluded_optional_key_default 107
function test_reports_lineno 112
function test_review_check_flags_and_passes 121
function test_review_engine_dispatches_rule 134

tests/core/test_interfaces.py

source · 61 tests · 900 lines

Covers: core.interfaces.volk, core.base/ (package), core.interfaces/ (package)

Kind Name Line Description
function test_component_type_enum_members 92
function test_health_status_enum_members 112
function test_component_scope_enum_members 127
function test_memory_classification_str_enum 133
function test_summarization_strategy_str_enum 139
function test_model_capability_str_enum 145
function test_routing_strategy_str_enum 155
function test_component_metadata_fields_and_defaults 167
function test_component_metadata_independent_lists 180
function test_service_endpoint_defaults 193
function test_system_event_defaults_and_to_dict 199
function test_system_event_from_dict_roundtrip 209
function test_system_event_from_dict_handles_bad_timestamp 218
function test_event_subscription_expiry_behaviour 225
function test_memory_scope_all_none_by_default 250
function test_memory_entry_uses_volk_id_field_with_agent_id_alias 256
function test_memory_entry_from_dict_parses_strings 274
function test_memory_entry_from_dict_parses_iso_datetime_strings 291
function test_memory_summary_defaults 305
function test_token_usage_and_cost_defaults 312
function test_message_default_role_is_user 321
function test_provider_request_defaults 327
function test_provider_response_defaults 334
function test_budget_status_defaults 341
function test_usage_report_defaults 348
function test_model_pricing_defaults 354
function test_model_info_defaults_nested_pricing 361
function test_provider_config_defaults 366
function test_raw_provider_response_defaults 375
function test_all_expected_classes_are_dataclasses 381
function test_base_service_satisfies_icomponent_at_runtime 416
function test_base_service_get_metadata_returns_component_metadata 421
function test_base_service_lifecycle_runs_without_error 428
function test_icomponent_rejects_incomplete_class 437
function test_standalone_component_is_icomponent 478
function test_itoken_counter_has_required_method_names 490
function test_token_counter_default_methods_are_noop_returning_none 502
function test_ivolk_is_runtime_checkable 549
function test_ivolk_rejects_incomplete_implementation 553
function test_ivolk_properties_return_expected 564
function test_ivolk_process_intent_returns_dict 571
function test_ivolk_health_check_returns_bool 578
function test_ivolk_default_members_are_noop_returning_none 590
function test_ievent_bus_required_members 605
function test_imemory_engine_required_members 610
function test_iprovider_required_members 623
function test_iprovider_manager_required_members 628
function test_iorchestration_kernel_required_members 642
function test_ipostman_required_members 655
function test_iorchestrator_required_members 667
function test_istate_manager_required_members 678
function test_orchestration_kernel_default_methods_are_noop_returning_none 728
function test_postman_default_methods_are_noop_returning_none 748
function test_orchestrator_default_methods_are_noop_returning_none 762
function test_state_manager_default_methods_are_noop_returning_none 778
function test_memory_engine_default_methods_are_noop_returning_none 790
function test_igovernance_prolog_bridge_members 807
function test_ivolk_registry_members 826
function test_iaudit_trail_members 841
function test_iredis_state_manager_members 866
function test_interfaces_module_exposes_ivolk_marker 897

tests/core/test_interfaces_volk.py

source · 3 tests · 39 lines

Tests for core.interfaces.volk.

Covers: core.interfaces.volk

Kind Name Line Description
class TestIVolk 26
method TestIVolk.test_is_protocol 27
method TestIVolk.test_has_required_methods 32
method TestIVolk.test_has_required_properties 36

tests/core/test_isolation.py

source · 7 tests · 71 lines

Tests for core.isolation.

Covers: core.isolation

Kind Name Line Description
class TestIsolation 28
method TestIsolation.test_creates_temp_dir 29
method TestIsolation.test_test_id_is_uuid 35
method TestIsolation.test_context_manager 40
method TestIsolation.test_create_file 45
method TestIsolation.test_create_directory 52
method TestIsolation.test_cleanup_removes_all 59
method TestIsolation.test_multiple_files 65

tests/core/test_janus_bootstrap.py

source · 28 tests · 540 lines

Covers: core.janus_bootstrap, core.prolog_adapter

Kind Name Line Description
function test_module_reexports_real_janus_swi 88 janus_bootstrap.janus is the real janus_swi module, not a stub.
function test_ensure_swipl_symbols_global_is_idempotent_and_returns_existing_path 97 Calling ensure_swipl_symbols_global() repeatedly (module import already
function test_json_works_in_process_under_janus_after_bootstrap 111 THE proof: the dict-JSON library's atom_json_dict runs in-process via
function test_json_write_dict_roundtrip_in_process_under_janus 129 A second dict-JSON predicate (the write direction) also works
function test_prolog_adapter_uses_the_bootstrapped_janus 144 Wiring proof: core.prolog_adapter's janus IS the bootstrapped one
function test_resolve_libswipl_path_env_override_wins 162 ORCHESTRATA_LIBSWIPL, when set, wins over every other resolution
function test_resolve_libswipl_path_ldd_tier_wins_over_a_different_dump_result 174 Tier 2 is the janus extension's own ldd linkage and it is
function test_resolve_libswipl_path_ldd_tier_is_reached_with_no_dump_result 197 The ldd tier resolves on its own (injected real function objects, not
function test_resolve_libswipl_path_declared_swipl_tier_resolves_the_real_library 211 Tier 3: with no ldd result, the DECLARED swipl's
function test_resolve_libswipl_path_raises_when_no_tier_resolves 225 Tier 4 is a RuntimeError naming the declaration, the ADR and the
function test_a_bare_swipl_declaration_is_never_executed 245 SWIPL=swipl — the shape env/test.env still carries — is not an
function test_a_bare_swipl_in_env_resolves_nothing_through_the_real_tier_3 267 The same, through the REAL dump-runtime resolver (no injected
function test_resolve_libswipl_path_defaults_to_process_environ 275 No env= argument at all -- defaults to the real os.environ, matching
function test_declared_swipl_accepts_only_an_absolute_executable 296 The declaration is used verbatim when it is an absolute executable
function test_path_from_dump_runtime_variables_resolves_the_declared_swipl 318 The DECLARED swipl (env/toolchain.env) really runs and really reports a
function test_path_from_dump_runtime_variables_without_a_declaration_returns_none 329 No declaration, no resolution: the shutil.which("swipl") PATH
function test_path_from_dump_runtime_variables_subprocess_failure_branch 338 A nonexistent binary path makes subprocess.run raise a real
function test_path_from_dump_runtime_variables_plbase_plarch_fallback 346 When PLLIBSWIPL is absent from the dump-runtime-variables output, the
function test_janus_extension_path_locates_compiled_extension 401 The janus-swi package ships a compiled _swipl*.so extension --
function test_janus_extension_path_package_not_found_branch 414 A nonexistent package name makes find_spec return None
function test_janus_extension_path_no_matches_in_given_locations 421 An explicit empty locations list skips package discovery
function test_janus_extension_path_find_spec_raises_branch 427 A malformed relative-import-style name makes find_spec itself
function test_path_from_janus_ldd_matches_dump_runtime_variables 441 Both independent resolution strategies (the DECLARED swipl's
function test_path_from_janus_ldd_not_found_branch 457 An empty ldd_bin override forces the "ldd not on PATH" branch.
function test_path_from_janus_ldd_subprocess_failure_branch 462 ldd on a nonexistent file path exits non-zero -- a real
function test_path_from_janus_ldd_no_libswipl_in_output_branch 469 ldd on a real binary that does NOT link libswipl (/bin/ls)
function test_ensure_swipl_symbols_global_raises_on_bad_path_without_caching_failure 481 A resolution failure must raise RuntimeError with an actionable
function test_ensure_swipl_symbols_global_concurrent_calls_agree_on_one_path 506 Real multi-threaded proof of the idempotent double-checked-locking

tests/core/test_logging.py

source · 23 tests · 326 lines

Tests for orchestrata_ultimate.core.logging.

Covers: core.logging

Kind Name Line Description
function test_structured_formatter_outputs_valid_json 93 Output of format() is parseable JSON with the expected keys.
function test_structured_formatter_includes_context_vars 108 Active correlation/session/volk IDs show up in the JSON payload.
function test_structured_formatter_includes_exception_info 120 Exception info is formatted and attached under 'exception'.
function test_structured_formatter_extracts_extra_fields 144 Known extra fields attached to the record are surfaced in JSON.
function test_structured_formatter_ignores_unknown_fields 156 Fields not in the allow-list are NOT surfaced.
function test_standard_formatter_contains_message_and_level 169 The human-readable format includes level and message text.
function test_standard_formatter_is_not_json 177 Output is not parseable as JSON (it's plain text).
function test_configure_logging_default_level_is_info 189 Default level is INFO.
function test_configure_logging_sets_level_from_string 195 Level argument is parsed from its string name.
function test_configure_logging_unknown_level_falls_back_to_info 201 Unknown level names fall back to INFO.
function test_configure_logging_attaches_stream_handler 207 A StreamHandler is added to the root logger.
function test_configure_logging_removes_old_handlers 214 Reconfiguring wipes previously attached handlers.
function test_configure_logging_json_format_uses_structured 223 When json_format=True, StructuredFormatter is attached.
function test_configure_logging_standard_format_uses_standard 232 When json_format=False, StandardFormatter is attached.
function test_configure_logging_writes_to_file 241 With log_file set, messages land in the file as JSON lines.
function test_configure_logging_no_file_when_empty 259 Empty log_file string means no FileHandler is added.
function test_new_correlation_id_returns_12_char_string 271 Returned ID is a 12-character string.
function test_new_correlation_id_updates_context_var 278 The context var is updated to match the returned value.
function test_new_correlation_id_uniqueness 284 Successive calls produce different IDs (extremely high prob).
function test_get_logger_returns_logging_logger 295 Returns a real logging.Logger instance.
function test_get_logger_same_name_returns_same_instance 302 Calls with the same name return the same cached logger.
function test_get_logger_inherits_root_configuration 309 Loggers obtained via get_logger() honor the root level.
function test_get_logger_logs_to_configured_file 317 get_logger() output reaches the configured file handler.

tests/core/test_lru_cache.py

source · 13 tests · 154 lines

Tests for core.lru_cache — thread-safe LRU cache with TTL.

Covers: core.lru_cache

Kind Name Line Description
function test_get_missing 31
function test_put_and_get 36
function test_put_overwrites 42
function test_ttl_expiry 54
function test_custom_ttl 61
function test_no_expiry_when_within_ttl 68
function test_lru_eviction_when_full 79
function test_lru_updates_on_access 89
function test_invalidate_existing 105
function test_invalidate_missing 112
function test_clear 122
function test_stats_initial 136
function test_stats_after_hit_and_miss 145

tests/core/test_monitoring.py

source · 50 tests · 781 lines

Covers: core.monitoring.engine, core.monitoring.spans, core.monitoring/ (package)

Kind Name Line Description
function test_span_status_values 59
function test_span_defaults 65
function test_span_duration_properties 79
function test_span_to_dict_serializes_status_and_rounds_ms 86
function test_make_span_sets_start_ns_to_now 111
function test_get_trace_level_returns_valid_range 135
function test_trace_level_constants 140
function test_engine_init_with_trace_off 160
function test_engine_init_explicit_level_override 166
function test_engine_reset_clears_spans_and_active 178
function test_engine_set_label_stores_label_by_code_id 191
function test_on_py_start_creates_active_span_for_thread 219
function test_on_py_return_finalizes_span_as_ok 235
function test_on_py_return_without_active_is_noop 250
function test_on_raise_marks_active_span_as_error 257
function test_on_raise_truncates_long_messages 271
function test_on_raise_without_active_is_noop 280
function test_on_unwind_finalizes_span_as_error 286
function test_on_unwind_preserves_error_info_from_prior_raise 302
function test_on_unwind_without_active_is_noop 316
function test_get_spans_respects_limit 341
function test_get_spans_returns_all_when_limit_exceeds 348
function test_max_spans_ring_buffer_evicts_oldest 355
function test_get_slow_spans_filters_by_threshold 367
function test_get_slow_spans_respects_limit 376
function test_get_slow_spans_returns_empty_when_none_slow 385
function test_monitor_decorator_without_parens_passes_through_when_off 396 At TRACE_OFF (default test env), @monitor is a pass-through.
function test_monitor_decorator_with_label_passes_through_when_off 410
function test_monitor_decorator_propagates_exceptions_when_off 421
function test_module_tracer_is_tracer_engine_instance 437
function test_get_trace_level_invalid_env 446 _get_trace_level returns TRACE_OFF for non-integer env value.
function test_get_trace_level_clamps_high 453 _get_trace_level clamps values above TRACE_FULL.
function test_get_trace_level_clamps_low 460 _get_trace_level clamps negative values to TRACE_OFF.
function test_start_stop_lifecycle 472 start() registers and stop() unregisters from sys.monitoring.
function test_start_idempotent 485 Multiple start() calls are no-ops.
function test_stop_when_not_registered 496 stop() is a no-op when not registered.
function test_start_trace_off_is_noop 502 start() is a no-op at TRACE_OFF.
function test_enable_for_starts_engine 509 enable_for() auto-starts an unregistered engine.
function test_enable_for_code_object 524 enable_for() accepts a code object directly.
function test_on_line_logs_debug 540 _on_line logs a DEBUG message with file, line, and function.
function test_monitor_decorator_with_active_tracer 557 @monitor registers function and works when tracer is active.
function test_monitor_fallback_records_span 579 Monitor fallback path records spans when sys.monitoring unavailable.
function test_get_slow_spans_empty_engine 617 get_slow_spans returns empty list for engine with no spans.
function test_get_slow_spans_exact_threshold 623 Spans at exactly the threshold are included.
function test_start_at_trace_lines 636 start() registers LINE callback at TRACE_LINES level.
function test_start_at_trace_full 646 start() registers RAISE callback at TRACE_FULL level.
function test_enable_for_at_trace_lines 656 enable_for() sets LINE local events at TRACE_LINES level.
function test_monitor_fallback_records_span_and_exception 672 Fallback path records spans and exceptions.
function test_monitor_with_label_and_fallback 712 Monitor with label in fallback path.
function test_monitor_fallback_when_tool_id_claimed 734 Fallback path runs when sys.monitoring tool ID is already claimed.

tests/core/test_paths.py

source · 8 tests · 100 lines

Tests for core.paths.

Covers: core.paths

Kind Name Line Description
class TestGetProjectRoot 33
method TestGetProjectRoot.test_env_override 34
method TestGetProjectRoot.test_finds_repo_root_not_package_dir 38
method TestGetProjectRoot.test_returns_path_object 47
class TestGetPrologDir 52
method TestGetPrologDir.test_returns_prolog_subdirectory 53
method TestGetPrologDir.test_is_the_packaged_rules_dir_not_the_root_marker 58 get_prolog_dir anchors to the PACKAGE rules
class TestResolveProjectRoot 75 The root lookup that never raises, for imports that must not fail.
method TestResolveProjectRoot.test_an_installed_package_finds_the_checkout_above_its_venv 78
method TestResolveProjectRoot.test_a_tree_without_pyproject_falls_back_to_its_layout_root 88
method TestResolveProjectRoot.test_this_checkout_resolves_as_get_project_root_does 99

tests/core/test_patterns.py

source · 26 tests · 327 lines

Covers: core.patterns.error_handling

Kind Name Line Description
function test_error_detail_minimal_fields 40
function test_error_detail_to_dict_omits_optional_fields 50
function test_error_detail_to_dict_includes_stack_trace_when_present 61
function test_error_detail_to_dict_includes_context_when_nonempty 71
function test_error_detail_to_dict_includes_error_code 81
function test_error_handler_defaults 96
function test_error_handler_debug_mode_true_constructor 103
function test_error_handler_set_debug_mode_toggles 108
function test_error_handler_history_is_defensive_copy 116
function test_handle_error_no_debug_suppresses_stack_trace 130
function test_handle_error_debug_captures_stack_trace 145
function test_handle_error_debug_outside_active_except_still_formats_trace 157
function test_handle_error_stores_context 173
function test_handle_error_increments_counter 182
function test_handle_error_from_string_basic 198
function test_handle_error_from_string_defaults 214
function test_history_is_bounded_to_limit 226
function test_history_bound_with_real_exceptions 239
function test_get_recent_errors_returns_last_n 250
function test_get_recent_errors_default_count_is_ten 260
function test_get_recent_errors_when_empty 270
function test_clear_history_returns_count_and_empties 280
function test_clear_history_on_empty_handler 291
function test_get_error_summary_aggregates_types 296
function test_get_error_summary_after_clear_preserves_total 308
function test_get_error_summary_on_empty_handler 319

tests/core/test_prolog_adapter.py

source · 13 tests · 241 lines

Covers: core.prolog_adapter

Kind Name Line Description
function test_backend_is_real 69 The engine used by these tests must be the real janus-swi backend.
function test_assertz_then_query_once_returns_fact 74 A fact asserted via assertz is retrievable via query_once.
function test_query_returns_all_solutions 84 query enumerates every solution for a non-deterministic goal.
function test_query_once_returns_none_for_no_solution 96 Failing goals yield None from query_once.
function test_retract_removes_a_single_fact 104 retract removes the matching fact so subsequent queries miss it.
function test_retractall_clears_the_predicate 116 retractall removes every matching clause.
function test_arithmetic_query_once 128 A built-in arithmetic goal resolves through query_once.
function test_strip_truth_removes_truth_key 136
function test_strip_truth_no_truth_key 143
function test_strip_truth_empty_dict 150
function test_consult_loads_file 157 consult loads a .pl file and makes its predicates available.
function test_engine_pins_reusable_engine_per_thread 168 PrologEngine pins one reusable SWI engine per thread; raw janus churns.
function test_shared_engine_runs_concurrently_and_correctly 211 One PrologEngine, queried from many threads, returns correct answers.

tests/core/test_protocols.py

source · 61 tests · 966 lines

Covers: core.protocols.base, memory.token_counter, core.interfaces/ (package), core.protocols/ (package)

Kind Name Line Description
function test_component_type_values 93
function test_component_type_roundtrip 107
function test_request_constant 112
function test_component_metadata_required_and_defaults 121
function test_component_metadata_independent_default_lists 136
function test_service_endpoint_required_and_defaults 153
function test_service_endpoint_custom_metadata 163
function test_system_event_defaults 180
function test_system_event_to_dict_roundtrip 193
function test_system_event_from_dict_roundtrip 212
function test_system_event_from_dict_defaults_when_unknown_timestamp 224
function test_event_subscription_not_expired_when_expires_at_none 238
function test_event_subscription_expired_past 248
function test_event_subscription_not_expired_future 260
function test_event_subscription_expired_with_explicit_reference 272
function test_memory_classification_values 290
function test_summarization_strategy_values 298
function test_memory_scope_defaults 309
function test_memory_entry_defaults_and_types 315
function test_memory_entry_to_dict_and_back 326
function test_memory_entry_from_dict_handles_string_json_fields 353
function test_memory_summary_defaults 368
function test_word_token_counter_satisfies_protocol_structurally 383
function test_tiktoken_counter_satisfies_protocol_structurally 391
function test_get_token_counter_returns_a_protocol_impl 398
function test_token_counter_protocol_required_methods_present 408
function test_token_usage_and_cost_records_defaults 421
function test_cost_estimate_has_default_cost_record 431
function test_message_defaults 438
function test_provider_request_defaults 444
function test_provider_response_defaults_and_types 455
function test_budget_status_and_usage_report_defaults 463
function test_model_pricing_and_info_defaults 474
function test_provider_config_defaults 484
function test_raw_provider_response_defaults 493
function test_model_capability_values 504
function test_routing_strategy_values 514
function test_expected_types_are_dataclasses 526
function test_volk_protocol_is_runtime_checkable 603
function test_volk_protocol_rejects_incomplete_implementation 608
function test_volk_protocol_properties_return_expected_values 619
function test_volk_protocol_process_intent_returns_dict 626
function test_volk_protocol_health_check_returns_bool 634
function test_volk_protocol_documents_required_members 639
function test_component_protocol_structural_conformance 682
function test_sample_component_lifecycle_runs 688
function test_event_bus_protocol_has_required_members 706
function test_memory_engine_protocol_has_required_members 717
function test_provider_protocol_has_required_members 730
function test_provider_manager_protocol_has_required_members 735
function test_orchestration_kernel_protocol_has_required_members 749
function test_postman_protocol_has_required_members 762
function test_orchestrator_protocol_has_required_members 774
function test_state_manager_protocol_has_required_members 785
function test_governance_prolog_bridge_protocol_members 802
function test_volk_registry_protocol_members 821
function test_audit_trail_protocol_members 836
function test_redis_state_manager_protocol_members 861
function test_protocols_module_all_exports 892
function test_event_bus_protocol_stub_bodies_are_callable 915
function test_component_protocol_stub_bodies_are_callable 945

tests/core/test_protocols_agent.py

source · 2 tests · 34 lines

Tests for core.protocols.agent — VolkProtocol.

Covers: core.protocols.agent

Kind Name Line Description
class TestVolkProtocol 26
method TestVolkProtocol.test_runtime_checkable 27
method TestVolkProtocol.test_missing_methods_fails 30

tests/core/test_pyproject_contract.py

source · 10 tests · 255 lines

Tests for the claims pyproject.toml makes about this project's runtime.

Kind Name Line Description
class TestVersionAgreement 60 One release version, stated in three places that must not drift.
method TestVersionAgreement.test_project_and_commitizen_versions_match 69
method TestVersionAgreement.test_plugin_manifest_matches_project_version 78
class TestFreeThreadingFloor 88 SPEC-023: the GIL stays off. A dependency must not switch it back on.
method TestFreeThreadingFloor.test_tokenizers_floor_is_the_gil_safe_release 103
method TestFreeThreadingFloor.test_transformers_floor_permits_the_gil_safe_tokenizers 119 transformers<5.16.0 caps tokenizers at <=0.23.0, undoing the pin.
method TestFreeThreadingFloor.test_free_threading_stack_not_in_core_dependencies 136 The chain was moved to an extra to shrink prod's install footprint.
method TestFreeThreadingFloor.test_gil_chain_dev_group_matches_local_embeddings_pins 146 Single-authoritative-location invariant (PI-ORCH-A finding #3): the
method TestFreeThreadingFloor.test_importing_tokenizers_leaves_the_gil_off 165 The claim itself, measured — not the pin, the behaviour.
class TestTorchIsCpuOnly 195 The CUDA wheel was never a reachable capability, only dead weight.
method TestTorchIsCpuOnly.test_torch_pin_is_the_cpu_build 210
method TestTorchIsCpuOnly.test_torch_source_index_agrees_with_the_pin 224
class TestExternalToolsAreDeclared 238 A tool a script shells out to must be declared with a version floor.
method TestExternalToolsAreDeclared.test_clips_declaration_is_complete 246

tests/core/test_redis_factory.py

source · 10 tests · 97 lines

Tests for core/redis_factory.py — helper functions and client creation.

Covers: core.redis_factory

Kind Name Line Description
class TestGetRedisHost 35
method TestGetRedisHost.test_unset_raises 36
method TestGetRedisHost.test_from_env 43
class TestGetRedisPort 50
method TestGetRedisPort.test_unset_raises 51
method TestGetRedisPort.test_from_env 56
class TestGetRedisDb 60
method TestGetRedisDb.test_default 61
method TestGetRedisDb.test_from_env 64
class TestCreateSyncRedis 68
method TestCreateSyncRedis.test_returns_redis_instance 69
method TestCreateSyncRedis.test_uses_explicit_params 75
class TestCreateAsyncRedis 87
method TestCreateAsyncRedis.test_returns_async_redis_instance 88
method TestCreateAsyncRedis.test_uses_explicit_params 92

tests/core/test_runtime_callgraph_coverage.py

source · 18 tests · 257 lines

Tests for core/tracing/runtime_callgraph.py — the SPEC-023 runtime

Covers: core.tracing.runtime_callgraph

Kind Name Line Description
function test_is_first_party_true_for_package_code 87
function test_is_first_party_false_for_test_code 91
function test_module_of_maps_path_to_dotted_module 95
function test_module_of_normalizes_package_init 100
function test_qname_matches_ast_convention 107
function test_on_call_ignores_builtin_callee 115
function test_on_call_ignores_non_first_party_caller 123
function test_on_call_ignores_non_first_party_callee 129
function test_on_call_records_first_party_edge_once 135
function test_on_call_records_distinct_pairs 147
function test_pytest_configure_noop_without_env 159
function test_pytest_configure_claims_tool_and_registers 164
function test_pytest_configure_returns_when_no_tool_id_free 175
function test_pytest_sessionfinish_noop_when_never_configured 196
function test_pytest_sessionfinish_noop_when_env_missing 204
function test_pytest_sessionfinish_skips_pairs_missing_code_objects 215
function test_pytest_sessionfinish_drops_self_edges 228
function test_pytest_sessionfinish_writes_edges_file 239

tests/core/test_spans.py

source · 7 tests · 96 lines

Tests for core.monitoring.spans.

Covers: core.monitoring.spans

Kind Name Line Description
class TestSpan 28
method TestSpan.test_defaults 29
method TestSpan.test_duration_ns 42
method TestSpan.test_duration_ms 46
method TestSpan.test_duration_us 50
method TestSpan.test_to_dict 54
class TestMakeSpan 79
method TestMakeSpan.test_sets_start_ns 80
class TestSpanStatus 92
method TestSpanStatus.test_values 93

tests/core/test_standards.py

source · 14 tests · 96 lines

Tests for orchestrata_ultimate.core.standards.

Covers: core.standards

Kind Name Line Description
function test_coding_standards_is_nonempty_string 19 CODING_STANDARDS is defined and not empty.
function test_coding_standards_has_delimiters 25 Begins and ends with the canonical block markers.
function test_coding_standards_fix_is_nonempty_string 31 Fix-cycle subset is defined and not empty.
function test_coding_standards_fix_has_delimiters 37 Fix-cycle subset begins and ends with its canonical markers.
function test_fix_cycle_is_shorter_than_full 43 The fix-cycle subset must be shorter than the full standards.
function test_fix_cycle_is_roughly_three_times_smaller 48 Docstring claims ~3x reduction. Allow a generous range.
function test_get_standards_default_returns_full 54 With no argument, returns the full CODING_STANDARDS string.
function test_get_standards_fix_cycle_false_returns_full 59 Explicit fix_cycle=False returns the full standards.
function test_get_standards_fix_cycle_true_returns_subset 64 fix_cycle=True returns the shorter subset.
function test_get_standards_positional_arg 69 Supports positional True/False.
function test_standards_mention_no_mocking 75 Core policy — no mocking — must appear in both variants.
function test_standards_mention_absolute_imports 81 Absolute-imports rule appears in the full standards.
function test_get_standards_returns_string_always 87 Return type is always str.
function test_get_standards_idempotent 93 Repeated calls return identical strings.

tests/core/test_state_manager.py

source · 12 tests · 192 lines

Covers: core.state.state_manager, core.interfaces/ (package)

Kind Name Line Description
function test_set_then_get_returns_the_value 60
function test_get_state_returns_default_when_missing 67
function test_delete_state_removes_the_key 74
function test_update_state_applies_updater_function 84
function test_update_state_initializes_when_absent 93
function test_create_and_list_namespaces 103
function test_set_state_without_dot_uses_default_namespace 118 Keys without a dot are stored under the default namespace.
function test_set_state_persists_to_disk 129 Setting a value writes a &lt;namespace&gt;.json file with the data.
function test_initialize_reloads_state_from_disk 147 A fresh manager restores namespaces from _load_state on init.
function test_lifecycle_health_transitions 164 start → HEALTHY, stop → STOPPED.
function test_get_metadata_returns_state_manager_metadata 175
function test_delete_state_is_noop_for_missing_key 184 Deleting a key that does not exist should be silent (no exception).

tests/core/test_test_memgraph_routing.py

source · 7 tests · 218 lines

The suite must talk to the DEDICATED test Memgraph, never production.

Kind Name Line Description
function test_memgraph_uri_is_the_dedicated_test_instance 38 The resolved URI equals TEST_MEMGRAPH_URI whenever one is configured.
function test_conftest_rewrote_the_ambient_memgraph_env 52 conftest's import-time rewrite reached os.environ.
function test_ha_discovery_inputs_are_cleared 68 No route back to the prod coordinators behind the suite's back.
function test_resolved_uri_answers_a_real_bolt_round_trip 79 End-to-end proof the URI the fixtures use is a live, reachable node —
function test_test_instance_is_not_the_production_cluster 93 The test node must not BE the production cluster.
function test_kg_routing_never_overrides_the_dedicated_test_instance 124 The Phase 4.2 cutover must not aim the suite at production.
function test_env_template_names_the_test_fleet_node_for_the_suite 177 .env.example is what a fresh host copies to .env. The guard

tests/core/test_thread_pool.py

source · 1 tests · 17 lines

Kind Name Line Description
function test_submit_task 11

tests/core/test_traceability.py

source · 51 tests · 875 lines

Covers: core.base.traces, core.traceability_utils, core.traceability/ (package)

Kind Name Line Description
function test_tr_traces_requires_reqs 50
function test_tr_traces_empty_list_rejected 58
function test_tr_traces_rejects_invalid_req_id 66
function test_tr_traces_accepts_known_id_formats 85
function test_tr_traces_accepts_cluster_phase_id_form 109
function test_tr_traces_rejects_cluster_id_without_digit 117
function test_tr_traces_error_message_mentions_cluster_phase_form 125
function test_tr_traces_stores_spec_and_story 133
function test_tr_traces_second_application_appends_list 143
function test_tr_traces_third_application_extends_existing_list 155
function test_tr_traces_on_function 166
function test_tr_trace_info_to_dict_roundtrip 180
function test_tr_validation_report_coverage_totals 204
function test_tr_validation_report_coverage_empty_returns_100 217
function test_tr_validation_report_to_dict 222
function test_tr_collect_traces_rejects_non_directory 249
function test_tr_collect_traces_empty_tree 255
function test_tr_collect_traces_finds_class_decorators 260
function test_tr_collect_traces_finds_method_and_inherits_parent_spec 285
function test_tr_collect_traces_top_level_function 313
function test_tr_collect_traces_skips_invalid_syntax 333
function test_tr_collect_traces_skips_pycache 352
function test_tr_collect_traces_expands_multi_req_list_to_separate_entries 369
function test_tr_generate_rtm_sorted_entries 392
function test_tr_generate_rtm_writes_json 419
function test_tr_generate_rtm_markdown_contains_summary_and_details 436
function test_tr_generate_rtm_markdown_writes_to_file 455
function test_tr_validate_traces_classifies_ids 476
function test_tr_validate_traces_detects_duplicates 489
function test_tr_validate_traces_location_fallback 499
function test_tu_traces_requires_reqs 518
function test_tu_traces_rejects_invalid_req_id 526
function test_tu_traces_rejects_bare_us_id 544
function test_tu_traces_accepts_supported_ids 563
function test_tu_traces_stacks_on_repeat 571
function test_tu_trace_info_to_dict 586
function test_tu_user_story_to_dict 603
function test_tu_validation_report_coverage_math 632
function test_tu_validation_report_empty_is_100 639
function test_tu_rtm_report_to_dict_with_and_without_validation 643
function test_tu_scan_traces_missing_directory_returns_empty 665
function test_tu_scan_traces_empty_directory 669
function test_tu_scan_traces_finds_class_and_method 674
function test_tu_scan_traces_top_level_function 700
function test_tu_scan_traces_ignores_pycache 719
function test_tu_validate_traces_classification 740
function test_tu_validate_traces_duplicates 753
function test_tu_generate_rtm_builds_report 762
function test_tu_save_rtm_writes_json_and_markdown 790
function test_tu_save_rtm_without_validation_omits_coverage 831
function test_traceability_utils_pattern_matches_canonical_base_traces 871

tests/core/test_traceability_init_extended.py

source · 44 tests · 604 lines

Covers: core.traceability/ (package)

Kind Name Line Description
function test_validate_req_id_accepts_valid 67
function test_validate_req_id_rejects_invalid 87
function test_extract_string_value_from_string_constant 96
function test_extract_string_value_from_int_constant 101
function test_extract_string_value_from_non_constant 106
function test_extract_list_values_from_string_list 111
function test_extract_list_values_from_non_list 116
function test_extract_list_values_skips_non_string_elements 121
function test_extract_traces_from_decorator_with_name_traces 131
function test_extract_traces_from_decorator_with_attribute_traces 140
function test_extract_traces_from_decorator_rejects_other_name 149
function test_extract_traces_from_decorator_rejects_other_attribute 156
function test_extract_traces_from_decorator_rejects_subscript 163
function test_extract_traces_from_decorator_missing_reqs_returns_none 171
function test_extract_traces_from_decorator_empty_reqs_returns_none 178
function test_file_path_to_module_normal_case 190
function test_file_path_to_module_outside_root 196
function test_file_path_to_module_same_as_root 202
function test_is_method_detects_method 213
function test_is_method_rejects_top_level_function 220
function test_scan_class_no_decorators 232
function test_scan_class_with_non_traces_decorator 240
function test_scan_function_no_decorators 248
function test_scan_function_with_traces_decorator 256
function test_scan_function_inherits_parent_trace 266
function test_scan_function_ignores_non_traces_decorator 279
function test_collect_traces_skips_unicode_decode_error 299
function test_collect_traces_async_function 321
function test_collect_traces_class_with_methods_no_traces 340
function test_collect_traces_nested_classes_not_double_counted 355
function test_generate_rtm_empty_list 385
function test_generate_rtm_multiple_reqs_per_trace 390
function test_generate_rtm_markdown_empty_list 410
function test_generate_rtm_markdown_multiple_specs 416
function test_generate_rtm_markdown_no_src_in_path 442
function test_generate_rtm_markdown_trace_with_no_reqs 457
function test_generate_rtm_markdown_class_only_no_method 473
function test_validate_traces_empty_inputs 494
function test_validate_traces_all_missing 502
function test_validate_traces_all_orphan 508
function test_validate_traces_no_duplicates 517
function test_validate_traces_location_uses_module_fallback 525
function test_full_pipeline_from_source_to_validation_report 543
function test_full_pipeline_json_output_roundtrip 578

tests/core/test_tracing.py

source · 80 tests · 1258 lines

Covers: core.tracing.context, core.tracing.scanner, core.tracing.traceability, core.tracing/ (package)

Kind Name Line Description
function test_traces_requires_reqs 56
function test_traces_empty_list_rejected 64
function test_traces_rejects_invalid_req_id 72
function test_traces_accepts_known_id_formats 92
function test_traces_stores_spec_and_story 104
function test_traces_second_application_creates_list 114
function test_traces_third_application_extends_list 130
function test_traces_on_function_preserves_callable 141
function test_trace_info_defaults 159
function test_trace_info_to_dict_roundtrip 167
function test_validation_report_empty_coverage_is_100 190
function test_validation_report_coverage_math 198
function test_validation_report_to_dict 211
function test_collect_traces_rejects_non_directory 236
function test_collect_traces_empty_tree 242
function test_collect_traces_finds_class_decorator 247
function test_collect_traces_method_inherits_parent_spec_and_story 273
function test_collect_traces_method_overrides_spec_story 298
function test_collect_traces_top_level_function 318
function test_collect_traces_async_function 338
function test_collect_traces_async_method_inside_class 355
function test_collect_traces_skips_invalid_syntax 377
function test_collect_traces_skips_pycache 395
function test_collect_traces_expands_multiple_reqs 410
function test_collect_traces_ignores_non_traces_decorators 427
function test_collect_traces_attribute_style_decorator 446
function test_collect_traces_missing_reqs_kwarg_is_skipped 463
function test_collect_traces_bare_name_decorator_is_ignored 480
function test_collect_traces_walks_nested_dirs 498
function test_scanner_extract_string_value_handles_non_string 522
function test_scanner_extract_list_values_filters_non_strings 526
function test_scanner_extract_list_values_non_list_returns_empty 538
function test_scanner_file_path_to_module_outside_root 542
function test_scanner_file_path_to_module_inside_root 553
function test_generate_rtm_sorted_by_req_id 565
function test_generate_rtm_writes_json_file 592
function test_generate_rtm_markdown_contains_summary_and_details 607
function test_generate_rtm_markdown_writes_file 626
function test_generate_rtm_markdown_renders_missing_method_as_dash 642
function test_validate_traces_classifies_verified_missing_orphan 663
function test_validate_traces_detects_duplicates 676
function test_validate_traces_duplicate_location_fallbacks 686
function test_validate_traces_no_duplicates_when_unique_locations 695
function test_iteration_tracer_writes_start_event 745
function test_iteration_tracer_path_under_output_dir 760
function test_iteration_tracer_creates_missing_output_dir 770
function test_iteration_tracer_trace_event_appends 782
function test_iteration_tracer_trace_llm_call 799
function test_iteration_tracer_trace_volk_decision 822
function test_iteration_tracer_trace_qa_gate 841
function test_iteration_tracer_trace_concierge_round 858
function test_iteration_tracer_trace_fix_cycle 878
function test_iteration_tracer_close_writes_trace_end 900
function test_iteration_tracer_close_is_idempotent 913
function test_iteration_tracer_context_manager_closes 924
function test_iteration_tracer_sequence_numbers_are_monotonic 936
function test_iteration_tracer_carries_no_placeholder_traces 947 IterationTracer must not claim fabricated requirements.
function test_iteration_tracer_jsonl_lines_are_valid_json 966
function test_iteration_tracer_elapsed_ms_is_non_negative 980
function test_iteration_tracer_init_failure_closes_file_and_reraises 1008
function test_iteration_tracer_del_swallows_oserror_on_broken_fd 1022
function test_iteration_tracer_close_raises_after_broken_fd_write_logs_oserror 1032
function test_iteration_tracer_trace_event_swallows_oserror_on_broken_fd 1043
function test_iteration_tracer_trace_llm_call_swallows_serialization_error 1052
function test_iteration_tracer_trace_volk_decision_swallows_serialization_error 1074
function test_iteration_tracer_trace_qa_gate_swallows_serialization_error 1090
function test_iteration_tracer_trace_concierge_round_swallows_serialization_error 1106
function test_iteration_tracer_trace_fix_cycle_swallows_serialization_error 1123
function test_iteration_tracer_trace_event_swallows_serialization_error 1140
function test_context_tracing_enabled_default_is_true 1165
function test_context_tracing_enabled_false_for_disabled_values 1173
function test_context_tracing_enabled_true_for_other_values 1178
function test_context_trace_dir_default 1182
function test_context_trace_dir_env_override 1187
function test_context_get_tracer_returns_none_for_falsy_or_unknown 1192
function test_context_register_get_unregister_tracer_lifecycle 1198
function test_context_pipeline_trace_registers_writes_and_cleans_up 1214
function test_context_pipeline_trace_disabled_yields_none 1232
function test_context_pipeline_trace_empty_thread_id_yields_none 1239
function test_context_pipeline_trace_oserror_on_open_yields_none 1246

tests/core/test_uv_lock_contract.py

source · 2 tests · 72 lines

Tests for the claims uv.lock makes about this project's runtime.

Kind Name Line Description
class TestFreeThreadingFloor 57 SPEC-023: nothing in the lock may abort the free-threaded interpreter.
method TestFreeThreadingFloor.test_greenlet_is_at_or_above_the_free_threaded_floor 60
method TestFreeThreadingFloor.test_release_parsing_orders_versions_numerically 68 3.5.10 must sort above 3.5.3 — a string compare would invert it.

tests/core/test_worker_database_mapping.py

source · 7 tests · 280 lines

Regression tests for the per-slot DATABASE mapping in tests/conftest.py.

Covers: core.graph_factory

Kind Name Line Description
function test_worker_isolation_is_a_database_name 49 This slot must target its own orchkg_w&lt;N&gt; database.
function test_mapped_database_reaches_a_live_instance 89 The mapped (uri, database) pair answers a real bolt round-trip.
function test_kg_database_for_level0_maps_slot_band 123 A plain profile value (or empty env) maps to the per-worker band.
function test_slot0_resolves_to_its_own_database_band_end_to_end 167 slot0 must reach orchkg_w0 through the REAL conftest.py call
function test_missing_slot_maps_to_the_slot0_band 181 A missing ORCHESTRATA_WORKER_SLOT intentionally maps to the SAME
function test_kg_database_for_nested_reuses_parent_band 190 An inherited worker-band name means this is a nested child: REUSE it.
function test_nested_child_process_reuses_parent_database 203 END-TO-END: a pytest child launched from a worker whose band is

tests/core/test_worker_kg_grpc_port_mapping.py

source · 7 tests · 127 lines

Regression tests for the per-worker KG_GRPC_PORT mapping in tests/conftest.py.

Kind Name Line Description
function test_slot0_resolves_to_its_own_offset_band 73
function test_slot1_resolves_to_offset_band 87
function test_slot3_resolves_to_offset_band 94
function test_no_slot_port_collides_with_kernel_cxp_port 99
function test_slot0_and_missing_slot_resolve_to_different_ports 109
function test_missing_slot_leaves_base_port_unchanged 117
function test_non_numeric_slot_suffix_is_fail_safe_and_leaves_base_port_unchanged 122 A slot suffix that doesn't parse as an int (e.g. a hand-run worker

Support files

Fixtures, package markers and helpers without test functions.