omnibase_infra 0.2.6__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- omnibase_infra/__init__.py +101 -0
- omnibase_infra/adapters/adapter_onex_tool_execution.py +451 -0
- omnibase_infra/capabilities/__init__.py +15 -0
- omnibase_infra/capabilities/capability_inference_rules.py +211 -0
- omnibase_infra/capabilities/contract_capability_extractor.py +221 -0
- omnibase_infra/capabilities/intent_type_extractor.py +160 -0
- omnibase_infra/cli/__init__.py +1 -0
- omnibase_infra/cli/commands.py +216 -0
- omnibase_infra/clients/__init__.py +0 -0
- omnibase_infra/configs/widget_mapping.yaml +176 -0
- omnibase_infra/constants_topic_patterns.py +26 -0
- omnibase_infra/contracts/handlers/filesystem/handler_contract.yaml +264 -0
- omnibase_infra/contracts/handlers/mcp/handler_contract.yaml +141 -0
- omnibase_infra/decorators/__init__.py +29 -0
- omnibase_infra/decorators/allow_any.py +109 -0
- omnibase_infra/dlq/__init__.py +90 -0
- omnibase_infra/dlq/constants_dlq.py +57 -0
- omnibase_infra/dlq/models/__init__.py +26 -0
- omnibase_infra/dlq/models/enum_replay_status.py +37 -0
- omnibase_infra/dlq/models/model_dlq_replay_record.py +135 -0
- omnibase_infra/dlq/models/model_dlq_tracking_config.py +184 -0
- omnibase_infra/dlq/service_dlq_tracking.py +611 -0
- omnibase_infra/enums/__init__.py +132 -0
- omnibase_infra/enums/enum_any_type_violation.py +104 -0
- omnibase_infra/enums/enum_backend_type.py +27 -0
- omnibase_infra/enums/enum_capture_outcome.py +42 -0
- omnibase_infra/enums/enum_capture_state.py +88 -0
- omnibase_infra/enums/enum_chain_violation_type.py +119 -0
- omnibase_infra/enums/enum_circuit_state.py +51 -0
- omnibase_infra/enums/enum_confirmation_event_type.py +27 -0
- omnibase_infra/enums/enum_consumer_group_purpose.py +92 -0
- omnibase_infra/enums/enum_contract_type.py +84 -0
- omnibase_infra/enums/enum_dedupe_strategy.py +46 -0
- omnibase_infra/enums/enum_dispatch_status.py +191 -0
- omnibase_infra/enums/enum_environment.py +46 -0
- omnibase_infra/enums/enum_execution_shape_violation.py +103 -0
- omnibase_infra/enums/enum_handler_error_type.py +111 -0
- omnibase_infra/enums/enum_handler_loader_error.py +178 -0
- omnibase_infra/enums/enum_handler_source_mode.py +86 -0
- omnibase_infra/enums/enum_handler_source_type.py +87 -0
- omnibase_infra/enums/enum_handler_type.py +77 -0
- omnibase_infra/enums/enum_handler_type_category.py +61 -0
- omnibase_infra/enums/enum_infra_transport_type.py +73 -0
- omnibase_infra/enums/enum_introspection_reason.py +154 -0
- omnibase_infra/enums/enum_kafka_acks.py +99 -0
- omnibase_infra/enums/enum_message_category.py +213 -0
- omnibase_infra/enums/enum_node_archetype.py +74 -0
- omnibase_infra/enums/enum_node_output_type.py +185 -0
- omnibase_infra/enums/enum_non_retryable_error_category.py +224 -0
- omnibase_infra/enums/enum_policy_type.py +32 -0
- omnibase_infra/enums/enum_registration_state.py +261 -0
- omnibase_infra/enums/enum_registration_status.py +33 -0
- omnibase_infra/enums/enum_registry_response_status.py +28 -0
- omnibase_infra/enums/enum_response_status.py +26 -0
- omnibase_infra/enums/enum_retry_error_category.py +98 -0
- omnibase_infra/enums/enum_security_rule_id.py +103 -0
- omnibase_infra/enums/enum_selection_strategy.py +91 -0
- omnibase_infra/enums/enum_topic_standard.py +42 -0
- omnibase_infra/enums/enum_validation_severity.py +78 -0
- omnibase_infra/errors/__init__.py +160 -0
- omnibase_infra/errors/error_architecture_violation.py +152 -0
- omnibase_infra/errors/error_binding_resolution.py +128 -0
- omnibase_infra/errors/error_chain_propagation.py +188 -0
- omnibase_infra/errors/error_compute_registry.py +95 -0
- omnibase_infra/errors/error_consul.py +132 -0
- omnibase_infra/errors/error_container_wiring.py +243 -0
- omnibase_infra/errors/error_event_bus_registry.py +105 -0
- omnibase_infra/errors/error_infra.py +610 -0
- omnibase_infra/errors/error_message_type_registry.py +101 -0
- omnibase_infra/errors/error_policy_registry.py +115 -0
- omnibase_infra/errors/error_vault.py +123 -0
- omnibase_infra/event_bus/__init__.py +72 -0
- omnibase_infra/event_bus/configs/kafka_event_bus_config.yaml +84 -0
- omnibase_infra/event_bus/event_bus_inmemory.py +797 -0
- omnibase_infra/event_bus/event_bus_kafka.py +1716 -0
- omnibase_infra/event_bus/mixin_kafka_broadcast.py +180 -0
- omnibase_infra/event_bus/mixin_kafka_dlq.py +771 -0
- omnibase_infra/event_bus/models/__init__.py +29 -0
- omnibase_infra/event_bus/models/config/__init__.py +20 -0
- omnibase_infra/event_bus/models/config/model_kafka_event_bus_config.py +693 -0
- omnibase_infra/event_bus/models/model_dlq_event.py +206 -0
- omnibase_infra/event_bus/models/model_dlq_metrics.py +304 -0
- omnibase_infra/event_bus/models/model_event_headers.py +115 -0
- omnibase_infra/event_bus/models/model_event_message.py +60 -0
- omnibase_infra/event_bus/testing/__init__.py +26 -0
- omnibase_infra/event_bus/testing/adapter_protocol_event_publisher_inmemory.py +418 -0
- omnibase_infra/event_bus/testing/model_publisher_metrics.py +64 -0
- omnibase_infra/event_bus/topic_constants.py +376 -0
- omnibase_infra/handlers/__init__.py +82 -0
- omnibase_infra/handlers/filesystem/__init__.py +48 -0
- omnibase_infra/handlers/filesystem/enum_file_system_operation.py +35 -0
- omnibase_infra/handlers/filesystem/model_file_system_request.py +298 -0
- omnibase_infra/handlers/filesystem/model_file_system_result.py +166 -0
- omnibase_infra/handlers/handler_consul.py +795 -0
- omnibase_infra/handlers/handler_db.py +1046 -0
- omnibase_infra/handlers/handler_filesystem.py +1478 -0
- omnibase_infra/handlers/handler_graph.py +2015 -0
- omnibase_infra/handlers/handler_http.py +926 -0
- omnibase_infra/handlers/handler_intent.py +387 -0
- omnibase_infra/handlers/handler_manifest_persistence.contract.yaml +184 -0
- omnibase_infra/handlers/handler_manifest_persistence.py +1539 -0
- omnibase_infra/handlers/handler_mcp.py +1430 -0
- omnibase_infra/handlers/handler_qdrant.py +1076 -0
- omnibase_infra/handlers/handler_vault.py +428 -0
- omnibase_infra/handlers/mcp/__init__.py +19 -0
- omnibase_infra/handlers/mcp/adapter_onex_to_mcp.py +446 -0
- omnibase_infra/handlers/mcp/protocols.py +178 -0
- omnibase_infra/handlers/mcp/transport_streamable_http.py +352 -0
- omnibase_infra/handlers/mixins/__init__.py +47 -0
- omnibase_infra/handlers/mixins/mixin_consul_initialization.py +349 -0
- omnibase_infra/handlers/mixins/mixin_consul_kv.py +338 -0
- omnibase_infra/handlers/mixins/mixin_consul_service.py +542 -0
- omnibase_infra/handlers/mixins/mixin_consul_topic_index.py +585 -0
- omnibase_infra/handlers/mixins/mixin_vault_initialization.py +338 -0
- omnibase_infra/handlers/mixins/mixin_vault_retry.py +412 -0
- omnibase_infra/handlers/mixins/mixin_vault_secrets.py +450 -0
- omnibase_infra/handlers/mixins/mixin_vault_token.py +365 -0
- omnibase_infra/handlers/models/__init__.py +286 -0
- omnibase_infra/handlers/models/consul/__init__.py +81 -0
- omnibase_infra/handlers/models/consul/enum_consul_operation_type.py +57 -0
- omnibase_infra/handlers/models/consul/model_consul_deregister_payload.py +51 -0
- omnibase_infra/handlers/models/consul/model_consul_handler_config.py +153 -0
- omnibase_infra/handlers/models/consul/model_consul_handler_payload.py +89 -0
- omnibase_infra/handlers/models/consul/model_consul_kv_get_found_payload.py +55 -0
- omnibase_infra/handlers/models/consul/model_consul_kv_get_not_found_payload.py +49 -0
- omnibase_infra/handlers/models/consul/model_consul_kv_get_recurse_payload.py +50 -0
- omnibase_infra/handlers/models/consul/model_consul_kv_item.py +33 -0
- omnibase_infra/handlers/models/consul/model_consul_kv_put_payload.py +41 -0
- omnibase_infra/handlers/models/consul/model_consul_register_payload.py +53 -0
- omnibase_infra/handlers/models/consul/model_consul_retry_config.py +66 -0
- omnibase_infra/handlers/models/consul/model_payload_consul.py +66 -0
- omnibase_infra/handlers/models/consul/registry_payload_consul.py +214 -0
- omnibase_infra/handlers/models/graph/__init__.py +35 -0
- omnibase_infra/handlers/models/graph/enum_graph_operation_type.py +20 -0
- omnibase_infra/handlers/models/graph/model_graph_execute_payload.py +38 -0
- omnibase_infra/handlers/models/graph/model_graph_handler_config.py +54 -0
- omnibase_infra/handlers/models/graph/model_graph_handler_payload.py +44 -0
- omnibase_infra/handlers/models/graph/model_graph_query_payload.py +40 -0
- omnibase_infra/handlers/models/graph/model_graph_record.py +22 -0
- omnibase_infra/handlers/models/http/__init__.py +50 -0
- omnibase_infra/handlers/models/http/enum_http_operation_type.py +29 -0
- omnibase_infra/handlers/models/http/model_http_body_content.py +45 -0
- omnibase_infra/handlers/models/http/model_http_get_payload.py +88 -0
- omnibase_infra/handlers/models/http/model_http_handler_payload.py +90 -0
- omnibase_infra/handlers/models/http/model_http_post_payload.py +88 -0
- omnibase_infra/handlers/models/http/model_payload_http.py +66 -0
- omnibase_infra/handlers/models/http/registry_payload_http.py +212 -0
- omnibase_infra/handlers/models/mcp/__init__.py +23 -0
- omnibase_infra/handlers/models/mcp/enum_mcp_operation_type.py +24 -0
- omnibase_infra/handlers/models/mcp/model_mcp_handler_config.py +40 -0
- omnibase_infra/handlers/models/mcp/model_mcp_tool_call.py +32 -0
- omnibase_infra/handlers/models/mcp/model_mcp_tool_result.py +45 -0
- omnibase_infra/handlers/models/model_consul_handler_response.py +96 -0
- omnibase_infra/handlers/models/model_db_describe_response.py +83 -0
- omnibase_infra/handlers/models/model_db_query_payload.py +95 -0
- omnibase_infra/handlers/models/model_db_query_response.py +60 -0
- omnibase_infra/handlers/models/model_filesystem_config.py +98 -0
- omnibase_infra/handlers/models/model_filesystem_delete_payload.py +54 -0
- omnibase_infra/handlers/models/model_filesystem_delete_result.py +77 -0
- omnibase_infra/handlers/models/model_filesystem_directory_entry.py +75 -0
- omnibase_infra/handlers/models/model_filesystem_ensure_directory_payload.py +54 -0
- omnibase_infra/handlers/models/model_filesystem_ensure_directory_result.py +60 -0
- omnibase_infra/handlers/models/model_filesystem_list_directory_payload.py +60 -0
- omnibase_infra/handlers/models/model_filesystem_list_directory_result.py +68 -0
- omnibase_infra/handlers/models/model_filesystem_read_payload.py +62 -0
- omnibase_infra/handlers/models/model_filesystem_read_result.py +61 -0
- omnibase_infra/handlers/models/model_filesystem_write_payload.py +70 -0
- omnibase_infra/handlers/models/model_filesystem_write_result.py +55 -0
- omnibase_infra/handlers/models/model_graph_handler_response.py +98 -0
- omnibase_infra/handlers/models/model_handler_response.py +103 -0
- omnibase_infra/handlers/models/model_http_handler_response.py +101 -0
- omnibase_infra/handlers/models/model_manifest_metadata.py +75 -0
- omnibase_infra/handlers/models/model_manifest_persistence_config.py +62 -0
- omnibase_infra/handlers/models/model_manifest_query_payload.py +90 -0
- omnibase_infra/handlers/models/model_manifest_query_result.py +97 -0
- omnibase_infra/handlers/models/model_manifest_retrieve_payload.py +44 -0
- omnibase_infra/handlers/models/model_manifest_retrieve_result.py +98 -0
- omnibase_infra/handlers/models/model_manifest_store_payload.py +47 -0
- omnibase_infra/handlers/models/model_manifest_store_result.py +67 -0
- omnibase_infra/handlers/models/model_operation_context.py +187 -0
- omnibase_infra/handlers/models/model_qdrant_handler_response.py +98 -0
- omnibase_infra/handlers/models/model_retry_state.py +162 -0
- omnibase_infra/handlers/models/model_vault_handler_response.py +98 -0
- omnibase_infra/handlers/models/qdrant/__init__.py +44 -0
- omnibase_infra/handlers/models/qdrant/enum_qdrant_operation_type.py +26 -0
- omnibase_infra/handlers/models/qdrant/model_qdrant_collection_payload.py +42 -0
- omnibase_infra/handlers/models/qdrant/model_qdrant_delete_payload.py +36 -0
- omnibase_infra/handlers/models/qdrant/model_qdrant_handler_config.py +42 -0
- omnibase_infra/handlers/models/qdrant/model_qdrant_handler_payload.py +54 -0
- omnibase_infra/handlers/models/qdrant/model_qdrant_search_payload.py +42 -0
- omnibase_infra/handlers/models/qdrant/model_qdrant_search_result.py +30 -0
- omnibase_infra/handlers/models/qdrant/model_qdrant_upsert_payload.py +36 -0
- omnibase_infra/handlers/models/vault/__init__.py +69 -0
- omnibase_infra/handlers/models/vault/enum_vault_operation_type.py +35 -0
- omnibase_infra/handlers/models/vault/model_payload_vault.py +66 -0
- omnibase_infra/handlers/models/vault/model_vault_delete_payload.py +57 -0
- omnibase_infra/handlers/models/vault/model_vault_handler_config.py +148 -0
- omnibase_infra/handlers/models/vault/model_vault_handler_payload.py +101 -0
- omnibase_infra/handlers/models/vault/model_vault_list_payload.py +58 -0
- omnibase_infra/handlers/models/vault/model_vault_renew_token_payload.py +67 -0
- omnibase_infra/handlers/models/vault/model_vault_retry_config.py +66 -0
- omnibase_infra/handlers/models/vault/model_vault_secret_payload.py +106 -0
- omnibase_infra/handlers/models/vault/model_vault_write_payload.py +66 -0
- omnibase_infra/handlers/models/vault/registry_payload_vault.py +213 -0
- omnibase_infra/handlers/registration_storage/__init__.py +43 -0
- omnibase_infra/handlers/registration_storage/handler_registration_storage_mock.py +392 -0
- omnibase_infra/handlers/registration_storage/handler_registration_storage_postgres.py +922 -0
- omnibase_infra/handlers/registration_storage/models/__init__.py +23 -0
- omnibase_infra/handlers/registration_storage/models/model_delete_registration_request.py +58 -0
- omnibase_infra/handlers/registration_storage/models/model_update_registration_request.py +73 -0
- omnibase_infra/handlers/registration_storage/protocol_registration_persistence.py +191 -0
- omnibase_infra/handlers/service_discovery/__init__.py +43 -0
- omnibase_infra/handlers/service_discovery/handler_service_discovery_consul.py +1051 -0
- omnibase_infra/handlers/service_discovery/handler_service_discovery_mock.py +258 -0
- omnibase_infra/handlers/service_discovery/models/__init__.py +22 -0
- omnibase_infra/handlers/service_discovery/models/model_discovery_result.py +64 -0
- omnibase_infra/handlers/service_discovery/models/model_registration_result.py +138 -0
- omnibase_infra/handlers/service_discovery/models/model_service_info.py +109 -0
- omnibase_infra/handlers/service_discovery/protocol_discovery_operations.py +170 -0
- omnibase_infra/idempotency/__init__.py +94 -0
- omnibase_infra/idempotency/models/__init__.py +43 -0
- omnibase_infra/idempotency/models/model_idempotency_check_result.py +85 -0
- omnibase_infra/idempotency/models/model_idempotency_guard_config.py +130 -0
- omnibase_infra/idempotency/models/model_idempotency_record.py +86 -0
- omnibase_infra/idempotency/models/model_idempotency_store_health_check_result.py +81 -0
- omnibase_infra/idempotency/models/model_idempotency_store_metrics.py +140 -0
- omnibase_infra/idempotency/models/model_postgres_idempotency_store_config.py +299 -0
- omnibase_infra/idempotency/protocol_idempotency_store.py +184 -0
- omnibase_infra/idempotency/store_inmemory.py +265 -0
- omnibase_infra/idempotency/store_postgres.py +923 -0
- omnibase_infra/infrastructure/__init__.py +0 -0
- omnibase_infra/migrations/001_create_event_ledger.sql +166 -0
- omnibase_infra/migrations/001_drop_event_ledger.sql +18 -0
- omnibase_infra/mixins/__init__.py +71 -0
- omnibase_infra/mixins/mixin_async_circuit_breaker.py +656 -0
- omnibase_infra/mixins/mixin_dict_like_accessors.py +146 -0
- omnibase_infra/mixins/mixin_envelope_extraction.py +119 -0
- omnibase_infra/mixins/mixin_node_introspection.py +2670 -0
- omnibase_infra/mixins/mixin_retry_execution.py +386 -0
- omnibase_infra/mixins/protocol_circuit_breaker_aware.py +133 -0
- omnibase_infra/models/__init__.py +144 -0
- omnibase_infra/models/bindings/__init__.py +59 -0
- omnibase_infra/models/bindings/constants.py +144 -0
- omnibase_infra/models/bindings/model_binding_resolution_result.py +103 -0
- omnibase_infra/models/bindings/model_operation_binding.py +44 -0
- omnibase_infra/models/bindings/model_operation_bindings_subcontract.py +152 -0
- omnibase_infra/models/bindings/model_parsed_binding.py +52 -0
- omnibase_infra/models/corpus/__init__.py +17 -0
- omnibase_infra/models/corpus/model_capture_config.py +133 -0
- omnibase_infra/models/corpus/model_capture_result.py +86 -0
- omnibase_infra/models/discovery/__init__.py +42 -0
- omnibase_infra/models/discovery/model_dependency_spec.py +319 -0
- omnibase_infra/models/discovery/model_discovered_capabilities.py +50 -0
- omnibase_infra/models/discovery/model_introspection_config.py +330 -0
- omnibase_infra/models/discovery/model_introspection_performance_metrics.py +169 -0
- omnibase_infra/models/discovery/model_introspection_task_config.py +116 -0
- omnibase_infra/models/dispatch/__init__.py +155 -0
- omnibase_infra/models/dispatch/model_debug_trace_snapshot.py +114 -0
- omnibase_infra/models/dispatch/model_dispatch_context.py +439 -0
- omnibase_infra/models/dispatch/model_dispatch_error.py +336 -0
- omnibase_infra/models/dispatch/model_dispatch_log_context.py +400 -0
- omnibase_infra/models/dispatch/model_dispatch_metadata.py +228 -0
- omnibase_infra/models/dispatch/model_dispatch_metrics.py +496 -0
- omnibase_infra/models/dispatch/model_dispatch_outcome.py +317 -0
- omnibase_infra/models/dispatch/model_dispatch_outputs.py +231 -0
- omnibase_infra/models/dispatch/model_dispatch_result.py +436 -0
- omnibase_infra/models/dispatch/model_dispatch_route.py +279 -0
- omnibase_infra/models/dispatch/model_dispatcher_metrics.py +275 -0
- omnibase_infra/models/dispatch/model_dispatcher_registration.py +352 -0
- omnibase_infra/models/dispatch/model_materialized_dispatch.py +141 -0
- omnibase_infra/models/dispatch/model_parsed_topic.py +135 -0
- omnibase_infra/models/dispatch/model_topic_parser.py +725 -0
- omnibase_infra/models/dispatch/model_tracing_context.py +285 -0
- omnibase_infra/models/errors/__init__.py +45 -0
- omnibase_infra/models/errors/model_handler_validation_error.py +594 -0
- omnibase_infra/models/errors/model_infra_error_context.py +99 -0
- omnibase_infra/models/errors/model_message_type_registry_error_context.py +71 -0
- omnibase_infra/models/errors/model_timeout_error_context.py +110 -0
- omnibase_infra/models/handlers/__init__.py +80 -0
- omnibase_infra/models/handlers/model_bootstrap_handler_descriptor.py +162 -0
- omnibase_infra/models/handlers/model_contract_discovery_result.py +82 -0
- omnibase_infra/models/handlers/model_handler_descriptor.py +200 -0
- omnibase_infra/models/handlers/model_handler_identifier.py +215 -0
- omnibase_infra/models/handlers/model_handler_source_config.py +220 -0
- omnibase_infra/models/health/__init__.py +9 -0
- omnibase_infra/models/health/model_health_check_result.py +40 -0
- omnibase_infra/models/lifecycle/__init__.py +39 -0
- omnibase_infra/models/logging/__init__.py +51 -0
- omnibase_infra/models/logging/model_log_context.py +756 -0
- omnibase_infra/models/mcp/__init__.py +15 -0
- omnibase_infra/models/mcp/model_mcp_contract_config.py +80 -0
- omnibase_infra/models/mcp/model_mcp_server_config.py +67 -0
- omnibase_infra/models/mcp/model_mcp_tool_definition.py +73 -0
- omnibase_infra/models/mcp/model_mcp_tool_parameter.py +35 -0
- omnibase_infra/models/model_node_identity.py +126 -0
- omnibase_infra/models/model_retry_error_classification.py +78 -0
- omnibase_infra/models/projection/__init__.py +43 -0
- omnibase_infra/models/projection/model_capability_fields.py +112 -0
- omnibase_infra/models/projection/model_registration_projection.py +434 -0
- omnibase_infra/models/projection/model_registration_snapshot.py +322 -0
- omnibase_infra/models/projection/model_sequence_info.py +182 -0
- omnibase_infra/models/projection/model_snapshot_topic_config.py +591 -0
- omnibase_infra/models/projectors/__init__.py +41 -0
- omnibase_infra/models/projectors/model_projector_column.py +289 -0
- omnibase_infra/models/projectors/model_projector_discovery_result.py +65 -0
- omnibase_infra/models/projectors/model_projector_index.py +270 -0
- omnibase_infra/models/projectors/model_projector_schema.py +415 -0
- omnibase_infra/models/projectors/model_projector_validation_error.py +63 -0
- omnibase_infra/models/projectors/util_sql_identifiers.py +115 -0
- omnibase_infra/models/registration/__init__.py +68 -0
- omnibase_infra/models/registration/commands/__init__.py +15 -0
- omnibase_infra/models/registration/commands/model_node_registration_acked.py +108 -0
- omnibase_infra/models/registration/events/__init__.py +56 -0
- omnibase_infra/models/registration/events/model_node_became_active.py +103 -0
- omnibase_infra/models/registration/events/model_node_liveness_expired.py +103 -0
- omnibase_infra/models/registration/events/model_node_registration_accepted.py +98 -0
- omnibase_infra/models/registration/events/model_node_registration_ack_received.py +98 -0
- omnibase_infra/models/registration/events/model_node_registration_ack_timed_out.py +112 -0
- omnibase_infra/models/registration/events/model_node_registration_initiated.py +107 -0
- omnibase_infra/models/registration/events/model_node_registration_rejected.py +104 -0
- omnibase_infra/models/registration/model_event_bus_topic_entry.py +59 -0
- omnibase_infra/models/registration/model_introspection_metrics.py +253 -0
- omnibase_infra/models/registration/model_node_capabilities.py +190 -0
- omnibase_infra/models/registration/model_node_event_bus_config.py +99 -0
- omnibase_infra/models/registration/model_node_heartbeat_event.py +126 -0
- omnibase_infra/models/registration/model_node_introspection_event.py +195 -0
- omnibase_infra/models/registration/model_node_metadata.py +79 -0
- omnibase_infra/models/registration/model_node_registration.py +162 -0
- omnibase_infra/models/registration/model_node_registration_record.py +162 -0
- omnibase_infra/models/registry/__init__.py +29 -0
- omnibase_infra/models/registry/model_domain_constraint.py +202 -0
- omnibase_infra/models/registry/model_message_type_entry.py +271 -0
- omnibase_infra/models/resilience/__init__.py +9 -0
- omnibase_infra/models/resilience/model_circuit_breaker_config.py +227 -0
- omnibase_infra/models/routing/__init__.py +25 -0
- omnibase_infra/models/routing/model_routing_entry.py +52 -0
- omnibase_infra/models/routing/model_routing_subcontract.py +70 -0
- omnibase_infra/models/runtime/__init__.py +49 -0
- omnibase_infra/models/runtime/model_contract_security_config.py +41 -0
- omnibase_infra/models/runtime/model_discovery_error.py +81 -0
- omnibase_infra/models/runtime/model_discovery_result.py +162 -0
- omnibase_infra/models/runtime/model_discovery_warning.py +74 -0
- omnibase_infra/models/runtime/model_failed_plugin_load.py +63 -0
- omnibase_infra/models/runtime/model_handler_contract.py +296 -0
- omnibase_infra/models/runtime/model_loaded_handler.py +129 -0
- omnibase_infra/models/runtime/model_plugin_load_context.py +93 -0
- omnibase_infra/models/runtime/model_plugin_load_summary.py +124 -0
- omnibase_infra/models/security/__init__.py +50 -0
- omnibase_infra/models/security/classification_levels.py +99 -0
- omnibase_infra/models/security/model_environment_policy.py +145 -0
- omnibase_infra/models/security/model_handler_security_policy.py +107 -0
- omnibase_infra/models/security/model_security_error.py +81 -0
- omnibase_infra/models/security/model_security_validation_result.py +328 -0
- omnibase_infra/models/security/model_security_warning.py +67 -0
- omnibase_infra/models/snapshot/__init__.py +27 -0
- omnibase_infra/models/snapshot/model_field_change.py +65 -0
- omnibase_infra/models/snapshot/model_snapshot.py +270 -0
- omnibase_infra/models/snapshot/model_snapshot_diff.py +203 -0
- omnibase_infra/models/snapshot/model_subject_ref.py +81 -0
- omnibase_infra/models/types/__init__.py +71 -0
- omnibase_infra/models/validation/__init__.py +89 -0
- omnibase_infra/models/validation/model_any_type_validation_result.py +118 -0
- omnibase_infra/models/validation/model_any_type_violation.py +141 -0
- omnibase_infra/models/validation/model_category_match_result.py +345 -0
- omnibase_infra/models/validation/model_chain_violation.py +166 -0
- omnibase_infra/models/validation/model_coverage_metrics.py +316 -0
- omnibase_infra/models/validation/model_execution_shape_rule.py +159 -0
- omnibase_infra/models/validation/model_execution_shape_validation.py +208 -0
- omnibase_infra/models/validation/model_execution_shape_validation_result.py +294 -0
- omnibase_infra/models/validation/model_execution_shape_violation.py +122 -0
- omnibase_infra/models/validation/model_localhandler_validation_result.py +139 -0
- omnibase_infra/models/validation/model_localhandler_violation.py +100 -0
- omnibase_infra/models/validation/model_output_validation_params.py +74 -0
- omnibase_infra/models/validation/model_validate_and_raise_params.py +84 -0
- omnibase_infra/models/validation/model_validation_error_params.py +84 -0
- omnibase_infra/models/validation/model_validation_outcome.py +287 -0
- omnibase_infra/nodes/__init__.py +57 -0
- omnibase_infra/nodes/architecture_validator/__init__.py +79 -0
- omnibase_infra/nodes/architecture_validator/contract.yaml +252 -0
- omnibase_infra/nodes/architecture_validator/contract_architecture_validator.yaml +203 -0
- omnibase_infra/nodes/architecture_validator/mixins/__init__.py +16 -0
- omnibase_infra/nodes/architecture_validator/mixins/mixin_file_path_rule.py +92 -0
- omnibase_infra/nodes/architecture_validator/models/__init__.py +36 -0
- omnibase_infra/nodes/architecture_validator/models/model_architecture_validation_request.py +56 -0
- omnibase_infra/nodes/architecture_validator/models/model_architecture_validation_result.py +311 -0
- omnibase_infra/nodes/architecture_validator/models/model_architecture_violation.py +163 -0
- omnibase_infra/nodes/architecture_validator/models/model_rule_check_result.py +265 -0
- omnibase_infra/nodes/architecture_validator/models/model_validation_request.py +105 -0
- omnibase_infra/nodes/architecture_validator/models/model_validation_result.py +314 -0
- omnibase_infra/nodes/architecture_validator/node.py +262 -0
- omnibase_infra/nodes/architecture_validator/node_architecture_validator.py +383 -0
- omnibase_infra/nodes/architecture_validator/protocols/__init__.py +9 -0
- omnibase_infra/nodes/architecture_validator/protocols/protocol_architecture_rule.py +225 -0
- omnibase_infra/nodes/architecture_validator/registry/__init__.py +28 -0
- omnibase_infra/nodes/architecture_validator/registry/registry_infra_architecture_validator.py +106 -0
- omnibase_infra/nodes/architecture_validator/validators/__init__.py +104 -0
- omnibase_infra/nodes/architecture_validator/validators/validator_no_direct_dispatch.py +422 -0
- omnibase_infra/nodes/architecture_validator/validators/validator_no_handler_publishing.py +481 -0
- omnibase_infra/nodes/architecture_validator/validators/validator_no_orchestrator_fsm.py +491 -0
- omnibase_infra/nodes/contract_registry_reducer/__init__.py +29 -0
- omnibase_infra/nodes/contract_registry_reducer/contract.yaml +255 -0
- omnibase_infra/nodes/contract_registry_reducer/models/__init__.py +38 -0
- omnibase_infra/nodes/contract_registry_reducer/models/model_contract_registry_state.py +266 -0
- omnibase_infra/nodes/contract_registry_reducer/models/model_payload_cleanup_topic_references.py +55 -0
- omnibase_infra/nodes/contract_registry_reducer/models/model_payload_deactivate_contract.py +58 -0
- omnibase_infra/nodes/contract_registry_reducer/models/model_payload_mark_stale.py +49 -0
- omnibase_infra/nodes/contract_registry_reducer/models/model_payload_update_heartbeat.py +71 -0
- omnibase_infra/nodes/contract_registry_reducer/models/model_payload_update_topic.py +66 -0
- omnibase_infra/nodes/contract_registry_reducer/models/model_payload_upsert_contract.py +92 -0
- omnibase_infra/nodes/contract_registry_reducer/node.py +121 -0
- omnibase_infra/nodes/contract_registry_reducer/reducer.py +784 -0
- omnibase_infra/nodes/contract_registry_reducer/registry/__init__.py +9 -0
- omnibase_infra/nodes/contract_registry_reducer/registry/registry_infra_contract_registry_reducer.py +101 -0
- omnibase_infra/nodes/effects/README.md +358 -0
- omnibase_infra/nodes/effects/__init__.py +26 -0
- omnibase_infra/nodes/effects/contract.yaml +167 -0
- omnibase_infra/nodes/effects/models/__init__.py +32 -0
- omnibase_infra/nodes/effects/models/model_backend_result.py +190 -0
- omnibase_infra/nodes/effects/models/model_effect_idempotency_config.py +92 -0
- omnibase_infra/nodes/effects/models/model_registry_request.py +132 -0
- omnibase_infra/nodes/effects/models/model_registry_response.py +263 -0
- omnibase_infra/nodes/effects/protocol_consul_client.py +89 -0
- omnibase_infra/nodes/effects/protocol_effect_idempotency_store.py +143 -0
- omnibase_infra/nodes/effects/protocol_postgres_adapter.py +96 -0
- omnibase_infra/nodes/effects/registry_effect.py +525 -0
- omnibase_infra/nodes/effects/store_effect_idempotency_inmemory.py +425 -0
- omnibase_infra/nodes/handlers/consul/contract.yaml +85 -0
- omnibase_infra/nodes/handlers/db/contract.yaml +72 -0
- omnibase_infra/nodes/handlers/graph/contract.yaml +127 -0
- omnibase_infra/nodes/handlers/http/contract.yaml +74 -0
- omnibase_infra/nodes/handlers/intent/contract.yaml +66 -0
- omnibase_infra/nodes/handlers/mcp/contract.yaml +69 -0
- omnibase_infra/nodes/handlers/vault/contract.yaml +91 -0
- omnibase_infra/nodes/node_intent_storage_effect/__init__.py +50 -0
- omnibase_infra/nodes/node_intent_storage_effect/contract.yaml +194 -0
- omnibase_infra/nodes/node_intent_storage_effect/models/__init__.py +24 -0
- omnibase_infra/nodes/node_intent_storage_effect/models/model_intent_storage_input.py +141 -0
- omnibase_infra/nodes/node_intent_storage_effect/models/model_intent_storage_output.py +130 -0
- omnibase_infra/nodes/node_intent_storage_effect/node.py +94 -0
- omnibase_infra/nodes/node_intent_storage_effect/registry/__init__.py +35 -0
- omnibase_infra/nodes/node_intent_storage_effect/registry/registry_infra_intent_storage.py +294 -0
- omnibase_infra/nodes/node_ledger_projection_compute/__init__.py +50 -0
- omnibase_infra/nodes/node_ledger_projection_compute/contract.yaml +104 -0
- omnibase_infra/nodes/node_ledger_projection_compute/node.py +284 -0
- omnibase_infra/nodes/node_ledger_projection_compute/registry/__init__.py +29 -0
- omnibase_infra/nodes/node_ledger_projection_compute/registry/registry_infra_ledger_projection.py +118 -0
- omnibase_infra/nodes/node_ledger_write_effect/__init__.py +82 -0
- omnibase_infra/nodes/node_ledger_write_effect/contract.yaml +200 -0
- omnibase_infra/nodes/node_ledger_write_effect/handlers/__init__.py +22 -0
- omnibase_infra/nodes/node_ledger_write_effect/handlers/handler_ledger_append.py +372 -0
- omnibase_infra/nodes/node_ledger_write_effect/handlers/handler_ledger_query.py +597 -0
- omnibase_infra/nodes/node_ledger_write_effect/models/__init__.py +31 -0
- omnibase_infra/nodes/node_ledger_write_effect/models/model_ledger_append_result.py +54 -0
- omnibase_infra/nodes/node_ledger_write_effect/models/model_ledger_entry.py +92 -0
- omnibase_infra/nodes/node_ledger_write_effect/models/model_ledger_query.py +53 -0
- omnibase_infra/nodes/node_ledger_write_effect/models/model_ledger_query_result.py +41 -0
- omnibase_infra/nodes/node_ledger_write_effect/node.py +89 -0
- omnibase_infra/nodes/node_ledger_write_effect/protocols/__init__.py +13 -0
- omnibase_infra/nodes/node_ledger_write_effect/protocols/protocol_ledger_persistence.py +127 -0
- omnibase_infra/nodes/node_ledger_write_effect/registry/__init__.py +9 -0
- omnibase_infra/nodes/node_ledger_write_effect/registry/registry_infra_ledger_write.py +121 -0
- omnibase_infra/nodes/node_registration_orchestrator/README.md +542 -0
- omnibase_infra/nodes/node_registration_orchestrator/__init__.py +120 -0
- omnibase_infra/nodes/node_registration_orchestrator/contract.yaml +482 -0
- omnibase_infra/nodes/node_registration_orchestrator/dispatchers/__init__.py +53 -0
- omnibase_infra/nodes/node_registration_orchestrator/dispatchers/dispatcher_node_introspected.py +376 -0
- omnibase_infra/nodes/node_registration_orchestrator/dispatchers/dispatcher_node_registration_acked.py +376 -0
- omnibase_infra/nodes/node_registration_orchestrator/dispatchers/dispatcher_runtime_tick.py +373 -0
- omnibase_infra/nodes/node_registration_orchestrator/handlers/__init__.py +62 -0
- omnibase_infra/nodes/node_registration_orchestrator/handlers/handler_node_heartbeat.py +376 -0
- omnibase_infra/nodes/node_registration_orchestrator/handlers/handler_node_introspected.py +694 -0
- omnibase_infra/nodes/node_registration_orchestrator/handlers/handler_node_registration_acked.py +458 -0
- omnibase_infra/nodes/node_registration_orchestrator/handlers/handler_runtime_tick.py +364 -0
- omnibase_infra/nodes/node_registration_orchestrator/introspection_event_router.py +544 -0
- omnibase_infra/nodes/node_registration_orchestrator/models/__init__.py +75 -0
- omnibase_infra/nodes/node_registration_orchestrator/models/model_consul_intent_payload.py +194 -0
- omnibase_infra/nodes/node_registration_orchestrator/models/model_consul_registration_intent.py +67 -0
- omnibase_infra/nodes/node_registration_orchestrator/models/model_intent_execution_result.py +50 -0
- omnibase_infra/nodes/node_registration_orchestrator/models/model_node_liveness_expired.py +107 -0
- omnibase_infra/nodes/node_registration_orchestrator/models/model_orchestrator_config.py +67 -0
- omnibase_infra/nodes/node_registration_orchestrator/models/model_orchestrator_input.py +41 -0
- omnibase_infra/nodes/node_registration_orchestrator/models/model_orchestrator_output.py +166 -0
- omnibase_infra/nodes/node_registration_orchestrator/models/model_postgres_intent_payload.py +235 -0
- omnibase_infra/nodes/node_registration_orchestrator/models/model_postgres_upsert_intent.py +68 -0
- omnibase_infra/nodes/node_registration_orchestrator/models/model_reducer_execution_result.py +384 -0
- omnibase_infra/nodes/node_registration_orchestrator/models/model_reducer_state.py +60 -0
- omnibase_infra/nodes/node_registration_orchestrator/models/model_registration_intent.py +177 -0
- omnibase_infra/nodes/node_registration_orchestrator/models/model_registry_intent.py +247 -0
- omnibase_infra/nodes/node_registration_orchestrator/node.py +195 -0
- omnibase_infra/nodes/node_registration_orchestrator/plugin.py +909 -0
- omnibase_infra/nodes/node_registration_orchestrator/protocols.py +439 -0
- omnibase_infra/nodes/node_registration_orchestrator/registry/__init__.py +41 -0
- omnibase_infra/nodes/node_registration_orchestrator/registry/registry_infra_node_registration_orchestrator.py +528 -0
- omnibase_infra/nodes/node_registration_orchestrator/timeout_coordinator.py +393 -0
- omnibase_infra/nodes/node_registration_orchestrator/wiring.py +743 -0
- omnibase_infra/nodes/node_registration_reducer/__init__.py +15 -0
- omnibase_infra/nodes/node_registration_reducer/contract.yaml +301 -0
- omnibase_infra/nodes/node_registration_reducer/models/__init__.py +38 -0
- omnibase_infra/nodes/node_registration_reducer/models/model_validation_result.py +113 -0
- omnibase_infra/nodes/node_registration_reducer/node.py +139 -0
- omnibase_infra/nodes/node_registration_reducer/registry/__init__.py +9 -0
- omnibase_infra/nodes/node_registration_reducer/registry/registry_infra_node_registration_reducer.py +79 -0
- omnibase_infra/nodes/node_registration_storage_effect/__init__.py +41 -0
- omnibase_infra/nodes/node_registration_storage_effect/contract.yaml +220 -0
- omnibase_infra/nodes/node_registration_storage_effect/models/__init__.py +44 -0
- omnibase_infra/nodes/node_registration_storage_effect/models/model_delete_result.py +132 -0
- omnibase_infra/nodes/node_registration_storage_effect/models/model_registration_record.py +199 -0
- omnibase_infra/nodes/node_registration_storage_effect/models/model_registration_update.py +155 -0
- omnibase_infra/nodes/node_registration_storage_effect/models/model_storage_health_check_details.py +123 -0
- omnibase_infra/nodes/node_registration_storage_effect/models/model_storage_health_check_result.py +117 -0
- omnibase_infra/nodes/node_registration_storage_effect/models/model_storage_query.py +100 -0
- omnibase_infra/nodes/node_registration_storage_effect/models/model_storage_result.py +136 -0
- omnibase_infra/nodes/node_registration_storage_effect/models/model_upsert_result.py +127 -0
- omnibase_infra/nodes/node_registration_storage_effect/node.py +112 -0
- omnibase_infra/nodes/node_registration_storage_effect/protocols/__init__.py +22 -0
- omnibase_infra/nodes/node_registration_storage_effect/protocols/protocol_registration_persistence.py +333 -0
- omnibase_infra/nodes/node_registration_storage_effect/registry/__init__.py +23 -0
- omnibase_infra/nodes/node_registration_storage_effect/registry/registry_infra_registration_storage.py +215 -0
- omnibase_infra/nodes/node_registry_effect/__init__.py +85 -0
- omnibase_infra/nodes/node_registry_effect/contract.yaml +677 -0
- omnibase_infra/nodes/node_registry_effect/handlers/__init__.py +70 -0
- omnibase_infra/nodes/node_registry_effect/handlers/handler_consul_deregister.py +211 -0
- omnibase_infra/nodes/node_registry_effect/handlers/handler_consul_register.py +212 -0
- omnibase_infra/nodes/node_registry_effect/handlers/handler_partial_retry.py +417 -0
- omnibase_infra/nodes/node_registry_effect/handlers/handler_postgres_deactivate.py +215 -0
- omnibase_infra/nodes/node_registry_effect/handlers/handler_postgres_upsert.py +208 -0
- omnibase_infra/nodes/node_registry_effect/models/__init__.py +43 -0
- omnibase_infra/nodes/node_registry_effect/models/model_partial_retry_request.py +92 -0
- omnibase_infra/nodes/node_registry_effect/node.py +165 -0
- omnibase_infra/nodes/node_registry_effect/registry/__init__.py +27 -0
- omnibase_infra/nodes/node_registry_effect/registry/registry_infra_registry_effect.py +196 -0
- omnibase_infra/nodes/node_service_discovery_effect/__init__.py +111 -0
- omnibase_infra/nodes/node_service_discovery_effect/contract.yaml +246 -0
- omnibase_infra/nodes/node_service_discovery_effect/models/__init__.py +67 -0
- omnibase_infra/nodes/node_service_discovery_effect/models/enum_health_status.py +72 -0
- omnibase_infra/nodes/node_service_discovery_effect/models/enum_service_discovery_operation.py +58 -0
- omnibase_infra/nodes/node_service_discovery_effect/models/model_discovery_query.py +99 -0
- omnibase_infra/nodes/node_service_discovery_effect/models/model_discovery_result.py +98 -0
- omnibase_infra/nodes/node_service_discovery_effect/models/model_health_check_config.py +121 -0
- omnibase_infra/nodes/node_service_discovery_effect/models/model_query_metadata.py +63 -0
- omnibase_infra/nodes/node_service_discovery_effect/models/model_registration_result.py +130 -0
- omnibase_infra/nodes/node_service_discovery_effect/models/model_service_discovery_health_check_details.py +111 -0
- omnibase_infra/nodes/node_service_discovery_effect/models/model_service_discovery_health_check_result.py +119 -0
- omnibase_infra/nodes/node_service_discovery_effect/models/model_service_info.py +106 -0
- omnibase_infra/nodes/node_service_discovery_effect/models/model_service_registration.py +121 -0
- omnibase_infra/nodes/node_service_discovery_effect/node.py +111 -0
- omnibase_infra/nodes/node_service_discovery_effect/protocols/__init__.py +14 -0
- omnibase_infra/nodes/node_service_discovery_effect/protocols/protocol_discovery_operations.py +279 -0
- omnibase_infra/nodes/node_service_discovery_effect/registry/__init__.py +13 -0
- omnibase_infra/nodes/node_service_discovery_effect/registry/registry_infra_service_discovery.py +222 -0
- omnibase_infra/nodes/reducers/__init__.py +30 -0
- omnibase_infra/nodes/reducers/models/__init__.py +37 -0
- omnibase_infra/nodes/reducers/models/model_payload_consul_register.py +87 -0
- omnibase_infra/nodes/reducers/models/model_payload_ledger_append.py +133 -0
- omnibase_infra/nodes/reducers/models/model_payload_postgres_upsert_registration.py +60 -0
- omnibase_infra/nodes/reducers/models/model_registration_confirmation.py +166 -0
- omnibase_infra/nodes/reducers/models/model_registration_state.py +433 -0
- omnibase_infra/nodes/reducers/registration_reducer.py +1138 -0
- omnibase_infra/observability/__init__.py +143 -0
- omnibase_infra/observability/constants_metrics.py +91 -0
- omnibase_infra/observability/factory_observability_sink.py +525 -0
- omnibase_infra/observability/handlers/__init__.py +118 -0
- omnibase_infra/observability/handlers/handler_logging_structured.py +967 -0
- omnibase_infra/observability/handlers/handler_metrics_prometheus.py +1120 -0
- omnibase_infra/observability/handlers/model_logging_handler_config.py +71 -0
- omnibase_infra/observability/handlers/model_logging_handler_response.py +77 -0
- omnibase_infra/observability/handlers/model_metrics_handler_config.py +172 -0
- omnibase_infra/observability/handlers/model_metrics_handler_payload.py +135 -0
- omnibase_infra/observability/handlers/model_metrics_handler_response.py +101 -0
- omnibase_infra/observability/hooks/__init__.py +74 -0
- omnibase_infra/observability/hooks/hook_observability.py +1223 -0
- omnibase_infra/observability/models/__init__.py +30 -0
- omnibase_infra/observability/models/enum_required_log_context_key.py +77 -0
- omnibase_infra/observability/models/model_buffered_log_entry.py +117 -0
- omnibase_infra/observability/models/model_logging_sink_config.py +73 -0
- omnibase_infra/observability/models/model_metrics_sink_config.py +156 -0
- omnibase_infra/observability/sinks/__init__.py +69 -0
- omnibase_infra/observability/sinks/sink_logging_structured.py +809 -0
- omnibase_infra/observability/sinks/sink_metrics_prometheus.py +710 -0
- omnibase_infra/plugins/__init__.py +27 -0
- omnibase_infra/plugins/examples/__init__.py +28 -0
- omnibase_infra/plugins/examples/plugin_json_normalizer.py +271 -0
- omnibase_infra/plugins/examples/plugin_json_normalizer_error_handling.py +210 -0
- omnibase_infra/plugins/models/__init__.py +21 -0
- omnibase_infra/plugins/models/model_plugin_context.py +76 -0
- omnibase_infra/plugins/models/model_plugin_input_data.py +58 -0
- omnibase_infra/plugins/models/model_plugin_output_data.py +62 -0
- omnibase_infra/plugins/plugin_compute_base.py +449 -0
- omnibase_infra/projectors/__init__.py +30 -0
- omnibase_infra/projectors/contracts/__init__.py +63 -0
- omnibase_infra/projectors/contracts/registration_projector.yaml +370 -0
- omnibase_infra/projectors/projection_reader_registration.py +1559 -0
- omnibase_infra/projectors/snapshot_publisher_registration.py +1329 -0
- omnibase_infra/protocols/__init__.py +104 -0
- omnibase_infra/protocols/protocol_capability_projection.py +253 -0
- omnibase_infra/protocols/protocol_capability_query.py +251 -0
- omnibase_infra/protocols/protocol_container_aware.py +200 -0
- omnibase_infra/protocols/protocol_dispatch_engine.py +152 -0
- omnibase_infra/protocols/protocol_event_bus_like.py +127 -0
- omnibase_infra/protocols/protocol_event_projector.py +96 -0
- omnibase_infra/protocols/protocol_idempotency_store.py +142 -0
- omnibase_infra/protocols/protocol_message_dispatcher.py +247 -0
- omnibase_infra/protocols/protocol_message_type_registry.py +306 -0
- omnibase_infra/protocols/protocol_plugin_compute.py +368 -0
- omnibase_infra/protocols/protocol_projector_schema_validator.py +82 -0
- omnibase_infra/protocols/protocol_registry_metrics.py +215 -0
- omnibase_infra/protocols/protocol_snapshot_publisher.py +396 -0
- omnibase_infra/protocols/protocol_snapshot_store.py +567 -0
- omnibase_infra/runtime/__init__.py +445 -0
- omnibase_infra/runtime/binding_config_resolver.py +2771 -0
- omnibase_infra/runtime/binding_resolver.py +753 -0
- omnibase_infra/runtime/chain_aware_dispatch.py +467 -0
- omnibase_infra/runtime/constants_notification.py +75 -0
- omnibase_infra/runtime/constants_security.py +70 -0
- omnibase_infra/runtime/contract_handler_discovery.py +587 -0
- omnibase_infra/runtime/contract_loaders/__init__.py +51 -0
- omnibase_infra/runtime/contract_loaders/handler_routing_loader.py +464 -0
- omnibase_infra/runtime/contract_loaders/operation_bindings_loader.py +789 -0
- omnibase_infra/runtime/dispatch_context_enforcer.py +427 -0
- omnibase_infra/runtime/emit_daemon/__init__.py +97 -0
- omnibase_infra/runtime/emit_daemon/cli.py +844 -0
- omnibase_infra/runtime/emit_daemon/client.py +811 -0
- omnibase_infra/runtime/emit_daemon/config.py +535 -0
- omnibase_infra/runtime/emit_daemon/daemon.py +812 -0
- omnibase_infra/runtime/emit_daemon/event_registry.py +477 -0
- omnibase_infra/runtime/emit_daemon/model_daemon_request.py +139 -0
- omnibase_infra/runtime/emit_daemon/model_daemon_response.py +191 -0
- omnibase_infra/runtime/emit_daemon/queue.py +618 -0
- omnibase_infra/runtime/enums/__init__.py +18 -0
- omnibase_infra/runtime/enums/enum_config_ref_scheme.py +33 -0
- omnibase_infra/runtime/enums/enum_scheduler_status.py +170 -0
- omnibase_infra/runtime/envelope_validator.py +179 -0
- omnibase_infra/runtime/event_bus_subcontract_wiring.py +466 -0
- omnibase_infra/runtime/handler_bootstrap_source.py +507 -0
- omnibase_infra/runtime/handler_contract_config_loader.py +603 -0
- omnibase_infra/runtime/handler_contract_source.py +750 -0
- omnibase_infra/runtime/handler_identity.py +81 -0
- omnibase_infra/runtime/handler_plugin_loader.py +2046 -0
- omnibase_infra/runtime/handler_registry.py +329 -0
- omnibase_infra/runtime/handler_source_resolver.py +367 -0
- omnibase_infra/runtime/invocation_security_enforcer.py +427 -0
- omnibase_infra/runtime/kafka_contract_source.py +984 -0
- omnibase_infra/runtime/kernel.py +40 -0
- omnibase_infra/runtime/mixin_policy_validation.py +522 -0
- omnibase_infra/runtime/mixin_semver_cache.py +402 -0
- omnibase_infra/runtime/mixins/__init__.py +24 -0
- omnibase_infra/runtime/mixins/mixin_projector_notification_publishing.py +566 -0
- omnibase_infra/runtime/mixins/mixin_projector_sql_operations.py +778 -0
- omnibase_infra/runtime/models/__init__.py +229 -0
- omnibase_infra/runtime/models/model_batch_lifecycle_result.py +217 -0
- omnibase_infra/runtime/models/model_binding_config.py +168 -0
- omnibase_infra/runtime/models/model_binding_config_cache_stats.py +135 -0
- omnibase_infra/runtime/models/model_binding_config_resolver_config.py +329 -0
- omnibase_infra/runtime/models/model_cached_secret.py +138 -0
- omnibase_infra/runtime/models/model_compute_key.py +138 -0
- omnibase_infra/runtime/models/model_compute_registration.py +97 -0
- omnibase_infra/runtime/models/model_config_cache_entry.py +61 -0
- omnibase_infra/runtime/models/model_config_ref.py +331 -0
- omnibase_infra/runtime/models/model_config_ref_parse_result.py +125 -0
- omnibase_infra/runtime/models/model_contract_load_result.py +224 -0
- omnibase_infra/runtime/models/model_domain_plugin_config.py +92 -0
- omnibase_infra/runtime/models/model_domain_plugin_result.py +270 -0
- omnibase_infra/runtime/models/model_duplicate_response.py +54 -0
- omnibase_infra/runtime/models/model_enabled_protocols_config.py +61 -0
- omnibase_infra/runtime/models/model_event_bus_config.py +54 -0
- omnibase_infra/runtime/models/model_failed_component.py +55 -0
- omnibase_infra/runtime/models/model_health_check_response.py +168 -0
- omnibase_infra/runtime/models/model_health_check_result.py +229 -0
- omnibase_infra/runtime/models/model_lifecycle_result.py +245 -0
- omnibase_infra/runtime/models/model_logging_config.py +42 -0
- omnibase_infra/runtime/models/model_optional_correlation_id.py +167 -0
- omnibase_infra/runtime/models/model_optional_string.py +94 -0
- omnibase_infra/runtime/models/model_optional_uuid.py +110 -0
- omnibase_infra/runtime/models/model_policy_context.py +100 -0
- omnibase_infra/runtime/models/model_policy_key.py +138 -0
- omnibase_infra/runtime/models/model_policy_registration.py +139 -0
- omnibase_infra/runtime/models/model_policy_result.py +103 -0
- omnibase_infra/runtime/models/model_policy_type_filter.py +157 -0
- omnibase_infra/runtime/models/model_projector_notification_config.py +171 -0
- omnibase_infra/runtime/models/model_projector_plugin_loader_config.py +47 -0
- omnibase_infra/runtime/models/model_protocol_registration_config.py +65 -0
- omnibase_infra/runtime/models/model_retry_policy.py +105 -0
- omnibase_infra/runtime/models/model_runtime_config.py +150 -0
- omnibase_infra/runtime/models/model_runtime_contract_config.py +268 -0
- omnibase_infra/runtime/models/model_runtime_scheduler_config.py +625 -0
- omnibase_infra/runtime/models/model_runtime_scheduler_metrics.py +233 -0
- omnibase_infra/runtime/models/model_runtime_tick.py +193 -0
- omnibase_infra/runtime/models/model_secret_cache_stats.py +82 -0
- omnibase_infra/runtime/models/model_secret_mapping.py +63 -0
- omnibase_infra/runtime/models/model_secret_resolver_config.py +107 -0
- omnibase_infra/runtime/models/model_secret_resolver_metrics.py +111 -0
- omnibase_infra/runtime/models/model_secret_source_info.py +72 -0
- omnibase_infra/runtime/models/model_secret_source_spec.py +66 -0
- omnibase_infra/runtime/models/model_security_config.py +109 -0
- omnibase_infra/runtime/models/model_shutdown_batch_result.py +75 -0
- omnibase_infra/runtime/models/model_shutdown_config.py +94 -0
- omnibase_infra/runtime/models/model_transition_notification_outbox_config.py +112 -0
- omnibase_infra/runtime/models/model_transition_notification_outbox_metrics.py +140 -0
- omnibase_infra/runtime/models/model_transition_notification_publisher_metrics.py +357 -0
- omnibase_infra/runtime/projector_plugin_loader.py +1462 -0
- omnibase_infra/runtime/projector_schema_manager.py +565 -0
- omnibase_infra/runtime/projector_shell.py +1330 -0
- omnibase_infra/runtime/protocol_contract_descriptor.py +92 -0
- omnibase_infra/runtime/protocol_contract_source.py +92 -0
- omnibase_infra/runtime/protocol_domain_plugin.py +474 -0
- omnibase_infra/runtime/protocol_handler_discovery.py +221 -0
- omnibase_infra/runtime/protocol_handler_plugin_loader.py +327 -0
- omnibase_infra/runtime/protocol_lifecycle_executor.py +435 -0
- omnibase_infra/runtime/protocol_policy.py +366 -0
- omnibase_infra/runtime/protocols/__init__.py +37 -0
- omnibase_infra/runtime/protocols/protocol_runtime_scheduler.py +468 -0
- omnibase_infra/runtime/publisher_topic_scoped.py +294 -0
- omnibase_infra/runtime/registry/__init__.py +93 -0
- omnibase_infra/runtime/registry/mixin_message_type_query.py +326 -0
- omnibase_infra/runtime/registry/mixin_message_type_registration.py +354 -0
- omnibase_infra/runtime/registry/registry_event_bus_binding.py +268 -0
- omnibase_infra/runtime/registry/registry_message_type.py +542 -0
- omnibase_infra/runtime/registry/registry_protocol_binding.py +445 -0
- omnibase_infra/runtime/registry_compute.py +1143 -0
- omnibase_infra/runtime/registry_contract_source.py +693 -0
- omnibase_infra/runtime/registry_dispatcher.py +678 -0
- omnibase_infra/runtime/registry_policy.py +1185 -0
- omnibase_infra/runtime/runtime_contract_config_loader.py +406 -0
- omnibase_infra/runtime/runtime_scheduler.py +1070 -0
- omnibase_infra/runtime/secret_resolver.py +2112 -0
- omnibase_infra/runtime/security_metadata_validator.py +776 -0
- omnibase_infra/runtime/service_kernel.py +1651 -0
- omnibase_infra/runtime/service_message_dispatch_engine.py +2350 -0
- omnibase_infra/runtime/service_runtime_host_process.py +3493 -0
- omnibase_infra/runtime/transition_notification_outbox.py +1190 -0
- omnibase_infra/runtime/transition_notification_publisher.py +765 -0
- omnibase_infra/runtime/util_container_wiring.py +1124 -0
- omnibase_infra/runtime/util_validation.py +314 -0
- omnibase_infra/runtime/util_version.py +98 -0
- omnibase_infra/runtime/util_wiring.py +723 -0
- omnibase_infra/schemas/schema_registration_projection.sql +320 -0
- omnibase_infra/schemas/schema_transition_notification_outbox.sql +245 -0
- omnibase_infra/services/__init__.py +89 -0
- omnibase_infra/services/corpus_capture.py +684 -0
- omnibase_infra/services/mcp/__init__.py +31 -0
- omnibase_infra/services/mcp/mcp_server_lifecycle.py +449 -0
- omnibase_infra/services/mcp/service_mcp_tool_discovery.py +411 -0
- omnibase_infra/services/mcp/service_mcp_tool_registry.py +329 -0
- omnibase_infra/services/mcp/service_mcp_tool_sync.py +565 -0
- omnibase_infra/services/registry_api/__init__.py +40 -0
- omnibase_infra/services/registry_api/main.py +261 -0
- omnibase_infra/services/registry_api/models/__init__.py +66 -0
- omnibase_infra/services/registry_api/models/model_capability_widget_mapping.py +38 -0
- omnibase_infra/services/registry_api/models/model_pagination_info.py +48 -0
- omnibase_infra/services/registry_api/models/model_registry_discovery_response.py +73 -0
- omnibase_infra/services/registry_api/models/model_registry_health_response.py +49 -0
- omnibase_infra/services/registry_api/models/model_registry_instance_view.py +88 -0
- omnibase_infra/services/registry_api/models/model_registry_node_view.py +88 -0
- omnibase_infra/services/registry_api/models/model_registry_summary.py +60 -0
- omnibase_infra/services/registry_api/models/model_response_list_instances.py +43 -0
- omnibase_infra/services/registry_api/models/model_response_list_nodes.py +51 -0
- omnibase_infra/services/registry_api/models/model_warning.py +49 -0
- omnibase_infra/services/registry_api/models/model_widget_defaults.py +28 -0
- omnibase_infra/services/registry_api/models/model_widget_mapping.py +51 -0
- omnibase_infra/services/registry_api/routes.py +371 -0
- omnibase_infra/services/registry_api/service.py +837 -0
- omnibase_infra/services/service_capability_query.py +945 -0
- omnibase_infra/services/service_health.py +898 -0
- omnibase_infra/services/service_node_selector.py +530 -0
- omnibase_infra/services/service_timeout_emitter.py +699 -0
- omnibase_infra/services/service_timeout_scanner.py +394 -0
- omnibase_infra/services/session/__init__.py +56 -0
- omnibase_infra/services/session/config_consumer.py +137 -0
- omnibase_infra/services/session/config_store.py +139 -0
- omnibase_infra/services/session/consumer.py +1007 -0
- omnibase_infra/services/session/protocol_session_aggregator.py +117 -0
- omnibase_infra/services/session/store.py +997 -0
- omnibase_infra/services/snapshot/__init__.py +31 -0
- omnibase_infra/services/snapshot/service_snapshot.py +647 -0
- omnibase_infra/services/snapshot/store_inmemory.py +637 -0
- omnibase_infra/services/snapshot/store_postgres.py +1279 -0
- omnibase_infra/shared/__init__.py +8 -0
- omnibase_infra/testing/__init__.py +10 -0
- omnibase_infra/testing/utils.py +23 -0
- omnibase_infra/topics/__init__.py +45 -0
- omnibase_infra/topics/platform_topic_suffixes.py +140 -0
- omnibase_infra/topics/util_topic_composition.py +95 -0
- omnibase_infra/types/__init__.py +48 -0
- omnibase_infra/types/type_cache_info.py +49 -0
- omnibase_infra/types/type_dsn.py +173 -0
- omnibase_infra/types/type_infra_aliases.py +60 -0
- omnibase_infra/types/typed_dict/__init__.py +29 -0
- omnibase_infra/types/typed_dict/typed_dict_envelope_build_params.py +115 -0
- omnibase_infra/types/typed_dict/typed_dict_introspection_cache.py +128 -0
- omnibase_infra/types/typed_dict/typed_dict_performance_metrics_cache.py +140 -0
- omnibase_infra/types/typed_dict_capabilities.py +64 -0
- omnibase_infra/utils/__init__.py +117 -0
- omnibase_infra/utils/correlation.py +208 -0
- omnibase_infra/utils/util_atomic_file.py +261 -0
- omnibase_infra/utils/util_consumer_group.py +232 -0
- omnibase_infra/utils/util_datetime.py +372 -0
- omnibase_infra/utils/util_db_transaction.py +239 -0
- omnibase_infra/utils/util_dsn_validation.py +333 -0
- omnibase_infra/utils/util_env_parsing.py +264 -0
- omnibase_infra/utils/util_error_sanitization.py +457 -0
- omnibase_infra/utils/util_pydantic_validators.py +477 -0
- omnibase_infra/utils/util_retry_optimistic.py +281 -0
- omnibase_infra/utils/util_semver.py +233 -0
- omnibase_infra/validation/__init__.py +307 -0
- omnibase_infra/validation/contracts/security.validation.yaml +114 -0
- omnibase_infra/validation/enums/__init__.py +11 -0
- omnibase_infra/validation/enums/enum_contract_violation_severity.py +13 -0
- omnibase_infra/validation/infra_validators.py +1514 -0
- omnibase_infra/validation/linter_contract.py +907 -0
- omnibase_infra/validation/mixin_any_type_classification.py +120 -0
- omnibase_infra/validation/mixin_any_type_exemption.py +580 -0
- omnibase_infra/validation/mixin_any_type_reporting.py +106 -0
- omnibase_infra/validation/mixin_execution_shape_violation_checks.py +596 -0
- omnibase_infra/validation/mixin_node_archetype_detection.py +254 -0
- omnibase_infra/validation/models/__init__.py +15 -0
- omnibase_infra/validation/models/model_contract_lint_result.py +101 -0
- omnibase_infra/validation/models/model_contract_violation.py +41 -0
- omnibase_infra/validation/service_validation_aggregator.py +395 -0
- omnibase_infra/validation/validation_exemptions.yaml +2033 -0
- omnibase_infra/validation/validator_any_type.py +715 -0
- omnibase_infra/validation/validator_chain_propagation.py +839 -0
- omnibase_infra/validation/validator_execution_shape.py +465 -0
- omnibase_infra/validation/validator_localhandler.py +261 -0
- omnibase_infra/validation/validator_registration_security.py +410 -0
- omnibase_infra/validation/validator_routing_coverage.py +1020 -0
- omnibase_infra/validation/validator_runtime_shape.py +915 -0
- omnibase_infra/validation/validator_security.py +513 -0
- omnibase_infra/validation/validator_topic_category.py +1152 -0
- omnibase_infra-0.2.6.dist-info/METADATA +197 -0
- omnibase_infra-0.2.6.dist-info/RECORD +833 -0
- omnibase_infra-0.2.6.dist-info/WHEEL +4 -0
- omnibase_infra-0.2.6.dist-info/entry_points.txt +5 -0
- omnibase_infra-0.2.6.dist-info/licenses/LICENSE +21 -0
|
@@ -0,0 +1,1124 @@
|
|
|
1
|
+
# SPDX-License-Identifier: MIT
|
|
2
|
+
# Copyright (c) 2025 OmniNode Team
|
|
3
|
+
"""Container wiring for omnibase_infra services.
|
|
4
|
+
|
|
5
|
+
This module provides functions to register infrastructure services
|
|
6
|
+
with ModelONEXContainer from omnibase_core. It establishes container-based
|
|
7
|
+
dependency injection for RegistryPolicy and other infrastructure components.
|
|
8
|
+
|
|
9
|
+
Design Principles:
|
|
10
|
+
- Explicit registration: All services registered explicitly
|
|
11
|
+
- Singleton per container: Each container gets its own service instances
|
|
12
|
+
- Type-safe resolution: Services registered with proper type interfaces
|
|
13
|
+
- Testability: Easy to mock services via container
|
|
14
|
+
|
|
15
|
+
Service Keys:
|
|
16
|
+
- RegistryPolicy: Registered as interface=RegistryPolicy
|
|
17
|
+
- RegistryProtocolBinding: Registered as interface=RegistryProtocolBinding
|
|
18
|
+
- RegistryCompute: Registered as interface=RegistryCompute
|
|
19
|
+
|
|
20
|
+
Example Usage:
|
|
21
|
+
```python
|
|
22
|
+
from omnibase_core.container import ModelONEXContainer
|
|
23
|
+
from omnibase_infra.runtime.util_container_wiring import wire_infrastructure_services
|
|
24
|
+
from omnibase_infra.runtime.registry_policy import RegistryPolicy
|
|
25
|
+
|
|
26
|
+
# Bootstrap container
|
|
27
|
+
container = ModelONEXContainer()
|
|
28
|
+
|
|
29
|
+
# Wire infrastructure services
|
|
30
|
+
summary = await wire_infrastructure_services(container)
|
|
31
|
+
print(f"Registered {len(summary['services'])} services")
|
|
32
|
+
|
|
33
|
+
# Resolve services using type interface
|
|
34
|
+
policy_registry = await container.service_registry.resolve_service(RegistryPolicy)
|
|
35
|
+
|
|
36
|
+
# Use the registry
|
|
37
|
+
policy_registry.register_policy(
|
|
38
|
+
policy_id="exponential_backoff",
|
|
39
|
+
policy_class=ExponentialBackoffPolicy,
|
|
40
|
+
policy_type=EnumPolicyType.ORCHESTRATOR,
|
|
41
|
+
)
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Integration Notes:
|
|
45
|
+
- Uses ModelONEXContainer.service_registry for registration
|
|
46
|
+
- Services registered as global scope (singleton per container)
|
|
47
|
+
- Type-safe resolution via interface types
|
|
48
|
+
- Compatible with omnibase_core v0.5.6 and later (async service registry)
|
|
49
|
+
- For omnibase_core v0.6.2+: Validates service_registry availability before operations
|
|
50
|
+
"""
|
|
51
|
+
|
|
52
|
+
from __future__ import annotations
|
|
53
|
+
|
|
54
|
+
import logging
|
|
55
|
+
from typing import TYPE_CHECKING
|
|
56
|
+
|
|
57
|
+
from omnibase_core.enums import EnumInjectionScope
|
|
58
|
+
from omnibase_core.models.primitives import ModelSemVer
|
|
59
|
+
from omnibase_infra.enums import EnumInfraTransportType
|
|
60
|
+
from omnibase_infra.errors import (
|
|
61
|
+
ModelInfraErrorContext,
|
|
62
|
+
ServiceRegistrationError,
|
|
63
|
+
ServiceRegistryUnavailableError,
|
|
64
|
+
ServiceResolutionError,
|
|
65
|
+
)
|
|
66
|
+
from omnibase_infra.runtime.handler_registry import RegistryProtocolBinding
|
|
67
|
+
from omnibase_infra.runtime.registry_compute import RegistryCompute
|
|
68
|
+
from omnibase_infra.runtime.registry_policy import RegistryPolicy
|
|
69
|
+
|
|
70
|
+
if TYPE_CHECKING:
|
|
71
|
+
import asyncpg
|
|
72
|
+
|
|
73
|
+
from omnibase_core.container import ModelONEXContainer
|
|
74
|
+
from omnibase_infra.handlers import HandlerConsul
|
|
75
|
+
from omnibase_infra.nodes.node_registration_orchestrator.handlers import (
|
|
76
|
+
HandlerNodeIntrospected,
|
|
77
|
+
HandlerNodeRegistrationAcked,
|
|
78
|
+
HandlerRuntimeTick,
|
|
79
|
+
)
|
|
80
|
+
from omnibase_infra.nodes.node_registration_orchestrator.wiring import WiringResult
|
|
81
|
+
from omnibase_infra.projectors import ProjectionReaderRegistration
|
|
82
|
+
from omnibase_infra.runtime.projector_shell import ProjectorShell
|
|
83
|
+
from omnibase_infra.runtime.service_message_dispatch_engine import (
|
|
84
|
+
MessageDispatchEngine,
|
|
85
|
+
)
|
|
86
|
+
|
|
87
|
+
# Default semantic version for infrastructure components (from omnibase_core)
|
|
88
|
+
SEMVER_DEFAULT = ModelSemVer.parse("1.0.0")
|
|
89
|
+
|
|
90
|
+
logger = logging.getLogger(__name__)
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
def _validate_service_registry(
|
|
94
|
+
container: ModelONEXContainer,
|
|
95
|
+
operation: str,
|
|
96
|
+
) -> None:
|
|
97
|
+
"""Validate that container.service_registry is not None.
|
|
98
|
+
|
|
99
|
+
This validation should be called before any operation that uses
|
|
100
|
+
container.service_registry to provide clear error messages when
|
|
101
|
+
the service registry is unavailable.
|
|
102
|
+
|
|
103
|
+
Args:
|
|
104
|
+
container: The ONEX container to validate.
|
|
105
|
+
operation: Description of the operation being attempted.
|
|
106
|
+
|
|
107
|
+
Raises:
|
|
108
|
+
ServiceRegistryUnavailableError: If service_registry is None.
|
|
109
|
+
|
|
110
|
+
Example:
|
|
111
|
+
>>> _validate_service_registry(container, "register RegistryPolicy")
|
|
112
|
+
>>> # Proceed with registration...
|
|
113
|
+
"""
|
|
114
|
+
if not hasattr(container, "service_registry"):
|
|
115
|
+
raise ServiceRegistryUnavailableError(
|
|
116
|
+
"Container missing 'service_registry' attribute",
|
|
117
|
+
operation=operation,
|
|
118
|
+
hint=(
|
|
119
|
+
"Expected ModelONEXContainer from omnibase_core. "
|
|
120
|
+
"Check that omnibase_core is properly installed."
|
|
121
|
+
),
|
|
122
|
+
)
|
|
123
|
+
|
|
124
|
+
if container.service_registry is None:
|
|
125
|
+
# TODO(OMN-1265): Request upstream API - add public method
|
|
126
|
+
# `container.initialize_service_registry(config)` in omnibase_core.
|
|
127
|
+
# Current behavior: service_registry returns None under several conditions, requiring
|
|
128
|
+
# downstream validation. Proposed improvement: provide a factory method or builder pattern
|
|
129
|
+
# that ensures service_registry is always initialized with clear diagnostics.
|
|
130
|
+
raise ServiceRegistryUnavailableError(
|
|
131
|
+
"Container service_registry is None",
|
|
132
|
+
operation=operation,
|
|
133
|
+
hint=(
|
|
134
|
+
"ModelONEXContainer.service_registry returns None when:\n"
|
|
135
|
+
" 1. enable_service_registry=False was passed to constructor\n"
|
|
136
|
+
" 2. ServiceRegistry module is not available/installed\n"
|
|
137
|
+
" 3. Container initialization encountered an import error\n"
|
|
138
|
+
"Check container logs for 'ServiceRegistry not available' warnings."
|
|
139
|
+
),
|
|
140
|
+
)
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
def _analyze_attribute_error(error_str: str) -> tuple[str, str]:
|
|
144
|
+
"""Analyze AttributeError and return (missing_attribute, hint).
|
|
145
|
+
|
|
146
|
+
Extracts the missing attribute name from the error string and provides
|
|
147
|
+
a user-friendly hint for common container API issues.
|
|
148
|
+
|
|
149
|
+
Note: service_registry missing/None cases are handled by _validate_service_registry()
|
|
150
|
+
which is called before operations. This function handles other AttributeErrors
|
|
151
|
+
(e.g., missing register_instance method).
|
|
152
|
+
|
|
153
|
+
Args:
|
|
154
|
+
error_str: The string representation of the AttributeError.
|
|
155
|
+
|
|
156
|
+
Returns:
|
|
157
|
+
Tuple of (missing_attribute, hint) for error context.
|
|
158
|
+
"""
|
|
159
|
+
missing_attr = error_str.split("'")[-2] if "'" in error_str else "unknown"
|
|
160
|
+
|
|
161
|
+
if "register_instance" in error_str:
|
|
162
|
+
hint = (
|
|
163
|
+
"Container.service_registry missing 'register_instance' method. "
|
|
164
|
+
"Check omnibase_core version compatibility (requires v0.5.6 or later)."
|
|
165
|
+
)
|
|
166
|
+
else:
|
|
167
|
+
hint = f"Missing attribute: '{missing_attr}'"
|
|
168
|
+
|
|
169
|
+
return missing_attr, hint
|
|
170
|
+
|
|
171
|
+
|
|
172
|
+
def _analyze_type_error(error_str: str) -> tuple[str, str]:
|
|
173
|
+
"""Analyze TypeError and return (invalid_argument, hint).
|
|
174
|
+
|
|
175
|
+
Extracts which argument caused the type error and provides
|
|
176
|
+
a user-friendly hint for fixing registration issues.
|
|
177
|
+
|
|
178
|
+
Args:
|
|
179
|
+
error_str: The string representation of the TypeError.
|
|
180
|
+
|
|
181
|
+
Returns:
|
|
182
|
+
Tuple of (invalid_argument, hint) for error context.
|
|
183
|
+
"""
|
|
184
|
+
if "interface" in error_str:
|
|
185
|
+
return "interface", (
|
|
186
|
+
"Invalid 'interface' argument. "
|
|
187
|
+
"Expected a type class (e.g., RegistryPolicy), not an instance."
|
|
188
|
+
)
|
|
189
|
+
if "instance" in error_str:
|
|
190
|
+
return "instance", (
|
|
191
|
+
"Invalid 'instance' argument. Expected an instance of the interface type."
|
|
192
|
+
)
|
|
193
|
+
if "scope" in error_str:
|
|
194
|
+
return "scope", (
|
|
195
|
+
"Invalid 'scope' argument. Expected 'global', 'request', or 'transient'."
|
|
196
|
+
)
|
|
197
|
+
if "metadata" in error_str:
|
|
198
|
+
return "metadata", "Invalid 'metadata' argument. Expected dict[str, object]."
|
|
199
|
+
if "positional" in error_str or "argument" in error_str:
|
|
200
|
+
return "signature", (
|
|
201
|
+
"Argument count mismatch. "
|
|
202
|
+
"Check register_instance() signature compatibility with omnibase_core version."
|
|
203
|
+
)
|
|
204
|
+
return "unknown", "Check register_instance() signature compatibility."
|
|
205
|
+
|
|
206
|
+
|
|
207
|
+
async def wire_infrastructure_services(
|
|
208
|
+
container: ModelONEXContainer,
|
|
209
|
+
) -> dict[str, list[str] | str]:
|
|
210
|
+
"""Register infrastructure services with the container.
|
|
211
|
+
|
|
212
|
+
Registers RegistryPolicy, RegistryProtocolBinding, and RegistryCompute as global
|
|
213
|
+
singleton services in the container. Uses ModelONEXContainer.service_registry.register_instance()
|
|
214
|
+
with the respective class as the interface type.
|
|
215
|
+
|
|
216
|
+
Note: This function is async because ModelONEXContainer.service_registry.register_instance()
|
|
217
|
+
is async in omnibase_core v0.5.6 and later (see omnibase_core.container.ModelONEXContainer).
|
|
218
|
+
|
|
219
|
+
Args:
|
|
220
|
+
container: ONEX container instance to register services in.
|
|
221
|
+
|
|
222
|
+
Returns:
|
|
223
|
+
Summary dict with:
|
|
224
|
+
- services: List of registered service class names
|
|
225
|
+
- status: Always "success" (errors raise exceptions)
|
|
226
|
+
|
|
227
|
+
Raises:
|
|
228
|
+
ServiceRegistryUnavailableError: If service_registry is missing or None.
|
|
229
|
+
ServiceRegistrationError: If service registration fails.
|
|
230
|
+
|
|
231
|
+
Example:
|
|
232
|
+
>>> from omnibase_core.container import ModelONEXContainer
|
|
233
|
+
>>> container = ModelONEXContainer()
|
|
234
|
+
>>> summary = await wire_infrastructure_services(container)
|
|
235
|
+
>>> print(summary)
|
|
236
|
+
{'services': ['RegistryPolicy', 'RegistryProtocolBinding', 'RegistryCompute'], 'status': 'success'}
|
|
237
|
+
>>> policy_reg = await container.service_registry.resolve_service(RegistryPolicy)
|
|
238
|
+
>>> handler_reg = await container.service_registry.resolve_service(RegistryProtocolBinding)
|
|
239
|
+
>>> compute_reg = await container.service_registry.resolve_service(RegistryCompute)
|
|
240
|
+
>>> # Verify via duck typing (per ONEX conventions)
|
|
241
|
+
>>> hasattr(policy_reg, 'register_policy') and callable(policy_reg.register_policy)
|
|
242
|
+
True
|
|
243
|
+
>>> hasattr(handler_reg, 'register') and callable(handler_reg.register)
|
|
244
|
+
True
|
|
245
|
+
>>> hasattr(compute_reg, 'register_plugin') and callable(compute_reg.register_plugin)
|
|
246
|
+
True
|
|
247
|
+
"""
|
|
248
|
+
# Validate service_registry is available and has required methods
|
|
249
|
+
_validate_service_registry(container, "wire_infrastructure_services")
|
|
250
|
+
|
|
251
|
+
services_registered: list[str] = []
|
|
252
|
+
|
|
253
|
+
try:
|
|
254
|
+
# Create RegistryPolicy instance
|
|
255
|
+
policy_registry = RegistryPolicy()
|
|
256
|
+
|
|
257
|
+
# Register with container using type interface (global scope = singleton)
|
|
258
|
+
await container.service_registry.register_instance(
|
|
259
|
+
interface=RegistryPolicy,
|
|
260
|
+
instance=policy_registry,
|
|
261
|
+
scope=EnumInjectionScope.GLOBAL,
|
|
262
|
+
metadata={
|
|
263
|
+
"description": "ONEX policy plugin registry",
|
|
264
|
+
"version": str(SEMVER_DEFAULT),
|
|
265
|
+
},
|
|
266
|
+
)
|
|
267
|
+
|
|
268
|
+
services_registered.append("RegistryPolicy")
|
|
269
|
+
logger.debug("Registered RegistryPolicy in container (global scope)")
|
|
270
|
+
|
|
271
|
+
# Create RegistryProtocolBinding instance
|
|
272
|
+
handler_registry = RegistryProtocolBinding()
|
|
273
|
+
|
|
274
|
+
# Register with container using type interface (global scope = singleton)
|
|
275
|
+
await container.service_registry.register_instance(
|
|
276
|
+
interface=RegistryProtocolBinding,
|
|
277
|
+
instance=handler_registry,
|
|
278
|
+
scope=EnumInjectionScope.GLOBAL,
|
|
279
|
+
metadata={
|
|
280
|
+
"description": "ONEX protocol handler binding registry",
|
|
281
|
+
"version": str(SEMVER_DEFAULT),
|
|
282
|
+
},
|
|
283
|
+
)
|
|
284
|
+
|
|
285
|
+
services_registered.append("RegistryProtocolBinding")
|
|
286
|
+
logger.debug("Registered RegistryProtocolBinding in container (global scope)")
|
|
287
|
+
|
|
288
|
+
# Create RegistryCompute instance
|
|
289
|
+
compute_registry = RegistryCompute()
|
|
290
|
+
|
|
291
|
+
# Register with container using type interface (global scope = singleton)
|
|
292
|
+
await container.service_registry.register_instance(
|
|
293
|
+
interface=RegistryCompute,
|
|
294
|
+
instance=compute_registry,
|
|
295
|
+
scope=EnumInjectionScope.GLOBAL,
|
|
296
|
+
metadata={
|
|
297
|
+
"description": "ONEX compute plugin registry",
|
|
298
|
+
"version": str(SEMVER_DEFAULT),
|
|
299
|
+
},
|
|
300
|
+
)
|
|
301
|
+
|
|
302
|
+
services_registered.append("RegistryCompute")
|
|
303
|
+
logger.debug("Registered RegistryCompute in container (global scope)")
|
|
304
|
+
|
|
305
|
+
except AttributeError as e:
|
|
306
|
+
# Container missing service_registry or registration method
|
|
307
|
+
error_str = str(e)
|
|
308
|
+
missing_attr, hint = _analyze_attribute_error(error_str)
|
|
309
|
+
|
|
310
|
+
logger.exception(
|
|
311
|
+
"Container missing required service_registry API",
|
|
312
|
+
extra={
|
|
313
|
+
"error": error_str,
|
|
314
|
+
"error_type": "AttributeError",
|
|
315
|
+
"missing_attribute": missing_attr,
|
|
316
|
+
"hint": hint,
|
|
317
|
+
},
|
|
318
|
+
)
|
|
319
|
+
context = ModelInfraErrorContext.with_correlation(
|
|
320
|
+
transport_type=EnumInfraTransportType.RUNTIME,
|
|
321
|
+
operation="wire_infrastructure_services",
|
|
322
|
+
)
|
|
323
|
+
raise ServiceRegistrationError(
|
|
324
|
+
f"Container wiring failed - {hint}",
|
|
325
|
+
context=context,
|
|
326
|
+
missing_attribute=missing_attr,
|
|
327
|
+
required_api="container.service_registry.register_instance(interface, instance, scope, metadata)",
|
|
328
|
+
original_error=str(e),
|
|
329
|
+
) from e
|
|
330
|
+
except TypeError as e:
|
|
331
|
+
# Invalid arguments to register_instance
|
|
332
|
+
error_str = str(e)
|
|
333
|
+
invalid_arg, hint = _analyze_type_error(error_str)
|
|
334
|
+
|
|
335
|
+
logger.exception(
|
|
336
|
+
"Invalid arguments during service registration",
|
|
337
|
+
extra={
|
|
338
|
+
"error": error_str,
|
|
339
|
+
"error_type": "TypeError",
|
|
340
|
+
"invalid_argument": invalid_arg,
|
|
341
|
+
"hint": hint,
|
|
342
|
+
},
|
|
343
|
+
)
|
|
344
|
+
context = ModelInfraErrorContext.with_correlation(
|
|
345
|
+
transport_type=EnumInfraTransportType.RUNTIME,
|
|
346
|
+
operation="wire_infrastructure_services",
|
|
347
|
+
)
|
|
348
|
+
raise ServiceRegistrationError(
|
|
349
|
+
f"Container wiring failed - {hint}",
|
|
350
|
+
context=context,
|
|
351
|
+
invalid_argument=invalid_arg,
|
|
352
|
+
expected_signature="register_instance(interface=Type, instance=obj, scope='global'|'request'|'transient', metadata=dict)",
|
|
353
|
+
original_error=str(e),
|
|
354
|
+
) from e
|
|
355
|
+
except Exception as e:
|
|
356
|
+
# Generic fallback for unexpected errors
|
|
357
|
+
logger.exception(
|
|
358
|
+
"Failed to register infrastructure services",
|
|
359
|
+
extra={"error": str(e), "error_type": type(e).__name__},
|
|
360
|
+
)
|
|
361
|
+
context = ModelInfraErrorContext.with_correlation(
|
|
362
|
+
transport_type=EnumInfraTransportType.RUNTIME,
|
|
363
|
+
operation="wire_infrastructure_services",
|
|
364
|
+
)
|
|
365
|
+
raise ServiceRegistrationError(
|
|
366
|
+
f"Failed to wire infrastructure services: {e}",
|
|
367
|
+
context=context,
|
|
368
|
+
original_error=str(e),
|
|
369
|
+
error_type=type(e).__name__,
|
|
370
|
+
) from e
|
|
371
|
+
|
|
372
|
+
logger.info(
|
|
373
|
+
"Infrastructure services wired successfully",
|
|
374
|
+
extra={
|
|
375
|
+
"service_count": len(services_registered),
|
|
376
|
+
"services": services_registered,
|
|
377
|
+
},
|
|
378
|
+
)
|
|
379
|
+
|
|
380
|
+
return {"services": services_registered, "status": "success"}
|
|
381
|
+
|
|
382
|
+
|
|
383
|
+
async def get_policy_registry_from_container(
|
|
384
|
+
container: ModelONEXContainer,
|
|
385
|
+
) -> RegistryPolicy:
|
|
386
|
+
"""Get RegistryPolicy from container.
|
|
387
|
+
|
|
388
|
+
Resolves RegistryPolicy using ModelONEXContainer.service_registry.resolve_service().
|
|
389
|
+
This is the preferred method for accessing RegistryPolicy in container-based code.
|
|
390
|
+
|
|
391
|
+
Note: This function is async because ModelONEXContainer.service_registry.resolve_service()
|
|
392
|
+
is async in omnibase_core v0.5.6 and later (see omnibase_core.container.ModelONEXContainer).
|
|
393
|
+
|
|
394
|
+
Args:
|
|
395
|
+
container: ONEX container instance with registered RegistryPolicy.
|
|
396
|
+
|
|
397
|
+
Returns:
|
|
398
|
+
RegistryPolicy instance from container.
|
|
399
|
+
|
|
400
|
+
Raises:
|
|
401
|
+
ServiceRegistryUnavailableError: If service_registry is missing or None.
|
|
402
|
+
ServiceResolutionError: If RegistryPolicy not registered in container.
|
|
403
|
+
|
|
404
|
+
Example:
|
|
405
|
+
>>> from omnibase_core.container import ModelONEXContainer
|
|
406
|
+
>>> container = ModelONEXContainer()
|
|
407
|
+
>>> await wire_infrastructure_services(container)
|
|
408
|
+
>>> registry = await get_policy_registry_from_container(container)
|
|
409
|
+
>>> isinstance(registry, RegistryPolicy)
|
|
410
|
+
True
|
|
411
|
+
|
|
412
|
+
Note:
|
|
413
|
+
This function assumes RegistryPolicy was registered via
|
|
414
|
+
wire_infrastructure_services(). If not, it will raise ServiceResolutionError.
|
|
415
|
+
For auto-registration, use get_or_create_policy_registry() instead.
|
|
416
|
+
"""
|
|
417
|
+
# Validate service_registry is available
|
|
418
|
+
_validate_service_registry(container, "resolve RegistryPolicy")
|
|
419
|
+
|
|
420
|
+
try:
|
|
421
|
+
registry: RegistryPolicy = await container.service_registry.resolve_service(
|
|
422
|
+
RegistryPolicy
|
|
423
|
+
)
|
|
424
|
+
return registry
|
|
425
|
+
except AttributeError as e:
|
|
426
|
+
# Note: service_registry case is now handled by _validate_service_registry
|
|
427
|
+
# This block handles other AttributeErrors like missing resolve_service
|
|
428
|
+
error_str = str(e)
|
|
429
|
+
if "resolve_service" in error_str:
|
|
430
|
+
hint = (
|
|
431
|
+
"Container.service_registry missing 'resolve_service' method. "
|
|
432
|
+
"Check omnibase_core version compatibility (requires v0.5.6 or later)."
|
|
433
|
+
)
|
|
434
|
+
else:
|
|
435
|
+
hint = f"Missing attribute in resolution chain: {e}"
|
|
436
|
+
|
|
437
|
+
logger.exception(
|
|
438
|
+
"Failed to resolve RegistryPolicy from container",
|
|
439
|
+
extra={
|
|
440
|
+
"error": error_str,
|
|
441
|
+
"error_type": "AttributeError",
|
|
442
|
+
"service_type": "RegistryPolicy",
|
|
443
|
+
"hint": hint,
|
|
444
|
+
},
|
|
445
|
+
)
|
|
446
|
+
context = ModelInfraErrorContext.with_correlation(
|
|
447
|
+
transport_type=EnumInfraTransportType.RUNTIME,
|
|
448
|
+
operation="resolve_policy_registry",
|
|
449
|
+
)
|
|
450
|
+
raise ServiceResolutionError(
|
|
451
|
+
f"Failed to resolve RegistryPolicy - {hint}",
|
|
452
|
+
service_name="RegistryPolicy",
|
|
453
|
+
context=context,
|
|
454
|
+
required_api="container.service_registry.resolve_service(RegistryPolicy)",
|
|
455
|
+
original_error=str(e),
|
|
456
|
+
) from e
|
|
457
|
+
except Exception as e:
|
|
458
|
+
logger.exception(
|
|
459
|
+
"Failed to resolve RegistryPolicy from container",
|
|
460
|
+
extra={
|
|
461
|
+
"error": str(e),
|
|
462
|
+
"error_type": type(e).__name__,
|
|
463
|
+
"service_type": "RegistryPolicy",
|
|
464
|
+
},
|
|
465
|
+
)
|
|
466
|
+
context = ModelInfraErrorContext.with_correlation(
|
|
467
|
+
transport_type=EnumInfraTransportType.RUNTIME,
|
|
468
|
+
operation="resolve_policy_registry",
|
|
469
|
+
)
|
|
470
|
+
raise ServiceResolutionError(
|
|
471
|
+
"RegistryPolicy not registered in container",
|
|
472
|
+
service_name="RegistryPolicy",
|
|
473
|
+
context=context,
|
|
474
|
+
fix="Call wire_infrastructure_services(container) first",
|
|
475
|
+
original_error=str(e),
|
|
476
|
+
) from e
|
|
477
|
+
|
|
478
|
+
|
|
479
|
+
async def get_or_create_policy_registry(
|
|
480
|
+
container: ModelONEXContainer,
|
|
481
|
+
) -> RegistryPolicy:
|
|
482
|
+
"""Get RegistryPolicy from container, creating if not registered.
|
|
483
|
+
|
|
484
|
+
Convenience function that provides lazy initialization semantics.
|
|
485
|
+
Attempts to resolve RegistryPolicy from container, and if not found,
|
|
486
|
+
creates and registers a new instance.
|
|
487
|
+
|
|
488
|
+
This function is useful when code paths may not have called
|
|
489
|
+
wire_infrastructure_services() yet or when lazy initialization is desired.
|
|
490
|
+
|
|
491
|
+
Note: This function is async because ModelONEXContainer.service_registry methods
|
|
492
|
+
(resolve_service and register_instance) are async in omnibase_core v0.5.6 and later.
|
|
493
|
+
|
|
494
|
+
Args:
|
|
495
|
+
container: ONEX container instance.
|
|
496
|
+
|
|
497
|
+
Returns:
|
|
498
|
+
RegistryPolicy instance from container (existing or newly created).
|
|
499
|
+
|
|
500
|
+
Example:
|
|
501
|
+
>>> container = ModelONEXContainer()
|
|
502
|
+
>>> # No wiring yet, but this still works
|
|
503
|
+
>>> registry = await get_or_create_policy_registry(container)
|
|
504
|
+
>>> isinstance(registry, RegistryPolicy)
|
|
505
|
+
True
|
|
506
|
+
>>> # Second call returns same instance
|
|
507
|
+
>>> registry2 = await get_or_create_policy_registry(container)
|
|
508
|
+
>>> registry is registry2
|
|
509
|
+
True
|
|
510
|
+
|
|
511
|
+
Note:
|
|
512
|
+
While this function provides convenience, prefer explicit wiring via
|
|
513
|
+
wire_infrastructure_services() for production code to ensure proper
|
|
514
|
+
initialization order and error handling.
|
|
515
|
+
"""
|
|
516
|
+
# Validate service_registry is available
|
|
517
|
+
_validate_service_registry(container, "get_or_create RegistryPolicy")
|
|
518
|
+
|
|
519
|
+
try:
|
|
520
|
+
# Try to resolve existing RegistryPolicy
|
|
521
|
+
registry: RegistryPolicy = await container.service_registry.resolve_service(
|
|
522
|
+
RegistryPolicy
|
|
523
|
+
)
|
|
524
|
+
return registry
|
|
525
|
+
except Exception:
|
|
526
|
+
# RegistryPolicy not registered, create and register it
|
|
527
|
+
logger.debug("RegistryPolicy not found in container, auto-registering")
|
|
528
|
+
|
|
529
|
+
try:
|
|
530
|
+
policy_registry = RegistryPolicy()
|
|
531
|
+
await container.service_registry.register_instance(
|
|
532
|
+
interface=RegistryPolicy,
|
|
533
|
+
instance=policy_registry,
|
|
534
|
+
scope=EnumInjectionScope.GLOBAL,
|
|
535
|
+
metadata={
|
|
536
|
+
"description": "ONEX policy plugin registry (auto-registered)",
|
|
537
|
+
"version": str(SEMVER_DEFAULT),
|
|
538
|
+
"auto_registered": True,
|
|
539
|
+
},
|
|
540
|
+
)
|
|
541
|
+
logger.debug("Auto-registered RegistryPolicy in container (lazy init)")
|
|
542
|
+
return policy_registry
|
|
543
|
+
|
|
544
|
+
except Exception as e:
|
|
545
|
+
logger.exception(
|
|
546
|
+
"Failed to auto-register RegistryPolicy",
|
|
547
|
+
extra={"error": str(e), "error_type": type(e).__name__},
|
|
548
|
+
)
|
|
549
|
+
context = ModelInfraErrorContext.with_correlation(
|
|
550
|
+
transport_type=EnumInfraTransportType.RUNTIME,
|
|
551
|
+
operation="auto_register_policy_registry",
|
|
552
|
+
)
|
|
553
|
+
raise ServiceRegistrationError(
|
|
554
|
+
"Failed to create and register RegistryPolicy",
|
|
555
|
+
service_name="RegistryPolicy",
|
|
556
|
+
context=context,
|
|
557
|
+
original_error=str(e),
|
|
558
|
+
) from e
|
|
559
|
+
|
|
560
|
+
|
|
561
|
+
async def get_handler_registry_from_container(
|
|
562
|
+
container: ModelONEXContainer,
|
|
563
|
+
) -> RegistryProtocolBinding:
|
|
564
|
+
"""Get RegistryProtocolBinding from container.
|
|
565
|
+
|
|
566
|
+
Resolves RegistryProtocolBinding using ModelONEXContainer.service_registry.resolve_service().
|
|
567
|
+
This is the preferred method for accessing RegistryProtocolBinding in container-based code.
|
|
568
|
+
|
|
569
|
+
Note: This function is async because ModelONEXContainer.service_registry.resolve_service()
|
|
570
|
+
is async in omnibase_core v0.5.6 and later (see omnibase_core.container.ModelONEXContainer).
|
|
571
|
+
|
|
572
|
+
Args:
|
|
573
|
+
container: ONEX container instance with registered RegistryProtocolBinding.
|
|
574
|
+
|
|
575
|
+
Returns:
|
|
576
|
+
RegistryProtocolBinding instance from container.
|
|
577
|
+
|
|
578
|
+
Raises:
|
|
579
|
+
ServiceRegistryUnavailableError: If service_registry is missing or None.
|
|
580
|
+
ServiceResolutionError: If RegistryProtocolBinding not registered in container.
|
|
581
|
+
|
|
582
|
+
Example:
|
|
583
|
+
>>> from omnibase_core.container import ModelONEXContainer
|
|
584
|
+
>>> container = ModelONEXContainer()
|
|
585
|
+
>>> await wire_infrastructure_services(container)
|
|
586
|
+
>>> registry = await get_handler_registry_from_container(container)
|
|
587
|
+
>>> # Verify via duck typing (per ONEX conventions)
|
|
588
|
+
>>> hasattr(registry, 'register') and callable(registry.register)
|
|
589
|
+
True
|
|
590
|
+
|
|
591
|
+
Note:
|
|
592
|
+
This function assumes RegistryProtocolBinding was registered via
|
|
593
|
+
wire_infrastructure_services(). If not, it will raise ServiceResolutionError.
|
|
594
|
+
"""
|
|
595
|
+
# Validate service_registry is available
|
|
596
|
+
_validate_service_registry(container, "resolve RegistryProtocolBinding")
|
|
597
|
+
|
|
598
|
+
try:
|
|
599
|
+
registry: RegistryProtocolBinding = (
|
|
600
|
+
await container.service_registry.resolve_service(RegistryProtocolBinding)
|
|
601
|
+
)
|
|
602
|
+
return registry
|
|
603
|
+
except AttributeError as e:
|
|
604
|
+
# Note: service_registry case is now handled by _validate_service_registry
|
|
605
|
+
# This block handles other AttributeErrors like missing resolve_service
|
|
606
|
+
error_str = str(e)
|
|
607
|
+
if "resolve_service" in error_str:
|
|
608
|
+
hint = (
|
|
609
|
+
"Container.service_registry missing 'resolve_service' method. "
|
|
610
|
+
"Check omnibase_core version compatibility (requires v0.5.6 or later)."
|
|
611
|
+
)
|
|
612
|
+
else:
|
|
613
|
+
hint = f"Missing attribute in resolution chain: {e}"
|
|
614
|
+
|
|
615
|
+
logger.exception(
|
|
616
|
+
"Failed to resolve RegistryProtocolBinding from container",
|
|
617
|
+
extra={
|
|
618
|
+
"error": error_str,
|
|
619
|
+
"error_type": "AttributeError",
|
|
620
|
+
"service_type": "RegistryProtocolBinding",
|
|
621
|
+
"hint": hint,
|
|
622
|
+
},
|
|
623
|
+
)
|
|
624
|
+
context = ModelInfraErrorContext.with_correlation(
|
|
625
|
+
transport_type=EnumInfraTransportType.RUNTIME,
|
|
626
|
+
operation="resolve_handler_registry",
|
|
627
|
+
)
|
|
628
|
+
raise ServiceResolutionError(
|
|
629
|
+
f"Failed to resolve RegistryProtocolBinding - {hint}",
|
|
630
|
+
service_name="RegistryProtocolBinding",
|
|
631
|
+
context=context,
|
|
632
|
+
required_api="container.service_registry.resolve_service(RegistryProtocolBinding)",
|
|
633
|
+
original_error=str(e),
|
|
634
|
+
) from e
|
|
635
|
+
except Exception as e:
|
|
636
|
+
logger.exception(
|
|
637
|
+
"Failed to resolve RegistryProtocolBinding from container",
|
|
638
|
+
extra={
|
|
639
|
+
"error": str(e),
|
|
640
|
+
"error_type": type(e).__name__,
|
|
641
|
+
"service_type": "RegistryProtocolBinding",
|
|
642
|
+
},
|
|
643
|
+
)
|
|
644
|
+
context = ModelInfraErrorContext.with_correlation(
|
|
645
|
+
transport_type=EnumInfraTransportType.RUNTIME,
|
|
646
|
+
operation="resolve_handler_registry",
|
|
647
|
+
)
|
|
648
|
+
raise ServiceResolutionError(
|
|
649
|
+
"RegistryProtocolBinding not registered in container",
|
|
650
|
+
service_name="RegistryProtocolBinding",
|
|
651
|
+
context=context,
|
|
652
|
+
fix="Call wire_infrastructure_services(container) first",
|
|
653
|
+
original_error=str(e),
|
|
654
|
+
) from e
|
|
655
|
+
|
|
656
|
+
|
|
657
|
+
async def get_compute_registry_from_container(
|
|
658
|
+
container: ModelONEXContainer,
|
|
659
|
+
) -> RegistryCompute:
|
|
660
|
+
"""Get RegistryCompute from container.
|
|
661
|
+
|
|
662
|
+
Resolves RegistryCompute using ModelONEXContainer.service_registry.resolve_service().
|
|
663
|
+
This is the preferred method for accessing RegistryCompute in container-based code.
|
|
664
|
+
|
|
665
|
+
Note: This function is async because ModelONEXContainer.service_registry.resolve_service()
|
|
666
|
+
is async in omnibase_core v0.5.6 and later (see omnibase_core.container.ModelONEXContainer).
|
|
667
|
+
|
|
668
|
+
Args:
|
|
669
|
+
container: ONEX container instance with registered RegistryCompute.
|
|
670
|
+
|
|
671
|
+
Returns:
|
|
672
|
+
RegistryCompute instance from container.
|
|
673
|
+
|
|
674
|
+
Raises:
|
|
675
|
+
ServiceRegistryUnavailableError: If service_registry is missing or None.
|
|
676
|
+
ServiceResolutionError: If RegistryCompute not registered in container.
|
|
677
|
+
|
|
678
|
+
Example:
|
|
679
|
+
>>> from omnibase_core.container import ModelONEXContainer
|
|
680
|
+
>>> container = ModelONEXContainer()
|
|
681
|
+
>>> await wire_infrastructure_services(container)
|
|
682
|
+
>>> registry = await get_compute_registry_from_container(container)
|
|
683
|
+
>>> isinstance(registry, RegistryCompute)
|
|
684
|
+
True
|
|
685
|
+
|
|
686
|
+
Note:
|
|
687
|
+
This function assumes RegistryCompute was registered via
|
|
688
|
+
wire_infrastructure_services(). If not, it will raise ServiceResolutionError.
|
|
689
|
+
For auto-registration, use get_or_create_compute_registry() instead.
|
|
690
|
+
"""
|
|
691
|
+
# Validate service_registry is available
|
|
692
|
+
_validate_service_registry(container, "resolve RegistryCompute")
|
|
693
|
+
|
|
694
|
+
try:
|
|
695
|
+
registry: RegistryCompute = await container.service_registry.resolve_service(
|
|
696
|
+
RegistryCompute
|
|
697
|
+
)
|
|
698
|
+
return registry
|
|
699
|
+
except AttributeError as e:
|
|
700
|
+
# Note: service_registry case is now handled by _validate_service_registry
|
|
701
|
+
# This block handles other AttributeErrors like missing resolve_service
|
|
702
|
+
error_str = str(e)
|
|
703
|
+
if "resolve_service" in error_str:
|
|
704
|
+
hint = (
|
|
705
|
+
"Container.service_registry missing 'resolve_service' method. "
|
|
706
|
+
"Check omnibase_core version compatibility (requires v0.5.6 or later)."
|
|
707
|
+
)
|
|
708
|
+
else:
|
|
709
|
+
hint = f"Missing attribute in resolution chain: {e}"
|
|
710
|
+
|
|
711
|
+
logger.exception(
|
|
712
|
+
"Failed to resolve RegistryCompute from container",
|
|
713
|
+
extra={
|
|
714
|
+
"error": error_str,
|
|
715
|
+
"error_type": "AttributeError",
|
|
716
|
+
"service_type": "RegistryCompute",
|
|
717
|
+
"hint": hint,
|
|
718
|
+
},
|
|
719
|
+
)
|
|
720
|
+
context = ModelInfraErrorContext.with_correlation(
|
|
721
|
+
transport_type=EnumInfraTransportType.RUNTIME,
|
|
722
|
+
operation="resolve_compute_registry",
|
|
723
|
+
)
|
|
724
|
+
raise ServiceResolutionError(
|
|
725
|
+
f"Failed to resolve RegistryCompute - {hint}",
|
|
726
|
+
service_name="RegistryCompute",
|
|
727
|
+
context=context,
|
|
728
|
+
required_api="container.service_registry.resolve_service(RegistryCompute)",
|
|
729
|
+
original_error=str(e),
|
|
730
|
+
) from e
|
|
731
|
+
except Exception as e:
|
|
732
|
+
logger.exception(
|
|
733
|
+
"Failed to resolve RegistryCompute from container",
|
|
734
|
+
extra={
|
|
735
|
+
"error": str(e),
|
|
736
|
+
"error_type": type(e).__name__,
|
|
737
|
+
"service_type": "RegistryCompute",
|
|
738
|
+
},
|
|
739
|
+
)
|
|
740
|
+
context = ModelInfraErrorContext.with_correlation(
|
|
741
|
+
transport_type=EnumInfraTransportType.RUNTIME,
|
|
742
|
+
operation="resolve_compute_registry",
|
|
743
|
+
)
|
|
744
|
+
raise ServiceResolutionError(
|
|
745
|
+
"RegistryCompute not registered in container",
|
|
746
|
+
service_name="RegistryCompute",
|
|
747
|
+
context=context,
|
|
748
|
+
fix="Call wire_infrastructure_services(container) first",
|
|
749
|
+
original_error=str(e),
|
|
750
|
+
) from e
|
|
751
|
+
|
|
752
|
+
|
|
753
|
+
async def get_or_create_compute_registry(
|
|
754
|
+
container: ModelONEXContainer,
|
|
755
|
+
) -> RegistryCompute:
|
|
756
|
+
"""Get RegistryCompute from container, creating if not registered.
|
|
757
|
+
|
|
758
|
+
Convenience function that provides lazy initialization semantics.
|
|
759
|
+
Attempts to resolve RegistryCompute from container, and if not found,
|
|
760
|
+
creates and registers a new instance.
|
|
761
|
+
|
|
762
|
+
This function is useful when code paths may not have called
|
|
763
|
+
wire_infrastructure_services() yet or when lazy initialization is desired.
|
|
764
|
+
|
|
765
|
+
Note: This function is async because ModelONEXContainer.service_registry methods
|
|
766
|
+
(resolve_service and register_instance) are async in omnibase_core v0.5.6 and later.
|
|
767
|
+
|
|
768
|
+
Args:
|
|
769
|
+
container: ONEX container instance.
|
|
770
|
+
|
|
771
|
+
Returns:
|
|
772
|
+
RegistryCompute instance from container (existing or newly created).
|
|
773
|
+
|
|
774
|
+
Example:
|
|
775
|
+
>>> container = ModelONEXContainer()
|
|
776
|
+
>>> # No wiring yet, but this still works
|
|
777
|
+
>>> registry = await get_or_create_compute_registry(container)
|
|
778
|
+
>>> isinstance(registry, RegistryCompute)
|
|
779
|
+
True
|
|
780
|
+
>>> # Second call returns same instance
|
|
781
|
+
>>> registry2 = await get_or_create_compute_registry(container)
|
|
782
|
+
>>> registry is registry2
|
|
783
|
+
True
|
|
784
|
+
|
|
785
|
+
Note:
|
|
786
|
+
While this function provides convenience, prefer explicit wiring via
|
|
787
|
+
wire_infrastructure_services() for production code to ensure proper
|
|
788
|
+
initialization order and error handling.
|
|
789
|
+
"""
|
|
790
|
+
# Validate service_registry is available
|
|
791
|
+
_validate_service_registry(container, "get_or_create RegistryCompute")
|
|
792
|
+
|
|
793
|
+
try:
|
|
794
|
+
# Try to resolve existing RegistryCompute
|
|
795
|
+
registry: RegistryCompute = await container.service_registry.resolve_service(
|
|
796
|
+
RegistryCompute
|
|
797
|
+
)
|
|
798
|
+
return registry
|
|
799
|
+
except Exception:
|
|
800
|
+
# RegistryCompute not registered, create and register it
|
|
801
|
+
logger.debug("RegistryCompute not found in container, auto-registering")
|
|
802
|
+
|
|
803
|
+
try:
|
|
804
|
+
compute_registry = RegistryCompute()
|
|
805
|
+
await container.service_registry.register_instance(
|
|
806
|
+
interface=RegistryCompute,
|
|
807
|
+
instance=compute_registry,
|
|
808
|
+
scope=EnumInjectionScope.GLOBAL,
|
|
809
|
+
metadata={
|
|
810
|
+
"description": "ONEX compute plugin registry (auto-registered)",
|
|
811
|
+
"version": str(SEMVER_DEFAULT),
|
|
812
|
+
"auto_registered": True,
|
|
813
|
+
},
|
|
814
|
+
)
|
|
815
|
+
logger.debug("Auto-registered RegistryCompute in container (lazy init)")
|
|
816
|
+
return compute_registry
|
|
817
|
+
|
|
818
|
+
except Exception as e:
|
|
819
|
+
logger.exception(
|
|
820
|
+
"Failed to auto-register RegistryCompute",
|
|
821
|
+
extra={"error": str(e), "error_type": type(e).__name__},
|
|
822
|
+
)
|
|
823
|
+
context = ModelInfraErrorContext.with_correlation(
|
|
824
|
+
transport_type=EnumInfraTransportType.RUNTIME,
|
|
825
|
+
operation="auto_register_compute_registry",
|
|
826
|
+
)
|
|
827
|
+
raise ServiceRegistrationError(
|
|
828
|
+
"Failed to create and register RegistryCompute",
|
|
829
|
+
service_name="RegistryCompute",
|
|
830
|
+
context=context,
|
|
831
|
+
original_error=str(e),
|
|
832
|
+
) from e
|
|
833
|
+
|
|
834
|
+
|
|
835
|
+
async def wire_registration_handlers(
|
|
836
|
+
container: ModelONEXContainer,
|
|
837
|
+
pool: asyncpg.Pool,
|
|
838
|
+
liveness_interval_seconds: int | None = None,
|
|
839
|
+
projector: ProjectorShell | None = None,
|
|
840
|
+
consul_handler: HandlerConsul | None = None,
|
|
841
|
+
) -> WiringResult:
|
|
842
|
+
"""Register registration orchestrator handlers with the container.
|
|
843
|
+
|
|
844
|
+
This function delegates to the Registration domain wiring module,
|
|
845
|
+
following the domain-driven design principle where Registration-specific
|
|
846
|
+
code lives in the Registration domain rather than the generic runtime layer.
|
|
847
|
+
|
|
848
|
+
Registers ProjectionReaderRegistration and the three registration handlers:
|
|
849
|
+
- HandlerNodeIntrospected
|
|
850
|
+
- HandlerRuntimeTick
|
|
851
|
+
- HandlerNodeRegistrationAcked
|
|
852
|
+
|
|
853
|
+
All handlers depend on ProjectionReaderRegistration, which is registered first.
|
|
854
|
+
This enables declarative dependency resolution when constructing the
|
|
855
|
+
NodeRegistrationOrchestrator.
|
|
856
|
+
|
|
857
|
+
Args:
|
|
858
|
+
container: ONEX container instance to register services in.
|
|
859
|
+
pool: asyncpg connection pool for database access.
|
|
860
|
+
liveness_interval_seconds: Liveness deadline interval for ack handler.
|
|
861
|
+
If None, uses ONEX_LIVENESS_INTERVAL_SECONDS env var or default (60s).
|
|
862
|
+
projector: Optional ProjectorShell for persisting state transitions.
|
|
863
|
+
If provided, HandlerNodeIntrospected will persist projections to the
|
|
864
|
+
database using ProjectorShell.partial_update() and upsert_partial().
|
|
865
|
+
If None, the handler operates in read-only mode (useful for testing
|
|
866
|
+
or when projection persistence is handled elsewhere).
|
|
867
|
+
consul_handler: Optional HandlerConsul for dual registration with Consul.
|
|
868
|
+
If provided, HandlerNodeIntrospected will register nodes with Consul
|
|
869
|
+
for service discovery. If None, only PostgreSQL registration occurs.
|
|
870
|
+
|
|
871
|
+
Returns:
|
|
872
|
+
Summary dict with:
|
|
873
|
+
- services: List of registered service class names
|
|
874
|
+
- status: Always "success" (errors raise exceptions)
|
|
875
|
+
|
|
876
|
+
Raises:
|
|
877
|
+
ServiceRegistryUnavailableError: If service_registry is missing or None.
|
|
878
|
+
ContainerWiringError: If service registration fails.
|
|
879
|
+
|
|
880
|
+
Example:
|
|
881
|
+
>>> from omnibase_core.container import ModelONEXContainer
|
|
882
|
+
>>> from omnibase_infra.runtime.projector_shell import ProjectorShell
|
|
883
|
+
>>> from omnibase_infra.runtime.projector_plugin_loader import ProjectorPluginLoader
|
|
884
|
+
>>> import asyncpg
|
|
885
|
+
>>> container = ModelONEXContainer()
|
|
886
|
+
>>> pool = await asyncpg.create_pool(dsn)
|
|
887
|
+
>>> # Load projector from contract
|
|
888
|
+
>>> loader = ProjectorPluginLoader()
|
|
889
|
+
>>> projector = await loader.load_from_contract("registration_projector", pool)
|
|
890
|
+
>>> summary = await wire_registration_handlers(container, pool, projector=projector)
|
|
891
|
+
>>> print(summary)
|
|
892
|
+
{'services': ['ProjectionReaderRegistration', 'HandlerNodeIntrospected', ...], 'status': 'success'}
|
|
893
|
+
>>> # Resolve handlers from container
|
|
894
|
+
>>> handler = await container.service_registry.resolve_service(HandlerNodeIntrospected)
|
|
895
|
+
|
|
896
|
+
Note:
|
|
897
|
+
This function delegates to the Registration domain wiring module
|
|
898
|
+
(omnibase_infra.nodes.node_registration_orchestrator.wiring) to keep
|
|
899
|
+
Registration-specific code in its own domain. See OMN-1346.
|
|
900
|
+
"""
|
|
901
|
+
# Delegate to the Registration domain wiring module
|
|
902
|
+
# This keeps Registration-specific logic (handlers, projectors) in its domain
|
|
903
|
+
from omnibase_infra.nodes.node_registration_orchestrator.wiring import (
|
|
904
|
+
wire_registration_handlers as _wire_registration_handlers,
|
|
905
|
+
)
|
|
906
|
+
|
|
907
|
+
return await _wire_registration_handlers(
|
|
908
|
+
container,
|
|
909
|
+
pool,
|
|
910
|
+
liveness_interval_seconds=liveness_interval_seconds,
|
|
911
|
+
projector=projector,
|
|
912
|
+
consul_handler=consul_handler,
|
|
913
|
+
)
|
|
914
|
+
|
|
915
|
+
|
|
916
|
+
async def get_projection_reader_from_container(
|
|
917
|
+
container: ModelONEXContainer,
|
|
918
|
+
) -> ProjectionReaderRegistration:
|
|
919
|
+
"""Get ProjectionReaderRegistration from container.
|
|
920
|
+
|
|
921
|
+
This function delegates to the Registration domain wiring module.
|
|
922
|
+
|
|
923
|
+
Args:
|
|
924
|
+
container: ONEX container instance with registered ProjectionReaderRegistration.
|
|
925
|
+
|
|
926
|
+
Returns:
|
|
927
|
+
ProjectionReaderRegistration instance from container.
|
|
928
|
+
|
|
929
|
+
Raises:
|
|
930
|
+
ServiceRegistryUnavailableError: If service_registry is missing or None.
|
|
931
|
+
ServiceResolutionError: If ProjectionReaderRegistration not registered in container.
|
|
932
|
+
|
|
933
|
+
Example:
|
|
934
|
+
>>> pool = await asyncpg.create_pool(dsn)
|
|
935
|
+
>>> await wire_registration_handlers(container, pool)
|
|
936
|
+
>>> reader = await get_projection_reader_from_container(container)
|
|
937
|
+
|
|
938
|
+
Note:
|
|
939
|
+
This function delegates to the Registration domain wiring module
|
|
940
|
+
(omnibase_infra.nodes.node_registration_orchestrator.wiring). See OMN-1346.
|
|
941
|
+
"""
|
|
942
|
+
from omnibase_infra.nodes.node_registration_orchestrator.wiring import (
|
|
943
|
+
get_projection_reader_from_container as _get_projection_reader,
|
|
944
|
+
)
|
|
945
|
+
|
|
946
|
+
return await _get_projection_reader(container)
|
|
947
|
+
|
|
948
|
+
|
|
949
|
+
async def get_handler_node_introspected_from_container(
|
|
950
|
+
container: ModelONEXContainer,
|
|
951
|
+
) -> HandlerNodeIntrospected:
|
|
952
|
+
"""Get HandlerNodeIntrospected from container.
|
|
953
|
+
|
|
954
|
+
This function delegates to the Registration domain wiring module.
|
|
955
|
+
|
|
956
|
+
Args:
|
|
957
|
+
container: ONEX container instance with registered handlers.
|
|
958
|
+
|
|
959
|
+
Returns:
|
|
960
|
+
HandlerNodeIntrospected instance from container.
|
|
961
|
+
|
|
962
|
+
Raises:
|
|
963
|
+
ServiceRegistryUnavailableError: If service_registry is missing or None.
|
|
964
|
+
ServiceResolutionError: If handler not registered in container.
|
|
965
|
+
|
|
966
|
+
Note:
|
|
967
|
+
This function delegates to the Registration domain wiring module
|
|
968
|
+
(omnibase_infra.nodes.node_registration_orchestrator.wiring). See OMN-1346.
|
|
969
|
+
"""
|
|
970
|
+
from omnibase_infra.nodes.node_registration_orchestrator.wiring import (
|
|
971
|
+
get_handler_node_introspected_from_container as _get_handler,
|
|
972
|
+
)
|
|
973
|
+
|
|
974
|
+
return await _get_handler(container)
|
|
975
|
+
|
|
976
|
+
|
|
977
|
+
async def get_handler_runtime_tick_from_container(
|
|
978
|
+
container: ModelONEXContainer,
|
|
979
|
+
) -> HandlerRuntimeTick:
|
|
980
|
+
"""Get HandlerRuntimeTick from container.
|
|
981
|
+
|
|
982
|
+
This function delegates to the Registration domain wiring module.
|
|
983
|
+
|
|
984
|
+
Args:
|
|
985
|
+
container: ONEX container instance with registered handlers.
|
|
986
|
+
|
|
987
|
+
Returns:
|
|
988
|
+
HandlerRuntimeTick instance from container.
|
|
989
|
+
|
|
990
|
+
Raises:
|
|
991
|
+
ServiceRegistryUnavailableError: If service_registry is missing or None.
|
|
992
|
+
ServiceResolutionError: If handler not registered in container.
|
|
993
|
+
|
|
994
|
+
Note:
|
|
995
|
+
This function delegates to the Registration domain wiring module
|
|
996
|
+
(omnibase_infra.nodes.node_registration_orchestrator.wiring). See OMN-1346.
|
|
997
|
+
"""
|
|
998
|
+
from omnibase_infra.nodes.node_registration_orchestrator.wiring import (
|
|
999
|
+
get_handler_runtime_tick_from_container as _get_handler,
|
|
1000
|
+
)
|
|
1001
|
+
|
|
1002
|
+
return await _get_handler(container)
|
|
1003
|
+
|
|
1004
|
+
|
|
1005
|
+
async def get_handler_node_registration_acked_from_container(
|
|
1006
|
+
container: ModelONEXContainer,
|
|
1007
|
+
) -> HandlerNodeRegistrationAcked:
|
|
1008
|
+
"""Get HandlerNodeRegistrationAcked from container.
|
|
1009
|
+
|
|
1010
|
+
This function delegates to the Registration domain wiring module.
|
|
1011
|
+
|
|
1012
|
+
Args:
|
|
1013
|
+
container: ONEX container instance with registered handlers.
|
|
1014
|
+
|
|
1015
|
+
Returns:
|
|
1016
|
+
HandlerNodeRegistrationAcked instance from container.
|
|
1017
|
+
|
|
1018
|
+
Raises:
|
|
1019
|
+
ServiceRegistryUnavailableError: If service_registry is missing or None.
|
|
1020
|
+
ServiceResolutionError: If handler not registered in container.
|
|
1021
|
+
|
|
1022
|
+
Note:
|
|
1023
|
+
This function delegates to the Registration domain wiring module
|
|
1024
|
+
(omnibase_infra.nodes.node_registration_orchestrator.wiring). See OMN-1346.
|
|
1025
|
+
"""
|
|
1026
|
+
from omnibase_infra.nodes.node_registration_orchestrator.wiring import (
|
|
1027
|
+
get_handler_node_registration_acked_from_container as _get_handler,
|
|
1028
|
+
)
|
|
1029
|
+
|
|
1030
|
+
return await _get_handler(container)
|
|
1031
|
+
|
|
1032
|
+
|
|
1033
|
+
async def wire_registration_dispatchers(
|
|
1034
|
+
container: ModelONEXContainer,
|
|
1035
|
+
engine: MessageDispatchEngine,
|
|
1036
|
+
) -> dict[str, list[str] | str]:
|
|
1037
|
+
"""Wire registration dispatchers into MessageDispatchEngine.
|
|
1038
|
+
|
|
1039
|
+
This function delegates to the Registration domain wiring module,
|
|
1040
|
+
following the domain-driven design principle where Registration-specific
|
|
1041
|
+
code lives in the Registration domain rather than the generic runtime layer.
|
|
1042
|
+
|
|
1043
|
+
Creates dispatcher adapters for the registration handlers and registers
|
|
1044
|
+
them with the MessageDispatchEngine. This enables the engine to route
|
|
1045
|
+
introspection events to the appropriate handlers.
|
|
1046
|
+
|
|
1047
|
+
Prerequisites:
|
|
1048
|
+
- wire_registration_handlers() must be called first to register
|
|
1049
|
+
the underlying handlers in the container.
|
|
1050
|
+
- MessageDispatchEngine must not be frozen yet. If the engine is already
|
|
1051
|
+
frozen, dispatcher registration will fail with a ContainerWiringError.
|
|
1052
|
+
|
|
1053
|
+
Args:
|
|
1054
|
+
container: ONEX container with registered handlers.
|
|
1055
|
+
engine: MessageDispatchEngine instance to register dispatchers with.
|
|
1056
|
+
|
|
1057
|
+
Returns:
|
|
1058
|
+
Summary dict with diagnostic information:
|
|
1059
|
+
- dispatchers: List of registered dispatcher IDs (e.g.,
|
|
1060
|
+
['dispatcher.node-introspected', 'dispatcher.runtime-tick',
|
|
1061
|
+
'dispatcher.node-registration-acked'])
|
|
1062
|
+
- routes: List of registered route IDs (e.g.,
|
|
1063
|
+
['route.registration.node-introspection', 'route.registration.runtime-tick',
|
|
1064
|
+
'route.registration.node-registration-acked'])
|
|
1065
|
+
- status: Always "success" (errors raise exceptions)
|
|
1066
|
+
|
|
1067
|
+
This diagnostic output can be logged or used to verify correct wiring.
|
|
1068
|
+
|
|
1069
|
+
Raises:
|
|
1070
|
+
ServiceRegistryUnavailableError: If service_registry is missing or None.
|
|
1071
|
+
ContainerWiringError: If required handlers are not registered in the container,
|
|
1072
|
+
or if the engine is already frozen (cannot register new dispatchers).
|
|
1073
|
+
|
|
1074
|
+
Engine Frozen Behavior:
|
|
1075
|
+
If engine.freeze() has been called before this function, the engine
|
|
1076
|
+
will reject new dispatcher registrations. Ensure this function is called
|
|
1077
|
+
during the wiring phase before engine.freeze() is invoked.
|
|
1078
|
+
|
|
1079
|
+
Example:
|
|
1080
|
+
>>> from omnibase_core.container import ModelONEXContainer
|
|
1081
|
+
>>> from omnibase_infra.runtime.service_message_dispatch_engine import MessageDispatchEngine
|
|
1082
|
+
>>> import asyncpg
|
|
1083
|
+
>>>
|
|
1084
|
+
>>> container = ModelONEXContainer()
|
|
1085
|
+
>>> pool = await asyncpg.create_pool(dsn)
|
|
1086
|
+
>>> await wire_registration_handlers(container, pool)
|
|
1087
|
+
>>>
|
|
1088
|
+
>>> engine = MessageDispatchEngine()
|
|
1089
|
+
>>> summary = await wire_registration_dispatchers(container, engine)
|
|
1090
|
+
>>> print(summary)
|
|
1091
|
+
{'dispatchers': [...], 'routes': [...]}
|
|
1092
|
+
>>> engine.freeze() # Must freeze after wiring
|
|
1093
|
+
|
|
1094
|
+
Note:
|
|
1095
|
+
This function delegates to the Registration domain wiring module
|
|
1096
|
+
(omnibase_infra.nodes.node_registration_orchestrator.wiring) to keep
|
|
1097
|
+
Registration-specific code in its own domain. See OMN-1346.
|
|
1098
|
+
"""
|
|
1099
|
+
# Delegate to the Registration domain wiring module
|
|
1100
|
+
# This keeps Registration-specific logic (route IDs, dispatchers) in its domain
|
|
1101
|
+
from omnibase_infra.nodes.node_registration_orchestrator.wiring import (
|
|
1102
|
+
wire_registration_dispatchers as _wire_registration_dispatchers,
|
|
1103
|
+
)
|
|
1104
|
+
|
|
1105
|
+
return await _wire_registration_dispatchers(container, engine)
|
|
1106
|
+
|
|
1107
|
+
|
|
1108
|
+
__all__: list[str] = [
|
|
1109
|
+
# Container wiring functions
|
|
1110
|
+
"get_compute_registry_from_container",
|
|
1111
|
+
"get_handler_node_introspected_from_container",
|
|
1112
|
+
"get_handler_node_registration_acked_from_container",
|
|
1113
|
+
"get_handler_registry_from_container",
|
|
1114
|
+
"get_handler_runtime_tick_from_container",
|
|
1115
|
+
"get_or_create_compute_registry",
|
|
1116
|
+
"get_or_create_policy_registry",
|
|
1117
|
+
"get_policy_registry_from_container",
|
|
1118
|
+
"get_projection_reader_from_container",
|
|
1119
|
+
"wire_infrastructure_services",
|
|
1120
|
+
# Registration handlers (OMN-888)
|
|
1121
|
+
"wire_registration_handlers",
|
|
1122
|
+
# Registration dispatchers (OMN-892)
|
|
1123
|
+
"wire_registration_dispatchers",
|
|
1124
|
+
]
|