Repository navigation
feat: owner_reaction_decision.py の selected 出力を not_planned heavy mutation gate へ限定接続する - #2697
Conversation
…ation gate へ限定接続する (#2689) run_refinement_preflight.py の heavy mutation gate (_classify_heavy_mutation_gate, #1891 AC6) は close_not_planned の trusted-anchor 承認しか受理できず、 owner_reaction_decision.py (#1975) の selected 判定結果を消費する経路が 未接続だった (#1975 Out of Scope)。 - _is_approved_owner_reaction_not_planned_decision(): 既存の _is_approved_close_not_planned_decision() とは独立した predicate。 status==selected かつ operation==close_not_planned かつ target が対象 Issue と完全一致する場合のみ true を返し、selected を approved_by_trusted_anchor へ変換しない。 - _run_owner_reaction_decision_fresh() / _build_owner_reaction_decide_argv(): owner_reaction.decide と同一の argv 形状で owner_reaction_decision.py を fresh subprocess 実行する(キャッシュなし)。 - _classify_heavy_mutation_gate_with_fresh_owner_reaction(): mutation_category が not_planned かつ known_context["owner_reaction_context"] が渡された 場合のみ、gate 評価直前に fresh subprocess を実行して結果を gate へ渡す。 それ以外は #2689 以前と挙動が完全に同一。 - close / replacement_issue_creation / dependency_removal / parent_child_change は引き続き fail-closed のまま。 - scripts/agent-guards/skill_runtime_exec.py / command_registry.py / skill_runtime_command_policy.py への変更なし。 Co-Authored-By: Claude Sonnet 5 <[email protected]>
Preview URLPreview removed (PR #2697 closed). |
PR Review (impl-review-loop Step 4)Mergeability
Evidence Check
Blockers(なし) Warnings(なし) verdict: APPROVE
reviewed_head_sha: "38ff3859ca8c55e35b8402252904e73d10238b20"
blockers: []
warnings: [] |
結論PR #2697 は REQUEST_CHANGES 相当です。
確認対象は PR head P0 — production wiring が依然として到達不能PR が追加した実 production call-site は ところが PR head 全体を追うと、
だけです。 同様に skill_runtime_exec → command_registry → run_refinement_preflight.py → run_preflight() という canonical path では、 これは特に重要で、Issue #2689 の初期 adversarial review コメント P0 — AC6 の「production-shaped」テストが欠落区間をバイパスしている
問題は後半です。取得した へ渡しています。 つまりこのテストは 本PRで新設した production wrapper まして、
は一切検証していません。 一方、wrapper の fresh-call テストは 結果として、 producer は本物、consumer は本物だが、producer→consumer transport はテストコードが代行している 状態です。今回もっとも壊れやすい境界だけが試験対象から抜けています。 CI 全成功や PR コメント P1 — subprocess の non-zero exit を無視している
で、 一方 現状はその JSON の Python の ここは harness を増やす必要はなく、 と、 P2 — schema identity の確認がない
だけを確認し、 production transport が完全に閉じていれば実害は限定的なので、これは blocker にするほどではありません。ただ、関数自身が「V1-shaped dict を読む」と契約している以上、1行の schema equality check を追加する方が契約として明確です。新しい validation framework は不要です。 既存実装で維持すべき部分owner reaction reader 自体は作り直す必要はありません。GitHub REST の issue-comment reactions は reaction ごとに また今回追加された以下は維持してよいです。
最小修正方針このプロジェクトが個人趣味開発で、workflow の実用性を優先する前提なら、generic authorization framework、ledger、TTL、追加publisherなどは不要です。 必要なのは canonical preflight invocation が そのうえで AC6 のテストを、producer payload をPythonから直接 gate に渡す方式ではなく、real canonical preflight entrypoint → context materialization → fresh owner_reaction subprocess → heavy mutation gate まで1本通す形に変更するべきです。fake この2点と non-zero exit check を直せば、PRの設計方向そのものはかなり良く、追加のセキュリティ機構を増やす必要はありません。現状の最大問題は安全性不足ではなく、「実装した経路が production から呼ばれない」という機能的な未接続です。 ## 結論PR #2697 は REQUEST_CHANGES 相当です。
確認対象は PR head
P0 — production wiring が依然として到達不能PR が追加した実 production call-site は if known_context and known_context.get("mutation_category"):
_heavy_mutation_gate = (
_classify_heavy_mutation_gate_with_fresh_owner_reaction(
mutation_category=known_context.get("mutation_category"),
scope_delta_decision=known_context.get("scope_delta_decision"),
owner_reaction_context=known_context.get("owner_reaction_context"),
repo=repo,
issue_number=issue_number,
)
)ところが PR head 全体を追うと、
cli_known_context = {
human_context_comment_urls: ...,
agent_report_comment_urls: ...,
}だけです。 同様に skill_runtime_exec → command_registry → run_refinement_preflight.py → run_preflight() という canonical path では、 これは特に重要で、Issue #2689 の初期 adversarial review コメント P0 — AC6 の「production-shaped」テストが欠落区間をバイパスしている
問題は後半です。取得した preflight._is_approved_owner_reaction_not_planned_decision(...)
preflight._classify_heavy_mutation_gate(
mutation_category="not_planned",
owner_reaction_decision=producer_payload,
...
)へ渡しています。 つまりこのテストは 本PRで新設した production wrapper まして、
は一切検証していません。 一方、wrapper の fresh-call テストは 結果として、 producer は本物、consumer は本物だが、producer→consumer transport はテストコードが代行している 状態です。今回もっとも壊れやすい境界だけが試験対象から抜けています。 CI 全成功や PR コメント P1 — subprocess の non-zero exit を無視している
proc = runner(..., check=False)
stdout = getattr(proc, "stdout", None)
...
parsed = json.loads(stdout)
return parsed if isinstance(parsed, dict) else Noneで、 一方 現状はその JSON の Python の ここは harness を増やす必要はなく、 if getattr(proc, "returncode", 1) != 0:
return Noneと、 P2 — schema identity の確認がない
だけを確認し、 production transport が完全に閉じていれば実害は限定的なので、これは blocker にするほどではありません。ただ、関数自身が「V1-shaped dict を読む」と契約している以上、1行の schema equality check を追加する方が契約として明確です。新しい validation framework は不要です。 既存実装で維持すべき部分owner reaction reader 自体は作り直す必要はありません。GitHub REST の issue-comment reactions は reaction ごとに また今回追加された以下は維持してよいです。
最小修正方針このプロジェクトが個人趣味開発で、workflow の実用性を優先する前提なら、generic authorization framework、ledger、TTL、追加publisherなどは不要です。 必要なのは canonical preflight invocation が そのうえで AC6 のテストを、producer payload をPythonから直接 gate に渡す方式ではなく、real canonical preflight entrypoint → context materialization → fresh owner_reaction subprocess → heavy mutation gate まで1本通す形に変更するべきです。fake この2点と non-zero exit check を直せば、PRの設計方向そのものはかなり良く、追加のセキュリティ機構を増やす必要はありません。現状の最大問題は安全性不足ではなく、「実装した経路が production から呼ばれない」という機能的な未接続です。 |
|
確認した限り、推奨は そのまま現行 Allowed Paths 内で修正を続けるのではなく、#2697 の P0 を根拠に #2689 を最小限 reframe してから 対象コメントは OWNER による明示的な したがって、このユーザープロンプト自体を「Stop Condition で要求されていた owner/operator 判断」として扱わせ、P0 解消に必要な最小 transport ファイルだけ #2689 の Allowed Paths に追加するのが整合的です。P1 の non-zero exit check と P2 の schema identity check も小さいので同じ fix_delta で潰すのがよいです。 以下を、既に auto mode で動いている Claude Code にそのまま渡せます。 PR #2697 を対象に、以下の OWNER review comment を authoritative fix_delta として Target PR: Target review / human context: Linked Issue: 現在確認済みの PR head: 使用する skill: 目的は、対象 OWNER comment の blocker を解消し、実装 → 独立検証 → PR review のループを マージ直前の canonical approved / draft_pr_ready 状態まで、人間への逐次承認要求なしで自律継続することです。 PR の merge 自体は実行しないでください。 この入力の authority対象 comment これは「停止せよ」という human veto ではなく、明示的な REQUEST_CHANGES / 修正指示です。 また Issue #2689 の Stop Conditions にある
については、このプロンプトをその operator decision として扱って構いません。 P0 を独立調査して本当に canonical transport の変更が必要だと確認できた場合、以下の 最小限の scope expansion を追加承認なしで materialize してよいものとします。 最大許可範囲:
これ以上の scope 拡大は行わないでください。 最初に SubAgent で独立調査する実装を始める前に、main orchestrator から独立した SubAgent を起動してください。 最低でも以下の3観点を別々に調べてください。
SubAgent は nested SubAgent を起動しないこと。 全 SubAgent の作業完了を必ず待ってから main orchestrator が統合判断してください。 Scope reframe が必要な場合独立調査で comment の P0 が再現し、共有 infra transport の変更が不可避なら、コード変更より先に Issue #2689 の live contract を canonical issue-editing path で最小修正してください。 raw な無制御 mutation は避け、repository の既存 issue-editing workflow / guard に従ってください。 最低限、Issue #2689 の以下の矛盾を解消してください。
AC6 は少なくとも次の chain を実際に通すことを要求する内容へ修正してください。
fake/stub は GitHub network boundary に限定して構いません。 Issue body を広範囲に書き換えず、今回必要な transport gap の修正だけに限定してください。 実装修正の優先順位OWNER comment の finding を以下の順で扱ってください。 P0-1: canonical production transportcanonical preflight invocation から必要 context が実際に
可能なら明示的 transport を使い、comment metadata などから暗黙推論しないでください。 特に:
の provenance を曖昧にしないこと。 今回開放する mutation category は引き続き
は fail-closed のまま維持してください。 generic authorization framework や ledger/TTL などは追加しないでください。 P0-2: false-green test の修正現在の production-shaped test のように、
と手動接続してはいけません。 上述の canonical production chain を real subprocess entrypoint から通してください。 既存 P1: non-zero subprocess exit
non-zero + parseable structured JSON でも transport success として扱わず fail-closed にしてください。 少なくとも
する regression test を追加してください。 P2: schema identity低コストで可能なので、
または実際の canonical schema identity に対応する等価チェックを predicate boundary に追加してください。 既存 schema validator frameworkを新設する必要はありません。 守るべき既存設計以下は壊さないでください。
impl-review-loop の実行scope contract が coherent になったら、 対象 PR #2697 を再利用し、新規 PR を作らないこと。 target comment の blocker を 各 iteration で:
を実施してください。 各 SubAgent の完了を必ず待つこと。 SubAgent の散文だけで判断せず、skill が要求する structured result を保持してください。 current-head binding を必ず確認し、実装後に head が変わった場合は古い review verdict を再利用しないでください。 REQUEST_CHANGES なら追加承認なしで次 iteration に進んでください。
実 Git conflict、secret/credential 判断、明示的な human stop、max_iterations 等の skill 上の真正 hard stop が発生した場合だけ停止してください。 VerificationIssue #2689 の AC/VC を fresh contract に基づいて再評価してください。 最低でも:
を実行してください。 無関係な全リポジトリ test suite を機械的に増やすより、今回変更した production boundary を直接検証する focused tests を優先してください。 既知の pre-existing failure と今回導入した failure を明確に分離してください。 完了条件以下を全て満たすまで自律継続してください。
PR の merge はしないでください。 最後に、実際に変更した Issue contract、変更ファイル、最終 head SHA、テスト結果、review verdict、残存 warning、mergeability を簡潔に報告してください。 ポイントは、P0 の修正そのものより先に #2689 の「共有 infra は変更禁止」という契約矛盾を解消させることです。これを入れないと、実装できても |
… false-green E2E repair (#2689) PR #2697 review fix_delta (comment #5755475318): - P0-1: add --mutation-category/--owner-user-id/--preview-binding-file to run_refinement_preflight.py's main(), wired through command_registry.py's preflight.run.with_human_context / contract_update.run.with_human_context and skill_runtime_command_policy.py's exact command parser, so the not_planned heavy mutation gate is reachable from the real production dispatch chain (previously only exercisable via hand-crafted known_context). - P0-2: replace the false-green production-shaped test with a real E2E that launches run_refinement_preflight.py as a genuine subprocess (fixture-mode outer read, fake-gh-backed nested owner_reaction_decision.py subprocess) and observes the gate's decision via the real planner_input.json artifact -- no test-code manual bridging of producer/consumer. - P1: _run_owner_reaction_decision_fresh() now fails closed on any non-zero subprocess exit, even when stdout happens to parse as JSON. - P2: add a lightweight OWNER_REACTION_DECISION_RESULT_V1 schema-identity check to the same function. Co-Authored-By: Claude Sonnet 5 <[email protected]>
…on-heavy-mutation-gate' into worktree-issue-2689-owner-reaction-heavy-mutation-gate
…tion-gate transport triple (#2689 fix_delta, PR #2697 Blocker 2) pr-reviewer noted no existing test starts skill_runtime_exec.py as a real subprocess with --mutation-category/--owner-user-id/--preview-binding-file; reuse the existing _install_real_contract_update_fixture() fixture to prove the triple is accepted and correctly reaches run_refinement_preflight.py's heavy mutation gate. Co-Authored-By: Claude Sonnet 5 <[email protected]>
Summary
owner_reaction_decision.py(Issue #1975)はselected判定結果を返すが、run_refinement_preflight.pyの heavy mutation gate(_classify_heavy_mutation_gate()/_is_approved_close_not_planned_decision()、Issue #1891 / PR #2478)へは未接続で、既存 gate が唯一意味を持つnot_planned(close_not_planned)ケースを owner reaction 経由で承認する経路が存在しなかった(#1975 の明示的 Out of Scope)。本 PR は、
owner_reaction_decision.pyのselected出力を、既存 gate が唯一意味を持つnot_plannedケースに限定して production 接続する。_is_approved_owner_reaction_not_planned_decision()(run_refinement_preflight.py): 既存の_is_approved_close_not_planned_decision()とは完全に独立した predicate。status == "selected"かつselected_option_metadata.operation == "close_not_planned"かつselected_option_metadata.target == f"#{issue_number}"(対象 Issue と完全一致)の場合のみtrueを返す。selectedをapproved_by_trusted_anchorへ変換しない。同一 operation でも target が異なる option は承認済みとして扱わない。_build_owner_reaction_decide_argv()/_run_owner_reaction_decision_fresh():command_registry.pyのowner_reaction.decideエントリと同一の--repo/--issue-number/--owner-user-id/--preview-binding-file引数形状でowner_reaction_decision.pyを fresh subprocess 実行する(キャッシュ・再利用なし)。_run_repair_subprocess()の既存 sibling-subprocess 呼び出し規約(sys.executable直接起動)に倣う。_classify_heavy_mutation_gate_with_fresh_owner_reaction():mutation_category == "not_planned"かつknown_context["owner_reaction_context"]({"owner_user_id": <int>, "preview_binding_file": <path>})が渡された場合のみ、gate 評価の直前に fresh subprocess を実行し、その結果だけを_classify_heavy_mutation_gate()へ渡す。それ以外(未指定、または他の heavy mutation category)は 実装: owner_reaction_decision.py の出力を既存 heavy mutation gate へ統合する(#1975 の Out of Scope) #2689 以前と挙動が完全に同一。_classify_heavy_mutation_gate()はowner_reaction_decision/target_issue_numberを追加のキーワード専用引数(デフォルトNone)として受理し、既存のexact_close_not_planned分岐とは独立した OR 分岐としてowner_reaction_not_planned_approvedを追加。両分岐ともnot_plannedのみに限定。run_preflight()の呼び出し箇所を新ラッパーへ差し替え。close/replacement_issue_creation/dependency_removal/parent_child_changeは引き続き fail-closed のまま。command_registry.pyがレンダリングする production argv にはrun_refinement_preflight.pyの CLI へ--mutation-category/--owner-user-id/--preview-binding-fileを渡す経路が一つも存在せず、_classify_heavy_mutation_gate_with_fresh_owner_reaction()が実 CLI 経由では到達不能だった。これを修正するため、command_registry.pyのpreflight.run.with_human_context/contract_update.run.with_human_contextの2 command_id のエントリのみに、オプション atomic triple--mutation-category/--owner-user-id/--preview-binding-file(3つ揃って指定するか、3つとも省略するかのいずれかのみ許可)を追加。skill_runtime_command_policy.pyの exact-grammar parser(parse_exact_skill_runtime_anchor_command())とskill_runtime_exec.pyのmain()に、この2 command_id のみ許可する all-or-none 検証(一部のみ指定・他の command_id への指定は exit 2)を追加。run_refinement_preflight.pyのmain()にも同じ CLI flag と all-or-none 検証(違反時 blocked/exit 2)を追加し、known_context["mutation_category"]/known_context["owner_reaction_context"]を materialize する。owner_reaction.decide自体の argv 形状・_build_owner_reaction_decide_argv()(sys.executable 直接起動、skill_runtime_exec.pyを経由しない設計は変更なし)には影響しない。新たな command_id・新たな mutation category は一切追加しない。owner_reaction_decision.pyはモジュール docstring のみ更新(実装: owner_reaction_decision.py の出力を既存 heavy mutation gate へ統合する(#1975 の Out of Scope) #2689 の consumer 側配線を追記)。reaction 読み取りロジックは無変更。.claude/skills/issue-refinement-loop/SKILL.mdの Reference Map を更新。新規テスト:
test_owner_reaction_not_planned_gate.py: AC1〜AC5 相当(predicate の独立性・identity binding・fail-closed 分岐・fresh subprocess 検証・trusted-anchor 非混同)test_owner_reaction_not_planned_gate_production_shaped.py: AC6(run_refinement_preflight.pyをsys.executableで直接起動する real subprocess + 既存 fake-ghfixtureowner_reaction_dispatch_fixture.pyを再利用した producer→consumer path の production-shaped 検証。この subprocess chain は設計上skill_runtime_exec.pyを経由しない)scripts/agent-guards/tests/test_skill_runtime_exec_anchor.py::test_mutation_gate_transport_triple_reaches_real_subprocess_and_heavy_mutation_gate(fix_delta 追加、Blocker 2 対応): 既存 fixture_install_real_contract_update_fixture()を再利用し、realskill_runtime_exec.pysubprocess に新 triple を渡してcommand_registry.render_command()/skill_runtime_command_policy.parse_exact_skill_runtime_anchor_command()を経て実際に子プロセスの argv が正しく組み立てられ、realrun_refinement_preflight.pyの heavy mutation gate(HEAVY_MUTATION_FAIL_CLOSED)まで到達することを検証Checks
rg -n "_is_approved_owner_reaction_not_planned_decision" .claude/skills/issue-refinement-loop/scripts/run_refinement_preflight.py— マッチあり(AC1)uv run --locked pytest .claude/skills/issue-refinement-loop/tests/test_owner_reaction_not_planned_gate.py -v— 12 passeduv run --locked pytest .claude/skills/issue-refinement-loop/tests/test_owner_reaction_not_planned_gate_production_shaped.py -v— 1 passed(AC6)uv run --locked pytest .claude/skills/issue-refinement-loop/tests/test_run_refinement_preflight_credentialless_transport.py -v— 16 passed(AC7、無変更で継続 PASS)uv run --locked pytest .claude/skills/issue-refinement-loop/tests/test_anchor_context_multi_turn_supersession.py .claude/skills/issue-refinement-loop/tests/test_anchor_scope_reframe_close_not_planned.py -q— 47 passed(既存 heavy mutation gate 呼び出し元の回帰確認)uv run --locked pytest .claude/skills/issue-refinement-loop/tests/test_owner_reaction_decision.py .claude/skills/issue-refinement-loop/tests/test_owner_reaction_decide_dispatch.py .claude/skills/issue-refinement-loop/tests/test_owner_reaction_decide_failure_boundary.py .claude/skills/issue-refinement-loop/tests/test_owner_reaction_decide_flag_validation.py -q— 37 passed(owner_reaction_decision.py docstring-only 変更の無回帰確認)uv run --locked pytest .claude/skills/issue-refinement-loop/tests/ -q -n auto— 2214 passed, 3 skipped, 5 failed(すべて pre-existing。3件はTestAuthorityTransportPrivilegedExecutorRealSubprocessDispatch(本 PR 変更前のmainでも同一失敗を再現確認済み — 環境固有の既知事象、owner_reaction とは無関係)。残り2件は-n auto並列実行時のみ発生する.claude/artifacts/issue-refinement-loop/2053/...共有パスへの xdist worker 間書き込み競合(-p no:xdistの逐次実行では該当テストは PASS することを確認済み。本 PR の変更内容とは無関係)uv run --locked pytest .claude/skills/issue-refinement-loop/tests/test_thin_entrypoint.py .claude/skills/issue-refinement-loop/tests/test_step_0f_parent_owned_preflight.py .claude/skills/issue-refinement-loop/tests/test_skill_md_wiring.py -q— 24 passed(SKILL.md thin entrypoint line budget 500 行以内を維持、498 行)uv run --locked pytest scripts/agent-guards/tests/test_skill_runtime_exec_anchor.py -q— 21 passed(fix_delta 追加テスト含む既存 real-subprocess スイート全体の無回帰確認。新 triple を追加したcommand_registry.py/skill_runtime_command_policy.py/skill_runtime_exec.pyの既存 real-subprocess 回帰カバレッジ)uv run --locked pytest scripts/agent-guards/tests/test_skill_runtime_exec_anchor.py::test_mutation_gate_transport_triple_reaches_real_subprocess_and_heavy_mutation_gate -v— 1 passed(fix_delta Blocker 2 対応の新規テスト)pnpm typecheck/pnpm lint/pnpm test/pnpm build— 未実行。本 PR の変更は.claude/skills/issue-refinement-loop/配下の Python スクリプト・テスト・Markdown のみで、TypeScript/フロントエンドのソースコードには一切触れていないため対象外と判断(docs/dev/workflow.mdの docs-only/非 TS 変更時の運用に準拠)uv run pytest .claude/skills/gemini-cli-headless-delegation/tests/test_model_routing.py— 24 passed(無関係領域だが規約に従い実行)Schema Change Applicability
(
OWNER_REACTION_DECISION_RESULT_V1は Issue 実装: owner reaction 手順を決定論的 reaction reader/principal resolver/drift checker/mutation consumer として実装する #1975 で確立済みの既存 schema であり、本 PR ではキー集合・型を一切変更していない。_classify_heavy_mutation_gate()に追加したowner_reaction_decision/target_issue_numberはいずれもデフォルトNoneの内部 Python 関数のキーワード専用引数であり、外部消費される新規スキーマの導入ではない)Schema Consumer Inventory
N/A(
not_schema_changeのため。本 PR は既存 schema 出力(owner_reaction_decision.pyのOWNER_REACTION_DECISION_RESULT_V1)の新規 in-process consumer をrun_refinement_preflight.py内部に追加するのみで、schema 自体の定義変更・外部 consumer 追加は行っていない)Safety Claim Matrix
run_refinement_preflight.pyの heavy mutation gate(_classify_heavy_mutation_gate())は Issue #1891 で導入された fail-closed 安全境界であり、本 PR はその承認経路を拡張するため safety-sensitive PR として扱う。not_plannedcategory にのみ適用され、close/replacement_issue_creation/dependency_removal/parent_child_changeの fail-closed 挙動は変更していないtest_unresolved_stale_environment_error_and_unsupported_category_fail_closedPASS(4 category すべてでstatus: blocked, fail_closed: Trueを確認)close_not_plannedoperation でも target が異なる option は承認されない(identity binding)test_same_category_different_target_rejectedPASS。production-shaped テストでもtarget_issue_number=ISSUE_NUMBER+1で再確認unresolved/stale/environment_errorの owner reaction 結果は承認されないtest_unresolved_stale_environment_error_and_unsupported_category_fail_closedPASStest_gate_uses_fresh_invocation_result_onlyPASS(2回の呼び出しで異なる fake 結果を返し、gate 判定が都度追随することを確認)selectedをapproved_by_trusted_anchorに変換せず、既存_is_approved_close_not_planned_decision()を呼び出さないtest_new_predicate_does_not_convert_to_approved_by_trusted_anchorPASS(AST ベースで実行本体に該当識別子・リテラルが存在しないことを検証)test_no_subprocess_issued_when_owner_reaction_context_absent/test_no_subprocess_issued_for_non_not_planned_categoryPASSscripts/agent-guards/skill_runtime_exec.py/command_registry.py/skill_runtime_command_policy.pyへの変更は、preflight.run.with_human_context/contract_update.run.with_human_contextの2 command_id のみに限定したオプション atomic triple 追加であり、owner_reaction.decide自体の argv 形状・新規 dispatch surface は追加していない(285 insertions / 13 deletions、3ファイル)git diff --stat origin/main...HEAD -- scripts/agent-guards/skill_runtime_exec.py scripts/agent-guards/skill_runtime_command_policy.py .claude/skills/issue-refinement-loop/scripts/command_registry.pyで確認可能(285 insertions(+), 13 deletions(-))skill_runtime_exec.pysubprocess がこれを受理し、command_registry.render_command()を経て子プロセス(realrun_refinement_preflight.py)の argv へ実際に組み立てられ、heavy mutation gate まで到達するtest_mutation_gate_transport_triple_reaches_real_subprocess_and_heavy_mutation_gatePASS(real subprocess dispatch。extra_args 省略時はHEAVY_MUTATION_FAIL_CLOSEDが出現しないことを別途手元で確認済み — 陽性/陰性の両方を区別できることを検証)run_refinement_preflight.py/skill_runtime_exec.py/skill_runtime_command_policy.pyそれぞれにコード実装済みだが、real subprocess 経由でこの否定的経路(拒否)を明示的に検証する新規テストは本 PR には含まれないskill_runtime_exec.pyL2651-2691 /run_refinement_preflight.pyL10658-10672 /skill_runtime_command_policy.pyの exact-grammar parser 参照。テストなしRuntime Verification Evidence(動作検証証跡、AC4/AC6)
Runtime Verification Applicability:
immediate(Issue #2689 本文)。applicable_acs: AC4, AC6。実行環境は GitHub network 通信なしで完結する(fake-ghfixture + realskill_runtime_exec.pysubprocess)。以下は本 PR head(.claude/worktrees/issue-2689-owner-reaction-heavy-mutation-gatecheckout)で実行した実ログ。AC4: heavy mutation gate 評価直前に
owner_reaction_decision.pyが fresh subprocess 実行され、同一 invocation 内の結果のみが使われる。PASS2026-09-21T03:30:56ZLinux WSL2 6.18.33.2-microsoft-standard-WSL2 / Python 3.12.3 / uv 0.11.29 / pytest 9.0.30実行ログ(クリックで展開)
AC6:
owner_reaction.decideの実行結果が heavy mutation gate 判定へ到達する producer→consumer path が1本通る(real subprocess chain)。fix_delta(PR #2697 review、Blocker 2)で判明した通り、この producer→consumer path は
run_refinement_preflight.pyをsys.executableで直接起動する real subprocess であり、その内部の_run_owner_reaction_decision_fresh()(owner_reaction_decision.pyを起動する nested real subprocess)は設計上 意図的にscripts/agent-guards/skill_runtime_exec.pyを経由しない(_build_owner_reaction_decide_argv()の docstring に明記の通り、_run_repair_subprocess()と同じ sibling-subprocess 規約に倣う)。PASS2026-09-21T07:07:14ZLinux WSL2 6.18.33.2-microsoft-standard-WSL2 / Python 3.12.3 / uv 0.11.29 / pytest 9.0.30実行ログ(クリックで展開)
AC6 補足(fix_delta 追加、Blocker 2 対応):
preflight.run.with_human_context/contract_update.run.with_human_contextの production transport(command_registry.pyが rendering する realskill_runtime_exec.pysubprocess 経由)が、新 triple--mutation-category/--owner-user-id/--preview-binding-fileを実際に受理し、realrun_refinement_preflight.pyの heavy mutation gate まで到達させる。上記 AC6 本体の producer→consumer path が経由しない
skill_runtime_exec.py自体を real subprocess として起動し、新 triple の command_text 再構築・render_command()を経た argv 組み立てが正しく動作することを検証する(reviewer 推奨 (a))。PASS2026-09-21T07:07:30ZLinux WSL2 6.18.33.2-microsoft-standard-WSL2 / Python 3.12.3 / uv 0.11.29 / pytest 9.0.30実行ログ(クリックで展開)
Notes
run_refinement_preflight.py/owner_reaction_decision.py/.claude/skills/issue-refinement-loop/tests//SKILL.md)に加え、PR feat: owner_reaction_decision.py の selected 出力を not_planned heavy mutation gate へ限定接続する #2697 review fix_delta(P0-1、reviewer コメント #5755475318)で scope reframe されたcommand_registry.py/scripts/agent-guards/skill_runtime_exec.py/scripts/agent-guards/skill_runtime_command_policy.py/scripts/agent-guards/tests/(test_skill_runtime_exec_anchor.py)を変更している(git diff --stat origin/main...HEADで12ファイル、1725 insertions(+), 29 deletions(-) を確認可能)。run_refinement_preflight.py/tests/を Allowed Paths に含む OPEN Issue)は edit_intent が異なるため重複ではない。並行実装時は## Delivery Ruleに従い後着手側が rebase する。