omnibase_infra 0.2.1__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/cli/__init__.py +1 -0
- omnibase_infra/cli/commands.py +216 -0
- omnibase_infra/clients/__init__.py +0 -0
- omnibase_infra/contracts/handlers/filesystem/handler_contract.yaml +261 -0
- omnibase_infra/contracts/handlers/mcp/handler_contract.yaml +138 -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 +123 -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_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 +101 -0
- omnibase_infra/enums/enum_handler_loader_error.py +178 -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_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 +156 -0
- omnibase_infra/errors/error_architecture_violation.py +152 -0
- omnibase_infra/errors/error_chain_propagation.py +188 -0
- omnibase_infra/errors/error_compute_registry.py +92 -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 +102 -0
- omnibase_infra/errors/error_infra.py +608 -0
- omnibase_infra/errors/error_message_type_registry.py +101 -0
- omnibase_infra/errors/error_policy_registry.py +112 -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 +86 -0
- omnibase_infra/event_bus/event_bus_inmemory.py +743 -0
- omnibase_infra/event_bus/event_bus_kafka.py +1658 -0
- omnibase_infra/event_bus/mixin_kafka_broadcast.py +184 -0
- omnibase_infra/event_bus/mixin_kafka_dlq.py +765 -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 +725 -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/topic_constants.py +376 -0
- omnibase_infra/handlers/__init__.py +75 -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 +787 -0
- omnibase_infra/handlers/handler_db.py +1039 -0
- omnibase_infra/handlers/handler_filesystem.py +1478 -0
- omnibase_infra/handlers/handler_graph.py +1154 -0
- omnibase_infra/handlers/handler_http.py +920 -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 +748 -0
- omnibase_infra/handlers/handler_qdrant.py +1076 -0
- omnibase_infra/handlers/handler_vault.py +422 -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 +42 -0
- omnibase_infra/handlers/mixins/mixin_consul_initialization.py +349 -0
- omnibase_infra/handlers/mixins/mixin_consul_kv.py +337 -0
- omnibase_infra/handlers/mixins/mixin_consul_service.py +277 -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 +915 -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 +747 -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 +99 -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/mixins/__init__.py +71 -0
- omnibase_infra/mixins/mixin_async_circuit_breaker.py +655 -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 +2465 -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 +136 -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 +311 -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 +147 -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_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 +37 -0
- omnibase_infra/models/handlers/model_contract_discovery_result.py +80 -0
- omnibase_infra/models/handlers/model_handler_descriptor.py +185 -0
- omnibase_infra/models/handlers/model_handler_identifier.py +215 -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/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 +590 -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 +59 -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_introspection_metrics.py +253 -0
- omnibase_infra/models/registration/model_node_capabilities.py +179 -0
- omnibase_infra/models/registration/model_node_heartbeat_event.py +126 -0
- omnibase_infra/models/registration/model_node_introspection_event.py +175 -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 +40 -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 +280 -0
- omnibase_infra/models/runtime/model_loaded_handler.py +120 -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 +48 -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 +208 -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 +99 -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/effects/README.md +358 -0
- omnibase_infra/nodes/effects/__init__.py +26 -0
- omnibase_infra/nodes/effects/contract.yaml +172 -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/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 +475 -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 +609 -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 +525 -0
- omnibase_infra/nodes/node_registration_orchestrator/timeout_coordinator.py +392 -0
- omnibase_infra/nodes/node_registration_orchestrator/wiring.py +742 -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 +225 -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 +109 -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 +194 -0
- omnibase_infra/nodes/node_registry_effect/__init__.py +85 -0
- omnibase_infra/nodes/node_registry_effect/contract.yaml +682 -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 +416 -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 +214 -0
- omnibase_infra/nodes/reducers/__init__.py +30 -0
- omnibase_infra/nodes/reducers/models/__init__.py +32 -0
- omnibase_infra/nodes/reducers/models/model_payload_consul_register.py +76 -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 +1137 -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 +435 -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 +99 -0
- omnibase_infra/protocols/protocol_capability_projection.py +253 -0
- omnibase_infra/protocols/protocol_capability_query.py +251 -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 +296 -0
- omnibase_infra/runtime/binding_config_resolver.py +2706 -0
- omnibase_infra/runtime/chain_aware_dispatch.py +467 -0
- omnibase_infra/runtime/contract_handler_discovery.py +582 -0
- omnibase_infra/runtime/contract_loaders/__init__.py +42 -0
- omnibase_infra/runtime/contract_loaders/handler_routing_loader.py +464 -0
- omnibase_infra/runtime/dispatch_context_enforcer.py +427 -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/handler_contract_source.py +669 -0
- omnibase_infra/runtime/handler_plugin_loader.py +2029 -0
- omnibase_infra/runtime/handler_registry.py +321 -0
- omnibase_infra/runtime/invocation_security_enforcer.py +427 -0
- omnibase_infra/runtime/kernel.py +40 -0
- omnibase_infra/runtime/mixin_policy_validation.py +522 -0
- omnibase_infra/runtime/mixin_semver_cache.py +378 -0
- omnibase_infra/runtime/mixins/__init__.py +17 -0
- omnibase_infra/runtime/mixins/mixin_projector_sql_operations.py +757 -0
- omnibase_infra/runtime/models/__init__.py +192 -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_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 +228 -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_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_scheduler_config.py +624 -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_shutdown_batch_result.py +75 -0
- omnibase_infra/runtime/models/model_shutdown_config.py +94 -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 +1102 -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 +27 -0
- omnibase_infra/runtime/protocols/protocol_runtime_scheduler.py +468 -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 +444 -0
- omnibase_infra/runtime/registry_compute.py +1143 -0
- omnibase_infra/runtime/registry_dispatcher.py +678 -0
- omnibase_infra/runtime/registry_policy.py +1502 -0
- omnibase_infra/runtime/runtime_scheduler.py +1070 -0
- omnibase_infra/runtime/secret_resolver.py +2110 -0
- omnibase_infra/runtime/security_metadata_validator.py +776 -0
- omnibase_infra/runtime/service_kernel.py +1573 -0
- omnibase_infra/runtime/service_message_dispatch_engine.py +1805 -0
- omnibase_infra/runtime/service_runtime_host_process.py +2260 -0
- omnibase_infra/runtime/util_container_wiring.py +1123 -0
- omnibase_infra/runtime/util_validation.py +314 -0
- omnibase_infra/runtime/util_version.py +98 -0
- omnibase_infra/runtime/util_wiring.py +566 -0
- omnibase_infra/schemas/schema_registration_projection.sql +320 -0
- omnibase_infra/services/__init__.py +68 -0
- omnibase_infra/services/corpus_capture.py +678 -0
- omnibase_infra/services/service_capability_query.py +945 -0
- omnibase_infra/services/service_health.py +897 -0
- omnibase_infra/services/service_node_selector.py +530 -0
- omnibase_infra/services/service_timeout_emitter.py +682 -0
- omnibase_infra/services/service_timeout_scanner.py +390 -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/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 +21 -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 +89 -0
- omnibase_infra/utils/correlation.py +208 -0
- omnibase_infra/utils/util_datetime.py +372 -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_semver.py +233 -0
- omnibase_infra/validation/__init__.py +307 -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 +1486 -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 +1710 -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 +410 -0
- omnibase_infra/validation/validator_topic_category.py +1152 -0
- omnibase_infra-0.2.1.dist-info/METADATA +197 -0
- omnibase_infra-0.2.1.dist-info/RECORD +675 -0
- omnibase_infra-0.2.1.dist-info/WHEEL +4 -0
- omnibase_infra-0.2.1.dist-info/entry_points.txt +4 -0
- omnibase_infra-0.2.1.dist-info/licenses/LICENSE +21 -0
|
@@ -0,0 +1,386 @@
|
|
|
1
|
+
# SPDX-License-Identifier: MIT
|
|
2
|
+
# Copyright (c) 2025 OmniNode Team
|
|
3
|
+
"""Reusable retry execution mixin for infrastructure handlers.
|
|
4
|
+
|
|
5
|
+
This module provides a mixin class that encapsulates retry logic with
|
|
6
|
+
exponential backoff, circuit breaker integration, and standardized
|
|
7
|
+
error handling for infrastructure handlers like Consul and Vault.
|
|
8
|
+
|
|
9
|
+
Features:
|
|
10
|
+
- Exponential backoff with configurable parameters
|
|
11
|
+
- Circuit breaker integration via MixinAsyncCircuitBreaker
|
|
12
|
+
- Error classification for determining retry eligibility
|
|
13
|
+
- Standardized error context creation
|
|
14
|
+
- Thread pool executor integration for sync operations
|
|
15
|
+
|
|
16
|
+
Usage:
|
|
17
|
+
```python
|
|
18
|
+
from omnibase_infra.mixins import MixinRetryExecution, MixinAsyncCircuitBreaker
|
|
19
|
+
|
|
20
|
+
class HandlerConsul(MixinAsyncCircuitBreaker, MixinRetryExecution):
|
|
21
|
+
async def _my_operation(self, ...):
|
|
22
|
+
result = await self._execute_with_retry(
|
|
23
|
+
operation="consul.kv_get",
|
|
24
|
+
func=lambda: self._client.kv.get(key),
|
|
25
|
+
correlation_id=correlation_id,
|
|
26
|
+
retry_config=self._config.retry,
|
|
27
|
+
timeout_seconds=self._config.timeout_seconds,
|
|
28
|
+
)
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
Design Rationale:
|
|
32
|
+
This mixin extracts common retry patterns from HandlerConsul and HandlerVault
|
|
33
|
+
to reduce code duplication and cyclomatic complexity. The error classification
|
|
34
|
+
methods are designed to be overridden by subclasses for handler-specific
|
|
35
|
+
exception types (e.g., consul.ACLPermissionDenied, hvac.exceptions.Forbidden).
|
|
36
|
+
|
|
37
|
+
See Also:
|
|
38
|
+
- docs/patterns/error_recovery_patterns.md for retry pattern documentation
|
|
39
|
+
- MixinAsyncCircuitBreaker for circuit breaker integration
|
|
40
|
+
"""
|
|
41
|
+
|
|
42
|
+
from __future__ import annotations
|
|
43
|
+
|
|
44
|
+
import logging
|
|
45
|
+
from abc import ABC, abstractmethod
|
|
46
|
+
from typing import TYPE_CHECKING, TypeVar, cast
|
|
47
|
+
from uuid import UUID
|
|
48
|
+
|
|
49
|
+
from omnibase_infra.enums import EnumInfraTransportType, EnumRetryErrorCategory
|
|
50
|
+
from omnibase_infra.errors import (
|
|
51
|
+
InfraAuthenticationError,
|
|
52
|
+
InfraConnectionError,
|
|
53
|
+
InfraTimeoutError,
|
|
54
|
+
ModelInfraErrorContext,
|
|
55
|
+
ModelTimeoutErrorContext,
|
|
56
|
+
)
|
|
57
|
+
from omnibase_infra.mixins.protocol_circuit_breaker_aware import (
|
|
58
|
+
ProtocolCircuitBreakerAware,
|
|
59
|
+
)
|
|
60
|
+
from omnibase_infra.models.model_retry_error_classification import (
|
|
61
|
+
ModelRetryErrorClassification,
|
|
62
|
+
)
|
|
63
|
+
|
|
64
|
+
if TYPE_CHECKING:
|
|
65
|
+
from concurrent.futures import ThreadPoolExecutor
|
|
66
|
+
|
|
67
|
+
from omnibase_infra.handlers.models import ModelOperationContext, ModelRetryState
|
|
68
|
+
from omnibase_infra.handlers.models.model_consul_retry_config import (
|
|
69
|
+
ModelConsulRetryConfig,
|
|
70
|
+
)
|
|
71
|
+
from omnibase_infra.handlers.models.model_vault_retry_config import (
|
|
72
|
+
ModelVaultRetryConfig,
|
|
73
|
+
)
|
|
74
|
+
|
|
75
|
+
RetryConfigType = ModelConsulRetryConfig | ModelVaultRetryConfig
|
|
76
|
+
|
|
77
|
+
T = TypeVar("T")
|
|
78
|
+
|
|
79
|
+
logger = logging.getLogger(__name__)
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
class MixinRetryExecution(ABC):
|
|
83
|
+
"""Mixin providing retry execution with exponential backoff and circuit breaker.
|
|
84
|
+
|
|
85
|
+
This mixin provides the core retry logic used by infrastructure handlers.
|
|
86
|
+
Subclasses must implement error classification for handler-specific exceptions.
|
|
87
|
+
|
|
88
|
+
Required Mixin Dependencies:
|
|
89
|
+
- MixinAsyncCircuitBreaker: For circuit breaker state management
|
|
90
|
+
|
|
91
|
+
Required Instance Attributes:
|
|
92
|
+
- _circuit_breaker_initialized: bool
|
|
93
|
+
- _circuit_breaker_lock: asyncio.Lock (from MixinAsyncCircuitBreaker)
|
|
94
|
+
- _executor: ThreadPoolExecutor | None
|
|
95
|
+
|
|
96
|
+
Abstract Methods:
|
|
97
|
+
Subclasses must implement:
|
|
98
|
+
- _classify_error: Classify an exception for retry handling
|
|
99
|
+
- _get_transport_type: Return the transport type for error context
|
|
100
|
+
- _get_target_name: Return the target name for error context
|
|
101
|
+
|
|
102
|
+
Example:
|
|
103
|
+
```python
|
|
104
|
+
class HandlerConsul(MixinAsyncCircuitBreaker, MixinRetryExecution):
|
|
105
|
+
def _classify_error(self, error: Exception, operation: str) -> ModelRetryErrorClassification:
|
|
106
|
+
if isinstance(error, consul.ACLPermissionDenied):
|
|
107
|
+
return ModelRetryErrorClassification(
|
|
108
|
+
category=EnumRetryErrorCategory.AUTHENTICATION,
|
|
109
|
+
should_retry=False,
|
|
110
|
+
record_circuit_failure=True,
|
|
111
|
+
error_message="Consul ACL permission denied",
|
|
112
|
+
)
|
|
113
|
+
# ... more error types
|
|
114
|
+
```
|
|
115
|
+
"""
|
|
116
|
+
|
|
117
|
+
# Type hints for required attributes from other mixins/base class
|
|
118
|
+
_circuit_breaker_initialized: bool
|
|
119
|
+
_executor: ThreadPoolExecutor | None
|
|
120
|
+
|
|
121
|
+
@abstractmethod
|
|
122
|
+
def _classify_error(
|
|
123
|
+
self, error: Exception, operation: str
|
|
124
|
+
) -> ModelRetryErrorClassification:
|
|
125
|
+
"""Classify an exception for retry handling.
|
|
126
|
+
|
|
127
|
+
Subclasses must implement this to handle handler-specific exception types.
|
|
128
|
+
|
|
129
|
+
Args:
|
|
130
|
+
error: The exception to classify.
|
|
131
|
+
operation: The operation name for context.
|
|
132
|
+
|
|
133
|
+
Returns:
|
|
134
|
+
ModelRetryErrorClassification with retry decision and error details.
|
|
135
|
+
"""
|
|
136
|
+
...
|
|
137
|
+
|
|
138
|
+
@abstractmethod
|
|
139
|
+
def _get_transport_type(self) -> EnumInfraTransportType:
|
|
140
|
+
"""Return the transport type for error context.
|
|
141
|
+
|
|
142
|
+
Returns:
|
|
143
|
+
The transport type enum value (e.g., CONSUL, VAULT).
|
|
144
|
+
"""
|
|
145
|
+
...
|
|
146
|
+
|
|
147
|
+
@abstractmethod
|
|
148
|
+
def _get_target_name(self) -> str:
|
|
149
|
+
"""Return the target name for error context.
|
|
150
|
+
|
|
151
|
+
Returns:
|
|
152
|
+
The target name string (e.g., "consul_handler", "vault_handler").
|
|
153
|
+
"""
|
|
154
|
+
...
|
|
155
|
+
|
|
156
|
+
def _get_namespace(self) -> str | None:
|
|
157
|
+
"""Return the namespace for error context (optional).
|
|
158
|
+
|
|
159
|
+
Override in subclasses that support namespaces.
|
|
160
|
+
|
|
161
|
+
Returns:
|
|
162
|
+
The namespace string or None if not applicable.
|
|
163
|
+
"""
|
|
164
|
+
return None
|
|
165
|
+
|
|
166
|
+
def _build_error_context(
|
|
167
|
+
self, operation: str, correlation_id: UUID
|
|
168
|
+
) -> ModelInfraErrorContext:
|
|
169
|
+
"""Build standardized error context for infrastructure errors.
|
|
170
|
+
|
|
171
|
+
Args:
|
|
172
|
+
operation: Operation name for the error context.
|
|
173
|
+
correlation_id: Correlation ID for distributed tracing.
|
|
174
|
+
|
|
175
|
+
Returns:
|
|
176
|
+
ModelInfraErrorContext with handler-specific configuration.
|
|
177
|
+
"""
|
|
178
|
+
return ModelInfraErrorContext(
|
|
179
|
+
transport_type=self._get_transport_type(),
|
|
180
|
+
operation=operation,
|
|
181
|
+
target_name=self._get_target_name(),
|
|
182
|
+
correlation_id=correlation_id,
|
|
183
|
+
namespace=self._get_namespace(),
|
|
184
|
+
)
|
|
185
|
+
|
|
186
|
+
def _as_circuit_breaker(self) -> ProtocolCircuitBreakerAware:
|
|
187
|
+
"""Cast self to ProtocolCircuitBreakerAware for type-safe circuit breaker access.
|
|
188
|
+
|
|
189
|
+
This helper enables type-safe access to circuit breaker methods when
|
|
190
|
+
the implementing class also inherits from MixinAsyncCircuitBreaker.
|
|
191
|
+
|
|
192
|
+
Returns:
|
|
193
|
+
Self cast as ProtocolCircuitBreakerAware for type checker satisfaction.
|
|
194
|
+
|
|
195
|
+
Note:
|
|
196
|
+
This should only be called when _circuit_breaker_initialized is True,
|
|
197
|
+
which guarantees the circuit breaker methods are available.
|
|
198
|
+
"""
|
|
199
|
+
return cast(ProtocolCircuitBreakerAware, self)
|
|
200
|
+
|
|
201
|
+
async def _record_circuit_failure_if_enabled(
|
|
202
|
+
self, operation: str, correlation_id: UUID
|
|
203
|
+
) -> None:
|
|
204
|
+
"""Record circuit breaker failure if circuit breaker is enabled.
|
|
205
|
+
|
|
206
|
+
Args:
|
|
207
|
+
operation: Operation name for logging.
|
|
208
|
+
correlation_id: Correlation ID for tracing.
|
|
209
|
+
"""
|
|
210
|
+
if self._circuit_breaker_initialized:
|
|
211
|
+
cb = self._as_circuit_breaker()
|
|
212
|
+
async with cb._circuit_breaker_lock:
|
|
213
|
+
await cb._record_circuit_failure(operation, correlation_id)
|
|
214
|
+
|
|
215
|
+
async def _reset_circuit_if_enabled(self) -> None:
|
|
216
|
+
"""Reset circuit breaker to closed state if enabled."""
|
|
217
|
+
if self._circuit_breaker_initialized:
|
|
218
|
+
cb = self._as_circuit_breaker()
|
|
219
|
+
async with cb._circuit_breaker_lock:
|
|
220
|
+
await cb._reset_circuit_breaker()
|
|
221
|
+
|
|
222
|
+
async def _check_circuit_if_enabled(
|
|
223
|
+
self, operation: str, correlation_id: UUID
|
|
224
|
+
) -> None:
|
|
225
|
+
"""Check circuit breaker state if enabled.
|
|
226
|
+
|
|
227
|
+
Args:
|
|
228
|
+
operation: Operation name for error context.
|
|
229
|
+
correlation_id: Correlation ID for tracing.
|
|
230
|
+
|
|
231
|
+
Raises:
|
|
232
|
+
InfraUnavailableError: If circuit breaker is open.
|
|
233
|
+
"""
|
|
234
|
+
if self._circuit_breaker_initialized:
|
|
235
|
+
cb = self._as_circuit_breaker()
|
|
236
|
+
async with cb._circuit_breaker_lock:
|
|
237
|
+
await cb._check_circuit_breaker(operation, correlation_id)
|
|
238
|
+
|
|
239
|
+
async def _handle_retriable_error(
|
|
240
|
+
self,
|
|
241
|
+
classification: ModelRetryErrorClassification,
|
|
242
|
+
retry_state: ModelRetryState,
|
|
243
|
+
max_delay_seconds: float,
|
|
244
|
+
operation: str,
|
|
245
|
+
correlation_id: UUID,
|
|
246
|
+
op_context: ModelOperationContext,
|
|
247
|
+
original_error: Exception,
|
|
248
|
+
) -> tuple[ModelRetryState, Exception | None]:
|
|
249
|
+
"""Handle an error that may be eligible for retry.
|
|
250
|
+
|
|
251
|
+
Args:
|
|
252
|
+
classification: The error classification result.
|
|
253
|
+
retry_state: Current retry state.
|
|
254
|
+
max_delay_seconds: Maximum delay cap for backoff.
|
|
255
|
+
operation: Operation name for context.
|
|
256
|
+
correlation_id: Correlation ID for tracing.
|
|
257
|
+
op_context: Operation context with timeout info.
|
|
258
|
+
original_error: The original exception.
|
|
259
|
+
|
|
260
|
+
Returns:
|
|
261
|
+
Tuple of (new_retry_state, error_to_raise_or_none).
|
|
262
|
+
If error_to_raise_or_none is not None, caller should raise it.
|
|
263
|
+
"""
|
|
264
|
+
new_state = retry_state.next_attempt(
|
|
265
|
+
error_message=classification.error_message,
|
|
266
|
+
max_delay_seconds=max_delay_seconds,
|
|
267
|
+
)
|
|
268
|
+
|
|
269
|
+
if not new_state.is_retriable():
|
|
270
|
+
if classification.record_circuit_failure:
|
|
271
|
+
await self._record_circuit_failure_if_enabled(operation, correlation_id)
|
|
272
|
+
|
|
273
|
+
ctx = self._build_error_context(operation, correlation_id)
|
|
274
|
+
error_to_raise = self._create_final_error(
|
|
275
|
+
classification, ctx, op_context, original_error
|
|
276
|
+
)
|
|
277
|
+
return new_state, error_to_raise
|
|
278
|
+
|
|
279
|
+
return new_state, None
|
|
280
|
+
|
|
281
|
+
def _create_final_error(
|
|
282
|
+
self,
|
|
283
|
+
classification: ModelRetryErrorClassification,
|
|
284
|
+
ctx: ModelInfraErrorContext,
|
|
285
|
+
op_context: ModelOperationContext,
|
|
286
|
+
original_error: Exception,
|
|
287
|
+
) -> Exception:
|
|
288
|
+
"""Create the appropriate error to raise after retries exhausted.
|
|
289
|
+
|
|
290
|
+
Args:
|
|
291
|
+
classification: Error classification result.
|
|
292
|
+
ctx: Error context.
|
|
293
|
+
op_context: Operation context.
|
|
294
|
+
original_error: Original exception for chaining.
|
|
295
|
+
|
|
296
|
+
Returns:
|
|
297
|
+
The infrastructure error to raise.
|
|
298
|
+
"""
|
|
299
|
+
if classification.category == EnumRetryErrorCategory.TIMEOUT:
|
|
300
|
+
# Convert ModelInfraErrorContext to ModelTimeoutErrorContext for stricter typing
|
|
301
|
+
# ModelTimeoutErrorContext requires transport_type and operation to be non-None
|
|
302
|
+
timeout_ctx = ModelTimeoutErrorContext(
|
|
303
|
+
transport_type=ctx.transport_type
|
|
304
|
+
or self._get_transport_type(), # Fallback to handler's transport type
|
|
305
|
+
operation=ctx.operation or "unknown",
|
|
306
|
+
target_name=ctx.target_name,
|
|
307
|
+
correlation_id=ctx.correlation_id,
|
|
308
|
+
timeout_seconds=op_context.timeout_seconds,
|
|
309
|
+
)
|
|
310
|
+
return InfraTimeoutError(
|
|
311
|
+
f"Operation timed out after {op_context.timeout_seconds}s",
|
|
312
|
+
context=timeout_ctx,
|
|
313
|
+
)
|
|
314
|
+
elif classification.category == EnumRetryErrorCategory.AUTHENTICATION:
|
|
315
|
+
return InfraAuthenticationError(
|
|
316
|
+
classification.error_message,
|
|
317
|
+
context=ctx,
|
|
318
|
+
)
|
|
319
|
+
else:
|
|
320
|
+
return InfraConnectionError(
|
|
321
|
+
classification.error_message,
|
|
322
|
+
context=ctx,
|
|
323
|
+
)
|
|
324
|
+
|
|
325
|
+
async def _handle_non_retriable_error(
|
|
326
|
+
self,
|
|
327
|
+
classification: ModelRetryErrorClassification,
|
|
328
|
+
operation: str,
|
|
329
|
+
correlation_id: UUID,
|
|
330
|
+
original_error: Exception,
|
|
331
|
+
) -> Exception:
|
|
332
|
+
"""Handle an error that should not be retried.
|
|
333
|
+
|
|
334
|
+
Args:
|
|
335
|
+
classification: The error classification result.
|
|
336
|
+
operation: Operation name for context.
|
|
337
|
+
correlation_id: Correlation ID for tracing.
|
|
338
|
+
original_error: The original exception.
|
|
339
|
+
|
|
340
|
+
Returns:
|
|
341
|
+
The infrastructure error to raise.
|
|
342
|
+
"""
|
|
343
|
+
if classification.record_circuit_failure:
|
|
344
|
+
await self._record_circuit_failure_if_enabled(operation, correlation_id)
|
|
345
|
+
|
|
346
|
+
ctx = self._build_error_context(operation, correlation_id)
|
|
347
|
+
|
|
348
|
+
if classification.category == EnumRetryErrorCategory.AUTHENTICATION:
|
|
349
|
+
return InfraAuthenticationError(
|
|
350
|
+
classification.error_message,
|
|
351
|
+
context=ctx,
|
|
352
|
+
)
|
|
353
|
+
else:
|
|
354
|
+
return InfraConnectionError(
|
|
355
|
+
classification.error_message,
|
|
356
|
+
context=ctx,
|
|
357
|
+
)
|
|
358
|
+
|
|
359
|
+
async def _log_retry_attempt(
|
|
360
|
+
self, operation: str, retry_state: ModelRetryState, correlation_id: UUID
|
|
361
|
+
) -> None:
|
|
362
|
+
"""Log a retry attempt with standardized format.
|
|
363
|
+
|
|
364
|
+
Args:
|
|
365
|
+
operation: Operation name.
|
|
366
|
+
retry_state: Current retry state after increment.
|
|
367
|
+
correlation_id: Correlation ID for tracing.
|
|
368
|
+
"""
|
|
369
|
+
logger.debug(
|
|
370
|
+
"Retrying operation",
|
|
371
|
+
extra={
|
|
372
|
+
"operation": operation,
|
|
373
|
+
"attempt": retry_state.attempt,
|
|
374
|
+
"max_attempts": retry_state.max_attempts,
|
|
375
|
+
"backoff_seconds": retry_state.delay_seconds,
|
|
376
|
+
"last_error": retry_state.last_error,
|
|
377
|
+
"correlation_id": str(correlation_id),
|
|
378
|
+
},
|
|
379
|
+
)
|
|
380
|
+
|
|
381
|
+
|
|
382
|
+
__all__: list[str] = [
|
|
383
|
+
"EnumRetryErrorCategory",
|
|
384
|
+
"MixinRetryExecution",
|
|
385
|
+
"ModelRetryErrorClassification",
|
|
386
|
+
]
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
# SPDX-License-Identifier: MIT
|
|
2
|
+
# Copyright (c) 2025 OmniNode Team
|
|
3
|
+
"""Protocol for circuit breaker awareness.
|
|
4
|
+
|
|
5
|
+
This module defines the protocol interface for components that support
|
|
6
|
+
circuit breaker functionality via MixinAsyncCircuitBreaker.
|
|
7
|
+
|
|
8
|
+
The protocol enables structural typing (duck typing) for circuit breaker
|
|
9
|
+
methods, allowing mixins like MixinRetryExecution to interact with circuit
|
|
10
|
+
breaker functionality without requiring inheritance relationships.
|
|
11
|
+
|
|
12
|
+
Usage:
|
|
13
|
+
```python
|
|
14
|
+
from omnibase_infra.mixins import (
|
|
15
|
+
MixinAsyncCircuitBreaker,
|
|
16
|
+
MixinRetryExecution,
|
|
17
|
+
ProtocolCircuitBreakerAware,
|
|
18
|
+
)
|
|
19
|
+
|
|
20
|
+
class MyHandler(MixinAsyncCircuitBreaker, MixinRetryExecution):
|
|
21
|
+
# Automatically satisfies ProtocolCircuitBreakerAware via MixinAsyncCircuitBreaker
|
|
22
|
+
...
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Design Rationale:
|
|
26
|
+
This protocol exists to eliminate type: ignore comments in MixinRetryExecution
|
|
27
|
+
when accessing circuit breaker methods. By defining the protocol, type checkers
|
|
28
|
+
can verify that the required methods exist without runtime inheritance checks.
|
|
29
|
+
|
|
30
|
+
See Also:
|
|
31
|
+
- MixinAsyncCircuitBreaker: Implementation of circuit breaker functionality
|
|
32
|
+
- MixinRetryExecution: Consumer of this protocol for retry logic
|
|
33
|
+
- docs/patterns/circuit_breaker_implementation.md: Full implementation details
|
|
34
|
+
|
|
35
|
+
.. versionadded:: 0.4.1
|
|
36
|
+
"""
|
|
37
|
+
|
|
38
|
+
from __future__ import annotations
|
|
39
|
+
|
|
40
|
+
import asyncio
|
|
41
|
+
from typing import Protocol, runtime_checkable
|
|
42
|
+
from uuid import UUID
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
@runtime_checkable
|
|
46
|
+
class ProtocolCircuitBreakerAware(Protocol):
|
|
47
|
+
"""Protocol for components with circuit breaker capability.
|
|
48
|
+
|
|
49
|
+
This protocol defines the interface for circuit breaker functionality
|
|
50
|
+
that MixinAsyncCircuitBreaker provides. Components that want to interact
|
|
51
|
+
with circuit breakers can use this protocol for type hints.
|
|
52
|
+
|
|
53
|
+
Attributes:
|
|
54
|
+
_circuit_breaker_lock: Async lock for coroutine-safe circuit breaker access.
|
|
55
|
+
All circuit breaker operations MUST be performed while holding this lock.
|
|
56
|
+
|
|
57
|
+
Methods:
|
|
58
|
+
_check_circuit_breaker: Verify circuit allows operation (raises if open).
|
|
59
|
+
_record_circuit_failure: Record a failure and potentially open circuit.
|
|
60
|
+
_reset_circuit_breaker: Reset circuit to closed state on success.
|
|
61
|
+
|
|
62
|
+
Concurrency Safety:
|
|
63
|
+
All circuit breaker methods MUST be called while holding ``_circuit_breaker_lock``.
|
|
64
|
+
This is documented in each method's docstring using:
|
|
65
|
+
"REQUIRES: self._circuit_breaker_lock must be held by caller."
|
|
66
|
+
|
|
67
|
+
Example:
|
|
68
|
+
```python
|
|
69
|
+
async with self._circuit_breaker_lock:
|
|
70
|
+
await self._check_circuit_breaker("operation", correlation_id)
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
Note:
|
|
74
|
+
Method bodies use ``...`` (Ellipsis) per PEP 544 Protocol conventions.
|
|
75
|
+
"""
|
|
76
|
+
|
|
77
|
+
_circuit_breaker_lock: asyncio.Lock
|
|
78
|
+
"""Async lock for coroutine-safe circuit breaker access."""
|
|
79
|
+
|
|
80
|
+
async def _check_circuit_breaker(
|
|
81
|
+
self, operation: str, correlation_id: UUID | None = None
|
|
82
|
+
) -> None:
|
|
83
|
+
"""Check if circuit breaker allows operation.
|
|
84
|
+
|
|
85
|
+
Verifies circuit breaker state and raises InfraUnavailableError if
|
|
86
|
+
circuit is open. Automatically transitions from OPEN to HALF_OPEN
|
|
87
|
+
if reset timeout has elapsed.
|
|
88
|
+
|
|
89
|
+
Concurrency Safety:
|
|
90
|
+
REQUIRES: self._circuit_breaker_lock must be held by caller.
|
|
91
|
+
|
|
92
|
+
Args:
|
|
93
|
+
operation: Operation name for error context (e.g., "publish", "register").
|
|
94
|
+
correlation_id: Optional correlation ID for distributed tracing.
|
|
95
|
+
|
|
96
|
+
Raises:
|
|
97
|
+
InfraUnavailableError: If circuit breaker is open and reset timeout
|
|
98
|
+
has not elapsed.
|
|
99
|
+
"""
|
|
100
|
+
...
|
|
101
|
+
|
|
102
|
+
async def _record_circuit_failure(
|
|
103
|
+
self, operation: str, correlation_id: UUID | None = None
|
|
104
|
+
) -> None:
|
|
105
|
+
"""Record a circuit breaker failure and potentially open the circuit.
|
|
106
|
+
|
|
107
|
+
Increments the failure counter and opens the circuit if the threshold
|
|
108
|
+
is reached. When the circuit opens, it sets the reset timestamp for
|
|
109
|
+
automatic recovery.
|
|
110
|
+
|
|
111
|
+
Concurrency Safety:
|
|
112
|
+
REQUIRES: self._circuit_breaker_lock must be held by caller.
|
|
113
|
+
|
|
114
|
+
Args:
|
|
115
|
+
operation: Operation name for logging context.
|
|
116
|
+
correlation_id: Optional correlation ID for distributed tracing.
|
|
117
|
+
"""
|
|
118
|
+
...
|
|
119
|
+
|
|
120
|
+
async def _reset_circuit_breaker(self) -> None:
|
|
121
|
+
"""Reset circuit breaker to closed state.
|
|
122
|
+
|
|
123
|
+
Resets the failure counter and closes the circuit, allowing all
|
|
124
|
+
requests to proceed normally. Typically called after a successful
|
|
125
|
+
operation.
|
|
126
|
+
|
|
127
|
+
Concurrency Safety:
|
|
128
|
+
REQUIRES: self._circuit_breaker_lock must be held by caller.
|
|
129
|
+
"""
|
|
130
|
+
...
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
__all__: list[str] = ["ProtocolCircuitBreakerAware"]
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
# SPDX-License-Identifier: MIT
|
|
2
|
+
# Copyright (c) 2025 OmniNode Team
|
|
3
|
+
"""ONEX Infrastructure Models.
|
|
4
|
+
|
|
5
|
+
This module exports all infrastructure-specific Pydantic models.
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
from omnibase_infra.models.dispatch import (
|
|
9
|
+
EnumDispatchStatus,
|
|
10
|
+
EnumTopicStandard,
|
|
11
|
+
ModelDispatcherMetrics,
|
|
12
|
+
ModelDispatcherRegistration,
|
|
13
|
+
ModelDispatchLogContext,
|
|
14
|
+
ModelDispatchMetrics,
|
|
15
|
+
ModelDispatchOutcome,
|
|
16
|
+
ModelDispatchResult,
|
|
17
|
+
ModelDispatchRoute,
|
|
18
|
+
ModelParsedTopic,
|
|
19
|
+
ModelTopicParser,
|
|
20
|
+
)
|
|
21
|
+
from omnibase_infra.models.errors import ModelHandlerValidationError
|
|
22
|
+
from omnibase_infra.models.handlers import ModelHandlerIdentifier
|
|
23
|
+
from omnibase_infra.models.health import ModelHealthCheckResult
|
|
24
|
+
from omnibase_infra.models.logging import ModelLogContext
|
|
25
|
+
from omnibase_infra.models.model_retry_error_classification import (
|
|
26
|
+
ModelRetryErrorClassification,
|
|
27
|
+
)
|
|
28
|
+
|
|
29
|
+
# ModelSemVer and SEMVER_DEFAULT must be imported from omnibase_core.models.primitives.model_semver
|
|
30
|
+
# The local model_semver.py has been REMOVED and raises ImportError on import.
|
|
31
|
+
# Import directly from omnibase_core:
|
|
32
|
+
# from omnibase_core.models.primitives.model_semver import ModelSemVer
|
|
33
|
+
# To create SEMVER_DEFAULT:
|
|
34
|
+
# SEMVER_DEFAULT = ModelSemVer.parse("1.0.0")
|
|
35
|
+
from omnibase_infra.models.projection import (
|
|
36
|
+
ModelRegistrationProjection,
|
|
37
|
+
ModelRegistrationSnapshot,
|
|
38
|
+
ModelSequenceInfo,
|
|
39
|
+
ModelSnapshotTopicConfig,
|
|
40
|
+
)
|
|
41
|
+
from omnibase_infra.models.projectors import (
|
|
42
|
+
ModelProjectorColumn,
|
|
43
|
+
ModelProjectorIndex,
|
|
44
|
+
ModelProjectorSchema,
|
|
45
|
+
)
|
|
46
|
+
from omnibase_infra.models.registration import (
|
|
47
|
+
ModelIntrospectionMetrics,
|
|
48
|
+
ModelNodeCapabilities,
|
|
49
|
+
ModelNodeHeartbeatEvent,
|
|
50
|
+
ModelNodeIntrospectionEvent,
|
|
51
|
+
ModelNodeMetadata,
|
|
52
|
+
ModelNodeRegistration,
|
|
53
|
+
)
|
|
54
|
+
from omnibase_infra.models.resilience import ModelCircuitBreakerConfig
|
|
55
|
+
from omnibase_infra.models.routing import (
|
|
56
|
+
ModelRoutingEntry,
|
|
57
|
+
ModelRoutingSubcontract,
|
|
58
|
+
)
|
|
59
|
+
from omnibase_infra.models.runtime import ModelLoadedHandler
|
|
60
|
+
from omnibase_infra.models.security import (
|
|
61
|
+
ModelEnvironmentPolicy,
|
|
62
|
+
ModelHandlerSecurityPolicy,
|
|
63
|
+
)
|
|
64
|
+
from omnibase_infra.models.snapshot import (
|
|
65
|
+
ModelFieldChange,
|
|
66
|
+
ModelSnapshot,
|
|
67
|
+
ModelSnapshotDiff,
|
|
68
|
+
ModelSubjectRef,
|
|
69
|
+
)
|
|
70
|
+
from omnibase_infra.models.validation import (
|
|
71
|
+
ModelCoverageMetrics,
|
|
72
|
+
ModelExecutionShapeRule,
|
|
73
|
+
ModelExecutionShapeViolationResult,
|
|
74
|
+
ModelValidationOutcome,
|
|
75
|
+
)
|
|
76
|
+
|
|
77
|
+
__all__: list[str] = [
|
|
78
|
+
# Dispatch models
|
|
79
|
+
"EnumDispatchStatus",
|
|
80
|
+
"EnumTopicStandard",
|
|
81
|
+
# Resilience models
|
|
82
|
+
"ModelCircuitBreakerConfig",
|
|
83
|
+
# Validation models
|
|
84
|
+
"ModelCoverageMetrics",
|
|
85
|
+
"ModelDispatchLogContext",
|
|
86
|
+
"ModelDispatchMetrics",
|
|
87
|
+
"ModelDispatchOutcome",
|
|
88
|
+
"ModelDispatchResult",
|
|
89
|
+
"ModelDispatchRoute",
|
|
90
|
+
"ModelDispatcherMetrics",
|
|
91
|
+
"ModelDispatcherRegistration",
|
|
92
|
+
"ModelExecutionShapeRule",
|
|
93
|
+
"ModelExecutionShapeViolationResult",
|
|
94
|
+
# Error models
|
|
95
|
+
"ModelHandlerValidationError",
|
|
96
|
+
# Handler models
|
|
97
|
+
"ModelHandlerIdentifier",
|
|
98
|
+
# Routing models
|
|
99
|
+
"ModelRoutingEntry",
|
|
100
|
+
"ModelRoutingSubcontract",
|
|
101
|
+
# Health models
|
|
102
|
+
"ModelHealthCheckResult",
|
|
103
|
+
# Registration models
|
|
104
|
+
"ModelIntrospectionMetrics",
|
|
105
|
+
# Runtime models
|
|
106
|
+
"ModelLoadedHandler",
|
|
107
|
+
# Logging models
|
|
108
|
+
"ModelLogContext",
|
|
109
|
+
"ModelNodeCapabilities",
|
|
110
|
+
"ModelNodeHeartbeatEvent",
|
|
111
|
+
"ModelNodeIntrospectionEvent",
|
|
112
|
+
"ModelNodeMetadata",
|
|
113
|
+
"ModelNodeRegistration",
|
|
114
|
+
"ModelParsedTopic",
|
|
115
|
+
# Projection models
|
|
116
|
+
"ModelRegistrationProjection",
|
|
117
|
+
# Projector schema models
|
|
118
|
+
"ModelProjectorColumn",
|
|
119
|
+
"ModelProjectorIndex",
|
|
120
|
+
"ModelProjectorSchema",
|
|
121
|
+
"ModelRegistrationSnapshot",
|
|
122
|
+
# Retry models
|
|
123
|
+
"ModelRetryErrorClassification",
|
|
124
|
+
# Security models
|
|
125
|
+
"ModelEnvironmentPolicy",
|
|
126
|
+
"ModelHandlerSecurityPolicy",
|
|
127
|
+
"ModelSequenceInfo",
|
|
128
|
+
"ModelSnapshotTopicConfig",
|
|
129
|
+
"ModelTopicParser",
|
|
130
|
+
"ModelValidationOutcome",
|
|
131
|
+
# Snapshot models
|
|
132
|
+
"ModelFieldChange",
|
|
133
|
+
"ModelSnapshot",
|
|
134
|
+
"ModelSnapshotDiff",
|
|
135
|
+
"ModelSubjectRef",
|
|
136
|
+
]
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# SPDX-FileCopyrightText: 2025 OmniNode Team <info@omninode.ai>
|
|
2
|
+
#
|
|
3
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
"""
|
|
5
|
+
Corpus capture models.
|
|
6
|
+
|
|
7
|
+
.. versionadded:: 0.5.0
|
|
8
|
+
Added for CorpusCapture (OMN-1203)
|
|
9
|
+
"""
|
|
10
|
+
|
|
11
|
+
from omnibase_infra.models.corpus.model_capture_config import ModelCaptureConfig
|
|
12
|
+
from omnibase_infra.models.corpus.model_capture_result import ModelCaptureResult
|
|
13
|
+
|
|
14
|
+
__all__ = [
|
|
15
|
+
"ModelCaptureConfig",
|
|
16
|
+
"ModelCaptureResult",
|
|
17
|
+
]
|