Repository navigation
Validate compute task parameters against their schema - #407
Draft
amirabbas-jalali-bentley wants to merge 2 commits into
Draft
amirabbas-jalali-bentley wants to merge 2 commits into
amirabbas-jalali-bentley wants to merge 2 commits into
Conversation
Add ParameterValidationError and schema-driven validation before ComputeClient submits a job. Shallow validation checks required-field presence and nullability by default; opt-in deep validation checks JSON Schema Draft 2020-12 constraints with path-prefixed messages and discriminated union diagnostics. Also adds unknown_annotation_keys() and conformance tests for the closed schema-annotation vocabulary the engine interprets.
This was referenced Nov 14, 2026
amirabbas-jalali-bentley
changed the base branch from
main
to
add-generic-compute-engine
November 16, 2026 20:11
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
ComputeClient(#395) binds top-level keyword arguments from a task's discovery schema before submitting a job. This adds schema-driven parameter validation so invalid payloads fail locally with clear, path-prefixed messages instead of reaching the service.Changes
ParameterValidationError(ValueError)(exported fromevo.compute), carrying.task(topic.task) and.errors(one message per validation failure). Signature-binding errors fromComputeClientnow raiseParameterValidationErrortoo.evo.compute.validation.validate_parameters:validate=True, on by default): checks that every required field is present on the wire payload and is notNoneunless the property's schema permitsnull(including nullable unions and$reftargets).deep_validation=False, opt-in onComputeClientor peraruncall): validates the payload against JSON Schema Draft 2020-12 ($ref/$defs, scalar/container types, bounds, enums, and discriminated unions).validate=Falseacts as the master switch overdeep_validation.oneOf/anyOfcarriesdiscriminator.propertyName, reports the selected branch's specific field errors (or the allowed discriminator values when no branch matches) instead of a generic union error.reference_tokeep scalar carrier types (such as URL strings) while relaxing object/array resolved shapes ahead of the reference-resolution layer.KNOWN_SCHEMA_ANNOTATIONSandunknown_annotation_keys(schema)to guard the closed schema-annotation vocabulary the engine interprets.No breaking changes to existing task runners.
ComputeClientparameter binding errors now raiseParameterValidationError(aValueErrorsubclass).Testing
test_validation.pycover shallow required/nullability checks, deep Draft 2020-12 validation,$refresolution, reference-leaf relaxation, discriminated union diagnostics, and client/per-call toggle combinations.test_schema_conformance.pyverify the closed annotation vocabulary against bundled fixtures (plus an opt-in live discovery check).evo-computetests: 590 passed, 1 skipped (49 new).ruff check,ruff format --check,uv lock --check, and pre-commit hooks pass.Checklist