Orchestrata Ultimate › Tests › Reference › kernel › test_pipeline_session

Tests reference — tests/kernel/test_pipeline_session.py

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

Prose pending.

tests/kernel/test_pipeline_session.py

source · 59 tests · 1161 lines

Covers: core.base.traces, kernel.audit.logger, kernel.audit.model, kernel.audit_bootstrap, kernel.pipeline, kernel.pipeline_artifacts, kernel.pipeline_checkpoint, kernel.pipeline_events, kernel.pipeline_kg, kernel.pipeline_session, core.packet/ (package), session.controller/ (package)

Kind Name Line Description
class TestPipelineSessionMixin 171 Tests for PipelineSessionMixin — session lifecycle helpers.
method TestPipelineSessionMixin.test_import 174
method TestPipelineSessionMixin.test_init_session_manager_method_exists 177
method TestPipelineSessionMixin.test_session_log_transition_method_exists 180
method TestPipelineSessionMixin.test_init_session_manager_no_root_skips_and_creates_no_dir 183 _init_session_manager with no injected sessions root leaves
method TestPipelineSessionMixin.test_init_session_manager_injected_root_used 214 _init_session_manager with an injected root under tmp_path uses
method TestPipelineSessionMixin.test_init_session_manager_disabled_via_env 231 ORCHESTRATA_KERNEL_SESSION_DISABLED short-circuits init: session
method TestPipelineSessionMixin.test_session_log_no_session 246 _session_log is a no-op when session is None.
method TestPipelineSessionMixin.test_session_log_transition_no_session 251 _session_log_transition is a no-op when session is None.
method TestPipelineSessionMixin.test_human_handler_appends_to_inbox 263 _human_handler appends packet to human_inbox.
method TestPipelineSessionMixin.test_human_handler_qa_complete 278 _human_handler emits complete event on qa_complete.
method TestPipelineSessionMixin.test_shutdown_no_session 291 shutdown emits complete event even without session.
class TestSessionLog 299 _session_log — real session logging + the dict->list[str] conversion.
method TestSessionLog.test_flattens_dict_details_for_the_real_controller 302 Regression test for a real bug: log_work's details is typed
method TestSessionLog.test_no_details_passes_none_through 320 No details dict -> log_work is called with details=None.
method TestSessionLog.test_idle_session_is_a_real_noop 331 A real session with no active record just returns (no raise).
method TestSessionLog.test_swallows_exception_from_a_broken_session 340 self.session is any object; if it lacks the expected interface
class TestEndSessionOnQA 355 _end_session_on_qa — real session end-to-end + exception swallowing.
method TestEndSessionOnQA.test_ends_a_real_session_with_artifacts_recorded 358
method TestEndSessionOnQA.test_swallows_exceptions_from_a_broken_session 380 Both the per-file log_artifact loop and the final end() call must
class TestSessionLifecycleAuditWiring 405 SPEC-001 US-008 REQ-008-004: session-lifecycle audit trail added to
method TestSessionLifecycleAuditWiring.test_end_session_on_qa_fires_session_end_audit 431
method TestSessionLifecycleAuditWiring.test_end_session_on_qa_with_audit_none_is_unaffected 464 audit=None (the suite-wide default) must leave the session-end
class TestSessionLogTransition 482 _session_log_transition — per-subject session recording.
method TestSessionLogTransition.test_design_feedback_logs_a_choice 485
method TestSessionLogTransition.test_implementation_complete_logs_each_artifact 502
method TestSessionLogTransition.test_fix_issues_logs_a_choice_with_issue_count 518
method TestSessionLogTransition.test_swallows_exception_from_a_broken_session 535
class TestCollectArtifacts 554 _collect_artifacts — payload -> ArtifactStore + checkpoint + KG sync.
method TestCollectArtifacts.test_noop_when_no_artifact_store_is_wired_up 557
method TestCollectArtifacts.test_noop_for_an_unmapped_subject 568
method TestCollectArtifacts.test_noop_when_payload_is_not_a_dict 582
method TestCollectArtifacts.test_records_string_and_non_string_values_then_checkpoints 596 Empty values are skipped, string values pass through as-is,
method TestCollectArtifacts.test_defaults_stage_to_unknown_when_from_agent_is_empty 628
method TestCollectArtifacts.test_swallows_a_raising_kg_sync_hook 648 The real sync_*_to_kg hooks (PipelineKGMixin) never raise — they
method TestCollectArtifacts.test_swallows_an_unexpected_error_building_artifact_content 679 A circular-referencing value can't be json.dumps-encoded even with
class TestCollectDecisions 701 _collect_decisions — decisions payload -> sync_decisions_to_kg hook.
method TestCollectDecisions.test_noop_without_decisions_in_the_payload 704
method TestCollectDecisions.test_noop_when_the_hook_is_not_wired_up 715
method TestCollectDecisions.test_calls_the_real_sync_hook_with_decisions 726
method TestCollectDecisions.test_swallows_a_raising_sync_hook 748
class TestCheckpointStage 770 _checkpoint_stage — persists stage output via PipelineCheckpoint.
method TestCheckpointStage.test_noop_without_a_checkpoint_wired_up 773
method TestCheckpointStage.test_saves_the_real_stage_output 784
method TestCheckpointStage.test_swallows_the_real_value_error_on_empty_thread_id 800 PipelineCheckpoint.save_stage genuinely raises ValueError when
class TestHumanHandlerCompliance 827 _human_handler dispatch to compliance finalisation.
method TestHumanHandlerCompliance.test_dispatches_compliance_complete_to_finalisation 830
class TestHandleComplianceComplete 847 _handle_compliance_complete — terminal pipeline outcome + session end.
method TestHandleComplianceComplete.test_pass_without_a_session_returns_after_emitting 850
method TestHandleComplianceComplete.test_fail_without_a_session_logs_with_report 862
method TestHandleComplianceComplete.test_fail_without_a_session_and_without_a_report 874
method TestHandleComplianceComplete.test_pass_with_a_real_session_ends_it 888
method TestHandleComplianceComplete.test_fail_with_a_real_session_logs_and_ends 904
method TestHandleComplianceComplete.test_swallows_exception_from_a_broken_session 920
class TestShutdown 936 shutdown — emits a failed pipeline.complete + ends the session.
method TestShutdown.test_ends_a_real_session 939
method TestShutdown.test_swallows_exception_from_a_broken_session 949
method TestShutdown.test_shutdown_ends_real_session 957 shutdown logs + ends an active session and prints confirmation.
method TestShutdown.test_handle_compliance_complete_ends_real_session 967 A compliance result with an active session ends it (success path).
method TestShutdown.test_collect_artifacts_non_dict_payload_is_ignored 983 A non-dict payload on a mapped subject is a real, harmless edge case.
method TestShutdown.test_collect_artifacts_syncs_to_kg 997 A mapped subject with real content syncs the new artifacts to the KG.
method TestShutdown.test_collect_artifacts_kg_sync_exception_is_swallowed 1011 sync_artifacts_to_kg raising must not break artifact capture (best-effort).
method TestShutdown.test_collect_artifacts_outer_exception_is_swallowed 1025 A real un-stringifiable artifact value is swallowed by the outer guard.
method TestShutdown.test_collect_decisions_sync_exception_is_swallowed 1038 sync_decisions_to_kg raising must not break decision capture.
method TestShutdown.test_checkpoint_stage_noop_without_checkpoint 1050 _checkpoint_stage is a no-op when the host has no checkpoint store.
method TestShutdown.test_checkpoint_stage_save_exception_is_swallowed 1062 A real empty thread_id makes PipelineCheckpoint.save_stage raise;
class TestAshutdown 1077 ashutdown — the async shutdown path that WAITS for audit writes.
method TestAshutdown.test_awaits_an_audit_write_still_in_flight 1090
method TestAshutdown.test_still_performs_the_synchronous_shutdown 1110 ashutdown is a superset of shutdown, not a replacement for
method TestAshutdown.test_returns_zero_when_no_audit_write_is_pending 1124
class TestPipelineRunnerBootForwardsEnvToSessionManager 1129 PipelineRunner.boot(env=...) reaches _init_session_manager (change D).
method TestPipelineRunnerBootForwardsEnvToSessionManager.test_boot_env_reaches_session_manager 1140