Orchestrata Ultimate › Tests › Reference › kernel › test_pipeline_kg

Tests reference — tests/kernel/test_pipeline_kg.py

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

Prose pending.

tests/kernel/test_pipeline_kg.py

source · 72 tests · 1547 lines

Covers: context.assembler, core.base.traces, core.infra_config, kernel.pipeline_artifacts, kernel.pipeline_kg, knowledge_graph.context_injector, knowledge_graph.context_pack.relevance, knowledge_graph.runtime_writer, session.models, core.graph/ (package), core.packet/ (package), session.controller/ (package)

Kind Name Line Description
class TestComponentFromSourcePath 141 Pure tests for _component_from_source_path (gap #2 ownership
method TestComponentFromSourcePath.test_in_tree_subpackage_resolves 145
method TestComponentFromSourcePath.test_out_of_tree_path_returns_none 151
method TestComponentFromSourcePath.test_bare_top_level_module_returns_none 154 A file directly under the marker with no package directory (e.g.
method TestComponentFromSourcePath.test_marker_with_nothing_after_returns_none 159
method TestComponentFromSourcePath.test_windows_style_separators_normalized 162
class TestPipelineKGMixin 169 Tests for PipelineKGMixin — knowledge graph helpers.
method TestPipelineKGMixin.test_import 172
method TestPipelineKGMixin.test_init_context_injector_method_exists 175
method TestPipelineKGMixin.test_get_graph_client_method_exists 178
method TestPipelineKGMixin.test_get_graph_client_returns_config_object 181 _get_graph_client returns object with _config.uri/username/password.
method TestPipelineKGMixin.test_init_context_injector 190 _init_context_injector creates ContextInjector (with or without the graph).
method TestPipelineKGMixin.test_try_create_relevance_retriever_with_real_prolog_and_neo4j 199 When Prolog and Neo4j are available, the mixin creates a real
method TestPipelineKGMixin.test_sync_to_graph_with_bad_dir 215 _sync_to_graph handles missing project_dir gracefully.
method TestPipelineKGMixin.test_sync_to_graph_missing_context_injector_is_non_fatal 223 _sync_to_graph never raises, even if a caller never wired up
method TestPipelineKGMixin.test_maybe_inject_context_no_injection 244 _maybe_inject_context returns packet unchanged for non-injection subjects.
method TestPipelineKGMixin.test_pre_task_sync_with_bad_dir 259 _pre_task_sync handles missing directory gracefully.
method TestPipelineKGMixin.test_pre_task_sync_permission_denied_is_non_fatal 267 A real PermissionError while hashing an unreadable file (not a
method TestPipelineKGMixin.test_pre_task_sync_permission_denied_is_also_logged 285 The same real failure must reach the logger too, not just
method TestPipelineKGMixin.test_pre_task_sync_env_default_preserves_todays_behaviour 306 No env override (the real production call site) falls through to
method TestPipelineKGMixin.test_pre_task_sync_env_one_preserves_todays_behaviour 317 An explicit '1' behaves exactly like the unset default.
method TestPipelineKGMixin.test_pre_task_sync_env_falsy_values_skip_sync 327 Every falsy spelling skips the sync outright and logs one
method TestPipelineKGMixin.test_pre_task_sync_env_read_at_call_time_not_cached 341 The same host, called twice with different env dicts, obeys each
method TestPipelineKGMixin.test_sync_volks_to_kg_no_driver_returns_zero 361 Without a live graph driver the sync is a no-op (best-effort).
method TestPipelineKGMixin.test_sync_volks_to_kg_no_status_report_returns_zero 367 A host that doesn't expose status_report yields 0, not an error.
method TestPipelineKGMixin.test_sync_volks_to_kg_status_report_raises_returns_zero 374 A failing roster read is auxiliary — never breaks the caller.
method TestPipelineKGMixin.test_sync_volks_to_kg_no_aliased_rows_returns_zero 382 Rows without a truthy alias are filtered out; nothing to sync.
method TestPipelineKGMixin.test_sync_volks_to_kg_write_failure_is_non_fatal 390 A genuine graph outage during the MERGE write returns 0, not raise.
method TestPipelineKGMixin.test_sync_artifacts_to_kg_no_driver_returns_zero 403
method TestPipelineKGMixin.test_sync_artifacts_to_kg_default_store_missing_returns_zero 408 artifacts=None with no self.artifacts store falls back to [].
method TestPipelineKGMixin.test_sync_artifacts_to_kg_from_default_store_write_failure_is_non_fatal 417 artifacts=None pulls from self.artifacts.all() (ArtifactStore);
method TestPipelineKGMixin.test_sync_artifacts_to_kg_success_writes_provenance_edge 436 A known volk alias gets a real (:Artifact)-[:GENERATED_BY]->(:Volk)
method TestPipelineKGMixin.test_sync_artifacts_to_kg_anchors_non_volk_stage_to_thread_hub 491 Session-254 root-connectivity ruling: an Artifact whose stage
method TestPipelineKGMixin.test_sync_artifacts_to_kg_writes_ownership_for_source_tree_path 545 An artifact whose file_path resolves under the project's own
method TestPipelineKGMixin.test_sync_artifacts_to_kg_skips_ownership_for_out_of_tree_path 611 A file_path outside the project's source tree never fabricates
method TestPipelineKGMixin.test_sync_components_to_kg_no_driver_returns_zero 665 Without a live graph driver the sync is a no-op (best-effort).
method TestPipelineKGMixin.test_sync_components_to_kg_no_project_id_returns_zero 671 No resolved project (neither _project_id nor _project_dir)
method TestPipelineKGMixin.test_sync_components_to_kg_write_failure_is_non_fatal 682 A genuine graph outage during the Component MERGE returns 0.
method TestPipelineKGMixin.test_sync_components_to_kg_creates_component_and_part_of 691 Component nodes are derived from existing depth-0 Package nodes
method TestPipelineKGMixin.test_sync_intent_to_kg_no_driver_returns_false 746
method TestPipelineKGMixin.test_sync_intent_to_kg_empty_thread_id_returns_false 751
method TestPipelineKGMixin.test_sync_intent_to_kg_write_failure_returns_false 758
method TestPipelineKGMixin.test_sync_intent_to_kg_success_creates_intent_and_run 765 Successful sync MERGEs both nodes and the TRIGGERED edge between
method TestPipelineKGMixin.test_sync_intent_to_kg_anchors_intent_and_run_to_thread_hub 807 Session-254 root-connectivity ruling: both nodes must be
method TestPipelineKGMixin.test_sync_decisions_to_kg_no_driver_returns_zero 861 Without a live graph driver the sync is a no-op (best-effort).
method TestPipelineKGMixin.test_sync_decisions_to_kg_write_failure_is_non_fatal 868 A genuine graph outage during the Decision MERGE returns 0.
method TestPipelineKGMixin.test_sync_decisions_to_kg_skips_blank_rationale_and_returns_zero 883 A decision list where every entry has a blank/whitespace
method TestPipelineKGMixin.test_init_context_injector_honours_explicit_project_id 893 ORCHESTRATA_PROJECT_ID must win over the checkout basename.
method TestPipelineKGMixin.test_init_context_injector_falls_back_to_basename_without_override 920 An unset override must leave resolution exactly as it was.
method TestPipelineKGMixin.test_sync_decisions_to_kg_scopes_applies_to_by_project 936 A Decision must not attach to another project's same-named file.
method TestPipelineKGMixin.test_sync_decisions_to_kg_emits_runtime_signal 1009 A wired _runtime_writer also gets a Tier-H decision signal
method TestPipelineKGMixin.test_pipeline_kg_writes_conform_to_canonical_schema 1041 Runtime/provenance writes use canonical labels/keys and keep the
method TestPipelineKGMixin.test_init_context_injector_creates_context_assembler 1148 Production wiring creates a UnifiedContextAssembler alongside the injector.
method TestPipelineKGMixin.test_assemble_context_for_subject_builds_graph_context 1157 _assemble_context_for_subject folds assembler parts into payload.
method TestPipelineKGMixin.test_assemble_context_for_subject_empty_parts_skip_graph_context 1183 When every assembler part is empty, payload is returned unchanged.
method TestPipelineKGMixin.test_inject_for_subject_prefers_assembler_path 1197 inject_for_subject calls the assembler and writes graph_context.
method TestPipelineKGMixin.test_inject_for_subject_pre_task_syncs_existing_project_dir 1220 When the payload's project_dir exists on disk,
method TestPipelineKGMixin.test_inject_for_subject_falls_back_when_assembler_raises 1233 A broken assembler does not crash injection; the except
method TestPipelineKGMixin.test_session_context_data_returns_none_without_controller 1261 Hosts with no session controller degrade to no session context.
method TestPipelineKGMixin.test_session_context_data_returns_none_when_read_raises 1266 An un-initialized controller's ctx.read() raises — the
method TestPipelineKGMixin.test_session_context_data_reads_from_orchestrator_controller 1276 _session_ctrl style controllers load ContextData for the assembler.
method TestPipelineKGMixin.test_session_context_data_reads_from_kernel_controller 1286 Kernel-style self.session controllers also load ContextData.
method TestPipelineKGMixin.test_assemble_context_for_subject_includes_mission_with_session 1296 When a session controller is wired, the mission layer is rendered.
method TestPipelineKGMixin.test_kg_available_now_throttle_holds_before_interval_elapses 1316 A host that was dialed recently (interval not yet elapsed) is not
method TestPipelineKGMixin.test_kg_available_now_redial_recovers_after_interval_elapses 1327 backlog #219: a host previously dialed and left disabled
method TestPipelineKGMixin.test_sync_volks_to_kg_recovers_via_redial 1340 A real use-site (sync_volks_to_kg) recovers a previously-down
method TestPipelineKGMixin.test_write_context_injection_event_writes_real_node 1367 _write_context_injection_event (used by inject_for_subject)
method TestPipelineKGMixin.test_write_context_injection_event_noop_without_files 1401 No files_created in the payload -> no GatewayEvent written.
method TestPipelineKGMixin.test_write_message_signal_writes_real_node 1419
method TestPipelineKGMixin.test_write_message_signal_truncates_long_summary 1455 A text longer than 200 chars is truncated with an ellipsis
method TestPipelineKGMixin.test_write_tool_call_signal_writes_real_node 1490
method TestPipelineKGMixin.test_write_message_signal_noop_without_runtime_writer 1527 No _runtime_writer set at all -> no-op, no raise.
method TestPipelineKGMixin.test_write_context_injection_event_noop_without_runtime_writer 1533 No _runtime_writer set at all -> no-op, no raise.
method TestPipelineKGMixin.test_write_tool_call_signal_noop_without_runtime_writer 1541 No _runtime_writer set at all -> no-op, no raise.