Skip to content

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

Closed

Description

@furedea-agent

#300 で,片付けスクリプトはレーンが書ける場所(/tmp,/tmp/claude,$TMPDIR など)にある本体を信頼しなくなった.テストは pytest の一時ディレクトリ(sandbox の中では /private/tmp/claude-501/pytest-of-...)にリポジトリを作るため,本体が信頼されずに 8 件以上が失敗する.CI では通るが,エージェントのセッションの Stop hook の全体テストでは毎回失敗し,時間切れの原因にもなる.

変更前 変更後
sandbox の中での tests/agents/hooks/test_cleanup_worktrees*.py 失敗する 通る
信頼しない場所の一覧 実行環境の /tmp や $TMPDIR をそのまま使う テストでは一覧を差し替えられ,各テストの一時ディレクトリは「信頼する場所」として扱える.偽リポジトリのテストは,明示的に「書き込み可能」とした場所に置く

受け入れ条件

  • sandbox の中(TMPDIR=/tmp/claude-501)で cleanup のテストがすべて通る
  • CI でも通る
  • 本番の判定(/tmp,$TMPDIR,allowWrite,~/.herdr/worktrees を信頼しない)は変わらない

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions