Repository navigation
Closed
Labels
agent/implementerAI implementer agentenhancementNew feature or requestphase/implementationImplementation phasetriage-requiredNeeds owner triage for priority decision
Description
Machine-Readable Contract
contract_schema_version: v1
issue_kind: implementation
parent_issue: "none"
goal_ref: "owner_reaction.decide / owner_reaction.decide.fixture を skill_runtime_exec.py の exact dispatch へ実配線し、production-shaped / fixture 両 profile で real executor subprocess を入口とした runtime reachability を成立させる"
change_kind: codeParent Issue
none
Parent Goal Ref
- Goal: owner_reaction.decide が registry entry として command_registry.py に存在するだけの状態を解消し、実行時に呼び出し可能な状態にする
- Desired Destination: N/A(単独改善のため親 Issue なし)
Current Validated Scope
scripts/agent-guards/skill_runtime_exec.pyにowner_reaction.decide/owner_reaction.decide.fixture用の exact dispatch wiring を追加する(scope_rollup.run型の独立 exact executor は不採用。architecture は OWNER anchor comment で確定済み: https://github.com/squne121/loop-protocol/issues/2688#issuecomment-5749552225)- 上記 dispatch 経路が、実
skill_runtime_exec.pysubprocess を入口としてowner_reaction_decision_result/v1(stdout_contract)を正しく生成・伝播することを、production-shaped / fixture 両 profile で検証する real executor test を追加する
Remaining Parent Gaps
なし(単独改善のため親 Issue なし)
Outcome
owner_reaction.decide(および owner_reaction.decide.fixture)が、root/control-plane から canonical skill_runtime_exec.py invocation を通して実行可能になり、registry rendering・正しい first-hop child・structured stdout(owner_reaction_decision_result/v1)まで end-to-end に到達できる状態。actual workflow/mutation consumer への接続(selected_option_id を mutation gate に接続する処理)は本 Issue の Outcome に含まない(別スコープ、#2689 等)。
Runtime Verification Applicability
decision: immediate
reason: "acceptance target は静的 registry presence ではなく executor から child CLI までの runtime reachability であり、全 AC は local repository checkout 上で uv run pytest により network 非依存・認証不要で即時実行可能なため"
applicable_acs:
- AC1
- AC2
- AC3
- AC4
- AC5
- AC6
- AC7
- AC8
- AC9
- AC10
execution_environment:
cli_tools:
- python3
- uv
auth_required: false
network_required: false
skip_conditions:
- "local repository checkout が存在しない場合は SKIP ではなく environment blocked として扱う"
fallback_policy:
fallback_success_is_pass: false
notes: "live GitHub API 呼び出しの fallback は不要。fixture/fake-backed の実 skill_runtime_exec.py subprocess 経由でのみ検証し、fallback 経由の成功を PASS に変換しない"
artifact_requirements:
- "pytest output"
- "skill_runtime_exec.py subprocess の structured stdout capture"In Scope
owner_reaction.decide/owner_reaction.decide.fixtureをskill_runtime_exec.pyの exact dispatch として実行時に呼び出せるようにする実装(skill_runtime_command_policy.pyへの execution class / exact parser・checker 追加を含む)- 上記 dispatch chain(下記 AC3 参照)を production-shaped / fixture 両 profile で real executor entrypoint から検証するテストの追加
Out of Scope
owner_reaction_decision.py自体の reaction semantics の再設計(Issue 実装: owner reaction 手順を決定論的 reaction reader/principal resolver/drift checker/mutation consumer として実装する #1975 で実装済み)- pagination semantics の再設計
command_registry.pyのowner_reaction.decide/owner_reaction.decide.fixtureエントリ定義自体の変更(argv / placeholders / stdout_contract 等)。既存 entry を変更しない前提の read-only design reference として扱うowner_reaction.decideの実行結果(selected_option_id)を実際の mutation gate に接続する downstream consumer integration(別スコープ、実装: owner_reaction_decision.py の出力を既存 heavy mutation gate へ統合する(#1975 の Out of Scope) #2689 と混同しない。実装: owner_reaction_decision.py の出力を既存 heavy mutation gate へ統合する(#1975 の Out of Scope) #2689 の責務を本 Issue に吸収しない)- 完全 generic command runner 化
- 新規独立 executor architecture(
scope_rollup.run型を含む)の新設
Acceptance Criteria
- AC1:
owner_reaction.decideとowner_reaction.decide.fixtureがscripts/agent-guards/skill_runtime_exec.pyの exact dispatch に接続されている。 - AC2: production-shaped profile と fixture profile が同一の owner-reaction dispatcher 実装を利用する。
- AC3: outer argv から少なくとも次の全鎖が real executor test で通る:
skill_runtime_exec.py→ exact command policy/parser →command_registry.render_command()→owner_reaction_decision.py→owner_reaction_decision_result/v1structured stdout。 - AC4: owner-user-id と preview-binding-file の各フラグ、および fixture 用 gh-fixture-file フラグの required/forbidden combination が exact に検証される。
- AC5: executor の first-hop script integrity/readback 対象と、registry が render する実 first-hop script が、owner reaction の場合
owner_reaction_decision.pyで一致する。 - AC6: 既存 registry entry(
owner_reaction.decide/owner_reaction.decide.fixture)の argv / placeholders / stdout_contract は変更しない。 - AC7:
owner_reaction.decide.fixtureが実skill_runtime_exec.pysubprocess 経由で structured result を返す。 - AC8: production-shaped dispatch と fixture dispatch の正常系を実 executor entrypoint から検証する。live GitHub API は不要で、fixture/fake/stub で閉じてよい。
- AC9: child の non-zero exit または malformed structured result の少なくとも一方を実 executor 境界から検証し、outer executor が false success に変換しないことを確認する。
- AC10: 既存
owner_reaction_decision.py/ command registry / skill runtime 関連の relevant regression tests が PASS する。
Verification Commands
- (補助 evidence。acceptance の正本にはしない)dispatch エントリの存在確認:
$ rg -n "owner_reaction.decide" scripts/agent-guards/skill_runtime_exec.py- AC1: dispatch wiring が新規テストで検証される(テストファイルは実装時に新規作成):
# AC1
$ uv run pytest .claude/skills/issue-refinement-loop/tests/test_owner_reaction_decide_dispatch.py -q- AC2: production-shaped / fixture 両 profile が同一 dispatcher 実装を利用することを新規テストで検証する:
# AC2
$ uv run pytest .claude/skills/issue-refinement-loop/tests/test_owner_reaction_decide_dispatch.py -q- AC3: outer argv から structured stdout までの全鎖を real executor test で検証する:
# AC3
$ uv run pytest .claude/skills/issue-refinement-loop/tests/test_owner_reaction_decide_dispatch.py -q- AC4: 必須/禁止フラグの組み合わせを新規テストで検証する(テストファイルは実装時に新規作成):
# AC4
$ uv run pytest .claude/skills/issue-refinement-loop/tests/test_owner_reaction_decide_flag_validation.py -q- AC5: first-hop script integrity/readback の一致を新規テストで検証する:
# AC5
$ uv run pytest .claude/skills/issue-refinement-loop/tests/test_owner_reaction_decide_dispatch.py -q- AC6: 既存 registry entry の argv / placeholders / stdout_contract が変更されていないことを既存テストで確認する:
# AC6
$ uv run pytest .claude/skills/issue-refinement-loop/tests/test_owner_reaction_decision.py -q- AC7: fixture profile が実 subprocess 経由で structured result を返すことを新規テストで検証する:
# AC7
$ uv run pytest .claude/skills/issue-refinement-loop/tests/test_owner_reaction_decide_dispatch.py -q- AC8: production-shaped / fixture 両 dispatch の正常系を実 executor entrypoint から検証する:
# AC8
$ uv run pytest .claude/skills/issue-refinement-loop/tests/test_owner_reaction_decide_dispatch.py -q- AC9: child の non-zero exit または malformed structured result で false success に変換されないことを新規テストで検証する(テストファイルは実装時に新規作成):
# AC9
$ uv run pytest .claude/skills/issue-refinement-loop/tests/test_owner_reaction_decide_failure_boundary.py -q- AC10: 既存 owner_reaction_decision.py / command registry / skill runtime 関連の regression tests が PASS することを確認する:
# AC10
$ uv run pytest .claude/skills/issue-refinement-loop/tests/test_owner_reaction_decision.py -qAllowed Paths
- scripts/agent-guards/skill_runtime_exec.py
- scripts/agent-guards/skill_runtime_command_policy.py
- .claude/skills/issue-refinement-loop/tests/
Stop Conditions
- Allowed Paths 外の変更が必要と判明した場合
- In Scope の固定契約(キー集合・スキーマ・型定義)の変更が必要になった場合
- 新規 Issue の起票が必要と判断した場合(スコープ分割が発生する場合)
- 後続 Phase / 別スコープへの波及が判明した場合
- nested SubAgent delegation が必要になった場合
- 外部サービス利用・権限昇格・既存テスト大規模改変が必要になった場合
Required Skills
なし
Required Design References
- .claude/skills/issue-refinement-loop/references/anchor-comment-handling.md
- .claude/skills/issue-refinement-loop/scripts/command_registry.py(owner_reaction.decide / owner_reaction.decide.fixture エントリの現状 argv / placeholders / stdout_contract。read-only design reference、変更対象外)
- scripts/agent-guards/skill_runtime_exec.py 内の repair_action.apply / structural_repair_action.apply の dispatch precedent(exact parser/checker 関数、execution_class 定数、first-hop script integrity/readback パターン)
- scripts/agent-guards/skill_runtime_command_policy.py 内の scope_rollup.run の execution_class 定義(構造比較用の precedent。dispatch 方式自体は不採用)
Scope Delta(任意)
N/A
Notes for Reviewer
- 本 Issue は 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 の実装、マージ済み)の post-merge-cleanup で検出された follow-up。実装: owner reaction 手順を決定論的 reaction reader/principal resolver/drift checker/mutation consumer として実装する #1975 の実装スコープでは owner_reaction.decide の registry entry 追加のみを行い、skill_runtime_exec.py 側の実 dispatch 配線は明示的に Out of Scope とされていた。
- 実装: operator-selected human context の scope reframe を自動継続し scope expansion stop を撤去する #2086 に registry/policy-declaration-only な false-green の既知事例があるため、新規 command_id の実 dispatch は自動的に成立しない点に注意。
- architecture は OWNER anchor comment(https://github.com/squne121/loop-protocol/issues/2688#issuecomment-5749552225)により skill_runtime_exec.py exact dispatch 採用で確定済み。実装着手時に owner 判断を再度求める必要はない。
- 実装時は repair_action.apply / structural_repair_action.apply の既存 dispatch precedent(exact parser/checker 関数、execution_class 定数、first-hop integrity/readback パターン)との構造整合を優先する。
- command_registry.py は本 Issue の Allowed Paths から除外され、read-only design reference として扱う。
Source
- dedupe_key:
follow-up:squne121/loop-protocol:pr/2683:not_controlled_1 - 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
Metadata
Metadata
Assignees
Labels
agent/implementerAI implementer agentenhancementNew feature or requestphase/implementationImplementation phasetriage-requiredNeeds owner triage for priority decision
Activity
squne121 commentedon Sep 20, 2026
#2688、関連する #1975 / #2086 / #2689、PR #2683、現在の
main上のskill_runtime_exec.py/skill_runtime_command_policy.py/command_registry.py/ owner reaction テストまで追いました。現状の Issue は方向性自体は正しいですが、このまま実装着手すると「dispatch を直したつもりの第二の false-green」を作る余地があります。REQUEST_CHANGES 相当です。特に、#2086 で既に踏んだ失敗パターンを #2688 の AC/Allowed Paths が十分に取り込めていません。
敵対的レビュー
P0-1 —
Runtime Verification: not_applicableは Issue の目的と矛盾しています。実装: owner_reaction.decide の skill_runtime_exec.py generic dispatch 配線を行う(#1975 の Out of Scope) #2688 の目的は静的な registry 定義ではなく、
skill_runtime_exec.pyから実 CLI までの実到達性です。しかし現在の Verification はrg "owner_reaction.decide" skill_runtime_exec.pyと pytest です。rgはコメントや未到達 branch が1行追加されるだけでも PASS します。これは 実装: operator-selected human context の scope reframe を自動継続し scope expansion stop を撤去する #2086 AC10 が明示的に潰した「registry/policy/dispatcher false-green」と同型です。PR feat: owner reaction 手順を決定論的 reaction reader/principal resolver/drift checker/selection resolver として実装する #2683 の既存テスト自身にも「skill_runtime_exec.pygeneric dispatch wiring is still never exercised」と明記されています。修正案:
Runtime Verification Applicabilityをimmediateにし、live GitHub API は使わず、fixture-backed の実skill_runtime_exec.pysubprocessを1本だけ必須にしてください。趣味開発なら巨大なハーネスは不要です。skill_runtime_exec.py -> command_registry.render_command() -> owner_reaction_decision.py -> structured stdoutの1本を通せば十分です。P0-2 — Allowed Paths が canonical な実装に必要な
skill_runtime_command_policy.pyを欠いています。現在の policy には
owner_reaction.decideが登録されていますが、コメントで明示的に「policy declaration only」「skill_runtime_exec.pyの hardcoded dispatch branch ではない」「exact-match parser もない」とされています。また通常のparse_exact_skill_runtime_command()はexecution_class == SKILL_RUNTIME_EXECUTION_CLASSの command しか受理しません。owner_reaction.decideはexact_owner_reaction_decideなので対象外です。つまり
skill_runtime_exec.pyに branch だけ足すと、registry と executor と exact-command policy の3者が食い違います。実装: operator-selected human context の scope reframe を自動継続し scope expansion stop を撤去する #2086 ではまさにこのためskill_runtime_command_policy.pyまで Allowed Paths に入れていました。修正案:
scripts/agent-guards/skill_runtime_command_policy.pyを Allowed Paths に追加し、owner reaction 用 outer command shape の parser/classifier と既存コメントを同期させるべきです。これはセキュリティ強化というより、SSOT の自己矛盾を残さないためです。P1-1 — 「
scope_rollup.run型の独立 exact executor」という選択肢は、現在の Allowed Paths では実装できません。実際の
scope_rollup.runは単に別 branch があるだけではありません。専用のscripts/agent-guards/run_scope_rollup_preflight.py、skill_runtime_command_policy.pyの専用 parser/class、guard 側 classifier、専用テストを持っています。一方 実装: owner_reaction.decide の skill_runtime_exec.py generic dispatch 配線を行う(#1975 の Out of Scope) #2688 は新規scripts/agent-guards/*executor や policy を Allowed Paths に含めていません。したがって AC1 は「owner が二択から選ぶ」としていますが、一方を選ぶと即 Stop Condition です。
修正案: この二択自体をやめ、実装: owner_reaction.decide の skill_runtime_exec.py generic dispatch 配線を行う(#1975 の Out of Scope) #2688 では 既存
skill_runtime_exec.pyに owner-reaction exact dispatch を追加する方針に固定するのがよいです。独立 executor は、この read-only CLI にはコスト過多です。P1-2 — Issue は “generic dispatch” と呼んでいますが、現行 executor 構造では実質的に command-specific dispatch です。
skill_runtime_exec.pyは generic registry runner に見える部分もありますが、外側 argparse、command-specific required/forbidden flags、script identity、render_paramsが command ID ごとにハードコードされています。owner_reaction.decideには現在存在しない--owner-user-id/--preview-binding-file、fixture には--gh-fixture-fileが必要です。したがって「dispatch table に1行追加」では成立しません。最低でも outer args、production/fixture の組合せ検証、render params、child script identity が必要です。Issue が generic と呼ぶことで実装量を過小評価しています。
修正案: Outcome を「generic dispatch」ではなく
owner_reaction.decide*exact dispatch wiring と定義する方が正確です。将来 command registry を完全 generic runner にする話とは分離した方が小さく仕上がります。P1-3 —
skill_runtime_exec.pyの child-script integrity check が現在 owner reaction に対応していません。現在は
decide.run -> decide_next_loop_action.py、barepreflight.run -> workflow_start_entry.py、それ以外はrun_refinement_preflight.pyとみなして存在確認しています。owner_reaction.decideの本当の child はowner_reaction_decision.pyです。単に render params を通せるようにしても、この integrity/readback 部分は誤ったファイルを検証したままになります。即座に execution failure になるとは限らないため、むしろ検出しづらい不整合です。
AC に追加すべきこと: executor が検証する first-hop script と、registry が実際に起動する first-hop script が
owner_reaction_decision.pyで一致すること。P1-4 — 「actual consumer が読める」という Outcome が現状の repository evidence より強いです。
current-main の code search では
owner_reaction.decideの実参照は policy、registry、reference、implementation/test が中心で、production Python caller は見当たりません。issue-refinement-loop/SKILL.mdは owner reaction implementation を reference していますが、skill_runtime_exec.py --command-id owner_reaction.decide ...という canonical invocation はまだ workflow に materialize されていません。したがって 実装: owner_reaction.decide の skill_runtime_exec.py generic dispatch 配線を行う(#1975 の Out of Scope) #2688 完了後も「呼べる executor」はできますが、「workflow が実際に呼ぶ」ことまでは証明できません。実装: owner_reaction_decision.py の出力を既存 heavy mutation gate へ統合する(#1975 の Out of Scope) #2689 は mutation consumer の別問題なので代替にもなりません。
修正案: Outcome は「root/control-plane から canonical exact invocation が可能」に狭めるか、SKILL/reference を Allowed Paths に加えて caller contract まで明記してください。個人的には前者で 実装: owner_reaction.decide の skill_runtime_exec.py generic dispatch 配線を行う(#1975 の Out of Scope) #2688 を小さく閉じ、実 consumer 統合は 実装: owner_reaction_decision.py の出力を既存 heavy mutation gate へ統合する(#1975 の Out of Scope) #2689 側と整合させるのがよいです。
P1-5 — 新規テストの合格条件が弱すぎます。
pytest ... -k "owner_reaction and dispatch"では、テスト名さえ合えば direct function call や直接owner_reaction_decision.pyを起動するテストでも満たせます。PR feat: owner reaction 手順を決定論的 reaction reader/principal resolver/drift checker/selection resolver として実装する #2683 の既存 AC7 がまさにそれで、production entry をテストしていても executor は通っていませんでした。最小限必要なのは2ケースです。 production と fixture を parameterize して、実
skill_runtime_exec.pyプロセスを入口にする正常系。そして child の non-zero / malformed structured result のどちらか1ケースを通し、outer executor が success に化けさせないこと。この程度ならハーネス過剰にはなりません。P2-1 — architecture owner approval を実装直前の人間ゲートに残す必要性が薄いです。
実装: owner_reaction.decide の skill_runtime_exec.py generic dispatch 配線を行う(#1975 の Out of Scope) #2688 は
triage-requiredで、「generic / independent executor のどちらかを owner が選ぶまで実装しない」としています。しかし repository evidence を見る限り、この Issue ではskill_runtime_exec.py側に exact dispatch を追加する方が明らかに小さいです。独立 executor は Allowed Paths とも矛盾しています。自動ループを重視するなら、refinement 時点で技術判断を確定して本文へ materializeし、人間判断 Stop Condition を消す方が実用的です。
P2-2 —
command_registry.pyは Allowed Paths にあるのに、ACでは「entry を変更しない」とされています。今回 registry の既存
argv/ placeholders / stdout contract はかなり明確で、90秒 timeout もskill_runtime_exec.pyが実際にentry["timeout_seconds"]として利用する構造になっています。変更理由は薄いです。修正案:
command_registry.pyを Allowed Paths から外して read-only design reference にする方が scope discipline が明瞭です。外部仕様との照合
既存
owner_reaction_decision.pyの reaction reader 設計自体は、今回触らない判断で妥当です。GitHub CLI の公式仕様ではgh api --paginateは後続ページを順次すべて取得し、--slurpは各ページを外側の配列へまとめます。(GitHub CLI) GitHub REST の reaction API も+1 / -1 / rocket / eyes等を正式な reaction content とし、reaction record にuser.idを含め、ページサイズは既定30・最大100です。([GitHub Docs]2)したがって #2688 で pagination や reaction semantics を再設計する価値はありません。dispatch 境界だけ直すのがよいです。
推奨する #2688 の着地点
個人趣味開発という前提なら、独立 executor や guard の全面再構築は避けます。
skill_runtime_exec.pyにowner_reaction.decide/.fixtureの exact branchを追加し、既存 registry entryをそのままrender_command()、既存90秒 timeout、既存 child supervisorで実行する構成が最も小さいです。そのため Issue を実装前に次のように直すのを推奨します。
skill_runtime_exec.pyexact dispatch 採用で確定し、scope_rollup.run型案を削除。scripts/agent-guards/skill_runtime_command_policy.pyと focused executor test 1ファイルを追加。代わりにcommand_registry.pyは変更対象から外す。Runtime Verificationをimmediateに変更。ただし live GitHub は不要で、fixture-backed real subprocess のみ。owner_reaction_decision.py→ structured stdout」の全鎖を明記。rgを acceptance evidence から降格し、real subprocess test を正本にする。この形なら、#2086 で発覚した false-green を再発させず、かつ趣味開発には不要な guard/harness の拡張を最小限にできます。最優先で直すべきなのは P0-1/P0-2、次に P1-1〜P1-5 です。
squne121 commentedon Sep 20, 2026
推奨は、対象コメントを OWNER が直接指定した trusted human context として扱い、
preflight.run.with_human_context→ controlled contract update → 必要ならissue-editorfull rewrite の正規経路で #2688 を更新することです。コメント内ですでに architecture 判断が「skill_runtime_exec.pyへの exact dispatch」に収束しているため、generic vs. independent executor の人間判断ゲートは残す必要がありません。特に、①
skill_runtime_command_policy.pyを Allowed Paths に追加、②command_registry.pyは変更対象から外して read-only reference 化、③ runtime verification をimmediateに変更、④ realskill_runtime_exec.pysubprocess を acceptance evidence にする、⑤codebase-investigatorを実行して完了を待ってから rewrite/review を進める、という流れが適切です。ループ途中の承認確認は不要ですが、skill が返す真正のhuman_judgment_requiredや fail-closed 条件そのものを無効化する指示にはしません。そのまま既存の Claude Code セッションへ貼れる形です。
Issue #2688 を、以下の OWNER コメントを authoritative anchor として
issue-refinement-loopで refinement してください。Target Issue:
#2688
Authoritative anchor:
#2688 (comment)
Canonical skill:
https://github.com/squne121/loop-protocol/tree/main/.claude/skills/issue-refinement-loop
あなたは既に auto mode で起動している root/main の対話的 Claude Code セッションです。
実行方針
.claude/skills/issue-refinement-loop/SKILL.mdと、その progressive-disclosure references / canonical scripts を SSOT として、この Issue の refinement loop を実行してください。今回の anchor comment は、ユーザーが明示的に指定した Issue OWNER のコメントです。したがって unlabeled / agent-report lane には落とさず、operator-selected trusted human context として snapshot/binding を検証したうえで
with_human_contextlane を使用してください。loop iteration ごとの人間承認は不要です。
loop_iteration_approval_gate.default_required: falseに従い、needs-fixが出た場合はmax_iterationsの範囲で自動継続してください。途中で「続行してよいですか」「この設計でよいですか」等の確認をユーザーへ求めないでください。一方で Claude Code 自体の permission mode、
bypassPermissions、--dangerously-skip-permissions等は変更しないでください。リポジトリの loop approval と Claude Code permission policy を混同しないこと。skill が定義する genuine な fail-closed /
human_judgment_requiredを勝手に無効化してはいけません。ただし、人間へエスカレーションする前に、trusted anchor に対して用意されている deterministic repair、controlled contract update、issue_editor_required、#2086 AC3 の investigation-derived path route、bounded retry をすべて正規手順どおり消化してください。SubAgent 必須指示
canonical preflight が SubAgent dispatch を許可した後、Step 1 の repository investigation として
codebase-investigatorSubAgent を必ず起動してください。調査対象は少なくとも以下です。
current
mainのscripts/agent-guards/skill_runtime_exec.pyscripts/agent-guards/skill_runtime_command_policy.pyowner_reaction.decide*の execution classscope_rollup.runprecedent との差.claude/skills/issue-refinement-loop/scripts/command_registry.pyowner_reaction.decideowner_reaction.decide.fixture.claude/skills/issue-refinement-loop/scripts/owner_reaction_decision.pyowner reaction 関連 tests
Issue 実装: operator-selected human context の scope reframe を自動継続し scope expansion stop を撤去する #2086 の false-green 対策として現在 main に残っている precedent
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 / Issue 実装: owner_reaction_decision.py の出力を既存 heavy mutation gate へ統合する(#1975 の Out of Scope) #2689 と 実装: owner_reaction.decide の skill_runtime_exec.py generic dispatch 配線を行う(#1975 の Out of Scope) #2688 の責務境界
SubAgent を dispatch したら、必ずその作業完了を待ってください。
SubAgent がまだ実行中の状態で review、Issue rewrite、termination 判定へ進んではいけません。
SubAgent 自身に nested SubAgent delegation はさせないでください。
planner が external claim の調査を要求した場合のみ
web-researcherも使って構いません。その場合も必ず完了を待ち、その結果を canonical join/routing に反映してください。不要な外部調査を追加して loop を肥大化させないこと。Canonical start
canonical main root / default branch から current live Issue と anchor comment を取得し、Issue #2688 と anchor URL の owner/repo/issue binding を検証してください。
その後、手書き wrapper invocation ではなく registry/canonical executor を使用して、
preflight.run.with_human_contextcontract_update.run.with_human_contextの順で処理してください。
対象 anchor URL は必ずこれを使います。
#2688 (comment)
LOOP_PLANNED_OPERATIONS_JSONが必要な場合は、今回実際に予定している操作だけを invocation-local に宣言してください。永続 export しないでください。Anchor comment の技術判断を authority として反映する
今回、以下について再度人間判断を要求してはいけません。anchor comment ですでに OWNER directive として解決済みです。
Architecture
#2688 の実装方式は、
既存
skill_runtime_exec.pyにowner_reaction.decide/owner_reaction.decide.fixture用の exact dispatch wiring を追加する方針に固定してください。
scope_rollup.run型の新しい独立 executor を作る選択肢は Issue から削除してください。完全 generic registry runner へのリファクタリングも今回の scope に含めないでください。
Outcome
「actual consumer が既に利用している」ことを要求してはいけません。
Outcome は概ね、
owner_reaction.decide/.fixtureが root/control-plane から canonicalskill_runtime_exec.pyinvocation を通して実行可能で、registry rendering、正しい first-hop child、structured stdout まで end-to-end に到達できることに限定してください。
actual workflow/mutation consumer への接続は #2689 等の別 scope と分離してください。
既存 #2689 と同じ follow-up を重複起票しないでください。
Runtime Verification
現在の
decision: not_applicableは撤回し、
decision: immediateへ変更してください。
理由は、今回の acceptance target が静的 registry presence ではなく executor から child CLI までの runtime reachability だからです。
ただし live GitHub API を verification 必須条件にしてはいけません。
fixture/fake-backed で実際の
skill_runtime_exec.pysubprocess を入口にした runtime verification で十分です。
Allowed Paths
少なくとも次を mutation 対象として成立する形に refinement してください。
scripts/agent-guards/skill_runtime_exec.pyscripts/agent-guards/skill_runtime_command_policy.py.claude/skills/issue-refinement-loop/tests/可能なら focused executor test file に限定してください。
.claude/skills/issue-refinement-loop/scripts/command_registry.pyは、既存 entry の argv / placeholders / stdout_contract / timeout を維持する前提なので、変更対象の Allowed Paths から外し、read-only design reference としてください。owner_reaction_decision.py本体の reaction selection logic は変更対象にしないでください。新規独立 executor script を追加する方向へ scope expansion しないでください。
Allowed Paths expansion の処理
skill_runtime_command_policy.pyの追加がexpands_allowed_pathsと判定されても、即座にユーザーへ判断を戻さないでください。これは今回の trusted human anchor が明示的に要求している変更です。
issue-refinement-loopの #2086 AC3 / Operator-Selected Human-Context continuation に従い、必要ならcodebase-investigatorの read-only evidence から exact repository-relative path を導出してください。SubAgent の完了を待ち、その evidence を canonical classifier/consumer へ渡して再判定してください。
investigation evidence transport manifest が生成された場合は、read-only preflight で使用した同一 manifest pathを直後の
contract_update.run.with_human_contextに渡してください。勝手に再生成しないこと。section-bound patch では表現できず
NEXT_ACTION: issue_editor_requiredになった場合は、同じcontract_updateを無限再試行しないでください。既存の
issue-editorSubAgent /edit-issuecontrolled transaction route へ handoff し、reviewer_feedback_urlとして上記 canonical anchor URL をそのまま渡してください。その
issue-editorSubAgent の完了も必ず待ってください。raw
gh issue editや rawgh issue commentで control-plane を迂回してはいけません。Acceptance Criteria に反映する内容
review/investigation evidence と矛盾しない限り、少なくとも次の性質を検証可能な AC としてください。
owner_reaction.decideと.fixtureがskill_runtime_exec.pyの exact dispatch に接続されている。production-shaped / fixture の両 profile が同じ owner-reaction dispatcher implementation を利用する。
outer argv から少なくとも以下の全鎖が real executor test で通る。
skill_runtime_exec.py→ exact command policy/parser
→
command_registry.render_command()→
owner_reaction_decision.py→
owner_reaction_decision_result/v1structured stdout--owner-user-id/--preview-binding-fileと fixture 用--gh-fixture-fileの required/forbidden combination が exact に検証される。executor の first-hop script integrity/readback 対象と registry が render する実 first-hop script が、owner reaction の場合
owner_reaction_decision.pyで一致する。existing registry entry の argv / placeholders / stdout_contract は変更しない。
owner_reaction.decide.fixtureが realskill_runtime_exec.pysubprocess 経由で structured result を返す。production-shaped dispatch と fixture dispatch の正常系を実 executor entrypoint から検証する。
live GitHub API は不要で、fixture/fake/stub で閉じてよい。
child non-zero または malformed structured result の少なくとも一方を実 executor 境界から検証し、outer executor が false success に変換しないことを確認する。
既存
owner_reaction_decision.py/ command registry / skill runtime 関連の relevant regression tests が PASS する。単なる
rg "owner_reaction.decide" scripts/agent-guards/skill_runtime_exec.pyは補助 evidence としては残して構いませんが、acceptance の正本にしないでください。コメントや dead branch だけで PASS できる verification に依存しないこと。
Scope / Out of Scope
以下は明示的に Out of Scope のまま維持してください。
owner_reaction_decision.pyの reaction semantics の再設計GitHub CLI / GitHub reaction semantics は今回の dispatch boundary 修正に必要な範囲を越えて再検討しないでください。
Review / rewrite loop
Issue body mutation 後は、その body を成功と仮定しないでください。
必ず fresh readback を行い、
preflight.runを再実行してください。
review が
needs-fix / request_changesの場合は、ユーザー承認を求めず Step 4 rewrite へ進み、loop policy の範囲で自動反復してください。各 iteration で必要な SubAgent が dispatch された場合は、必ず全員の完了を待ってから次へ進んでください。
issue-reviewerlegacy SubAgent を canonical Step 2 の代わりに使用しないでください。Step 2 は currentSKILL.mdが指定する root-owned review pipeline を使ってください。prose で独自に routing を再判定せず、planner / canonical reviewer /
decide_next_loop_action.py/decide_rewrite_route.py等の SSOT 出力を consume してください。Termination
最終的に #2688 が current body に対して approved / implementation-ready になるまで、承認問い合わせなしで canonical refinement loop を進めてください。
approved termination では skill が要求する fresh body hash、termination report、handoff marker、dependency gate 等を省略しないでください。
ユーザーが今回依頼している主目的は Issue refinement です。downstream のコード実装を独自判断で scope に追加しないでください。ただし
issue-refinement-loopの canonical Step 5 が同一 invocation 内で必須とする handoff/routing bookkeeping は省略しないでください。どうしても terminal な
human_judgment_required/ environment failure / skill-defined fail-closed に到達した場合だけ停止してください。その場合も先に、自動で許されている deterministic repair、controlled contract update、issue-editor rewrite、investigation-derived path 解決、bounded retry をすべて実施してください。停止時は「人間判断が必要」とだけ書かず、
を GitHub termination report と最終応答に明示してください。
作業中はユーザーへ承認を求めず、この指示を受けたら直ちに開始してください。
この版では、単に「承認不要」とするのではなく、#2688 の anchor が解決済みの設計判断を authority にして、現在の skill にある
with_human_context/ #2086 AC3 /issue_editor_requiredの自律経路を使い切るようにしています。これにより、Allowed Paths の変更だけで再度 operator intervention に落ちる可能性を抑えられます。squne121 commentedon Sep 20, 2026
root-owned entry router audit
route: invoke_impl_review_loop
reason: fresh_review_go_live_equality
squne121 commentedon Sep 20, 2026
issue-refinement-loop: approved
run_root_review_pipeline.py produce→canonical_step2_route: step_2_5→VERDICT: approvesemantic_review_trigger.py→semantic_review_applicable: false(skip)decision: proceed,reason: no_hard_dependencies_confirmed_this_cycle## Verification Commandsを実際に検証してstatus: go)Note:
contract_review.latest_comment_urlはroot_entry_router.py::run_root_transition()が同一継続 turn 内で実行した current-runissue-contract-review(status: go,readiness_status: go,vc_preflight_status: pass)と live body/base SHA equality(ROOT_IMPLEMENTATION_ENTRY_ROUTE_V1.route: invoke_impl_review_loop,reason: fresh_review_go_live_equality)の audit comment を指す。root-owned synchronous entry transition(Issue #2272 正本)に基づき、この route 自体が impl-review-loop Step 1 起動の独立した authority である。squne121 commentedon Sep 20, 2026
確認結果では、#2688 は refinement 済みで、最新 handoff は
status: impl_ready/routing_action: run_impl_review_loop、blocker なしです。さらに現行mainのskill_runtime_exec.pyにはまだowner_reaction.decideの dispatch がなく、skill_runtime_command_policy.pyも #1975 時点の「declaration only / exact parser なし」の状態なので、実装対象は残っています。([Issue #2688](https://github.com/squne121/loop-protocol/issues/2688)、[[refinement 完了コメント](https://github.com/squne121/loop-protocol/issues/2688#issuecomment-5749752412)](https://github.com/squne121/loop-protocol/issues/2688#issuecomment-5749752412))推奨アクションは次のとおりです。
LOOP_HANDOFF_RESULT_V1やroot-entry-auditを再利用可能な authorization と見なさず、現在の root/main セッションから fresh な Root-Owned Synchronous Entry Transition を同一 continuous turn で実行する。implementation-worker → test-runner → pr-reviewerを canonical SubAgent として使用し、各 agent ごとに final result の取得とlist_agents上の terminalcompletedの両方を確認するまで次工程へ進まない。これはimpl-review-loopの Common Completion Protocol そのものです。REQUEST_CHANGESは人間確認を挟まずmax_iterations=3の範囲で自動修正。BEHINDや stale-head も canonical route に従って更新→再検証→再レビューする。skill_runtime_exec.pyの exact dispatch、policy の exact parser/checker、real executor subprocess テストに限定する。command_registry.pyは read-only、実装: owner_reaction_decision.py の出力を既存 heavy mutation gate へ統合する(#1975 の Out of Scope) #2689 の mutation consumer integration は吸収しない。APPROVE + blockers=[] + live mergeability CLEAN/HAS_HOOKSまで到達したら終了。merge / auto-merge は実行しない。ここが今回の「マージ直前」です。[impl-review-loop](https://github.com/squne121/loop-protocol/tree/main/.claude/skills/impl-review-loop)自身もこの状態をdraft_pr_readyとして人間の merge 判断に残す設計です。(impl-review-loop)そのまま既に auto mode で起動している Claude Code に貼れるプロンプトです。
Issue #2688 を対象に、canonical
impl-review-loopを使用して、実装 → 独立検証 → PRレビュー → 必要な修正ループを自律実行し、マージ直前の approved / mergeable 状態まで進めてください。Target Issue:
#2688
Canonical skill:
https://github.com/squne121/loop-protocol/tree/main/.claude/skills/impl-review-loop
Relevant OWNER architecture anchor:
#2688 (comment)
Latest refinement handoff:
#2688 (comment)
あなたは既に auto mode で起動している root/main の対話的 Claude Code セッションです。
最終目的
Issue #2688 の live contract を満たす実装を行い、PR を作成し、Verification Commands と relevant regressions を独立検証し、
pr-review-judgeの APPROVE と live mergeability の成立まで、通常のループ途中で人間承認を求めず進めてください。最終地点は以下です。
APPROVE[]IMPL_REVIEW_LOOP_RESULT_V1.status: draft_pr_readyPR の merge は実行しないでください。
gh pr merge、GitHub API merge、auto-merge enable 等も実行しないでください。マージ直前で停止し、PR URL と最終 evidence を報告してください。
0. canonical entry を fresh に実行する
過去コメントの
LOOP_HANDOFF_RESULT_V1.status: impl_readyROOT_IMPLEMENTATION_ENTRY_ROUTE_V1.route: invoke_impl_review_loopを、Step 1 の再利用可能な authorization token として扱ってはいけません。
.claude/skills/impl-review-loop/SKILL.mdと.claude/skills/impl-review-loop/steps/preparation.mdの Root-Owned Synchronous Entry Transition を SSOT としてください。
現在の root/main thread から、単一の continuous control flow / continuous turn の中で、
issue-contract-reviewdecide_root_entry_route()/ canonical root entry routinginvoke_impl_review_loopなら、その同じ継続 turn の中で Step 1 を起動まで実行してください。
過去 handoff comment は telemetry / background evidence として参照して構いませんが、それ単独で Step 1 を authorize しないでください。
fresh live state が過去コメントと異なる場合は、必ず fresh live state と canonical router を優先してください。
1. 人間承認ポリシー
今回、通常の loop iteration ごとの人間承認は不要です。
以下について途中確認を求めず、そのまま canonical loop を継続してください。
max_iterationsは canonical default の 3 としてください。REQUEST_CHANGESの場合は、blockers をfix_deltaに materialize して次 iteration の implementation-worker に渡し、自動継続してください。ただし以下は無効化しないでください。
HUMAN_REVIEW_REQUIREDClaude Code の permission mode は現在の auto mode のまま使用してください。
--dangerously-skip-permissions、permission configuration、bypass mode 等を変更してはいけません。「承認不要」は repository loop の routine approval を省略する意味であり、permission system や canonical hard-stop の無効化ではありません。
2. SubAgent を必ず使用する
root thread 自身が implementation / independent verification / review judgment を抱え込まず、
impl-review-loopが定義する canonical SubAgent を使用してください。少なくとも以下を使用します。
Step 1
implementation-worker.claude/skills/implement-issue/SKILL.mdを使用して、open-pr経由の PR 起票まで担当させてください。
Step 2
test-runnerimplementation-worker と独立した agent とし、current PR head SHA に対して Issue #2688 の literal Verification Commands を実行させてください。
Step 4
pr-reviewer.claude/skills/pr-review-judge/SKILL.mdに従い、current head に対する review verdict を取得してください。必要な
update_branch等も canonical routing が要求する場合は、skill が指定する worker delegation を使用してください。root thread は control-plane、state tracking、binding 検証、routing に専念してください。
3. SubAgent の完了を必ず待つ
これは必須です。
各
spawn_agentごとに canonicaltask_nameを保存してください。SubAgent を起動しただけで次の Step に進んではいけません。
.claude/skills/impl-review-loop/steps/step-4-pr-review.mdのCommon Completion Protocolをそのまま適用してください。
各 SubAgent について必ず、
spawn_agentwait_agentで mailbox activity を待つlist_agentsで同じ canonical task name が terminalcompletedであることを確認completedの両方が揃った後だけ次の routing / Step に進むという順序にしてください。
wait_agenttimeout、途中 mailbox update、steer response は完了ではありません。以下は成功として扱わず fail-closed にしてください。
erroredinterruptedshutdownnot_found特に、
ことを厳守してください。
ad-hoc な nested SubAgent delegation を追加しないでください。
canonical skill が明示する root-owned delegation 構造を維持してください。
4. Issue #2688 の技術的実装方針
live Issue body を contract の正本としてください。
今回の architecture は既に OWNER 判断済みです。
再度 architecture 選択を人間へ質問してはいけません。
採用方式は、
既存
scripts/agent-guards/skill_runtime_exec.pyにowner_reaction.decide/owner_reaction.decide.fixture用の command-specific exact dispatch wiring を追加する
です。
新しい
scope_rollup.run型独立 executor は作成しないでください。完全 generic command runner へのリファクタリングも行わないでください。
5. Allowed Paths を厳守する
変更可能なのは live Issue に記載された次の範囲だけです。
scripts/agent-guards/skill_runtime_exec.pyscripts/agent-guards/skill_runtime_command_policy.py.claude/skills/issue-refinement-loop/tests/.claude/skills/issue-refinement-loop/scripts/command_registry.pyは read-only design reference です。
registry の
を今回変更しないでください。
.claude/skills/issue-refinement-loop/scripts/owner_reaction_decision.pyも reaction semantics の再設計対象ではありません。
Allowed Paths 外の変更が本当に必要だと判明した場合は、勝手に scope を拡大せず canonical hard-stop / routing に従ってください。
6. implementation-worker への technical recommendation
implementation-worker には、Issue body の AC と repository evidence に加えて、少なくとも以下の derived guidance を渡してください。
exact dispatch
owner_reaction.decideとowner_reaction.decide.fixtureの両方を
skill_runtime_exec.pyの exact dispatch に接続する。production-shaped と fixture の両 profile が同じ owner-reaction dispatcher implementation を共有する。
policy
skill_runtime_command_policy.pyに、を current repository precedent と整合する形で実装する。
特に以下を正確に扱う。
--owner-user-id--preview-binding-file--gh-fixture-fileproduction と fixture で required / forbidden combination を曖昧にしない。
render / first hop
canonical chain は最低でも
skill_runtime_exec.py→ exact command policy/parser
→
command_registry.render_command()→
owner_reaction_decision.py→
owner_reaction_decision_result/v1まで real subprocess で到達させる。
executor が integrity/readback する first-hop script と registry が実際に render する first-hop script を、
owner_reaction_decision.pyで一致させる。
scope boundary
以下は実装しない。
selected_option_idを mutation gate に接続する downstream integration7. テストを「本物の executor 境界」で行う
単なる unit test や
command_registry.render_command()の direct invocation だけで AC を満たしたことにしないでください。Issue の Verification Commands に対応するテストとして、少なくとも live contract が要求する、
test_owner_reaction_decide_dispatch.pytest_owner_reaction_decide_flag_validation.pytest_owner_reaction_decide_failure_boundary.pyを実装してください。
正常系は production-shaped / fixture の両方で、
実
skill_runtime_exec.pysubprocess を entrypointにしてください。
確認対象には、
を含めてください。
failure boundary は少なくとも、
または
の一方を real outer executor 境界から発生させ、
outer executor が false success に変換しないことを確認してください。
既存
.claude/skills/issue-refinement-loop/tests/test_owner_reaction_decision.pyおよび relevant skill-runtime regressions も実行してください。
8. independent Verification を省略しない
Step 1 worker 自身のテスト PASS を Step 2 の代用にしてはいけません。
test-runner は PR current head に対して independent に Issue #2688 の literal Verification Commands を実行してください。
Step 4 起動前に root が、
completedを確認してください。
head が変化した場合、古い verification evidence を再利用せず、canonical route に従って再検証してください。
9. PR review と自動修正ループ
pr-reviewer が
REQUEST_CHANGESを返した場合、fix_deltaとして次の implementation-worker に渡すしてください。
routine fix ごとにユーザーへ承認を求めてはいけません。
reviewed_head_sha != current PR headの場合は stale review を APPROVE として扱わず、route_stale_head_rereviewで current head を再レビューしてください。
live merge state が
BEHINDの場合はroute_to_update_branchに従って branch update を worker に委譲し、その後 Verification と Review を再実行してください。
artifact / snapshot / launch ledger が stale・missing であるだけではループを止めず、canonical skill の advisory artifact policy に従ってください。
10. 終了条件
以下が成立するまで bounded loop を継続してください。
APPROVE[]route_loop_verdict_v2()のapproved条件を満たす成立したら、
IMPL_REVIEW_LOOP_RESULT_V1.status: draft_pr_readyとして終了してください。
ここで停止してください。PR は merge しないでください。
最終報告には最低限、
draft_pr_readyを構造化して含めてください。
途中経過の散文報告よりも、canonical structured result と evidence binding を優先してください。
このプロンプトでは、#2688 の既存 refinement を尊重しつつ、過去 handoff を authorization として誤再利用しないことと、各 SubAgent の final result + terminal
completedを待つことを明示的に強化しています。squne121 commentedon Sep 20, 2026
impl-review-loop: 完了 (2026-09-21T05:10:00Z)
require_extra_approval_for_unattributed_changes)→ mark ready for review → マージ → post-merge-cleanupfix: owner_reaction.decide の GH_CONFIG_DIR 継承・flag 検証・worktree 依存を PR #…
squne121 commentedon Sep 21, 2026
impl-review-loop: 完了 (2026-09-21T00:00:00Z)