Repository navigation
Description
Machine-Readable Contract
contract_schema_version: "v1"
issue_kind: "implementation"
parent_issue: "#1950"
goal_ref: "#1975"
change_kind: "integration"Parent Issue
(多段 owner turn の chronology metadata 化と reaction decision flow の issue-refinement-loop / impl-review-loop への導入)
Parent Goal Ref
#1950 の Goal は、owner の reaction による意思決定を issue-refinement-loop / impl-review-loop の判断フローへ chronology metadata として組み込むことである。本 Issue はその一部として、#1975 で実装された owner_reaction_decision.py の出力(selected_option_id)を、実際の heavy mutation gate 実行判断へ接続する未着手区間を扱う。
Current Validated Scope
owner_reaction_decision.py(.claude/skills/issue-refinement-loop/scripts/owner_reaction_decision.py)は PR feat: owner reaction 手順を決定論的 reaction reader/principal resolver/drift checker/selection resolver として実装する #2683(Issue 実装: owner reaction 手順を決定論的 reaction reader/principal resolver/drift checker/mutation consumer として実装する #1975)で実装済み・マージ済み。read-only CLI として owner reaction を読み取りselected_option_idを確定するところまでが検証済みスコープ。- 同スクリプトの docstring には明示的に「
approved_by_trusted_anchorへは変換せず、既存の heavy mutation gate へは配線しない」と記載されている(.claude/skills/issue-refinement-loop/scripts/owner_reaction_decision.py冒頭コメント参照)。 .claude/skills/issue-refinement-loop/scripts/run_refinement_preflight.pyの_classify_heavy_mutation_gate()/_is_approved_close_not_planned_decision()は、close_not_plannedかつauthorized_mutation_category == "not_planned"の完全一致のみを受理する fail-closed 実装として PR fix: normalize close-not-planned anchor decisions #2478 で確定済みであり、owner_reaction_decision.pyの出力はこの gate に接続されていない。- Issue 実装: owner_reaction.decide の skill_runtime_exec.py generic dispatch 配線を行う(#1975 の Out of Scope) #2688(
owner_reaction.decide/owner_reaction.decide.fixtureのscripts/agent-guards/skill_runtime_exec.pyexact dispatch 配線)は PR feat: owner_reaction.decide を skill_runtime_exec.py の exact dispatch に配線する #2694 で完了・マージ済み(origin/mainコミット10bbcf85c0bd7c33fc25f07617488d27b254703d時点で反映済み)。これによりowner_reaction_decision.pyは canonical CLI からowner_reaction.decideとして fresh 実行可能である(.claude/skills/issue-refinement-loop/scripts/command_registry.pyのowner_reaction.decideエントリ、scripts/agent-guards/skill_runtime_exec.pyの対応する exact dispatch 分岐を参照。いずれも既に production 到達可能であり、本 Issue はこれらのファイルを変更しない)。
Remaining Parent Gaps
- 本 Issue は 5 種類の heavy mutation カテゴリ(
close/not_planned/replacement_issue_creation/dependency_removal/parent_child_change)のうちnot_plannedのみを配線対象とする。これは「今回どこまで機能を実装するか」という rollout scope の決定であり、runtime mutation の個別承認(owner reaction 自体)とは別軸である。 - 他の heavy mutation カテゴリ(
close/replacement_issue_creation/dependency_removal/parent_child_change)への解禁範囲拡張は、operation+targetを表現する canonical mutation-intent contract が確立してから、別 Issue として follow-up 化する。本 Issue はそれらのカテゴリをnot_plannedと同じ仕組みで扱えるよう一般化しない。
Outcome
owner_reaction_decision.py(owner_reaction.decide として fresh 実行)が返す OWNER_REACTION_DECISION_RESULT_V1 の selected 判定結果を、run_refinement_preflight.py の heavy mutation gate へ、既存 gate が唯一意味を持つ not_planned(close_not_planned)ケースに限定して、exact option/target binding を維持したまま production 接続する。
接続は run_refinement_preflight.py が heavy mutation gate 評価直前に owner_reaction_decision.py を(owner_reaction.decide の canonical argv shape と同一の引数で)fresh subprocess 実行し、その invocation の結果だけを使う設計とする。この設計のため、run_refinement_preflight.py CLI に mutation_category / owner_reaction_context(owner_user_id / preview_binding_file を含む)を canonical dispatch(skill_runtime_exec.py → command_registry.render_command())から供給する transport を確立し、production 接続する(PR #2697 の OWNER レビュー comment #5755475318 で、既存 Allowed Paths 4件のみでは canonical dispatch chain が mutation_category / owner_reaction_context を運べず production 到達不能であることが確認されたため、command_registry.py / skill_runtime_exec.py / skill_runtime_command_policy.py を Allowed Paths に追加する)。この設計により、preflight.run.with_human_context / contract_update.run.with_human_context のどちらの既存 canonical entrypoint から run_refinement_preflight.py が起動されても、追加の dispatcher 変更なしに接続が到達可能になる。
authorization は既存の trusted-anchor gate(_is_approved_close_not_planned_decision())とは意味を混同しない独立した predicate(例: _is_approved_owner_reaction_not_planned_decision(...))として実装し、少なくとも以下を要求する:
OWNER_REACTION_DECISION_RESULT_V1.status == "selected"selected_option_metadata.operation == "close_not_planned"- selected option の target identity が、その mutation が適用される対象 Issue と完全一致する
- 同一 operation/category でも別 target の option は承認済みとして扱わない(
test_preview_binding_primary_identityが固定する identity-binding 契約を壊さない) selectedをapproved_by_trusted_anchorに変換しない(authority semantics を混同しない)
close / replacement_issue_creation / dependency_removal / parent_child_change は本 Issue では fail-closed のまま維持する。authorization artifact の永続保存や TTL/ledger framework は新設しない。
Runtime Verification Applicability
decision: immediate
reason: >
`_is_approved_owner_reaction_not_planned_decision(...)` の gate 統合は subagent
lifecycle / skill invocation procedure に影響する extension-surface
risk-trigger(skill-invocation-procedure-or-contract-change)に該当し、かつ
#2694 で確立した fake-gh + real scripts/agent-guards/skill_runtime_exec.py
subprocess fixture(.claude/skills/issue-refinement-loop/tests/owner_reaction_dispatch_fixture.py)
を再利用すれば、live GitHub Actions や実 reaction mutation なしに
production-shaped な producer→consumer path を focused pytest で直接検証できる。
よって deferred のままにせず immediate verification とする。
applicable_acs:
- AC4
- AC6
execution_environment:
cli_tools:
- python3
- uv
auth_required: false
network_required: false
skip_conditions:
- condition: uv または python3 venv が起動できない
action: exit 77 SKIP とし、docs/dev/runtime-verification-policy.md の SKIP 規約に従って証跡を残す
fallback_policy: >
fake-gh fixture を経由しない unit-only テスト(hand-crafted known_context を
直接渡すテストのみ)での PASS は AC4 / AC6 の充足とみなさない。real
scripts/agent-guards/skill_runtime_exec.py subprocess 経路を通したテストの
PASS のみを正とする。
artifact_requirements:
- pytest 実行ログを PR 本文または PR コメントに証跡として貼付する
- 新規 fixture 出力ファイルは .claude/skills/issue-refinement-loop/tests/ 配下に置くIn Scope
owner_reaction_decision.pyのselected出力(OWNER_REACTION_DECISION_RESULT_V1)を fresh 実行し、run_refinement_preflight.pyの heavy mutation gate 判定へ渡すための変換・受け渡しロジックの実装close_not_planned+ exact target binding のみを許可する、既存 trusted-anchor gate とは独立した predicate/adapter(_is_approved_owner_reaction_not_planned_decision(...)相当)の実装- heavy mutation gate 評価直前に
owner_reaction_decision.pyを fresh subprocess 実行し、その invocation の結果だけを使う(保存済み/キャッシュ済み authorization artifact を再利用しない)freshness 境界の実装 run_refinement_preflight.pyの既存 Allowed Paths のみで到達可能な canonical production entrypoint からの transport(scripts/agent-guards/skill_runtime_exec.py/command_registry.py/skill_runtime_command_policy.pyへの変更なし)- 既存 fail-closed 挙動(
close/replacement_issue_creation/dependency_removal/parent_child_changeおよびunresolved/stale/environment_errorは必ず拒否)を壊さないことを保証する回帰テストの追加 - feat: owner_reaction.decide を skill_runtime_exec.py の exact dispatch に配線する #2694 の fake-
gh+ realskill_runtime_exec.pysubprocess fixture(owner_reaction_dispatch_fixture.py)を再利用した production-shaped verification の追加 - 関連する
.claude/skills/issue-refinement-loop/SKILL.mdの記述更新(配線が実装された場合の docstring/コメント更新を含む)
Out of Scope
owner_reaction_decision.py自体の reaction 読み取りロジックの変更(実装: owner reaction 手順を決定論的 reaction reader/principal resolver/drift checker/mutation consumer として実装する #1975 で確定済み)impl-review-loop側への同種配線の実装(別スコープとして follow-up 化する)close/replacement_issue_creation/dependency_removal/parent_child_changeの heavy mutation カテゴリへの解禁範囲拡張(not_planned以外は fail-closed のまま維持し、本 Issue では扱わない)- generic な mutation-authorization framework(5 カテゴリを一般化する共通機構)の新設
- authorization artifact の永続保存・TTL/ledger framework の新設
- fake/stub は GitHub network boundary(
ghCLI 呼び出し)に限定すること。canonical dispatch chain(skill_runtime_exec.py→command_registry.render_command()→run_refinement_preflight.pyCLImain()→run_preflight())はそれ以外は real code path を通すこと。今回開放する mutation category は引き続きnot_plannedのみとし、close/replacement_issue_creation/dependency_removal/parent_child_changeは fail-closed のまま維持する。generic authorization framework や authorization artifact の ledger/TTL 永続化は追加しない。 - 無関係な harness / security framework の増設
Acceptance Criteria
- AC1:
run_refinement_preflight.pyに、既存の trusted-anchor gate(_is_approved_close_not_planned_decision())とは独立した predicate(_is_approved_owner_reaction_not_planned_decision(...)相当)が実装されており、OWNER_REACTION_DECISION_RESULT_V1.status == "selected"かつselected_option_metadata.operation == "close_not_planned"かつ selected option の target identity が対象 Issue と完全一致する場合にのみ true を返す - AC2: 同一
close_not_plannedoperation でも target が異なる option は拒否される(selected_option_idの identity を collapse しない)ことが、test_preview_binding_primary_identityの identity-binding 契約に整合する回帰テストで示されている - AC3:
statusがunresolved/stale/environment_errorの場合、およびclose/replacement_issue_creation/dependency_removal/parent_child_changeの mutation category の場合は fail-closed(gate 拒否)のままであることが回帰テストで示されている - AC4: heavy mutation gate 評価の直前に
owner_reaction_decision.pyが fresh subprocess 実行され、run_refinement_preflight.pyの同一 invocation 内で得られた結果だけが gate 判定に使われる(保存済み/キャッシュ済み結果の再利用がない)ことがテストで示されている - AC5:
selectedをapproved_by_trusted_anchorに変換していない(新 predicate が既存の anchor-authority 変換ロジックを呼び出さず、_is_approved_close_not_planned_decision()の既存実装を変更しない)ことがコードレベルで示されている - AC6: real
scripts/agent-guards/skill_runtime_exec.py→ exact command parser/policy(skill_runtime_command_policy.py)→command_registry.render_command()→run_refinement_preflight.pyCLImain()→cli_known_contextmaterialization →run_preflight()→_classify_heavy_mutation_gate_with_fresh_owner_reaction()→ freshowner_reaction_decision.pysubprocess →_classify_heavy_mutation_gate()という実 chain が、producer/consumer をテストコードで手動接続することなく、1本の real subprocess 起動で通ることを示す pytest が存在すること(fake は GitHub network boundary(ghCLI)に限定してよい)。加えて、_run_owner_reaction_decision_fresh()は child subprocess の non-zero returncode を明示的に fail-closed 扱いすること(returncode != 0 かつ stdout が parseable JSON であっても transport success として扱わない regression test を含む)。また_classify_heavy_mutation_gate_with_fresh_owner_reaction()系の predicate はdecision.get("schema") == "OWNER_REACTION_DECISION_RESULT_V1"相当の schema identity を検証すること - AC7: 既存の
_classify_heavy_mutation_gate()/_is_approved_close_not_planned_decision()の既存テストが全て継続してパスする
Verification Commands
# AC1
$ rg -n "_is_approved_owner_reaction_not_planned_decision" .claude/skills/issue-refinement-loop/scripts/run_refinement_preflight.py
# AC2
$ uv run --locked pytest .claude/skills/issue-refinement-loop/tests/test_owner_reaction_not_planned_gate.py::test_same_category_different_target_rejected -v
# AC3
$ uv run --locked pytest .claude/skills/issue-refinement-loop/tests/test_owner_reaction_not_planned_gate.py::test_unresolved_stale_environment_error_and_unsupported_category_fail_closed -v
# AC4
$ uv run --locked pytest .claude/skills/issue-refinement-loop/tests/test_owner_reaction_not_planned_gate.py::test_gate_uses_fresh_invocation_result_only -v
# AC5
$ uv run --locked pytest .claude/skills/issue-refinement-loop/tests/test_owner_reaction_not_planned_gate.py::test_new_predicate_does_not_convert_to_approved_by_trusted_anchor -v
# AC6
$ uv run --locked pytest .claude/skills/issue-refinement-loop/tests/test_owner_reaction_not_planned_gate_production_shaped.py::test_selected_not_planned_reaches_gate_via_real_subprocess -v
# AC7
$ uv run --locked pytest .claude/skills/issue-refinement-loop/tests/test_run_refinement_preflight_credentialless_transport.py -vAllowed Paths
.claude/skills/issue-refinement-loop/scripts/run_refinement_preflight.py.claude/skills/issue-refinement-loop/scripts/owner_reaction_decision.py.claude/skills/issue-refinement-loop/tests/.claude/skills/issue-refinement-loop/SKILL.md.claude/skills/issue-refinement-loop/scripts/command_registry.pyscripts/agent-guards/skill_runtime_exec.pyscripts/agent-guards/skill_runtime_command_policy.pyscripts/agent-guards/tests/(関連テストのみ)
Stop Conditions
- Allowed Paths 外の変更が必要と判明した場合(
scripts/agent-guards/skill_runtime_exec.py/.claude/skills/issue-refinement-loop/scripts/command_registry.py/scripts/agent-guards/skill_runtime_command_policy.pyへの変更は、PR feat: owner_reaction_decision.py の selected 出力を not_planned heavy mutation gate へ限定接続する #2697 OWNER レビュー comment #5755475318 を受けて本 Issue については上記 Allowed Paths 拡張により解消済み。以後の Allowed Paths 拡張が必要になった場合は改めて判断する) - In Scope の固定契約(キー集合・スキーマ・型定義)の変更が必要になった場合
- 新規 Issue の起票が必要と判断した場合(スコープ分割が発生する場合)
- 後続 Phase / 別スコープへの波及が判明した場合
- nested SubAgent delegation が必要になった場合
- 外部サービス利用・権限昇格・既存テスト大規模改変が必要になった場合
Required Skills
- Python(pytest ベースの契約テスト設計)
- GitHub Actions ワークフロー上での reaction ベース owner 判断の運用理解
Required Design References
.claude/skills/issue-refinement-loop/scripts/owner_reaction_decision.py(実装: owner reaction 手順を決定論的 reaction reader/principal resolver/drift checker/mutation consumer として実装する #1975 実装、PR feat: owner reaction 手順を決定論的 reaction reader/principal resolver/drift checker/selection resolver として実装する #2683).claude/skills/issue-refinement-loop/scripts/run_refinement_preflight.py(PR fix: normalize close-not-planned anchor decisions #2478 で確定した fail-closed gate 実装).claude/skills/issue-refinement-loop/SKILL.md(Step 2 canonical review routing・producer/consumer 境界の正本)
Delivery Rule
1 Issue = 1 PRを原則とする。worktree は.claude/worktrees/issue-2689-*命名規約に従う。run_refinement_preflight.py/.claude/skills/issue-refinement-loop/tests/を Allowed Paths に含む他の OPEN Issue(例: 実装: run_refinement_preflight.py の結果に decisions フィールドを出力しSKILL.mdとのSSOT乖離を解消する #1556、Outcome はdecisionsフィールド出力で本 Issue とは edit_intent が異なる)と並行実装する場合は、マージコンフリクトに注意し、後着手側が rebase する。- Draft PR を既定とし、
impl-review-loopの APPROVE 判定を経てから ready for review にする。
Notes for Reviewer
Scope Collision (C1, overlap preflight check_issue_overlap.py): run_refinement_preflight.py および .claude/skills/issue-refinement-loop/tests/ を Allowed Paths に含む OPEN Issue が現時点(2026-09-21、origin/main = 10bbcf85c0bd7c33fc25f07617488d27b254703d)で存在する(例: #1556、Outcome は decisions フィールド出力で本 Issue とは異なる edit_intent のため重複ではない)。#2688 と #2678 は同様の Scope Collision 候補として以前挙げられていたが、いずれも現在は CLOSED であり本 Issue の着手を妨げない。並行実装する場合の直列化方針は上記 ## Delivery Rule を参照する。
Production wiring 設計(PR #2697 OWNER レビュー comment #5755475318 を受けた修正): owner_reaction.decide / owner_reaction.decide.fixture は #2694(Issue #2688)で既に scripts/agent-guards/skill_runtime_exec.py の exact dispatch に接続済みである。ただし当初想定していた「既存 4 パスの Allowed Paths だけで production 到達可能」という設計は、canonical dispatch chain(skill_runtime_exec.py → command_registry.py → run_refinement_preflight.py CLI main() → run_preflight())が mutation_category / owner_reaction_context を運ばないため成立しないことが判明した(初期 adversarial review comment #5754526086 の懸念が再発)。そのため command_registry.py / skill_runtime_exec.py / skill_runtime_command_policy.py を Allowed Paths に追加し、これらを経由する transport を確立したうえで、run_refinement_preflight.py が owner_reaction_decision.py を fresh subprocess として直接呼び出す設計(## Outcome 参照)により production entrypoint(preflight.run.with_human_context / contract_update.run.with_human_context のいずれの既存 canonical dispatch からでも)から到達可能にする。
owner allowlist 判断: 本 Issue の対象コメント(issuecomment-5754526086、operator-selected human context)により、5 種類の heavy mutation カテゴリのうち今回配線するのは not_planned のみであることが OWNER により明示的に確定している。他カテゴリへの解禁は別 Issue の follow-up 判断に委ねる。
Source
- dedupe_key:
follow-up:squne121/loop-protocol:pr/2683:not_controlled_2 - origin_pr: feat: owner reaction 手順を決定論的 reaction reader/principal resolver/drift checker/selection resolver として実装する #2683
- origin_issue: 実装: owner reaction 手順を決定論的 reaction reader/principal resolver/drift checker/mutation consumer として実装する #1975
- detected_during: post-merge-cleanup
Activity
squne121 commentedon Sep 21, 2026
結論
Issue #2689 は必要な統合ですが、現状の契約のまま実装するのは REQUEST_CHANGES 相当です。特に、
selected_option_idを heavy mutation gate へ接続する経路が canonical production path に存在しない点と、「特定 option への owner 承認」を「mutation category 全体の承認」に拡大し得る点が大きな問題です。2026-09-21 11:04 JST 時点の fresh read では、#2689 のコメントは 0件で、要求されている owner allowlist 判断もまだありません。一方、#2688 は PR #2694 で完了し、現在の
mainは10bbcf85c0bd7c33fc25f07617488d27b254703dです。つまり #2689 の本文は既に一部 stale です。Issue #2689 PR #2694敵対的レビュー
P0 — 現在の Allowed Paths では production wiring が成立しません。
owner_reaction.decide自体は feat: owner_reaction.decide を skill_runtime_exec.py の exact dispatch に配線する #2694 によりskill_runtime_exec.pyから実行可能になりました。しかしrun_refinement_preflight.pyの CLI は、owner_reaction_decision_resultもselected_option_idもmutation_categoryも受け取りません。CLI がknown_contextに投入するのは現状human_context_comment_urls/agent_report_comment_urlsだけです。一方 heavy gate はknown_context["mutation_category"]とscope_delta_decisionが存在して初めて動きます。したがって、Python テストから hand-craftedknown_contextを渡せば green にできますが、canonicalskill_runtime_exec.py → registry → run_refinement_preflight.py経路では到達できません。これは 実装: owner_reaction.decide の skill_runtime_exec.py generic dispatch 配線を行う(#1975 の Out of Scope) #2688 が潰した「実装は存在するが production entrypoint から到達不能」という false-green の再発です。実装: owner_reaction_decision.py の出力を既存 heavy mutation gate へ統合する(#1975 の Out of Scope) #2689 の Allowed Paths にcommand_registry.py/skill_runtime_exec.py/skill_runtime_command_policy.pyを含めるか、別の既存 canonical transport を明記する必要があります。P0 —
selected_option_idを category に潰すと owner の承認範囲を拡大します。 実装: owner reaction 手順を決定論的 reaction reader/principal resolver/drift checker/mutation consumer として実装する #1975 のtest_preview_binding_primary_identityは、同じoperation: close_not_plannedでも target#100と#200は別 option であり、同一操作としてcollapseしてはいけないことを明示的にテストしています。ところが現 heavy gate が見るのは実質mutation_categoryだけです。たとえばparent_child_changeの option A を owner が選んだ後、「parent_child_change が allowlist」という理由だけで option B の別 target を通せば、reaction の identity binding を破壊します。実装: owner reaction 手順を決定論的 reaction reader/principal resolver/drift checker/mutation consumer として実装する #1975 の設計意図そのものへの回帰です。Issue #1975P1 — Issue コメントで決める「category allowlist」は authority と rollout policy が混ざっています。 親 実装: multi-turn anchor の owner turn を chronology metadata として扱い、reaction decision flow を issue-refinement-loop と impl-review-loop へ導入する #1950 は、chronology・technical recommendation・mutation authorization を分離し、decision preview に束縛された owner reaction 自体を明示的 authorization の一形態として定義しています。したがって 実装: owner_reaction_decision.py の出力を既存 heavy mutation gate へ統合する(#1975 の Out of Scope) #2689 の着手前コメントは runtime authorization ではなく、「今回どこまで実装するか」という feature scope に限定すべきです。さらに現在の5分類では
closeとnot_plannedが並列ですが、既存 gate が唯一理解するのはdecision=close_not_planned+authorized_mutation_category=not_plannedです。genericcloseの具体的意味はまだ gate contract にありません。Parent Issue #1950P1 — reaction result の freshness 境界が不足しています。
owner_reaction_decision.py自体は reaction 全ページ取得後に comment / anchor / Issue を readback するよう PR feat: owner reaction 手順を決定論的 reaction reader/principal resolver/drift checker/selection resolver として実装する #2683 で改善されています。しかし、そのselectedresult を後続 invocation が保存・再利用する設計にすると、その間に owner が reaction を削除しても旧 authorization を消費できます。GitHub API は issue-comment reaction の削除を正式にサポートしています。(GitHub Docs) 新しい ledger や TTL framework は不要で、heavy gate を評価する直前にowner_reaction.decideを fresh 実行し、その invocation の結果だけ使う程度で十分です。P1 —
Runtime Verification: deferredは feat: owner_reaction.decide を skill_runtime_exec.py の exact dispatch に配線する #2694 マージ後には弱すぎます。 live GitHub Actions や実 reaction mutation は不要です。feat: owner_reaction.decide を skill_runtime_exec.py の exact dispatch に配線する #2694 には既に fakeghを network boundary にだけ置き、realskill_runtime_exec.pysubprocess を通す fixture infrastructure があります。これを再利用してowner_reaction.decide.fixture → selected result → consumer adapter → heavy gateの1本だけ production-shaped に通せます。これなら workflow を肥大化させず、unit-only false-green を防げます。PR feat: owner_reaction.decide を skill_runtime_exec.py の exact dispatch に配線する #2694 のレビューでも、read-only command に不要な active-worktree coupling を外すなど、過剰な harness を削る方向が採られています。PR #2694 の adversarial reviewP2 — Verification Commands が acceptance を証明していません。 AC1 の
rg "owner_reaction_decision"は import やコメント1行だけでも通ります。AC3 の credentialless transport test は今回の「reaction selection → mutation gate」の wiring を直接証明しません。必要なのは、同一 category・別 target の拒否、unresolved/stale/environment_errorの拒否、unsupported category の拒否、exact selected option の許可、production-shaped producer→consumer の5ケース程度です。巨大なテストハーネスは不要です。P2 — Issue body の factual freshness と contract hygiene も更新が必要です。
Current Validated Scopeはorigin/main 33a6ffbfを基準にしていますが、現在の main は feat: owner_reaction.decide を skill_runtime_exec.py の exact dispatch に配線する #2694 マージ後の10bbcf85...です。また Notes では 実装: owner_reaction.decide の skill_runtime_exec.py generic dispatch 配線を行う(#1975 の Out of Scope) #2688 / 実装: contract_update.run.with_human_context の mutation phase に investigation evidence transport (#2086 AC3) を配線する #2678 を OPEN Issue の例にしていますが、両方とも現在は closed です。さらに Notes は「## Delivery Ruleの直列化推奨」を参照していますが、実装: owner_reaction_decision.py の出力を既存 heavy mutation gate へ統合する(#1975 の Out of Scope) #2689 本文に## Delivery Ruleセクション自体がありません。実装前に一度 refinement し直すべき状態です。外部仕様については、reaction reader 自体を再設計する必要はありません。GitHub CLI の
gh api --paginateは全ページを順次取得し、--slurpはページ単位の JSON を外側の配列にまとめる仕様です。(GitHub CLI) Issue-comment reaction API も現在+1/-1/laugh/confused/heart/hooray/rocket/eyesとuser.idを返すので、現行 principal resolver と pagination 方針は妥当です。(GitHub Docs) また issue-comment readback にはissue_urlが含まれるため、PR #2683 で追加された Issue binding も公式 API と整合しています。(GitHub Docs)最小構成での推奨 reframe
項目 | 推奨 -- | -- 今回解禁する mutation | not_planned のみに固定。5カテゴリの owner allowlist 選択を着手条件にしない Authorization | status == selected だけでなく、selected_option_metadata.operation == "close_not_planned" と target が今回の対象 Issue に完全一致することを要求 Gate integration | selected を偽って approved_by_trusted_anchor に変換するより、_is_approved_owner_reaction_not_planned_decision(...) のような別 predicate を追加し、既存 anchor authority と意味を混ぜない 他4カテゴリ | close / replacement_issue_creation / dependency_removal / parent_child_change は fail-closed のまま。operation + target を表現する canonical mutation-intent contract ができてから拡張 Freshness | 保存済み authorization artifact を信用せず、gate 直前に既存 owner_reaction.decide を fresh 実行 Production wiring | canonical CLI から届く実経路を定義するため、必要なら #2694 で確立した exact-dispatch 関連3ファイルを Allowed Paths に追加。新規 generic runner / ledger / publisher は作らない Runtime verification | deferred から immediate に変更。ただし fake gh の focused real-subprocess test 1本で十分この形なら、#2689 は「5種類の mutation authorization framework」を新設する Issue ではなく、既に十分成熟している owner reaction reader を、まず
## 結論not_plannedという既存 gate の唯一の実装済みケースへ正しく接続する Issueになります。品質を落とさず、ハーネス増加もかなり抑えられます。Issue #2689 は必要な統合ですが、現状の契約のまま実装するのは REQUEST_CHANGES 相当です。特に、
selected_option_idを heavy mutation gate へ接続する経路が canonical production path に存在しない点と、「特定 option への owner 承認」を「mutation category 全体の承認」に拡大し得る点が大きな問題です。2026-09-21 11:04 JST 時点の fresh read では、#2689 のコメントは 0件で、要求されている owner allowlist 判断もまだありません。一方、#2688 は PR #2694 で完了し、現在の
mainは10bbcf85c0bd7c33fc25f07617488d27b254703dです。つまり #2689 の本文は既に一部 stale です。[Issue #2689](https://github.com/squne121/loop-protocol/issues/2689?utm_source=chatgpt.com) [PR #2694](https://github.com/squne121/loop-protocol/pull/2694?utm_source=chatgpt.com)敵対的レビュー
P0 — 現在の Allowed Paths では production wiring が成立しません。
owner_reaction.decide自体は feat: owner_reaction.decide を skill_runtime_exec.py の exact dispatch に配線する #2694 によりskill_runtime_exec.pyから実行可能になりました。しかしrun_refinement_preflight.pyの CLI は、owner_reaction_decision_resultもselected_option_idもmutation_categoryも受け取りません。CLI がknown_contextに投入するのは現状human_context_comment_urls/agent_report_comment_urlsだけです。一方 heavy gate はknown_context["mutation_category"]とscope_delta_decisionが存在して初めて動きます。したがって、Python テストから hand-craftedknown_contextを渡せば green にできますが、canonicalskill_runtime_exec.py → registry → run_refinement_preflight.py経路では到達できません。これは 実装: owner_reaction.decide の skill_runtime_exec.py generic dispatch 配線を行う(#1975 の Out of Scope) #2688 が潰した「実装は存在するが production entrypoint から到達不能」という false-green の再発です。実装: owner_reaction_decision.py の出力を既存 heavy mutation gate へ統合する(#1975 の Out of Scope) #2689 の Allowed Paths にcommand_registry.py/skill_runtime_exec.py/skill_runtime_command_policy.pyを含めるか、別の既存 canonical transport を明記する必要があります。P0 —
selected_option_idを category に潰すと owner の承認範囲を拡大します。 実装: owner reaction 手順を決定論的 reaction reader/principal resolver/drift checker/mutation consumer として実装する #1975 のtest_preview_binding_primary_identityは、同じoperation: close_not_plannedでも target#100と#200は別 option であり、同一操作としてcollapseしてはいけないことを明示的にテストしています。ところが現 heavy gate が見るのは実質mutation_categoryだけです。たとえばparent_child_changeの option A を owner が選んだ後、「parent_child_change が allowlist」という理由だけで option B の別 target を通せば、reaction の identity binding を破壊します。実装: owner reaction 手順を決定論的 reaction reader/principal resolver/drift checker/mutation consumer として実装する #1975 の設計意図そのものへの回帰です。[Issue #1975](https://github.com/squne121/loop-protocol/issues/1975?utm_source=chatgpt.com)P1 — Issue コメントで決める「category allowlist」は authority と rollout policy が混ざっています。 親 実装: multi-turn anchor の owner turn を chronology metadata として扱い、reaction decision flow を issue-refinement-loop と impl-review-loop へ導入する #1950 は、chronology・technical recommendation・mutation authorization を分離し、decision preview に束縛された owner reaction 自体を明示的 authorization の一形態として定義しています。したがって 実装: owner_reaction_decision.py の出力を既存 heavy mutation gate へ統合する(#1975 の Out of Scope) #2689 の着手前コメントは runtime authorization ではなく、「今回どこまで実装するか」という feature scope に限定すべきです。さらに現在の5分類では
closeとnot_plannedが並列ですが、既存 gate が唯一理解するのはdecision=close_not_planned+authorized_mutation_category=not_plannedです。genericcloseの具体的意味はまだ gate contract にありません。[Parent Issue #1950](https://github.com/squne121/loop-protocol/issues/1950?utm_source=chatgpt.com)P1 — reaction result の freshness 境界が不足しています。
owner_reaction_decision.py自体は reaction 全ページ取得後に comment / anchor / Issue を readback するよう PR feat: owner reaction 手順を決定論的 reaction reader/principal resolver/drift checker/selection resolver として実装する #2683 で改善されています。しかし、そのselectedresult を後続 invocation が保存・再利用する設計にすると、その間に owner が reaction を削除しても旧 authorization を消費できます。GitHub API は issue-comment reaction の削除を正式にサポートしています。([GitHub Docs]1) 新しい ledger や TTL framework は不要で、heavy gate を評価する直前にowner_reaction.decideを fresh 実行し、その invocation の結果だけ使う程度で十分です。P1 —
Runtime Verification: deferredは feat: owner_reaction.decide を skill_runtime_exec.py の exact dispatch に配線する #2694 マージ後には弱すぎます。 live GitHub Actions や実 reaction mutation は不要です。feat: owner_reaction.decide を skill_runtime_exec.py の exact dispatch に配線する #2694 には既に fakeghを network boundary にだけ置き、realskill_runtime_exec.pysubprocess を通す fixture infrastructure があります。これを再利用してowner_reaction.decide.fixture → selected result → consumer adapter → heavy gateの1本だけ production-shaped に通せます。これなら workflow を肥大化させず、unit-only false-green を防げます。PR feat: owner_reaction.decide を skill_runtime_exec.py の exact dispatch に配線する #2694 のレビューでも、read-only command に不要な active-worktree coupling を外すなど、過剰な harness を削る方向が採られています。[PR #2694 の adversarial review](feat: owner_reaction.decide を skill_runtime_exec.py の exact dispatch に配線する #2694)P2 — Verification Commands が acceptance を証明していません。 AC1 の
rg "owner_reaction_decision"は import やコメント1行だけでも通ります。AC3 の credentialless transport test は今回の「reaction selection → mutation gate」の wiring を直接証明しません。必要なのは、同一 category・別 target の拒否、unresolved/stale/environment_errorの拒否、unsupported category の拒否、exact selected option の許可、production-shaped producer→consumer の5ケース程度です。巨大なテストハーネスは不要です。P2 — Issue body の factual freshness と contract hygiene も更新が必要です。
Current Validated Scopeはorigin/main 33a6ffbfを基準にしていますが、現在の main は feat: owner_reaction.decide を skill_runtime_exec.py の exact dispatch に配線する #2694 マージ後の10bbcf85...です。また Notes では 実装: owner_reaction.decide の skill_runtime_exec.py generic dispatch 配線を行う(#1975 の Out of Scope) #2688 / 実装: contract_update.run.with_human_context の mutation phase に investigation evidence transport (#2086 AC3) を配線する #2678 を OPEN Issue の例にしていますが、両方とも現在は closed です。さらに Notes は「## Delivery Ruleの直列化推奨」を参照していますが、実装: owner_reaction_decision.py の出力を既存 heavy mutation gate へ統合する(#1975 の Out of Scope) #2689 本文に## Delivery Ruleセクション自体がありません。実装前に一度 refinement し直すべき状態です。外部仕様については、reaction reader 自体を再設計する必要はありません。GitHub CLI の
gh api --paginateは全ページを順次取得し、--slurpはページ単位の JSON を外側の配列にまとめる仕様です。(GitHub CLI) Issue-comment reaction API も現在+1/-1/laugh/confused/heart/hooray/rocket/eyesとuser.idを返すので、現行 principal resolver と pagination 方針は妥当です。([GitHub Docs]1) また issue-comment readback にはissue_urlが含まれるため、PR #2683 で追加された Issue binding も公式 API と整合しています。([GitHub Docs]3)最小構成での推奨 reframe
not_plannedのみに固定。5カテゴリの owner allowlist 選択を着手条件にしないstatus == selectedだけでなく、selected_option_metadata.operation == "close_not_planned"と target が今回の対象 Issue に完全一致することを要求selectedを偽ってapproved_by_trusted_anchorに変換するより、_is_approved_owner_reaction_not_planned_decision(...)のような別 predicate を追加し、既存 anchor authority と意味を混ぜないclose / replacement_issue_creation / dependency_removal / parent_child_changeは fail-closed のまま。operation + target を表現する canonical mutation-intent contract ができてから拡張owner_reaction.decideを fresh 実行deferredから immediate に変更。ただし fakeghの focused real-subprocess test 1本で十分この形なら、#2689 は「5種類の mutation authorization framework」を新設する Issue ではなく、既に十分成熟している owner reaction reader を、まず
not_plannedという既存 gate の唯一の実装済みケースへ正しく接続する Issueになります。品質を落とさず、ハーネス増加もかなり抑えられます。squne121 commentedon Sep 21, 2026
推奨アクションは、対象コメント
#5754526086を operator-selected human context として扱い、#2689 をその推奨 reframe に沿って refinement し直すことです。現行mainは確認時点で10bbcf85c0bd7c33fc25f07617488d27b254703dで、#2694 のowner_reaction.decideexact dispatch は既に入っています。したがって、#2689 の古い前提を維持したまま実装フェーズへ送るのは避けるべきです。方向性としては、5種類の heavy mutation を一般化するのではなく、今回は
not_plannedのみへ絞るのが妥当です。status == selectedだけで許可せず、selected_option_metadata.operation == "close_not_planned"と target identity の完全一致を要求し、approved_by_trusted_anchorへの偽装変換もしない。他カテゴリは fail-closed のままにします。また、#2694 後の production path を実際に通すために必要な Allowed Paths はcodebase-investigatorに current main から導出させ、手書きの追加判断を人間へ戻さない構成が適しています。以下を、既に auto mode で起動済みの Claude Code にそのまま渡す想定です。
Issue #2689 を対象に、repository の canonical
issue-refinement-loopを使って refinement を実行してください。対象:
実装: owner_reaction_decision.py の出力を既存 heavy mutation gate へ統合する(#1975 の Out of Scope) #2689 (comment)
.claude/skills/issue-refinement-loop/SKILL.mdこのセッションは既に auto mode です。repository の
loop_iteration_approval_gate.default_required: falseに従い、各 iteration・Issue 本文 rewrite・再レビューのたびに私へ承認確認を求めず、許可された範囲で自律的に最後まで進めてください。ただし、repository-owned の fail-closed / environment / integrity / genuine semantic hard-stop を捏造した承認で迂回してはいけません。人間承認のためだけに任意停止するのは禁止ですが、canonical contract が本当に terminal route を返した場合は、その前に repository が定義する deterministic repair、trusted human-context continuation、issue-editor rewrite 等の自動経路をすべて使い切ってください。
Human-context の扱い
今回の
#issuecomment-5754526086は、私が明示的に選択した human context です。URL や投稿者情報から origin を再推測せず、
issue-refinement-loopの Accepted Trust Model に従い operator-selected human-context lane として扱ってください。必要な preflight は unlabeledwith_anchorではなく canonicalpreflight.run.with_human_context相当の経路を使用してください。このコメントに含まれる adversarial review と「最小構成での推奨 reframe」を、今回の refinement における owner/operator direction として反映してください。
今回採用する設計方向
#2689 を「5種類すべての heavy mutation authorization framework を実装する Issue」にはしないでください。
今回の実装対象は原則として
not_plannedのみへ narrow してください。owner reaction による authorization は少なくとも次を満たす契約にしてください。
OWNER_REACTION_DECISION_RESULT_V1.status == "selected"selected_option_metadata.operation == "close_not_planned"selectedをapproved_by_trusted_anchorに変換して authority semantics を混同しない_is_approved_owner_reaction_not_planned_decision(...)等の独立した predicate / adapter として設計し、既存 trusted-anchor gate の意味を変更しないclose/replacement_issue_creation/dependency_removal/parent_child_changeは今回 fail-closed のまま維持するowner_reaction.decideを fresh 実行し、その invocation の結果だけを使用する方向を優先するこの direction は「runtime mutation の個別承認」と「今回どこまで機能を実装するかという rollout scope」を混同しないよう Issue 本文へ明示してください。
Current-main freshness
作業開始時に
origin/mainを fresh fetch/read し、SHA を記録してください。確認済み参考値は
10bbcf85c0bd7c33fc25f07617488d27b254703dですが、これを盲信せず作業開始時点の current main を再確認してください。特に以下を fresh read してください。
.claude/skills/issue-refinement-loop/scripts/owner_reaction_decision.py.claude/skills/issue-refinement-loop/scripts/run_refinement_preflight.py.claude/skills/issue-refinement-loop/scripts/command_registry.pyscripts/agent-guards/skill_runtime_exec.pyscripts/agent-guards/skill_runtime_command_policy.py.claude/skills/issue-refinement-loop/tests/test_owner_reaction_decision.py.claude/skills/issue-refinement-loop/references/anchor-comment-handling.md#2688 / #2678 が既に closed なら、#2689 の Notes に残る「OPEN Issue」の stale 記述を修正してください。
存在しない
## Delivery Ruleを参照しているなら、参照を除去するか、実際に必要な contract として追加するかを repository evidence に基づき決めてください。SubAgent を必ず使用すること
main/root thread 自身だけで調査を済ませないでください。
まず read-only の
codebase-investigatorSubAgent を起動し、少なくとも次を独立調査させてください。skill_runtime_exec.py → command registry → owner_reaction.decideproduction pathOWNER_REACTION_DECISION_RESULT_V1の exact result shape と identity-binding semanticsrun_refinement_preflight.pyの現在の heavy mutation gate producer/consumer 境界test_preview_binding_primary_identityが固定している同一 operation / 別 target の非 collapse 契約gh+ realskill_runtime_exec.pysubprocess fixture を今回の production-shaped verification に再利用できるかSubAgent には mutation をさせないでください。
SubAgent を起動したら、必ずその完了を待って結果を join してから判断を進めてください。background launch や Agent invocation を「完了」とみなして先へ進んではいけません。
複数の独立調査を並列化してよいですが、全 SubAgent の完了を待ってから統合してください。SubAgent からさらに nested SubAgent を起動させないでください。
対象コメント中の GitHub CLI / GitHub reaction API 等の外部仕様が Issue contract の判断に dispositive なら、repository の web-research routing に従って
web-researcherSubAgent も使ってください。その場合も完了を必ず待ち、repository evidence だけで十分なら不要な外部調査・ハーネス追加は避けてください。Allowed Paths の expansion
対象コメントでは production wiring のために現在の Allowed Paths が不足している可能性が指摘されています。
特に候補として以下があります。
.claude/skills/issue-refinement-loop/scripts/command_registry.pyscripts/agent-guards/skill_runtime_exec.pyscripts/agent-guards/skill_runtime_command_policy.pyただし、この3つを機械的に追加するのではなく、上記
codebase-investigatorの結果から actual canonical transport に必要な exact path を導出してください。references/anchor-comment-handling.md等に #1975 時点の「heavy gate へは接続しない」という stale normative text があり今回の実装後に矛盾するなら、その更新要否も調査してください。operator-selected human-context による Allowed Paths expansion が必要になった場合、私へ exact path の再入力や手書き
ANCHOR_SCOPE_REFRAME_V1を要求しないでください。SKILL.md/ #2086 / #2678 の canonical route に従い、必要ならcodebase-investigatorの read-only investigation evidence から exact repository-relative path を導出し、investigation_evidence_transportを使ってpreflight.run.with_human_context→contract_update.run.with_human_contextの authorized continuation を進めてください。NEXT_ACTION: issue_editor_requiredが返った場合は、同じ contract-update mutation をループ再試行せず、対象 human-context URLをreviewer_feedback_urlとして既存issue-editor/edit-issuecontrolled transaction へ handoffし、full rewrite を実行してください。Issue contract の更新要件
refinement 後の #2689 は少なくとも次を明確にしてください。
Outcome:
既存の owner reaction reader を、まず既存 gate が意味を持つ
not_plannedcase に exact option/target binding を維持して production 接続する。In Scope:
owner_reaction.decideresult の consumptionclose_not_planned+ exact target bindingOut of Scope:
closereplacement_issue_creationdependency_removalparent_child_changeAcceptance Criteria / Verification Commands は、単なる
rgpresence check で wiring 成功としないよう更新してください。最低限、次の behavior を直接証明できるようにしてください。
not_plannedは gate へ到達できるclose_not_plannedでも別 target は拒否されるunresolved/stale/environment_error等は fail-closedskill_runtime_exec.pysubprocess と既存 fake-ghboundary を用いた production-shaped producer→consumer path が1本通る巨大な新規 test harness は作らず、#2694 の fixture infrastructure を優先的に再利用してください。
Runtime Verification Applicabilityは、現在の #2694 後の実装状況を踏まえて再評価してください。対象コメントの推奨どおり focused real-subprocess test が成立するならdeferredのままにせず immediate verification としてください。Refinement loop の実行
.claude/skills/issue-refinement-loop/SKILL.mdを thin entrypoint として読み、必要なreferences/だけ progressive disclosure で読んでください。判定を独自 prose で再実装しないでください。対象 human-context URLを指定した canonical preflight から開始し、planner result、investigation、review、rewrite、fresh review、final contract readiness の順で repository contract に従って進めてください。
canonical Step 2 の
run_root_review_pipeline.py produceは SKILL.md の execution contract どおり、Claude Code Bash からrun_in_background: trueで起動し、background task の完了通知を必ず join して実際の JSON 結果を取得してからcanonical_step2_routeを consume してください。background 起動しただけで Step 2 完了扱いにしてはいけません。
canonical_step2_routeは producer JSON の値をそのまま routing authority として使い、status/verdict/next_actionから独自に再導出しないでください。needs-fixの場合、max_iterationsの範囲では承認を求めず自動 rewrite → fresh review を続行してください。issue-editor やその他 SubAgent を起動した場合も、その invocation の完了を待って結果を取得してから次フェーズへ進んでください。
人間へ戻さず自動処理してよい事項
以下については私へ確認を求めず、repository evidence と対象コメントの direction に基づいて決定・実行してください。
not_plannedのみに scope を narrow すること今回、5 mutation category のどれを選ぶかを私に再質問してはいけません。今回の operator direction は
not_plannedのみです。禁止事項
selected_option_idを mutation category だけへ collapse するselectedをapproved_by_trusted_anchorに偽装変換するknown_contextだけで production wiring 成功と判定するgh issue edit等で controlled mutation lane を迂回するapproveへ書き換える完了条件
Issue #2689 の本文が対象コメントの P0/P1/P2 finding を反映して rewrite され、fresh canonical Step 2 review が approve 相当へ収束し、最新 Issue body に対する final
CONTRACT_REVIEW_RESULT_V1.status == "go"と freshness が確認できるところまで進めてください。issue_kind: implementationの approved termination/handoff が成立する場合は、repository の canonical termination / handoff flow に従って終了してください。この依頼は Issue refinement が対象です。refinement 完了後に implementation が自動 handoff されることを repository contract が明示的に要求する場合を除き、#2689 の実装そのものを独自判断で先行開始しないでください。
最終報告では、少なくとも以下を簡潔に示してください。
このプロンプトでは、対象コメントを単なる「参考レビュー」ではなく、スキルが既に持つ
with_human_context継続経路へ明示的に載せています。そのため、Allowed Paths 拡張のたびに人間へ戻るより、codebase-investigator → investigation evidence → controlled rewrite → fresh reviewで収束させる構成です。squne121 commentedon Sep 21, 2026
issue-refinement-loop 完了報告
対象コメント #issuecomment-5754526086(operator-selected human context)の P0/P1/P2 finding と「最小構成での推奨 reframe」を反映し、Issue 本文を rewrite しました(fix_delta 2 iteration)。
run_root_review_pipeline.py produce)は iteration 1 でneeds-fix(C11:decision: immediateに対するruntime-verification: trueタグ欠落)、iteration 2 でapprove(canonical_step2_route: step_2_5、deterministic checks 全 pass)に収束しました。semantic_review_trigger.py)はsemantic_review_applicable: falseのため skip し、直接 approved 終了へ進みました。sha256:b96b75a19f846fb7f38bb42477569aba58713144c26b9dc83951e23af0f747b3)に対してrun_contract_review_once.py --mode staticを再実行し、CONTRACT_REVIEW_ONCE_RESULT_V1.status == "go"(readiness: go、VC baseline preflight: pass、全 VC が baseline で期待通り fail)を fresh に確認しました。Final Gate: passed(
status: goを実際に確認した通常経路)squne121 commentedon Sep 21, 2026
root-owned entry router audit
route: invoke_impl_review_loop
reason: fresh_review_go_live_equality
squne121 commentedon Sep 21, 2026
確認した時点では、#2689 は refinement 完了済みで
impl_ready、直後の root audit もinvoke_impl_review_loopです。ただし、そのコメントを再利用して Step 1 を開始するのではなく、impl-review-loop現行契約どおり Root-Owned Synchronous Entry Transition を今回の invocation 内で fresh に再実行する必要があります。また、refinement 時の main
10bbcf85...から既に進んでおり、現在確認できたmainは001ced10bb34f610f68fb6459936123630d6839eです。したがって、Claude Code 側ではこの SHA すら固定値として信頼せず、開始時に fresh fetch/read させる構成がよいです。推奨は次です。
max_iterations=3の標準ループを承認確認なしで使い、implementation-worker → test-runner → pr-reviewer → route_loop_verdict_v2を厳守します。各 SubAgent は 起動しただけで完了扱いにせず、final result とlist_agentsの terminalcompletedの両方を確認させます。REQUEST_CHANGES はfix_deltaとして自動修正へ戻し、BEHIND は worker に update-branch を委譲、stale head は再レビューします。最終的にapproved/draft_pr_readyまで到達させますが、merge 自体は実行させません。そのまま Claude Code に投入するプロンプトです。
Issue #2689 を対象に、repository の canonical
impl-review-loopを使って、実装 → 独立検証 → PR review → 修正ループを マージ直前まで自律実行してください。対象:
.claude/skills/impl-review-loop/SKILL.mdsqune121/loop-protocolこの Claude Code セッションは既に auto mode で起動済みです。
各 iteration、実装、テスト、commit、push、PR 作成・更新、review blocker 修正、CI 再確認、branch update、再レビューのたびに私へ承認を求めず、repository contract が許す範囲で自律的に進めてください。
ただし merge は実行しないでください。
目標は
impl-review-loopの canonical termination であるIMPL_REVIEW_LOOP_RESULT_V1.status: draft_pr_ready、すなわち人間が最終 merge 判断できる状態まで到達することです。現在確認済みの状態
Issue #2689 は既に issue-refinement-loop を完了しています。
最新の refinement 完了報告:
LOOP_HANDOFF_RESULT_V1.status: impl_readystatus: gosha256:b96b75a19f846fb7f38bb42477569aba58713144c26b9dc83951e23af0f747b3その直後の root-owned audit:
route: invoke_impl_review_loopreason: fresh_review_go_live_equalityただし、これら既存コメントを Step 1 authorization packet として再利用してはいけません。
.claude/skills/impl-review-loop/SKILL.mdのRoot-Owned Synchronous Entry Transitionを正本として、今回の invocation 自身で fresh な entry transition を実行してください。
参考として、外部確認時点の current main は:
001ced10bb34f610f68fb6459936123630d6839eです。
これは参考値に過ぎません。作業開始時に必ず origin/main / live GitHub main を fresh read し、最新 SHA を使ってください。
0. Root-Owned Synchronous Entry Transition を今回 fresh に実行する
過去の
LOOP_HANDOFF_RESULT_V1やroot-entry-audit-markerだけを根拠に implementation-worker を直接起動しないでください。root/main thread 自身が、単一の継続した invocation / control flow の中で、repository canonical implementation に従い少なくとも次を実行してください。
issue-contract-reviewdecide_root_entry_route()/run_root_transition()による fresh routinginvoke_impl_review_loopの場合だけ、同一 continuous invocation 内で Step 1 を開始.claude/skills/issue-refinement-loop/scripts/root_entry_router.pyおよび
.claude/skills/issue-refinement-loop/references/termination-policy.mdの Root-Owned Synchronous Entry Transition を正本として使用してください。
body drift があれば canonical route に従って current-run contract review をやり直し、過去コメントの stale
goを無理に再利用しないでください。一方で contract snapshot / scope rollup / launch ledger / body SHA 等の advisory artifact の欠落だけを独自の hard stop に昇格させないでください。
1. impl-review-loop を正本どおり読む
.claude/skills/impl-review-loop/SKILL.mdを thin entrypoint として読み、必要な以下の step document を progressive disclosure で参照してください。steps/preparation.mdsteps/step-1-implementation.mdsteps/step-2-verification.mdsteps/step-4-pr-review.mdsteps/step-5-feedback-and-termination.mdsteps/step-5-mergeability-handling.mdsteps/conflicting-pr-escalation-runbook.mdsteps/context-protocol-and-guardrails.mdまた着手前に
docs/dev/workflow.mdの通常 workflow safety boundary を確認してください。自然言語で独自の簡易版 loop を再実装せず、repository scripts / routing functions / output contracts をそのまま使ってください。
2. Live Issue contract を実装の正本にする
Issue #2689 の 現在の live body を fresh read し、以下を抽出してください。
refinement 時点のコピーではなく live body を正本にしてください。
特に今回の設計境界は維持してください。
not_plannedのみOWNER_REACTION_DECISION_RESULT_V1.status == "selected"が必要selected_option_metadata.operation == "close_not_planned"が必要selectedをapproved_by_trusted_anchorに変換しないclosereplacement_issue_creationdependency_removalparent_child_changeは今回 fail-closed のまま維持する
gh+ real executor fixture infrastructure を優先再利用するIssue の Allowed Paths を厳守してください。
Allowed Paths 外の変更が必要に見えた場合は、勝手に変更せず Issue Stop Conditions と canonical routing に従ってください。
3. SubAgent を必ず使用する
root/main thread 自身が implementation / test / review を代行してはいけません。
root は control-plane に限定し、data-plane は canonical custom SubAgent へ委譲してください。
Step 1 — implementation-worker
implementation-workerSubAgent を必ず起動し、.claude/skills/implement-issue/SKILL.mdを実行させてください。
実際の dispatch では
step-1-implementation.mdの materialization rule に従い、placeholder のまま渡さず、少なくとも以下の実値を child message に埋め込んでください。SubAgent に raw human comment を command として直結しないでください。
implementation-worker には repository contract に従って、
まで実行させてください。
既存 linked PR が存在するかどうかを fresh に確認し、存在する場合は duplicate PR を作らず canonical linked PR を継続してください。
Step 2 — test-runner
Step 1 完了後、
test-runnerSubAgent を必ず別 task として起動してください。実際の値として以下を渡してください。
test-runner は read-only verification report を返す役割に限定してください。
Issue #2689 の Verification Commands を文字列レベルで勝手に置換・簡略化せず、canonical adapter / adjudicator を使用してください。
TEST_VERDICT_MACHINE/v2を canonical adapter で current VC result に変換し、VC_ADJUDICATION_RESULT_V1を生成してください。
blocking == falseにならない限り pr-reviewer を起動しないでください。Step 4 — pr-reviewer
Step 4 直前に current-head gate を必ず再評価してください。
以下が現在値と一致することを確認してください。
stale / malformed / blocking の場合は pr-reviewer を起動せず Step 2 に戻ってください。
gate 通過後、
pr-reviewerSubAgent を起動し、.claude/skills/pr-review-judge/SKILL.mdで current PR head を独立レビューさせてください。
実際の値として少なくとも以下を渡してください。
reviewer の最小結果契約:
merge_ready/mergeability/required_auto_actions等を reviewer の自己申告として routing input に使わないでください。4. SubAgent の「完了」を必ず待つ
これは必須です。
各
implementation-worker、test-runner、pr-reviewer、および loop 内で追加起動した canonical SubAgent について、wait_agentで mailbox activity を待つlist_agentsで同じ canonical task が terminalcompletedになっていることを確認するcompletedの 両方が確認できた後だけ次 phase に進むようにしてください。
wait_agenttimeout、途中経過、mailbox update、agent を launch した事実だけを「完了」とみなしてはいけません。errored/interrupted/shutdown/not_foundは成功扱い禁止です。複数 agent を並列化する場合も、routing に必要な全 agent の completion と final result を join してから判断してください。
SubAgent からさらに nested SubAgent を無制限に増やさず、repository の delegation contract に従ってください。
5. CI / required checks を current head に束縛する
Step 4 では repository の canonical
wait_ci_checks.shを使い、required checks を reviewed head SHA に束縛して確認してください。main branch の required checks として現在少なくとも以下が設定されているため、live branch protection / PR checks を fresh に確認してください。
この一覧も開始時の live settings を正本とし、固定値として盲信しないでください。
CI が failed/cancelled の場合は canonical failed-log helper を使い、blocker を次 iteration の fix_delta に含めてください。
pending / skipped / no-checks を pass に偽装しないでください。
6. Step 5 は route_loop_verdict_v2() を authority にする
reviewer の散文から独自 routing を推測しないでください。
control-plane 自身が live PR から以下を fresh 取得してください。
headRefOidmergeablemergeStateStatus必要な
semantic_ambiguityは固定値や推測で与えず、repository が指定する実 git oraclegit merge-tree --write-treeまたは canonical wrapper を使って算出してください。
そのうえで
route_loop_verdict_v2()の返した route をそのまま authority として扱ってください。continue_loopREQUEST_CHANGESの blockers と test failure をfix_deltaに構造化し、してください。
各 iteration の間に私へ承認を求めないでください。
route_to_update_branchBEHINDの場合は reviewer の提案を直接実行せず、router が合成したupdate_branchaction をimplementation-workerに委譲してください。update 後は head が変わるため、Step 2 → Step 4 を fresh に再実行してください。
route_stale_head_rereviewreviewed head と live PR head が違う場合、人間へ戻さず current head で再レビューしてください。
必要ならその前に current-head verification を再取得してください。
fail_closedUNKNOWN/BLOCKED/UNSTABLE/DRAFT等を Git conflict と誤分類しないでください。repository contract の bounded retry / CI evaluator / branch-protection evaluator に従い、自動的に再評価可能なものは人間へ戻さず継続してください。
actual conflict
以下だけを actual conflict の hard-stop 判定として扱ってください。
mergeable == CONFLICTINGmerge_state_status == DIRTYこの場合だけ canonical CONFLICTING PR Escalation Runbook に従ってください。
7. 人間承認不要の範囲
以下は各回私へ問い合わせず、自動処理してください。
Step 1-4 の child が単に
human_review_required: trueという boolean を返しただけでは止めないでください。
impl-review-loopの現在の contract どおり、それ自体は warning とし、正式なHUMAN_REVIEW_REQUIREDverdict、actual conflict、secret/protected path 等の genuine hard gate だけを人間停止理由として扱ってください。8. 禁止事項
以下は禁止です。
gh pr mergenot_planned以外の heavy mutation category を今回ついでに解禁することapproved_by_trusted_anchorに変換すること-過去の
LOOP_HANDOFF_RESULT_V1コメントだけを authorization として Step 1 を開始することAPPROVE単独で loop 完了とすること9. 外部仕様調査
今回の Issue contract と repository implementation だけで判断可能なら、不要な外部 Web 調査は増やさなくて構いません。
外部仕様が dispositive になった場合だけ、
impl-review-loopの external research routing に従って repository-defined researcher / delegation を使用し、結果を join してください。外部調査をしなかった場合は、その理由を
external_research_skip_basisに記録してください。今回の優先順位は security/harness の増築ではなく、Issue #2689 の correctness、production reachability、identity binding、freshness、focused verification です。
10. 完了条件
以下すべてを満たすところまで、承認確認なしでループしてください。
VC_ADJUDICATION_RESULT_V1.blocking == falseAPPROVEblockers == []reviewed_head_sha == live PR head SHAroute_loop_verdict_v2()で評価した結果が canonicalapprovedvalidate_autonomy_policy_result.pyが実際の終了報告に対して passIMPL_REVIEW_LOOP_RESULT_V1.status: draft_pr_readyIssue / open-pr contract 上、最終 merge readiness のために Draft → Ready for review の transition が必要な場合は、repository canonical worker/action に従って実行して構いません。ただし merge / auto-merge は絶対に実行しないでください。
APPROVEだけでは終了せず、live mergeability / blockers / current-head binding を含む canonical termination 条件を満たしてください。11. max_iterations
max_iterations = 3としてください。3 iteration 内で REQUEST_CHANGES を解消できる場合は自動継続してください。
max_iterations を使い切った場合、または正式な
route_human_escalation、actual conflict、secret/protected path violation、回復不能な permission/runtime failure 等の genuine terminal condition に到達した場合のみ停止してください。その場合も、単に「人間確認が必要」と書くのではなく、canonical route、reason_code、未解決 blocker、現在の PR/head/CI 状態を構造化して報告してください。
12. 最終報告
完了時には簡潔に以下を示してください。
作業開始時に fresh read した current main SHA
最終 PR URL / PR number
worktree
branch
final PR head SHA
iteration 数
変更ファイル
AC ごとの結果
Verification Commands の結果
required CI/checks
Allowed Paths gate
pr-reviewer final verdict
reviewed_head_sha
live
mergeable/mergeStateStatusroute_loop_verdict_v2()の final routeSubAgent task:
について、final result と terminal
completedを全て join 済みであることAUTONOMY_POLICY_V1validator 結果IMPL_REVIEW_LOOP_RESULT_V1unresolved blockers
merge を実行していないこと
最終成功状態は 「merge 済み」ではなく「merge 直前の human decision point」 です。
このプロンプトで特に重要なのは、既存の
impl_readyコメントをそのまま起動権限にせず、今回の Claude Code invocation 内で root transition をやり直す点と、各 SubAgentについて result + terminal completed の二重確認を明示した点です。これで「起動したので次へ進む」タイプの premature continuation をかなり抑えられます。squne121 commentedon Sep 21, 2026
root-owned entry router audit
route: invoke_impl_review_loop
reason: fresh_review_go_live_equality
squne121 commentedon Sep 21, 2026
implement-issue: 実装完了 (2026-09-21T03:34:08Z)
.claude/worktrees/issue-2689-owner-reaction-heavy-mutation-gateworktree-issue-2689-owner-reaction-heavy-mutation-gatesqune121 commentedon Sep 21, 2026
impl-review-loop: 完了 (2026-09-21T04:40:00Z)
fix: canonical CLI transport for owner-reaction heavy mutation gate +…
test: add real skill_runtime_exec.py subprocess coverage for the muta…
squne121 commentedon Sep 21, 2026
impl-review-loop: 完了 (2026-09-21T05:30:00Z)
feat: owner_reaction_decision.py の selected 出力を not_planned heavy mut…