Skip to content

fix(hooks): let cleanup_worktrees tests choose the untrusted locations - #306

Merged
furedea merged 1 commit into
mainfrom
fix/cleanup-tests-tmp
Oct 23, 2026
Merged

furedea merged 1 commit into
mainfrom
fix/cleanup-tests-tmp

Conversation

@furedea-agent

@furedea-agent furedea-agent Bot commented Oct 23, 2026

Copy link
Copy Markdown
Contributor

概要

cleanup_worktrees.py の「信頼しない場所」の一覧を untrusted_locations() に切り出し,テストから差し替えられるようにした.テストは一覧を明示的な fixture ディレクトリに差し替えるので,pytest の一時ディレクトリが sandbox の /private/tmp/claude-501/... にあっても通る.本番の判定は変えていない.

変更前 変更後
sandbox の中でのテスト 一時ディレクトリが書き込み可能と判定され失敗 通る
信頼しない場所の一覧 関数内に直書き untrusted_locations() に切り出し,テストで差し替え可能
偽リポジトリのテスト tmp_path 直下に置く 「書き込み可能」とした writable/ の下に置き,拒否されることを確認
本番の一覧のテスト なし /tmp,/private/tmp,TMPDIR,/tmp/claude,allowWrite,~/.herdr/worktrees を含むことを確認

受け入れ条件

  • sandbox の中で cleanup のテストがすべて通る(70 件)
  • CI でも通る
  • 本番の判定は変わらない

Closes #305

🤖 Generated with Claude Code

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@furedea
furedea merged commit 90cfd2f into main Oct 23, 2026
11 checks passed
@furedea
furedea deleted the fix/cleanup-tests-tmp branch October 23, 2026 04:59
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.

cleanup_worktrees のテストが sandbox の中だと失敗する(一時ディレクトリが書き込み可能な場所と判定される)

1 participant