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.
Files changed (161) hide show
  1. omnibase_infra/__init__.py +1 -1
  2. omnibase_infra/adapters/adapter_onex_tool_execution.py +451 -0
  3. omnibase_infra/capabilities/__init__.py +15 -0
  4. omnibase_infra/capabilities/capability_inference_rules.py +211 -0
  5. omnibase_infra/capabilities/contract_capability_extractor.py +221 -0
  6. omnibase_infra/capabilities/intent_type_extractor.py +160 -0
  7. omnibase_infra/cli/commands.py +1 -1
  8. omnibase_infra/configs/widget_mapping.yaml +176 -0
  9. omnibase_infra/contracts/handlers/filesystem/handler_contract.yaml +5 -2
  10. omnibase_infra/contracts/handlers/mcp/handler_contract.yaml +5 -2
  11. omnibase_infra/enums/__init__.py +6 -0
  12. omnibase_infra/enums/enum_handler_error_type.py +10 -0
  13. omnibase_infra/enums/enum_handler_source_mode.py +72 -0
  14. omnibase_infra/enums/enum_kafka_acks.py +99 -0
  15. omnibase_infra/errors/error_compute_registry.py +4 -1
  16. omnibase_infra/errors/error_event_bus_registry.py +4 -1
  17. omnibase_infra/errors/error_infra.py +3 -1
  18. omnibase_infra/errors/error_policy_registry.py +4 -1
  19. omnibase_infra/event_bus/event_bus_kafka.py +1 -1
  20. omnibase_infra/event_bus/models/config/model_kafka_event_bus_config.py +59 -10
  21. omnibase_infra/handlers/__init__.py +8 -1
  22. omnibase_infra/handlers/handler_consul.py +7 -1
  23. omnibase_infra/handlers/handler_db.py +10 -3
  24. omnibase_infra/handlers/handler_graph.py +10 -5
  25. omnibase_infra/handlers/handler_http.py +8 -2
  26. omnibase_infra/handlers/handler_intent.py +387 -0
  27. omnibase_infra/handlers/handler_mcp.py +745 -63
  28. omnibase_infra/handlers/handler_vault.py +11 -5
  29. omnibase_infra/handlers/mixins/mixin_consul_kv.py +4 -3
  30. omnibase_infra/handlers/mixins/mixin_consul_service.py +2 -1
  31. omnibase_infra/handlers/registration_storage/handler_registration_storage_postgres.py +7 -0
  32. omnibase_infra/handlers/service_discovery/handler_service_discovery_consul.py +308 -4
  33. omnibase_infra/handlers/service_discovery/models/model_service_info.py +10 -0
  34. omnibase_infra/mixins/mixin_async_circuit_breaker.py +3 -2
  35. omnibase_infra/mixins/mixin_node_introspection.py +42 -7
  36. omnibase_infra/mixins/mixin_retry_execution.py +1 -1
  37. omnibase_infra/models/discovery/model_introspection_config.py +11 -0
  38. omnibase_infra/models/handlers/__init__.py +48 -5
  39. omnibase_infra/models/handlers/model_bootstrap_handler_descriptor.py +162 -0
  40. omnibase_infra/models/handlers/model_contract_discovery_result.py +6 -4
  41. omnibase_infra/models/handlers/model_handler_descriptor.py +15 -0
  42. omnibase_infra/models/handlers/model_handler_source_config.py +220 -0
  43. omnibase_infra/models/mcp/__init__.py +15 -0
  44. omnibase_infra/models/mcp/model_mcp_contract_config.py +80 -0
  45. omnibase_infra/models/mcp/model_mcp_server_config.py +67 -0
  46. omnibase_infra/models/mcp/model_mcp_tool_definition.py +73 -0
  47. omnibase_infra/models/mcp/model_mcp_tool_parameter.py +35 -0
  48. omnibase_infra/models/registration/model_node_capabilities.py +11 -0
  49. omnibase_infra/models/registration/model_node_introspection_event.py +9 -0
  50. omnibase_infra/models/runtime/model_handler_contract.py +25 -9
  51. omnibase_infra/models/runtime/model_loaded_handler.py +9 -0
  52. omnibase_infra/nodes/architecture_validator/contract_architecture_validator.yaml +0 -5
  53. omnibase_infra/nodes/architecture_validator/registry/registry_infra_architecture_validator.py +17 -10
  54. omnibase_infra/nodes/effects/contract.yaml +0 -5
  55. omnibase_infra/nodes/node_registration_orchestrator/contract.yaml +7 -0
  56. omnibase_infra/nodes/node_registration_orchestrator/handlers/handler_node_introspected.py +86 -1
  57. omnibase_infra/nodes/node_registration_orchestrator/introspection_event_router.py +3 -3
  58. omnibase_infra/nodes/node_registration_orchestrator/plugin.py +1 -1
  59. omnibase_infra/nodes/node_registration_orchestrator/registry/registry_infra_node_registration_orchestrator.py +9 -8
  60. omnibase_infra/nodes/node_registration_orchestrator/timeout_coordinator.py +4 -3
  61. omnibase_infra/nodes/node_registration_orchestrator/wiring.py +14 -13
  62. omnibase_infra/nodes/node_registration_storage_effect/contract.yaml +0 -5
  63. omnibase_infra/nodes/node_registration_storage_effect/node.py +4 -1
  64. omnibase_infra/nodes/node_registration_storage_effect/registry/registry_infra_registration_storage.py +47 -26
  65. omnibase_infra/nodes/node_registry_effect/contract.yaml +0 -5
  66. omnibase_infra/nodes/node_registry_effect/handlers/handler_partial_retry.py +2 -1
  67. omnibase_infra/nodes/node_service_discovery_effect/registry/registry_infra_service_discovery.py +28 -20
  68. omnibase_infra/plugins/examples/plugin_json_normalizer.py +2 -2
  69. omnibase_infra/plugins/examples/plugin_json_normalizer_error_handling.py +2 -2
  70. omnibase_infra/plugins/plugin_compute_base.py +16 -2
  71. omnibase_infra/protocols/__init__.py +2 -0
  72. omnibase_infra/protocols/protocol_container_aware.py +200 -0
  73. omnibase_infra/protocols/protocol_event_projector.py +1 -1
  74. omnibase_infra/runtime/__init__.py +90 -1
  75. omnibase_infra/runtime/binding_config_resolver.py +102 -37
  76. omnibase_infra/runtime/constants_notification.py +75 -0
  77. omnibase_infra/runtime/contract_handler_discovery.py +6 -1
  78. omnibase_infra/runtime/handler_bootstrap_source.py +507 -0
  79. omnibase_infra/runtime/handler_contract_config_loader.py +603 -0
  80. omnibase_infra/runtime/handler_contract_source.py +267 -186
  81. omnibase_infra/runtime/handler_identity.py +81 -0
  82. omnibase_infra/runtime/handler_plugin_loader.py +19 -2
  83. omnibase_infra/runtime/handler_registry.py +11 -3
  84. omnibase_infra/runtime/handler_source_resolver.py +326 -0
  85. omnibase_infra/runtime/mixin_semver_cache.py +25 -1
  86. omnibase_infra/runtime/mixins/__init__.py +7 -0
  87. omnibase_infra/runtime/mixins/mixin_projector_notification_publishing.py +566 -0
  88. omnibase_infra/runtime/mixins/mixin_projector_sql_operations.py +31 -10
  89. omnibase_infra/runtime/models/__init__.py +24 -0
  90. omnibase_infra/runtime/models/model_health_check_result.py +2 -1
  91. omnibase_infra/runtime/models/model_projector_notification_config.py +171 -0
  92. omnibase_infra/runtime/models/model_transition_notification_outbox_config.py +112 -0
  93. omnibase_infra/runtime/models/model_transition_notification_outbox_metrics.py +140 -0
  94. omnibase_infra/runtime/models/model_transition_notification_publisher_metrics.py +357 -0
  95. omnibase_infra/runtime/projector_plugin_loader.py +1 -1
  96. omnibase_infra/runtime/projector_shell.py +229 -1
  97. omnibase_infra/runtime/protocol_lifecycle_executor.py +6 -6
  98. omnibase_infra/runtime/protocols/__init__.py +10 -0
  99. omnibase_infra/runtime/registry/registry_protocol_binding.py +16 -15
  100. omnibase_infra/runtime/registry_contract_source.py +693 -0
  101. omnibase_infra/runtime/registry_policy.py +9 -326
  102. omnibase_infra/runtime/secret_resolver.py +4 -2
  103. omnibase_infra/runtime/service_kernel.py +11 -3
  104. omnibase_infra/runtime/service_message_dispatch_engine.py +4 -2
  105. omnibase_infra/runtime/service_runtime_host_process.py +589 -106
  106. omnibase_infra/runtime/transition_notification_outbox.py +1190 -0
  107. omnibase_infra/runtime/transition_notification_publisher.py +764 -0
  108. omnibase_infra/runtime/util_container_wiring.py +6 -5
  109. omnibase_infra/runtime/util_wiring.py +17 -4
  110. omnibase_infra/schemas/schema_transition_notification_outbox.sql +245 -0
  111. omnibase_infra/services/__init__.py +21 -0
  112. omnibase_infra/services/corpus_capture.py +7 -1
  113. omnibase_infra/services/mcp/__init__.py +31 -0
  114. omnibase_infra/services/mcp/mcp_server_lifecycle.py +449 -0
  115. omnibase_infra/services/mcp/service_mcp_tool_discovery.py +411 -0
  116. omnibase_infra/services/mcp/service_mcp_tool_registry.py +329 -0
  117. omnibase_infra/services/mcp/service_mcp_tool_sync.py +547 -0
  118. omnibase_infra/services/registry_api/__init__.py +40 -0
  119. omnibase_infra/services/registry_api/main.py +261 -0
  120. omnibase_infra/services/registry_api/models/__init__.py +66 -0
  121. omnibase_infra/services/registry_api/models/model_capability_widget_mapping.py +38 -0
  122. omnibase_infra/services/registry_api/models/model_pagination_info.py +48 -0
  123. omnibase_infra/services/registry_api/models/model_registry_discovery_response.py +73 -0
  124. omnibase_infra/services/registry_api/models/model_registry_health_response.py +49 -0
  125. omnibase_infra/services/registry_api/models/model_registry_instance_view.py +88 -0
  126. omnibase_infra/services/registry_api/models/model_registry_node_view.py +88 -0
  127. omnibase_infra/services/registry_api/models/model_registry_summary.py +60 -0
  128. omnibase_infra/services/registry_api/models/model_response_list_instances.py +43 -0
  129. omnibase_infra/services/registry_api/models/model_response_list_nodes.py +51 -0
  130. omnibase_infra/services/registry_api/models/model_warning.py +49 -0
  131. omnibase_infra/services/registry_api/models/model_widget_defaults.py +28 -0
  132. omnibase_infra/services/registry_api/models/model_widget_mapping.py +51 -0
  133. omnibase_infra/services/registry_api/routes.py +371 -0
  134. omnibase_infra/services/registry_api/service.py +837 -0
  135. omnibase_infra/services/service_capability_query.py +4 -4
  136. omnibase_infra/services/service_health.py +3 -2
  137. omnibase_infra/services/service_timeout_emitter.py +20 -3
  138. omnibase_infra/services/service_timeout_scanner.py +7 -3
  139. omnibase_infra/services/session/__init__.py +56 -0
  140. omnibase_infra/services/session/config_consumer.py +120 -0
  141. omnibase_infra/services/session/config_store.py +139 -0
  142. omnibase_infra/services/session/consumer.py +1007 -0
  143. omnibase_infra/services/session/protocol_session_aggregator.py +117 -0
  144. omnibase_infra/services/session/store.py +997 -0
  145. omnibase_infra/utils/__init__.py +19 -0
  146. omnibase_infra/utils/util_atomic_file.py +261 -0
  147. omnibase_infra/utils/util_db_transaction.py +239 -0
  148. omnibase_infra/utils/util_dsn_validation.py +1 -1
  149. omnibase_infra/utils/util_retry_optimistic.py +281 -0
  150. omnibase_infra/validation/__init__.py +3 -19
  151. omnibase_infra/validation/contracts/security.validation.yaml +114 -0
  152. omnibase_infra/validation/infra_validators.py +35 -24
  153. omnibase_infra/validation/validation_exemptions.yaml +140 -9
  154. omnibase_infra/validation/validator_chain_propagation.py +2 -2
  155. omnibase_infra/validation/validator_runtime_shape.py +1 -1
  156. omnibase_infra/validation/validator_security.py +473 -370
  157. {omnibase_infra-0.2.1.dist-info → omnibase_infra-0.2.3.dist-info}/METADATA +3 -3
  158. {omnibase_infra-0.2.1.dist-info → omnibase_infra-0.2.3.dist-info}/RECORD +161 -98
  159. {omnibase_infra-0.2.1.dist-info → omnibase_infra-0.2.3.dist-info}/WHEEL +0 -0
  160. {omnibase_infra-0.2.1.dist-info → omnibase_infra-0.2.3.dist-info}/entry_points.txt +0 -0
  161. {omnibase_infra-0.2.1.dist-info → omnibase_infra-0.2.3.dist-info}/licenses/LICENSE +0 -0
@@ -486,6 +486,47 @@ pattern_exemptions:
486
486
  - CLAUDE.md (Registry Naming Conventions)
487
487
  ticket: OMN-953
488
488
  # ==========================================================================
489
+ # TransitionNotificationPublisher publisher_id Exemption (OMN-1139)
490
+ # ==========================================================================
491
+ # publisher_id is a human-readable semantic identifier similar to scheduler_id.
492
+ # It identifies the publisher instance and may be auto-generated or user-specified.
493
+ - file_pattern: 'model_transition_notification_publisher_metrics\.py'
494
+ violation_pattern: "Field 'publisher_id' should use UUID"
495
+ reason: >
496
+ publisher_id is a human-readable semantic identifier (e.g., "transition-publisher-<uuid>") that identifies the publisher instance. Follows the same pattern as scheduler_id.
497
+
498
+ documentation:
499
+ - CLAUDE.md (Registry Naming Conventions)
500
+ ticket: OMN-1139
501
+ # ==========================================================================
502
+ # ModelTransitionNotificationOutboxMetrics table_name Exemption (OMN-1139)
503
+ # ==========================================================================
504
+ # table_name is the database table name string, not an entity reference.
505
+ - file_pattern: 'model_transition_notification_outbox_metrics\.py'
506
+ violation_pattern: "Field 'table_name' might reference an entity"
507
+ reason: >
508
+ table_name is the database table name string (e.g., "transition_notification_outbox"), not an entity reference. It identifies the outbox table for metrics reporting and does not require ID + display_name pattern.
509
+
510
+ documentation:
511
+ - CLAUDE.md (Registry Naming Conventions)
512
+ ticket: OMN-1139
513
+ # ==========================================================================
514
+ # TransitionNotificationOutbox Method Count Exemption (OMN-1139)
515
+ # ==========================================================================
516
+ # Outbox pattern requires lifecycle (start/stop), storage (store/cleanup),
517
+ # processing (process_pending), and multiple config properties for observability.
518
+ # NOTE: Pattern anchored with src/omnibase_infra/runtime/ prefix to match only
519
+ # the production file, not test files.
520
+ - file_pattern: 'src/omnibase_infra/runtime/transition_notification_outbox\.py'
521
+ class_pattern: "Class 'TransitionNotificationOutbox'"
522
+ violation_pattern: 'has \d+ methods'
523
+ reason: >
524
+ Transactional outbox pattern inherently requires: lifecycle methods (start/stop), storage operations (store/cleanup_processed), processing (process_pending), background loop (_processor_loop), metrics (get_metrics), and configuration properties (table_name, batch_size, poll_interval, is_running, shutdown_timeout, notifications_stored/processed/failed, strict_transaction_mode). Method count is driven by pattern requirements, not poor design.
525
+
526
+ documentation:
527
+ - src/omnibase_infra/schemas/schema_transition_notification_outbox.sql
528
+ ticket: OMN-1139
529
+ # ==========================================================================
489
530
  # ServiceTimeoutEmitter/Scanner Naming Exemptions (OMN-1055)
490
531
  # ==========================================================================
491
532
  # These service classes follow the CLAUDE.md Service<Name> naming convention.
@@ -1032,6 +1073,54 @@ pattern_exemptions:
1032
1073
  - CLAUDE.md (ONEX Architecture - Handler Types)
1033
1074
  ticket: OMN-1097
1034
1075
  # ==========================================================================
1076
+ # Handler Bootstrap Source Exemptions (OMN-1087)
1077
+ # ==========================================================================
1078
+ # HandlerBootstrapSource provides hardcoded handler descriptors for core
1079
+ # infrastructure handlers. The "Handler" in the name refers to ONEX handler
1080
+ # concepts, consistent with HandlerContractSource and HandlerPluginLoader.
1081
+ #
1082
+ # Pattern specificity note: Uses separate class_pattern + violation_pattern
1083
+ # (not combined "Class name .* contains...") for precise targeting. All three
1084
+ # patterns must match: exact filename, exact class name, and violation type.
1085
+ # This is consistent with HandlerContractSource/HandlerPluginLoader exemptions.
1086
+ - file_pattern: 'handler_bootstrap_source\.py'
1087
+ class_pattern: "Class name 'HandlerBootstrapSource'"
1088
+ violation_pattern: "contains anti-pattern 'Handler'"
1089
+ reason: >
1090
+ HandlerBootstrapSource centralizes hardcoded handler registration for core infrastructure handlers (Consul, DB, HTTP, Vault). The "Handler" refers to ONEX handler concepts, consistent with HandlerContractSource. This is legitimate handler infrastructure code per OMN-1087.
1091
+
1092
+ documentation:
1093
+ - docs/architecture/HANDLER_PROTOCOL_DRIVEN_ARCHITECTURE.md
1094
+ - CLAUDE.md (ONEX Architecture - Handler Types)
1095
+ ticket: OMN-1087
1096
+ # ==========================================================================
1097
+ # Handler Source Mode Exemptions (OMN-1095)
1098
+ # ==========================================================================
1099
+ # EnumHandlerSourceMode and HandlerSourceResolver are part of the handler
1100
+ # source mode feature flag implementation. The "Handler" in the names refers
1101
+ # to ONEX handler concepts (how handlers are discovered/loaded), consistent
1102
+ # with HandlerBootstrapSource and HandlerContractSource.
1103
+ - file_pattern: 'enum_handler_source_mode\.py'
1104
+ class_pattern: "Class name 'EnumHandlerSourceMode'"
1105
+ violation_pattern: "contains anti-pattern 'Handler'"
1106
+ reason: >
1107
+ EnumHandlerSourceMode defines handler loading modes (BOOTSTRAP, CONTRACT, HYBRID). The "Handler" refers to ONEX handler concepts - how handlers are discovered and loaded at runtime. Consistent with HandlerBootstrapSource and HandlerContractSource naming.
1108
+
1109
+ documentation:
1110
+ - docs/architecture/HANDLER_PROTOCOL_DRIVEN_ARCHITECTURE.md
1111
+ - CLAUDE.md (ONEX Architecture - Handler Types)
1112
+ ticket: OMN-1095
1113
+ - file_pattern: 'handler_source_resolver\.py'
1114
+ class_pattern: "Class name 'HandlerSourceResolver'"
1115
+ violation_pattern: "contains anti-pattern 'Handler'"
1116
+ reason: >
1117
+ HandlerSourceResolver implements per-handler identity resolution between bootstrap and contract sources. The "Handler" refers to ONEX handler concepts - resolving which handler source takes precedence. Consistent with HandlerBootstrapSource and HandlerContractSource naming.
1118
+
1119
+ documentation:
1120
+ - docs/architecture/HANDLER_PROTOCOL_DRIVEN_ARCHITECTURE.md
1121
+ - CLAUDE.md (ONEX Architecture - Handler Types)
1122
+ ticket: OMN-1095
1123
+ # ==========================================================================
1035
1124
  # Handler Plugin Loader Exemptions (OMN-1132)
1036
1125
  # ==========================================================================
1037
1126
  # HandlerPluginLoader discovers and loads ONEX handlers from contract YAML files.
@@ -1456,16 +1545,17 @@ pattern_exemptions:
1456
1545
  # ProjectorShell Exemptions (OMN-1169)
1457
1546
  # ==========================================================================
1458
1547
  # ProjectorShell implements ProtocolEventProjector protocol which requires:
1459
- # - Protocol properties (projector_id, aggregate_type, consumed_events, is_placeholder)
1460
- # - Core methods (project, get_state)
1461
- # - SQL execution modes (_upsert, _insert, _append, _execute_projection)
1462
- # - Value extraction (_extract_values, _resolve_path, _get_event_type)
1463
- # - Utility (_parse_row_count)
1464
- # Total: 11 methods, all cohesive to the projector contract pattern.
1465
- # NOTE: Pattern anchored with omnibase_infra/runtime/ prefix and $ suffix to
1466
- # match only the production file at src/omnibase_infra/runtime/projector_shell.py.
1548
+ # - Protocol properties (projector_id, aggregate_type, consumed_events, contract, is_placeholder)
1549
+ # - Core methods (project, get_state, get_states, partial_update, upsert_partial)
1550
+ # - SQL execution modes handled by MixinProjectorSqlOperations
1551
+ # - Value extraction (_extract_values, _resolve_path, _get_event_type, _execute_projection)
1552
+ # - Notification integration (via MixinProjectorNotificationPublishing)
1553
+ # Total: 11 methods, all cohesive to the contract-driven projector pattern.
1554
+ # OMN-1139: Added notification publishing support via mixin composition.
1555
+ # NOTE: Pattern anchored with src/omnibase_infra/runtime/ prefix to match only
1556
+ # the production file at src/omnibase_infra/runtime/projector_shell.py.
1467
1557
  # This prevents matching test files in tests/unit/runtime/ or tests/integration/runtime/.
1468
- - file_pattern: 'omnibase_infra/runtime/projector_shell\.py$'
1558
+ - file_pattern: 'src/omnibase_infra/runtime/projector_shell\.py'
1469
1559
  class_pattern: "Class 'ProjectorShell'"
1470
1560
  violation_pattern: 'has \d+ methods'
1471
1561
  reason: >
@@ -1631,6 +1721,47 @@ pattern_exemptions:
1631
1721
  documentation:
1632
1722
  - docs/patterns/binding_config_resolver.md
1633
1723
  ticket: OMN-765
1724
+ # ==========================================================================
1725
+ # HandlerMCP Method Count Exemption (OMN-1282)
1726
+ # ==========================================================================
1727
+ # MCP handler is a complex infrastructure component requiring many methods:
1728
+ # - 4 ProtocolHandler methods (initialize, shutdown, execute, health_check)
1729
+ # - 2 factory methods for route handlers (_create_health_endpoint, _create_tools_list_endpoint)
1730
+ # - 2 server lifecycle methods (_start_http_server, _stop_http_server)
1731
+ # - 3 execution/operation methods (_run_server, _execute_tool_operation, _execute_describe)
1732
+ # Complexity is inherent to MCP protocol requirements and uvicorn server management.
1733
+ - file_pattern: 'handler_mcp\.py'
1734
+ class_pattern: "Class 'HandlerMCP'"
1735
+ violation_pattern: 'has \d+ methods'
1736
+ reason: >
1737
+ HandlerMCP is a complex infrastructure handler implementing MCP protocol with internal uvicorn server lifecycle. The 11 methods are cohesive: 4 ProtocolHandler interface methods, 2 factory methods for Starlette route handlers (explicit closure capture), 2 server lifecycle methods (start/stop), and 3 operation methods. Splitting would fragment the unified MCP server abstraction.
1738
+
1739
+ documentation:
1740
+ - CLAUDE.md (Handler Plugin Loader Patterns)
1741
+ ticket: OMN-1282
1742
+ # ==========================================================================
1743
+ # Registry API Models - service_name Exemptions (OMN-1278)
1744
+ # ==========================================================================
1745
+ # service_name in registry API models is the Consul service name for discovery,
1746
+ # NOT an entity reference. It's an external Consul identifier.
1747
+ - file_pattern: 'services/registry_api/models/model_registry_node_view\.py'
1748
+ violation_pattern: "Field 'service_name' might reference an entity"
1749
+ reason: >
1750
+ service_name is the Consul service name for service discovery (e.g., "onex-effect-abc123"). This is an external Consul identifier, NOT an ONEX entity reference. The node_id field provides the UUID identifier; service_name is how the node appears in Consul's catalog.
1751
+
1752
+ documentation:
1753
+ - CLAUDE.md (Type Annotation Conventions)
1754
+ - Consul service discovery documentation
1755
+ ticket: OMN-1278
1756
+ - file_pattern: 'services/registry_api/models/model_registry_instance_view\.py'
1757
+ violation_pattern: "Field 'service_name' might reference an entity"
1758
+ reason: >
1759
+ service_name is the Consul service name for live instance discovery (e.g., "my-service"). This is an external Consul identifier, NOT an ONEX entity reference. The node_id and service_id fields provide UUID identifiers; service_name is the Consul catalog name.
1760
+
1761
+ documentation:
1762
+ - CLAUDE.md (Type Annotation Conventions)
1763
+ - Consul service discovery documentation
1764
+ ticket: OMN-1278
1634
1765
  # Architecture validator exemptions
1635
1766
  # These handle one-model-per-file violations for domain-grouped protocols
1636
1767
  architecture_exemptions:
@@ -183,7 +183,7 @@ def get_message_id(envelope: ModelEventEnvelope[object]) -> UUID:
183
183
  """
184
184
  # envelope_id is typed as UUID in ModelEventEnvelope, but mypy sees it as Any
185
185
  # due to the generic type parameter. Cast is required for type safety.
186
- return cast(UUID, envelope.envelope_id)
186
+ return cast("UUID", envelope.envelope_id)
187
187
 
188
188
 
189
189
  def get_correlation_id(envelope: ModelEventEnvelope[object]) -> UUID | None:
@@ -200,7 +200,7 @@ def get_correlation_id(envelope: ModelEventEnvelope[object]) -> UUID | None:
200
200
  correlation_id = envelope.correlation_id
201
201
  if correlation_id is None:
202
202
  return None
203
- return cast(UUID, correlation_id)
203
+ return cast("UUID", correlation_id)
204
204
 
205
205
 
206
206
  def get_causation_id(envelope: ModelEventEnvelope[object]) -> UUID | None:
@@ -893,7 +893,7 @@ def enforce_execution_shape(node_archetype: EnumNodeArchetype) -> Callable[[F],
893
893
 
894
894
  # Cast wrapper to F - functools.wraps preserves the signature at runtime,
895
895
  # and mypy cannot prove the equivalence, so we use an explicit cast.
896
- return cast(F, wrapper)
896
+ return cast("F", wrapper)
897
897
 
898
898
  return decorator
899
899