Repository navigation
Description
Parent Issue
なし(単独改善。PR #2118 / Issue #2102 の follow-up)
Machine-Readable Contract
contract_schema_version: v1
issue_kind: implementation
parent_issue: "none"
goal_ref: "scripts/agent-ops/pr_head_replay_publish_exec.py::execute() を実際の production 経路から呼び出し可能にする(PR #2118 / Issue #2102 follow-up)"
change_kind: codeParent Goal Ref
- Goal: なし(単独 Issue)
- Desired Destination: なし(単独 Issue)
Current Validated Scope
scripts/agent-ops/pr_head_replay_publish_exec.py::execute()を production 経路(impl-review-loop/open-pr/implement-issueのいずれかの publish step)から呼び出す配線を追加する- 呼び出し元の判定ロジック・呼び出しタイミングを既存の main drift reconciliation フローに整合させる
Remaining Parent Gaps
なし
Outcome
pr_head_replay_publish_exec.py::execute() が impl-review-loop(または open-pr / implement-issue)の publish 経路から実際に呼び出されるようになり、main drift reconciliation の replay/publish 実行ロジックが production で到達可能になっている状態。呼び出し元を明示するコード変更がマージされ、対応するユニットテストが PASS している。
In Scope
pr_head_replay_publish_exec.py::execute()を呼び出す production caller の実装(呼び出し元 skill/script は既存の main drift reconciliation フロー(.claude/skills/impl-review-loopの update_branch/publish step、または.claude/skills/open-pr/.claude/skills/implement-issueの publish step)から選定する)- caller 追加に伴う既存フロー(main drift 検知、
route_loop_verdict_v2_resolve_semantic_ambiguity()経由のcompute_semantic_ambiguity()呼び出し等)との整合確認 - caller に対するユニットテスト追加(
execute()が実際に呼ばれること、blocked/failed/success 各 status の伝播を確認するテスト)
Out of Scope
pr_head_replay_publish_exec.py::execute()自体のロジック変更(PR fix(loop): main drift evidence を再束縛する (#2102) #2118 で実装済みのロジックは対象外)compute_semantic_ambiguity()/_merge_tree_conflicts()側の変更(PR fix(loop): main drift evidence を再束縛する (#2102) #2118 で production caller を既に獲得済み)- main drift reconciliation 機能の新規仕様追加
Acceptance Criteria
- AC1:
scripts/agent-ops/pr_head_replay_publish_exec.py::execute()を呼び出す production caller が repo 内に存在する - AC2: caller の呼び出し経路に対するユニットテストが追加され PASS している
- AC3: 既存の
scripts/agent-ops/tests/test_pr_head_replay_publish_exec.pyを含む既存テストが regressed していない
Verification Commands
# AC1
# execute() を import/呼び出す非テストコードが存在することを確認(Allowed Paths 内の新規 caller ファイルがヒットする)
$ rg -n "pr_head_replay_publish_exec" --type py -g '!**/tests/**' .# AC2
# caller の呼び出し経路に対する新規ユニットテストが PASS することを確認
$ uv run --locked pytest scripts/agent-ops/tests/test_pr_head_replay_publish_exec.py -q# AC3
# 既存テストが regressed していないことを確認
$ uv run --locked pytest scripts/agent-ops/tests/ -k pr_head_replay_publish_exec -qAllowed Paths
- scripts/agent-ops/pr_head_replay_publish_exec.py
- scripts/agent-ops/tests/test_pr_head_replay_publish_exec.py
- .claude/skills/impl-review-loop/scripts/
- .claude/skills/impl-review-loop/steps/
- .claude/skills/impl-review-loop/tests/
- .claude/skills/impl-review-loop/SKILL.md
- .claude/skills/open-pr/scripts/
- .claude/skills/open-pr/SKILL.md
- .claude/skills/implement-issue/scripts/
- .claude/skills/implement-issue/SKILL.md
Stop Conditions
- Allowed Paths 外の変更が必要と判明した場合
- In Scope の固定契約(キー集合・スキーマ・型定義)の変更が必要になった場合
- 新規 Issue の起票が必要と判断した場合(スコープ分割が発生する場合)
- 後続 Phase / 別スコープへの波及が判明した場合
- nested SubAgent delegation が必要になった場合
- 外部サービス利用・権限昇格・既存テスト大規模改変が必要になった場合
Required Skills
なし
Required Design References
- docs/dev/agent-skill-boundaries.md
Scope Delta(任意)
N/A
Background
PR #2118(マージ済み、Closes #2102)は main drift 時の evidence rebind / scope-clean reconciliation を実装した。この過程で scripts/agent-ops/pr_head_replay_publish_exec.py::execute()(PR head replay/publish executor の実行部分)が main_drift_reconciliation 用の新しい安全機構(live current-base readback、git merge-tree --write-tree による deterministic conflict 判定、candidate_final_net_diff の Allowed Paths 再判定)を獲得したにもかかわらず、repo 全体で production caller が一つも存在しない(pre-existing gap、PR #2118 本文で開示済み、fresh pr-reviewer が iteration 4/5 で warning として記録)。
compute_semantic_ambiguity()(_merge_tree_conflicts() の public export)は route_loop_verdict_v2.py::route_loop_verdict_v2_resolve_semantic_ambiguity() から呼ばれるようになり初の production caller を得たが、execute() 自体(実際の publish 実行アクション)はまだ呼ばれていない。
関連: PR #2118 #2118 / Issue #2102 #2102
Source
- dedupe_key: follow-up:squne121/loop-protocol:pr/2118:blocker-c-execute-caller
- origin: post-merge-cleanup (PR fix(loop): main drift evidence を再束縛する (#2102) #2118 follow-up candidate)
Notes for Reviewer
- overlap preflight(
check_issue_overlap.py)はpolicy_class: C1/decision: overlap_requires_commentを返した。Allowed Paths にディレクトリ単位のパス(.claude/skills/impl-review-loop/scripts/等)を含めているため、同ディレクトリを Allowed Paths に含む多数の既存 Issue(実装: pnpm test の Vitest result cache を無効化して canonical executor の write-path deadlock を解消する #2055, 実装: Codex/Claude 共通の phase status・final report publisher を実装する #2041, 実装: implementation Issue の Runtime Verification Applicability 欠落を authoring・readiness・reviewer・consumer 全経路で fail-closed に統一する #2040, consumer 側で CONTRACT_REVIEW_ONCE_RESULT_V1.applicability フィールドを読むよう更新する #1944 等、詳細は overlap preflight 出力参照)と広義に重複表示された。 - non_conflict_reason: これらは同一ディレクトリ配下の異なるファイル・異なる関心事(本 Issue は
execute()の production caller 配線のみが対象)であり、実際の編集対象ファイルは重複しない見込み。具体的な caller 実装ファイルは実装時に確定し、Allowed Paths の narrow 化(Scope Delta)は実装時に必要に応じて行う。 - edit_intent: 既存ファイルへの新規 import/呼び出しコード追加のみ(既存ロジックの改変は想定しない)。
Activity
squne121 commentedon Aug 12, 2026
create-issue transaction partial-failure
Issue: #2141
Failure stage: label-apply
Message: label-apply failed
Requested:
Completed steps: create
Failure context: command=gh issue edit --repo squne121/loop-protocol 2141 --add-label follow-up,pre-existing-gap,enhancement,phase/implementation,triage-required,agent/implementer
output=failed to update #2141: 'pre-existing-gap' not found
failed to update 1 issue
matching_issue_numbers=[2141]
issue_number=2141
Recovery hint: stage 'label-apply' encountered an unexpected failure.
Generic guidance: verify the issue state manually and re-run the transaction if safe.
gh issue view 2141 --repo squne121/loop-protocol --json number,title,labels,state
idempotent re-run: depends on the specific failure
Please recover deterministically before re-running the create issue transaction.
squne121 commentedon Aug 31, 2026
判定
REQUEST_CHANGES。#2141 が指摘している「
execute()が production から到達不能」という事実自体は正しいですが、Issue 本文のまま実装へ進めるのは勧めません。PR #2118 でも最終的に、
compute_semantic_ambiguity()には production caller を与えた一方、pr_head_replay_publish_exec.py::execute()本体には caller が存在しないことを明示して follow-up にしています。したがって #2141 の起票根拠は妥当です。 ただし、現在のmainを見ると問題は「caller を1個足せば終わり」ではなく、そもそも replay/publish mutation を発火すべき production state transition が定義されていないことです。敵対的レビュー結果
重要度 | Finding | 評価 -- | -- | -- BLOCKER | execute() に渡す authority の producer が定義されていない | execute() は source_base, source_head, expected_remote_pr_head に加えて main-drift 時は current_base_branch, expected_current_base_sha を必要とします。ところが現在の route_scope_clean_reconciliation action は evidence epoch / reusable evidence / rerun flags しか返さず、これら replay 用 SHA の provenance がありません。 current main のコード検索でも source_base / expected_remote_pr_head は executor とテスト群にしか現れていません。 BLOCKER | AC1 が現状のまま false-green | AC1 の rg -n "pr_head_replay_publish_exec" --type py -g '!**/tests/**' . は、すでに route_loop_verdict_v2.py が compute_semantic_ambiguity() を import しているため、execute() が一度も呼ばれなくてもヒットします。Issue が求める「execute の production caller」の証明になっていません。Issue 本文自身は AC1 を caller 存在証明として扱っています。 BLOCKER | AC2 も caller を検証していない | 指定されている test_pr_head_replay_publish_exec.py は executor 本体の offline test であり、現在でも caller がゼロの状態で PASS します。既存テストは成功、stale head、Allowed Paths、race 等を executor に直接入力しているだけです。 main-drift integration test も同様に execute() を直接呼んでいます。 HIGH | Issue の status contract が実装と違う | Issue は「blocked/failed/success 各 status の伝播」としていますが、現実の success status は ok です。 小さく見えますが、caller adapter を作る Issue でこれは契約バグです。 HIGH | main-drift safety を誤って無効化できる | main_drift_reconciliation = bool(current_base_branch and expected_current_base_sha) なので、caller が片方を渡し忘れると blocked ではなく、通常 replay path に静かに downgrade します。 #2141 は execute() 自体を Out of Scope にしているため、単に caller を作るだけだとこの footgun が production に露出します。 HIGH | Git エラーを「semantic conflict」と誤分類する | _merge_tree_conflicts() は returncode != 0 をすべて conflict としています。 しかし Git 公式仕様では git merge-tree --write-tree は 0=clean、1=conflict、それ以外=処理自体の失敗です。つまり missing object、Git failure 等まで「semantic ambiguity」として workflow を止めます。これはセキュリティより、個人開発で邪魔になる reliability 問題です。(Git) HIGH | subprocess timeout が status に変換されない | デフォルト runner は timeout=60 を設定していますが TimeoutExpired / OSError を捕捉していません。 production caller を付けると、「blocked/failed を返す executor」という期待に反して例外で orchestration 自体が落ちる経路が増えます。 HIGH | open-pr は caller 候補として不適切 | 現行 open_pr.py の publish は branch publish ではなく、body validation 後の gh pr create です。 一方 execute() は既存 pr_number と PR head を必要とします。PR 作成前には呼べず、作成直後に呼ぶなら「PR を作ってから branch を replay して head を変える」という不自然な lifecycle になります。#2141 の候補から open-pr は外すべきです。 HIGH | BEHIND 経路にはすでに適切な canonical executor がある | 現行 Step 5 は BEHIND に対し implement-issue.update_branch を合成し、GitHub Update Branch API を使います。 update_branch.py は expected_head_sha を CAS input にしています。 GitHub 公式 API 自体も base の最新 HEAD を PR head に merge し、expected_head_sha 不一致を拒否し、成功要求を 202 Accepted として扱います。(GitHub Docs) ここを replay executor へ置換する理由はありません。 MEDIUM | scope-clean reconciliation と replay mutation が混同されている | 現行 route_scope_clean_reconciliation は snapshot / CI / review の stale evidence を再取得し、evidence epoch を current main に rebind して Step 5 を再実行する経路です。branch head を変更する処理ではありません。 ここに execute() を直結すると #2102 で確立した state semantics 自体が変わります。 MEDIUM | Allowed Paths が caller 選定前から広すぎる | impl-review-loop / open-pr / implement-issue の各 directory を丸ごと許可してから caller を選ぶ構造で、実際に issue 本文でも overlap ノイズが発生しています。 caller を決めてから exact file に narrow する方が実装もレビューも軽くなります。外部仕様と照合した評価
push 周りをさらにハードニングする必要性は低いです。現在の executor は
--force-with-lease=<ref>:<expect>の exact form を使っており、Git 公式仕様でもこの形式は remote ref が指定した expected value と一致する場合だけ更新するものです。ここは妥当です。(Git)したがって、個人趣味開発という前提では 新しい guard / approval / security artifact を追加する方向には進めない方がよいです。問題はセキュリティ不足ではなく、mutation path が二重化し、入力 authority が曖昧なことです。GitHub の
mergeStateStatusも BEHIND / DIRTY / CLEAN 等を区別しており、現在の「BEHIND は update-branch、actual conflict は別処理」という分離は自然です。(GitHub Docs)推奨アクション
実装: pr_head_replay_publish_exec.execute() の production caller を配線する #2141 をいったん implementation-ready 扱いしない。 最初に「どの production state が replay/publish を本当に必要とするか」を確定します。現状の canonical flow だけを見ると、BEHIND は
update_branch、非-BEHIND main drift は evidence rebind、通常 branch publish は既存 publish lane で処理されており、source_base..source_headを別 commit として PR head に replay する必須状態が見つかりません。その状態が存在しないなら、実装: pr_head_replay_publish_exec.execute() の production caller を配線する #2141 は
not plannedが第一候補です。execute()は dead/legacy executor として削除候補にし、今 production 利用されているcompute_semantic_ambiguity()は小さな Git helper module へ分離するのが長期的には分かりやすいです。PR fix(loop): main drift evidence を再束縛する (#2102) #2118 のレビュー自身も、「caller 不在なら本当に AC に必要なのか、それとも optional/defense-in-depth なのかを判断せよ」と明示していました。本当に replay が必要なら、caller は
impl-review-loopの専用 action に限定します。open-prには入れず、既存update_branchも置換しません。例えば明示的なroute_replay_publish/replay_publishaction を設け、その action の producer がsource_base,source_head,expected_remote_pr_head,current_base_shaを「同一 decision cycle の authority」として生成する設計にします。ただしこれは現行 実装: pr_head_replay_publish_exec.execute() の production caller を配線する #2141 が想定する「import/呼び出しを追加するだけ」より明確に大きい変更です。VC を先に修正します。 AC1 は generic
rgではなく、選定した production adapter がexecute()を呼ぶことを静的または AST test で確認する。AC2 は「replay action → execute が exactly once」「その他 route → execute 0 回」「main drift では2つの current-base 引数が必ず揃う」「ok→ verification + PR review 再実行」「CAS/drift blocked → fresh readback / reroute」を caller-level test にします。production wiring 前に executor の2つの小さな reliability defect を直します。
merge-treeの exit1だけを conflict とし、それ以外は execution failure に分離すること、TimeoutExpired/OSErrorをfailedに変換することです。またcurrent_base_branchとexpected_current_base_shaは XOR をinvalid_argumentsにすべきです。この3点は guard 強化ではなく、不要な停止・クラッシュを減らす変更です。最終評価
#2141 の problem statement は正しいです。「死んだ production path がある」という観測は PR #2118 のレビューとも一致します。
しかし solution statement はまだ不十分です。現状のまま進めると、AC が green になっても
execute()の main-drift reconciliation が実際には使われない、あるいは既存update_branch/ publish lane と競合する実装ができる可能性があります。私なら現段階では 「実装する」より先に #2141 を reframe します。優先順位は 「replay mutation が本当に必要な状態を証明 → なければ not planned、あれば impl-review-loop に単一の明示 action として配線」 です。セキュリティ機構を増やす必要はありません。むしろ今は mutation path を減らす方が、品質・有用性・日常のワークフローすべてに効きます。
## 判定REQUEST_CHANGES。#2141 が指摘している「
execute()が production から到達不能」という事実自体は正しいですが、Issue 本文のまま実装へ進めるのは勧めません。PR #2118 でも最終的に、
compute_semantic_ambiguity()には production caller を与えた一方、pr_head_replay_publish_exec.py::execute()本体には caller が存在しないことを明示して follow-up にしています。したがって #2141 の起票根拠は妥当です。 ただし、現在のmainを見ると問題は「caller を1個足せば終わり」ではなく、そもそも replay/publish mutation を発火すべき production state transition が定義されていないことです。敵対的レビュー結果
execute()に渡す authority の producer が定義されていないexecute()はsource_base,source_head,expected_remote_pr_headに加えて main-drift 時はcurrent_base_branch,expected_current_base_shaを必要とします。ところが現在のroute_scope_clean_reconciliationaction は evidence epoch / reusable evidence / rerun flags しか返さず、これら replay 用 SHA の provenance がありません。 current main のコード検索でもsource_base/expected_remote_pr_headは executor とテスト群にしか現れていません。rg -n "pr_head_replay_publish_exec" --type py -g '!**/tests/**' .は、すでにroute_loop_verdict_v2.pyがcompute_semantic_ambiguity()を import しているため、execute()が一度も呼ばれなくてもヒットします。Issue が求める「execute の production caller」の証明になっていません。Issue 本文自身は AC1 を caller 存在証明として扱っています。test_pr_head_replay_publish_exec.pyは executor 本体の offline test であり、現在でも caller がゼロの状態で PASS します。既存テストは成功、stale head、Allowed Paths、race 等を executor に直接入力しているだけです。 main-drift integration test も同様にexecute()を直接呼んでいます。okです。 小さく見えますが、caller adapter を作る Issue でこれは契約バグです。main_drift_reconciliation = bool(current_base_branch and expected_current_base_sha)なので、caller が片方を渡し忘れると blocked ではなく、通常 replay path に静かに downgrade します。 #2141 はexecute()自体を Out of Scope にしているため、単に caller を作るだけだとこの footgun が production に露出します。_merge_tree_conflicts()はreturncode != 0をすべて conflict としています。 しかし Git 公式仕様ではgit merge-tree --write-treeは 0=clean、1=conflict、それ以外=処理自体の失敗です。つまり missing object、Git failure 等まで「semantic ambiguity」として workflow を止めます。これはセキュリティより、個人開発で邪魔になる reliability 問題です。(Git)timeout=60を設定していますがTimeoutExpired/OSErrorを捕捉していません。 production caller を付けると、「blocked/failed を返す executor」という期待に反して例外で orchestration 自体が落ちる経路が増えます。open-prは caller 候補として不適切open_pr.pyの publish は branch publish ではなく、body validation 後のgh pr createです。 一方execute()は既存pr_numberと PR head を必要とします。PR 作成前には呼べず、作成直後に呼ぶなら「PR を作ってから branch を replay して head を変える」という不自然な lifecycle になります。#2141 の候補からopen-prは外すべきです。BEHINDに対しimplement-issue.update_branchを合成し、GitHub Update Branch API を使います。update_branch.pyはexpected_head_shaを CAS input にしています。 GitHub 公式 API 自体も base の最新 HEAD を PR head に merge し、expected_head_sha不一致を拒否し、成功要求を202 Acceptedとして扱います。([GitHub Docs]2) ここを replay executor へ置換する理由はありません。route_scope_clean_reconciliationは snapshot / CI / review の stale evidence を再取得し、evidence epoch を current main に rebind して Step 5 を再実行する経路です。branch head を変更する処理ではありません。 ここにexecute()を直結すると #2102 で確立した state semantics 自体が変わります。impl-review-loop/open-pr/implement-issueの各 directory を丸ごと許可してから caller を選ぶ構造で、実際に issue 本文でも overlap ノイズが発生しています。 caller を決めてから exact file に narrow する方が実装もレビューも軽くなります。外部仕様と照合した評価
push 周りをさらにハードニングする必要性は低いです。現在の executor は
--force-with-lease=<ref>:<expect>の exact form を使っており、Git 公式仕様でもこの形式は remote ref が指定した expected value と一致する場合だけ更新するものです。ここは妥当です。(Git)したがって、個人趣味開発という前提では 新しい guard / approval / security artifact を追加する方向には進めない方がよいです。問題はセキュリティ不足ではなく、mutation path が二重化し、入力 authority が曖昧なことです。GitHub の
mergeStateStatusも BEHIND / DIRTY / CLEAN 等を区別しており、現在の「BEHIND は update-branch、actual conflict は別処理」という分離は自然です。([GitHub Docs]4)推奨アクション
実装: pr_head_replay_publish_exec.execute() の production caller を配線する #2141 をいったん implementation-ready 扱いしない。 最初に「どの production state が replay/publish を本当に必要とするか」を確定します。現状の canonical flow だけを見ると、BEHIND は
update_branch、非-BEHIND main drift は evidence rebind、通常 branch publish は既存 publish lane で処理されており、source_base..source_headを別 commit として PR head に replay する必須状態が見つかりません。その状態が存在しないなら、実装: pr_head_replay_publish_exec.execute() の production caller を配線する #2141 は
not plannedが第一候補です。execute()は dead/legacy executor として削除候補にし、今 production 利用されているcompute_semantic_ambiguity()は小さな Git helper module へ分離するのが長期的には分かりやすいです。PR fix(loop): main drift evidence を再束縛する (#2102) #2118 のレビュー自身も、「caller 不在なら本当に AC に必要なのか、それとも optional/defense-in-depth なのかを判断せよ」と明示していました。本当に replay が必要なら、caller は
impl-review-loopの専用 action に限定します。open-prには入れず、既存update_branchも置換しません。例えば明示的なroute_replay_publish/replay_publishaction を設け、その action の producer がsource_base,source_head,expected_remote_pr_head,current_base_shaを「同一 decision cycle の authority」として生成する設計にします。ただしこれは現行 実装: pr_head_replay_publish_exec.execute() の production caller を配線する #2141 が想定する「import/呼び出しを追加するだけ」より明確に大きい変更です。VC を先に修正します。 AC1 は generic
rgではなく、選定した production adapter がexecute()を呼ぶことを静的または AST test で確認する。AC2 は「replay action → execute が exactly once」「その他 route → execute 0 回」「main drift では2つの current-base 引数が必ず揃う」「ok→ verification + PR review 再実行」「CAS/drift blocked → fresh readback / reroute」を caller-level test にします。production wiring 前に executor の2つの小さな reliability defect を直します。
merge-treeの exit1だけを conflict とし、それ以外は execution failure に分離すること、TimeoutExpired/OSErrorをfailedに変換することです。またcurrent_base_branchとexpected_current_base_shaは XOR をinvalid_argumentsにすべきです。この3点は guard 強化ではなく、不要な停止・クラッシュを減らす変更です。最終評価
#2141 の problem statement は正しいです。「死んだ production path がある」という観測は PR #2118 のレビューとも一致します。
しかし solution statement はまだ不十分です。現状のまま進めると、AC が green になっても
execute()の main-drift reconciliation が実際には使われない、あるいは既存update_branch/ publish lane と競合する実装ができる可能性があります。私なら現段階では 「実装する」より先に #2141 を reframe します。優先順位は 「replay mutation が本当に必要な状態を証明 → なければ not planned、あれば impl-review-loop に単一の明示 action として配線」 です。セキュリティ機構を増やす必要はありません。むしろ今は mutation path を減らす方が、品質・有用性・日常のワークフローすべてに効きます。
squne121 commentedon Aug 31, 2026
確認した範囲では、今回は #2141 の実装を進めるのではなく、アンカーコメントを human context として
issue-refinement-loopに取り込み、Issue 自体を reframe するのが適切です。アンカーは「replay mutation が必要な production state をまず証明し、存在しなければnot planned、存在するならimpl-review-loopの単一 action として設計」としています。また現行
issue-refinement-loopは loop iteration ごとの承認を既定で要求せず、Step 1 のcodebase-investigator、必要時のweb-researcherを使う構造です。canonical Step 2 では旧issue-reviewerSubAgent を直接起動せず root-owned pipeline を使うため、そこも明示してあります。技術面でも、Git は
merge-tree --write-treeの exit 0/1/その他を clean/conflict/error と区別し、GitHub Update Branch API はexpected_head_sha不一致を拒否するため、アンカーの reliability / CAS に関する問題提起は妥当です。 ([Git]1)そのまま Claude-GPT に渡せる形です。
#2141 (comment)
を operator-selected human context の anchor comment として扱い、Issue #2141 に対して
issue-refinement-loopを実行してください。目的は Issue #2141 をそのまま実装することではありません。
この anchor comment の REQUEST_CHANGES を current
mainの repository evidence と照合し、Issue の problem statement / solution statement / Acceptance Criteria / Verification Commands / Allowed Paths / Outcome を再評価し、実装に進める前に Issue 契約を正しい状態へ refinement することです。実行方針
needs-fixが返った場合、current skill のmax_iterations/ loop policy の範囲内で自動継続してください。bypassPermissions、--dangerously-skip-permissions等を変更する意味ではありません。現在与えられている実行権限の範囲で進めてください。human_judgment_required/human_escalationを要求する場合だけ、その理由と unresolved blockers を明示して停止してください。単なる慎重論を理由に人間判断へ逃がさないでください。max_iterations到達までは、policy が自動継続を許す限り自動で修正・再レビューしてください。Anchor comment の扱い
この URL は今回、私が明示的に選択した human context です。
したがって、current
issue-refinement-loop/command_registry.py/ skill runtime policy を読み、現在の canonical human-context profile を使用してください。preflight.run.with_human_context等の profile を定義している場合、それを canonical executor 経由で使用すること。mainの SKILL.md / command registry を SSOT として exact invocation を導出してください。最初に行うこと
canonical
mainroot / default branch の状態を確認し、必要なら安全に同期してください。その後、current
mainの以下を必ず読んでください。.claude/skills/issue-refinement-loop/SKILL.md.claude/skills/issue-refinement-loop/references/index.mdscripts/command_registry.pyまたは current command registry SSOTdocs/dev/agent-skill-boundaries.md過去の記憶や古い worktree の内容ではなく、current
mainを根拠にしてください。Preflight
Step 0 / Step 0f を current canonical entrypoint から実行してください。
この anchor は human context なので、human-context lane を明示してください。
preflight / planner の出力を prose で勝手に再判定せず、
STATUSNEXT_ACTIONMUST_READCOMMANDS_JSONBLOCKERSARTIFACTをそのまま consumer contract に従って処理してください。
trusted contract patch plan / deterministic contract-update route が生成された場合は、current skill が許可する parent-owned canonical transaction を使用して構いません。
サブエージェントの使用
サブエージェントを必ず使用してください。
少なくとも Step 1 の investigation が planner により required なら、
codebase-investigatorを起動してください。調査対象には以下を含めてください。
pr_head_replay_publish_exec.py::execute()の current implementationsource_basesource_headexpected_remote_pr_headcurrent_base_branchexpected_current_base_sharoute_scope_clean_reconciliationroute_loop_verdict_v2impl-review-loopの current Step 5 / publish / update-branch routingimplement-issueのupdate_branchopen-prの lifecyclepr_head_replay_publish_exec関連 testscodebase-investigatorは read-only とし、Issue / repository を mutation させないでください。planner が Web research を required とした場合は
web-researcherも使用してください。両方 required なら並列起動して構いませんが、両サブエージェントの作業完了を必ず待ってください。
重要:
issue-refinement-loop自身が規定している top-level investigation / web research worker を禁止するものとして誤解しないでください。Web research
external claims が decision-dispositive なら、一次資料を優先してください。
特に必要なら以下を確認してください。
Git
git merge-tree --write-treeGit
push --force-with-lease=<ref>:<expect>GitHub REST API
Update a pull request branchexpected_head_shaGitHub GraphQL
mergeStateStatusブログや二次解説より公式 Git / GitHub documentation を優先してください。
ただし、Web research のために新しい security framework / approval layer を提案しないでください。
この repository は個人趣味開発です。品質・有用性・日常運用の単純さを優先し、guard / harness / security artifact を増やすこと自体を目的化しないでください。
Anchor comment の主要 Finding を fact-check すること
以下を「正しい前提」として盲目的に採用せず、current
mainに対して fact-check してください。A. replay/publish mutation を要求する production state が存在するか
最重要です。
現在の canonical flow を列挙し、
などの state ごとに、現在どの action / executor が担当しているかを確認してください。
そのうえで、
source_base..source_headを別 commit として PR head に replay/publish しなければならない production stateが本当に存在するかを証明してください。
「executor が存在するから caller が必要」という circular reasoningは禁止です。
B. authority producer
execute()が要求する各 SHA / branch input が、を確認してください。
producer が存在しないなら「caller を足せばよい」と結論しないでください。
C. AC1 false-green
現行 Issue の AC1 / Verification Command が、
execute()の production caller がゼロでも PASS し得るかを確認してください。
pr_head_replay_publish_execmodule の別 symbol、特にcompute_semantic_ambiguity()の import だけで genericrgがヒットするなら、AC1 は caller existence verification になっていません。D. AC2 false-green
test_pr_head_replay_publish_exec.py等が executor を直接テストしているだけで、production caller / route を通していないなら、それを明示してください。E. status contract
Issue が
successと書いている場合、current implementation の success status が本当にsuccessなのかokなのか確認してください。F. main-drift argument pair
current_base_branchとexpected_current_base_shaの片方だけを caller が渡した場合の挙動を確認してください。silent downgrade が存在するなら production wiring 前に reliability defect として扱うべきか評価してください。
G. merge-tree error classification
git merge-tree --write-treeのが executor 内で正しく区別されているか確認してください。
H. subprocess failures
TimeoutExpired/OSError等が structuredfailedresult に変換されるのか、例外として orchestration を落とすのか確認してください。I. open-pr
PR 作成前/後 lifecycle と
execute()の required inputs を比較し、open-prが caller 候補として自然か確認してください。J. BEHIND
current
impl-review-loopが BEHIND に対して既にimplement-issue.update_branch/ GitHub Update Branch API 等を使っているなら、それを replay executor に置換する合理的理由があるか確認してください。K. scope-clean reconciliation
evidence rebind / snapshot refresh と branch mutation を混同していないか確認してください。
推奨 disposition
以下を hypothesis / decision tree として扱ってください。結論を先に固定しないでください。
第一候補
調査の結果、replay/publish mutation を必要とする固有の production state が存在しないなら、
#2141 を「production caller を追加する implementation Issue」として維持しない
方向を第一候補にしてください。
その場合は current issue-refinement-loop の classification / termination policy に従い、
reframe_in_placesuperseded_by_decisionnot plannedのどれが canonical かを決定してください。
anchor comment は「not planned を第一候補」としていますが、「必ず今すぐ close せよ」という命令として雑に解釈しないでください。
canonical policy 上、close / not planned が十分に authority-backed で deterministic なら、追加承認を求めず実行して構いません。
一方で close authority が不足しているが Issue 契約の再構成は可能なら、無理に close せず
reframe_in_placeを完了してください。replay が本当に必要だった場合
production state が concrete に存在すると repository evidence で証明できた場合のみ、Issue を implementation-ready に再構成してください。
その場合:
impl-review-loopの明示的な専用 action として設計するopen-prに押し込まないupdate_branchlane を理由なく置換しないことを重視してください。
Acceptance Criteria / Verification Commands の修正
Issue を実装可能な形で残す場合、少なくとも以下の性質を検証できる VC にしてください。
execute()が exactly once 呼ばれる可能なら caller-level integration/unit test を VC にしてください。
reliability defect の扱い
anchor comment が挙げている以下は、production wiring 前の小さな reliability prerequisite 候補として評価してください。
merge-treeexit 1 のみ conflict、その他 nonzero は execution failureTimeoutExpired/OSErrorを structured failure に変換current_base_branchXORexpected_current_base_shaを invalid arguments とするただし、Issue #2141 の scope に機械的に全部追加しないでください。
replay executor を production 化しない disposition なら、その dead path の hardening 自体が不要になる可能性があります。
必要性・scope ownership・dedupe を確認し、current refinement policy に従ってください。
新規 Issue 作成が必要になった場合も、勝手に issue proliferation しないでください。current follow-up materialization / dedupe / scope policy が deterministic に許可する場合だけ行ってください。
Rewrite / Issue mutation
review 結果が
needs-fixで canonical route が rewrite を要求した場合は、current skill が指定する issue-author / issue-editor 等の mutation worker を使用してください。以下を許可します。
これらについて逐一私の承認を求める必要はありません。
ただし、この依頼は Issue refinement です。
以下はこの実行では行わないでください。
pr_head_replay_publish_exec.pyの production code 実装impl-review-loopによる implementationIssue が最終的に
implementation_readyになった場合でも、そこで refinement task を完了してください。実装フェーズへ自動的に進まないでください。Review
current
issue-refinement-loopの canonical Step 2 をそのまま使用してください。legacy な
issue-reviewerSubAgent を canonical Step 2 として独自に復活させないでください。current
mainがrun_root_review_pipeline.pyroot-owned producer を canonical としているなら、その結果を直接 consume してください。status / verdict / next_action の組を prose で再判定しないでください。
needs-fixなら iteration budget 内で rewrite → fresh review を自動継続してください。Issue body を変更した後は stale review / stale contract result を再利用せず、fresh readback と必要な fresh review/readiness を実行してください。
終了条件
次のいずれかになるまで続けてください。
approved/ implementation-ready になったnot planned/ superseded 等として完了したhuman_escalationhuman_judgment_required1 または 2 の場合は、人間の追加承認を待たずに refinement loop を完了してください。
3〜5 の場合だけ停止してください。
最終報告
最後に以下を簡潔に報告してください。
SubAgent の作業が残った状態では最終報告を出さないでください。
すべての起動済み SubAgent の完了を待ち、結果を join し、必要な GitHub readback を完了してから終了してください。
特に今回は、**「not planned を強制」ではなく「not planned を強い第一仮説として fact-check → canonical classification に従う」**形にしています。これならアンカーコメントの意図を保ちつつ、issue-refinement-loop 自身の authority/routing を迂回しません。
squne121 commentedon Aug 31, 2026
issue-refinement-loop: human_escalation
structural_repair_action.applyreturnedphase: complete,mutation_outcome: not_attempted,failure_code: transaction_execute_error; no Issue mutation was attempted.## Runtime Verification Applicabilitysection. The controlled transaction failed before mutation, so the canonical policy forbids retrying it blindly or falling through to a manual rewrite/review route.update_branch), scope-clean evidence reconciliation, ordinary publish, and PR creation. This observation was not applied to the Issue because the control-plane repair failure blocks the required fresh preflight/review cycle.squne121 commentedon Sep 2, 2026
結論
Verdict:
REQUEST_CHANGES。Issue #2141 は現状の契約のまま実装へ進めるべきではありません。再検証した結果、既存の敵対的レビューで指摘された中心問題は、2026-09-02 時点の
mainでも解消されていません。特に重要なのは、execute()が死んでいることそのものではなく、「どの production state が、この executor による source-range replay/publish を必要とするのか」が未定義なことです。PR #2118 自身もcompute_semantic_ambiguity()には production caller を与えた一方、execute()本体の caller は follow-up gap として残しています。さらに今は #2141 の広い Allowed Paths が、無関係に近い Issue #2467 を「#2141 merge 後まで開始しない」という依存状態にしています。個人開発でワークフロー効率を優先するなら、これは放置コストが実装メリットを上回り始めています。
敵対的レビュー結果
Severity | Finding | 評価 -- | -- | -- P0 | production caller 以前に input authority producer が存在しない | 現行コード検索では expected_remote_pr_head は executor 本体とテストにしか存在しません。source-base の CLI input も executor にしかありません。つまり source_base / source_head / expected_remote_pr_head を「同じ decision cycle の正本」として生成する production component がありません。caller を1行足すだけでは成立しません。 P0 | execute() は Update Branch の代替ではない | executor は既存 PR head から detached worktree を作り、source_base..source_head の net diff を git apply して新しい1コミットを追加し、それを lease 付き push します。current base は conflict/final-diff 検査に使うだけで、PR head を current main 上へ作り直す処理ではありません。 P0 | BEHIND には既に canonical executor がある | 現行 router は merge_state_status == BEHIND を明示的に implement-issue.update_branch へ route し、verification / PR review を再実行します。GitHub の公式 Update Branch API も base HEAD を PR branch へ merge するための API で、expected_head_sha 不一致は 422 で拒否します。こちらが BEHIND に対する自然な実装です。 (GitHub Docs) P0 | AC1 / AC2 が false-green | Issue の AC1 は generic rg "pr_head_replay_publish_exec" ですが、現行 production code はすでに同 module の compute_semantic_ambiguity() を import しています。したがって execute() を誰も呼ばなくても AC1 が green になります。AC2 も executor 自身の既存テストを実行するだけで caller 配線を証明しません。 P1 | production 化するには executor 自体の reliability 修正が必要なのに Out of Scope | _merge_tree_conflicts() は returncode != 0 を全部 conflict としています。しかし Git 公式仕様では 0=clean, 1=conflict, それ以外=実行エラーです。現状では Git 自体のエラーが意味上の conflict に化けます。 (Git) P1 | subprocess failure が workflow failure ではなく Python crash になり得る | replay executor の _run() は timeout=60 を設定する一方、TimeoutExpired / OSError を捕捉しません。対して既存 update_branch.py はこの2つを明示的に正規化しています。自動 caller を付ける前に揃えるべきです。 P1 | partial main-drift args が fail-closed せず通常モードへ downgrade | main_drift_reconciliation = bool(current_base_branch and expected_current_base_sha) なので片方だけ渡すと invalid_arguments ではなく reconciliation 無効として処理が進みます。production caller の typo が安全機構を静かに無効化します。 P1 | worktree cleanup failure が完全に捨てられる | git worktree remove --force が失敗しても cleanup_error は return result へ載らず、最後に _ = cleanup_error, pushed で捨てられます。頻繁に自動実行するなら .claude/worktrees/ の残骸が運用ノイズになります。セキュリティより実用上の friction として直す価値があります。 P1 | open-pr は lifecycle 上 caller 候補にならない | open_pr.py は検証後に gh pr create する PR 作成 wrapper です。一方 replay executor は既存の pr_number, headRefOid, target branch を最初から必要とします。PR 作成前には呼べず、作成直後なら「PRを作ってからそのheadを書き換える」という不自然な順序になります。 P1 | 広すぎる Allowed Paths が実際に他 Issue を止めている | #2467 は #2141 が .claude/skills/impl-review-loop subtree を広く持っているため、明示的に「#2141 merge 後に開始」としています。まだ caller file すら選定できていない Issue が、別の具体的改善の hard predecessor になっています。これはハーネス由来の実害です。 P2 | executor 自体には operator utility はありそう | PR #2070 の conflicting branch recovery では control-plane が exact-old lease と live readback を手動再現して reconciliation しています。したがって「機能自体が完全に無価値」とまでは言えません。ただしこれは 自動 Step 5 action より explicit recovery/operator tool のユースケースを支持する証拠です。外部仕様との照合
現在の replay publisher が使う exact form の
--force-with-lease=<ref>:<expect>は、remote ref が指定した<expect>と一致するときだけ update を許可する Git の正式な CAS 機構です。ここへさらに独自 locking・approval artifact・persistent ledger を追加する必要性は低いです。むしろ現在の exact lease を維持したまま mutation path を減らす方が、個人開発では合理的です。 (Git)また GitHub 自身が
BEHINDを「head ref is out of date」、DIRTYを「merge commit cannot be cleanly created」と別状態として定義しています。現行設計の BEHIND → Update Branch / scope-clean drift → evidence reconciliation / real conflict → hard stop という分離は upstream semantics と一致しています。#2141 を雑に replay executor へ接続すると、この分離を逆に壊します。 (GitHub Docs)推奨する reframe
優先順位は以下です。
実装: pr_head_replay_publish_exec.execute() の production caller を配線する #2141 をいったん
implementation-readyから外し、Allowed Paths を即座に narrow 化する。 少なくともopen-pr/**とimplement-issue/**の broad directory allowance は削除候補です。これだけでも 実装: impl-review-loop の runtime_only VC adjudication を current-head evidence に安全に接続する #2467 の不要な直列化を解除できる可能性があります。最初の AC を「production state proof」に置き換える。 「どの route/state で」「なぜ既存
update_branch/ scope-clean reconciliation では不足し」「どの component がsource_base,source_head,expected_remote_pr_headを authoritative に生成するか」をコード上の producer/call-site まで特定することを必須化します。その state が存在しないなら 実装: pr_head_replay_publish_exec.execute() の production caller を配線する #2141 は
not plannedが第一候補です。execute()は explicit operator/recovery utility として残してもよいです。PR fix(contract-review): RVA 欠落を fail-closed に統一 #2070 のような例外的な branch reconstruction には実用性があります。production caller が無いというだけで削除を急ぐ必要もありません。state が本当に存在するなら
impl-review-loopに専用replay_publishaction を1本だけ作る。open-prには入れず、BEHIND のupdate_branchも置換しません。producer → route → executor の1本の lifecycle としてsource_base/source_head/expected_remote_pr_head/current_base_shaを同一 decision cycle に束縛するべきです。配線前に executor の reliability debt を同じ Issue へ取り込む。
merge-treeの 0/1/error 分離、TimeoutExpired/OSError正規化、current-base args の XOR rejection、cleanup warning の返却は、security hardening ではなく「自動処理が無意味に止まらない」ための最低限です。VC を caller-level に作り直す。 generic
rgは廃止し、選定した production adapter を直接 test して、対象 route ではexecute()が exactly once、それ以外では zero times、ok / blocked / failedが正しく routing されることを検証します。なお executor の実際の成功 status はsuccessではなくokです。既に Issue コメントではほぼ同方向の
REQUEST_CHANGESが出ていますが、その後のissue-refinement-loopはstructural_repair_action.applyのtransaction_execute_errorという control-plane/environment failure で mutation 前に停止しています。つまり、レビューが反証されたのではなく、reframe が Issue 本文へ反映されないまま残っています。現時点での推奨 disposition は「#2141 を reframe → production state の存在を fact-check → 存在しなければ
not planned」です。 新しい security guard や承認ゲートを増やす方向は勧めません。むしろ未定義の mutation path と broad Allowed Paths を減らすことが、このリポジトリでは品質・有用性・作業速度の3つに効きます。必要なら次に、このレビューをそのまま #2141 の OWNER anchor comment として投稿できる形に整理するか、
## 結論issue-refinement-loopに人間承認なしで reframe させる Claude-GPT 用プロンプトまで作れます。Verdict:
REQUEST_CHANGES。Issue #2141 は現状の契約のまま実装へ進めるべきではありません。再検証した結果、既存の敵対的レビューで指摘された中心問題は、2026-09-02 時点の
mainでも解消されていません。特に重要なのは、execute()が死んでいることそのものではなく、「どの production state が、この executor による source-range replay/publish を必要とするのか」が未定義なことです。PR #2118 自身もcompute_semantic_ambiguity()には production caller を与えた一方、execute()本体の caller は follow-up gap として残しています。さらに今は #2141 の広い Allowed Paths が、無関係に近い Issue #2467 を「#2141 merge 後まで開始しない」という依存状態にしています。個人開発でワークフロー効率を優先するなら、これは放置コストが実装メリットを上回り始めています。
敵対的レビュー結果
expected_remote_pr_headは executor 本体とテストにしか存在しません。source-baseの CLI input も executor にしかありません。つまりsource_base/source_head/expected_remote_pr_headを「同じ decision cycle の正本」として生成する production component がありません。caller を1行足すだけでは成立しません。execute()は Update Branch の代替ではないsource_base..source_headの net diff をgit applyして新しい1コミットを追加し、それを lease 付き push します。current base は conflict/final-diff 検査に使うだけで、PR head を current main 上へ作り直す処理ではありません。merge_state_status == BEHINDを明示的にimplement-issue.update_branchへ route し、verification / PR review を再実行します。GitHub の公式 Update Branch API も base HEAD を PR branch へ merge するための API で、expected_head_sha不一致は 422 で拒否します。こちらが BEHIND に対する自然な実装です。 ([GitHub Docs]1)rg "pr_head_replay_publish_exec"ですが、現行 production code はすでに同 module のcompute_semantic_ambiguity()を import しています。したがってexecute()を誰も呼ばなくても AC1 が green になります。AC2 も executor 自身の既存テストを実行するだけで caller 配線を証明しません。_merge_tree_conflicts()はreturncode != 0を全部 conflict としています。しかし Git 公式仕様では0=clean,1=conflict, それ以外=実行エラーです。現状では Git 自体のエラーが意味上の conflict に化けます。 (Git)_run()は timeout=60 を設定する一方、TimeoutExpired/OSErrorを捕捉しません。対して既存update_branch.pyはこの2つを明示的に正規化しています。自動 caller を付ける前に揃えるべきです。main_drift_reconciliation = bool(current_base_branch and expected_current_base_sha)なので片方だけ渡すとinvalid_argumentsではなく reconciliation 無効として処理が進みます。production caller の typo が安全機構を静かに無効化します。git worktree remove --forceが失敗してもcleanup_errorは return result へ載らず、最後に_ = cleanup_error, pushedで捨てられます。頻繁に自動実行するなら.claude/worktrees/の残骸が運用ノイズになります。セキュリティより実用上の friction として直す価値があります。open-prは lifecycle 上 caller 候補にならないopen_pr.pyは検証後にgh pr createする PR 作成 wrapper です。一方 replay executor は既存のpr_number,headRefOid, target branch を最初から必要とします。PR 作成前には呼べず、作成直後なら「PRを作ってからそのheadを書き換える」という不自然な順序になります。.claude/skills/impl-review-loopsubtree を広く持っているため、明示的に「#2141 merge 後に開始」としています。まだ caller file すら選定できていない Issue が、別の具体的改善の hard predecessor になっています。これはハーネス由来の実害です。外部仕様との照合
現在の replay publisher が使う exact form の
--force-with-lease=<ref>:<expect>は、remote ref が指定した<expect>と一致するときだけ update を許可する Git の正式な CAS 機構です。ここへさらに独自 locking・approval artifact・persistent ledger を追加する必要性は低いです。むしろ現在の exact lease を維持したまま mutation path を減らす方が、個人開発では合理的です。 (Git)また GitHub 自身が
BEHINDを「head ref is out of date」、DIRTYを「merge commit cannot be cleanly created」と別状態として定義しています。現行設計の BEHIND → Update Branch / scope-clean drift → evidence reconciliation / real conflict → hard stop という分離は upstream semantics と一致しています。#2141 を雑に replay executor へ接続すると、この分離を逆に壊します。 ([GitHub Docs]4)推奨する reframe
優先順位は以下です。
実装: pr_head_replay_publish_exec.execute() の production caller を配線する #2141 をいったん
implementation-readyから外し、Allowed Paths を即座に narrow 化する。 少なくともopen-pr/**とimplement-issue/**の broad directory allowance は削除候補です。これだけでも 実装: impl-review-loop の runtime_only VC adjudication を current-head evidence に安全に接続する #2467 の不要な直列化を解除できる可能性があります。最初の AC を「production state proof」に置き換える。 「どの route/state で」「なぜ既存
update_branch/ scope-clean reconciliation では不足し」「どの component がsource_base,source_head,expected_remote_pr_headを authoritative に生成するか」をコード上の producer/call-site まで特定することを必須化します。その state が存在しないなら 実装: pr_head_replay_publish_exec.execute() の production caller を配線する #2141 は
not plannedが第一候補です。execute()は explicit operator/recovery utility として残してもよいです。PR fix(contract-review): RVA 欠落を fail-closed に統一 #2070 のような例外的な branch reconstruction には実用性があります。production caller が無いというだけで削除を急ぐ必要もありません。state が本当に存在するなら
impl-review-loopに専用replay_publishaction を1本だけ作る。open-prには入れず、BEHIND のupdate_branchも置換しません。producer → route → executor の1本の lifecycle としてsource_base/source_head/expected_remote_pr_head/current_base_shaを同一 decision cycle に束縛するべきです。配線前に executor の reliability debt を同じ Issue へ取り込む。
merge-treeの 0/1/error 分離、TimeoutExpired/OSError正規化、current-base args の XOR rejection、cleanup warning の返却は、security hardening ではなく「自動処理が無意味に止まらない」ための最低限です。VC を caller-level に作り直す。 generic
rgは廃止し、選定した production adapter を直接 test して、対象 route ではexecute()が exactly once、それ以外では zero times、ok / blocked / failedが正しく routing されることを検証します。なお executor の実際の成功 status はsuccessではなくokです。既に Issue コメントではほぼ同方向の
REQUEST_CHANGESが出ていますが、その後のissue-refinement-loopはstructural_repair_action.applyのtransaction_execute_errorという control-plane/environment failure で mutation 前に停止しています。つまり、レビューが反証されたのではなく、reframe が Issue 本文へ反映されないまま残っています。現時点での推奨 disposition は「#2141 を reframe → production state の存在を fact-check → 存在しなければ
not planned」です。 新しい security guard や承認ゲートを増やす方向は勧めません。むしろ未定義の mutation path と broad Allowed Paths を減らすことが、このリポジトリでは品質・有用性・作業速度の3つに効きます。必要なら次に、このレビューをそのまま #2141 の OWNER anchor comment として投稿できる形に整理するか、
issue-refinement-loopに人間承認なしで reframe させる Claude-GPT 用プロンプトまで作れます。squne121 commentedon Sep 2, 2026
確認した範囲では、#2141 はまだ元の「production caller を配線する」契約のまま OPEN です。 一方、直前の refinement は
structural_repair_action.applyのtransaction_execute_errorで mutation 前に停止しており、その調査では production replay を必須とする state は見つかっていません。 最新 OWNER コメントも、第一候補を 「reframe → production state を fresh fact-check → 存在しなければ not planned」 としています。したがって、今回は「caller を作る方向へ誘導」せず、fresh evidence が同じ結論なら Claude Code 自身に
not plannedまで処理させるのを推奨します。#2467 は現在も本文上#2141 merge 後に開始としており、#2141 の broad Allowed Paths が実際の直列化要因になっています。#2141 (comment)
を operator_asserted_human_context の OWNER anchor として扱い、Issue #2141 に対して
issue-refinement-loopを実行してください。目的は、現在の Issue 本文を前提に無理に implementation-ready にすることではありません。anchor comment の REQUEST_CHANGES を fresh current-main evidence で検証し、Issue #2141 を最も合理的な disposition へ収束させることです。
実行方針
issue-refinement-loopの canonical workflow / SSOT / command registry / routing に従うこと。anchor_comment_urlは上記 URL を使用すること。preflight.run.with_human_context等、現在の canonical profile を使用すること。needs_fixは iteration 上限まで自動継続すること。今回は最大 5 iteration まで許可する。最優先で検証する仮説
最新 anchor の中心仮説を fresh current-main で再検証すること。
pr_head_replay_publish_exec.py::execute()を必要とする production state transition が本当に存在するか。source_base,source_head,expected_remote_pr_headおよび必要な current-base authority を、同一 decision cycle で authoritative に生成する production producer が存在するか。BEHINDは既存implement-issue.update_branchで処理されており、replay executor を必要としていないか。既存レビューの結論を盲信せず、current main、関連 Issue / PR / comments、production call sites、tests、design references を read-only に調査して裏付けること。
SubAgent の使用
調査は必要に応じて
codebase-investigatorSubAgent に委譲すること。外部仕様が disposition に影響する場合のみ、planner / skill contract に従って
web-researcherを使用してよい。重要:
in_progress/running/ background 実行中の状態で次の routing decision や最終回答へ進まないこと。推奨 disposition
fresh fact-check の結果に基づき、以下を優先順位として機械的に選択すること。
A. production replay state が存在しない場合 — 第一候補
Issue #2141 を
not plannedに収束させる。この場合:
execute()は explicit operator/recovery utility として残す選択を許容する。issue-refinement-loopの dependency-materialization policy が許す範囲で整合させる。B. production replay state が実在する場合
#2141 を implementation-ready へ直接戻さず、まず proof-first contract に reframe する。
少なくとも以下を contract に反映すること。
impl-review-loopの専用replay_publish相当 action 1本に限定する。open-prを caller 候補から除外する。BEHIND -> update_branchを replay executor で置換しない。さらに production wiring を要求するなら、anchor で指摘された reliability debt が caller 導入を妨げないか検証し、必要なら同一 contract に取り込むこと:
git merge-tree --write-treeの exit 0 / 1 / execution error の分離TimeoutExpired/OSErrorの workflow status への正規化これは security hardening の追加ではなく、自動 workflow の不要な crash / stop / residue を減らす reliability 修正として扱うこと。
Acceptance Criteria / Verification Commands の修正方針
現行の generic
rg -n "pr_head_replay_publish_exec" ...は
compute_semantic_ambiguity()import でも green になるため、production caller の証明として使用しないこと。もし production wiring を維持する disposition なら caller-level VC に変更し、少なくとも以下を検証すること。
replay_publishroute →execute()exactly onceexecute()zero timesok→ downstream verification / PR review rerunblocked→ fresh readback / reroutefailed→ workflow failure として正規化successではなくok前回 environment failure の扱い
前回の refinement は
structural_repair_action.applyが:phase: completemutation_outcome: not_attemptedfailure_code: transaction_execute_errorで停止している。
今回はこれを「レビュー内容が否定された」と扱わないこと。
まず current canonical preflight を fresh に実行し、現在も同じ failure が再現するか確認する。
再現した場合:
fix_environment/ deterministic repair route が提示されるならそれを使用する。gh issue edit等で横抜けして consistency contract を破壊しない。環境が回復したら fresh preflight から再開する。
許可する操作
このタスクを完了するために必要な範囲で、以下は事前承認済みとして扱ってよい。
issue-refinement-loopが要求する Issue 実装: pr_head_replay_publish_exec.execute() の production caller を配線する #2141 body / labels / state の mutationnot plannedcloseneeds_fixになった場合の rewrite と再レビューこれらについて個別の human approval を求めないこと。
やらないこと
execute()を削除しない。open-prに replay publisher を接続しない。完了条件
issue-refinement-loopの canonical termination まで進めること。望ましい最終状態は fresh evidence に応じて次のいずれか。
not plannedとして整合的に終了している。途中の「調査完了」「SubAgent 起動済み」「Issue body 更新済み」は完了ではない。
最後に以下を簡潔に報告すること。
人間への途中承認要求は行わず、自律的に canonical loop を最後まで進めてください。
この形なら、前回と同じ
transaction_execute_errorに遭遇した場合にも「待つ/人間に聞く」ではなく、まず deterministic recovery を試しつつ、manual rewrite で canonical transaction を迂回する事故も防げます。また、最新コメントの evidence が再現されれば、実装 Issue を無理に延命せずnot plannedまで進める指示になっています。squne121 commentedon Sep 2, 2026
issue-refinement-loop: disposition = not planned
issue-refinement-loopStep 0f/2 preflight:STATUS: needs_fix/apply_deterministic_structural_repair(## Runtime Verification Applicability欠落)。candidate readiness はEXTSURF001(Allowed Paths が extension-surface risk-trigger policy のimmediateルールと重複するがdecision: not_applicableの候補は不整合)でmutation_outcome: not_attemptedに留まり auto-apply されなかった(transaction_execute_errorの再現ではなく、readiness gate 自体が拒否)。この構造欠陥は本 disposition により本文書き換えではなく Issue close で解消する。Fresh fact-check(current main、read-only investigation)
anchor の中心仮説を
codebase-investigatorで再検証した結果:pr_head_replay_publish_exec.py::execute()の production caller は存在しない。rg -n "pr_head_replay_publish_exec" --type py -g '!**/tests/**' .にヒットするのはrun_refinement_preflight.py/plan_issue_scope_rollup.pyのコメント参照のみで、実際にexecute()を呼ぶ非テストコードは無い。route_loop_verdict_v2.pyが import しているのは同モジュールのcompute_semantic_ambiguity()のみ(PR fix(loop): main drift evidence を再束縛する (#2102) #2118 で既に production caller 獲得済み、対象外)。source_base/source_head/expected_remote_pr_headを同一 decision cycle で authoritative に生成する production producer は存在しない。 これら識別子はpr_head_replay_publish_exec.py自身(関数引数・CLI)以外のどこにも定義されていない。BEHINDは既存implement-issue.update_branch相当(route_loop_verdict_v2.pyのroute_to_update_branchfast-path)で処理されている。 replay executor を必要としない。.claude/skills/impl-review-loop/steps/step-5-feedback-and-termination.md)で reconciliation されており、pr_head_replay_publish_exec.execute()を経由しない。open-pr/implement-issueの publish lane にpr_head_replay_publish_execへの参照・接続の必然性を示す既存コードは無い。open-prは PR 作成前提の wrapper であり、replay executor が要求する既存pr_number/headRefOidと lifecycle 順序が合わない。これにより、anchor が提示した「production replay state が存在しない場合」の条件が fresh evidence で成立していると判断する。
Disposition
Issue #2141 を
not plannedとして収束させる。pr_head_replay_publish_exec.py::execute()はコード変更しない。production caller が無いことのみを理由に削除しない。PR fix(contract-review): RVA 欠落を fail-closed に統一 #2070 の recovery 事例が示すとおり、explicit operator/recovery utility として残す。.claude/skills/impl-review-loop/**、.claude/skills/open-pr/**、.claude/skills/implement-issue/**の broad directory allowance)に起因する不要な overlap / dependency blocking を close により解消する。#2467 への影響
Issue #2467 の本文は native GitHub dependency(
blockedBy/trackedIssues)ではなく、prose 上の#2141 merge 後に開始するという記述にのみ依存している(GraphQL 確認:trackedIssues/trackedInIssuesは空)。#2141 がnot plannedで close されるため、この prose dependency は stale になる。issue-editor経由で該当箇所のみを narrow に修正し、#2467 が #2141 merge を待たず着手可能である旨へ更新する。