fix(config): wire dead validate() functions and fix migrate idempotency guards#6058
Merged
Merged
Conversation
…cy guards Config::validate() now calls 7 subsystem validate() functions that had real invariant checks but were unreachable from the production config-load path, most severely validate_pool() which two code comments elsewhere treat as a load-bearing guarantee against an empty [[llm.providers]] list. Config::default() now seeds one provider so --dump-config-defaults and the no-config-file TUI-remote fallback stay self-consistent with the newly enforced invariant. Also fixes two --migrate-config --in-place steps that re-appended their advisory block on every run instead of converging after one, same defect class as #5945: the mcp steps anchored on a raw substring that matched inside a commented catch-all stub, and the memory query-bias step guarded on the wrong (uncommented) form of its own commented output. Closes #5932 Closes #6018
This was referenced Jul 11, 2026
Closed
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.
Summary
Config::validate()now calls 7 subsystemvalidate()functions that had real invariant checks but were unreachable from the production config-load path (src/bootstrap/mod.rs,src/tui_remote.rs,src/commands/doctor.rs) — only their own unit tests exercised them.validate_pool()was the most severe gap: two code comments elsewhere state, verbatim, that it "rejects an empty[[llm.providers]]list at config-validation time" and treat that as a load-bearing guarantee, but it was never actually invoked outside its own test module. The other six:LlmConfig::validate_stt(),TrajectorySentinelConfig::validate(),GatewayConfig::validate(),UtilityScoringConfig::validate(),FidelityConfig::validate(),AconConfig::validate(). Also added#[must_use]tovalidate_stt().validate_pool()required seedingConfig::default()with oneProviderEntry::default()so--dump-config-defaultsand the no-config-filezeph --tui --connectfallback stay self-consistent with the newly enforced invariant, matching the shippedconfig/default.tomlreference (which already ships an active provider).--migrate-config --in-placesteps that re-appended their advisory block on every run instead of converging after one, same defect class as migrate-config: duplicate advisory blocks + silent false-success no-op for orchestration keys #5945: themcp/mcp.elicitation/mcp max-connect-attempts/retry-and-tool-timeout steps anchored on a raw substring that also matched inside a commented catch-all stub (now gated bysection_header_present), andmigrate_memory_retrieval_query_bias's guard checked the wrong (uncommented) form of its own commented output.Closes #5932
Closes #6018
Test plan
cargo nextest run -p zeph-config: 735/735 passedcargo nextest run --workspace --features "desktop,ide,server,chat,pdf,scheduler" --lib --bins: 12858/12858 passed, 35 skippedcargo nextest run --test daemon_boot --features a2a: 2/2 passed (a2a-gated integration test, confirmsConfig::default()change doesn't regress daemon boot)cargo test --doc --workspace --features "desktop,ide,server,chat,pdf,scheduler": all passedcargo +nightly fmt --check: cleancargo clippy --profile ci --workspace --all-targets --features "desktop,ide,server,chat,pdf,scheduler,testing" -- -D warnings: cleanRUSTFLAGS="-D warnings" RUSTDOCFLAGS="--deny rustdoc::broken_intra_doc_links" cargo doc --no-deps --workspace --features "desktop,ide,server,chat,pdf,scheduler": clean--migrate-config --in-placeverification against a built binary