Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
a094779
chore: complete ONEX validation compliance fixes
jonahgabriel Nov 21, 2025
52d71ee
chore: remove deprecated Pydantic v1 API and add version tracking to …
jonahgabriel Nov 21, 2025
1a9f069
fix: resolve 3 major blockers in Docker models for PR #88 merge readi…
jonahgabriel Nov 21, 2025
eb3844a
fix: resolve PR #86 post-merge issues (Quick Start API, paths, consis…
jonahgabriel Nov 21, 2025
319f818
fix: revert to relative paths in MANIFEST_MODELS.md for CI compatibility
jonahgabriel Nov 21, 2025
c388454
chore: add version field automation strategy and test failure analysis
jonahgabriel Nov 22, 2025
2b4543b
fix: resolve validation errors and async cleanup issues
jonahgabriel Nov 22, 2025
8e2669e
chore: cleanup validation fixtures and update configuration
jonahgabriel Nov 23, 2025
5df4e46
refactor: centralize version field default factory across all models
jonahgabriel Nov 23, 2025
143bec7
fix: resolve all PR #88 review issues - code quality and robustness i…
jonahgabriel Nov 23, 2025
5fef3f4
fix: resolve final PR #88 blockers - repository cleanup and portability
jonahgabriel Nov 23, 2025
798ed98
chore: remove temp migration docs and exclude multi-class files from …
jonahgabriel Nov 23, 2025
282901e
fix: resolve all PR #88 review issues for release readiness
jonahgabriel Nov 23, 2025
cbdc9d3
fix: resolve three failing test splits (8, 14, 18) - update tests for…
jonahgabriel Nov 24, 2025
f15b929
fix: complete PR #88 review - all 22 issues resolved via parallel agents
jonahgabriel Nov 24, 2025
6bcc5e5
feat: remove default_factory from version fields, make versions required
jonahgabriel Nov 24, 2025
33eb678
fix: add missing version argument to ModelGenericMetadata in model_mi…
jonahgabriel Nov 24, 2025
c1b2dcb
fix: update ModelEventType tests to use schema_version instead of ver…
jonahgabriel Nov 24, 2025
1c0b5ff
fix: resolve 459 test regressions from required version fields
jonahgabriel Nov 24, 2025
04c33b7
fix: resolve final 12 AsyncIO test failures in service health/lifecyc…
jonahgabriel Nov 24, 2025
5d06825
fix: add missing version fields to remaining test fixtures
jonahgabriel Nov 24, 2025
4b7ffe3
fix: add missing version fields to workflow execution test fixture
jonahgabriel Nov 24, 2025
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
23 changes: 23 additions & 0 deletions .yaml-validation-allowlist.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# YAML Validation Allowlist
#
# This file defines exceptions to the manual YAML validation detection hook.
# These are legitimate utility functions and files that need to use yaml.safe_load()
# for valid architectural reasons (e.g., parsing before Pydantic validation).

# Files allowed to use yaml.safe_load() (utility modules)
allowed_files:
- "src/omnibase_core/utils/util_safe_yaml_loader.py" # YAML utility functions
- "src/omnibase_core/validation/contracts.py" # Contract validation utilities
- "src/omnibase_core/validation/contract_validator.py" # Contract validator - preprocesses YAML

# Specific filenames that are allowed (matched by basename)
allowed_filenames:
- "util_safe_yaml_loader.py"

# Function names allowed to use yaml.safe_load()
allowed_functions:
- "load_and_validate_yaml_model" # Utility function in contracts.py - uses Pydantic validation
- "validate_model_compliance" # Validator in contract_validator.py - inspects raw YAML
- "validate_contract_yaml" # Contract validator - preprocesses YAML before Pydantic validation
- "load_yaml_content" # Generic YAML loading utility
- "parse_yaml_safely" # Safe YAML parsing utility
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Resolved
29 changes: 14 additions & 15 deletions docs/reference/MANIFEST_MODELS.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ from pathlib import Path
from omnibase_core.models.core.model_mixin_metadata import ModelMixinMetadataCollection

# Load all mixin metadata
collection = ModelMixinMetadataCollection.load_from_yaml(
collection = ModelMixinMetadataCollection.from_yaml(

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 | 🔴 Critical

🧩 Analysis chain

Verify API rename is not a breaking change.

The documentation shows load_from_yaml() renamed to from_yaml() throughout. However, the PR summary states "Breaking changes: None". If load_from_yaml() is a public API method being removed (not just deprecated), this is a breaking change for any external code calling the old method.

Run the following script to verify whether load_from_yaml is still supported (e.g., as a deprecated alias) or if it's completely removed:

If load_from_yaml was completely removed without a deprecation period, update the PR description to reflect this breaking change and consider adding a deprecation alias for backward compatibility.

Also applies to: 68-68, 95-95


🏁 Script executed:

#!/bin/bash
# Check if load_from_yaml still exists as deprecated method or alias
rg -n "def load_from_yaml" --type=py -C3

# Check for any deprecation decorators or warnings
rg -n "@deprecated|warnings.warn.*load_from_yaml" --type=py -C3

Length of output: 1529


I need to verify this further by searching for where from_yaml() is defined and checking if load_from_yaml() exists anywhere in the codebase.


🏁 Script executed:

#!/bin/bash
# Find where from_yaml is defined
echo "=== Searching for from_yaml method definitions ==="
rg -n "def from_yaml" --type=py -B5 -A10

echo ""
echo "=== Searching for any reference to load_from_yaml (including strings, comments, etc) ==="
rg -n "load_from_yaml" --type=py -B2 -A2

echo ""
echo "=== Check ModelMixinMetadataCollection class specifically ==="
rg -n "class ModelMixinMetadataCollection" --type=py -A20

Length of output: 20556


Let me check if load_from_yaml() existed in previous versions by searching git history:


🏁 Script executed:

#!/bin/bash
# Search git log for load_from_yaml to see if it was ever present
echo "=== Git history for load_from_yaml ==="
git log --all -S "def load_from_yaml" --oneline -- "*.py" | head -20

echo ""
echo "=== Check CHANGELOG for breaking changes ==="
if [ -f CHANGELOG.md ]; then
  grep -i "load_from_yaml\|breaking\|rename" CHANGELOG.md | head -20
fi

echo ""
echo "=== Check for __all__ exports in model files ==="
rg -n "__all__" src/omnibase_core/models/core/model_mixin_metadata_collection.py

Length of output: 752


I need to examine the actual commits to understand how load_from_yaml was changed:


🏁 Script executed:

#!/bin/bash
# Show the actual changes in those commits
echo "=== Changes in commit a094779 related to yaml methods ==="
git show a094779 --format="" -- "src/omnibase_core/models/core/model_mixin_metadata_collection.py" 2>/dev/null | head -100

echo ""
echo "=== Changes in commit 77d7963 related to yaml methods ==="
git show 77d7963 --format="" -- "src/omnibase_core/models/core/model_mixin_metadata_collection.py" 2>/dev/null | head -100

echo ""
echo "=== Check if there's a deprecation alias or property ==="
rg -n "load_from_yaml|@deprecated|warnings.warn" --type=py src/omnibase_core/models/core/model_mixin_metadata_collection.py -B3 -A3

echo ""
echo "=== Look for any deprecation decorators in the entire models directory ==="
rg -n "@deprecated\|deprecate\|@property.*load" --type=py src/omnibase_core/models/ | head -20

Length of output: 4318


Let me check which specific files had load_from_yaml removed or renamed:


🏁 Script executed:

#!/bin/bash
# Find all model files that previously had load_from_yaml (from git history)
echo "=== All files that mention load_from_yaml in git history ==="
git log --all -S "load_from_yaml" --name-only --pretty=format: -- "*.py" | sort | uniq

echo ""
echo "=== Check if load_from_yaml appears in tests (to understand the old API) ==="
rg -n "def load_from_yaml|\.load_from_yaml\(" --type=py tests/ | head -30

echo ""
echo "=== Search for from_yaml in tests to see the new API usage ==="
rg -n "\.from_yaml\(" --type=py tests/ | head -20

Length of output: 1854


Let me verify the current state of those two model files to confirm load_from_yaml is completely gone:


🏁 Script executed:

#!/bin/bash
# Check current state of model_mixin_metadata.py
echo "=== Current state of model_mixin_metadata.py ==="
rg -n "def.*from_yaml|def.*load_from_yaml" --type=py src/omnibase_core/models/core/model_mixin_metadata.py -A2

echo ""
echo "=== Current state of model_docker_compose_manifest.py ==="
rg -n "def.*from_yaml|def.*load_from_yaml" --type=py src/omnibase_core/models/docker/model_docker_compose_manifest.py -A2

echo ""
echo "=== Check git blame to see when load_from_yaml was removed from model_mixin_metadata.py ==="
git log --all --source --remotes -S "def load_from_yaml" --oneline -- "src/omnibase_core/models/core/model_mixin_metadata.py" | head -5

echo ""
echo "=== Check git blame for model_docker_compose_manifest.py ==="
git log --all --source --remotes -S "def load_from_yaml" --oneline -- "src/omnibase_core/models/docker/model_docker_compose_manifest.py" | head -5

Length of output: 764


Update PR description to reflect API breaking change.

Verification confirms that load_from_yaml() was renamed to from_yaml() in multiple model classes (e.g., ModelDockerComposeManifest). This is a breaking change for any external code using the old method name. The PR description states "Breaking changes: None," which contradicts this API rename.

Either:

  1. Update the PR description to document this as a breaking change with migration guidance, or
  2. Add a deprecated alias for load_from_yaml() that wraps from_yaml() for backward compatibility.
🤖 Prompt for AI Agents
In docs/reference/MANIFEST_MODELS.md around line 31, the PR claims "Breaking
changes: None" despite renaming load_from_yaml() to from_yaml() in model classes
(e.g., ModelDockerComposeManifest), which is an API-breaking change; either
update the PR description to document this breaking change and add migration
guidance (showing callers to replace load_from_yaml(...) with
Class.from_yaml(...)), or restore backward compatibility by adding a deprecated
load_from_yaml(...) alias method in each renamed model that simply calls and
returns from_yaml(...), emit a deprecation warning in the alias, and add/adjust
tests and changelog entries accordingly.

Path("src/omnibase_core/mixins/mixin_metadata.yaml")
)

Expand Down Expand Up @@ -92,7 +92,7 @@ from omnibase_core.models.docker.model_docker_compose_manifest import (
)

# Load from YAML
manifest = ModelDockerComposeManifest.load_from_yaml(
manifest = ModelDockerComposeManifest.from_yaml(
Path("docker-compose.yaml")
)

Expand Down Expand Up @@ -160,7 +160,7 @@ from omnibase_core.models.docker.model_docker_compose_manifest import (
)

# Load manifest
manifest = ModelDockerComposeManifest.load_from_yaml(
manifest = ModelDockerComposeManifest.from_yaml(
Path("docker-compose.yaml")
)

Expand Down Expand Up @@ -188,7 +188,7 @@ from omnibase_core.models.docker.model_docker_compose_manifest import (
)

# Load existing manifest
manifest = ModelDockerComposeManifest.load_from_yaml(
manifest = ModelDockerComposeManifest.from_yaml(
Path("docker-compose.yaml")
)

Expand All @@ -214,7 +214,7 @@ from omnibase_core.models.core.model_mixin_metadata import (
)

# Load all available mixins
collection = ModelMixinMetadataCollection.load_from_yaml(
collection = ModelMixinMetadataCollection.from_yaml(
Path("src/omnibase_core/mixins/mixin_metadata.yaml")
)

Expand Down Expand Up @@ -257,7 +257,7 @@ class NodeDockerOrchestrator(NodeOrchestrator):
super().__init__(container)

# Load and validate manifest
self.manifest = ModelDockerComposeManifest.load_from_yaml(
self.manifest = ModelDockerComposeManifest.from_yaml(
Path(container.get_config("docker_compose_path"))
)

Expand Down Expand Up @@ -327,7 +327,7 @@ from omnibase_core.models.docker.model_docker_compose_manifest import (
def test_load_and_validate_manifest():
"""Test loading and validating a docker-compose.yaml file."""
# Load test fixture
manifest = ModelDockerComposeManifest.load_from_yaml(
manifest = ModelDockerComposeManifest.from_yaml(
Path("tests/fixtures/docker-compose.yaml")
)

Expand All @@ -346,23 +346,22 @@ def test_load_and_validate_manifest():

## Related Documentation

- [Mixin System Architecture](../architecture/MIXIN_SYSTEM.md) - Complete mixin system documentation
- [Docker Integration Guide](../guides/DOCKER.md) - Using Docker models in ONEX workflows
- [Validation Framework](../guides/VALIDATION.md) - Pydantic validation patterns
- [Configuration Management](../guides/CONFIGURATION.md) - Managing system configuration
- [Mixin System Architecture](../architecture/MIXIN_ARCHITECTURE.md) - Complete mixin system documentation
- [Validation Framework](VALIDATION_FRAMEWORK.md) - Pydantic validation patterns
- [Configuration Management](../patterns/CONFIGURATION_MANAGEMENT.md) - Managing system configuration

## Best Practices

### 1. Always Validate on Load

```python
# ✅ Good: Validate immediately after loading
manifest = ModelDockerComposeManifest.load_from_yaml(path)
manifest = ModelDockerComposeManifest.from_yaml(path)
if warnings := manifest.validate_dependencies():
logger.warning(f"Validation warnings: {warnings}")

# ❌ Bad: Skip validation
manifest = ModelDockerComposeManifest.load_from_yaml(path)
manifest = ModelDockerComposeManifest.from_yaml(path)
# ... use manifest without validation
```

Expand Down Expand Up @@ -413,7 +412,7 @@ manifest.save_to_yaml(Path("docker-compose.yaml"))
```python
# Solution: Check YAML syntax and schema compatibility
try:
manifest = ModelDockerComposeManifest.load_from_yaml(path)
manifest = ModelDockerComposeManifest.from_yaml(path)
except ValidationError as e:
print(f"Validation errors: {e.errors()}")
# Fix YAML structure based on error messages
Expand Down Expand Up @@ -452,4 +451,4 @@ Planned improvements for manifest models:
**See Also**:
- [Architecture Overview](../architecture/ONEX_FOUR_NODE_ARCHITECTURE.md)
- [Error Handling Best Practices](../conventions/ERROR_HANDLING_BEST_PRACTICES.md)
- [Testing Guide](../testing/README.md)
- [Testing Guide](../guides/TESTING_GUIDE.md)
5 changes: 3 additions & 2 deletions scripts/validation/validate-no-backward-compatibility.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,9 +217,10 @@ def _check_backward_compatibility_patterns(
)

# Pattern 3: Configuration allowing extra fields for compatibility
# More specific patterns to avoid false positives with legitimate domain code
extra_allow_patterns = [
r'extra\s*=\s*["\']allow["\'].*compatibility',
r"Config:.*extra.*allow.*compatibility",
r'extra\s*=\s*["\']allow["\']\s*#.*compatibility', # extra='allow' with compatibility comment
r'#.*backward.*compatibility.*extra\s*=\s*["\']allow["\']', # Comment mentioning backward compat + extra='allow'
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Resolved
]

for pattern in extra_allow_patterns:
Expand Down
2 changes: 0 additions & 2 deletions src/omnibase_core/mixins/mixin_cli_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,8 +225,6 @@ def format_output(self, output: OutputStateT, output_format: str) -> str:
# Convert output to dict
if hasattr(output, "model_dump"):
output_dict = output.model_dump()
elif hasattr(output, "dict"):
output_dict = output.dict()
elif isinstance(output, dict):
output_dict = output
else:
Expand Down
16 changes: 0 additions & 16 deletions src/omnibase_core/mixins/mixin_event_listener.py
Original file line number Diff line number Diff line change
Expand Up @@ -725,15 +725,6 @@ def _event_to_input_state(self, event: ModelOnexEvent) -> InputStateT:
{"node_name": self.get_node_name()},
)
return cast(InputStateT, result)
if data is not None and hasattr(data, "dict"):
dict_data = data.dict()
result = input_state_class(**dict_data)
emit_log_event(
LogLevel.DEBUG,
"✅ EVENT_TO_INPUT_STATE: Created input state from dict method",
{"node_name": self.get_node_name()},
)
return cast(InputStateT, result)
result = input_state_class(data=data)
emit_log_event(
LogLevel.DEBUG,
Expand Down Expand Up @@ -941,13 +932,6 @@ def _publish_completion_event(
"✅ PUBLISH_COMPLETION: Added output state via model_dump",
{"node_name": self.get_node_name()},
)
elif hasattr(output_state, "dict"):
completion_data["result"] = output_state.dict()
emit_log_event(
LogLevel.DEBUG,
"✅ PUBLISH_COMPLETION: Added output state via dict method",
{"node_name": self.get_node_name()},
)
else:
completion_data["result"] = str(output_state)
emit_log_event(
Expand Down
4 changes: 0 additions & 4 deletions src/omnibase_core/mixins/mixin_node_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -494,10 +494,6 @@ def _serialize_result(self, result: Any) -> dict[str, Any]:
# Pydantic v2 model - use mode='json' for JSON-serializable output
serialized: dict[str, Any] = result.model_dump(mode="json")
return serialized
if hasattr(result, "dict"):
# Pydantic v1 model (fallback)
result_dict: dict[str, Any] = result.dict()
return result_dict
if hasattr(result, "__dict__"):
# Regular object
obj_dict: dict[str, Any] = result.__dict__
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
from pydantic import BaseModel, Field

from omnibase_core.models.core.model_action_config_value import ModelActionConfigValue
from omnibase_core.models.primitives.model_semver import ModelSemVer


class ModelActionConfigParameter(BaseModel):
Expand All @@ -22,6 +23,12 @@ class ModelActionConfigParameter(BaseModel):
and type safety for FSM transition actions.
"""

# Model version for instance tracking
version: ModelSemVer = Field(
default_factory=lambda: ModelSemVer(major=1, minor=0, patch=0),
description="Model version",
)
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Resolved

parameter_name: str = Field(
...,
description="Name of the configuration parameter",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@

from pydantic import BaseModel

from omnibase_core.models.primitives.model_semver import ModelSemVer

from .model_aggregation_parameter import ModelAggregationParameter


Expand All @@ -24,6 +26,12 @@ class ModelAggregationFunction(BaseModel):
and computational requirements for data processing.
"""

# Model version for instance tracking
version: ModelSemVer = Field(
default_factory=lambda: ModelSemVer(major=1, minor=0, patch=0),
description="Model version",
)

function_name: str = Field(
default=...,
description="Name of the aggregation function",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

from omnibase_core.enums.enum_parameter_type import EnumParameterType
from omnibase_core.models.common.model_schema_value import ModelSchemaValue
from omnibase_core.models.primitives.model_semver import ModelSemVer


class ModelAggregationParameter(BaseModel):
Expand All @@ -21,6 +22,12 @@ class ModelAggregationParameter(BaseModel):
ensuring type safety and runtime validation.
"""

# Model version for instance tracking
version: ModelSemVer = Field(
default_factory=lambda: ModelSemVer(major=1, minor=0, patch=0),
description="Model version",
)
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Resolved

parameter_name: str = Field(
...,
description="Name of the aggregation parameter",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@

from pydantic import BaseModel

from omnibase_core.models.primitives.model_semver import ModelSemVer


class ModelAggregationPerformance(BaseModel):
"""
Expand All @@ -22,6 +24,12 @@ class ModelAggregationPerformance(BaseModel):
and resource management for aggregation operations.
"""

# Model version for instance tracking
version: ModelSemVer = Field(
default_factory=lambda: ModelSemVer(major=1, minor=0, patch=0),
description="Model version",
)

parallel_aggregation: bool = Field(
default=True,
description="Enable parallel aggregation processing",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,12 @@ class ModelAggregationSubcontract(BaseModel):
# Interface version for code generation stability
INTERFACE_VERSION: ClassVar[ModelSemVer] = ModelSemVer(major=1, minor=0, patch=0)

# Model version for instance tracking
version: ModelSemVer = Field(
default_factory=lambda: ModelSemVer(major=1, minor=0, patch=0),
description="Model version",
)

# Core aggregation configuration
aggregation_enabled: bool = Field(
default=True,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@

from pydantic import BaseModel, Field

from omnibase_core.models.primitives.model_semver import ModelSemVer


class ModelBaseHeaderTransformation(BaseModel):
"""
Expand All @@ -25,6 +27,12 @@ class ModelBaseHeaderTransformation(BaseModel):
- any additional unique fields
"""

# Model version for instance tracking
version: ModelSemVer = Field(
default_factory=lambda: ModelSemVer(major=1, minor=0, patch=0),
description="Model version",
)

transformation_rule: str = Field(
...,
description="Transformation rule or template for the value",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

from pydantic import BaseModel

from omnibase_core.models.primitives.model_semver import ModelSemVer


class ModelCacheDistribution(BaseModel):
"""
Expand All @@ -17,6 +19,12 @@ class ModelCacheDistribution(BaseModel):
synchronization, and consistency policies.
"""

# Model version for instance tracking
version: ModelSemVer = Field(
default_factory=lambda: ModelSemVer(major=1, minor=0, patch=0),
description="Model version",
)

distributed_enabled: bool = Field(
default=False,
description="Enable distributed caching",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@

from pydantic import BaseModel

from omnibase_core.models.primitives.model_semver import ModelSemVer


class ModelCacheInvalidation(BaseModel):
"""
Expand All @@ -19,6 +21,12 @@ class ModelCacheInvalidation(BaseModel):
triggers, and cleanup policies.
"""

# Model version for instance tracking
version: ModelSemVer = Field(
default_factory=lambda: ModelSemVer(major=1, minor=0, patch=0),
description="Model version",
)

invalidation_strategy: str = Field(
default=...,
description="Strategy for cache invalidation",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

from pydantic import BaseModel

from omnibase_core.models.primitives.model_semver import ModelSemVer


class ModelCacheKeyStrategy(BaseModel):
"""
Expand All @@ -17,6 +19,12 @@ class ModelCacheKeyStrategy(BaseModel):
including namespacing, hashing, and versioning.
"""

# Model version for instance tracking
version: ModelSemVer = Field(
default_factory=lambda: ModelSemVer(major=1, minor=0, patch=0),
description="Model version",
)

key_generation_method: str = Field(
default=...,
description="Method for generating cache keys",
Expand Down
Loading