Repository navigation
feat(models): add ModelContractPatch and patch validation system (OMN-1126) #289
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
jonahgabriel
merged 53 commits into
main
from
jonah/omn-1126-modelcontractpatch-patch-validation
Jan 3, 2026
Merged
Changes from all commits
Commits
Show all changes
53 commits
Select commit
Hold shift + click to select a range
c846c50
feat(models): add ModelContractPatch and patch validation system (OMN…
jonahgabriel d53ca60
feat(contracts): enhance patch validation and add helper methods (OMN…
jonahgabriel 6e56442
refactor(models): rename ModelHandlerDescriptor to ModelHandlerBehavi…
jonahgabriel db991d5
chore(validation): add ContractPatchValidator to naming exemptions (O…
jonahgabriel 59244d5
fix(contracts): address PR review feedback for patch validation (OMN-…
jonahgabriel 4faceda
fix(contracts): address PR #289 review feedback (OMN-1126)
jonahgabriel dadf401
Merge branch 'main' into jonah/omn-1126-modelcontractpatch-patch-vali…
jonahgabriel 25757cd
feat(manifest): add execution manifest generation for pipeline observ…
b97c19a
fix(contracts): fix CI failure and address remaining PR #289 feedback…
jonahgabriel 69f6403
fix(mixins): remove backwards compatibility and extract ProtocolFromE…
4a7c9f2
fix(contracts): address all PR #289 feedback for release readiness (O…
jonahgabriel 15a4d51
fix(manifest): address PR review feedback for manifest generation
002a190
fix(manifest): address additional PR review feedback
69320e3
fix(contracts): address final PR #289 nitpicks and polish for release…
jonahgabriel f886793
fix(manifest): address PR review feedback for release readiness
f8ee9e3
fix(contracts): fix CI failures and address remaining PR #289 feedbac…
jonahgabriel 1ec1a7f
fix(manifest): address final PR review items for release readiness
39e97db
Merge branch 'main' into jonah/omn-1113-beta-manifest-generation-obse…
52b728a
fix(contracts): fix CI test failures and final PR #289 polish (OMN-1126)
jonahgabriel 3476b30
fix(manifest): address all PR review feedback and pre-commit violations
1372f98
fix(manifest): address PR review feedback and fix CI mypy errors
5a86ae2
fix(manifest): address PR #294 review feedback
bf7c3e8
feat(models): add ModelProjectorContract and schema models (OMN-1166)
204f3ce
refactor(contracts): DRY up duplicate detection in ContractPatchValid…
jonahgabriel 3de833a
Merge branch 'jonah/omn-1126-modelcontractpatch-patch-validation' int…
jonahgabriel 648bf2b
Merge branch 'jonah/omn-1166-modelprojectorcontract-schema-models' in…
d2ed3f1
Merge branch 'jonah/omn-1113-beta-manifest-generation-observability' …
jonahgabriel 290434c
docs(contracts): add handler contract guide with ID prefix convention
605fd88
fix(manifest): add EnumExecutionStatus classmethods and delegate from…
ea8787b
feat(security): add module allowlist for dynamic import resolution (O…
jonahgabriel 103453a
refactor(contracts): improve code quality and maintainability (OMN-1126)
jonahgabriel 0105041
fix: resolve all pre-commit hook violations
077d146
Merge branch 'main' into jonah/omn-1113-beta-manifest-generation-obse…
bf8ec13
Merge jonah/omn-1113-beta-manifest-generation-observability into OMN-…
jonahgabriel 9e1ddf1
fix: resolve pre-push hook failures from merged branch (OMN-1126)
jonahgabriel 061223c
fix: address all PR #289 review feedback (OMN-1126)
jonahgabriel 46a513d
style: fix ruff formatting in test files (OMN-1126)
jonahgabriel 80aabad
Merge branch 'main' into jonah/omn-1126-modelcontractpatch-patch-vali…
jonahgabriel 1ab7909
fix: skip tests with circular import in ModelProviderDescriptor (OMN-…
jonahgabriel b78e392
fix: resolve CI failures and PR #289 review feedback (OMN-1126)
jonahgabriel 820e870
fix: update import path for ModelToolSecuritySummary (OMN-1126)
jonahgabriel b8af310
docs: improve documentation and add security allowlist for PR #289 fe…
jonahgabriel c4f2cd7
Merge branch 'main' into jonah/omn-1126-modelcontractpatch-patch-vali…
jonahgabriel a157f2b
fix: address PR #289 review feedback - validation, security, and docs…
jonahgabriel 3537fa6
fix: address PR review feedback - scoring docs, logging cleanup, test…
jonahgabriel 4f844bc
Merge branch 'main' into jonah/omn-1126-modelcontractpatch-patch-vali…
jonahgabriel b52e8d3
style: fix end-of-file in schema file
jonahgabriel 604f78a
fix: correct security allowlist test assertions (OMN-1126)
jonahgabriel b33b028
Merge branch 'main' into jonah/omn-1126-modelcontractpatch-patch-vali…
jonahgabriel e343fa0
fix: resolve CI test failures and PR review issues (OMN-1126)
jonahgabriel c0cf00e
Merge remote-tracking branch 'origin/main' into jonah/omn-1126-modelc…
jonahgabriel cfa6b84
fix: address remaining PR #289 review feedback (OMN-1126)
jonahgabriel de99bad
fix: address final PR #289 review feedback (OMN-1126)
jonahgabriel File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
102 changes: 102 additions & 0 deletions
102
src/omnibase_core/enums/enum_patch_validation_error_code.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,102 @@ | ||
| # SPDX-FileCopyrightText: 2025 OmniNode Team <info@omninode.ai> | ||
| # | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
| """Patch validation error codes for contract patch validation. | ||
|
|
||
| These error codes are used by ContractPatchValidator to categorize | ||
| validation issues in contract patches. They provide type-safe | ||
| identification of validation errors and warnings. | ||
|
|
||
| Error Code Categories: | ||
| - List Operations: Duplicate detection within add lists | ||
| - Descriptor/Behavior: Behavior patch consistency issues | ||
| - Identity: Contract identity field issues | ||
| - Profile: Profile reference format issues | ||
| - File I/O: File access and parsing issues | ||
| - Validation: General validation errors | ||
|
|
||
| Related: | ||
| - OMN-1126: ModelContractPatch & Patch Validation | ||
| - ContractPatchValidator: The validator that uses these codes | ||
|
|
||
| .. versionadded:: 0.4.0 | ||
| """ | ||
|
|
||
| from enum import Enum | ||
|
|
||
|
|
||
| class EnumPatchValidationErrorCode(str, Enum): | ||
| """Error codes for contract patch validation. | ||
|
|
||
| These codes categorize the types of issues that can be detected | ||
| during contract patch validation. They are used in validation | ||
| results to provide machine-readable issue identification. | ||
|
|
||
| All error codes follow the CONTRACT_PATCH_* prefix convention for | ||
| consistent categorization and type-safe identification per PR #289. | ||
|
|
||
| Attributes: | ||
| CONTRACT_PATCH_DUPLICATE_LIST_ENTRIES: Duplicate items within an add list | ||
| CONTRACT_PATCH_EMPTY_DESCRIPTOR: Behavior patch with no overrides | ||
| CONTRACT_PATCH_PURITY_IDEMPOTENT_MISMATCH: Conflicting purity/idempotent settings | ||
| CONTRACT_PATCH_NEW_IDENTITY: Informational - new contract identity declared | ||
| CONTRACT_PATCH_NON_STANDARD_PROFILE_NAME: Profile name doesn't follow conventions | ||
| CONTRACT_PATCH_NON_STANDARD_VERSION_FORMAT: Version string format is non-standard | ||
| CONTRACT_PATCH_FILE_NOT_FOUND: File does not exist | ||
| CONTRACT_PATCH_FILE_READ_ERROR: File could not be read | ||
| CONTRACT_PATCH_UNEXPECTED_EXTENSION: File has unexpected extension | ||
| CONTRACT_PATCH_YAML_VALIDATION_ERROR: YAML parsing or validation error | ||
| CONTRACT_PATCH_PYDANTIC_VALIDATION_ERROR: Pydantic model validation error | ||
|
|
||
| Example: | ||
| >>> from omnibase_core.enums import EnumPatchValidationErrorCode | ||
| >>> code = EnumPatchValidationErrorCode.CONTRACT_PATCH_DUPLICATE_LIST_ENTRIES | ||
| >>> result.add_error("Duplicate handler found", code=code.value) | ||
| """ | ||
|
|
||
| # List operation errors | ||
| CONTRACT_PATCH_DUPLICATE_LIST_ENTRIES = "CONTRACT_PATCH_DUPLICATE_LIST_ENTRIES" | ||
| """Duplicate items found within an add list (e.g., handlers__add).""" | ||
|
|
||
| # Descriptor/Behavior errors | ||
| CONTRACT_PATCH_EMPTY_DESCRIPTOR = "CONTRACT_PATCH_EMPTY_DESCRIPTOR" | ||
| """Behavior patch (descriptor field) is present but has no overrides.""" | ||
|
|
||
| CONTRACT_PATCH_PURITY_IDEMPOTENT_MISMATCH = ( | ||
| "CONTRACT_PATCH_PURITY_IDEMPOTENT_MISMATCH" | ||
| ) | ||
| """Conflicting purity='pure' with idempotent=False settings.""" | ||
|
|
||
| # Identity errors | ||
| CONTRACT_PATCH_NEW_IDENTITY = "CONTRACT_PATCH_NEW_IDENTITY" | ||
| """Informational: Patch declares a new contract identity (name + version).""" | ||
|
|
||
| # Profile reference errors | ||
| CONTRACT_PATCH_NON_STANDARD_PROFILE_NAME = ( | ||
| "CONTRACT_PATCH_NON_STANDARD_PROFILE_NAME" | ||
| ) | ||
| """Profile name doesn't follow lowercase_with_underscores convention.""" | ||
|
|
||
| CONTRACT_PATCH_NON_STANDARD_VERSION_FORMAT = ( | ||
| "CONTRACT_PATCH_NON_STANDARD_VERSION_FORMAT" | ||
| ) | ||
| """Version string format is non-standard (expected semver-like).""" | ||
|
|
||
| # File I/O errors | ||
| CONTRACT_PATCH_FILE_NOT_FOUND = "CONTRACT_PATCH_FILE_NOT_FOUND" | ||
| """The specified file does not exist.""" | ||
|
|
||
| CONTRACT_PATCH_FILE_READ_ERROR = "CONTRACT_PATCH_FILE_READ_ERROR" | ||
| """The file could not be read (I/O error).""" | ||
|
|
||
| CONTRACT_PATCH_UNEXPECTED_EXTENSION = "CONTRACT_PATCH_UNEXPECTED_EXTENSION" | ||
| """File has unexpected extension (expected .yaml or .yml).""" | ||
|
|
||
| # Validation errors | ||
| CONTRACT_PATCH_YAML_VALIDATION_ERROR = "CONTRACT_PATCH_YAML_VALIDATION_ERROR" | ||
| """YAML parsing or validation error occurred.""" | ||
|
|
||
| CONTRACT_PATCH_PYDANTIC_VALIDATION_ERROR = ( | ||
| "CONTRACT_PATCH_PYDANTIC_VALIDATION_ERROR" | ||
| ) | ||
| """Pydantic model validation error occurred.""" |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.