Skip to content

test: sandbox HOME in test_claude_md.py so uninstall tests cannot delete the real user skill#2057

Open
erlandl4g wants to merge 3 commits into
Graphify-Labs:v8from
erlandl4g:v8
Open

test: sandbox HOME in test_claude_md.py so uninstall tests cannot delete the real user skill#2057
erlandl4g wants to merge 3 commits into
Graphify-Labs:v8from
erlandl4g:v8

Conversation

@erlandl4g

Copy link
Copy Markdown

claude_uninstall() removes the USER-scope skill tree (~/.claude/skills/ graphify) since #1121, but this file's uninstall tests predate that and called it with no Path.home isolation. Running the suite on a dev machine deleted the developer's real installed skill; where that path is a symlink into a git checkout (Skills claude_config/skills/graphify), it silently deleted tracked files (2026-07-19 22:01 UTC nightly-audit incident).

Autouse fixture redirects both pathlib.Path.home and HOME into tmp_path so every current and future test in this file is home-isolated, including subprocess-based helpers. Also clears CLAUDE_CONFIG_DIR, the second env escape hatch install.py's claude-platform resolver checks before Path.home() (caught in independent audit).

…ete the real user skill

claude_uninstall() removes the USER-scope skill tree (~/.claude/skills/
graphify) since Graphify-Labs#1121, but this file's uninstall tests predate that and
called it with no Path.home isolation. Running the suite on a dev machine
deleted the developer's real installed skill; where that path is a symlink
into a git checkout (Skills claude_config/skills/graphify), it silently
deleted tracked files (2026-07-19 22:01 UTC nightly-audit incident).

Autouse fixture redirects both pathlib.Path.home and HOME into tmp_path
so every current and future test in this file is home-isolated, including
subprocess-based helpers. Also clears CLAUDE_CONFIG_DIR, the second env
escape hatch install.py's claude-platform resolver checks before
Path.home() (caught in independent audit).
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