Centralize user files under ~/.config/scourgify#22
Merged
Conversation
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>
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.
What
Per-user files (
config.toml,overrides/,data/incl.backups/) resolved againstos.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 12os.getcwd()sites route through it.backups N snapshots · X MBline, turning yellow with a trim nudge pastBACKUP_WARN(500 MB) — surfaced, not relocated, since snapshots now live under the config dir.config.tomlwas tracked but only heldload_config()'s baked-in defaults and is no longer read from the repo → untracked + gitignored.tests/test_paths.py—user_dir()precedence +backups_size().Spec:
docs/superpowers/specs/2026-07-11-centralized-config-design.mdTest
uv runall 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/scourgifyand applies moved overrides throughtransform.🤖 Generated with Claude Code