Files
SubMiner/backlog/tasks/task-70 - Unify-config-path-resolution-across-main-and-launcher.md

1.5 KiB

id, title, status, assignee, created_date, updated_date, labels, dependencies, priority
id title status assignee created_date updated_date labels dependencies priority
TASK-70 Unify config path resolution across main and launcher To Do
2026-02-18 11:35 2026-02-18 11:35
config
launcher
consistency
high

Description

Config discovery logic is duplicated and inconsistent between app main process and launcher. Main resolves XDG_CONFIG_HOME + case variants (SubMiner/subminer), while launcher loaders still hardcode ~/.config/SubMiner in places.

Action Steps

  1. Extract shared config path discovery utility (candidate roots, case variants, .jsonc/.json preference).
  2. Replace ad-hoc resolution in src/main.ts, launcher/main.ts, and launcher/config.ts.
  3. Normalize fallback behavior when config file is absent.
  4. Keep existing user-visible behavior for subminer config path|show.
  5. Add tests for XDG and case-variant path resolution.
  6. Update docs if path precedence changes.

Acceptance Criteria

  • #1 Single canonical path-resolution logic used by app and launcher
  • #2 XDG_CONFIG_HOME and SubMiner|subminer precedence covered by tests
  • #3 No behavior drift for existing config-path CLI commands

Definition of Done

  • #1 Launcher and config tests pass
  • #2 Code no longer duplicates config path candidate logic