Skip to content

実装: freeform human_review_directive を production route で issue_editor_required に到達可能にする #2724

Closed

Description

@squne121

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: code

Parent Issue

None (standalone follow-up)

Parent Goal Ref

Current Validated Scope

  • Make the production run_preflight() path reach the existing canonical consumer only for a freeform explicit trusted human_review_directive fixture where structured ANCHOR_SCOPE_REFRAME_V1 is absent and planner authority contract_patch_plan is absent or non-dict before real run_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-authority contract_patch_plan absent/non-dict production reachability gap for an eligible freeform explicit trusted human_review_directive fixture where structured ANCHOR_SCOPE_REFRAME_V1 is absent.
  • Require use of the existing canonical consumer and existing decide_rewrite_route SSOT. Do not directly call _decide_human_review_directive_editor_route() from run_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 trusted human_review_directive fixture where structured ANCHOR_SCOPE_REFRAME_V1 is absent and planner authority contract_patch_plan is absent/non-dict before real run_preflight(), and for explicit_trusted_human_directive_requires_issue_editor, writes: 0, and transaction calls 0.
  • Add negative-matrix coverage for wrong-lane/untrusted, ambiguous, and invalid-binding missing-plan inputs: each has writes 0, no editor route, no no_change or proven_no_change, and its existing fail-closed blocker/reason.
  • Assert mutually exclusive precedence: (1) an existing structured ANCHOR_SCOPE_REFRAME_V1 remains owned by its existing route and retains approved_scope_requires_full_contract_rewrite; (2) only when no structured payload governs the transaction, the eligible freeform explicit trusted human_review_directive fixture with planner authority contract_patch_plan absent/non-dict reaches explicit_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-smoke through the existing apparatus with a focused real run_preflight() invocation and preserve worktree-local evidence, handling SKIP 77 and fallback FAIL exactly as specified above.

Out of Scope

Acceptance Criteria

  • AC1: For a freeform explicit trusted human_review_directive fixture where structured ANCHOR_SCOPE_REFRAME_V1 is absent and planner authority contract_patch_plan is absent or non-dict before a real run_preflight(), the eligible directive reaches the existing canonical consumer and emits NEXT_ACTION: issue_editor_required, explicit_trusted_human_directive_requires_issue_editor, writes: 0, and transaction calls 0. This case is mutually exclusive from AC4's structured scope-reframe case.
  • AC2: run_preflight() does not synthesize generic {"operations": []} or an empty CONTRACT_PATCH_PLAN_V1; genuine empty-operations behavior remains owned by the existing canonical consumer and decide_rewrite_route SSOT.
  • 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 yield no_change or proven_no_change.
  • AC4: Mutually exclusive precedence is explicit: (1) an existing structured ANCHOR_SCOPE_REFRAME_V1 remains owned by its existing route and retains approved_scope_requires_full_contract_rewrite; (2) only when no structured payload governs the transaction, AC1's eligible freeform explicit trusted human_review_directive fixture with planner authority contract_patch_plan absent/non-dict reaches explicit_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.md
  • docs/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

Delivery Rule

Activity

  1. added
    phase/implementation
    agent/implementer
    enhancement
    triage-required
    on Sep 22, 2026
  2. squne121 commented on Sep 22, 2026

    @squne121
    OwnerAuthor

    結論

    REQUEST_CHANGES — reframe_in_place 推奨です。

    #2724 が特定した不具合は実在します。#2715 の実測、#2620 / PR #2623 の契約、current main の run_refinement_preflight.py を追うと、freeform explicit trusted human_review_directive 自体の routing SSOT は既に実装済みなのに、production run_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

    1. BLOCKER / P0 — 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 としてコードコメントにも固定されています。

    したがって、

    patch_plan absent
      ↓
    無条件に {"operations": []} を合成
      ↓
    freeform route は non-applicable
      ↓
    run_trusted_anchor_iteration_zero()
      ↓
    no_change
    

    という修正は、現在 PLANNER_FAIL_CLOSED になるべき ambiguous / untrusted / non-applicable input を成功扱いの no-op に変えます。#2724 の「非適格ケースは fail-closed を維持」と正面から衝突します。

    Issue に「missing plan を generic empty plan に materialize してはならない」を明記すべきです。

    1. BLOCKER / P1 — 現在の positive regression は、この不具合の決定的条件である「planner patch plan が absent」を検証していません。

    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 が明示している通り、実障害は

    explicit freeform human directive
    structured scope reframe = absent
    planner contract_patch_plan = absent
    

    です。既存 positive fixture は最終結果しか見ておらず、consumer 呼び出し直前の patch_plan が本当に absent だったことを固定していません。

    #2724 の新しい regression は少なくとも、

    assert structured scope reframe == absent
    assert planner authority.contract_patch_plan is absent / not dict
    ↓
    run_preflight()
    ↓
    NEXT_ACTION == issue_editor_required
    contract_update.writes == 0
    apply_transaction calls == 0
    

    まで固定すべきです。

    可能なら #2715 comment 5770013860 の正規化された形を fixture に使うのが最も強いです。「似た英語の directive」をもう1本増やすより価値があります。

    1. HIGH — Issue の「absent or empty」は広すぎます。壊れているのは基本的に absent 側です。

    empty operations[] の canonical consumer route は #2620 / PR #2623 ですでに存在し、current codeでも

    if _decision_kind == "absent" and not _raw_operations:
        _decide_human_review_directive_editor_route(...)

    まで到達できます。

    今回壊れているのは、その前段の run_preflight() が patch-plan object 自体がないと consumer を呼ばないことです。

    したがって Outcome / AC を、

    contract_patch_plan が absent でも、既存 eligibility を満たす freeform directive に限って、既存 empty-operations editor-route 判定へ到達できる

    と絞る方がよいです。

    「empty も直す」と書くと、すでに動いている #2620 consumer semantics に手を入れる余地を不用意に作ります。

    1. HIGH — 実装方法について、internal type widening を許すかを Issue が決めた方がよいです。

    最も素直な実装は、既存 consumer を唯一の routing boundary のまま維持して、

    consume_trusted_anchor_contract_patch_plan(
        contract_patch_plan: dict | None,
        ...
    )

    相当にし、

    plan present:
        現行処理を byte-for-byte に近く維持
    
    plan absent:
        existing freeform editor route だけを評価
        eligible → issue_editor_required
        integrity failure → existing invalid/failure
        ordinary non-applicable → fail-closed
        ※ run_trusted_anchor_iteration_zero(no_change) には流さない
    

    とする形です。

    ところが #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 に集約した設計を再び二重化します。

    1. HIGH — 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)

    1. P1 — negative tests が弱く、Finding 1 の退行を見逃します。

    現行の #2620 production-shaped negative tests は、例えば untrusted / ambiguous case で主に

    assert result["next_action"] != "issue_editor_required"
    assert calls["apply_transaction"] == 0

    を確認しています(test_preflight_run_with_anchor.py:1195–1216)。

    これでは、

    PLANNER_FAIL_CLOSED → no_change
    

    に変わっても green です。

    #2724 では absent-plan negative matrix に対して最低限、

    next_action == human_judgment_required
    writes == 0
    PLANNER_FAIL_CLOSED または同等の既存 fail-closed reason が存在
    contract_update.status != no_change
    contract_update.status != proven_no_change
    

    を固定すべきです。

    対象は3本程度で十分です。

    • untrusted / wrong lane
    • ambiguous freeform
    • invalid anchor/binding

    巨大な matrix は不要です。

    1. MEDIUM — precedence AC は「最終 action」だけでなく route identity を固定した方がよいです。

    #2724 は structured scope-reframe と ordinary non-empty patch の precedence 維持を要求しています。ここは結果だけでなく、

    • structured scope reframe →既存 approved_scope_requires_full_contract_rewrite
    • explicit freeform + absent plan → explicit_trusted_human_directive_requires_issue_editor
    • non-empty operations → ordinary patch route、issue_editor_required ではない

    まで reason/disposition を確認すると、将来同じバグを再発させにくくなります。

    推奨する最小 reframe

    #2724 を大きくする必要はありません。変更したいのは次の程度です。

    • Outcome の absent or empty を absent production reachability gap に限定する。
    • 「generic empty CONTRACT_PATCH_PLAN_V1 synthesis は禁止」と明記する。
    • existing consumer が missing-plan case の editor eligibility を判定できるようにし、non-applicable missing-plan は従来通り fail-closed とする。
    • private/internal contract_patch_plan: Optional[...] 化を許容するか明示する。wire/schema contract は変更しない。
    • positive test は planner patch plan absent を明示 assertion する。
    • negative tests は not issue_editor_required だけでなく not no_change まで固定する。
    • Runtime Verification を immediate に直す。ただし既存 runtime-smoke を再利用し、新規 harness は作らない。

    Allowed Paths は現在の2ファイル、

    run_refinement_preflight.py
    test_preflight_run_with_anchor.py
    

    のままで足りる可能性が高いです。decide_rewrite_route.py のSSOT自体には今回欠陥が見当たらず、repository searchでも run_refinement_preflight の plugins/ 配布コピーは見つかっていないため、plugin同期まで広げる必要も現時点ではありません。

    実装イメージ

    設計としてはこれが最も事故が少ないです。

    run_preflight
      |
      |-- patch_plan is dict
      |     └─ existing consumer path(変更最小)
      |
      └-- patch_plan is absent + anchor context available
            └─ existing consumer / shared helper で
                 freeform editor eligibility のみ評価
                   |
                   |-- eligible
                   |     └─ issue_editor_required / writes=0
                   |
                   |-- integrity error
                   |     └─ existing invalid/fail-closed
                   |
                   └-- not applicable
                         └─ PLANNER_FAIL_CLOSED
                             ※ no_change へ落とさない
    

    #2620 / PR #2623 のアーキテクチャを壊さず、#2715 の実障害だけを塞げます。

    要するに #2724 の方向は正しいものの、現在の契約だと「missing plan を empty plan にするだけ」という誤実装を防げません。そこを塞ぎ、#2715 の exact failure shape を regression に固定してから実装へ進めるのがよいです。 セキュリティ機構を増やす必要はなく、今回の本質は routing とテスト契約です。

  3. squne121 commented on Sep 22, 2026

    @squne121
    OwnerAuthor

    推奨は、[対象コメント](#2724 (comment)) を operator_asserted_human_context の anchor として #2724 を reframe_in_place → controlled rewrite → fresh review まで自律実行させることです。production implementation はまだ開始しません。

    確認時点の main HEAD は db97d2916a847312b786ddf35e41b22e38a57334 で、コメントが検証した 60bb337... より進んでいるため、Claude-GPT 側では必ず fresh HEAD で再検証させます。また現行 issue-refinement-loop は、Step 1 の repository fact-check に codebase-investigator、Step 4 の本文更新に issue-editor を使えます。一方 canonical Step 2 は issue-reviewer SubAgent ではなく 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 まで到達させることです。

    1. 最初に current state を fresh に確定してください。
    • canonical main root / default branch 上の current HEAD を取得する。
    • Issue 実装: freeform human_review_directive を production route で issue_editor_required に到達可能にする #2724 の live title/body、anchor comment 5770927620 の live snapshot・metadata・所属 Issue を取得し、anchor binding を確認する。
    • anchor は operator が明示選択した human context として扱い、preflight.run.with_human_context lane を使用する。
    • preflight.run.with_anchor や with_agent_report に downgrade しない。
    • コメント本文から structured payload を捏造しない。
    • permission mode / auto mode / bypassPermissions 等の Claude Code 設定は変更しない。
    • loop iteration approval は不要。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
    • planner が MUST_READ として返す資料
    • 必要なら .claude/agents/issue-editor.md
    • 必要なら .claude/skills/edit-issue/SKILL.md

    SKILL.md の procedure / command registry / routing authority を正本とし、このプロンプトに書かれた具体例より current repository contract を優先してください。

    1. anchor comment の repository claims は SubAgent で fresh fact-check してください。

    この anchor は run_refinement_preflight.py、scope_signal_delta.py、#2620 / PR #2623、#2715、runtime verification policy 等について repository facts を含むため、単なる prose feedback として無検証で適用しないでください。

    Step 1 では codebase-investigator SubAgent を使用し、少なくとも以下を current HEAD で確認してください。

    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 へ進んでください。

    1. anchor の intended disposition は reframe_in_place を第一候補としてください。

    ただし、コメントの結論を盲目的に authority とせず、Step 1 evidence で current HEAD に対して成立することを確認してください。

    facts が維持されている場合、#2724 を新規 Issue に分割せず in-place で reframe してください。

    reframe の中心は以下です。

    • Outcome / scope を「absent or empty plan 全般」ではなく、contract_patch_plan が absent の production reachability gap に限定する。
    • 既に canonical consumer が処理できる genuine empty-operations semantics を変更対象に含めない。
    • missing contract_patch_plan を generic な {"operations": []} / empty CONTRACT_PATCH_PLAN_V1 に materialize する実装を明示的に禁止する。
    • absent-plan の場合は、既存 canonical consumer / shared routing boundary で freeform editor eligibility のみを評価できる設計を契約化する。
    • eligible → existing issue_editor_required, writes=0。
    • integrity/environment failure → existing invalid/fail-closed vocabulary。
    • ordinary non-applicable →従来通り fail-closed。
    • non-applicable absent-plan を no_change / proven_no_change に落としてはならない。
    • run_preflight() 側から _decide_human_review_directive_editor_route() を直接呼ぶ等、routing SSOT を二重化する実装を要求しない。
    • wire/schema/fixed artifact contract の変更は禁止を維持する。
    • ただし最小実装上必要なら private/internal consumer parameter の dict -> dict | None 相当の optionalization は In Scope と明記し、「型定義変更禁止」という Stop Condition が private annotation まで誤って禁止しないようにする。
    • decide_rewrite_route.py 自体に current defect がない限り Allowed Paths を不用意に追加しない。
    1. Acceptance Criteria / regression contract を強化してください。

    positive regression は「最終結果が issue_editor_required だった」だけでは不十分です。

    current evidence が支持する場合、少なくとも次を Issue contract に固定してください。

    negative regression は少数・focused でよいですが、最低限以下の class を検討してください。

    • untrusted / wrong origin lane
    • ambiguous freeform
    • invalid anchor / binding

    これらについて単に
    next_action != issue_editor_required
    だけで終わらせず、current canonical vocabulary に合わせて、

    • fail-closed/human-judgment route であること
    • writes == 0
    • fail-closed reason が存在すること
    • contract_update.status != no_change
    • contract_update.status != proven_no_change

    まで固定し、PLANNER_FAIL_CLOSED -> no_change の false-green を防いでください。

    precedence regression も final action だけでなく既存 route identity / reason code を可能な範囲で固定してください。

    例:

    • structured scope reframe → existing approved_scope_requires_full_contract_rewrite
    • explicit eligible freeform + absent plan → explicit_trusted_human_directive_requires_issue_editor
    • nonempty operations → ordinary patch route、issue_editor_required ではない

    current implementation の実際の canonical field 名を確認して使用し、存在しない schema key を新設しないでください。

    1. Runtime Verification Applicability を current policy に整合させてください。

    current docs/dev/extension-surface-runtime-policy.yaml が引き続き

    • skill-invocation-procedure-or-contract-change
    • .claude/skills/**/scripts/**
    • script_body_semantics / skill_script_execution_logic
    • default_decision: immediate
    • verification_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 に限定してください。

    1. Allowed Paths は原則として現在の2ファイルに維持してください。

    現 Issue の想定:

    • .claude/skills/issue-refinement-loop/scripts/run_refinement_preflight.py
    • .claude/skills/issue-refinement-loop/tests/test_preflight_run_with_anchor.py

    codebase-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 に従って処理してください。

    1. Issue 本文 mutation は canonical controlled route だけを使用してください。

    raw gh issue edit 等で直接書き換えないでください。

    Step 4 rewrite が必要になった場合は current issue-refinement-loop が指定する issue-editor SubAgent / edit-issue controlled transaction route を使ってください。

    issue-editor SubAgent を起動した場合も 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 を保持してください。

    1. self-hosting routing defect を workaround で隠さないでください。

    今回の対象そのものが issue-refinement-loop routing regression です。

    この #2724 anchor を canonical preflight.run.with_human_context / contract-update route へ流した結果、#2724 が修正対象としている同じ absent-plan PLANNER_FAIL_CLOSED に self-hosting 的に遭遇した場合:

    • generic empty patch plan を合成しない。
    • structured ANCHOR_SCOPE_REFRAME_V1 を人為的に作らない。
    • raw GitHub mutation へ逃げない。
    • canonical route を無視して直接 implementation を開始しない。
    • 同じ mutation command を no-progress retry しない。

    current skill contract が別の正規 Step 4 rewrite lane を明示的に許可している場合だけそれを使用してください。

    canonical contract 上その blocker を迂回できない場合は、environment/integrity/terminal routing として正確に停止し、self-hosting blocker を最終報告してください。
    「承認待ちだから」と私へ質問して停止するのではなく、terminal evidence を完成させてください。

    1. canonical Step 2 review の実行モデルを厳守してください。

    現行 skill が引き続きそう定義している場合:

    • canonical Step 2 では issue-reviewer SubAgent を起動しない。
    • run_root_review_pipeline.py produce を root-owned producer として使用する。
    • Bash tool では run_in_background: true を明示する。
    • background 起動した時点で完了扱いにしない。
    • task notification / actual completion JSON を必ず join してから routing する。
    • 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 を継続してください。

    1. semantic design review / readiness まで fresh revision に対して完了させてください。

    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 として再利用しないでください。

    1. 人間承認を求めず自律継続してください。

    以下について私への確認は不要です。

    • anchor comment 5770927620 を human-context anchor として選択すること
    • reframe_in_place の検証・適用
    • max_iterations 内の needs-fix rewrite
    • Issue body の controlled update
    • focused fact-check
    • current-main / related Issue / PR / tests の調査
    • runtime applicability を immediate に直すこと
    • generic empty-plan synthesis 禁止の明文化
    • positive / negative regression contract の強化
    • internal private optionalization を許容する契約修正

    停止を許可するのは、current canonical contract 上の genuine terminal condition に限定してください。

    例:

    • genuine semantic ambiguity / human_judgment_required
    • operator intervention が必須な readiness failure
    • environment / integrity failure
    • secret / credential が新たに必要
    • destructive / non-idempotent operation が必要
    • permission boundary / external-service boundary の変更が必要
    • Issue split / 新規 Issue materialization が不可避
    • current Allowed Paths では実現不能かつ scope expansion が正規に認可できない
    • nested SubAgent delegation が不可避
    • max_iterations 到達
    • canonical self-hosting blocker により正規 route で refinement 続行不能

    通常の loop iteration や Issue rewrite のたびに承認確認を求めないでください。

    1. production implementation は開始しないでください。

    refinement の最終状態が implementation-ready になっても、このセッションで以下は行わないでください。

    Issue contract の refinement 完了と implementation handoff status の報告までで終了してください。

    1. 最終報告には最低限以下を含めてください。
    • 実行時の current main HEAD
    • anchor URL / id / final classification
    • anchor fact-check の結果
    • 起動した各 SubAgent の名前、担当、terminal status、主要 finding
    • すべての SubAgent completion を join 済みであること
    • 実装: freeform human_review_directive を production route で issue_editor_required に到達可能にする #2724 before/after title
    • before/after body SHA256(変更した場合)
    • reframe で実際に変更した contract の要約
    • absent-plan / empty-plan distinction の最終扱い
    • generic empty-plan synthesis prohibition の有無
    • private/internal optionalization の扱い
    • positive regression contract
    • negative fail-closed regression contract
    • precedence contract
    • Runtime Verification Applicability / profile
    • Allowed Paths の最終集合
    • deterministic review 結果
    • semantic review applicability/result
    • readiness/final gate
    • iteration count
    • termination_reason / termination_cause
    • implementation handoff status
    • residual blockers
    • 次の最小アクション

    最優先は「何としても 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_change false-green を禁止する」「runtime verification を immediate に戻す」を明示しつつ、現行 skill の SubAgent/Step 2 契約も維持できます。

  4. squne121 commented on Sep 22, 2026

    @squne121
    OwnerAuthor

    issue-refinement-loop: human_escalation

    FOLLOW_UP_MATERIALIZATION_RESULT_V1:
      schema_version: 1
      materialized_by: issue-refinement-loop
      follow_up_issues: []
      note_only_observations: []
  5. squne121 commented on Sep 22, 2026

    @squne121
    OwnerAuthor

    issue-refinement-loop: approved

    LOOP_HANDOFF_RESULT_V1:
      status: impl_ready
      routing_action: run_impl_review_loop
      contract_review:
        status: go
        gate_result: fresh_go
        latest_comment_url: null
        generated_at: "2026-09-22T09:39:32Z"
        body_sha256: "sha256:cae3eac02ff695b47b3e0c98dfe40742e7c5f040a526fa28cdd65356c3f4f430"
      metadata:
        title_prefix_ready: true
      label_sync_observation:
        kind: presentation_sync
        result: noop
        detail: "No label mutation was needed or attempted."
      auto_fixes:
        result: auto_fixed
        required: []
        skipped: []
      blockers: []
      permissions:
        unavailable: []
      generated_at: "2026-09-22T09:40:41Z"
      checked_body_sha256: "sha256:cae3eac02ff695b47b3e0c98dfe40742e7c5f040a526fa28cdd65356c3f4f430"
      checker_exit_code: 0
      missing_sections: []
      missing_contract_keys: []
    FOLLOW_UP_MATERIALIZATION_RESULT_V1:
      schema_version: 1
      materialized_by: issue-refinement-loop
      follow_up_issues: []
      note_only_observations: []
  6. squne121 commented on Sep 22, 2026

    @squne121
    OwnerAuthor

    推奨アクションは、現在の #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 に以下を取得してください。

    確認時点では main HEAD は

    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.md
    • Issue 実装: freeform human_review_directive を production route で issue_editor_required に到達可能にする #2724 の Required Design References
    • planner / current skill が MUST_READ として要求する資料

    1. 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.py

    Allowed Paths 外を変更しないでください。

    特に以下を禁止します。

    • missing contract_patch_plan を generic {"operations": []} に変換する
    • empty CONTRACT_PATCH_PLAN_V1 を合成する
    • structured ANCHOR_SCOPE_REFRAME_V1 を捏造する
    • run_preflight() から _decide_human_review_directive_editor_route() を直接呼んで routing を二重化する
    • existing canonical consumer / decide_rewrite_route SSOT を迂回する
    • genuine empty-operations semantics を変更する
    • wire/schema/fixed artifact contract を変更する
    • 新規 runtime/security harness を作る
    • 実装: --enable-full-analysis のhelpテキストを--publish-authorized必須の実際の起動条件に合わせて修正する #2715 のコード・Issue contract をこの PR で変更する
    • unrelated cleanup / refactor を混ぜる

    private/internal canonical-consumer parameter の optionalization は、live Issue contract が許容している範囲で、必要な場合のみ使用してください。

    3. 実装設計の重要な不変条件

    実装は以下の意味論を維持してください。

    eligible freeform + missing planner plan

    structured ANCHOR_SCOPE_REFRAME_V1 が存在せず、

    • trusted
    • explicit
    • validly bound
    • eligible freeform 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

    へ到達させてください。

    この経路では

    • writes = 0
    • transaction/apply call = 0

    を維持してください。

    non-applicable / invalid missing-plan

    以下は false-green にしてはいけません。

    • wrong lane / untrusted
    • ambiguous
    • invalid binding
    • ordinary non-applicable

    これらは existing fail-closed blocker/reason を維持し、

    • writes = 0
    • editor route なし
    • no_change ではない
    • proven_no_change ではない

    ことを保証してください。

    特に

    missing plan
    → generic empty plan
    → run_trusted_anchor_iteration_zero()
    → no_change

    という誤実装を絶対に導入しないでください。

    precedence

    以下の ownership / precedence を維持してください。

    1. existing structured ANCHOR_SCOPE_REFRAME_V1
      → existing structured route
      → approved_scope_requires_full_contract_rewrite

    2. structured payload が transaction を支配していない場合に限り、
      eligible explicit trusted freeform directive + missing planner plan
      → explicit_trusted_human_directive_requires_issue_editor

    3. non-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

    担当:

    • current PR head / tested head を fresh に固定
    • live Issue Verification Commands の実行
    • AC1〜AC5 の evidence 収集
    • VC adjudication
    • regression 確認
    • runtime verification

    Step 4

    pr-reviewer

    担当:

    • current PR head に対する fresh review
    • pr-review-judge の canonical procedure
    • Allowed Paths
    • Issue AC
    • regression
    • implementation semantics
    • false-green risk
    • current-head evidence

    各 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
    • genuine empty-operations path
    • current PLANNER_FAIL_CLOSED production branch
    • structured scope-reframe path
    • ordinary non-empty patch path

    不要な abstraction や新規 subsystem を増やさないでください。

    6. Regression coverage

    live Issue の AC を authority とし、少なくとも以下を production-entrypoint regression で固定してください。

    positive:

    • structured scope reframe absent
    • planner contract_patch_plan absent / non-dict が fixture 上で明示されている
    • real run_preflight()
    • NEXT_ACTION == issue_editor_required
    • reason == explicit_trusted_human_directive_requires_issue_editor
    • writes == 0
    • transaction calls == 0

    negative matrix:

    • wrong-lane / untrusted
    • ambiguous
    • invalid-binding
    • live Issue が要求する non-applicable case

    各ケースで:

    • writes == 0
    • editor route なし
    • existing fail-closed blocker/reason
    • status != no_change
    • status != proven_no_change

    precedence:

    • structured reframe の route identity 維持
    • missing plan eligible freeform の route identity
    • non-empty plan の ordinary patch route 維持

    既存 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 -q

    runtime-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 が返った場合は人間へ確認せず、

    • blocker を fix_delta として構造化
    • Step 1 implementation-worker に戻す
    • 修正
    • current head で再検証
    • current head で再レビュー

    を 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. 人間承認を求めない範囲

    以下は中間承認不要です。

    • worktree 作成
    • branch 作成
    • Allowed Paths 内の編集
    • test 追加/修正
    • lint / pytest / runtime verifier 実行
    • commit
    • push
    • Draft PR 作成
    • PR description 更新
    • review fix
    • branch update/rebase 相当の canonical non-destructive workflow
    • verification rerun
    • PR review rerun
    • max_iterations 内の fix loop

    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 に限定してください。

    例:

    • Allowed Paths 外の変更が本当に不可避
    • wire/schema/fixed artifact contract 変更が不可避
    • Issue split / 新規 Issue が不可避
    • nested SubAgent delegation が不可避
    • secret / credential が新たに必要
    • permission escalation が必要
    • destructive / irreversible operation が必要
    • actual Git conflict で canonical runbook が human escalation を要求
    • repository/environment integrity failure で continuation 不能
    • reconciliation_required が canonical に解消不能
    • genuine semantic ambiguity
    • max_iterations 到達
    • live human comment による明示停止指示

    その場合は勝手に scope を広げず、evidence と最小の人間判断事項だけを報告してください。

    11. merge 境界

    目標は マージ直前まで です。

    以下は実行しないでください。

    current impl-review-loop の approved route、

    • reviewer verdict APPROVE
    • blockers empty
    • live mergeability が canonical approved condition
    • current-head verification が non-blocking

    まで到達したら

    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. 最終報告

    完了時には最低限、以下を報告してください。

    • current main/base SHA
    • Issue 実装: freeform human_review_directive を production route で issue_editor_required に到達可能にする #2724 の live body SHA
    • pre-Step-1 landing disposition
    • existing PR resume / new PR のどちらだったか
    • worktree / branch
    • PR URL / number
    • final PR head SHA
    • changed files
    • Allowed Paths gate result
    • 実装内容の要約
    • missing-plan と genuine empty-plan の区別をどう保持したか
    • generic empty-plan synthesis を導入していないこと
    • positive regression 結果
    • negative fail-closed matrix 結果
    • precedence regression 結果
    • Verification Commands の各結果
    • runtime verification result / exit classification
    • 起動した全 SubAgent
    • 各 SubAgent の担当
    • 各 SubAgent の terminal status
    • 全 SubAgent completion を join 済みであること
    • review iterations
    • final pr-reviewer verdict
    • blockers / warnings
    • live mergeability
    • termination_reason
    • IMPL_REVIEW_LOOP_RESULT_V1.status
    • merge 未実施
    • auto-merge 未実施
    • Issue close 未実施
    • 残存 blocker があればその最小説明

    最優先は「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 に直接進ませています。

  7. squne121 commented on Sep 22, 2026

    @squne121
    OwnerAuthor

    root-owned entry router audit

    route: invoke_impl_review_loop
    reason: fresh_review_go_live_equality

  8. squne121 commented on Sep 22, 2026

    @squne121
    OwnerAuthor

    作業一時中断 / resume checkpoint

    週間利用上限が残り 1% のため、ここでは追加の実装・検証・レビューを行わず、意図的に作業を中断します。

    • 利用上限リセット予定: 2026-09-27 18:32 JST
    • これは repository / code の新規 blocker ではなく、operator-selected operational pause です。
    • 再開時は、このコメントを handoff checkpoint として参照しつつ、必ず live state と current skill contract を fresh に再取得してください。

    現在の checkpoint

    実装済み内容

    implementation-worker は terminal completed / join 済みで、commit / push / Draft PR #2732 作成まで完了しています。

    worker 報告上の検証:

    • full suite: 56 passed
    • focused runtime smoke: 3 passed, 53 deselected
    • exit 77 / SKIP / fallback: なし
    • worktree-local evidence 保存済み
    • generic empty-plan synthesis は導入せず、missing-plan と genuine empty-operations を分離する最小実装
    • merge / auto-merge / Issue close は未実施

    直前の停止理由

    前回の 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_503
    • IMPL_REVIEW_LOOP_RESULT_V1.status: 未発行
    • review iterations: 0
    • pr-reviewer: 未起動
    • 全ての起動済み SubAgent は join 済み

    したがって、再開時の主目的は実装のやり直しではありません。

    再開時の最小アクション

    current .claude/skills/impl-review-loop を fresh に読み、live Issue / PR / main / comments / CI と current contract を再確認したうえで、既存 PR #2732 を resume してください。

    原則として:

    1. capability preflight / live Issue fetch / current-run issue-contract-review / live refetch / routing を current skill の canonical root-owned entry で fresh に行う。
    2. pre-Step-1 landing disposition で existing PR fix: route missing planner patch plans #2732 resume を優先し、新規 PR や実装の重複作成をしない。
    3. live PR head が recorded head 9286d49f817438df9b8761d7b6a4425c56f706b8 から動いていれば、stale evidence を捨て current head に再bindする。
    4. current candidate head に対して test-runner を起動し、SubAgent の terminal completed を必ず待って joinし、head-bound canonical verification report を得る。
    5. verification gate が通ったら current head に対して pr-reviewer を起動し、terminal completion を待つ。
    6. REQUEST_CHANGES なら current skill の fix loop に従って implementation-worker → verification → review を bounded iteration 内で継続する。
    7. APPROVE / blockers empty / current-head verification non-blocking / live mergeability が current skill の approved condition を満たしたら、merge直前で停止し IMPL_REVIEW_LOOP_RESULT_V1.status: draft_pr_ready を目標とする。

    境界

    再開後も、明示的な別指示がない限り以下は実行しないこと。

    API 503 の再発だけを code defect と解釈しないこと。current skill の retry / recovery contract を使い、それでも canonical continuation が不能な場合のみ environment integrity failure として停止すること。

  9. squne121 commented on Sep 22, 2026

    @squne121
    OwnerAuthor

    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-loop

    Issue #2724 の作業を、前回の中断地点から再開してください。

    0. operator pause からの再開

    前回は週間利用上限の都合で operator が意図的に作業を中断しました。

    Issue #2724 の以下の checkpoint comment を handoff として参照してください。

    • comment ID: 5780207015
    • marker: OPERATOR_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 に確認してください。

    前回記録では以下でしたが、必ず live state で再検証してください。

    • existing PR: #2732
    • branch: worktree-issue-2724-freeform-human-review-directive
    • recorded PR head:
      9286d49f817438df9b8761d7b6a4425c56f706b8
    • recorded base:
      73203069a9cfc6e1d0bd84e9bdf241ca618fa6b2

    2. 実装を最初からやり直さない

    前回の 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.py

    worker 報告では:

    • full suite: 56 passed
    • focused runtime smoke: 3 passed, 53 deselected
    • exit 77 / SKIP / fallback: なし
    • worktree-local evidence 保存済み
    • generic empty-plan synthesis は導入していない
    • missing-plan と genuine empty-operations を分離している

    したがって 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_503

    candidate 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: 未発行
    • review iterations: 0
    • pr-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
    から変化している場合:

    • 古い verification evidence を current-head evidence として使わない
    • current head に binding を更新する
    • current head で Verification Commands を fresh に再実行する

    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 を使用してください。

    ただし:

    • 無制限 retry はしない
    • fabricated completed report を作らない
    • main-thread test result を SubAgent completed result に偽装しない
    • stale report を current-head evidence として昇格しない

    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 についても:

    • current PR head に bind する
    • terminal completion を必ず待つ
    • stale reviewed head を採用しない
    • nested delegation は禁止

    としてください。

    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 の核心を変更しないでください。

    特に:

    • missing planner contract_patch_plan を generic {"operations": []} に偽装しない
    • generic empty CONTRACT_PATCH_PLAN_V1 を合成しない
    • genuine empty-operations semantics を壊さない
    • structured ANCHOR_SCOPE_REFRAME_V1 の既存 precedence を維持する
    • non-empty patch plan の通常 route を維持する
    • eligible freeform explicit trusted human_review_directive のみ既存 canonical consumer / routing SSOT へ到達させる
    • wrong-lane / untrusted / ambiguous / invalid-binding / non-applicable missing-plan は fail-closed を維持する
    • run_preflight() から _decide_human_review_directive_editor_route() を直接呼ぶ duplicate routing を作らない
    • wire / schema / fixed artifact contract を変更しない
    • security subsystem / approval mechanism /新規 harness を追加しない

    9. SubAgent policy

    必要な SubAgent は root/main thread から起動してください。

    各 SubAgent について:

    • 担当を明示する
    • nested SubAgent delegation を許可しない
    • current head / Issue / PR binding を明示する
    • terminal result を待つ
    • task status が terminal になるまで join する

    final report では、起動した全 SubAgent と terminal status を列挙してください。

    10. 人間承認なしで進めてよい範囲

    current skill / live Issue が許可している限り、以下は中間承認不要です。

    • existing worktree / PR resume
    • Allowed Paths 内の修正
    • test 追加・修正
    • Verification Commands
    • runtime verification
    • commit
    • push
    • PR description 更新
    • review fix
    • branch update/rebase 相当の canonical non-destructive workflow
    • verification rerun
    • PR review rerun
    • bounded fix loop

    permission mode / auto mode の設定自体は変更しないでください。

    11. genuine terminal condition

    停止は current skill / live Issue が定義する genuine terminal condition に限定してください。

    例:

    • Allowed Paths 外の変更が不可避
    • wire/schema/fixed artifact contract 変更が不可避
    • Issue split / 新規 Issue が不可避
    • nested SubAgent delegation が不可避
    • secret / credential が必要
    • permission escalation が必要
    • destructive / irreversible operation が必要
    • actual Git conflict で canonical runbook が human escalation を要求
    • bounded recovery 後も repository/environment integrity failure が解消不能
    • reconciliation_required が canonical に解消不能
    • genuine semantic ambiguity
    • max_iterations 到達
    • live human comment による明示停止

    その場合も scope を勝手に拡張せず、evidence と最小の判断事項だけを報告してください。

    12. merge 境界

    今回の目標は マージ直前まで です。

    以下は実行しないでください。

    current impl-review-loop の approved condition:

    • current-head Verification が non-blocking
    • final pr-reviewer verdict が APPROVE
    • blockers empty
    • live mergeability が current skill の approved condition を満たす

    まで到達したら、

    IMPL_REVIEW_LOOP_RESULT_V1.status: draft_pr_ready

    を目標として終了してください。

    13. 最終報告

    最低限、以下を報告してください。

    • current main/base SHA
    • Issue 実装: freeform human_review_directive を production route で issue_editor_required に到達可能にする #2724 live body SHA
    • pause checkpoint comment を確認したこと
    • pre-Step-1 landing disposition
    • existing PR fix: route missing planner patch plans #2732 resume / その他 route
    • worktree / branch
    • PR URL / number
    • final PR head SHA
    • changed files
    • Allowed Paths gate
    • implementation drift の有無
    • Verification Commands 各結果
    • runtime verification result / exit classification
    • current-head binding
    • 起動した全 SubAgent
    • 各 SubAgent の担当
    • 各 SubAgent の terminal status
    • 全 SubAgent を join 済みであること
    • review iterations
    • final pr-reviewer verdict
    • blockers / warnings
    • live mergeability
    • termination_reason
    • IMPL_REVIEW_LOOP_RESULT_V1.status
    • merge 未実施
    • auto-merge 未実施
    • Issue close 未実施

    最優先は実装をやり直すことではありません。

    PR #2732 の live candidate head を current contract に再bindし、canonical test-runner を terminal completed まで完了させ、その current head を fresh PR review に通して merge 直前まで進めることが今回の再開ポイントです。

    GitHub 側にも同じ再開方針の要点を残してあるので、次回はこのプロンプトと Issue の checkpoint の双方から復旧できます。

  10. added a commit that references this issue on Sep 24, 2026
    aba17f2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent/implementerenhancementphase/implementationtriage-required

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions