Repository navigation
Description
Machine-Readable Contract
contract_schema_version: v1
issue_kind: implementation
parent_issue: none
goal_ref: "Close only the planner contract_patch_plan absent/non-dict production reachability gap for the existing eligible #2620 freeform explicit trusted human_review_directive route, while preserving structured and genuine empty-operations semantics."
change_kind: codeParent Issue
None (standalone follow-up)
Parent Goal Ref
- Goal: Restore the existing 実装: trusted human contract feedback を controlled editor handoff に接続する #2620 eligible freeform route to production reachability only when the planner
contract_patch_planis absent or non-dict. - Desired Destination: 実装: --enable-full-analysis のhelpテキストを--publish-authorized必須の実際の起動条件に合わせて修正する #2715 remains blocked pending this narrowly scoped routing fix; 実装: --enable-full-analysis のhelpテキストを--publish-authorized必須の実際の起動条件に合わせて修正する #2715 itself is not updated by this Issue.
Current Validated Scope
- Make the production
run_preflight()path reach the existing canonical consumer only for a freeform explicit trustedhuman_review_directivefixture where structuredANCHOR_SCOPE_REFRAME_V1is absent and planner authoritycontract_patch_planis absent or non-dict before realrun_preflight()processing. - Add fixture-backed, full production-entrypoint regression coverage for that exact missing-plan source-anchor shape and its fail-closed negative matrix.
- Reuse the existing runtime verification apparatus for the required focused real
run_preflight()smoke.
Remaining Parent Gaps
- None.
Background
#2715 was reproduced with the operator-selected human anchor comment #2715 (comment). preflight.run.with_human_context passes and records source_kind: issue_comment, confidence: explicit, and anchor_reframe: false; the subsequent contract_update.run.with_human_context is blocked by PLANNER_FAIL_CLOSED and writes 0.
Verified current-HEAD evidence at 73203069a9cfc6e1d0bd84e9bdf241ca618fa6b2 establishes that absent/non-dict contract_patch_plan never reaches the consumer and falls fail-closed; structured-only synthesis is not generic missing-plan synthesis. The existing canonical consumer and decide_rewrite_route SSOT already implement the eligible freeform genuine empty-operations route to issue_editor_required. Generic {"operations": []} or empty CONTRACT_PATCH_PLAN_V1 synthesis is unsafe because non-applicable missing-plan cases can reach compatibility no_change.
Adopt only the deterministic production-reachability repair: make the existing canonical consumer evaluate the eligible planner-missing case before PLANNER_FAIL_CLOSED is emitted. Do not create a structured anchor payload, synthesize a generic empty plan, bypass issue-editor routing, or duplicate routing logic.
Outcome
Updated run_refinement_preflight.py production routing and fixture-backed regression coverage exist. For the exact eligible freeform missing-plan path, the canonical route emits NEXT_ACTION: issue_editor_required with writes: 0; untrusted, ambiguous, invalid-binding, and non-applicable missing-plan inputs retain their existing fail-closed blocker/reason and never report no_change or proven_no_change.
Runtime Verification Applicability
decision: immediate
runtime_tag: skill-invocation-runtime-smoke
applicable_acs: ["runtime skill-invocation smoke"]
execution_environment: existing canonical skill runtime executor in the implementation worktree
skip_conditions: Exit 77 is an explicit SKIP only under the existing runtime policy.
fallback_policy: Required runtime prerequisites unavailable without the policy-defined exit-77 SKIP are reported as FAIL; do not add a harness.
artifact_requirements: Preserve worktree-local evidence from the focused real run_preflight() invocation.
reason: This production run_preflight() reachability repair requires a focused real invocation through the existing runtime verification apparatus; fixture coverage alone is insufficient.
evidence: Reuse existing apparatus only.
In Scope
- In
run_preflight(), close only the planner-authoritycontract_patch_planabsent/non-dict production reachability gap for an eligible freeform explicit trustedhuman_review_directivefixture where structuredANCHOR_SCOPE_REFRAME_V1is absent. - Require use of the existing canonical consumer and existing
decide_rewrite_routeSSOT. Do not directly call_decide_human_review_directive_editor_route()fromrun_preflight()and do not duplicate routing. - Permit optionalization of a private/internal canonical-consumer parameter only if necessary to carry the absent/non-dict planner state; do not change wire, schema, or fixed artifact contracts.
- Add full
run_preflight()regression fixtures and assertions in the allowed test file for a freeform explicit trustedhuman_review_directivefixture where structuredANCHOR_SCOPE_REFRAME_V1is absent and planner authoritycontract_patch_planis absent/non-dict before realrun_preflight(), and forexplicit_trusted_human_directive_requires_issue_editor,writes: 0, and transaction calls0. - Add negative-matrix coverage for wrong-lane/untrusted, ambiguous, and invalid-binding missing-plan inputs: each has writes
0, no editor route, nono_changeorproven_no_change, and its existing fail-closed blocker/reason. - Assert mutually exclusive precedence: (1) an existing structured
ANCHOR_SCOPE_REFRAME_V1remains owned by its existing route and retainsapproved_scope_requires_full_contract_rewrite; (2) only when no structured payload governs the transaction, the eligible freeform explicit trustedhuman_review_directivefixture with planner authoritycontract_patch_planabsent/non-dict reachesexplicit_trusted_human_directive_requires_issue_editor; (3) a non-empty plan remains on its ordinary patch route. - Run the immediate, runtime-tagged
skill-invocation-runtime-smokethrough the existing apparatus with a focused realrun_preflight()invocation and preserve worktree-local evidence, handling SKIP 77 and fallback FAIL exactly as specified above.
Out of Scope
- 実装: --enable-full-analysis のhelpテキストを--publish-authorized必須の実際の起動条件に合わせて修正する #2715 CLI contract, code, or Issue updates.
- Creating a structured payload or generic
{"operations": []}/ emptyCONTRACT_PATCH_PLAN_V1synthesis. - Changing genuine eligible empty-operations semantics.
- An issue-editor bypass, a direct
run_preflight()call to_decide_human_review_directive_editor_route(), or duplicate routing. - Wire/schema/fixed-artifact contract changes.
- New schemas, runtime/security harnesses, approval systems, permission-setting work, control-plane redesign, or auto-mode classifier work.
Acceptance Criteria
- AC1: For a freeform explicit trusted
human_review_directivefixture where structuredANCHOR_SCOPE_REFRAME_V1is absent and planner authoritycontract_patch_planis absent or non-dict before a realrun_preflight(), the eligible directive reaches the existing canonical consumer and emitsNEXT_ACTION: issue_editor_required,explicit_trusted_human_directive_requires_issue_editor,writes: 0, and transaction calls0. This case is mutually exclusive from AC4's structured scope-reframe case. - AC2:
run_preflight()does not synthesize generic{"operations": []}or an emptyCONTRACT_PATCH_PLAN_V1; genuine empty-operations behavior remains owned by the existing canonical consumer anddecide_rewrite_routeSSOT. - AC3: Wrong-lane/untrusted, ambiguous, invalid-binding, and non-applicable missing-plan fixtures each retain their existing fail-closed blocker/reason, have writes
0, have no editor route, and never yieldno_changeorproven_no_change. - AC4: Mutually exclusive precedence is explicit: (1) an existing structured
ANCHOR_SCOPE_REFRAME_V1remains owned by its existing route and retainsapproved_scope_requires_full_contract_rewrite; (2) only when no structured payload governs the transaction, AC1's eligible freeform explicit trustedhuman_review_directivefixture with planner authoritycontract_patch_planabsent/non-dict reachesexplicit_trusted_human_directive_requires_issue_editor; (3) a non-empty contract patch plan remains on the ordinary patch route. - AC5: [runtime: immediate][skill-invocation-runtime-smoke] The existing runtime verification apparatus performs a focused real
run_preflight()invocation and saves worktree-local evidence; only exit 77 is recorded as SKIP, while unavailable prerequisites without that policy-defined SKIP are reported as FAIL.
Verification Commands
# AC1
# AC2
# AC3
# AC4
$ uv run --locked pytest .claude/skills/issue-refinement-loop/tests/test_preflight_run_with_anchor.py -q
# AC5
$ uv run --locked pytest .claude/skills/issue-refinement-loop/tests/test_preflight_run_with_anchor.py -q -k "explicit_human_review_directive_reaches_next_action_production_reachable"Allowed Paths
.claude/skills/issue-refinement-loop/scripts/run_refinement_preflight.py.claude/skills/issue-refinement-loop/tests/test_preflight_run_with_anchor.py
Stop Conditions
- Allowed Paths 外の変更が必要と判明した場合
- In Scope の固定契約(キー集合・スキーマ・型定義)の変更が必要になった場合
- wire、schema、fixed artifact contract の変更が必要になった場合
- 新規 Issue の起票が必要と判断した場合(スコープ分割が発生する場合)
- 後続 Phase / 別スコープへの波及が判明した場合
- nested SubAgent delegation が必要になった場合
- 外部サービス利用・権限昇格・既存テスト大規模改変が必要になった場合
- 新規 harness が必要になった場合
Required Skills
- なし
Required Design References
.claude/skills/issue-refinement-loop/references/anchor-comment-handling.md.claude/skills/issue-refinement-loop/references/loop-state.mddocs/dev/extension-surface-runtime-policy.yaml
Dedupe Key
2715-anchor-5770013860-freeform-human_review_directive-planner-contract_patch_plan-absent-or-nondict-no-generic-empty-plan-PLANNER_FAIL_CLOSED
Scope Coordination
- Overlap preflight class C1 matched 実装: run_refinement_preflight.py の結果に decisions フィールドを出力しSKILL.mdとのSSOT乖離を解消する #1556, 実装: fix(issue-refinement-loop): no-human-approval autonomy mode を loop state routing に明示する #1007, 実装: issue-refinement-loop の preflight result から LOOP_STATE を生成する route wrapper を追加し CLI/schema 迷走を防ぐ #1006, feat(agent-ops): issue-contract-fixer SubAgent を追加し、LLM rewrite 前に deterministic contract repair を完了させる #998, feat(issue-refinement-loop): LOOP_ITERATION_CAPSULE_V1 を導入し、raw body / raw log の main context 流入を禁止する #997, 実装: issue-refinement-loop の rewrite routing が既存 blocker contract を consume して non-body-author-fixable blocker を早期停止できるようにする #944, and test: scope_signal_guard termination の publisher-level 回帰テストを追加する #926 on the two Allowed Paths. They do not own this planner-missing production-reachability shape; this Issue is limited to one narrow production-reachability branch and its regression.
- Do not parallel-implement conflicting same-file edits; resolve any active same-file PR before implementation.
Delivery Rule
- 1 Issue = 1 PR. Use an isolated worktree and create a Draft PR by default.
- This Issue is a hard predecessor for 実装: --enable-full-analysis のhelpテキストを--publish-authorized必須の実際の起動条件に合わせて修正する #2715; keep 実装: --enable-full-analysis のhelpテキストを--publish-authorized必須の実際の起動条件に合わせて修正する #2715 blocked until this routing fix is landed.
Activity
squne121 commentedon Sep 22, 2026
結論
REQUEST_CHANGES —
reframe_in_place推奨です。#2724 が特定した不具合は実在します。#2715 の実測、#2620 / PR #2623 の契約、current
mainのrun_refinement_preflight.pyを追うと、freeform explicit trustedhuman_review_directive自体の routing SSOT は既に実装済みなのに、productionrun_preflight()がcontract_patch_plan不在時にその consumer を呼ぶ前にPLANNER_FAIL_CLOSEDへ落ちています。ただし、現状 Issue のまま実装すると「とりあえず空
CONTRACT_PATCH_PLAN_V1を合成する」修正に流れやすく、別の false-green を作る危険があります。新しい security subsystem や巨大 harness は不要です。missing-plan と empty-plan を区別して既存 consumer に接続し、negative regression を強化するのが最小かつ有用です。Findings
absent planを単純にoperations: []へ変換すると、非適格入力が正常no_changeに化けます。current
mainのrun_preflight()は、planner sidecar のcontract_patch_planがdictの場合だけconsume_trusted_anchor_contract_patch_plan()を呼びます。plan が無ければ consumer に到達せずBLOCKER_FAIL_CLOSEDです(run_refinement_preflight.py:9042以降)。一方 consumer 自体は、
operations == []かつ structured scope reframe が absent なら #2620 の_decide_human_review_directive_editor_route()を評価します(同ファイル7151–7268)。ここまでは正しいです。問題は、そこで directive が非適格だった場合です。helper は通常の non-applicable なら
Noneを返し、consumer はrun_trusted_anchor_iteration_zero()にフォールスルーします。そしてscope_signal_delta.py:1707–1760では、operations=[]かつallowed_path_deltasなしなら明示的にstatus: no_change, writes: 0を返します。これは pre-#2048 compatibility behavior としてコードコメントにも固定されています。
したがって、
という修正は、現在
PLANNER_FAIL_CLOSEDになるべき ambiguous / untrusted / non-applicable input を成功扱いの no-op に変えます。#2724 の「非適格ケースは fail-closed を維持」と正面から衝突します。Issue に「missing plan を generic empty plan に materialize してはならない」を明記すべきです。
PR #2623 はすでに
test_ac1_ac6_explicit_human_review_directive_reaches_next_action_production_reachableを追加しており、real
run_preflight()からissue_editor_requiredに到達すると主張しています。現行テストも通ります。それでも #2715 は失敗しました。差は入力 shape です。
#2715 comment
5770590798が明示している通り、実障害はです。既存 positive fixture は最終結果しか見ておらず、consumer 呼び出し直前の
patch_planが本当に absent だったことを固定していません。#2724 の新しい regression は少なくとも、
まで固定すべきです。
可能なら #2715 comment
5770013860の正規化された形を fixture に使うのが最も強いです。「似た英語の directive」をもう1本増やすより価値があります。absent側です。empty operations[]の canonical consumer route は #2620 / PR #2623 ですでに存在し、current codeでもまで到達できます。
今回壊れているのは、その前段の
run_preflight()が patch-plan object 自体がないと consumer を呼ばないことです。したがって Outcome / AC を、
と絞る方がよいです。
「empty も直す」と書くと、すでに動いている #2620 consumer semantics に手を入れる余地を不用意に作ります。
最も素直な実装は、既存 consumer を唯一の routing boundary のまま維持して、
相当にし、
とする形です。
ところが #2724 の Stop Conditions は「型定義変更が必要なら停止」と読めます。単なる private Python function annotation の
dict -> Optional[dict]まで禁止するなら、Issue 自身が自然な最小実装を封じます。ここは「wire/schema/固定 artifact contract の変更は禁止。ただしこの private consumer parameter の internal optionalization は In Scope」程度に明確化するのが実務的です。
逆に
run_preflight()側で_decide_human_review_directive_editor_route()を直接呼ぶ案は勧めません。#2620 が routing boundary を consumer +decide_rewrite_route.pyに集約した設計を再び二重化します。Runtime Verification Applicability: not_applicableはリポジトリ自身の current policy と一致していません。docs/dev/extension-surface-runtime-policy.yaml:361–401では.claude/skills/**/scripts/**のscript_body_semantics / skill_script_execution_logicはskill-invocation-procedure-or-contract-changeに入り、default_decision: immediate、verification_profile: skill-invocation-runtime-smokeです。#2724 はまさに
run_refinement_preflight.pyの production dispatch semantics を変えるため、not_applicableは説明しにくいです。ちなみに親の #2620 は同じ理由でimmediateとしていました。ただし、ここで新しい harness を作る必要はありません。ユーザーの優先条件にも反します。
既存 runtime profile を1本再利用するだけで十分です。新規 approval service、live GitHub write、追加 isolation layer は不要です。
外部仕様上も、GitHub は comment ID 単位の GET で fresh
body、updated_at、html_url、author_associationを取得できます。既存 #2623 の fresh-readback primitive をそのまま使えばよく、新しい GitHub access layer を増やす理由はありません。([GitHub Docs]1)現行の #2620 production-shaped negative tests は、例えば untrusted / ambiguous case で主に
を確認しています(
test_preflight_run_with_anchor.py:1195–1216)。これでは、
に変わっても green です。
#2724 では absent-plan negative matrix に対して最低限、
を固定すべきです。
対象は3本程度で十分です。
巨大な matrix は不要です。
#2724 は structured scope-reframe と ordinary non-empty patch の precedence 維持を要求しています。ここは結果だけでなく、
approved_scope_requires_full_contract_rewriteexplicit_trusted_human_directive_requires_issue_editorissue_editor_requiredではないまで reason/disposition を確認すると、将来同じバグを再発させにくくなります。
推奨する最小 reframe
#2724 を大きくする必要はありません。変更したいのは次の程度です。
absent or emptyをabsentproduction reachability gap に限定する。CONTRACT_PATCH_PLAN_V1synthesis は禁止」と明記する。contract_patch_plan: Optional[...]化を許容するか明示する。wire/schema contract は変更しない。not issue_editor_requiredだけでなく notno_changeまで固定する。immediateに直す。ただし既存 runtime-smoke を再利用し、新規 harness は作らない。Allowed Paths は現在の2ファイル、
のままで足りる可能性が高いです。
decide_rewrite_route.pyのSSOT自体には今回欠陥が見当たらず、repository searchでもrun_refinement_preflightのplugins/配布コピーは見つかっていないため、plugin同期まで広げる必要も現時点ではありません。実装イメージ
設計としてはこれが最も事故が少ないです。
#2620 / PR #2623 のアーキテクチャを壊さず、#2715 の実障害だけを塞げます。
要するに #2724 の方向は正しいものの、現在の契約だと「missing plan を empty plan にするだけ」という誤実装を防げません。そこを塞ぎ、#2715 の exact failure shape を regression に固定してから実装へ進めるのがよいです。 セキュリティ機構を増やす必要はなく、今回の本質は routing とテスト契約です。
squne121 commentedon Sep 22, 2026
推奨は、[対象コメント](#2724 (comment)) を
operator_asserted_human_contextの anchor として #2724 をreframe_in_place→ controlled rewrite → fresh review まで自律実行させることです。production implementation はまだ開始しません。確認時点の
mainHEAD はdb97d2916a847312b786ddf35e41b22e38a57334で、コメントが検証した60bb337...より進んでいるため、Claude-GPT 側では必ず fresh HEAD で再検証させます。また現行issue-refinement-loopは、Step 1 の repository fact-check にcodebase-investigator、Step 4 の本文更新にissue-editorを使えます。一方 canonical Step 2 はissue-reviewerSubAgent ではなく root-owned review pipeline を background 起動し、完了を join してから routing する契約です。あなたは既に auto mode で起動済みの対話的 Claude-GPT / Claude Code セッションです。
対象リポジトリ:
squne121/loop-protocol
対象 Issue:
#2724
今回の operator-selected human-context anchor:
#2724 (comment)
目的:
.claude/skills/issue-refinement-loopの現行契約を使用して、上記 anchor comment を反映した Issue #2724 の refinement loop を、人間の中間承認なしで最後まで実行してください。これは Issue refinement task です。
#2724 の production code implementation、実装ブランチ作成、PR 作成には進まないでください。
ゴールは、#2724 の Issue contract を current repository state と anchor feedback に整合させ、fresh review/readiness 上で implementation handoff 可能な状態、または genuine terminal condition まで到達させることです。
5770927620の live snapshot・metadata・所属 Issue を取得し、anchor binding を確認する。preflight.run.with_human_contextlane を使用する。preflight.run.with_anchorやwith_agent_reportに downgrade しない。max_iterationsは現行 skill の既定値 3 を基本とする。必ず current の以下を読んでから動作してください。
.claude/skills/issue-refinement-loop/SKILL.md.claude/skills/issue-refinement-loop/references/anchor-comment-handling.md.claude/skills/issue-refinement-loop/references/loop-state.md.claude/agents/issue-editor.md.claude/skills/edit-issue/SKILL.mdSKILL.md の procedure / command registry / routing authority を正本とし、このプロンプトに書かれた具体例より current repository contract を優先してください。
この anchor は
run_refinement_preflight.py、scope_signal_delta.py、#2620 / PR #2623、#2715、runtime verification policy 等について repository facts を含むため、単なる prose feedback として無検証で適用しないでください。Step 1 では
codebase-investigatorSubAgent を使用し、少なくとも以下を current HEAD で確認してください。run_preflight()が plannercontract_patch_planabsent 時に既存 consumer へ到達できない、という指摘が current HEAD でも成立するか。consume_trusted_anchor_contract_patch_plan()の empty-operations + no structured reframe 時のhuman_review_directiveroute。run_trusted_anchor_iteration_zero()のno_changecompatibility behavior に落ち得ること。5770590798の reproduced failure shape:explicit trusted freeform human directive
structured scope reframe absent
planner contract_patch_plan absent
expected issue_editor_required
actual PLANNER_FAIL_CLOSED
.claude/skills/issue-refinement-loop/tests/test_preflight_run_with_anchor.pyの既存 positive / negative regression の実際の assertion。docs/dev/extension-surface-runtime-policy.yamlの.claude/skills/**/scripts/**に対する runtime verification decision/profile。SubAgent は read-only investigation に限定してください。
nested SubAgent delegation は禁止です。
SubAgent を起動したら、必ず terminal result が返るまで待ってください。
partial result を main thread の final evidence として扱わないでください。
main thread が fact-check の final classification authority を保持してください。
Step 1b の Web Research は planner の
web_research_policy.requiredが true の場合だけ実行してください。その場合も SubAgent の完了を必ず待ち、Step 1 と並列実行した場合は両方を join してから Step 2 へ進んでください。reframe_in_placeを第一候補としてください。ただし、コメントの結論を盲目的に authority とせず、Step 1 evidence で current HEAD に対して成立することを確認してください。
facts が維持されている場合、#2724 を新規 Issue に分割せず in-place で reframe してください。
reframe の中心は以下です。
contract_patch_planが absent の production reachability gap に限定する。contract_patch_planを generic な{"operations": []}/ emptyCONTRACT_PATCH_PLAN_V1に materialize する実装を明示的に禁止する。issue_editor_required, writes=0。no_change/proven_no_changeに落としてはならない。run_preflight()側から_decide_human_review_directive_editor_route()を直接呼ぶ等、routing SSOT を二重化する実装を要求しない。dict -> dict | None相当の optionalization は In Scope と明記し、「型定義変更禁止」という Stop Condition が private annotation まで誤って禁止しないようにする。decide_rewrite_route.py自体に current defect がない限り Allowed Paths を不用意に追加しない。positive regression は「最終結果が issue_editor_required だった」だけでは不十分です。
current evidence が支持する場合、少なくとも次を Issue contract に固定してください。
contract_patch_plan自体が absent / not dict。run_preflight()entrypoint を通る。NEXT_ACTION == issue_editor_required。contract_update.writes == 0。5770013860の normalized failure shape を fixture/evidence として再現する。単なる「似た freeform English directive」を増やすだけで代替しない。negative regression は少数・focused でよいですが、最低限以下の class を検討してください。
これらについて単に
next_action != issue_editor_requiredだけで終わらせず、current canonical vocabulary に合わせて、
contract_update.status != no_changecontract_update.status != proven_no_changeまで固定し、
PLANNER_FAIL_CLOSED -> no_changeの false-green を防いでください。precedence regression も final action だけでなく既存 route identity / reason code を可能な範囲で固定してください。
例:
approved_scope_requires_full_contract_rewriteexplicit_trusted_human_directive_requires_issue_editorissue_editor_requiredではないcurrent implementation の実際の canonical field 名を確認して使用し、存在しない schema key を新設しないでください。
current
docs/dev/extension-surface-runtime-policy.yamlが引き続きskill-invocation-procedure-or-contract-change.claude/skills/**/scripts/**script_body_semantics / skill_script_execution_logicdefault_decision: immediateverification_profile: skill-invocation-runtime-smokeを定義しているなら、#2724 の
Runtime Verification Applicability: not_applicableを
immediate相当に修正してください。新規 runtime harness、approval service、GitHub access layer、security subsystem、live GitHub write test は作らない契約にしてください。
既存 runtime-smoke/profileを再利用する最小 verification に限定してください。
現 Issue の想定:
.claude/skills/issue-refinement-loop/scripts/run_refinement_preflight.py.claude/skills/issue-refinement-loop/tests/test_preflight_run_with_anchor.pycodebase-investigator の fresh evidence で本当に別 production defect path が必要と判明しない限り、追加しないでください。
特に
decide_rewrite_route.py、schema、security harness、plugin 配布コピー等を予防的に追加しないでください。逆に current code でこの2ファイルだけでは契約を実現不能であることが証明された場合、勝手に scope を拡張せず current issue-refinement-loop の scope/human-judgment semantics に従って処理してください。
raw
gh issue edit等で直接書き換えないでください。Step 4 rewrite が必要になった場合は current
issue-refinement-loopが指定するissue-editorSubAgent /edit-issuecontrolled transaction route を使ってください。issue-editorSubAgent を起動した場合も terminal result が返るまで必ず待ってください。SubAgent 自身に nested delegation をさせないでください。
anchor raw snapshot 全文を無制限に reviewer feedback text として再転送せず、現行 anchor handling contract の normalized feedback / canonical reviewer_feedback_url semantics に従ってください。
main thread が orchestration authority を保持してください。
今回の対象そのものが issue-refinement-loop routing regression です。
この #2724 anchor を canonical
preflight.run.with_human_context/ contract-update route へ流した結果、#2724 が修正対象としている同じ absent-planPLANNER_FAIL_CLOSEDに self-hosting 的に遭遇した場合:ANCHOR_SCOPE_REFRAME_V1を人為的に作らない。current skill contract が別の正規 Step 4 rewrite lane を明示的に許可している場合だけそれを使用してください。
canonical contract 上その blocker を迂回できない場合は、environment/integrity/terminal routing として正確に停止し、self-hosting blocker を最終報告してください。
「承認待ちだから」と私へ質問して停止するのではなく、terminal evidence を完成させてください。
現行 skill が引き続きそう定義している場合:
issue-reviewerSubAgent を起動しない。run_root_review_pipeline.py produceを root-owned producer として使用する。run_in_background: trueを明示する。canonical_step2_routeを唯一の routing authority として使用する。status/verdict/next_actionから main thread が独自 routing を再実装しない。review が
needs-fixの場合は、iteration + 1 < max_iterationsの間、人間確認を求めず Step 4 rewrite → fresh validation → fresh Step 2 を継続してください。deterministic review approve 後も現行 skill が Step 2.5 semantic design review applicability を要求する場合は省略しないでください。
Issue body を1回でも変更したら必ず、
live title/body readback
→ fresh body SHA
→ fresh preflight
→ fresh deterministic review
→ semantic design review applicability / review
→ fresh readiness/final gate
を新しい revision に対してやり直してください。
古い body SHA / preflight artifact / review result を approval evidence として再利用しないでください。
以下について私への確認は不要です。
5770927620を human-context anchor として選択することreframe_in_placeの検証・適用停止を許可するのは、current canonical contract 上の genuine terminal condition に限定してください。
例:
human_judgment_required通常の loop iteration や Issue rewrite のたびに承認確認を求めないでください。
refinement の最終状態が implementation-ready になっても、このセッションで以下は行わないでください。
Issue contract の refinement 完了と implementation handoff status の報告までで終了してください。
最優先は「何としても Issue を書き換えること」ではありません。
最優先は、anchor comment の REQUEST_CHANGES を current repository evidence で検証し、current
issue-refinement-loopの canonical routing と controlled mutation contract に従って #2724 を正しく reframe し、false-green や routing workaround を導入せず implementation-ready contract または genuine terminal result まで到達することです。作業を開始し、途中の通常承認は求めず、自律的に最後まで進めてください。
この形なら、今回のレビュー指摘で特に重要な「missing plan を empty plan に化けさせない」「negative test で
no_changefalse-green を禁止する」「runtime verification をimmediateに戻す」を明示しつつ、現行 skill の SubAgent/Step 2 契約も維持できます。squne121 commentedon Sep 22, 2026
issue-refinement-loop: human_escalation
human_escalationstatus: inconclusive; the returned AGY advisory sidecar lacked the required verifiedREPO_EVIDENCE_REF_V1metadata, so the anchor's critical repository claims cannot be promoted to supported or contradicted under the current evidence contract.squne121 commentedon Sep 22, 2026
issue-refinement-loop: approved
reframe_in_placecompleted from verified current-HEAD evidence.approve.approveeffective verdict; two medium findings were recorded as warnings.goforsha256:cae3eac02ff695b47b3e0c98dfe40742e7c5f040a526fa28cdd65356c3f4f430.proceed(no_hard_dependencies_confirmed_this_cycle).squne121 commentedon Sep 22, 2026
推奨アクションは、現在の #2724 をそのまま
impl-review-loopに投入して実装開始です。直近の refinement 終了コメントではcontract_review: go、status: impl_ready、routing_action: run_impl_review_loop、blocker なしまで到達しています。今回取得したmainの最新 HEAD は73203069a9cfc6e1d0bd84e9bdf241ca618fa6b2ですが、実行時には必ず fresh HEAD を再取得させます。最新 handoff は [issuecomment-5775039702](#2724 (comment)) です。また、現時点で確認できた範囲では #2724 用の既存 PR / Allowed Paths 2ファイルに対する open same-file PR は見当たりません。ただし、
impl-review-loop自身の pre-Step-1 landing disposition を authoritative とし、そこで改めて duplicate/既存PR/競合を確認させる構成にしています。そのまま Claude-GPT に貼るプロンプトです。
あなたは既に auto mode で起動済みの対話的 Claude-GPT / Claude Code セッションです。
対象リポジトリ:
squne121/loop-protocol対象 Issue:
#2724
使用する skill:
.claude/skills/impl-review-loop最新の issue-refinement-loop handoff:
#2724 (comment)
目的:
Issue #2724 を current repository state と live Issue contract に基づいて実装し、
.claude/skills/impl-review-loopの canonical procedure に従ってImplementation
→ Verification
→ PR Review
→ 必要なら fix loop
→ merge 直前の
draft_pr_readyまで、人間の中間承認なしで自律的に進めてください。
PR の merge、auto-merge、Issue close は実行しないでください。
人間に戻すのは genuine terminal condition の場合だけです。
0. current contract を正本として開始する
最初に必ず fresh に以下を取得してください。
mainHEAD5775039702.claude/skills/impl-review-loop/SKILL.md確認時点では
mainHEAD は73203069a9cfc6e1d0bd84e9bdf241ca618fa6b2でしたが、これは参考値です。
実行時に取得した fresh current HEAD を authority としてください。
handoff comment
5775039702は structured agent report として扱って構いませんが、それ自体を Step 1 authorization にしてはいけません。現行
impl-review-loopが要求するcapability preflight
→ live Issue fetch
→ current-run issue-contract-review
→ live refetch
→ routing
→ 同一 continuous invocation 内で Step 1
という Root-Owned Synchronous Entry Transition を実際に実行してください。
古い contract snapshot、GitHub comment、artifact、digest、以前の
go判定だけを再提示して Step 1 を開始しないでください。current SKILL.md / steps / scripts がこのプロンプトと食い違う場合は current repository の skill contract を優先してください。
少なくとも以下を読んでください。
.claude/skills/impl-review-loop/SKILL.md.claude/skills/impl-review-loop/steps/preparation.md.claude/skills/impl-review-loop/steps/step-1-implementation.md.claude/skills/impl-review-loop/steps/step-2-verification.md.claude/skills/impl-review-loop/steps/step-4-pr-review.md.claude/skills/impl-review-loop/steps/step-5-feedback-and-termination.md.claude/skills/impl-review-loop/steps/step-5-mergeability-handling.md.claude/skills/impl-review-loop/steps/context-protocol-and-guardrails.md1. pre-Step-1 landing disposition を必ず先に実行する
implementation-worker を起動する前に、current
impl-review-loopの Evidence-Based Landing Disposition を実行してください。fresh evidence で少なくとも以下を確認してください。
既存 PR が正規の resume target なら、新しい PR を重複作成せずその PR を resume してください。
active same-file conflicting implementation が存在する場合は、#2724 の Scope Coordination と current skill の conflict routing に従ってください。
並列に同一ファイルを実装しないでください。
reconciliation_requiredなら worker を起動せず canonical route に従ってください。通常実装可能なら Step 1 へ進んでください。
2. Issue #2724 の live contract を厳守する
今回の実装対象は、planner authority の
contract_patch_planが absent / non-dict のときに発生している production reachability gap のみです。Allowed Paths は live Issue 本文を authority としてください。
確認時点では以下の2ファイルです。
.claude/skills/issue-refinement-loop/scripts/run_refinement_preflight.py.claude/skills/issue-refinement-loop/tests/test_preflight_run_with_anchor.pyAllowed Paths 外を変更しないでください。
特に以下を禁止します。
contract_patch_planを generic{"operations": []}に変換するCONTRACT_PATCH_PLAN_V1を合成するANCHOR_SCOPE_REFRAME_V1を捏造するrun_preflight()から_decide_human_review_directive_editor_route()を直接呼んで routing を二重化するdecide_rewrite_routeSSOT を迂回するprivate/internal canonical-consumer parameter の optionalization は、live Issue contract が許容している範囲で、必要な場合のみ使用してください。
3. 実装設計の重要な不変条件
実装は以下の意味論を維持してください。
eligible freeform + missing planner plan
structured
ANCHOR_SCOPE_REFRAME_V1が存在せず、human_review_directiveであり、
planner
contract_patch_planが absent / non-dictの場合のみ、既存 canonical routing boundary を通じて
NEXT_ACTION: issue_editor_requiredおよび
explicit_trusted_human_directive_requires_issue_editorへ到達させてください。
この経路では
を維持してください。
non-applicable / invalid missing-plan
以下は false-green にしてはいけません。
これらは existing fail-closed blocker/reason を維持し、
no_changeではないproven_no_changeではないことを保証してください。
特に
missing plan
→ generic empty plan
→
run_trusted_anchor_iteration_zero()→
no_changeという誤実装を絶対に導入しないでください。
precedence
以下の ownership / precedence を維持してください。
existing structured
ANCHOR_SCOPE_REFRAME_V1→ existing structured route
→
approved_scope_requires_full_contract_rewritestructured payload が transaction を支配していない場合に限り、
eligible explicit trusted freeform directive + missing planner plan
→
explicit_trusted_human_directive_requires_issue_editornon-empty
contract_patch_plan→ existing ordinary patch route
最終
next_actionだけでなく、可能な範囲で route identity / reason も regression で固定してください。4. SubAgent を使うこと。root は completion を必ず join すること
impl-review-loopの canonical SubAgent 分担を使用してください。root/main thread は control-plane と routing を保持し、data-plane 作業は SubAgent に委譲してください。
少なくとも以下を使用してください。
Step 1
implementation-worker担当:
既存 PR resume route なら、その PR を更新してください。
Step 2
test-runner担当:
Step 4
pr-reviewer担当:
pr-review-judgeの canonical procedure各 SubAgent を起動したら、必ず terminal result が返るまで待ってください。
SubAgent を fire-and-forget しないでください。
partial result を canonical evidence として使用しないでください。
次 Step へ進む前にその Step の SubAgent completion を join してください。
必要な SubAgent を並列起動できる場合でも、その結果を使用する routing point より前に全 relevant SubAgent を join してください。
nested SubAgent delegation は禁止です。
root/main thread から canonical SubAgent を起動する構造にしてください。
SubAgent 自身に別 SubAgent を spawn させないでください。
5. Step 1: implementation
implementation-worker には live Issue body と current contract snapshot/evidence を渡してください。
最小差分を優先してください。
想定設計は、
run_preflight()→ planner plan absent/non-dict case
→ existing canonical consumer / shared boundary で eligible freeform editor eligibility を評価
→ eligible なら editor route
→ otherwise existing fail-closed
です。
ただし、具体的実装は current HEAD のコードを読み、既存 abstraction と最小 diff を優先して決定してください。
実装前後で、少なくとも以下の existing code を確認してください。
run_preflight()consume_trusted_anchor_contract_patch_plan()_decide_human_review_directive_editor_route()decide_rewrite_route不要な abstraction や新規 subsystem を増やさないでください。
6. Regression coverage
live Issue の AC を authority とし、少なくとも以下を production-entrypoint regression で固定してください。
positive:
contract_patch_planabsent / non-dict が fixture 上で明示されているrun_preflight()NEXT_ACTION == issue_editor_requiredexplicit_trusted_human_directive_requires_issue_editornegative matrix:
各ケースで:
no_changeproven_no_changeprecedence:
既存 test の assertion を弱めないでください。
7. Verification Commands と runtime smoke
Verification Commands は live Issue 本文を authority としてください。
確認時点では focused suite は:
uv run --locked pytest .claude/skills/issue-refinement-loop/tests/test_preflight_run_with_anchor.py -qruntime-focused verification は:
uv run --locked pytest .claude/skills/issue-refinement-loop/tests/test_preflight_run_with_anchor.py -q -k "explicit_human_review_directive_reaches_next_action_production_reachable"です。
ただし実行時の live Issue contract が更新されていればそちらを使ってください。
Runtime Verification Applicability は
immediate/skill-invocation-runtime-smokeです。既存 runtime verification apparatus のみを使用してください。
新規 harness は作らないでください。
exit 77 は Issue contract が定義する explicit SKIP として記録してください。
exit 77 以外で prerequisite unavailable なら勝手に SKIP 扱いせず FAIL としてください。
ただし、SKIP を独自判断で PASS に昇格しないでください。
current
impl-review-loop/ VC adjudication contract に従って routing してください。worktree-local evidence requirements も満たしてください。
8. PR 作成とレビュー循環
1 Issue = 1 PR としてください。
新規 PR の場合は Draft PR を既定としてください。
PR を作成したら、
Step 2 Verification
→ current-head gate
→ Step 4 PR Review
→ Step 5 route
を実行してください。
pr-reviewer の
REQUEST_CHANGESが返った場合は人間へ確認せず、を
max_iterationsの範囲で続けてください。stale reviewed head なら current head で再レビューしてください。
branch behind なら current skill が合成する update-branch action を canonical worker route で処理し、その後 Verification / PR Review をやり直してください。
human_review_required: trueという SubAgent 自己申告だけを停止理由にしないでください。current skill の routing authority に従ってください。
9. 人間承認を求めない範囲
以下は中間承認不要です。
permission mode / auto mode の設定自体は変更しないでください。
10. 停止条件
通常の test failure、review request changes、branch behind、advisory artifact stale では停止しないでください。
canonical recovery/fix loop を使ってください。
停止を許可するのは current skill / live Issue 上の genuine terminal condition に限定してください。
例:
max_iterations到達その場合は勝手に scope を広げず、evidence と最小の人間判断事項だけを報告してください。
11. merge 境界
目標は マージ直前まで です。
以下は実行しないでください。
mergeauto-mergecurrent
impl-review-loopの approved route、まで到達したら
IMPL_REVIEW_LOOP_RESULT_V1.status: draft_pr_readyで終了してください。
PR が Draft のままであること自体が current skill の routing 上 warning/non-terminal になる場合は、skill contract に従って merge直前状態に必要な PR state まで進めて構いません。ただし merge/auto-merge は行わないでください。
12. 外部調査
#2724 は repository-internal routing defect が中心なので、external web research はデフォルトでは不要です。
current skill/planner が external research を明示的に required と判定した場合のみ canonical research route を使用してください。
その場合も delegated work の completion を必ず待ってから routing してください。
外部調査を理由に security subsystem や harness を追加しないでください。
13. 最終報告
完了時には最低限、以下を報告してください。
termination_reasonIMPL_REVIEW_LOOP_RESULT_V1.status最優先は「PR を作ること」ではありません。
最優先は、live #2724 contract を current HEAD に対して正しく実装し、missing plan を empty plan に偽装する false-green を防ぎ、既存 canonical routing SSOT を維持したまま、実装・検証・fresh PR review を完了して merge 直前まで到達することです。
作業を開始してください。
通常の途中承認は求めず、必要な SubAgent を root から起動し、その完了を必ず待ちながら current
impl-review-loopの canonical routing に従って最後まで進めてください。今回のポイントは、以前の
human_escalationはすでに後続 refinement で解消されており、最新 handoff が明示的にrun_impl_review_loopを指していることです。そのため、このプロンプトでは古い fact-check failure の再処理ではなく、fresh root-entry → landing disposition → implementation-worker → test-runner → pr-reviewer に直接進ませています。squne121 commentedon Sep 22, 2026
root-owned entry router audit
route: invoke_impl_review_loop
reason: fresh_review_go_live_equality
squne121 commentedon Sep 22, 2026
作業一時中断 / resume checkpoint
週間利用上限が残り 1% のため、ここでは追加の実装・検証・レビューを行わず、意図的に作業を中断します。
現在の checkpoint
worktree-issue-2724-freeform-human-review-directive9286d49f817438df9b8761d7b6a4425c56f706b873203069a9cfc6e1d0bd84e9bdf241ca618fa6b2.claude/skills/issue-refinement-loop/scripts/run_refinement_preflight.py.claude/skills/issue-refinement-loop/tests/test_preflight_run_with_anchor.py実装済み内容
implementation-worker は terminal completed / join 済みで、commit / push / Draft PR #2732 作成まで完了しています。
worker 報告上の検証:
直前の停止理由
前回の
impl-review-loopは、candidate head に対する test-runner の実行結果自体は成功していた一方、複数の test-runner SubAgent task が API 503 で terminal failed となり、current skill が要求する canonical completed / head-bound verification report として採用できませんでした。記録された termination:
termination_reason: repository_environment_integrity_failure:test_runner_terminal_api_503IMPL_REVIEW_LOOP_RESULT_V1.status: 未発行pr-reviewer: 未起動したがって、再開時の主目的は実装のやり直しではありません。
再開時の最小アクション
current
.claude/skills/impl-review-loopを fresh に読み、live Issue / PR / main / comments / CI と current contract を再確認したうえで、既存 PR #2732 を resume してください。原則として:
9286d49f817438df9b8761d7b6a4425c56f706b8から動いていれば、stale evidence を捨て current head に再bindする。pr-reviewerを起動し、terminal completion を待つ。REQUEST_CHANGESなら current skill の fix loop に従って implementation-worker → verification → review を bounded iteration 内で継続する。IMPL_REVIEW_LOOP_RESULT_V1.status: draft_pr_readyを目標とする。境界
再開後も、明示的な別指示がない限り以下は実行しないこと。
API 503 の再発だけを code defect と解釈しないこと。current skill の retry / recovery contract を使い、それでも canonical continuation が不能な場合のみ environment integrity failure として停止すること。
squne121 commentedon Sep 22, 2026
Issue #2724 に 作業中断・resume checkpoint コメントを追加しました。コメント ID は
5780207015です。前回は実装と Draft PR #2732 作成まで完了し、canonical test-runner が API 503 で terminal completion を満たせず、PR review 前で停止していました。次回は以下を、そのまま auto mode で起動済みの Claude Code / Claude-GPT に渡せます。
あなたは既に auto mode で起動済みの対話的 Claude-GPT / Claude Code セッションです。
対象リポジトリ:
squne121/loop-protocol対象 Issue:
#2724
既存 Draft PR:
#2732
使用する skill:
.claude/skills/impl-review-loopIssue #2724 の作業を、前回の中断地点から再開してください。
0. operator pause からの再開
前回は週間利用上限の都合で operator が意図的に作業を中断しました。
Issue #2724 の以下の checkpoint comment を handoff として参照してください。
5780207015OPERATOR_PAUSE_CHECKPOINT:issue-2724-2026-09-23ただし、この checkpoint に記録された SHA・PR state・test evidence を execution authorization として再利用しないでください。
最初に current repository / GitHub state / current skill contract を fresh に取得してください。
current repository の skill / scripts / runbook がこのプロンプトと食い違う場合は、current repository の contract を優先してください。
1. fresh state を確定する
最低限、以下を fresh に確認してください。
mainHEAD5780207015.claude/skills/impl-review-loop/SKILL.md前回記録では以下でしたが、必ず live state で再検証してください。
#2732worktree-issue-2724-freeform-human-review-directive9286d49f817438df9b8761d7b6a4425c56f706b873203069a9cfc6e1d0bd84e9bdf241ca618fa6b22. 実装を最初からやり直さない
前回の implementation-worker は terminal completed / join 済みで、以下まで完了しています。
変更対象は記録上、以下の2ファイルだけです。
.claude/skills/issue-refinement-loop/scripts/run_refinement_preflight.py.claude/skills/issue-refinement-loop/tests/test_preflight_run_with_anchor.pyworker 報告では:
56 passed3 passed, 53 deselectedしたがって pre-Step-1 landing disposition では、live evidence が一致する限り existing PR #2732 resume を優先してください。
新規 branch / 新規 PR / duplicate implementation を作成しないでください。
ただし、current main / Issue contract / PR head の drift により current skill が implementation rerun または reconciliation を要求する場合は、canonical routing に従ってください。
3. 前回の genuine terminal condition
前回の終了理由は code/test failure ではありません。
記録:
termination_reason: repository_environment_integrity_failure:test_runner_terminal_api_503candidate worktree 上では Verification Commands 自体は成功していましたが、test-runner SubAgent が複数回 API HTTP 503 で terminal failed となり、current skill が要求する canonical completed / head-bound verification report として採用できませんでした。
そのため:
IMPL_REVIEW_LOOP_RESULT_V1.status: 未発行0pr-reviewer: 未起動でした。
全ての起動済み SubAgent は join 済みです。
API 503 を implementation defect と扱わないでください。
4. current root-owned entry から再開する
current
impl-review-loopが要求する canonical flow を fresh に実行してください。少なくとも current contract が要求する:
capability preflight
→ live Issue fetch
→ current-run issue-contract-review
→ live refetch
→ routing
→ pre-Step-1 landing disposition
を実施してください。
古い
go判定、古い digest、古い contract snapshot、pause checkpoint だけを再提示して execution authorization にしないでください。live equality / current-run review を使ってください。
5. test-runner を current PR head に対して再実行する
existing PR #2732 を resume できる場合、最優先作業は implementation の再実行ではなく current candidate head の canonical verification completion です。
current PR head が recorded head
9286d49f817438df9b8761d7b6a4425c56f706b8から変化している場合:
test-runner SubAgent を root/main thread から起動してください。
nested delegation は禁止です。
SubAgent を起動した場合は、hand-back text を受け取っただけで completed とみなさず、terminal status を確認できるまで必ず待って joinしてください。
partial / running / API-error task の出力を canonical verification evidence として採用しないでください。
current Issue の literal Verification Commands と current runtime verification policy に従ってください。
6. API 503 の扱い
test-runner が再び API 503 等で失敗した場合、即座に human judgment へ戻さず、current skill が許可する canonical retry / recovery route を使用してください。
ただし:
current skill が定める bounded recovery 後も canonical completion が不可能であれば、その時点でのみ repository/environment integrity failure として停止してください。
7. Verification gate 後に PR Review を実行する
current-head verification が canonical に non-blocking になったら、current
impl-review-loopの Step 4 / PR review route に従ってpr-reviewerを起動してください。pr-reviewer についても:
としてください。
REQUEST_CHANGESが返った場合は人間へ中間承認を求めず、current skill に従って:fix_delta
→ implementation-worker
→ current-head verification
→ current-head PR review
を bounded
max_iterations内で継続してください。通常の test failure、review request changes、branch behind、stale advisory artifact は、それ自体を terminal condition にしないでください。
8. 実装契約を維持する
#2724 の核心を変更しないでください。
特に:
contract_patch_planを generic{"operations": []}に偽装しないCONTRACT_PATCH_PLAN_V1を合成しないANCHOR_SCOPE_REFRAME_V1の既存 precedence を維持するhuman_review_directiveのみ既存 canonical consumer / routing SSOT へ到達させるrun_preflight()から_decide_human_review_directive_editor_route()を直接呼ぶ duplicate routing を作らない9. SubAgent policy
必要な SubAgent は root/main thread から起動してください。
各 SubAgent について:
final report では、起動した全 SubAgent と terminal status を列挙してください。
10. 人間承認なしで進めてよい範囲
current skill / live Issue が許可している限り、以下は中間承認不要です。
permission mode / auto mode の設定自体は変更しないでください。
11. genuine terminal condition
停止は current skill / live Issue が定義する genuine terminal condition に限定してください。
例:
その場合も scope を勝手に拡張せず、evidence と最小の判断事項だけを報告してください。
12. merge 境界
今回の目標は マージ直前まで です。
以下は実行しないでください。
current
impl-review-loopの approved condition:pr-reviewerverdict が APPROVEまで到達したら、
IMPL_REVIEW_LOOP_RESULT_V1.status: draft_pr_readyを目標として終了してください。
13. 最終報告
最低限、以下を報告してください。
IMPL_REVIEW_LOOP_RESULT_V1.status最優先は実装をやり直すことではありません。
PR #2732 の live candidate head を current contract に再bindし、canonical test-runner を terminal completed まで完了させ、その current head を fresh PR review に通して merge 直前まで進めることが今回の再開ポイントです。
GitHub 側にも同じ再開方針の要点を残してあるので、次回はこのプロンプトと Issue の checkpoint の双方から復旧できます。
fix: #2724 P1/P2 fix_delta -- reproduce #2715 origin comment + pin ne…