omnibase_infra 0.2.1__py3-none-any.whl → 0.2.3__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 +1 -1
- 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/commands.py +1 -1
- omnibase_infra/configs/widget_mapping.yaml +176 -0
- omnibase_infra/contracts/handlers/filesystem/handler_contract.yaml +5 -2
- omnibase_infra/contracts/handlers/mcp/handler_contract.yaml +5 -2
- omnibase_infra/enums/__init__.py +6 -0
- omnibase_infra/enums/enum_handler_error_type.py +10 -0
- omnibase_infra/enums/enum_handler_source_mode.py +72 -0
- omnibase_infra/enums/enum_kafka_acks.py +99 -0
- omnibase_infra/errors/error_compute_registry.py +4 -1
- omnibase_infra/errors/error_event_bus_registry.py +4 -1
- omnibase_infra/errors/error_infra.py +3 -1
- omnibase_infra/errors/error_policy_registry.py +4 -1
- omnibase_infra/event_bus/event_bus_kafka.py +1 -1
- omnibase_infra/event_bus/models/config/model_kafka_event_bus_config.py +59 -10
- omnibase_infra/handlers/__init__.py +8 -1
- omnibase_infra/handlers/handler_consul.py +7 -1
- omnibase_infra/handlers/handler_db.py +10 -3
- omnibase_infra/handlers/handler_graph.py +10 -5
- omnibase_infra/handlers/handler_http.py +8 -2
- omnibase_infra/handlers/handler_intent.py +387 -0
- omnibase_infra/handlers/handler_mcp.py +745 -63
- omnibase_infra/handlers/handler_vault.py +11 -5
- omnibase_infra/handlers/mixins/mixin_consul_kv.py +4 -3
- omnibase_infra/handlers/mixins/mixin_consul_service.py +2 -1
- omnibase_infra/handlers/registration_storage/handler_registration_storage_postgres.py +7 -0
- omnibase_infra/handlers/service_discovery/handler_service_discovery_consul.py +308 -4
- omnibase_infra/handlers/service_discovery/models/model_service_info.py +10 -0
- omnibase_infra/mixins/mixin_async_circuit_breaker.py +3 -2
- omnibase_infra/mixins/mixin_node_introspection.py +42 -7
- omnibase_infra/mixins/mixin_retry_execution.py +1 -1
- omnibase_infra/models/discovery/model_introspection_config.py +11 -0
- omnibase_infra/models/handlers/__init__.py +48 -5
- omnibase_infra/models/handlers/model_bootstrap_handler_descriptor.py +162 -0
- omnibase_infra/models/handlers/model_contract_discovery_result.py +6 -4
- omnibase_infra/models/handlers/model_handler_descriptor.py +15 -0
- omnibase_infra/models/handlers/model_handler_source_config.py +220 -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/registration/model_node_capabilities.py +11 -0
- omnibase_infra/models/registration/model_node_introspection_event.py +9 -0
- omnibase_infra/models/runtime/model_handler_contract.py +25 -9
- omnibase_infra/models/runtime/model_loaded_handler.py +9 -0
- omnibase_infra/nodes/architecture_validator/contract_architecture_validator.yaml +0 -5
- omnibase_infra/nodes/architecture_validator/registry/registry_infra_architecture_validator.py +17 -10
- omnibase_infra/nodes/effects/contract.yaml +0 -5
- omnibase_infra/nodes/node_registration_orchestrator/contract.yaml +7 -0
- omnibase_infra/nodes/node_registration_orchestrator/handlers/handler_node_introspected.py +86 -1
- omnibase_infra/nodes/node_registration_orchestrator/introspection_event_router.py +3 -3
- omnibase_infra/nodes/node_registration_orchestrator/plugin.py +1 -1
- omnibase_infra/nodes/node_registration_orchestrator/registry/registry_infra_node_registration_orchestrator.py +9 -8
- omnibase_infra/nodes/node_registration_orchestrator/timeout_coordinator.py +4 -3
- omnibase_infra/nodes/node_registration_orchestrator/wiring.py +14 -13
- omnibase_infra/nodes/node_registration_storage_effect/contract.yaml +0 -5
- omnibase_infra/nodes/node_registration_storage_effect/node.py +4 -1
- omnibase_infra/nodes/node_registration_storage_effect/registry/registry_infra_registration_storage.py +47 -26
- omnibase_infra/nodes/node_registry_effect/contract.yaml +0 -5
- omnibase_infra/nodes/node_registry_effect/handlers/handler_partial_retry.py +2 -1
- omnibase_infra/nodes/node_service_discovery_effect/registry/registry_infra_service_discovery.py +28 -20
- omnibase_infra/plugins/examples/plugin_json_normalizer.py +2 -2
- omnibase_infra/plugins/examples/plugin_json_normalizer_error_handling.py +2 -2
- omnibase_infra/plugins/plugin_compute_base.py +16 -2
- omnibase_infra/protocols/__init__.py +2 -0
- omnibase_infra/protocols/protocol_container_aware.py +200 -0
- omnibase_infra/protocols/protocol_event_projector.py +1 -1
- omnibase_infra/runtime/__init__.py +90 -1
- omnibase_infra/runtime/binding_config_resolver.py +102 -37
- omnibase_infra/runtime/constants_notification.py +75 -0
- omnibase_infra/runtime/contract_handler_discovery.py +6 -1
- 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 +267 -186
- omnibase_infra/runtime/handler_identity.py +81 -0
- omnibase_infra/runtime/handler_plugin_loader.py +19 -2
- omnibase_infra/runtime/handler_registry.py +11 -3
- omnibase_infra/runtime/handler_source_resolver.py +326 -0
- omnibase_infra/runtime/mixin_semver_cache.py +25 -1
- omnibase_infra/runtime/mixins/__init__.py +7 -0
- omnibase_infra/runtime/mixins/mixin_projector_notification_publishing.py +566 -0
- omnibase_infra/runtime/mixins/mixin_projector_sql_operations.py +31 -10
- omnibase_infra/runtime/models/__init__.py +24 -0
- omnibase_infra/runtime/models/model_health_check_result.py +2 -1
- omnibase_infra/runtime/models/model_projector_notification_config.py +171 -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 +1 -1
- omnibase_infra/runtime/projector_shell.py +229 -1
- omnibase_infra/runtime/protocol_lifecycle_executor.py +6 -6
- omnibase_infra/runtime/protocols/__init__.py +10 -0
- omnibase_infra/runtime/registry/registry_protocol_binding.py +16 -15
- omnibase_infra/runtime/registry_contract_source.py +693 -0
- omnibase_infra/runtime/registry_policy.py +9 -326
- omnibase_infra/runtime/secret_resolver.py +4 -2
- omnibase_infra/runtime/service_kernel.py +11 -3
- omnibase_infra/runtime/service_message_dispatch_engine.py +4 -2
- omnibase_infra/runtime/service_runtime_host_process.py +589 -106
- omnibase_infra/runtime/transition_notification_outbox.py +1190 -0
- omnibase_infra/runtime/transition_notification_publisher.py +764 -0
- omnibase_infra/runtime/util_container_wiring.py +6 -5
- omnibase_infra/runtime/util_wiring.py +17 -4
- omnibase_infra/schemas/schema_transition_notification_outbox.sql +245 -0
- omnibase_infra/services/__init__.py +21 -0
- omnibase_infra/services/corpus_capture.py +7 -1
- 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 +547 -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 +4 -4
- omnibase_infra/services/service_health.py +3 -2
- omnibase_infra/services/service_timeout_emitter.py +20 -3
- omnibase_infra/services/service_timeout_scanner.py +7 -3
- omnibase_infra/services/session/__init__.py +56 -0
- omnibase_infra/services/session/config_consumer.py +120 -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/utils/__init__.py +19 -0
- omnibase_infra/utils/util_atomic_file.py +261 -0
- omnibase_infra/utils/util_db_transaction.py +239 -0
- omnibase_infra/utils/util_dsn_validation.py +1 -1
- omnibase_infra/utils/util_retry_optimistic.py +281 -0
- omnibase_infra/validation/__init__.py +3 -19
- omnibase_infra/validation/contracts/security.validation.yaml +114 -0
- omnibase_infra/validation/infra_validators.py +35 -24
- omnibase_infra/validation/validation_exemptions.yaml +140 -9
- omnibase_infra/validation/validator_chain_propagation.py +2 -2
- omnibase_infra/validation/validator_runtime_shape.py +1 -1
- omnibase_infra/validation/validator_security.py +473 -370
- {omnibase_infra-0.2.1.dist-info → omnibase_infra-0.2.3.dist-info}/METADATA +3 -3
- {omnibase_infra-0.2.1.dist-info → omnibase_infra-0.2.3.dist-info}/RECORD +161 -98
- {omnibase_infra-0.2.1.dist-info → omnibase_infra-0.2.3.dist-info}/WHEEL +0 -0
- {omnibase_infra-0.2.1.dist-info → omnibase_infra-0.2.3.dist-info}/entry_points.txt +0 -0
- {omnibase_infra-0.2.1.dist-info → omnibase_infra-0.2.3.dist-info}/licenses/LICENSE +0 -0
|
@@ -49,7 +49,7 @@ from omnibase_infra.runtime.models import (
|
|
|
49
49
|
)
|
|
50
50
|
|
|
51
51
|
if TYPE_CHECKING:
|
|
52
|
-
from
|
|
52
|
+
from omnibase_infra.protocols import ProtocolContainerAware
|
|
53
53
|
|
|
54
54
|
logger = logging.getLogger(__name__)
|
|
55
55
|
|
|
@@ -172,7 +172,7 @@ class ProtocolLifecycleExecutor:
|
|
|
172
172
|
return self._health_check_timeout_seconds
|
|
173
173
|
|
|
174
174
|
@staticmethod
|
|
175
|
-
def get_shutdown_priority(handler:
|
|
175
|
+
def get_shutdown_priority(handler: ProtocolContainerAware) -> int:
|
|
176
176
|
"""Get shutdown priority for a handler.
|
|
177
177
|
|
|
178
178
|
Returns the shutdown priority for the given handler. Handlers with higher
|
|
@@ -225,7 +225,7 @@ class ProtocolLifecycleExecutor:
|
|
|
225
225
|
async def shutdown_handler(
|
|
226
226
|
self,
|
|
227
227
|
handler_type: str,
|
|
228
|
-
handler:
|
|
228
|
+
handler: ProtocolContainerAware,
|
|
229
229
|
) -> ModelLifecycleResult:
|
|
230
230
|
"""Shutdown a single handler with error handling.
|
|
231
231
|
|
|
@@ -267,7 +267,7 @@ class ProtocolLifecycleExecutor:
|
|
|
267
267
|
async def check_handler_health(
|
|
268
268
|
self,
|
|
269
269
|
handler_type: str,
|
|
270
|
-
handler:
|
|
270
|
+
handler: ProtocolContainerAware,
|
|
271
271
|
timeout_seconds: float = -1.0,
|
|
272
272
|
) -> ModelHealthCheckResult:
|
|
273
273
|
"""Check health of a single handler with timeout.
|
|
@@ -329,7 +329,7 @@ class ProtocolLifecycleExecutor:
|
|
|
329
329
|
|
|
330
330
|
async def shutdown_handlers_by_priority(
|
|
331
331
|
self,
|
|
332
|
-
handlers: dict[str,
|
|
332
|
+
handlers: dict[str, ProtocolContainerAware],
|
|
333
333
|
) -> ModelBatchLifecycleResult:
|
|
334
334
|
"""Shutdown all handlers grouped by priority (higher first, parallel within group).
|
|
335
335
|
|
|
@@ -359,7 +359,7 @@ class ProtocolLifecycleExecutor:
|
|
|
359
359
|
return ModelBatchLifecycleResult.empty()
|
|
360
360
|
|
|
361
361
|
# Group handlers by priority
|
|
362
|
-
priority_groups: dict[int, list[tuple[str,
|
|
362
|
+
priority_groups: dict[int, list[tuple[str, ProtocolContainerAware]]] = {}
|
|
363
363
|
for handler_type, handler in handlers.items():
|
|
364
364
|
priority = self.get_shutdown_priority(handler)
|
|
365
365
|
if priority not in priority_groups:
|
|
@@ -10,18 +10,28 @@ Available Protocols:
|
|
|
10
10
|
The scheduler is the single source of truth for 'now' across orchestrators.
|
|
11
11
|
It emits RuntimeTick events at configured intervals.
|
|
12
12
|
|
|
13
|
+
ProtocolTransitionNotificationPublisher: Interface for transition notification
|
|
14
|
+
publishing. Used by TransitionNotificationOutbox for delivering state
|
|
15
|
+
transition notifications to event buses.
|
|
16
|
+
|
|
13
17
|
Related:
|
|
14
18
|
- OMN-953: RuntimeTick scheduler implementation
|
|
19
|
+
- OMN-1139: TransitionNotificationOutbox implementation
|
|
15
20
|
- See also: runtime.dispatcher_registry.ProtocolMessageDispatcher
|
|
16
21
|
- See also: runtime.protocol_policy.ProtocolPolicy
|
|
17
22
|
"""
|
|
18
23
|
|
|
19
24
|
from __future__ import annotations
|
|
20
25
|
|
|
26
|
+
# Re-export from omnibase_core for convenience
|
|
27
|
+
from omnibase_core.protocols.notifications import (
|
|
28
|
+
ProtocolTransitionNotificationPublisher,
|
|
29
|
+
)
|
|
21
30
|
from omnibase_infra.runtime.protocols.protocol_runtime_scheduler import (
|
|
22
31
|
ProtocolRuntimeScheduler,
|
|
23
32
|
)
|
|
24
33
|
|
|
25
34
|
__all__: list[str] = [
|
|
26
35
|
"ProtocolRuntimeScheduler",
|
|
36
|
+
"ProtocolTransitionNotificationPublisher",
|
|
27
37
|
]
|
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
"""Protocol Binding Registry - SINGLE SOURCE OF TRUTH for handler registration.
|
|
4
4
|
|
|
5
5
|
This module provides the RegistryProtocolBinding class which implements the
|
|
6
|
-
|
|
6
|
+
ProtocolContainerAwareRegistry protocol from omnibase_spi. It serves as the
|
|
7
7
|
centralized location for registering and resolving protocol handlers
|
|
8
8
|
in the omnibase_infra layer.
|
|
9
9
|
|
|
10
10
|
The registry is responsible for:
|
|
11
|
-
- Registering
|
|
12
|
-
- Resolving handler classes for protocol types
|
|
11
|
+
- Registering infrastructure handlers by protocol type identifier
|
|
12
|
+
- Resolving handler classes for protocol types (requires ProtocolContainerAware)
|
|
13
13
|
- Thread-safe registration operations
|
|
14
14
|
- Listing all registered protocol types
|
|
15
15
|
|
|
@@ -65,12 +65,12 @@ from __future__ import annotations
|
|
|
65
65
|
|
|
66
66
|
import threading
|
|
67
67
|
import warnings
|
|
68
|
-
from typing import TYPE_CHECKING
|
|
68
|
+
from typing import TYPE_CHECKING, Any, cast
|
|
69
69
|
|
|
70
70
|
from omnibase_infra.errors import ModelInfraErrorContext, RuntimeHostError
|
|
71
71
|
|
|
72
72
|
if TYPE_CHECKING:
|
|
73
|
-
from
|
|
73
|
+
from omnibase_infra.protocols import ProtocolContainerAware
|
|
74
74
|
|
|
75
75
|
|
|
76
76
|
# =============================================================================
|
|
@@ -115,10 +115,11 @@ class RegistryError(RuntimeHostError):
|
|
|
115
115
|
if protocol_type is not None:
|
|
116
116
|
extra_context["protocol_type"] = protocol_type
|
|
117
117
|
|
|
118
|
+
# NOTE: Cast required for mypy - **dict[str, object] doesn't satisfy **context: Any
|
|
118
119
|
super().__init__(
|
|
119
120
|
message=message,
|
|
120
121
|
context=context,
|
|
121
|
-
**extra_context,
|
|
122
|
+
**cast("dict[str, Any]", extra_context),
|
|
122
123
|
)
|
|
123
124
|
|
|
124
125
|
|
|
@@ -130,11 +131,11 @@ class RegistryError(RuntimeHostError):
|
|
|
130
131
|
class RegistryProtocolBinding:
|
|
131
132
|
"""SINGLE SOURCE OF TRUTH for handler registration in omnibase_infra.
|
|
132
133
|
|
|
133
|
-
Thread-safe registry for protocol handlers. Implements
|
|
134
|
+
Thread-safe registry for protocol handlers. Implements ProtocolContainerAwareRegistry
|
|
134
135
|
protocol from omnibase_spi.
|
|
135
136
|
|
|
136
137
|
The registry maintains a mapping from protocol type identifiers (strings like
|
|
137
|
-
"http", "db", "kafka") to handler classes that implement the
|
|
138
|
+
"http", "db", "kafka") to handler classes that implement the ProtocolContainerAware
|
|
138
139
|
protocol.
|
|
139
140
|
|
|
140
141
|
TODO(OMN-40): Migrate handler signature from tuple[str, str] to structured model.
|
|
@@ -162,13 +163,13 @@ class RegistryProtocolBinding:
|
|
|
162
163
|
|
|
163
164
|
def __init__(self) -> None:
|
|
164
165
|
"""Initialize an empty handler registry with thread lock."""
|
|
165
|
-
self._registry: dict[str, type[
|
|
166
|
+
self._registry: dict[str, type[ProtocolContainerAware]] = {}
|
|
166
167
|
self._lock: threading.Lock = threading.Lock()
|
|
167
168
|
|
|
168
169
|
def register(
|
|
169
170
|
self,
|
|
170
171
|
protocol_type: str,
|
|
171
|
-
handler_cls: type[
|
|
172
|
+
handler_cls: type[ProtocolContainerAware],
|
|
172
173
|
) -> None:
|
|
173
174
|
"""Register a protocol handler.
|
|
174
175
|
|
|
@@ -218,10 +219,10 @@ class RegistryProtocolBinding:
|
|
|
218
219
|
Args:
|
|
219
220
|
protocol_type: Protocol type identifier (e.g., 'http', 'db', 'kafka').
|
|
220
221
|
Should be one of the HANDLER_TYPE_* constants.
|
|
221
|
-
handler_cls: Handler class implementing the
|
|
222
|
+
handler_cls: Handler class implementing the ProtocolContainerAware protocol.
|
|
222
223
|
|
|
223
224
|
Raises:
|
|
224
|
-
RegistryError: If handler_cls does not implement the
|
|
225
|
+
RegistryError: If handler_cls does not implement the ProtocolContainerAware protocol
|
|
225
226
|
(missing or non-callable execute()/handle() method).
|
|
226
227
|
|
|
227
228
|
Example:
|
|
@@ -229,7 +230,7 @@ class RegistryProtocolBinding:
|
|
|
229
230
|
>>> registry.register(HANDLER_TYPE_HTTP, HttpHandler)
|
|
230
231
|
>>> registry.register(HANDLER_TYPE_DATABASE, PostgresHandler)
|
|
231
232
|
"""
|
|
232
|
-
# Runtime type validation: Ensure handler_cls implements
|
|
233
|
+
# Runtime type validation: Ensure handler_cls implements ProtocolContainerAware protocol
|
|
233
234
|
# Check if execute() or handle() method exists and is callable
|
|
234
235
|
# Following RegistryEventBusBinding pattern of supporting alternative methods
|
|
235
236
|
has_execute = hasattr(handler_cls, "execute")
|
|
@@ -239,7 +240,7 @@ class RegistryProtocolBinding:
|
|
|
239
240
|
raise RegistryError(
|
|
240
241
|
f"Handler class {handler_cls.__name__!r} for protocol type "
|
|
241
242
|
f"{protocol_type!r} is missing 'execute()' or 'handle()' method "
|
|
242
|
-
f"from
|
|
243
|
+
f"from ProtocolContainerAware protocol",
|
|
243
244
|
protocol_type=protocol_type,
|
|
244
245
|
context=ModelInfraErrorContext.with_correlation(
|
|
245
246
|
operation="register",
|
|
@@ -278,7 +279,7 @@ class RegistryProtocolBinding:
|
|
|
278
279
|
def get(
|
|
279
280
|
self,
|
|
280
281
|
protocol_type: str,
|
|
281
|
-
) -> type[
|
|
282
|
+
) -> type[ProtocolContainerAware]:
|
|
282
283
|
"""Get handler class for protocol type.
|
|
283
284
|
|
|
284
285
|
Resolves the handler class registered for the given protocol type.
|