phase 4: configuration discovery with first-match-wins precedence#3
Merged
phase 4: configuration discovery with first-match-wins precedence#3
Conversation
Implements LOGICSHELL_OPERATIONS.md §Configuration discovery: 1. LOGICSHELL_CONFIG env var (absolute path required) 2. Walk-up from cwd for .logicshell.toml 3. XDG $XDG_CONFIG_HOME/logicshell/config.toml 4. XDG legacy .logicshell.toml (config.toml wins in same dir) 5. Built-in defaults when no file is found Exposes discover() and find_config_path() from crate root. Inner find_path_impl / find_and_load accept explicit env values so tests are fully deterministic without touching process env. 18 new tests covering all precedence rules; 107/107 pass. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
discover() and find_config_path() were never called directly in tests — only the inner find_and_load/find_path_impl were exercised, leaving the env-reading lines uncovered (86.54% vs the 90% gate). Two new tests call the public surface via walk-up (which fires before any env-based path) and guard the strong assertions behind an LOGICSHELL_CONFIG check so they stay correct even when that env var is set externally. Coverage: 86.54% → 100.00% (104/104 lines). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.
Implements LOGICSHELL_OPERATIONS.md §Configuration discovery:
Exposes discover() and find_config_path() from crate root. Inner find_path_impl / find_and_load accept explicit env values so tests are fully deterministic without touching process env. 18 new tests covering all precedence rules; 107/107 pass.