Skip to content

phase 4: configuration discovery with first-match-wins precedence#3

Merged
macaris64 merged 2 commits intomainfrom
phase-4-config-discovery
Apr 18, 2026
Merged

phase 4: configuration discovery with first-match-wins precedence#3
macaris64 merged 2 commits intomainfrom
phase-4-config-discovery

Conversation

@macaris64
Copy link
Copy Markdown
Owner

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.

macaris64 and others added 2 commits April 18, 2026 14:53
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>
@macaris64 macaris64 merged commit 029d87e into main Apr 18, 2026
4 checks passed
@macaris64 macaris64 deleted the phase-4-config-discovery branch April 18, 2026 21:34
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