Skip to content

feat(naming): rename decorators/, errors/, protocols/ files (OMN-1217, OMN-1218, OMN-1219) - #317

Merged
jonahgabriel merged 6 commits into
mainfrom
jonah/omn-1217-1219-naming-convention-renames
Jan 4, 2026
Merged

jonahgabriel merged 6 commits into
mainfrom
jonah/omn-1217-1219-naming-convention-renames

Conversation

@jonahgabriel

@jonahgabriel jonahgabriel commented Jan 3, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Rename files in decorators/, errors/, and protocols/ directories to follow naming conventions.

OMN-1217: decorators/ (4 files)

  • allow_dict_any.py → decorator_allow_dict_any.py
  • convert_to_schema.py → decorator_convert_to_schema.py
  • error_handling.py → decorator_error_handling.py
  • pattern_exclusions.py → decorator_pattern_exclusions.py

OMN-1218: errors/ (3 files)

  • declarative_errors.py → error_declarative.py
  • exceptions.py → exception_base.py
  • runtime_errors.py → error_runtime.py

OMN-1219: protocols/ (1 file)

  • core.py → protocol_core.py

Changes

  • 8 source files renamed
  • 3 test files renamed to match
  • All imports updated across 41 files (src/, tests/, docs/)

Test Plan

  • All pre-commit hooks pass
  • mypy type checking passes
  • pyright type checking passes
  • Code compiles (poetry run python -c "import omnibase_core")
  • CI tests pass

Related Issues

Closes OMN-1217
Closes OMN-1218
Closes OMN-1219

Summary by CodeRabbit

  • Refactor
    • Reorganized internal module layout and import paths for decorators, errors, protocols, and validation; public APIs and runtime behavior unchanged.
  • Documentation
    • Updated examples, architecture docs, and templates to reflect reorganized module locations.
  • Tests
    • Updated and added tests validating renamed import paths, re-exports, and preserved behavior.
  • Chores
    • Bumped CI cache version and small internal type-annotation simplification.

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

… naming conventions (OMN-1217, OMN-1218, OMN-1219)

Rename files to enforce consistent naming conventions across the codebase:

decorators/ (OMN-1217):
- allow_dict_any.py → decorator_allow_dict_any.py
- convert_to_schema.py → decorator_convert_to_schema.py
- error_handling.py → decorator_error_handling.py
- pattern_exclusions.py → decorator_pattern_exclusions.py

errors/ (OMN-1218):
- declarative_errors.py → error_declarative.py
- exceptions.py → exception_base.py
- runtime_errors.py → error_runtime.py

protocols/ (OMN-1219):
- core.py → protocol_core.py

Updated all imports across src/, tests/, and docs/.
@coderabbitai

coderabbitai Bot commented Jan 3, 2026 •

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

Refactors and renames across decorators, error modules, and protocols: many public symbols re-exported from new modules (e.g., decorator_* and error_*). Import paths updated across src, tests, and docs; public names and signatures preserved.

Changes

Cohort / File(s) Summary
Decorator re-exports & usage
src/omnibase_core/decorators/__init__.py, src/omnibase_core/decorators/..., src/omnibase_core/models/*, src/omnibase_core/runtime/envelope_router.py, src/omnibase_core/mixins/*, src/omnibase_core/models/*
Public decorator exports now import from modules prefixed with decorator_ (e.g., error_handling → decorator_error_handling, allow_dict_any → decorator_allow_dict_any, convert_to_schema → decorator_convert_to_schema). Call sites and tests updated to new import paths; behavior unchanged.
Error module reorganization
src/omnibase_core/errors/__init__.py, src/omnibase_core/errors/error_declarative.py, src/omnibase_core/errors/error_runtime.py, src/omnibase_core/errors/exception_*.py, src/omnibase_core/validation/__init__.py, src/omnibase_core/services/service_protocol_auditor.py
Declarative/runtime/exception modules renamed and re-routed (e.g., declarative_errors → error_declarative, runtime_errors → error_runtime, exceptions → exception_base). Lazy-loading/import resolution adjusted; public classes and signatures preserved.
Protocol export moves & docs
src/omnibase_core/protocols/__init__.py, src/omnibase_core/protocols/protocol_core.py, src/omnibase_core/protocols/protocol_contract_profile_factory.py
Core protocol export relocated (e.g., ProtocolCanonicalSerializer now from protocol_core); factory docstrings expanded. No API signature changes.
mypy plugin & tooling
src/omnibase_core/tools/mypy_plugins/dict_any_checker.py
Decorator-detection strings and ALLOW_DECORATOR updated to reference decorator_allow_dict_any; plugin now recognizes new import patterns.
Tests / snapshots
tests/unit/decorators/*, tests/unit/errors/*, tests/unit/validation/*, tests/unit/api_snapshots/test_renamed_imports_pr317.py
Tests updated to import renamed modules; new snapshot tests validate re-exports, all, and behavior of renamed decorators/errors/protocols.
Documentation & templates
docs/**, CLAUDE.md, docs/reference/templates/*, docs/architecture/*, docs/release/*, docs/MVP_PLAN.md
Examples, templates, ADRs and release docs updated to reflect new module paths for decorators, errors, and protocols.
CI workflow
.github/workflows/test.yml
Bumped CACHE_VERSION from "0.1.4" → "0.1.5" (cache key change only).
Minor typing tweak
src/omnibase_core/backends/cache/backend_cache_redis.py
Relaxed internal type annotation: `_client: Redis[str]

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

Possibly related PRs

Poem

🐰✨ I hopped through modules, nudged names to new nests,

Paths rerouted gently, the code kept its quests.
Decorators and errors moved rooms with a cheer,
Tests sniffed the changes, docs whispered, "All clear."
A tidy burrow — imports snug for the year.

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: renaming files in decorators/, errors/, and protocols/ directories to follow naming conventions, with clear references to the related issue numbers.
Docstring Coverage ✅ Passed Docstring coverage is 97.81% which is sufficient. The required threshold is 80.00%.
✨ Finishing touches
  • 📝 Generate docstrings

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

@claude

claude Bot commented Jan 3, 2026

Copy link
Copy Markdown

Code Review - PR #317

Summary

This PR implements a comprehensive file naming convention standardization across decorators/, errors/, and protocols/ directories. The changes are well-structured and align with ONEX naming standards.


✅ Strengths

1. Excellent Naming Convention Adherence

The renaming follows clear, consistent patterns:

  • decorators/: decorator_*.py prefix (e.g., error_handling.py → decorator_error_handling.py)
  • errors/: error_*.py or exception_*.py prefix (e.g., declarative_errors.py → error_declarative.py)
  • protocols/: protocol_*.py prefix (e.g., core.py → protocol_core.py)

This makes the codebase more navigable and enforces clear module categorization.

2. Comprehensive Import Updates

All 41 import sites have been updated:

  • Source files: ✅
  • Test files: ✅
  • Documentation: ✅ (CLAUDE.md, ADRs, templates, release checklists)

The thorough nature of this refactor reduces the risk of runtime import errors.

3. Lazy Loading Preserved

The errors/__init__.py lazy loading mechanism (__getattr__) was correctly updated to reference new module names while maintaining the deferred import pattern to avoid circular dependencies. This is critical for the framework's architecture.

4. Alphabetical Import Organization

The protocols/__init__.py properly maintains alphabetical ordering of imports, which is good practice for large module files (459 lines).


🔍 Areas for Improvement

1. Test Coverage Gap - Import Validation ⚠️

Issue: While the renamed files are imported, there's no explicit test validating that the old import paths fail and new paths succeed.

Recommendation: Add a test like:
```python

tests/unit/test_file_renames_omn1217_1219.py

def test_decorator_imports_use_new_names():
"""Verify all decorator imports use new naming convention."""
from omnibase_core.decorators import (
decorator_allow_dict_any,
decorator_convert_to_schema,
decorator_error_handling,
decorator_pattern_exclusions
)
assert hasattr(decorator_error_handling, 'standard_error_handling')

def test_error_imports_use_new_names():
"""Verify error module imports use new naming convention."""
from omnibase_core.errors import error_declarative, error_runtime
assert hasattr(error_declarative, 'AdapterBindingError')
assert hasattr(error_runtime, 'RuntimeHostError')
```

2. Documentation Update - Missing File Location Reference

Issue: protocols/__init__.py docstring references the old filename:

```python

Line 26 - Still says "core.py" instead of "protocol_core.py"

  • protocol_core.py: Core operation protocols (CanonicalSerializer)
    ```

Status: ✅ Actually FIXED in the PR! The diff shows this was updated correctly. Good attention to detail.

3. Potential grep/search Impacts

Consideration: Developers may have muscle memory or scripts searching for:

  • from omnibase_core.decorators.error_handling import
  • from omnibase_core.errors.declarative_errors import

Recommendation: Consider adding a CHANGELOG.md entry or migration note documenting these import path changes for external consumers (though this may be internal-only at v0.4.0-dev).

4. Mypy Plugin Reference ✅

The dict_any_checker.py mypy plugin was correctly updated:
```python
from omnibase_core.decorators.decorator_allow_dict_any import allow_dict_any
```

Validation Needed: Ensure mypy still correctly loads this plugin after the rename. The pyproject.toml or mypy.ini should be checked for any hardcoded module paths (though based on the diff, this appears to be dynamically imported, so should be fine).


🔒 Security & Performance

  • Security: ✅ No security concerns. This is purely a refactoring.
  • Performance: ✅ No performance impact. Lazy loading in errors/__init__.py is preserved, maintaining deferred import benefits.
  • Thread Safety: ✅ No changes to runtime behavior; file renames don't affect thread safety.

📋 Test Plan Validation

Per the PR description:

  • ✅ Pre-commit hooks pass
  • ✅ mypy passes
  • ✅ pyright passes
  • ✅ Code compiles
  • ⏳ CI tests pending

Critical: Before merging, verify that all 20 CI test splits pass. Given the comprehensive nature of the import changes, any missed import will surface in CI.


🎯 Recommendations

Before Merge:

  1. ✅ Wait for CI to go green - With 12,000+ tests, this is the definitive validation
  2. ⚠️ Consider adding explicit import tests (see suggestion above)
  3. ✅ Verify mypy plugin still works - Run: poetry run mypy src/omnibase_core/ locally to confirm

After Merge:

  1. 📝 Update any external documentation that references old import paths
  2. 🔍 Monitor for import errors in dependent projects (omnibase_spi, etc.)

📊 Code Quality Assessment

Category Rating Notes
Correctness ⭐⭐⭐⭐⭐ All imports updated comprehensively
Consistency ⭐⭐⭐⭐⭐ Clear, uniform naming convention
Documentation ⭐⭐⭐⭐☆ Updated, but could add migration note
Testing ⭐⭐⭐⭐☆ Good coverage, could add import validation tests
Maintainability ⭐⭐⭐⭐⭐ Significantly improved discoverability

✅ Final Verdict

Recommendation: APPROVE pending CI success.

This is a high-quality refactoring PR that improves codebase consistency and maintainability. The comprehensive nature of the import updates across 41 files demonstrates thorough execution. The only minor suggestions are:

  1. Adding explicit import validation tests
  2. Considering a migration note for any external consumers

The naming convention enforced here will make the codebase significantly easier to navigate for new developers and aligns with ONEX standards.

Great work on this systematic cleanup! 🎉


Reviewed by: Claude Code (Sonnet 4.5)
Review Date: 2026-01-03
Files Changed: 41 files (+178/-158 lines)
Scope: OMN-1217, OMN-1218, OMN-1219

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Caution

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

⚠️ Outside diff range comments (2)
src/omnibase_core/tools/mypy_plugins/dict_any_checker.py (1)

94-94: Update decorator path constants to match renamed module.

The module was renamed from allow_dict_any.py to decorator_allow_dict_any.py, but the string constants used for AST pattern matching still reference the old path. This will cause the mypy plugin to fail to recognize the decorator when it's imported from the new module.

Update:

  • Line 94: "omnibase_core.decorators.allow_dict_any.allow_dict_any" → "omnibase_core.decorators.decorator_allow_dict_any.allow_dict_any"
  • Line 605: "omnibase_core.decorators.allow_dict_any" → "omnibase_core.decorators.decorator_allow_dict_any"
🔎 Proposed fix
     # Decorator that allows dict[str, Any] usage
-    ALLOW_DECORATOR = "omnibase_core.decorators.allow_dict_any.allow_dict_any"
+    ALLOW_DECORATOR = "omnibase_core.decorators.decorator_allow_dict_any.allow_dict_any"
     ALLOW_DECORATOR_SHORT = "allow_dict_any"
         if decorator_name in (
             self.ALLOW_DECORATOR,
             self.ALLOW_DECORATOR_SHORT,
             # Common import patterns
             "allow_dict_any.allow_dict_any",
             "decorators.allow_dict_any.allow_dict_any",
-            "omnibase_core.decorators.allow_dict_any",
+            "omnibase_core.decorators.decorator_allow_dict_any",
         ):
             return True

Also applies to: 605-605

tests/unit/errors/test_error_declarative.py (1)

885-899: Update import to use the correctly renamed module.

The test imports declarative_errors which doesn't exist. The module was renamed to error_declarative and is not aliased for backwards compatibility in errors/__init__.py. Update the import and references:

from omnibase_core.errors import error_declarative

Then change declarative_errors.__all__ to error_declarative.__all__ in the assertion.

🧹 Nitpick comments (1)
src/omnibase_core/protocols/__init__.py (1)

175-181: Remove duplicate section header.

Lines 175-177 contain a "Compute Module Exports" header that appears to be leftover from a copy-paste. The actual section is "Core Module Exports" (lines 179-180). This creates unnecessary confusion.

🔎 Proposed cleanup
-# =============================================================================
-# Compute Module Exports
-# =============================================================================
 # =============================================================================
 # Core Module Exports
 # =============================================================================
 from omnibase_core.protocols.protocol_core import ProtocolCanonicalSerializer
📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 244f09f and 0e76204.

📒 Files selected for processing (41)
  • CLAUDE.md
  • docs/architecture/EXECUTION_SHAPE_EXAMPLES.md
  • docs/architecture/adr/ADR-012-VALIDATOR-ERROR-HANDLING.md
  • docs/architecture/decisions/ADR-003-reducer-output-exception-consistency.md
  • docs/reference/api/utils.md
  • docs/reference/templates/EFFECT_NODE_TEMPLATE.md
  • docs/reference/templates/ORCHESTRATOR_NODE_TEMPLATE.md
  • docs/release/V040_RELEASE_CHECKLIST.md
  • src/omnibase_core/decorators/__init__.py
  • src/omnibase_core/decorators/decorator_allow_dict_any.py
  • src/omnibase_core/decorators/decorator_convert_to_schema.py
  • src/omnibase_core/decorators/decorator_error_handling.py
  • src/omnibase_core/decorators/decorator_pattern_exclusions.py
  • src/omnibase_core/errors/__init__.py
  • src/omnibase_core/errors/error_declarative.py
  • src/omnibase_core/errors/error_runtime.py
  • src/omnibase_core/errors/exception_adapter_binding_error.py
  • src/omnibase_core/errors/exception_base.py
  • src/omnibase_core/errors/exception_node_execution_error.py
  • src/omnibase_core/errors/exception_purity_violation_error.py
  • src/omnibase_core/errors/exception_unsupported_capability_error.py
  • src/omnibase_core/models/capabilities/model_capability_requirement_set.py
  • src/omnibase_core/models/container/model_onex_container.py
  • src/omnibase_core/models/context/model_effect_template_context.py
  • src/omnibase_core/models/effect/model_effect_input.py
  • src/omnibase_core/models/intents/model_registration_record_base.py
  • src/omnibase_core/models/operations/model_effect_operation_config.py
  • src/omnibase_core/models/operations/model_operationparameters.py
  • src/omnibase_core/models/services/model_node_service_config.py
  • src/omnibase_core/protocols/__init__.py
  • src/omnibase_core/protocols/protocol_core.py
  • src/omnibase_core/runtime/envelope_router.py
  • src/omnibase_core/services/service_protocol_auditor.py
  • src/omnibase_core/tools/mypy_plugins/dict_any_checker.py
  • src/omnibase_core/validation/__init__.py
  • tests/unit/decorators/test_convert_to_schema.py
  • tests/unit/decorators/test_error_handling_extended.py
  • tests/unit/decorators/test_pattern_exclusions.py
  • tests/unit/errors/test_error_declarative.py
  • tests/unit/errors/test_error_runtime.py
  • tests/unit/validation/test_exception_base.py
🧰 Additional context used
📓 Path-based instructions (4)
**/*.py

📄 CodeRabbit inference engine (CLAUDE.md)

**/*.py: Use PEP 604 union syntax for type annotations (e.g., str | None instead of Optional[str])
Resolve services using protocol names (e.g., container.get_service('ProtocolEventBus')) never using concrete class names
Order exception tuples alphabetically by exception class name (e.g., except (AttributeError, TypeError, ValidationError) not except (ValueError, TypeError, AttributeError))
Format code using poetry run black and sort imports using poetry run isort
Lint code with poetry run ruff check and fix automatically with poetry run ruff check --fix

Files:

  • src/omnibase_core/services/service_protocol_auditor.py
  • src/omnibase_core/errors/exception_unsupported_capability_error.py
  • tests/unit/decorators/test_error_handling_extended.py
  • src/omnibase_core/models/intents/model_registration_record_base.py
  • src/omnibase_core/errors/error_runtime.py
  • src/omnibase_core/models/context/model_effect_template_context.py
  • src/omnibase_core/models/operations/model_effect_operation_config.py
  • src/omnibase_core/models/services/model_node_service_config.py
  • src/omnibase_core/errors/exception_node_execution_error.py
  • src/omnibase_core/models/effect/model_effect_input.py
  • tests/unit/errors/test_error_declarative.py
  • src/omnibase_core/runtime/envelope_router.py
  • src/omnibase_core/models/container/model_onex_container.py
  • tests/unit/decorators/test_pattern_exclusions.py
  • src/omnibase_core/validation/__init__.py
  • src/omnibase_core/errors/error_declarative.py
  • src/omnibase_core/errors/exception_adapter_binding_error.py
  • tests/unit/errors/test_error_runtime.py
  • src/omnibase_core/protocols/__init__.py
  • src/omnibase_core/tools/mypy_plugins/dict_any_checker.py
  • src/omnibase_core/errors/exception_purity_violation_error.py
  • src/omnibase_core/models/capabilities/model_capability_requirement_set.py
  • src/omnibase_core/models/operations/model_operationparameters.py
  • tests/unit/decorators/test_convert_to_schema.py
  • src/omnibase_core/decorators/__init__.py
  • src/omnibase_core/errors/__init__.py
  • tests/unit/validation/test_exception_base.py
src/omnibase_core/**/*.py

📄 CodeRabbit inference engine (CLAUDE.md)

src/omnibase_core/**/*.py: Use ModelOnexError with error codes from EnumCoreErrorCode for exception handling, never generic Exception
Use @standard_error_handling decorator from omnibase_core.decorators to eliminate try/catch boilerplate
Add standardized exception handling comment markers (# fallback-ok:, # catch-all-ok:, # cleanup-resilience-ok:, # boundary-ok:, # init-errors-ok:, # tool-resilience-ok:) when using broad exception handlers
Use centralized exception group constants from omnibase_core.errors.exception_groups instead of individual exception types
Ensure all source code passes mypy strict mode with zero errors and pyright basic mode validation
Use FileRegistry for loading YAML contracts and configuration files instead of direct file reading
Use duck typing with protocols for service resolution - never use isinstance checks for protocol-based dependencies

Files:

  • src/omnibase_core/services/service_protocol_auditor.py
  • src/omnibase_core/errors/exception_unsupported_capability_error.py
  • src/omnibase_core/models/intents/model_registration_record_base.py
  • src/omnibase_core/errors/error_runtime.py
  • src/omnibase_core/models/context/model_effect_template_context.py
  • src/omnibase_core/models/operations/model_effect_operation_config.py
  • src/omnibase_core/models/services/model_node_service_config.py
  • src/omnibase_core/errors/exception_node_execution_error.py
  • src/omnibase_core/models/effect/model_effect_input.py
  • src/omnibase_core/runtime/envelope_router.py
  • src/omnibase_core/models/container/model_onex_container.py
  • src/omnibase_core/validation/__init__.py
  • src/omnibase_core/errors/error_declarative.py
  • src/omnibase_core/errors/exception_adapter_binding_error.py
  • src/omnibase_core/protocols/__init__.py
  • src/omnibase_core/tools/mypy_plugins/dict_any_checker.py
  • src/omnibase_core/errors/exception_purity_violation_error.py
  • src/omnibase_core/models/capabilities/model_capability_requirement_set.py
  • src/omnibase_core/models/operations/model_operationparameters.py
  • src/omnibase_core/decorators/__init__.py
  • src/omnibase_core/errors/__init__.py
tests/**/*.py

📄 CodeRabbit inference engine (CLAUDE.md)

tests/**/*.py: Use pytest markers (@pytest.mark.unit, @pytest.mark.integration, @pytest.mark.slow, @pytest.mark.smoke, @pytest.mark.performance) to classify test types
All tests must complete within 60-second timeout protection to ensure CI performance

Files:

  • tests/unit/decorators/test_error_handling_extended.py
  • tests/unit/errors/test_error_declarative.py
  • tests/unit/decorators/test_pattern_exclusions.py
  • tests/unit/errors/test_error_runtime.py
  • tests/unit/decorators/test_convert_to_schema.py
  • tests/unit/validation/test_exception_base.py
src/omnibase_core/models/**/*.py

📄 CodeRabbit inference engine (CLAUDE.md)

src/omnibase_core/models/**/*.py: Add from_attributes=True to ConfigDict for immutable value objects nested in other Pydantic models to support pytest-xdist parallel execution
Do NOT use from __future__ import annotations in Pydantic model files (use only for forward references and circular import prevention)

Files:

  • src/omnibase_core/models/intents/model_registration_record_base.py
  • src/omnibase_core/models/context/model_effect_template_context.py
  • src/omnibase_core/models/operations/model_effect_operation_config.py
  • src/omnibase_core/models/services/model_node_service_config.py
  • src/omnibase_core/models/effect/model_effect_input.py
  • src/omnibase_core/models/container/model_onex_container.py
  • src/omnibase_core/models/capabilities/model_capability_requirement_set.py
  • src/omnibase_core/models/operations/model_operationparameters.py
🧠 Learnings (14)
📓 Common learnings
Learnt from: CR
Repo: OmniNode-ai/omnibase_core PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-01-02T20:42:17.780Z
Learning: Applies to src/omnibase_core/**/*.py : Use standard_error_handling decorator from omnibase_core.decorators to eliminate try/catch boilerplate
Learnt from: CR
Repo: OmniNode-ai/omnibase_core PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-01-02T20:42:17.780Z
Learning: Applies to src/omnibase_core/**/*.py : Use centralized exception group constants from omnibase_core.errors.exception_groups instead of individual exception types
📚 Learning: 2026-01-02T20:42:17.780Z
Learnt from: CR
Repo: OmniNode-ai/omnibase_core PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-01-02T20:42:17.780Z
Learning: Applies to src/omnibase_core/**/*.py : Use standard_error_handling decorator from omnibase_core.decorators to eliminate try/catch boilerplate

Applied to files:

  • docs/reference/templates/EFFECT_NODE_TEMPLATE.md
  • docs/architecture/EXECUTION_SHAPE_EXAMPLES.md
  • tests/unit/decorators/test_error_handling_extended.py
  • src/omnibase_core/errors/error_runtime.py
  • docs/architecture/adr/ADR-012-VALIDATOR-ERROR-HANDLING.md
  • CLAUDE.md
  • src/omnibase_core/models/services/model_node_service_config.py
  • docs/architecture/decisions/ADR-003-reducer-output-exception-consistency.md
  • tests/unit/errors/test_error_declarative.py
  • src/omnibase_core/runtime/envelope_router.py
  • src/omnibase_core/errors/error_declarative.py
  • docs/reference/templates/ORCHESTRATOR_NODE_TEMPLATE.md
  • docs/reference/api/utils.md
  • src/omnibase_core/models/operations/model_operationparameters.py
  • src/omnibase_core/decorators/__init__.py
📚 Learning: 2026-01-02T20:42:17.780Z
Learnt from: CR
Repo: OmniNode-ai/omnibase_core PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-01-02T20:42:17.780Z
Learning: Applies to src/omnibase_core/**/*.py : Use ModelOnexError with error codes from EnumCoreErrorCode for exception handling, never generic Exception

Applied to files:

  • docs/reference/templates/EFFECT_NODE_TEMPLATE.md
  • docs/architecture/EXECUTION_SHAPE_EXAMPLES.md
  • src/omnibase_core/services/service_protocol_auditor.py
  • src/omnibase_core/errors/exception_unsupported_capability_error.py
  • src/omnibase_core/errors/error_runtime.py
  • docs/architecture/adr/ADR-012-VALIDATOR-ERROR-HANDLING.md
  • src/omnibase_core/models/services/model_node_service_config.py
  • src/omnibase_core/errors/exception_node_execution_error.py
  • src/omnibase_core/models/effect/model_effect_input.py
  • tests/unit/errors/test_error_declarative.py
  • src/omnibase_core/runtime/envelope_router.py
  • src/omnibase_core/validation/__init__.py
  • src/omnibase_core/errors/error_declarative.py
  • src/omnibase_core/errors/exception_adapter_binding_error.py
  • docs/reference/templates/ORCHESTRATOR_NODE_TEMPLATE.md
  • docs/reference/api/utils.md
  • src/omnibase_core/errors/exception_purity_violation_error.py
  • src/omnibase_core/models/operations/model_operationparameters.py
  • src/omnibase_core/errors/__init__.py
  • tests/unit/validation/test_exception_base.py
📚 Learning: 2026-01-02T20:42:17.780Z
Learnt from: CR
Repo: OmniNode-ai/omnibase_core PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-01-02T20:42:17.780Z
Learning: Applies to src/omnibase_core/nodes/**/*.py : Use ModelONEXContainer (not ModelContainer) for dependency injection in node constructors

Applied to files:

  • docs/architecture/EXECUTION_SHAPE_EXAMPLES.md
  • docs/architecture/adr/ADR-012-VALIDATOR-ERROR-HANDLING.md
  • src/omnibase_core/models/services/model_node_service_config.py
  • src/omnibase_core/errors/exception_node_execution_error.py
  • tests/unit/errors/test_error_declarative.py
  • src/omnibase_core/models/container/model_onex_container.py
  • docs/reference/templates/ORCHESTRATOR_NODE_TEMPLATE.md
📚 Learning: 2026-01-02T20:42:17.780Z
Learnt from: CR
Repo: OmniNode-ai/omnibase_core PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-01-02T20:42:17.780Z
Learning: Applies to src/omnibase_core/nodes/**/*.py : Inherit from appropriate ONEX node base classes (NodeCompute, NodeReducer, NodeOrchestrator, NodeEffect) and call super().__init__(container)

Applied to files:

  • docs/architecture/EXECUTION_SHAPE_EXAMPLES.md
  • src/omnibase_core/errors/exception_node_execution_error.py
  • tests/unit/errors/test_error_declarative.py
  • docs/reference/templates/ORCHESTRATOR_NODE_TEMPLATE.md
📚 Learning: 2026-01-02T20:42:17.780Z
Learnt from: CR
Repo: OmniNode-ai/omnibase_core PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-01-02T20:42:17.780Z
Learning: Applies to src/omnibase_core/**/*.py : Use centralized exception group constants from omnibase_core.errors.exception_groups instead of individual exception types

Applied to files:

  • src/omnibase_core/services/service_protocol_auditor.py
  • src/omnibase_core/errors/exception_unsupported_capability_error.py
  • tests/unit/decorators/test_error_handling_extended.py
  • src/omnibase_core/errors/error_runtime.py
  • src/omnibase_core/errors/exception_node_execution_error.py
  • tests/unit/errors/test_error_declarative.py
  • src/omnibase_core/validation/__init__.py
  • src/omnibase_core/errors/error_declarative.py
  • src/omnibase_core/errors/exception_adapter_binding_error.py
  • tests/unit/errors/test_error_runtime.py
  • docs/reference/templates/ORCHESTRATOR_NODE_TEMPLATE.md
  • docs/reference/api/utils.md
  • src/omnibase_core/errors/exception_purity_violation_error.py
  • src/omnibase_core/models/operations/model_operationparameters.py
  • src/omnibase_core/errors/__init__.py
  • tests/unit/validation/test_exception_base.py
📚 Learning: 2026-01-02T20:42:17.780Z
Learnt from: CR
Repo: OmniNode-ai/omnibase_core PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-01-02T20:42:17.780Z
Learning: Applies to src/omnibase_core/models/**/*.py : Add `from_attributes=True` to ConfigDict for immutable value objects nested in other Pydantic models to support pytest-xdist parallel execution

Applied to files:

  • src/omnibase_core/models/intents/model_registration_record_base.py
  • src/omnibase_core/models/context/model_effect_template_context.py
  • src/omnibase_core/models/services/model_node_service_config.py
  • src/omnibase_core/models/capabilities/model_capability_requirement_set.py
📚 Learning: 2026-01-02T20:42:17.780Z
Learnt from: CR
Repo: OmniNode-ai/omnibase_core PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-01-02T20:42:17.780Z
Learning: Applies to src/omnibase_core/**/*.py : Add standardized exception handling comment markers (`# fallback-ok:`, `# catch-all-ok:`, `# cleanup-resilience-ok:`, `# boundary-ok:`, `# init-errors-ok:`, `# tool-resilience-ok:`) when using broad exception handlers

Applied to files:

  • CLAUDE.md
  • src/omnibase_core/validation/__init__.py
  • docs/reference/templates/ORCHESTRATOR_NODE_TEMPLATE.md
  • docs/reference/api/utils.md
  • src/omnibase_core/decorators/__init__.py
  • tests/unit/validation/test_exception_base.py
📚 Learning: 2026-01-02T20:42:17.780Z
Learnt from: CR
Repo: OmniNode-ai/omnibase_core PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-01-02T20:42:17.780Z
Learning: Applies to src/omnibase_core/nodes/**/*.py : Use EnumNodeKind for architectural routing (EFFECT, COMPUTE, REDUCER, ORCHESTRATOR, RUNTIME_HOST) and EnumNodeType for implementation matching (COMPUTE_GENERIC, TRANSFORMER, AGGREGATOR, etc.)

Applied to files:

  • src/omnibase_core/errors/exception_node_execution_error.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_core/models/container/model_onex_container.py
📚 Learning: 2026-01-02T20:42:17.780Z
Learnt from: CR
Repo: OmniNode-ai/omnibase_core PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-01-02T20:42:17.780Z
Learning: Applies to src/omnibase_core/**/*.py : Use FileRegistry for loading YAML contracts and configuration files instead of direct file reading

Applied to files:

  • docs/reference/api/utils.md
📚 Learning: 2026-01-02T20:42:17.780Z
Learnt from: CR
Repo: OmniNode-ai/omnibase_core PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-01-02T20:42:17.780Z
Learning: Applies to src/omnibase_core/nodes/**/*.py : Use declarative YAML contracts for node configuration and workflow definitions (not imperative code)

Applied to files:

  • docs/reference/api/utils.md
📚 Learning: 2026-01-02T20:42:17.780Z
Learnt from: CR
Repo: OmniNode-ai/omnibase_core PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-01-02T20:42:17.780Z
Learning: Applies to src/omnibase_core/**/*.py : Use duck typing with protocols for service resolution - never use isinstance checks for protocol-based dependencies

Applied to files:

  • src/omnibase_core/protocols/__init__.py
📚 Learning: 2026-01-02T20:42:17.780Z
Learnt from: CR
Repo: OmniNode-ai/omnibase_core PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-01-02T20:42:17.780Z
Learning: Applies to **/*.py : Resolve services using protocol names (e.g., `container.get_service('ProtocolEventBus')`) never using concrete class names

Applied to files:

  • src/omnibase_core/protocols/__init__.py
🧬 Code graph analysis (19)
src/omnibase_core/errors/exception_unsupported_capability_error.py (1)
src/omnibase_core/errors/error_runtime_host.py (1)
  • RuntimeHostError (38-102)
src/omnibase_core/models/intents/model_registration_record_base.py (2)
src/omnibase_core/decorators/decorator_allow_dict_any.py (1)
  • allow_dict_any (24-70)
src/omnibase_core/decorators/decorator_pattern_exclusions.py (1)
  • allow_dict_any (81-99)
src/omnibase_core/models/context/model_effect_template_context.py (3)
src/omnibase_core/decorators/decorator_allow_dict_any.py (1)
  • allow_dict_any (24-70)
src/omnibase_core/decorators/decorator_pattern_exclusions.py (1)
  • allow_dict_any (81-99)
src/omnibase_core/mixins/mixin_effect_execution.py (1)
  • allow_dict_any (123-146)
src/omnibase_core/models/operations/model_effect_operation_config.py (3)
src/omnibase_core/decorators/decorator_allow_dict_any.py (1)
  • allow_dict_any (24-70)
src/omnibase_core/decorators/decorator_pattern_exclusions.py (1)
  • allow_dict_any (81-99)
src/omnibase_core/mixins/mixin_effect_execution.py (1)
  • allow_dict_any (123-146)
src/omnibase_core/models/services/model_node_service_config.py (1)
src/omnibase_core/decorators/decorator_error_handling.py (1)
  • standard_error_handling (26-93)
src/omnibase_core/errors/exception_node_execution_error.py (1)
src/omnibase_core/errors/error_runtime_host.py (1)
  • RuntimeHostError (38-102)
src/omnibase_core/models/effect/model_effect_input.py (3)
src/omnibase_core/decorators/decorator_allow_dict_any.py (1)
  • allow_dict_any (24-70)
src/omnibase_core/decorators/decorator_pattern_exclusions.py (1)
  • allow_dict_any (81-99)
src/omnibase_core/mixins/mixin_effect_execution.py (1)
  • allow_dict_any (123-146)
tests/unit/errors/test_error_declarative.py (5)
src/omnibase_core/errors/exception_adapter_binding_error.py (1)
  • AdapterBindingError (34-99)
src/omnibase_core/enums/enum_core_error_code.py (1)
  • EnumCoreErrorCode (9-241)
src/omnibase_core/errors/error_runtime_host.py (1)
  • RuntimeHostError (38-102)
src/omnibase_core/errors/exception_purity_violation_error.py (1)
  • PurityViolationError (34-100)
src/omnibase_core/errors/exception_node_execution_error.py (1)
  • NodeExecutionError (34-99)
src/omnibase_core/runtime/envelope_router.py (1)
src/omnibase_core/decorators/decorator_error_handling.py (1)
  • standard_error_handling (26-93)
src/omnibase_core/models/container/model_onex_container.py (3)
src/omnibase_core/decorators/decorator_allow_dict_any.py (1)
  • allow_dict_any (24-70)
src/omnibase_core/decorators/decorator_pattern_exclusions.py (1)
  • allow_dict_any (81-99)
src/omnibase_core/mixins/mixin_effect_execution.py (1)
  • allow_dict_any (123-146)
src/omnibase_core/errors/exception_adapter_binding_error.py (1)
src/omnibase_core/errors/error_runtime_host.py (1)
  • RuntimeHostError (38-102)
tests/unit/errors/test_error_runtime.py (5)
src/omnibase_core/errors/error_runtime_host.py (1)
  • RuntimeHostError (38-102)
src/omnibase_core/errors/error_handler_execution.py (1)
  • HandlerExecutionError (16-79)
src/omnibase_core/errors/error_event_bus.py (1)
  • EventBusError (16-68)
src/omnibase_core/errors/error_invalid_operation.py (1)
  • InvalidOperationError (16-68)
src/omnibase_core/errors/error_contract_validation.py (1)
  • ContractValidationError (16-68)
src/omnibase_core/protocols/__init__.py (1)
src/omnibase_core/protocols/protocol_core.py (1)
  • ProtocolCanonicalSerializer (27-105)
src/omnibase_core/tools/mypy_plugins/dict_any_checker.py (1)
src/omnibase_core/decorators/decorator_allow_dict_any.py (1)
  • allow_dict_any (24-70)
src/omnibase_core/errors/exception_purity_violation_error.py (1)
src/omnibase_core/errors/error_runtime_host.py (1)
  • RuntimeHostError (38-102)
src/omnibase_core/models/operations/model_operationparameters.py (1)
src/omnibase_core/decorators/decorator_error_handling.py (1)
  • standard_error_handling (26-93)
tests/unit/decorators/test_convert_to_schema.py (1)
src/omnibase_core/decorators/decorator_convert_to_schema.py (2)
  • _parse_version_component (172-224)
  • _escape_field_name_for_validator (278-303)
src/omnibase_core/decorators/__init__.py (2)
src/omnibase_core/decorators/decorator_allow_dict_any.py (1)
  • allow_dict_any (24-70)
src/omnibase_core/decorators/decorator_pattern_exclusions.py (1)
  • allow_dict_any (81-99)
src/omnibase_core/errors/__init__.py (4)
src/omnibase_core/errors/error_callable_not_found.py (1)
  • CallableNotFoundError (10-18)
src/omnibase_core/errors/error_runtime_host.py (1)
  • RuntimeHostError (38-102)
src/omnibase_core/errors/error_unknown_dependency.py (1)
  • UnknownDependencyError (10-22)
src/omnibase_core/errors/exception_compute_pipeline_error.py (1)
  • ComputePipelineError (56-129)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: Code Quality
  • GitHub Check: claude-review
🔇 Additional comments (40)
src/omnibase_core/errors/error_runtime.py (1)

28-28: LGTM! Usage documentation updated correctly.

The import path in the usage example now correctly references error_runtime instead of the old runtime_errors module name.

src/omnibase_core/errors/exception_unsupported_capability_error.py (1)

31-31: LGTM! Import path updated correctly.

The RuntimeHostError import now references the renamed module error_runtime.

src/omnibase_core/errors/exception_adapter_binding_error.py (1)

31-31: LGTM! Import path updated correctly.

The RuntimeHostError import now references the renamed module error_runtime.

src/omnibase_core/errors/exception_node_execution_error.py (1)

31-31: LGTM! Import path updated correctly.

The RuntimeHostError import now references the renamed module error_runtime.

src/omnibase_core/protocols/__init__.py (2)

26-26: LGTM! Comment updated correctly.

The module organization comment now correctly references protocol_core.py instead of the generic term.


181-181: LGTM! Import path updated correctly.

The ProtocolCanonicalSerializer import now references the renamed module protocol_core.

src/omnibase_core/models/effect/model_effect_input.py (1)

73-73: LGTM! Clean import path update.

The import path correctly reflects the file rename from allow_dict_any.py → decorator_allow_dict_any.py. The decorator signature and behavior remain unchanged.

src/omnibase_core/models/container/model_onex_container.py (1)

37-37: LGTM! Import path updated correctly.

The import aligns with the decorator file rename. Usage at line 177 remains consistent with the decorator's signature.

src/omnibase_core/models/services/model_node_service_config.py (1)

17-17: LGTM! Import path reflects file rename.

The updated import path correctly points to decorator_error_handling.py. The standard_error_handling decorator signature and behavior are preserved, as confirmed by usage at line 189.

src/omnibase_core/services/service_protocol_auditor.py (1)

15-18: LGTM! Exception imports updated correctly.

The import path now references exception_base.py (renamed from exceptions.py). The exception classes ExceptionConfigurationError and ExceptionInputValidationError maintain their interfaces and are used correctly at lines 84, 86, 177, and 179.

src/omnibase_core/models/operations/model_operationparameters.py (1)

3-3: LGTM! Import path updated for decorator file rename.

The import correctly references decorator_error_handling.py. The decorator usage at line 39 remains consistent with the unchanged decorator signature.

src/omnibase_core/models/capabilities/model_capability_requirement_set.py (1)

55-55: LGTM: Import path updated correctly.

The import path change from omnibase_core.decorators.allow_dict_any to omnibase_core.decorators.decorator_allow_dict_any follows the systematic naming convention refactor. The decorator functionality and usage remain unchanged.

tests/unit/validation/test_exception_base.py (1)

9-18: LGTM: Import path updated correctly.

The import path change from omnibase_core.errors.exceptions to omnibase_core.errors.exception_base follows the systematic naming convention refactor for error modules. All imported exception classes remain functionally unchanged.

src/omnibase_core/models/operations/model_effect_operation_config.py (1)

38-38: LGTM: Import path updated correctly.

The import path change from omnibase_core.decorators.allow_dict_any to omnibase_core.decorators.decorator_allow_dict_any is consistent with the systematic decorator module renaming. Decorator usage throughout the file (lines 225, 236) remains unchanged and functional.

src/omnibase_core/models/intents/model_registration_record_base.py (1)

64-64: LGTM: Import path updated correctly.

The import path change from omnibase_core.decorators.allow_dict_any to omnibase_core.decorators.decorator_allow_dict_any aligns with the systematic decorator module renaming. The decorator usage at line 113 remains unchanged and functional.

CLAUDE.md (1)

392-392: LGTM: Documentation import path updated correctly.

The import path change from omnibase_core.decorators.error_handling to omnibase_core.decorators.decorator_error_handling keeps the documentation example synchronized with the systematic decorator module renaming. This ensures developers see the correct import path in the project documentation.

docs/reference/templates/ORCHESTRATOR_NODE_TEMPLATE.md (1)

90-90: LGTM! Import paths correctly updated in template.

The template now references the renamed decorator module decorator_error_handling, ensuring users copying this template will use the correct import paths. Both occurrences are consistently updated.

Also applies to: 1609-1609

src/omnibase_core/models/context/model_effect_template_context.py (1)

48-48: LGTM! Import path updated correctly.

The import path has been updated to reflect the renamed decorator module. The decorator usage throughout the file (lines 53, 158, 175) remains unchanged, and static analysis confirms the import resolution is correct.

tests/unit/decorators/test_pattern_exclusions.py (1)

19-28: LGTM! Test imports updated correctly.

The import statement has been updated to reference the renamed module decorator_pattern_exclusions. All imported symbols remain the same, and the test logic is unchanged. This ensures tests continue to validate the decorator functionality under the new module structure.

src/omnibase_core/errors/exception_purity_violation_error.py (1)

31-31: LGTM! Error module import updated correctly.

The import path has been updated from runtime_errors to error_runtime, following the new naming convention. The RuntimeHostError base class usage at line 34 remains unchanged, and type checking confirms the inheritance structure is intact.

src/omnibase_core/errors/error_declarative.py (1)

21-26: LGTM! Documentation updated to reflect new module path.

The docstring usage example has been updated to show the correct import path omnibase_core.errors.error_declarative, aligning with the file's new name. This ensures developers referencing this documentation will use the correct import paths.

docs/architecture/EXECUTION_SHAPE_EXAMPLES.md (1)

326-326: LGTM! Import paths correctly updated.

The documentation examples now reference the renamed module decorator_error_handling, maintaining consistency with the refactoring.

Also applies to: 667-667

src/omnibase_core/runtime/envelope_router.py (1)

49-49: LGTM! Import path correctly updated.

The import now references the renamed module decorator_error_handling, consistent with the refactoring objectives.

tests/unit/decorators/test_error_handling_extended.py (1)

18-22: LGTM! Import paths correctly updated.

The test file now imports all three decorators from the renamed module decorator_error_handling, maintaining test coverage for the refactored code.

docs/reference/api/utils.md (1)

23-23: LGTM! Documentation correctly updated.

All import examples now reference the renamed module decorator_error_handling, ensuring developers use the correct import paths.

Also applies to: 57-57, 293-293, 361-361

src/omnibase_core/tools/mypy_plugins/dict_any_checker.py (1)

65-65: Import path correctly updated.

The import statement now references the renamed module decorator_allow_dict_any.

docs/release/V040_RELEASE_CHECKLIST.md (1)

1201-1201: ✅ Import path correctly updated to new error module.

The import path for NodeExecutionError is correctly updated from omnibase_core.errors.declarative_errors to omnibase_core.errors.error_declarative, aligning with the PR's module reorganization.

docs/architecture/adr/ADR-012-VALIDATOR-ERROR-HANDLING.md (1)

220-221: ✅ Decorator import path correctly updated.

The import for standard_error_handling decorator is correctly updated from omnibase_core.decorators.error_handling to omnibase_core.decorators.decorator_error_handling, consistent with the PR's decorator module reorganization.

docs/reference/templates/EFFECT_NODE_TEMPLATE.md (1)

95-95: ✅ Decorator import path correctly updated in template.

The import for standard_error_handling is correctly updated from omnibase_core.decorators.error_handling to omnibase_core.decorators.decorator_error_handling. This template is a critical reference for developers; the updated import path ensures it provides correct guidance for new node implementations.

tests/unit/decorators/test_convert_to_schema.py (1)

19-23: LGTM! Import paths updated correctly.

All import statements have been consistently updated from omnibase_core.decorators.convert_to_schema to omnibase_core.decorators.decorator_convert_to_schema, aligning with the new naming convention. No functional changes detected.

Also applies to: 724-726, 734-736, 748-750, 760-762, 769-771, 780-782, 793-795, 813-815, 831-833, 850-852, 866-868, 875-877, 884-886, 892-894, 902-904

tests/unit/errors/test_error_declarative.py (2)

12-12: LGTM! Documentation reference updated correctly.

Comment now correctly references the renamed module error_declarative.py.


47-47: LGTM! Error class imports updated correctly.

All imports of declarative error classes have been consistently updated from omnibase_core.errors.declarative_errors to omnibase_core.errors.error_declarative, and RuntimeHostError imports updated from error_runtime_errors to error_runtime. Changes align with the module reorganization.

Also applies to: 59-59, 78-78, 98-98, 116-116, 124-124, 134-135, 147-147, 164-164, 176-176, 195-195, 215-215, 235-235, 243-243, 253-254, 265-265, 286-287, 303-303, 315-315, 334-334, 354-354, 374-374, 382-382, 392-393, 404-405, 426-427, 443-443, 455-455, 474-474, 494-494, 514-514, 522-522, 532-533, 544-544, 566-567, 583-588, 604-610, 624-629, 652-657, 675-680, 697-702, 724-724, 739-739, 753-753, 767-767, 787-787, 805-807, 824-826, 846-847, 872-877, 916-927

tests/unit/errors/test_error_runtime.py (1)

24-24: LGTM! Runtime error imports updated correctly.

All import statements have been consistently updated from omnibase_core.errors.runtime_errors to omnibase_core.errors.error_runtime, aligning with the new error module naming convention. No functional changes.

Also applies to: 38-38, 50-50, 61-61, 84-84, 97-97, 110-110, 123-123, 147-147, 157-157, 168-168, 187-187, 197-197, 208-211, 226-226, 236-236, 247-247, 271-277, 294-294, 303-307, 319-319

docs/architecture/decisions/ADR-003-reducer-output-exception-consistency.md (1)

413-413: LGTM! Documentation updated correctly.

Import path in the code example correctly updated from omnibase_core.decorators.error_handling to omnibase_core.decorators.decorator_error_handling, ensuring documentation stays in sync with the decorator module rename.

src/omnibase_core/validation/__init__.py (1)

32-36: LGTM! Exception imports updated correctly.

Import source updated from omnibase_core.errors.exceptions to omnibase_core.errors.exception_base for the three exception classes. Public exports remain unchanged, maintaining API compatibility.

src/omnibase_core/errors/__init__.py (4)

7-30: LGTM: TYPE_CHECKING imports correctly updated to new module names.

The imports have been systematically updated to reflect the new module naming convention (e.g., error_declarative, error_runtime, error_callable_not_found). All error classes remain accessible through the same public API.


126-127: LGTM: Comments accurately reflect new module structure.

The documentation correctly references the new module names error_runtime and error_declarative.


180-182: LGTM: Lazy loading correctly updated for runtime errors.

The lazy import mechanism properly references error_runtime (was runtime_errors), maintaining the deferred loading behavior while using the new module path.


207-209: LGTM: Lazy loading correctly updated for declarative errors.

The lazy import mechanism properly references error_declarative (was declarative_errors), maintaining the deferred loading behavior while using the new module path.

src/omnibase_core/decorators/__init__.py (1)

6-23: LGTM: Decorator imports correctly updated to new module names.

All decorator imports have been systematically updated to use the new naming convention with the decorator_ prefix. The public API is preserved through re-exports.

Note: allow_dict_any exists as two separate implementations — one in decorator_allow_dict_any.py (with optional reason parameter) and another in decorator_pattern_exclusions.py (simplified, pass-through version). The public API exports only the full version from decorator_allow_dict_any.py. Consider whether both implementations should coexist or if the duplicate in decorator_pattern_exclusions.py should be consolidated with the primary implementation to avoid confusion and maintain DRY principles.

…renames

- Update documentation references to use new file paths (decorator_error_handling, error_declarative)
- Add comprehensive docstrings to protocol_contract_profile_factory.py
- Fix duplicate section headers in docs
- Add 41 import validation tests verifying renamed imports work correctly
@claude

claude Bot commented Jan 3, 2026

Copy link
Copy Markdown

PR Review: File Naming Convention Alignment (OMN-1217, OMN-1218, OMN-1219)

Overview

This PR implements a systematic refactoring to align file naming conventions across three critical directories (decorators/, errors/, protocols/). The changes are well-structured, comprehensive, and follow best practices for large-scale refactoring.


✅ Strengths

1. Excellent Refactoring Methodology

  • Backward compatibility maintained: All init.py files properly re-export symbols, ensuring existing imports continue to work
  • Comprehensive test coverage: Added 554 lines of targeted import validation tests in test_renamed_imports_pr317.py
  • Systematic approach: Consistent naming pattern applied across all affected directories
  • Documentation updates: All 11 documentation files updated to reflect new import paths

2. Strong Test Coverage

The new test file demonstrates excellent practices:

  • Tests both direct imports AND re-exports
  • Tests object identity consistency (module_seh is init_seh)
  • Tests circular import prevention
  • Tests actual decorator functionality

3. Proper Lazy Loading for Circular Import Prevention

The errors/init.py uses proper lazy loading via getattr which is the correct pattern for avoiding circular dependencies in Python.

4. Comprehensive Scope

  • 41 files updated (8 source renames + 3 test renames + 30 import updates)
  • 815 additions, 173 deletions - net positive due to comprehensive tests
  • All import categories covered: Direct imports, re-exports, cross-module imports

🔍 Code Quality Assessment

Type Safety: ✅ EXCELLENT

  • Imports properly typed in TYPE_CHECKING blocks
  • No type checking regressions expected
  • Protocol imports correctly updated in protocols/init.py

Error Handling: ✅ EXCELLENT

  • Error class imports systematically updated
  • @standard_error_handling decorator paths corrected across all documentation
  • Exception groups remain intact

Documentation: ✅ COMPREHENSIVE

Updated files include:

  • CLAUDE.md (project instructions)
  • Architecture docs (ADRs, execution shape examples)
  • Reference docs (API docs, templates)
  • Release checklist

⚠️ Minor Observations

1. Import Path Consistency Check

The PR description states "All imports updated across 41 files" - verify that all consuming projects (omnibase_spi, downstream services) are aware of this change. Since re-exports are maintained, impact should be minimal, but worth documenting in release notes.

2. Pre-commit Hook Performance

The test plan shows:

  • ✅ All pre-commit hooks pass
  • ✅ mypy type checking passes
  • ✅ pyright type checking passes
  • ✅ Code compiles
  • ⏳ CI tests pass (pending)

Recommendation: Given the large test suite (12,000+ tests), ensure CI completes successfully before merge.

3. Protocol Documentation Enhancement

In protocols/protocol_contract_profile_factory.py, excellent docstring improvements were added. This is great work - consider applying similar documentation improvements to other protocol files in future PRs.


🎯 Specific File Review

src/omnibase_core/decorators/init.py

✅ LGTM - Clean imports, proper all export list

src/omnibase_core/errors/init.py

✅ LGTM - Proper lazy loading, comprehensive getattr implementation

src/omnibase_core/protocols/init.py

✅ LGTM - Protocol imports correctly organized by category

tests/unit/api_snapshots/test_renamed_imports_pr317.py

✅ EXCELLENT - Comprehensive coverage of:

  • Direct imports (from renamed files)
  • Re-exports (from init.py)
  • Object identity verification
  • Circular import prevention
  • Decorator functionality verification

🔒 Security & Performance

Security: ✅ NO CONCERNS

  • No changes to runtime behavior
  • No exposure of internal APIs
  • Proper encapsulation maintained

Performance: ✅ NO IMPACT

  • Lazy loading in getattr only triggers on first access
  • No additional overhead for consumers using re-exports
  • File renames don't affect runtime performance

📋 Pre-Merge Checklist

Before merging, verify:

  • CI tests pass (20 parallel splits)
  • Coverage remains ≥60%
  • No mypy errors (strict mode)
  • No pyright errors
  • Pre-commit hooks pass

🎉 Final Verdict: APPROVE (pending CI)

This is high-quality refactoring work that demonstrates:

  • ✅ Systematic approach to naming convention alignment
  • ✅ Comprehensive test coverage for import validation
  • ✅ Proper backward compatibility maintenance
  • ✅ Thorough documentation updates
  • ✅ No security or performance concerns

Recommendations:

  1. Wait for CI to complete before merging
  2. Document in release notes: Mention deprecated import paths (even though they still work) to guide future development
  3. Consider applying similar docstring improvements to other protocol files in follow-up PRs

Great work on maintaining backward compatibility while improving code organization! 🚀


Review conducted by Claude Code following CLAUDE.md conventions and ONEX architecture standards.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (2)
docs/reference/api/utils.md (2)

22-30: Add language specifier to code block.

The fenced code block should specify python as the language for proper syntax highlighting.

🔎 Proposed fix
-```
+```python
 from omnibase_core.decorators.decorator_error_handling import standard_error_handling

56-63: Add language specifier to code block.

The fenced code block should specify python as the language for proper syntax highlighting.

🔎 Proposed fix
-```
+```python
 from omnibase_core.decorators.decorator_error_handling import validation_error_handling
📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0e76204 and 98b39ce.

📒 Files selected for processing (8)
  • docs/MVP_PLAN.md
  • docs/reference/api/utils.md
  • docs/reference/templates/ORCHESTRATOR_NODE_TEMPLATE.md
  • src/omnibase_core/protocols/protocol_contract_profile_factory.py
  • tests/unit/api_snapshots/test_renamed_imports_pr317.py
  • tests/unit/decorators/test_error_handling_extended.py
  • tests/unit/decorators/test_pattern_exclusions.py
  • tests/unit/errors/test_error_declarative.py
✅ Files skipped from review due to trivial changes (1)
  • docs/MVP_PLAN.md
🚧 Files skipped from review as they are similar to previous changes (3)
  • docs/reference/templates/ORCHESTRATOR_NODE_TEMPLATE.md
  • tests/unit/decorators/test_pattern_exclusions.py
  • tests/unit/decorators/test_error_handling_extended.py
🧰 Additional context used
📓 Path-based instructions (4)
**/*.{py,sh}

📄 CodeRabbit inference engine (CLAUDE.md)

Always use poetry run for Python commands (pytest, mypy, pip, python -m). Never use pip or python directly.

Files:

  • src/omnibase_core/protocols/protocol_contract_profile_factory.py
  • tests/unit/api_snapshots/test_renamed_imports_pr317.py
  • tests/unit/errors/test_error_declarative.py
**/*.py

📄 CodeRabbit inference engine (CLAUDE.md)

**/*.py: Always call super().__init__(container) in node class constructors after inheriting from base node classes (NodeEffect, NodeCompute, NodeReducer, NodeOrchestrator). This eliminates 80+ lines of boilerplate code.
Use ModelONEXContainer for dependency injection in node constructors, NOT ModelContainer. ModelContainer is for value wrapping only.
Use protocol names (not concrete class names) when resolving services via DI: container.get_service("ProtocolEventBus") instead of container.get_service("EventBusService").
Use ModelOnexError with EnumCoreErrorCode for error handling instead of generic Exception.
Use @standard_error_handling decorator from omnibase_core.decorators.error_handling to eliminate try/catch boilerplate in async methods.
Add standardized comment markers when using catch-all or broad exception handlers: # fallback-ok:, # catch-all-ok:, # cleanup-resilience-ok:, # boundary-ok:, # init-errors-ok:, # tool-resilience-ok:
Order exception tuples alphabetically by exception class name in except clauses.
Use centralized exception groups from omnibase_core.errors.exception_groups (e.g., PYDANTIC_MODEL_ERRORS, VALIDATION_ERRORS) instead of hardcoding exception tuples.
Add from_attributes=True to ConfigDict for immutable value objects nested in other Pydantic models to support pytest-xdist parallel execution.
Use PEP 604 union syntax (str | None) instead of legacy Union/Optional syntax (enforced by ruff UP007).
ORCHESTRATOR nodes CANNOT return typed results - they can only emit events and intents. Only COMPUTE nodes return typed results.
Use declarative YAML contracts for all nodes. Load contracts using FileRegistry: registry = FileRegistry(); contract = registry.load(Path("config/runtime_host.yaml"))
Use FileRegistry for contract loading with error handling for codes: FILE_NOT_FOUND, FILE_READ_ERROR, CONFIGURATION_PARSE_ERROR, CONTRACT_VALIDATION_ERROR, DUPLICATE_REGISTRATION, DIRECTORY_NOT_FOUND
Implement mixins for cross-cutting concerns...

Files:

  • src/omnibase_core/protocols/protocol_contract_profile_factory.py
  • tests/unit/api_snapshots/test_renamed_imports_pr317.py
  • tests/unit/errors/test_error_declarative.py
src/**/*.py

📄 CodeRabbit inference engine (CLAUDE.md)

src/**/*.py: Achieve 100% mypy strict mode compliance with 0 errors across all source files.
Ensure both mypy AND pyright pass in CI without errors.

Files:

  • src/omnibase_core/protocols/protocol_contract_profile_factory.py
tests/**/*.py

📄 CodeRabbit inference engine (CLAUDE.md)

Run pytest with markers for test organization: @pytest.mark.unit, @pytest.mark.integration, @pytest.mark.slow, @pytest.mark.smoke, @pytest.mark.performance

Files:

  • tests/unit/api_snapshots/test_renamed_imports_pr317.py
  • tests/unit/errors/test_error_declarative.py
🧠 Learnings (3)
📚 Learning: 2026-01-03T21:44:56.028Z
Learnt from: CR
Repo: OmniNode-ai/omnibase_core PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-01-03T21:44:56.028Z
Learning: Applies to **/*.py : Use ModelOnexError with EnumCoreErrorCode for error handling instead of generic Exception.

Applied to files:

  • tests/unit/api_snapshots/test_renamed_imports_pr317.py
  • tests/unit/errors/test_error_declarative.py
  • docs/reference/api/utils.md
📚 Learning: 2026-01-03T21:44:56.028Z
Learnt from: CR
Repo: OmniNode-ai/omnibase_core PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-01-03T21:44:56.028Z
Learning: Applies to **/*.py : Use standard_error_handling decorator from omnibase_core.decorators.error_handling to eliminate try/catch boilerplate in async methods.

Applied to files:

  • tests/unit/api_snapshots/test_renamed_imports_pr317.py
  • docs/reference/api/utils.md
📚 Learning: 2026-01-03T21:44:56.028Z
Learnt from: CR
Repo: OmniNode-ai/omnibase_core PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-01-03T21:44:56.028Z
Learning: Applies to **/*.py : Use centralized exception groups from omnibase_core.errors.exception_groups (e.g., PYDANTIC_MODEL_ERRORS, VALIDATION_ERRORS) instead of hardcoding exception tuples.

Applied to files:

  • tests/unit/errors/test_error_declarative.py
  • docs/reference/api/utils.md
🧬 Code graph analysis (3)
src/omnibase_core/protocols/protocol_contract_profile_factory.py (2)
src/omnibase_core/factories/contract_profile_factory.py (2)
  • available_profiles (290-325)
  • available_profiles (351-353)
src/omnibase_core/enums/enum_node_type.py (1)
  • EnumNodeType (96-320)
tests/unit/api_snapshots/test_renamed_imports_pr317.py (7)
src/omnibase_core/decorators/decorator_error_handling.py (2)
  • io_error_handling (157-216)
  • standard_error_handling (26-93)
src/omnibase_core/errors/exception_adapter_binding_error.py (1)
  • AdapterBindingError (34-99)
src/omnibase_core/errors/error_runtime_host.py (1)
  • RuntimeHostError (38-102)
src/omnibase_core/protocols/protocol_core.py (1)
  • ProtocolCanonicalSerializer (27-105)
src/omnibase_core/protocols/protocol_import_tracker.py (1)
  • ProtocolImportTracker (13-36)
src/omnibase_core/protocols/protocol_logger_like.py (1)
  • ProtocolLoggerLike (18-51)
src/omnibase_core/protocols/protocol_payload_data.py (1)
  • ProtocolPayloadData (28-125)
tests/unit/errors/test_error_declarative.py (5)
src/omnibase_core/errors/exception_adapter_binding_error.py (1)
  • AdapterBindingError (34-99)
src/omnibase_core/enums/enum_core_error_code.py (1)
  • EnumCoreErrorCode (9-241)
src/omnibase_core/errors/exception_purity_violation_error.py (1)
  • PurityViolationError (34-100)
src/omnibase_core/errors/exception_node_execution_error.py (1)
  • NodeExecutionError (34-99)
src/omnibase_core/errors/exception_unsupported_capability_error.py (1)
  • UnsupportedCapabilityError (34-99)
🪛 LanguageTool
docs/reference/api/utils.md

[grammar] ~18-~18: Use a hyphen to join words.
Context: ...: Decorator that provides standard error handling pattern for ONEX operations. T...

(QB_NEW_EN_HYPHEN)


[grammar] ~20-~20: Use a hyphen to join words.
Context: ...eliminates 6+ lines of boilerplate error handling code and ensures consistent err...

(QB_NEW_EN_HYPHEN)

🪛 markdownlint-cli2 (0.18.1)
docs/reference/api/utils.md

22-22: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


56-56: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (21)
  • GitHub Check: Tests (Split 18/20)
  • GitHub Check: Tests (Split 16/20)
  • GitHub Check: Tests (Split 13/20)
  • GitHub Check: Tests (Split 20/20)
  • GitHub Check: Tests (Split 15/20)
  • GitHub Check: Tests (Split 19/20)
  • GitHub Check: Tests (Split 11/20)
  • GitHub Check: Tests (Split 12/20)
  • GitHub Check: Tests (Split 17/20)
  • GitHub Check: Tests (Split 14/20)
  • GitHub Check: Tests (Split 5/20)
  • GitHub Check: Tests (Split 10/20)
  • GitHub Check: Tests (Split 9/20)
  • GitHub Check: Tests (Split 7/20)
  • GitHub Check: Tests (Split 8/20)
  • GitHub Check: Tests (Split 6/20)
  • GitHub Check: Tests (Split 3/20)
  • GitHub Check: Tests (Split 1/20)
  • GitHub Check: Tests (Split 2/20)
  • GitHub Check: Tests (Split 4/20)
  • GitHub Check: claude-review
🔇 Additional comments (6)
docs/reference/api/utils.md (1)

16-30: Documentation updates look good.

The import path updates from omnibase_core.decorators.error_handling to omnibase_core.decorators.decorator_error_handling are correct and align with the PR objectives.

tests/unit/errors/test_error_declarative.py (1)

1-951: LGTM! Systematic import path updates are correct.

All import statements have been correctly updated to reflect the file renames:

  • declarative_errors → error_declarative
  • runtime_errors → error_runtime

The test logic remains unchanged, and the comprehensive test coverage for declarative errors is preserved. The updates align perfectly with the PR objectives for OMN-1217, OMN-1218, and OMN-1219.

tests/unit/api_snapshots/test_renamed_imports_pr317.py (1)

1-554: Excellent comprehensive test coverage for the PR #317 renames!

This test file provides thorough validation of all renamed imports across decorators, errors, and protocols. The test structure is well-organized and covers:

✅ Direct imports from new module paths
✅ Re-exports from __init__.py modules
✅ __all__ exports validation
✅ Import consistency (identity checks)
✅ Circular import prevention
✅ Functional decorator tests

The comprehensive coverage provides strong confidence that the renames preserve all public APIs and don't introduce breaking changes.

src/omnibase_core/protocols/protocol_contract_profile_factory.py (3)

1-14: LGTM! Well-structured module documentation.

The expanded module docstring clearly articulates the design principles and aligns with the coding guidelines for protocol-first design and type safety.


88-102: LGTM! Clear method documentation.

The docstring accurately documents the method contract, including the important note that the returned list may be empty.


56-86: Protocol documentation does not match actual implementation exception behavior.

The documented exceptions (KeyError for missing profiles, ValueError for invalid version) do not match the actual implementation. The concrete implementation in contract_profile_factory.py raises OnexError with EnumCoreErrorCode.VALIDATION_ERROR for missing profiles and performs no semantic version validation at all. Update the protocol docstring to reflect what implementations actually raise:

Raises:
    OnexError: If the requested profile does not exist for the
        given node type or if the node type is invalid.

Likely an incorrect or invalid review comment.

Comment on lines +38 to 54
Example:
.. code-block:: python

from omnibase_core.protocols import ProtocolContractProfileFactory
from omnibase_core.enums import EnumNodeType

def create_node_contract(
factory: ProtocolContractProfileFactory,
node_type: EnumNodeType,
) -> ModelContractBase:
'''Create a default contract for a node type.'''
# Check available profiles
profiles = factory.available_profiles(node_type)
if "default" in profiles:
return factory.get_profile(node_type, "default")
return factory.get_profile(node_type, profiles[0])
"""

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Fix IndexError risk in example code.

The example accesses profiles[0] without checking if the list is empty. According to the available_profiles documentation (Line 100), the method "May be empty if no profiles are defined for the node type," which would cause an IndexError at Line 53.

🔎 Suggested fix for the example
             def create_node_contract(
                 factory: ProtocolContractProfileFactory,
                 node_type: EnumNodeType,
             ) -> ModelContractBase:
                 '''Create a default contract for a node type.'''
                 # Check available profiles
                 profiles = factory.available_profiles(node_type)
+                if not profiles:
+                    raise ValueError(f"No profiles available for {node_type}")
                 if "default" in profiles:
                     return factory.get_profile(node_type, "default")
                 return factory.get_profile(node_type, profiles[0])
🤖 Prompt for AI Agents
In src/omnibase_core/protocols/protocol_contract_profile_factory.py around lines
38 to 54, the example can raise IndexError because it uses profiles[0] without
ensuring profiles is non-empty; update the example to check if profiles is empty
before indexing and handle that case (e.g., if not profiles: raise a clear
ValueError or return None) otherwise proceed to return
factory.get_profile(node_type, profiles[0]).

The PR #317 renamed several files (decorators/, errors/, protocols/)
but CI was using cached virtualenv from before the renames. This caused
ModuleNotFoundError for old module paths that no longer exist.

Bumping CACHE_VERSION from 0.1.4 to 0.1.5 forces cache invalidation,
ensuring CI installs fresh dependencies with the new file structure.

Error seen in CI:
- ModuleNotFoundError: No module named 'omnibase_core.decorators.allow_dict_any'
- ImportError: cannot import name 'declarative_errors' from 'omnibase_core.errors'

Related: OMN-1217, OMN-1218, OMN-1219
@claude

claude Bot commented Jan 3, 2026

Copy link
Copy Markdown

Code Review - PR #317: File Naming Convention Compliance

Summary

This PR successfully renames 8 core files across decorators/, errors/, and protocols/ directories to follow ONEX naming conventions, updating all 41+ dependent files accordingly.


✅ Strengths

1. Comprehensive Import Updates

  • All 41 files (src/, tests/, docs/) updated correctly
  • No orphaned old import paths detected
  • Proper init.py re-exports maintained
  • CI cache version bumped (0.1.4 → 0.1.5) to prevent stale caches

2. Excellent Test Coverage

  • Added dedicated test file (test_renamed_imports_pr317.py) with 554 lines
  • Tests validate both direct imports AND re-exports from init.py
  • Comprehensive coverage of all 8 renamed files
  • Existing test files renamed to match (test_error_declarative.py, etc.)

3. Documentation Updates

  • CLAUDE.md updated with new import paths
  • ADR documents updated (ADR-012, ADR-003)
  • API reference docs updated (docs/reference/api/utils.md)
  • Template files updated (EFFECT_NODE_TEMPLATE.md, ORCHESTRATOR_NODE_TEMPLATE.md)

4. Consistent Naming Pattern

  • Decorators: decorator_* prefix (4 files)
  • Errors: error_* or exception_* prefix (3 files)
  • Protocols: protocol_* prefix (1 file)
  • Aligns with established ONEX conventions

5. Low-Risk Refactor

  • Pure file renames with no logic changes
  • Backward compatibility maintained via init.py re-exports
  • Type checking passes (mypy + pyright in progress)

🔍 Code Quality Observations

Protocol-Driven DI Compliance ✅

The PR correctly maintains protocol-based imports throughout - container.get_service() calls remain unchanged.

Error Handling Pattern ✅

The decorator import updates follow CLAUDE.md guidelines, changing from omnibase_core.decorators.error_handling to omnibase_core.decorators.decorator_error_handling.

Thread Safety ✅

No changes to thread safety semantics - purely file renames.


📋 Validation Checklist

  • ✅ All pre-commit hooks pass (per PR description)
  • ✅ mypy type checking passes (per PR description)
  • ✅ pyright type checking passes (per PR description)
  • ✅ Code compiles (poetry run python -c "import omnibase_core")
  • ⏳ CI tests in progress (Code Quality, Pyright running)
  • ✅ 5/9 CI checks completed successfully:
    • Exports Validation ✅
    • Mypy Validation Scripts ✅
    • Core-Infra Boundary ✅
    • Documentation Validation ✅
    • Node Purity Check ✅

🎯 Performance Considerations

Impact: Minimal

  • File renames don't affect runtime performance
  • Import paths cached by Python after first load
  • No changes to hot paths or critical sections

🔒 Security Concerns

Impact: None identified

  • No logic changes
  • No new attack surfaces
  • Maintains existing error handling patterns

📊 Test Coverage Analysis

New Tests Added

tests/unit/api_snapshots/test_renamed_imports_pr317.py (554 lines)

Coverage: Excellent

  • Tests all 8 renamed files
  • Validates both direct imports and re-exports
  • Includes docstrings explaining OMN-1217, OMN-1218, OMN-1219

Test Structure

The TestDecoratorRenamedImports, TestErrorRenamedImports, and TestProtocolRenamedImports classes provide comprehensive coverage with both direct import and re-export validation.


🚀 Recommendations

Before Merge

  1. ✅ Wait for CI completion - Code Quality and Pyright checks still running
  2. ✅ Verify all 20 test splits pass - Critical for 12,000+ test suite
  3. ✅ Confirm coverage maintains ≥60% - Project requirement

Post-Merge

  1. Monitor downstream dependencies

    • Check if any external projects import these modules directly
    • The init.py re-exports provide backward compatibility, but direct imports would break
  2. Consider deprecation notice (optional)

    • If external projects exist, consider a deprecation warning in init.py
    • Example: warnings.warn for deprecated import paths

📝 Minor Suggestions

1. Test File Naming Consistency

The new test file test_renamed_imports_pr317.py is great for tracking the PR context, but consider renaming post-merge to something like test_import_paths.py or test_module_reexports.py. This makes it easier for future developers to understand the test's purpose without PR context.

2. Import Path Documentation

Consider adding a brief comment in each renamed file's docstring noting the rename from PR #317 for historical context.


🎉 Final Assessment

Verdict: ✅ APPROVE (pending CI completion)

This is a well-executed refactoring that:

  • Improves codebase consistency
  • Maintains backward compatibility
  • Includes comprehensive tests
  • Updates all documentation
  • Follows ONEX conventions

Risk Level: 🟢 Low

  • No logic changes
  • Comprehensive test coverage
  • Clean git history

Impact: 🟡 Medium

  • Touches 44 files
  • Affects core infrastructure
  • Requires CI cache invalidation

📚 Related Issues

Closes:

  • OMN-1217 (decorators/)
  • OMN-1218 (errors/)
  • OMN-1219 (protocols/)

Great work on maintaining code quality standards! 🚀

The systematic approach to renaming (plan → execute → test → document) is exemplary. This sets a strong precedent for future naming convention updates.


Review performed by Claude Code following CLAUDE.md guidelines
CI Status: 5/9 checks completed, 4 in progress
Last Updated: 2026-01-03 22:45 UTC

- Update decorator path constants in dict_any_checker.py to use new
  decorator_allow_dict_any module path after file rename
- Remove duplicate "Compute Module Exports" section header from
  protocols/__init__.py

Addresses PR #317 review feedback from CodeRabbit.
@claude

claude Bot commented Jan 3, 2026

Copy link
Copy Markdown

Code Review - PR #317

Summary

This PR renames 8 files across decorators/, errors/, and protocols/ directories to follow consistent naming conventions. The refactoring includes updating 41 import statements across source, tests, and documentation.

✅ Strengths

  1. Consistent Naming Convention: The new naming scheme is clear and systematic:

    • Decorators: decorator_* prefix (e.g., decorator_error_handling.py)
    • Errors: error_* prefix (e.g., error_declarative.py, error_runtime.py)
    • Protocols: protocol_* prefix (e.g., protocol_core.py)
    • Exception base: exception_base.py (more descriptive than exceptions.py)
  2. Comprehensive Import Updates: All 41 affected files properly updated:

    • Source files (decorators, errors, models, protocols)
    • Test files
    • Documentation (CLAUDE.md, ADRs, templates, guides)
    • CI cache version bumped (CACHE_VERSION: 0.1.5)
  3. Backward Compatibility via init.py: Public API maintained through re-exports - ensures external code doesn't break.

  4. Documentation Quality: Updated docstrings reflect new module paths with proper usage examples.

  5. Import Ordering: The errors/init.py properly alphabetizes imports in TYPE_CHECKING block, following Python best practices.

🔍 Observations

  1. getattr Pattern: The lazy loading in errors/init.py via getattr is maintained correctly to avoid circular imports while maintaining public API.

  2. Test File Renames: Test files appropriately renamed to match:

    • test_decorator_error_handling.py
    • test_error_declarative.py
    • test_error_runtime.py
  3. CI Cache Invalidation: Bumping CACHE_VERSION to 0.1.5 ensures GitHub Actions rebuilds with new module structure.

⚠️ Potential Concerns

  1. External Consumers: While init.py maintains backward compatibility for public APIs, any external code using direct file imports will break. Most consumers should use public API anyway, but document this in release notes.

  2. exception_base.py Naming: Changed from exceptions.py to exception_base.py. While descriptive, verify this file actually contains base exceptions (not just generic exceptions). If it's a catch-all module, exception_core.py or exception_common.py might be more accurate.

  3. Grep for Missed Imports: The diff shows comprehensive updates, but CI should catch any misses. Recommend final verification:

    • Search for old import patterns
    • Verify all references updated

🧪 Testing Recommendations

  1. Import Verification: Consider adding a smoke test that verifies both old (via init) and new import paths work correctly.

  2. Mypy/Pyright Pass: Ensure both type checkers pass with updated imports (PR checklist shows this is planned).

  3. Parallel Test Splits: With 20 parallel CI splits, verify no import race conditions occur with new module paths.

📝 Documentation

  1. CLAUDE.md Updated: ✅ Correctly updated example imports
  2. Architecture Docs: ✅ ADRs and templates updated with new paths
  3. Missing: Consider adding a migration note in docs/guides/ or CHANGELOG.md explaining the rename for downstream consumers.

🎯 Recommendations

  1. Add CHANGELOG Entry: Document breaking changes for direct imports:

    • Renamed decorator files with decorator_* prefix
    • Renamed error files with error_* prefix
    • Renamed protocol files with protocol_* prefix
    • BREAKING: Direct file imports changed (use public API imports instead)
  2. Verify exception_base.py: Confirm the file contains base exceptions. If not, consider exception_core.py or exception_common.py.

  3. Final Verification: Before merge, run:

    • poetry run python -c "import omnibase_core; print('Import OK')"
    • Full test suite with coverage

✅ Approval Conditions

This PR is approved pending:

  • CI tests pass (marked pending in test plan)
  • No grep results for old import paths (verify clean)
  • exception_base.py naming verified or adjusted

Overall Assessment

Score: 9/10

This is a high-quality refactoring that:

  • Improves codebase consistency ✅
  • Maintains backward compatibility ✅
  • Updates documentation thoroughly ✅
  • Follows ONEX conventions ✅

The systematic approach to renaming, comprehensive import updates, and proper CI cache invalidation demonstrate excellent engineering discipline. The only minor concerns are potential external consumer impact (mitigated by init.py) and verifying exception_base.py naming accuracy.

Recommendation: Merge after CI passes. 🚀


Review generated following CLAUDE.md conventions and ONEX architectural principles.

Resolved merge conflict in model_capability_requirement_set.py:
- Used renamed decorator path (decorator_allow_dict_any)
- Kept existing type_json import path

Fixed import path in mixin_caching.py:
- Updated allow_dict_any -> decorator_allow_dict_any
Redis class in redis-py 5.x no longer accepts type arguments.
Fixes mypy and pyright type-arg errors.
@claude

claude Bot commented Jan 4, 2026

Copy link
Copy Markdown

Code Review - PR #317

Summary

This PR implements a systematic file naming convention refactor across three critical directories: decorators/, errors/, and protocols/. The changes enforce consistent naming patterns that improve code discoverability and maintainability.


✅ Strengths

1. Excellent Migration Execution

  • Complete import updates: All 41+ import references updated across src/, tests/, and docs/
  • No stale imports: Verified with grep - no old import paths remain
  • Comprehensive test coverage: Added 554 lines of import validation tests in test_renamed_imports_pr317.py
  • CI cache invalidation: Properly bumped CACHE_VERSION to prevent stale cache issues

2. Strong Naming Consistency

The new naming conventions are clear and follow a logical pattern:

Category Pattern Examples
Decorators decorator_* decorator_error_handling.py, decorator_allow_dict_any.py
Errors error_* / exception_* error_declarative.py, exception_base.py
Protocols protocol_* protocol_core.py

This makes it immediately clear what type of module you're importing from.

3. Thorough Testing Strategy

The test_renamed_imports_pr317.py file demonstrates excellent test coverage:

  • ✅ Direct imports from renamed modules
  • ✅ Re-exports from __init__.py modules
  • ✅ Object identity verification (same object from different paths)
  • ✅ Circular import prevention tests
  • ✅ Functional testing of decorators

4. Documentation Updates

  • Updated CLAUDE.md, docs/, and templates consistently
  • Proper docstring improvements in protocol_contract_profile_factory.py
  • Fixed duplicate section headers

5. Type Safety Fix

The Redis type annotation fix (Redis[str] → Redis) correctly addresses redis-py 5.x compatibility:

-self._client: Redis[str] | None = None
+self._client: Redis | None = None

This is correct because Redis 5.x no longer accepts type arguments.


🔍 Code Quality Assessment

Adherence to CLAUDE.md Standards

✅ Poetry usage: All operations use poetry
✅ Error handling: Uses structured errors appropriately
✅ Type annotations: PEP 604 union syntax (X | None)
✅ Import patterns: Protocol-based imports maintained
✅ Testing: Comprehensive unit tests added

Potential Issues Found: NONE

I specifically checked for:

  • ❌ No circular import issues
  • ❌ No missing re-exports
  • ❌ No stale import paths
  • ❌ No type checking errors
  • ❌ No backwards compatibility breaks (not required pre-v0.4.0)

📊 Impact Analysis

Files Changed: 47

  • 8 source files renamed
  • 3 test files renamed
  • 36 files with import path updates
  • 1 new comprehensive test file (554 lines)

Migration Completeness

✅ src/omnibase_core/     - ALL imports updated
✅ tests/                 - ALL imports updated  
✅ docs/                  - ALL imports updated
✅ CI configuration       - Cache invalidated
✅ mypy plugin            - Updated decorator paths
✅ __init__.py re-exports - Updated and verified

🎯 Performance Considerations

CI Impact:

  • Cache invalidation will cause one-time CI slowdown (expected)
  • Future CI runs will benefit from cached dependencies
  • No runtime performance impact

Import Performance:

  • File renames don't affect import performance
  • Re-exports maintain same lazy loading behavior
  • No additional import overhead introduced

🔐 Security Considerations

No security concerns identified. This is a pure refactoring PR:

  • No changes to business logic
  • No new external dependencies
  • No changes to security-sensitive code paths
  • No exposure of sensitive data

📋 Test Coverage

Existing Tests

The PR maintains compatibility with the existing 12,000+ test suite by updating all import paths.

New Tests

Added comprehensive import validation suite with:

  • 41+ import path verification tests
  • Circular import prevention tests
  • Object identity verification
  • Functional decorator tests

Coverage Assessment: ⭐⭐⭐⭐⭐ Excellent

The test suite specifically validates:

  1. All renamed files can be imported directly
  2. All re-exports work correctly
  3. Same objects are returned from different import paths
  4. No circular import issues exist
  5. Decorators function correctly after rename

✨ Recommendations

1. Monitor CI Completion (Required)

The PR description shows CI tests are still pending. Ensure all 20 parallel splits pass before merging.

2. Consider Adding to Migration Docs (Optional)

Consider documenting this naming convention change in a migration guide for external consumers of omnibase_core, similar to the existing MIGRATING_TO_DECLARATIVE_NODES.md.

3. Verify Downstream Projects (If Applicable)

If any downstream projects depend on omnibase_core and import these modules directly (not via __init__.py re-exports), they'll need updates. Check:

  • omnibase_spi
  • Any internal OmniNode services
  • Example projects in documentation

🎉 Conclusion

Verdict: ✅ APPROVE (pending CI passing)

This is a well-executed refactoring PR that:

  • Improves code organization and discoverability
  • Maintains 100% backwards compatibility through re-exports
  • Includes comprehensive test coverage
  • Follows all project conventions from CLAUDE.md
  • Contains zero bugs or security issues

The naming convention changes are sensible and will make the codebase more maintainable going forward. The migration was executed thoroughly with excellent attention to detail.

Merge when: All CI checks pass (currently in progress)


Checklist Summary

  • ✅ Code quality: Excellent
  • ✅ Best practices: Fully adhered to CLAUDE.md
  • ✅ Potential bugs: None found
  • ✅ Performance: No impact (cache invalidation expected)
  • ✅ Security: No concerns
  • ✅ Test coverage: Comprehensive (554 new lines)

Great work @jonahgabriel! 🚀


Review performed by Claude Code following omnibase_core CLAUDE.md standards

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between cbb7c95 and 3ded0d4.

📒 Files selected for processing (6)
  • CLAUDE.md
  • src/omnibase_core/backends/cache/backend_cache_redis.py
  • src/omnibase_core/mixins/mixin_caching.py
  • src/omnibase_core/models/capabilities/model_capability_requirement_set.py
  • src/omnibase_core/protocols/__init__.py
  • src/omnibase_core/validation/__init__.py
🚧 Files skipped from review as they are similar to previous changes (2)
  • src/omnibase_core/protocols/init.py
  • src/omnibase_core/models/capabilities/model_capability_requirement_set.py
🧰 Additional context used
📓 Path-based instructions (3)
**/*.{py,sh}

📄 CodeRabbit inference engine (CLAUDE.md)

Always use poetry run for Python commands (pytest, mypy, pip, python -m). Never use pip or python directly.

Files:

  • src/omnibase_core/backends/cache/backend_cache_redis.py
  • src/omnibase_core/mixins/mixin_caching.py
  • src/omnibase_core/validation/__init__.py
**/*.py

📄 CodeRabbit inference engine (CLAUDE.md)

**/*.py: Always call super().__init__(container) in node class constructors after inheriting from base node classes (NodeEffect, NodeCompute, NodeReducer, NodeOrchestrator). This eliminates 80+ lines of boilerplate code.
Use ModelONEXContainer for dependency injection in node constructors, NOT ModelContainer. ModelContainer is for value wrapping only.
Use protocol names (not concrete class names) when resolving services via DI: container.get_service("ProtocolEventBus") instead of container.get_service("EventBusService").
Use ModelOnexError with EnumCoreErrorCode for error handling instead of generic Exception.
Use @standard_error_handling decorator from omnibase_core.decorators.error_handling to eliminate try/catch boilerplate in async methods.
Add standardized comment markers when using catch-all or broad exception handlers: # fallback-ok:, # catch-all-ok:, # cleanup-resilience-ok:, # boundary-ok:, # init-errors-ok:, # tool-resilience-ok:
Order exception tuples alphabetically by exception class name in except clauses.
Use centralized exception groups from omnibase_core.errors.exception_groups (e.g., PYDANTIC_MODEL_ERRORS, VALIDATION_ERRORS) instead of hardcoding exception tuples.
Add from_attributes=True to ConfigDict for immutable value objects nested in other Pydantic models to support pytest-xdist parallel execution.
Use PEP 604 union syntax (str | None) instead of legacy Union/Optional syntax (enforced by ruff UP007).
ORCHESTRATOR nodes CANNOT return typed results - they can only emit events and intents. Only COMPUTE nodes return typed results.
Use declarative YAML contracts for all nodes. Load contracts using FileRegistry: registry = FileRegistry(); contract = registry.load(Path("config/runtime_host.yaml"))
Use FileRegistry for contract loading with error handling for codes: FILE_NOT_FOUND, FILE_READ_ERROR, CONFIGURATION_PARSE_ERROR, CONTRACT_VALIDATION_ERROR, DUPLICATE_REGISTRATION, DIRECTORY_NOT_FOUND
Implement mixins for cross-cutting concerns...

Files:

  • src/omnibase_core/backends/cache/backend_cache_redis.py
  • src/omnibase_core/mixins/mixin_caching.py
  • src/omnibase_core/validation/__init__.py
src/**/*.py

📄 CodeRabbit inference engine (CLAUDE.md)

src/**/*.py: Achieve 100% mypy strict mode compliance with 0 errors across all source files.
Ensure both mypy AND pyright pass in CI without errors.

Files:

  • src/omnibase_core/backends/cache/backend_cache_redis.py
  • src/omnibase_core/mixins/mixin_caching.py
  • src/omnibase_core/validation/__init__.py
🧠 Learnings (3)
📚 Learning: 2026-01-03T21:44:56.028Z
Learnt from: CR
Repo: OmniNode-ai/omnibase_core PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-01-03T21:44:56.028Z
Learning: Applies to **/*.py : Use standard_error_handling decorator from omnibase_core.decorators.error_handling to eliminate try/catch boilerplate in async methods.

Applied to files:

  • CLAUDE.md
📚 Learning: 2026-01-03T21:44:56.028Z
Learnt from: CR
Repo: OmniNode-ai/omnibase_core PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-01-03T21:44:56.028Z
Learning: Applies to **/*.py : Use centralized exception groups from omnibase_core.errors.exception_groups (e.g., PYDANTIC_MODEL_ERRORS, VALIDATION_ERRORS) instead of hardcoding exception tuples.

Applied to files:

  • src/omnibase_core/validation/__init__.py
📚 Learning: 2026-01-03T21:44:56.028Z
Learnt from: CR
Repo: OmniNode-ai/omnibase_core PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-01-03T21:44:56.028Z
Learning: Applies to **/*.py : Use ModelOnexError with EnumCoreErrorCode for error handling instead of generic Exception.

Applied to files:

  • src/omnibase_core/validation/__init__.py
🧬 Code graph analysis (1)
src/omnibase_core/mixins/mixin_caching.py (1)
src/omnibase_core/mixins/mixin_effect_execution.py (1)
  • allow_dict_any (123-146)
🔇 Additional comments (4)
src/omnibase_core/validation/__init__.py (1)

32-36: LGTM! Import path updated correctly.

The import path change from omnibase_core.errors.exceptions to omnibase_core.errors.exception_base aligns with the PR's file renaming objectives. The three exception classes remain properly re-exported, preserving the public API surface.

src/omnibase_core/mixins/mixin_caching.py (1)

67-67: LGTM: Import path correctly updated.

The import path has been properly updated to reflect the file rename from allow_dict_any.py to decorator_allow_dict_any.py. The decorator usage at line 406 remains unchanged and correct.

CLAUDE.md (1)

442-442: No action required—import path is valid.

The omnibase_core.errors.exception_groups import path remains valid and accessible. The exception_groups.py module was not affected by the error module renames, as it uses the exception_* naming convention rather than error_*. The module and its exception group constants (PYDANTIC_MODEL_ERRORS, VALIDATION_ERRORS, etc.) are properly imported and exported in errors/__init__.py.

src/omnibase_core/backends/cache/backend_cache_redis.py (1)

350-350: Type annotation correctly updated for redis-py 5.x compatibility.

Redis 5.0 removed support for generic type parameters, so Redis | None is the correct annotation. This change resolves mypy strict mode type-argument errors and aligns with the updated library API.

Comment thread CLAUDE.md

```python
from omnibase_core.decorators.error_handling import standard_error_handling
from omnibase_core.decorators.decorator_error_handling import standard_error_handling

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash

# Check if standard_error_handling is re-exported from decorators __init__
echo "=== Checking decorators/__init__.py for re-exports ==="
rg "standard_error_handling" src/omnibase_core/decorators/__init__.py -A 3

echo ""
echo "=== Checking if decorator_error_handling.py exists ==="
fd -t f "decorator_error_handling.py" src/omnibase_core/decorators/

echo ""
echo "=== Checking error module structure and exception_groups ==="
fd -t f "exception_groups" src/omnibase_core/errors/

echo ""
echo "=== Checking decorators/__init__.py full content for imports ==="
cat src/omnibase_core/decorators/__init__.py

echo ""
echo "=== Checking errors/__init__.py for re-exports ==="
cat src/omnibase_core/errors/__init__.py

Repository: OmniNode-ai/omnibase_core

Length of output: 10978


Update import to follow public API conventions.

The import at line 399 currently uses the direct module path:

from omnibase_core.decorators.decorator_error_handling import standard_error_handling

While this works, the standard_error_handling decorator is already re-exported in the public API (src/omnibase_core/decorators/__init__.py). Update the documentation to use the package-level import for stability and to guide users toward the intended public API:

from omnibase_core.decorators import standard_error_handling

This ensures documentation demonstrates the stable, supported import pattern rather than internal module paths.

🤖 Prompt for AI Agents
In CLAUDE.md around line 399, the import uses the internal module path; replace
the direct module import with the package-level re-export. Update the line to
import standard_error_handling from omnibase_core.decorators (i.e., use the
public API import) so the documentation demonstrates the supported, stable
import pattern.

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