omnibase_infra 0.2.8__py3-none-any.whl → 0.2.9__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/enums/__init__.py +4 -0
- omnibase_infra/enums/enum_declarative_node_violation.py +102 -0
- omnibase_infra/event_bus/adapters/__init__.py +31 -0
- omnibase_infra/event_bus/adapters/adapter_protocol_event_publisher_kafka.py +517 -0
- omnibase_infra/mixins/mixin_async_circuit_breaker.py +113 -1
- omnibase_infra/models/__init__.py +9 -0
- omnibase_infra/models/event_bus/__init__.py +22 -0
- omnibase_infra/models/event_bus/model_consumer_retry_config.py +367 -0
- omnibase_infra/models/event_bus/model_dlq_config.py +177 -0
- omnibase_infra/models/event_bus/model_idempotency_config.py +131 -0
- omnibase_infra/models/event_bus/model_offset_policy_config.py +107 -0
- omnibase_infra/models/resilience/model_circuit_breaker_config.py +15 -0
- omnibase_infra/models/validation/__init__.py +8 -0
- omnibase_infra/models/validation/model_declarative_node_validation_result.py +139 -0
- omnibase_infra/models/validation/model_declarative_node_violation.py +169 -0
- omnibase_infra/nodes/architecture_validator/__init__.py +28 -7
- omnibase_infra/nodes/architecture_validator/constants.py +36 -0
- omnibase_infra/nodes/architecture_validator/handlers/__init__.py +28 -0
- omnibase_infra/nodes/architecture_validator/handlers/contract.yaml +120 -0
- omnibase_infra/nodes/architecture_validator/handlers/handler_architecture_validation.py +359 -0
- omnibase_infra/nodes/architecture_validator/node.py +1 -0
- omnibase_infra/nodes/architecture_validator/node_architecture_validator.py +48 -336
- omnibase_infra/nodes/node_ledger_projection_compute/__init__.py +16 -2
- omnibase_infra/nodes/node_ledger_projection_compute/contract.yaml +14 -4
- omnibase_infra/nodes/node_ledger_projection_compute/handlers/__init__.py +18 -0
- omnibase_infra/nodes/node_ledger_projection_compute/handlers/contract.yaml +53 -0
- omnibase_infra/nodes/node_ledger_projection_compute/handlers/handler_ledger_projection.py +354 -0
- omnibase_infra/nodes/node_ledger_projection_compute/node.py +20 -256
- omnibase_infra/nodes/node_registry_effect/node.py +20 -73
- omnibase_infra/protocols/protocol_dispatch_engine.py +90 -0
- omnibase_infra/runtime/__init__.py +11 -0
- omnibase_infra/runtime/baseline_subscriptions.py +150 -0
- omnibase_infra/runtime/event_bus_subcontract_wiring.py +455 -24
- omnibase_infra/runtime/kafka_contract_source.py +13 -5
- omnibase_infra/runtime/service_message_dispatch_engine.py +112 -0
- omnibase_infra/runtime/service_runtime_host_process.py +6 -11
- omnibase_infra/services/__init__.py +36 -0
- omnibase_infra/services/contract_publisher/__init__.py +95 -0
- omnibase_infra/services/contract_publisher/config.py +199 -0
- omnibase_infra/services/contract_publisher/errors.py +243 -0
- omnibase_infra/services/contract_publisher/models/__init__.py +28 -0
- omnibase_infra/services/contract_publisher/models/model_contract_error.py +67 -0
- omnibase_infra/services/contract_publisher/models/model_infra_error.py +62 -0
- omnibase_infra/services/contract_publisher/models/model_publish_result.py +112 -0
- omnibase_infra/services/contract_publisher/models/model_publish_stats.py +79 -0
- omnibase_infra/services/contract_publisher/service.py +617 -0
- omnibase_infra/services/contract_publisher/sources/__init__.py +52 -0
- omnibase_infra/services/contract_publisher/sources/model_discovered.py +155 -0
- omnibase_infra/services/contract_publisher/sources/protocol.py +101 -0
- omnibase_infra/services/contract_publisher/sources/source_composite.py +309 -0
- omnibase_infra/services/contract_publisher/sources/source_filesystem.py +174 -0
- omnibase_infra/services/contract_publisher/sources/source_package.py +221 -0
- omnibase_infra/services/observability/__init__.py +40 -0
- omnibase_infra/services/observability/agent_actions/__init__.py +64 -0
- omnibase_infra/services/observability/agent_actions/config.py +209 -0
- omnibase_infra/services/observability/agent_actions/consumer.py +1320 -0
- omnibase_infra/services/observability/agent_actions/models/__init__.py +87 -0
- omnibase_infra/services/observability/agent_actions/models/model_agent_action.py +142 -0
- omnibase_infra/services/observability/agent_actions/models/model_detection_failure.py +125 -0
- omnibase_infra/services/observability/agent_actions/models/model_envelope.py +85 -0
- omnibase_infra/services/observability/agent_actions/models/model_execution_log.py +159 -0
- omnibase_infra/services/observability/agent_actions/models/model_performance_metric.py +130 -0
- omnibase_infra/services/observability/agent_actions/models/model_routing_decision.py +138 -0
- omnibase_infra/services/observability/agent_actions/models/model_transformation_event.py +124 -0
- omnibase_infra/services/observability/agent_actions/tests/__init__.py +20 -0
- omnibase_infra/services/observability/agent_actions/tests/test_consumer.py +1154 -0
- omnibase_infra/services/observability/agent_actions/tests/test_models.py +645 -0
- omnibase_infra/services/observability/agent_actions/tests/test_writer.py +709 -0
- omnibase_infra/services/observability/agent_actions/writer_postgres.py +926 -0
- omnibase_infra/validation/__init__.py +12 -0
- omnibase_infra/validation/contracts/declarative_node.validation.yaml +143 -0
- omnibase_infra/validation/validation_exemptions.yaml +93 -0
- omnibase_infra/validation/validator_declarative_node.py +850 -0
- {omnibase_infra-0.2.8.dist-info → omnibase_infra-0.2.9.dist-info}/METADATA +2 -2
- {omnibase_infra-0.2.8.dist-info → omnibase_infra-0.2.9.dist-info}/RECORD +79 -27
- {omnibase_infra-0.2.8.dist-info → omnibase_infra-0.2.9.dist-info}/WHEEL +0 -0
- {omnibase_infra-0.2.8.dist-info → omnibase_infra-0.2.9.dist-info}/entry_points.txt +0 -0
- {omnibase_infra-0.2.8.dist-info → omnibase_infra-0.2.9.dist-info}/licenses/LICENSE +0 -0
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
# SPDX-License-Identifier: MIT
|
|
2
|
+
# Copyright (c) 2025 OmniNode Team
|
|
3
|
+
"""Declarative Node Violation Model.
|
|
4
|
+
|
|
5
|
+
Defines the result structure for detected declarative node violations.
|
|
6
|
+
Used by the declarative node validator to report policy breaches with
|
|
7
|
+
full context for debugging and CI gate integration.
|
|
8
|
+
"""
|
|
9
|
+
|
|
10
|
+
from __future__ import annotations
|
|
11
|
+
|
|
12
|
+
from pathlib import Path
|
|
13
|
+
|
|
14
|
+
from pydantic import BaseModel, ConfigDict, Field
|
|
15
|
+
|
|
16
|
+
from omnibase_infra.enums import EnumValidationSeverity
|
|
17
|
+
from omnibase_infra.enums.enum_declarative_node_violation import (
|
|
18
|
+
EnumDeclarativeNodeViolation,
|
|
19
|
+
)
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
class ModelDeclarativeNodeViolation(BaseModel):
|
|
23
|
+
"""Result of a declarative node violation detection.
|
|
24
|
+
|
|
25
|
+
Contains full context about a detected violation for debugging,
|
|
26
|
+
reporting, and CI gate integration. Each violation includes the
|
|
27
|
+
source location, violation type, and suggested fix.
|
|
28
|
+
|
|
29
|
+
Attributes:
|
|
30
|
+
file_path: Path to the source file containing the violation.
|
|
31
|
+
line_number: Line number where the violation was detected (1-indexed).
|
|
32
|
+
violation_type: The specific violation category detected.
|
|
33
|
+
code_snippet: The relevant code snippet showing the violation.
|
|
34
|
+
suggestion: Human-readable suggestion for fixing the violation.
|
|
35
|
+
severity: Severity classification (error blocks CI, warning is advisory).
|
|
36
|
+
node_class_name: Name of the node class containing the violation.
|
|
37
|
+
method_name: Name of the offending method/property if applicable.
|
|
38
|
+
|
|
39
|
+
Example:
|
|
40
|
+
>>> violation = ModelDeclarativeNodeViolation(
|
|
41
|
+
... file_path=Path("/src/nodes/my_node/node.py"),
|
|
42
|
+
... line_number=42,
|
|
43
|
+
... violation_type=EnumDeclarativeNodeViolation.CUSTOM_METHOD,
|
|
44
|
+
... code_snippet="def compute(self, data): ...",
|
|
45
|
+
... suggestion="Move business logic to a Handler class...",
|
|
46
|
+
... node_class_name="MyNode",
|
|
47
|
+
... method_name="compute",
|
|
48
|
+
... )
|
|
49
|
+
|
|
50
|
+
Note:
|
|
51
|
+
Violations with severity='error' or 'critical' should block CI pipelines.
|
|
52
|
+
All declarative node violations are errors by default.
|
|
53
|
+
"""
|
|
54
|
+
|
|
55
|
+
file_path: Path = Field(
|
|
56
|
+
...,
|
|
57
|
+
description="Path to the source file containing the violation",
|
|
58
|
+
)
|
|
59
|
+
line_number: int = Field(
|
|
60
|
+
...,
|
|
61
|
+
ge=1,
|
|
62
|
+
description="Line number where the violation was detected (1-indexed)",
|
|
63
|
+
)
|
|
64
|
+
violation_type: EnumDeclarativeNodeViolation = Field(
|
|
65
|
+
...,
|
|
66
|
+
description="The specific declarative node violation category",
|
|
67
|
+
)
|
|
68
|
+
code_snippet: str = Field(
|
|
69
|
+
...,
|
|
70
|
+
description="The relevant code snippet showing the violation",
|
|
71
|
+
)
|
|
72
|
+
suggestion: str = Field(
|
|
73
|
+
...,
|
|
74
|
+
description="Human-readable suggestion for fixing the violation",
|
|
75
|
+
)
|
|
76
|
+
severity: EnumValidationSeverity = Field(
|
|
77
|
+
default=EnumValidationSeverity.ERROR,
|
|
78
|
+
description="Severity classification: 'error' blocks CI, 'warning' is advisory",
|
|
79
|
+
)
|
|
80
|
+
node_class_name: str = Field(
|
|
81
|
+
default="",
|
|
82
|
+
description="Name of the node class containing the violation",
|
|
83
|
+
)
|
|
84
|
+
method_name: str = Field(
|
|
85
|
+
default="",
|
|
86
|
+
description="Name of the offending method/property if applicable",
|
|
87
|
+
)
|
|
88
|
+
|
|
89
|
+
model_config = ConfigDict(
|
|
90
|
+
frozen=True,
|
|
91
|
+
extra="forbid",
|
|
92
|
+
strict=True,
|
|
93
|
+
str_strip_whitespace=True,
|
|
94
|
+
use_enum_values=False,
|
|
95
|
+
)
|
|
96
|
+
|
|
97
|
+
def is_blocking(self) -> bool:
|
|
98
|
+
"""Check if this violation should block CI.
|
|
99
|
+
|
|
100
|
+
Returns:
|
|
101
|
+
True if severity is 'error' or 'critical', False for 'warning'.
|
|
102
|
+
"""
|
|
103
|
+
return self.severity in {
|
|
104
|
+
EnumValidationSeverity.ERROR,
|
|
105
|
+
EnumValidationSeverity.CRITICAL,
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
@property
|
|
109
|
+
def is_exemptable(self) -> bool:
|
|
110
|
+
"""Check if this violation can be exempted via ONEX_EXCLUDE comment.
|
|
111
|
+
|
|
112
|
+
Delegates to the violation type's is_exemptable property.
|
|
113
|
+
Some violations like SYNTAX_ERROR and NO_NODE_CLASS cannot be
|
|
114
|
+
exempted because they indicate fundamental issues with the source file.
|
|
115
|
+
|
|
116
|
+
Returns:
|
|
117
|
+
True if the violation can be exempted via inline comment.
|
|
118
|
+
"""
|
|
119
|
+
return self.violation_type.is_exemptable
|
|
120
|
+
|
|
121
|
+
def format_for_ci(self) -> str:
|
|
122
|
+
"""Format violation for CI output (GitHub Actions compatible).
|
|
123
|
+
|
|
124
|
+
Returns:
|
|
125
|
+
Formatted string in GitHub Actions annotation format.
|
|
126
|
+
|
|
127
|
+
Example:
|
|
128
|
+
::error file=src/nodes/my_node/node.py,line=42::CUSTOM_METHOD: ...
|
|
129
|
+
"""
|
|
130
|
+
annotation_type = "error" if self.is_blocking() else "warning"
|
|
131
|
+
context = f" in {self.node_class_name}" if self.node_class_name else ""
|
|
132
|
+
return (
|
|
133
|
+
f"::{annotation_type} file={self.file_path},line={self.line_number}::"
|
|
134
|
+
f"{self.violation_type.value}{context}: {self.code_snippet}"
|
|
135
|
+
)
|
|
136
|
+
|
|
137
|
+
def format_human_readable(self) -> str:
|
|
138
|
+
"""Format violation for human-readable console output.
|
|
139
|
+
|
|
140
|
+
Includes exemption hint for exemptable violation types.
|
|
141
|
+
|
|
142
|
+
Returns:
|
|
143
|
+
Formatted string with file location and suggestion.
|
|
144
|
+
|
|
145
|
+
Example:
|
|
146
|
+
src/nodes/my_node/node.py:42 - CUSTOM_METHOD
|
|
147
|
+
Class: MyNode
|
|
148
|
+
Method: compute
|
|
149
|
+
Code: def compute(self, data): ...
|
|
150
|
+
Suggestion: Move business logic to a Handler class...
|
|
151
|
+
Exemption: Add '# ONEX_EXCLUDE: declarative_node' above the class
|
|
152
|
+
"""
|
|
153
|
+
lines = [
|
|
154
|
+
f"{self.file_path}:{self.line_number} - {self.violation_type.value}",
|
|
155
|
+
]
|
|
156
|
+
if self.node_class_name:
|
|
157
|
+
lines.append(f" Class: {self.node_class_name}")
|
|
158
|
+
if self.method_name:
|
|
159
|
+
lines.append(f" Method: {self.method_name}")
|
|
160
|
+
lines.append(f" Code: {self.code_snippet}")
|
|
161
|
+
lines.append(f" Suggestion: {self.suggestion}")
|
|
162
|
+
if self.is_exemptable:
|
|
163
|
+
lines.append(
|
|
164
|
+
" Exemption: Add '# ONEX_EXCLUDE: declarative_node' above the class"
|
|
165
|
+
)
|
|
166
|
+
return "\n".join(lines)
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
__all__ = ["ModelDeclarativeNodeViolation"]
|
|
@@ -13,8 +13,12 @@ Available Validators:
|
|
|
13
13
|
- ARCH-003: No Workflow FSM in Orchestrators
|
|
14
14
|
|
|
15
15
|
NodeArchitectureValidatorCompute (OMN-1138):
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
Declarative compute node for architecture validation. Delegates all
|
|
17
|
+
validation logic to HandlerArchitectureValidation.
|
|
18
|
+
|
|
19
|
+
HandlerArchitectureValidation (OMN-1726):
|
|
20
|
+
Handler implementing validation logic for NodeArchitectureValidatorCompute.
|
|
21
|
+
Supports pluggable rules via ProtocolArchitectureRule implementations.
|
|
18
22
|
|
|
19
23
|
Example:
|
|
20
24
|
>>> from omnibase_core.models.container import ModelONEXContainer
|
|
@@ -22,13 +26,17 @@ Example:
|
|
|
22
26
|
... NodeArchitectureValidatorCompute,
|
|
23
27
|
... ModelArchitectureValidationRequest,
|
|
24
28
|
... )
|
|
29
|
+
>>> from omnibase_infra.nodes.architecture_validator.handlers import (
|
|
30
|
+
... HandlerArchitectureValidation,
|
|
31
|
+
... )
|
|
25
32
|
>>>
|
|
26
|
-
>>> # Create
|
|
33
|
+
>>> # Create declarative node
|
|
27
34
|
>>> container = ModelONEXContainer()
|
|
28
|
-
>>>
|
|
35
|
+
>>> node = NodeArchitectureValidatorCompute(container)
|
|
29
36
|
>>>
|
|
30
|
-
>>> #
|
|
31
|
-
>>>
|
|
37
|
+
>>> # Use handler for validation
|
|
38
|
+
>>> handler = HandlerArchitectureValidation(rules=my_rules)
|
|
39
|
+
>>> result = handler.handle(ModelArchitectureValidationRequest(
|
|
32
40
|
... nodes=my_nodes,
|
|
33
41
|
... handlers=my_handlers,
|
|
34
42
|
... ))
|
|
@@ -38,11 +46,23 @@ Example:
|
|
|
38
46
|
.. versionadded:: 0.8.0
|
|
39
47
|
Added NodeArchitectureValidatorCompute as part of OMN-1138.
|
|
40
48
|
Added NodeArchitectureValidator as part of OMN-1099.
|
|
49
|
+
|
|
50
|
+
.. versionchanged:: 0.9.0
|
|
51
|
+
Refactored to declarative pattern as part of OMN-1726. Validation logic
|
|
52
|
+
moved to HandlerArchitectureValidation.
|
|
41
53
|
"""
|
|
42
54
|
|
|
43
55
|
# Canonical severity enum
|
|
44
56
|
from omnibase_infra.enums import EnumValidationSeverity
|
|
45
57
|
|
|
58
|
+
# Constants
|
|
59
|
+
from omnibase_infra.nodes.architecture_validator.constants import SUPPORTED_RULE_IDS
|
|
60
|
+
|
|
61
|
+
# Handlers
|
|
62
|
+
from omnibase_infra.nodes.architecture_validator.handlers import (
|
|
63
|
+
HandlerArchitectureValidation,
|
|
64
|
+
)
|
|
65
|
+
|
|
46
66
|
# Models
|
|
47
67
|
from omnibase_infra.nodes.architecture_validator.models import (
|
|
48
68
|
ModelArchitectureValidationRequest,
|
|
@@ -52,7 +72,6 @@ from omnibase_infra.nodes.architecture_validator.models import (
|
|
|
52
72
|
)
|
|
53
73
|
from omnibase_infra.nodes.architecture_validator.node import NodeArchitectureValidator
|
|
54
74
|
from omnibase_infra.nodes.architecture_validator.node_architecture_validator import (
|
|
55
|
-
SUPPORTED_RULE_IDS,
|
|
56
75
|
NodeArchitectureValidatorCompute,
|
|
57
76
|
)
|
|
58
77
|
from omnibase_infra.nodes.architecture_validator.protocols import (
|
|
@@ -63,6 +82,8 @@ from omnibase_infra.nodes.architecture_validator.registry import (
|
|
|
63
82
|
)
|
|
64
83
|
|
|
65
84
|
__all__ = [
|
|
85
|
+
# OMN-1726: HandlerArchitectureValidation
|
|
86
|
+
"HandlerArchitectureValidation",
|
|
66
87
|
# OMN-1138: NodeArchitectureValidatorCompute
|
|
67
88
|
"NodeArchitectureValidatorCompute",
|
|
68
89
|
"SUPPORTED_RULE_IDS",
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# SPDX-License-Identifier: MIT
|
|
2
|
+
# Copyright (c) 2025 OmniNode Team
|
|
3
|
+
"""Constants for the architecture validator node.
|
|
4
|
+
|
|
5
|
+
This module defines constants used by the architecture validator node and its
|
|
6
|
+
handlers. These constants are extracted from the node to enable handler-based
|
|
7
|
+
architecture while keeping the supported rules defined in one place.
|
|
8
|
+
|
|
9
|
+
Related:
|
|
10
|
+
- OMN-1138: Architecture Validator for omnibase_infra
|
|
11
|
+
- OMN-1726: Refactor to declarative pattern
|
|
12
|
+
|
|
13
|
+
.. versionadded:: 0.8.0
|
|
14
|
+
Created as part of OMN-1138 Architecture Validator implementation.
|
|
15
|
+
|
|
16
|
+
.. versionchanged:: 0.9.0
|
|
17
|
+
Extracted to separate module as part of OMN-1726 declarative refactoring.
|
|
18
|
+
"""
|
|
19
|
+
|
|
20
|
+
from __future__ import annotations
|
|
21
|
+
|
|
22
|
+
# Supported rule IDs from contract_architecture_validator.yaml
|
|
23
|
+
# These are the only rules that this validator node is designed to handle.
|
|
24
|
+
# Any rule not in this set indicates a misconfiguration or version mismatch.
|
|
25
|
+
SUPPORTED_RULE_IDS: frozenset[str] = frozenset(
|
|
26
|
+
{
|
|
27
|
+
"NO_HANDLER_PUBLISHING",
|
|
28
|
+
"PURE_REDUCERS",
|
|
29
|
+
"NO_FSM_IN_ORCHESTRATORS",
|
|
30
|
+
"NO_WORKFLOW_IN_REDUCERS",
|
|
31
|
+
"NO_DIRECT_HANDLER_DISPATCH",
|
|
32
|
+
"NO_LOCAL_ONLY_PATHS",
|
|
33
|
+
}
|
|
34
|
+
)
|
|
35
|
+
|
|
36
|
+
__all__ = ["SUPPORTED_RULE_IDS"]
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# SPDX-License-Identifier: MIT
|
|
2
|
+
# Copyright (c) 2025 OmniNode Team
|
|
3
|
+
"""Handlers for NodeArchitectureValidatorCompute.
|
|
4
|
+
|
|
5
|
+
This module exports the architecture validation handler that implements
|
|
6
|
+
the validation logic for the declarative compute node.
|
|
7
|
+
|
|
8
|
+
Handler Architecture:
|
|
9
|
+
- Handlers are stateless classes (no mutable state between calls)
|
|
10
|
+
- Handlers receive all context via the request model
|
|
11
|
+
- Handlers return structured result models
|
|
12
|
+
- Time-based decisions use explicit timestamp injection
|
|
13
|
+
|
|
14
|
+
Related Tickets:
|
|
15
|
+
- OMN-1138: Architecture Validator for omnibase_infra
|
|
16
|
+
- OMN-1726: Refactor to declarative pattern with contract-driven handler
|
|
17
|
+
|
|
18
|
+
.. versionadded:: 0.9.0
|
|
19
|
+
Created as part of OMN-1726 declarative refactoring.
|
|
20
|
+
"""
|
|
21
|
+
|
|
22
|
+
from omnibase_infra.nodes.architecture_validator.handlers.handler_architecture_validation import (
|
|
23
|
+
HandlerArchitectureValidation,
|
|
24
|
+
)
|
|
25
|
+
|
|
26
|
+
__all__: list[str] = [
|
|
27
|
+
"HandlerArchitectureValidation",
|
|
28
|
+
]
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
# SPDX-License-Identifier: MIT
|
|
2
|
+
# Copyright (c) 2025 OmniNode Team
|
|
3
|
+
#
|
|
4
|
+
# ONEX Handler Contract - Architecture Validation Handler
|
|
5
|
+
#
|
|
6
|
+
# This contract defines the interface for the Architecture Validation handler,
|
|
7
|
+
# which validates ONEX nodes and handlers against architecture rules.
|
|
8
|
+
#
|
|
9
|
+
# =============================================================================
|
|
10
|
+
# HANDLER OVERVIEW
|
|
11
|
+
# =============================================================================
|
|
12
|
+
# This handler processes architecture validation requests and returns structured
|
|
13
|
+
# validation results. It encapsulates the validation logic that was previously
|
|
14
|
+
# in NodeArchitectureValidatorCompute.
|
|
15
|
+
#
|
|
16
|
+
# Supported Operations:
|
|
17
|
+
# - architecture.validate: Validate nodes and handlers against rules
|
|
18
|
+
#
|
|
19
|
+
# =============================================================================
|
|
20
|
+
# Handler identifier
|
|
21
|
+
name: "handler_architecture_validation"
|
|
22
|
+
handler_id: "handler-architecture-validation"
|
|
23
|
+
# Version (semantic versioning)
|
|
24
|
+
contract_version:
|
|
25
|
+
major: 1
|
|
26
|
+
minor: 0
|
|
27
|
+
patch: 0
|
|
28
|
+
# Node type context - this handler is used by COMPUTE_GENERIC nodes
|
|
29
|
+
node_type: "COMPUTE_GENERIC"
|
|
30
|
+
# Description
|
|
31
|
+
description: >
|
|
32
|
+
Handler for architecture validation operations. Validates ONEX nodes and handlers against configurable architecture rules. Supports pluggable rules via the ProtocolArchitectureRule protocol. Returns structured validation results with violations grouped by rule and severity.
|
|
33
|
+
|
|
34
|
+
# Strongly typed I/O models
|
|
35
|
+
input_model:
|
|
36
|
+
name: "ModelArchitectureValidationRequest"
|
|
37
|
+
module: "omnibase_infra.nodes.architecture_validator.models"
|
|
38
|
+
description: >
|
|
39
|
+
Request containing nodes and handlers to validate, optional rule filters, and validation configuration (fail_fast, correlation_id).
|
|
40
|
+
|
|
41
|
+
output_model:
|
|
42
|
+
name: "ModelArchitectureValidationResult"
|
|
43
|
+
module: "omnibase_infra.nodes.architecture_validator.models"
|
|
44
|
+
description: >
|
|
45
|
+
Result containing validation status, violations found, rules checked, and counts of nodes/handlers validated.
|
|
46
|
+
|
|
47
|
+
# Handler routing configuration
|
|
48
|
+
handler_routing:
|
|
49
|
+
routing_strategy: "operation_match"
|
|
50
|
+
handlers:
|
|
51
|
+
- handler_type: "architecture_validation"
|
|
52
|
+
handler:
|
|
53
|
+
name: "HandlerArchitectureValidation"
|
|
54
|
+
module: "omnibase_infra.nodes.architecture_validator.handlers.handler_architecture_validation"
|
|
55
|
+
supported_operations:
|
|
56
|
+
- "architecture.validate"
|
|
57
|
+
# Supported rules (from contract_architecture_validator.yaml)
|
|
58
|
+
# These are the only rules that this handler is designed to process.
|
|
59
|
+
supported_rules:
|
|
60
|
+
- rule_id: "NO_HANDLER_PUBLISHING"
|
|
61
|
+
description: >
|
|
62
|
+
Handlers MUST NOT have direct event bus access. Only orchestrators may publish events. Handlers return events; orchestrators publish.
|
|
63
|
+
|
|
64
|
+
- rule_id: "PURE_REDUCERS"
|
|
65
|
+
description: >
|
|
66
|
+
Reducers MUST be pure functions without side effects. They aggregate state and emit intents, but do not perform I/O operations.
|
|
67
|
+
|
|
68
|
+
- rule_id: "NO_FSM_IN_ORCHESTRATORS"
|
|
69
|
+
description: >
|
|
70
|
+
Orchestrators MUST NOT contain FSM (Finite State Machine) definitions. FSMs belong exclusively to reducer nodes.
|
|
71
|
+
|
|
72
|
+
- rule_id: "NO_WORKFLOW_IN_REDUCERS"
|
|
73
|
+
description: >
|
|
74
|
+
Reducers MUST NOT contain workflow logic. Workflow coordination belongs exclusively to orchestrator nodes.
|
|
75
|
+
|
|
76
|
+
- rule_id: "NO_DIRECT_HANDLER_DISPATCH"
|
|
77
|
+
description: >
|
|
78
|
+
Handlers MUST NOT be invoked directly bypassing the RuntimeHost. All event routing MUST go through the MessageDispatchEngine.
|
|
79
|
+
|
|
80
|
+
- rule_id: "NO_LOCAL_ONLY_PATHS"
|
|
81
|
+
description: >
|
|
82
|
+
Paths MUST NOT use local-only conventions that break portability. All paths should be relative or use environment variables.
|
|
83
|
+
|
|
84
|
+
# Handler descriptor
|
|
85
|
+
descriptor:
|
|
86
|
+
node_archetype: compute
|
|
87
|
+
purity: pure
|
|
88
|
+
idempotent: true
|
|
89
|
+
timeout_ms: 30000
|
|
90
|
+
retry_policy:
|
|
91
|
+
enabled: false
|
|
92
|
+
circuit_breaker:
|
|
93
|
+
enabled: false
|
|
94
|
+
concurrency_policy: concurrent
|
|
95
|
+
isolation_policy: none
|
|
96
|
+
observability_level: standard
|
|
97
|
+
# Capabilities provided by this handler
|
|
98
|
+
capabilities:
|
|
99
|
+
- name: "architecture_validation"
|
|
100
|
+
description: "Validate architecture patterns across nodes and handlers"
|
|
101
|
+
- name: "rule_based_validation"
|
|
102
|
+
description: "Extensible rule-based validation engine"
|
|
103
|
+
- name: "violation_reporting"
|
|
104
|
+
description: "Structured violation reporting with severity levels"
|
|
105
|
+
# Tags
|
|
106
|
+
tags:
|
|
107
|
+
- compute
|
|
108
|
+
- validation
|
|
109
|
+
- architecture
|
|
110
|
+
- handler
|
|
111
|
+
- onex-compliance
|
|
112
|
+
# Metadata
|
|
113
|
+
metadata:
|
|
114
|
+
author: "OmniNode Team"
|
|
115
|
+
license: "MIT"
|
|
116
|
+
created: "2025-01-30"
|
|
117
|
+
ticket: "OMN-1726"
|
|
118
|
+
related_tickets:
|
|
119
|
+
- "OMN-1138"
|
|
120
|
+
- "OMN-1099"
|