Uh oh!
There was an error while loading. Please reload this page.
fix: cross-review worktree デフォルトパス と gemini result.json スキーマ整合性修正 (PLAN20, v4.7.3) - #4
Merged
takemi-ohama merged 2 commits intoMay 22, 2026
Conversation
…AN20, v4.7.3) - state.py に _default_worktree_base() を追加し worktree 親ディレクトリを NDF_WORKTREE_BASE env > /work/worktrees > $HOME/work/worktrees の優先順で解決 - macOS / WSL でも `state.py init` が --worktree なしで成功するように - launch-gemini.sh の result.json 指示を codex と同一フィールド列挙ブロックに統一 (intent / comment_count 等の別名禁止を明記) - state.py cmd_read_result を堅牢化: * 別名フィールド (intent / comment_count) を spec 優先でフォールバック * event / intent いずれも無ければ exit 1 で die (旧: silent な None マージ) - SKILL.md / docs/01-state-and-review.md の `/work/worktrees/pr<PR>` ハードコードを `<worktree-base>/pr<PR>` 表記に統一 + 解決順を本文に追記 - pytest 追加: skills/cross-review/tests (read-result 4 ケース + worktree-base 3 ケース) - plugin version 4.7.2 → 4.7.3 + CHANGELOG に v4.7.3 節追加 Related: issues/i17.md, issues/PLAN20_cross-review-worktree-and-result-schema-fix.md Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
takemi-ohama
left a comment
ContributorAuthor
There was a problem hiding this comment.
🤖 cross-review | round 1 | gemini | APPROVE
環境に応じた worktree パス解決と、gemini のスキーマ揺れに対するフォールバックの実装を確認しました。
| return pathlib.Path(env) | ||
| legacy = pathlib.Path("/work/worktrees") | ||
| try: | ||
| legacy.mkdir(parents=True, exist_ok=True) |
ContributorAuthor
There was a problem hiding this comment.
[minor / 堅牢性] /work/worktrees が既に存在し、かつ読み取り専用である場合に mkdir(exist_ok=True) は例外を投げないため、後続の git worktree add で失敗する可能性があります。既存ディレクトリの場合は os.access(legacy, os.W_OK) での書き込み権限チェックを併用することを推奨します。
takemi-ohama
left a comment
ContributorAuthor
There was a problem hiding this comment.
🤖 cross-review | round 1 | codex | APPROVE
修正必須の指摘はありません。
cross-review が SKILL.md / docs を codex に echo させた際、err.log 上で FATAL キーワード (`「quota exceeded」`「sandbox error」等) が markdown 表セル内の 引用として書き出され、monitor.py の `_scan_early_fatal()` が誤発火して codex プロセスを kill していた。回避策 `MONITOR_NO_EARLY_ERROR=1` を不要にする恒久対応。 - FATAL パターンから `^.*` プレフィックスを外し、`m.start()` をキーワード位置に 合わせる (引用判定が prefix を見られるようにするため) - `EARLY_ERROR_BENIGN` に Markdown 表セル行 (`^\|`) を追加 - `_match_is_quoted()` を追加し、マッチ位置が backtick または 日本語「」で 引用されている場合に benign 扱い - 回帰テスト 7 ケース (`test_monitor_early_error.py`): - 本物 `quota exceeded` / `sandbox error` は依然 fatal 検知 - Markdown 表セル / backtick / 日本語クォート引用は benign - `conftest.py` に `monitor_mod` フィクスチャ追加 (state_mod と同方式) 13 件全 PASS: `uv run --with pytest pytest plugins/ndf/skills/cross-review/tests/` Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
4 tasks
takemi-ohama added a commit
that referenced
this pull request
May 26, 2026
- conftest.py.template: browser_type_launch_args を依存に追加し local モードで --headed/slow_mo/channel 等が反映されるよう修正 (#1, #6) - conftest.py.template: 変数名 b → browser に改名 (#2) - conftest.py.template: CDP 接続時に非 Chromium ブラウザの fail-fast チェック追加 (#5) - config.py: BrowserConfig.cdp_endpoint の既定値を ws:// → http:// に変更 (#4) - CHANGELOG.md: v4.10.0 エントリを追加 (#3) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
22 tasks
takemi-ohama
deleted the
fix/PLAN20-cross-review-macos-and-result-schema
branch
August 14, 2026 04:00
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 freeto 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
/ndf:cross-reviewの 3 件の不具合を恒久対応する PATCH リリース (v4.7.3)。/workが SIP で書き込み不可なためstate.py initがRead-only file systemで失敗していた。result.jsonスキーマ揺れでintent=Noneが silent に state にマージされ judge が空回りする問題 — launcher prompt の指示が曖昧で、gemini が独自スキーマ (intent/comment_count) を書き出すケースがあった。_scan_early_fatal()が Markdown 表セル内の「quota exceeded」等の doc 引用 を本物のエラーと判定していた。回避策MONITOR_NO_EARLY_ERROR=1は不要に。3 不具合とも cross-review skill 配下に閉じており影響範囲も小さいため 単一 PR で対応。
主な変更
scripts/state.py:_default_worktree_base()を追加し worktree 親ディレクトリをNDF_WORKTREE_BASEenv >/work/worktrees>$HOME/work/worktreesの優先順で解決cmd_read_resultを堅牢化: 別名フィールド (intent/comment_count) を spec 優先でフォールバック、event/intentいずれも無ければdie()で exit 1scripts/launch-gemini.sh: result.json 出力指示を codex と同一フィールド列挙ブロックに統一 (別名禁止を明記)scripts/monitor.py: (追加 commit) EARLY_ERROR 誤検知の恒久対応^.*プレフィックスを外しm.start()をキーワード位置にEARLY_ERROR_BENIGNに Markdown 表セル行 (^\|) を追加_match_is_quoted()を追加し backtick / 日本語「」引用内のキーワードは benign 扱いSKILL.md/docs/01-state-and-review.md: ハードコードパスを<worktree-base>/pr<PR>表記に統一 + 解決順を本文に追記 (state.json サンプル中の解決例 1 箇所のみ残存)tests/: pytest 追加test_monitor_early_error.py)plugin.jsonversionを 4.7.2 → 4.7.3、CHANGELOG に v4.7.3 節を追加後方互換性
/work/worktreesが書ける環境 (大半の Linux コンテナ): 挙動不変event/comments_count): 挙動不変intent=Noneマージは 破壊的に修正 (本来 bug のため。CHANGELOG に明記)^.*を外したが、\b...\bで同等のキーワード検知を維持。本物 fatal は引き続き kill される (テストで検証済)Test plan
uv run --with pytest pytest plugins/ndf/skills/cross-review/tests -v— 13/13 passtest_canonical_schema/test_alias_schema_intent_and_comment_count/test_missing_event_and_intent_dies/test_empty_result_file_diestest_env_override_takes_precedence/test_legacy_path_used_when_writable/test_fallback_to_home_when_legacy_unwritabletest_real_quota_exceeded_is_detected/test_real_sandbox_error_still_detected(本物 fatal の回帰)test_markdown_table_row_is_benign/test_backtick_quoted_keyword_is_benign/test_japanese_quote_wrapped_keyword_is_benign/test_sandbox_error_in_table_is_benign(doc 引用 benign)test_match_is_quoted_helper(ヘルパ単体)claude plugin validate plugins/ndf— Validation passed_default_worktree_base()が/work/worktreesを返すことを smoke test で確認NDF_WORKTREE_BASEenv で明示オーバーライドできることを smoke test で確認/ndf:cross-reviewでセルフ実行し codex / gemini が両方 APPROVE することを確認_scan_early_fatal()がNoneを返すことを確認 (MONITOR_NO_EARLY_ERROR=1不要)state.py init <PR>が--worktree引数なしで成功すること (実機検証は merge 後ユーザ環境で)/work/worktrees/pr<PR>が引き続き作られること (実機検証は merge 後ユーザ環境で)関連
issues/PLAN20_cross-review-worktree-and-result-schema-fix.mdissues/i17.mddevbasex/devbase#14