Repository navigation
test(core): pin privacy::load_config, EngineSettings::load and with_env_overrides - #1808
Merged
Merged
Conversation
…nv_overrides (#1766) The v0.24.0 mutation gate reported these three as missed late: a body that returned Default::default() passed every test, because they read the process environment and the layered uteke.toml files. Each test points UTEKE_HOME at a temp directory, runs serialized and restores the variables it touched, also when an assertion fails. - load_config: [privacy] mode and allowlist come from the file, and UTEKE_PRIVACY_MODE wins over the file. - EngineSettings::load: [recall] and [embed_fallback] come from the file, the environment wins, and a key it does not set keeps the file value. - EngineSettings::with_env_overrides: applies the real environment and keeps the rest of the value it is called on.
🔍 Cora AI Code Review✅ No issues found. Code looks good! Review powered by cora-code · BYOK · MIT |
7 tasks
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.
What
Killing tests for three mutants the v0.24.0 mutation gate reported late and left open in #1766:
privacy::load_config,EngineSettings::loadandEngineSettings::with_env_overrides, each replaced byDefault::default().Why
Part of #1766 (it stays open: the items that need the embedding model and the rest of the full gate run are not touched here). These three read the process environment and the layered
uteke.tomlfiles, so a body returning the default passed every test.How
Three tests in
mutation_gap_tests.rs, in the style of the existingstore_settings_load_reads_the_global_file:UTEKE_HOMEpoints at a temp directory, the tests run#[serial], and a smallEnvRestoreguard puts every variable back also when an assertion fails.load_config:[privacy] modeandallowlistcome from the file (strict, one regex that matchesKEEP-42and notDROP-42);UTEKE_PRIVACY_MODE=offwins over the file and the file's allowlist stays.EngineSettings::load:[recall] min_scoreand[embed_fallback]come from the file;UTEKE_RECALL_MIN_SCOREandUTEKE_EMBED_FALLBACK_MODELwin; a key the environment does not set keeps the file value.EngineSettings::with_env_overrides: applies the real environment and keeps the value it is called on.Testing
cargo test --workspacepassescargo fmt --all -- --checkpassescargo clippy --workspace --all-targets -- -D warningspassescora review --base origin/develop)Mutation gate on exactly these functions (owner rule 2026-08-19),
cargo mutants -p uteke-core -F 'load_config|EngineSettings::load|with_env_overrides' -- --lib: 4 mutants (those three pluswith_env_overrides_from), 4 caught, 0 missed, 0 timeouts.Related Issues
Refs #1766 (does not close it).
Checklist
fix/,feat/,docs/,chore/,refactor/,test/,perf/,security/)develop