#21 — Feature: XDG config path resolution with CWD fallback
What to build
Wire the path resolver into the CLI layer so that running librofm-downloader with no flags finds config/secrets/history via XDG→CWD search. Change run() default parameters for config_path, secrets_path, and history_path from CWD strings ("config.yaml" etc.) to None (meaning "search"). When config is missing everywhere: always print a visible message like "config.yaml not found in <paths>. Using built-in defaults." — not silenced, not verbose-only. When secrets are missing everywhere: print fatal error listing all searched paths and exit 1.
Apply the same XDG→CWD resolution to the history file default. Explicit --config, --secrets, and --history CLI flags must bypass search entirely and use the provided path as-is (backward compatibility). In --verbose mode, print which path was resolved for each file.
Acceptance criteria
run() with no path args → searches XDG then CWD for all three files
## Parent
#21 — Feature: XDG config path resolution with CWD fallback
## What to build
Wire the path resolver into the CLI layer so that running `librofm-downloader` with no flags finds config/secrets/history via XDG→CWD search. Change `run()` default parameters for `config_path`, `secrets_path`, and `history_path` from CWD strings (`"config.yaml"` etc.) to `None` (meaning "search"). When config is missing everywhere: always print a visible message like `"config.yaml not found in <paths>. Using built-in defaults."` — not silenced, not verbose-only. When secrets are missing everywhere: print fatal error listing all searched paths and exit 1.
Apply the same XDG→CWD resolution to the history file default. Explicit `--config`, `--secrets`, and `--history` CLI flags must bypass search entirely and use the provided path as-is (backward compatibility). In `--verbose` mode, print which path was resolved for each file.
## Acceptance criteria
- [ ] `run()` with no path args → searches XDG then CWD for all three files
- [ ] Missing config → prints "using built-in defaults" message (always visible), continues execution
- [ ] Missing secrets → prints error listing searched paths, exits 1 (no traceback)
- [ ] History file defaults to `~/.config/librofm-downloader/download_history.json`
- [ ] Explicit `--config ./foo.yaml` skips search, uses exact path
- [ ] `--verbose` shows resolved paths for config, secrets, and history
- [ ] Running from empty home dir (no XDG, no CWD files) → clean secrets error, no Python traceback
- [ ] Running with only secrets in XDG → works, uses all defaults, downloads succeed
- [ ] All existing CLI tests pass unchanged
- [ ] New tests: invoke `run()` with various filesystem layouts, capture console output, verify correct messages and exit codes
## Blocked by
#22 — Slice 1: Path resolution engine & config loading
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Parent
#21 — Feature: XDG config path resolution with CWD fallback
What to build
Wire the path resolver into the CLI layer so that running
librofm-downloaderwith no flags finds config/secrets/history via XDG→CWD search. Changerun()default parameters forconfig_path,secrets_path, andhistory_pathfrom CWD strings ("config.yaml"etc.) toNone(meaning "search"). When config is missing everywhere: always print a visible message like"config.yaml not found in <paths>. Using built-in defaults."— not silenced, not verbose-only. When secrets are missing everywhere: print fatal error listing all searched paths and exit 1.Apply the same XDG→CWD resolution to the history file default. Explicit
--config,--secrets, and--historyCLI flags must bypass search entirely and use the provided path as-is (backward compatibility). In--verbosemode, print which path was resolved for each file.Acceptance criteria
run()with no path args → searches XDG then CWD for all three files~/.config/librofm-downloader/download_history.json--config ./foo.yamlskips search, uses exact path--verboseshows resolved paths for config, secrets, and historyrun()with various filesystem layouts, capture console output, verify correct messages and exit codesBlocked by
#22 — Slice 1: Path resolution engine & config loading
Implemented in
01b14f1. All 10 AC met, 188/188 tests pass.