Separate raw and validated spec config loading#156
Merged
aidankhogg merged 2 commits intoJun 29, 2026
Merged
Conversation
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.
Motivation
NetEngineSpecobject.Description
SpecConfig.load_rawandSpecConfig.load_environment_variants_rawand keptSpecConfig.load/SpecConfig.load_environment_variantsas backwards-compatible aliases that return raw dictionaries.SpecConfig.load_validatedandSpecConfig.load_environment_variant_validatedthat compose raw dicts then delegate to the centralizedvalidate_spec_datafunction to return aNetEngineSpec.validate_spec_data(data, ...)innetengine/spec/loader.pyand refactoredload_spec,load_spec_with_composition, andload_spec_with_environmentto call it, eliminating duplicated validation code and resolving circular import issues viaTYPE_CHECKINGand local imports.tests/test_config.pyto assert that raw methods returndict, validated methods returnNetEngineSpec, and that invalid composed specs are rejected.Testing
pytest -q tests/test_config.pyand the config tests passed (all new and existing config tests passed).blackandisorton modified files and compiled the changed modules successfully.pytest -qwhich revealed 2 unrelated integration failures (2 failed, 536 passed, 10 skipped) not introduced by this change; these are noted as unrelated to the config API refactor.mypywhich surfaced pre-existing typing issues in other modules (not introduced by this change).Codex Task