Skip to content

test(core): pin privacy::load_config, EngineSettings::load and with_env_overrides - #1808

Merged
ajianaz merged 1 commit into
developfrom
test/engine-settings-and-privacy-load-1766
Nov 26, 2026
Merged

ajianaz merged 1 commit into
developfrom
test/engine-settings-and-privacy-load-1766

Conversation

@ajianaz

@ajianaz ajianaz commented Nov 26, 2026 •

Copy link
Copy Markdown
Collaborator

What

Killing tests for three mutants the v0.24.0 mutation gate reported late and left open in #1766: privacy::load_config, EngineSettings::load and EngineSettings::with_env_overrides, each replaced by Default::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.toml files, so a body returning the default passed every test.

How

Three tests in mutation_gap_tests.rs, in the style of the existing store_settings_load_reads_the_global_file: UTEKE_HOME points at a temp directory, the tests run #[serial], and a small EnvRestore guard puts every variable back also when an assertion fails.

  • load_config: [privacy] mode and allowlist come from the file (strict, one regex that matches KEEP-42 and not DROP-42); UTEKE_PRIVACY_MODE=off wins over the file and the file's allowlist stays.
  • EngineSettings::load: [recall] min_score and [embed_fallback] come from the file; UTEKE_RECALL_MIN_SCORE and UTEKE_EMBED_FALLBACK_MODEL win; 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 --workspace passes
  • cargo fmt --all -- --check passes
  • cargo clippy --workspace --all-targets -- -D warnings passes
  • Cora review run locally (cora review --base origin/develop)
  • Manual smoke-test of the affected feature

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 plus with_env_overrides_from), 4 caught, 0 missed, 0 timeouts.

Related Issues

Refs #1766 (does not close it).

Checklist

  • Branch name follows convention (fix/, feat/, docs/, chore/, refactor/, test/, perf/, security/)
  • Branch is from develop
  • Commit messages follow Conventional Commits
  • No secrets or credentials committed
  • One logical change per PR (no mixed concerns)

…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.
@github-actions

Copy link
Copy Markdown

🔍 Cora AI Code Review

✅ No issues found. Code looks good!


Review powered by cora-code · BYOK · MIT

@ajianaz
ajianaz merged commit 8cfd50e into develop Nov 26, 2026
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant