Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ concurrency:
env:
POETRY_VERSION: "2.2.1"
PYTHON_VERSION: "3.12"
CACHE_VERSION: "0.1.4"
CACHE_VERSION: "0.1.5"

jobs:
# =============================================================================
Expand Down
2 changes: 1 addition & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ raise ModelOnexError(
#### Use @standard_error_handling decorator:

```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.


@standard_error_handling # Eliminates 6+ lines of try/catch boilerplate
async def my_operation(self):
Expand Down
2 changes: 1 addition & 1 deletion docs/MVP_PLAN.md
Original file line number Diff line number Diff line change
Expand Up @@ -1311,7 +1311,7 @@ Create centralized validation layer that validates contracts at node load time.
**Description**:
Define canonical error classes for the validation and adapter logic. Makes debugging tolerable and stack traces meaningful.

**Location**: `src/omnibase_core/errors/declarative_errors.py`
**Location**: `src/omnibase_core/errors/error_declarative.py`

**Acceptance Criteria**:
- [ ] `ContractValidationError` - invalid contract structure
Expand Down
4 changes: 2 additions & 2 deletions docs/architecture/EXECUTION_SHAPE_EXAMPLES.md
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ from omnibase_core.models.container.model_onex_container import ModelONEXContain
from omnibase_core.models.fsm.model_intent import ModelIntent
from omnibase_core.models.results.model_intent_result import ModelIntentResult
from omnibase_core.enums.enum_intent_type import EnumIntentType
from omnibase_core.decorators.error_handling import standard_error_handling
from omnibase_core.decorators.decorator_error_handling import standard_error_handling


class NodeDatabaseWriterEffect(NodeEffect):
Expand Down Expand Up @@ -664,7 +664,7 @@ from pydantic import BaseModel

from omnibase_core.nodes import NodeEffect
from omnibase_core.models.container.model_onex_container import ModelONEXContainer
from omnibase_core.decorators.error_handling import standard_error_handling
from omnibase_core.decorators.decorator_error_handling import standard_error_handling


router = APIRouter()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ With `ValueError`, this logic requires fragile string parsing.
**Pattern**: Validators using `ModelOnexError` integrate seamlessly with ONEX error handling decorators:

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

class NodeMyReducer(NodeReducer):
@standard_error_handling # Catches ModelOnexError, logs with context
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ except ModelOnexError as e:

**Business Logic Errors** (node operations):
```python
from omnibase_core.decorators.error_handling import standard_error_handling
from omnibase_core.decorators.decorator_error_handling import standard_error_handling

@standard_error_handling
async def execute_reduction(self, input_data: ModelReducerInput):
Expand Down
12 changes: 6 additions & 6 deletions docs/reference/api/utils.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ This document provides comprehensive API reference for utility functions and hel

### standard_error_handling

**Location**: `omnibase_core.decorators.error_handling`
**Location**: `omnibase_core.decorators.decorator_error_handling`

**Purpose**: Decorator that provides standard error handling pattern for ONEX operations.

This decorator eliminates 6+ lines of boilerplate error handling code and ensures consistent error patterns across all nodes.

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

@standard_error_handling(operation_name="data processing")
async def process_data(self, input_data):
Expand All @@ -47,14 +47,14 @@ except Exception as e:

### validation_error_handling

**Location**: `omnibase_core.decorators.error_handling`
**Location**: `omnibase_core.decorators.decorator_error_handling`

**Purpose**: Decorator for validation operations that may throw ValidationError.

Similar to `standard_error_handling` but specifically designed for validation operations.

```
from omnibase_core.decorators.error_handling import validation_error_handling
from omnibase_core.decorators.decorator_error_handling import validation_error_handling

@validation_error_handling(operation_name="input validation")
def validate_user_input(self, user_data):
Expand Down Expand Up @@ -290,7 +290,7 @@ Provides additional decorators for common patterns in ONEX development.
### Error Handling Pattern

```
from omnibase_core.decorators.error_handling import standard_error_handling
from omnibase_core.decorators.decorator_error_handling import standard_error_handling
from omnibase_core.models.errors.model_onex_error import ModelOnexError
from omnibase_core.enums.enum_core_error_code import EnumCoreErrorCode

Expand Down Expand Up @@ -358,7 +358,7 @@ class MyNode(NodeCoreBase):
3. **YAML Loading**: Use `load_and_validate_yaml_model` for type-safe YAML loading with validation
4. **Import Paths**: The correct import path for `standard_error_handling` is:
```python
from omnibase_core.decorators.error_handling import standard_error_handling
from omnibase_core.decorators.decorator_error_handling import standard_error_handling
```
NOT `from omnibase_core.utils.standard_error_handling`

Expand Down
2 changes: 1 addition & 1 deletion docs/reference/templates/EFFECT_NODE_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ from omnibase_core.enums.enum_effect_types import (
EnumTransactionState,
EnumCircuitBreakerState,
)
from omnibase_core.decorators.error_handling import standard_error_handling
from omnibase_core.decorators.decorator_error_handling import standard_error_handling
from omnibase_core.utils.error_sanitizer import ErrorSanitizer

from .config import {DomainCamelCase}{MicroserviceCamelCase}EffectConfig
Expand Down
6 changes: 3 additions & 3 deletions docs/reference/templates/ORCHESTRATOR_NODE_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ from omnibase_core.models.contracts.subcontracts.model_workflow_definition impor
)
from omnibase_core.models.errors.model_onex_error import ModelOnexError
from omnibase_core.enums.enum_core_error_code import EnumCoreErrorCode
from omnibase_core.decorators.error_handling import standard_error_handling
from omnibase_core.decorators.decorator_error_handling import standard_error_handling
from omnibase_core.utils.error_sanitizer import ErrorSanitizer

from .config import {DomainCamelCase}{MicroserviceCamelCase}OrchestratorConfig
Expand Down Expand Up @@ -1464,7 +1464,7 @@ dependencies:
- "models.orchestrator.model_orchestrator_input"
- "models.orchestrator.model_orchestrator_output"
- "enums.enum_workflow_execution"
- "decorators.error_handling"
- "decorators.decorator_error_handling"
- "errors.model_onex_error"

# Interface contracts
Expand Down Expand Up @@ -1606,7 +1606,7 @@ from omnibase_core.nodes import (
from omnibase_core.models.container.model_onex_container import ModelONEXContainer

# Error handling
from omnibase_core.decorators.error_handling import standard_error_handling
from omnibase_core.decorators.decorator_error_handling import standard_error_handling
from omnibase_core.models.errors.model_onex_error import ModelOnexError
from omnibase_core.enums.enum_core_error_code import EnumCoreErrorCode
```
Expand Down
2 changes: 1 addition & 1 deletion docs/release/V040_RELEASE_CHECKLIST.md
Original file line number Diff line number Diff line change
Expand Up @@ -1198,7 +1198,7 @@ sys.exit(0) # Explicit success exit
```bash
# Generate error object snapshot with all observability fields
poetry run python -c "
from omnibase_core.errors.declarative_errors import NodeExecutionError
from omnibase_core.errors.error_declarative import NodeExecutionError
import json

# Create error with all observability fields
Expand Down
2 changes: 1 addition & 1 deletion src/omnibase_core/backends/cache/backend_cache_redis.py
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ def __init__(
self._default_ttl = default_ttl
self._max_connections = max_connections
self._pool: ConnectionPoolType | None = None
self._client: Redis[str] | None = None
self._client: Redis | None = None
self._connected = False

@property
Expand Down
8 changes: 4 additions & 4 deletions src/omnibase_core/decorators/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@
Provides decorators to mark legitimate exceptions to ONEX strict typing standards.
"""

from .allow_dict_any import allow_dict_any
from .convert_to_schema import (
from .decorator_allow_dict_any import allow_dict_any
from .decorator_convert_to_schema import (
convert_dict_to_schema,
convert_list_to_schema,
convert_to_schema,
)
from .decorator_enforce_execution_shape import enforce_execution_shape
from .error_handling import (
from .decorator_error_handling import (
io_error_handling,
standard_error_handling,
validation_error_handling,
)
from .pattern_exclusions import (
from .decorator_pattern_exclusions import (
allow_any_type,
allow_legacy_pattern,
allow_mixed_types,
Expand Down
26 changes: 13 additions & 13 deletions src/omnibase_core/errors/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,30 @@
# These symbols are re-exported via __all__ and resolved at runtime
# through __getattr__ to avoid circular import dependencies.
if TYPE_CHECKING:
from omnibase_core.errors.declarative_errors import (
from omnibase_core.errors.error_callable_not_found import CallableNotFoundError
from omnibase_core.errors.error_declarative import (
AdapterBindingError,
NodeExecutionError,
PurityViolationError,
UnsupportedCapabilityError,
)
from omnibase_core.errors.error_callable_not_found import CallableNotFoundError
from omnibase_core.errors.error_dependency_cycle import DependencyCycleError
from omnibase_core.errors.error_duplicate_hook import DuplicateHookError
from omnibase_core.errors.error_hook_registry_frozen import HookRegistryFrozenError
from omnibase_core.errors.error_hook_timeout import HookTimeoutError
from omnibase_core.errors.error_hook_type_mismatch import HookTypeMismatchError
from omnibase_core.errors.error_pipeline import PipelineError
from omnibase_core.errors.error_unknown_dependency import UnknownDependencyError
from omnibase_core.errors.exception_compute_pipeline_error import (
ComputePipelineError,
)
from omnibase_core.errors.runtime_errors import (
from omnibase_core.errors.error_runtime import (
ContractValidationError,
EventBusError,
HandlerExecutionError,
InvalidOperationError,
RuntimeHostError,
)
from omnibase_core.errors.error_unknown_dependency import UnknownDependencyError
from omnibase_core.errors.exception_compute_pipeline_error import (
ComputePipelineError,
)
from omnibase_core.models.common.model_onex_warning import ModelOnexWarning
from omnibase_core.models.common.model_registry_error import ModelRegistryError
from omnibase_core.models.core.model_cli_adapter import ModelCLIAdapter
Expand Down Expand Up @@ -123,8 +123,8 @@
# - ModelOnexError, OnexError (alias) - from models.errors
# - ModelOnexWarning, ModelRegistryError - from models.common
# - ModelCLIAdapter - from models.core
# - RuntimeHostError, HandlerExecutionError, etc. - from errors.runtime_errors
# - AdapterBindingError, PurityViolationError, etc. - from errors.declarative_errors
# - RuntimeHostError, HandlerExecutionError, etc. - from errors.error_runtime
# - AdapterBindingError, PurityViolationError, etc. - from errors.error_declarative
# - PipelineError, CallableNotFoundError, etc. - from errors.error_* modules
# =============================================================================
def __getattr__(name: str) -> Any:
Expand Down Expand Up @@ -177,9 +177,9 @@ def __getattr__(name: str) -> Any:
"ContractValidationError",
}
if name in _runtime_error_classes:
from omnibase_core.errors import runtime_errors
from omnibase_core.errors import error_runtime

return getattr(runtime_errors, name)
return getattr(error_runtime, name)

# Compute pipeline errors
if name == "ComputePipelineError":
Expand All @@ -204,9 +204,9 @@ def __getattr__(name: str) -> Any:
"UnsupportedCapabilityError",
}
if name in _declarative_error_classes:
from omnibase_core.errors import declarative_errors
from omnibase_core.errors import error_declarative

return getattr(declarative_errors, name)
return getattr(error_declarative, name)

# -------------------------------------------------------------------------
# Pipeline errors - consolidated import from individual modules
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
- Structured fields for logging and observability

Usage:
from omnibase_core.errors.declarative_errors import (
from omnibase_core.errors.error_declarative import (
AdapterBindingError,
PurityViolationError,
NodeExecutionError,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
- No circular dependencies

Usage:
from omnibase_core.errors.runtime_errors import (
from omnibase_core.errors.error_runtime import (
RuntimeHostError,
HandlerExecutionError,
EventBusError,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

from omnibase_core.enums.enum_core_error_code import EnumCoreErrorCode
from omnibase_core.enums.enum_onex_status import EnumOnexStatus
from omnibase_core.errors.runtime_errors import RuntimeHostError
from omnibase_core.errors.error_runtime import RuntimeHostError


class AdapterBindingError(RuntimeHostError):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

from omnibase_core.enums.enum_core_error_code import EnumCoreErrorCode
from omnibase_core.enums.enum_onex_status import EnumOnexStatus
from omnibase_core.errors.runtime_errors import RuntimeHostError
from omnibase_core.errors.error_runtime import RuntimeHostError


class NodeExecutionError(RuntimeHostError):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

from omnibase_core.enums.enum_core_error_code import EnumCoreErrorCode
from omnibase_core.enums.enum_onex_status import EnumOnexStatus
from omnibase_core.errors.runtime_errors import RuntimeHostError
from omnibase_core.errors.error_runtime import RuntimeHostError


class PurityViolationError(RuntimeHostError):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

from omnibase_core.enums.enum_core_error_code import EnumCoreErrorCode
from omnibase_core.enums.enum_onex_status import EnumOnexStatus
from omnibase_core.errors.runtime_errors import RuntimeHostError
from omnibase_core.errors.error_runtime import RuntimeHostError


class UnsupportedCapabilityError(RuntimeHostError):
Expand Down
2 changes: 1 addition & 1 deletion src/omnibase_core/mixins/mixin_caching.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def __init__(self, container):
import time
from typing import TYPE_CHECKING, Any

from omnibase_core.decorators.allow_dict_any import allow_dict_any
from omnibase_core.decorators.decorator_allow_dict_any import allow_dict_any
from omnibase_core.enums import EnumCoreErrorCode
from omnibase_core.models.errors.model_onex_error import ModelOnexError
from omnibase_core.types.typed_dict_mixin_types import TypedDictCacheStats
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@

from pydantic import BaseModel, ConfigDict, Field, model_validator

from omnibase_core.decorators.allow_dict_any import allow_dict_any
from omnibase_core.decorators.decorator_allow_dict_any import allow_dict_any
from omnibase_core.types.type_json import JsonType

# =============================================================================
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@

from typing import TYPE_CHECKING, TypeVar, cast

from omnibase_core.decorators.allow_dict_any import allow_dict_any
from omnibase_core.decorators.decorator_allow_dict_any import allow_dict_any
from omnibase_core.models.errors.model_onex_error import ModelOnexError
from omnibase_core.types.type_serializable_value import (
SerializableValue,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@

from pydantic import BaseModel, ConfigDict, Field, field_validator

from omnibase_core.decorators.allow_dict_any import allow_dict_any
from omnibase_core.decorators.decorator_allow_dict_any import allow_dict_any

__all__ = ["ModelEffectTemplateContext"]

Expand Down
2 changes: 1 addition & 1 deletion src/omnibase_core/models/effect/model_effect_input.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
from pydantic import BaseModel, Field, model_validator

from omnibase_core.constants import TIMEOUT_DEFAULT_MS
from omnibase_core.decorators.allow_dict_any import allow_dict_any
from omnibase_core.decorators.decorator_allow_dict_any import allow_dict_any
from omnibase_core.enums.enum_effect_types import EnumEffectType
from omnibase_core.models.context import ModelEffectInputData
from omnibase_core.models.effect.model_effect_metadata import ModelEffectMetadata
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@

from pydantic import BaseModel, ConfigDict

from omnibase_core.decorators.allow_dict_any import allow_dict_any
from omnibase_core.decorators.decorator_allow_dict_any import allow_dict_any


class ModelRegistrationRecordBase(BaseModel):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
EFFECT_OPERATION_DESCRIPTION_MAX_LENGTH,
EFFECT_OPERATION_NAME_MAX_LENGTH,
)
from omnibase_core.decorators.allow_dict_any import allow_dict_any
from omnibase_core.decorators.decorator_allow_dict_any import allow_dict_any
from omnibase_core.models.contracts.subcontracts.model_effect_circuit_breaker import (
ModelEffectCircuitBreaker,
)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from pydantic import BaseModel, Field

from omnibase_core.decorators.error_handling import standard_error_handling
from omnibase_core.decorators.decorator_error_handling import standard_error_handling
from omnibase_core.enums.enum_core_error_code import EnumCoreErrorCode
from omnibase_core.models.errors.model_onex_error import ModelOnexError
from omnibase_core.models.operations.model_operation_parameters_base import (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

from pydantic import BaseModel, ConfigDict, Field, field_validator, model_validator

from omnibase_core.decorators.error_handling import standard_error_handling
from omnibase_core.decorators.decorator_error_handling import standard_error_handling
from omnibase_core.enums.enum_core_error_code import EnumCoreErrorCode
from omnibase_core.enums.enum_log_level import EnumLogLevel as LogLevel
from omnibase_core.enums.enum_service_mode import EnumServiceMode
Expand Down
Loading