Enforce config precedence contract#157
Merged
aidankhogg merged 1 commit 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
Description
netengine/config/loader.pyandnetengine/spec/loader.pydocstrings to state: structured defaults < caller-provided defaults/base spec < environment/spec file < explicit overrides/CLI--set, with deep merges preserving sibling keys.validate_spec_datawrapper innetengine/spec/loader.pyto validate composed raw spec dictionaries while keepingload_specbehavior for single-file validation.load_spec_with_composition,load_spec_with_environment,SpecConfighelpers) to explicitly merge withConfigLoader.merge_configsfollowing the documented precedence.tests/test_config.pycoveringConfigLoader.load_configprecedence,merge_configsnested merging behavior, spec environment composition precedence, and a lightweight CLI path test using_load_spec_for_cliwith--envplus--setto assert CLI overrides win last.Testing
pytest -q tests/test_config.pyand the file-level test suite passed (all tests intests/test_config.pysucceeded).pytest -qwhich executed the project test matrix; the run produced 551 passed, 10 skipped, and 2 failing integration tests.tests/integration/test_e2e_bootstrap.py::TestFullMVPLifecycle::test_full_mvp_lifecycle(received HTTP 401 where 200 expected) andtests/integration/test_m8_operator_api.py::TestHealthRoute::test_health_does_not_leak_last_error_detail(health payload includedlast_error).Codex Task