Skip to content

Centralize user files under ~/.config/scourgify#22

Merged
elfensky merged 2 commits into
developfrom
feat/centralized-config
Jul 11, 2026
Merged

Centralize user files under ~/.config/scourgify#22
elfensky merged 2 commits into
developfrom
feat/centralized-config

Conversation

@elfensky

Copy link
Copy Markdown
Owner

What

Per-user files (config.toml, overrides/, data/ incl. backups/) resolved against os.getcwd(), so an installed copy (uv tool install / pipx) had no stable home — it read and wrote relative to whatever directory it was launched from. This gives them one fixed home.

  • common.user_dir() — single owner of "where user data lives": $SCOURGIFY_HOME$XDG_CONFIG_HOME/scourgify~/.config/scourgify (mac + Linux; no Windows). All 12 os.getcwd() sites route through it.
  • Wizard header gains a backups N snapshots · X MB line, turning yellow with a trim nudge past BACKUP_WARN (500 MB) — surfaced, not relocated, since snapshots now live under the config dir.
  • config.toml was tracked but only held load_config()'s baked-in defaults and is no longer read from the repo → untracked + gitignored.
  • tests/test_paths.pyuser_dir() precedence + backups_size().

Spec: docs/superpowers/specs/2026-07-11-centralized-config-design.md

Test

uv run all four suites — 62 passing (42 core + 5 paths + 5 wizard + 10 selection). Verified end-to-end that the tool reads config/overrides/backups from ~/.config/scourgify and applies moved overrides through transform.

🤖 Generated with Claude Code

elfensky and others added 2 commits July 11, 2026 02:24
Per-user files (config.toml, overrides/, data/ incl. backups/) resolved
against os.getcwd(), so an installed copy had no stable home — it read and
wrote relative to whatever directory it was launched from. Introduce
common.user_dir() as the single owner of "where user data lives":
$SCOURGIFY_HOME, else $XDG_CONFIG_HOME/scourgify, else ~/.config/scourgify
(mac + Linux; no Windows). All 12 os.getcwd() sites now route through it.

Wizard header gains a backups line (count · size), turning yellow with a
trim nudge past BACKUP_WARN (500 MB) — surfaced, not relocated, since the
snapshots now sit under the config dir.

config.toml was tracked but only ever held load_config()'s baked-in defaults
and is no longer read from the repo; untrack it and gitignore it.

tests/test_paths.py covers user_dir() precedence + backups_size().
Spec: docs/superpowers/specs/2026-07-11-centralized-config-design.md

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The centralized-config swap means classify/wrangle read overrides from
user_dir(), not os.getcwd(), so the chdir-based tests no longer pointed the
loader at their temp dirs. Set $SCOURGIFY_HOME instead. Also wire the new
test_paths.py into CI.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@elfensky
elfensky merged commit e07b3bd into develop Jul 11, 2026
2 checks passed
@elfensky
elfensky deleted the feat/centralized-config branch July 11, 2026 00:28
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