Skip to content

Refactor: cross-refactoring 4 回目の実機試行(v8.5.0 の修正確認) - #128

Closed
takemi-ohama wants to merge 34 commits into
mainfrom
refactor/cross-refactoring-4th-trial
Closed

Refactor: cross-refactoring 4 回目の実機試行(v8.5.0 の修正確認)#128
takemi-ohama wants to merge 34 commits into
mainfrom
refactor/cross-refactoring-4th-trial

Conversation

@takemi-ohama

Copy link
Copy Markdown
Contributor

目的

PR #127(NDF v8.5.0)で直した 5 件が実機で成立するかを、/ndf:cross-refactoring
自分自身のスクリプト群へ実行して確かめる。

この PR は検証用の Draft であり、マージは想定していない。

背景

3 回目の試行(PR #125)で見つけた 4 件は、生成物を持つリポジトリで進行を止めるものを
含む。--sync-command を渡す構成でしか踏まないため、同じ構成でもう一度通す。

確かめること

#直したこと観測できれば通ったと言えること
12生成物の同期コミット同期コミットが積まれ、git add が落ちない
13同期の後段の失敗失敗しても作業ツリーが綺麗に戻る
14実装担当のコミット手順書の迂回手段でコミットが作れる
15見送り後の読み取り同期次ラウンドの提案が消えた対象を指さない

詳細は issues/issue-113-cross-refactoring-4th-trial.md を参照。

テスト

着手前のテストは 463 passed。

uv run --with pytest python -m pytest \
plugins/ndf-shared/skills/cross-refactoring/tests \
plugins/ndf-shared/skills/cross-review/tests -q

…g/scripts/refactor.py#cmd_merge_apply
適用範囲のコミット所有者検証を _validate_range_ownership に抽出する。
Item-Id: R1-001
Round: 1
Impl-Runtime: codex
Impl-Model: default
…g/scripts/refactor.py#cmd_merge_apply
項目ごとの適用結果検証を _verify_items に抽出する。
Item-Id: R1-001
Round: 1
Impl-Runtime: codex
Impl-Model: default
…g/scripts/refactor.py#cmd_merge_apply
未割当や未知 ID を含む適用範囲の棄却処理を _reject_unassigned_range に抽出する。
Item-Id: R1-001
Round: 1
Impl-Runtime: codex
Impl-Model: default
…g/scripts/refactor.py#cmd_merge_apply
抽出後の検証結果受け取りを必要な値だけに絞り、cmd_merge_apply を orchestration に寄せる。
Item-Id: R1-001
Round: 1
Impl-Runtime: codex
Impl-Model: default
…ipts/lib/monitor.py#monitor_agent
result.json を伴う lingering process の早期完了判定を _check_lingering_with_result に抽出する。
Item-Id: R1-002
Round: 1
Impl-Runtime: codex
Impl-Model: default
…ipts/lib/monitor.py#monitor_agent
早期エラーの FATAL 判定と WARN 通知を _check_early_error に抽出する。
Item-Id: R1-002
Round: 1
Impl-Runtime: codex
Impl-Model: default
…ipts/lib/monitor.py#monitor_agent
抽出済みの lingering result 判定の説明を helper に寄せ、monitor_agent のループ本体を整理する。
Item-Id: R1-002
Round: 1
Impl-Runtime: codex
Impl-Model: default
…g/scripts/refactor.py#cmd_merge_fix
修正結果の解決スレッド申告と GitHub 実状態の突き合わせを _reconcile_resolved_threads に抽出する。
Item-Id: R1-003
Round: 1
Impl-Runtime: codex
Impl-Model: default
…g/scripts/refactor.py#cmd_merge_fix
修正コミット facts の検証と accepted/problems の集約を _validate_fix_commits に抽出する。
Item-Id: R1-003
Round: 1
Impl-Runtime: codex
Impl-Model: default
…g/scripts/refactor.py#cmd_merge_fix
cmd_merge_fix のコミット収集と検証で使う対象 scope を明示し、抽出後の orchestration を整える。
Item-Id: R1-003
Round: 1
Impl-Runtime: codex
Impl-Model: default
…g/scripts/refactor.py#cmd_judge_review
レビュー結果から状態保存用 record を作る処理を _build_review_record に抽出する。
Item-Id: R1-004
Round: 1
Impl-Runtime: codex
Impl-Model: default
…g/scripts/refactor.py#cmd_judge_review
レビュー担当ごとの所要時間集計を _accumulate_reviewer_durations に抽出する。
Item-Id: R1-004
Round: 1
Impl-Runtime: codex
Impl-Model: default
…g/scripts/refactor.py#cmd_judge_review
cmd_judge_review の duration 集計を _accumulate_reviewer_durations の呼び出しへ置き換える。
Item-Id: R1-004
Round: 1
Impl-Runtime: codex
Impl-Model: default
…factoring/scripts/refactor.py#cmd_judge_review"
This reverts commit 9592d0a.
…factoring/scripts/refactor.py#cmd_judge_review"
This reverts commit b2f8243.
…factoring/scripts/refactor.py#cmd_judge_review"
This reverts commit bbd7090.
…factoring/scripts/refactor.py#cmd_merge_fix"
This reverts commit bb6b207.
…factoring/scripts/refactor.py#cmd_merge_fix"
This reverts commit 33e0c8f.
…factoring/scripts/refactor.py#cmd_merge_fix"
This reverts commit 98027d2.
…view/scripts/lib/monitor.py#monitor_agent"
This reverts commit d3e5bfe.
…view/scripts/lib/monitor.py#monitor_agent"
This reverts commit 7e88d2d.
…view/scripts/lib/monitor.py#monitor_agent"
This reverts commit 3b7c351.
…factoring/scripts/refactor.py#cmd_merge_apply"
This reverts commit a55de1a.
…factoring/scripts/refactor.py#cmd_merge_apply"
This reverts commit 485dde5.
…factoring/scripts/refactor.py#cmd_merge_apply"
This reverts commit a192ade.
…factoring/scripts/refactor.py#cmd_merge_apply"
This reverts commit fc8e68a.
…w/scripts/lib/metrics.py#aggregate
aggregate の 96 行を 3 つのヘルパーに分割:
- _aggregate_impl_round: ラウンドごとの実装担当集計
- _record_first_review: 初回レビュー結果の反映
- _aggregate_reviewer_round: レビュー担当集計
aggregate 本体はラウンド反復と finish 処理だけを残す。
Item-Id: R2-001
Round: 2
Impl-Runtime: kiro
Impl-Model: default
…efactoring/scripts/refactor.py#cmd_merge_apply
4 箇所のインライン push-and-clear シーケンスを _push_with_retry_marker 呼び出しに統合:
- cmd_merge_apply: 全件取り消し経路、全項目通過経路
- _apply_drop: 取り消し完了後の push
- cmd_abandon_items: 見送り記録後の push
Item-Id: R2-002
Round: 2
Impl-Runtime: kiro
Impl-Model: default
…g/scripts/refactor.py#cmd_merge_proposals
JSON 読み込み・検証・エラーハンドリングを _read_result_lenient に抽出。
cmd_merge_proposals のループ本体を簡素化し、_read_result(致命的)との
使い分けを明確にした。
Item-Id: R2-003
Round: 2
Impl-Runtime: kiro
Impl-Model: default
…g/scripts/refactor.py#cmd_merge_proposals
各ランタイムの提案読み込みループを _load_proposals に抽出。
cmd_merge_proposals は状態確認→読み込み→マージ→保存の流れだけを持つ。
Item-Id: R2-004
Round: 2
Impl-Runtime: kiro
Impl-Model: default
…ipts/lib/monitor.py#_scan_patterns
_scan_patterns を 3 つのヘルパーに分割:
- _read_log_tail_text: 末尾 200KB 読み込み + ANSI 除去
- _matched_line: マッチ位置から行を切り出す
- _is_benign_match: benign パターンと引用判定
_scan_patterns は読み込んだ本文に対する走査と最初の non-benign 行の返却だけを行う。
Item-Id: R2-005
Round: 2
Impl-Runtime: kiro
Impl-Model: default
実装担当は対象範囲だけを変更するため、生成物が同期されない。
同期を検査する pre-push を持つリポジトリでも push できるよう、
公開の直前に進行側がまとめて生成する。

@takemi-ohamatakemi-ohama left a comment

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 cross-refactoring | round 2 | Reviewer: gemini / default | APPROVE

@takemi-ohama

Copy link
Copy Markdown
ContributorAuthor

検証が目的の Draft のため、成果物は取り込まずに閉じます。

ラウンド 2 の 5 項目は gemini が承認したのみで、codex が 3 回ともレビュー結果を残さなかったため、
cross-refactoring の完了条件(レビュー担当 2 者の承認)を満たしていません。作業ディレクトリと
state.json も失われているため、この PR から収束ループを再開することもできません。

試行の記録は #129 で main へ残します。実行中に見つけた不具合 2 件(レビュー結果が欠け続けると
進行が終わらない / 実装担当に直せない指摘が渡る)は別途対応します。

@takemi-ohama
takemi-ohama deleted the refactor/cross-refactoring-4th-trial branch August 19, 2026 15:54
takemi-ohama added a commit that referenced this pull request Aug 21, 2026
4 回目の実機試行(PR #128)で見つけた 2 件を直した。
- 収束ループが終わらない
`judge-review` の変更要求の出口は 2 つあり、差し戻し上限から落ちる側だけが
修正フェーズの起点(`fix_base_sha`)を記録していなかった。起点が無いと
`merge-fix` が範囲を確定できずに弾かれ、`fix_rounds` が進まないため
`should-abandon` の上限へ永久に到達しない。起点の記録を `_prepare_fix_phase`
へ集め、範囲を確定できないときも修正ラウンドを進める
- レビュー結果の欠落が実装担当へ回る
結果ファイルを残さなかったレビュー担当がいるときは、変更要求ではなく
進行の中断(終了コード 4)として扱う。結果を残さなかったのはレビュー担当の
プロセスが動かなかったということで、実装担当が直せる指摘ではない
Claude-Session: https://claude.ai/code/session_016xTBtHVcCLsYnLdwfgW4xx
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
Sign up for freeto 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

@takemi-ohama