fix: レビュースクリプトの TMP_DIR を worktree 内 .cross_review/ に統一#9
Open
takemi-ohama wants to merge 5 commits into
Open
Conversation
gemini CLI の write_file は workspace 内のみ書き込み可能。 ~/.gemini/tmp/ は workspace 外のため result.json の書き込みが ブロックされ NO_RESULT で停止していた。 TMP_DIR を <worktree>/.cross_review/ に変更し workspace 制約を根本回避。 codex の -s workspace-write 緩和は bwrap 非対応環境で不可のため維持。 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- state.py: _tmp_dir() 呼び出しを worktree 存在チェック・作成の後に移動。 _tmp_dir() が mkdir で worktree ディレクトリを副作用で作成し、 exists() チェックが常に true になる順序問題を解消。 - _tmpdir.sh: $PWD 依存を git rev-parse --show-toplevel に変更し、 サブディレクトリから実行しても worktree root を正しく特定。 - PLAN22 ドキュメント: After スニペットの .gemini/tmp を .cross_review に統一。 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- PLAN22 ドキュメントの "After" コード例を .gemini/tmp → .cross_review に修正 - state.py / monitor.py の docstring から /tmp/ フォールバック記述を削除 - state.py の _tmp_dir() で pathlib.Path に .resolve() を追加し絶対パス化 - monitor.py の _tmp_dir() フォールバックを git rev-parse --show-toplevel ベースに変更 - monitor.py のモジュール docstring の result.json パス記述を更新 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…ク (PLAN22 Round 4) サブディレクトリから実行した場合に os.getcwd() だとパス不一致が発生する問題を修正。 git コマンド失敗時のみ os.getcwd() にフォールバックする。 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…nd 5 fix) - SKILL.md: 状態ファイルパスを /tmp/ → <worktree>/.cross_review/ に更新 - docs/02-fix-and-rotation.md: TMP_DIR 解決順の説明を実装に合わせて更新 - scripts/_tmpdir.sh: コメントの優先順位から削除済みの /tmp/ fallback を除去 - scripts/launch-gemini.sh: コメント内の旧パス ~/.gemini/tmp/ を .cross_review/ に更新 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
takemi-ohama
commented
May 24, 2026
Contributor
Author
takemi-ohama
left a comment
There was a problem hiding this comment.
🤖 cross-review | round 6 | codex | APPROVE
修正が必要な指摘はありません。
takemi-ohama
commented
May 24, 2026
Contributor
Author
takemi-ohama
left a comment
There was a problem hiding this comment.
🤖 cross-review | round 6 | gemini | APPROVE
docs/01-state-and-review.mdにも$TMP_DIRの解決順序(env > .cross_review)の注釈を追加することを推奨します。- 今回のパス体系変更(v4.7.4 時点の記述の上書き)を反映するため、CHANGELOG への追記(v4.7.5等)を推奨します。
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.
Summary
write_fileが workspace 外 (~/.gemini/tmp/) への書き込みをブロックする問題を解消するため、レビュースクリプトの一時ファイルディレクトリ (TMP_DIR) を worktree 内<worktree>/.cross_review/に移行state.py/monitor.py/_tmpdir.shの_tmp_dir()関数を統一してgit rev-parse --show-toplevelベースでパスを解決するように変更。サブディレクトリからの実行でもパス不一致が発生しないstate.py cmd_initで worktree 作成前に_tmp_dir()を呼んでいた順序依存バグを修正(_tmp_dir()のmkdir副作用で worktree 存在チェックが常に true になる問題)/ndf:mergedskill に worktree クリーンアップ手順を追加(.cross_review/は worktree ごと削除される).gitignoreに.cross_review/を追加変更ファイル
plugins/ndf/skills/cross-review/scripts/state.py_tmp_dir()を<worktree>/.cross_review/に変更、_git_toplevel()ヘルパ追加、cmd_initの呼び出し順序修正plugins/ndf/skills/cross-review/scripts/monitor.py_tmp_dir()を同様にgit rev-parse --show-toplevelベースに変更plugins/ndf/skills/cross-review/scripts/_tmpdir.shgit rev-parse --show-toplevel+.cross_review/に統一plugins/ndf/skills/cross-review/scripts/launch-codex.shplugins/ndf/skills/cross-review/scripts/launch-gemini.shplugins/ndf/skills/cross-review/SKILL.md.cross_review/体系に統一plugins/ndf/skills/cross-review/docs/02-fix-and-rotation.mdplugins/ndf/skills/merged/SKILL.md.gitignore.cross_review/除外ルール追加issues/PLAN22_cross-review-gemini-result-workspace-constraint.mdTest plan
<worktree>/.cross_review/に result.json を書き込めることを確認monitor.pyが<worktree>/.cross_review/の result.json を検出して正常終了することを確認state.py read-resultが result.json を正常に読み取れることを確認.cross_review/がgit statusに表示されないことを確認/ndf:merged実行後に対応する worktree が削除されることを確認Related
issues/PLAN22_cross-review-gemini-result-workspace-constraint.md