Skip to content

実装: impl-review-loop の終了条件を APPROVE && merge_ready && required_auto_actions == [] に統一し終了 gate を実装する #632

Closed

Description

@squne121

Machine-Readable Contract

contract_schema_version: v1
issue_kind: implementation
parent_issue: "#626"
goal_ref: "impl-review-loop の終了条件を APPROVE && merge_ready && required_auto_actions == [] に統一し、required_auto_actions が残る限り termination_reason: approved にしない gate を実装する(C5 vs C6 競合の解消)"
change_kind: workflow

Parent Issue

#626

Parent Goal Ref

  • Goal: 各 skill の既定完了条件を goal まで引き上げる。/impl-review-loop <N> は追加オプションなしで、成功時に IMPL_REVIEW_LOOP_RESULT_V1.status: draft_pr_ready かつ merge_ready: true を返す。
  • Desired Destination: impl-review-loop_default_completion.terminal_success_state: draft_pr_ready。PR review loop reaches APPROVE with merge_ready == true。human is left with merge / close / request-changes decision only。

Current Validated Scope

  • step-5-feedback-and-termination.md の APPROVE 即終了ロジックを required_auto_actions gate 付きに変更する
  • step-5-mergeability-handling.md の BEHIND 分岐との競合(C5 vs C6 conflict)を解消し、required_auto_actions 未消化状態では termination_reason: approved に到達しないことを保証する
  • 終了条件を APPROVE && merge_ready == true && required_auto_actions == [] に統一した判定ブロックをドキュメントに記述する
  • 上記 gate に対応する決定論的なユニットテストまたは fixture ベーステストを追加する

Remaining Parent Gaps

Outcome

step-5-feedback-and-termination.md および step-5-mergeability-handling.md が更新され、required_auto_actions が空でない限り termination_reason: approved に到達しない終了条件 gate が実装されて、関連テストが PASS している状態。

In Scope

  • step-5-feedback-and-termination.md の終了条件マトリクス(APPROVE 即終了ブロック)を以下ロジックに書き換える:
    if verdict == APPROVE and required_auto_actions is not empty:
      route required_auto_actions to implementation-worker; rerun verification if head changed; rerun pr-reviewer; do not terminate
    if verdict == APPROVE and merge_ready == true and required_auto_actions == []:
      terminate approved
    if required_auto_actions exists but executor/skill is unknown:
      human_escalation
    
  • step-5-mergeability-handling.md との整合性確認(BEHIND 分岐が required_auto_actions に統合されることを明記、または現行 BEHIND 分岐が required_auto_actions の一形態として扱われることを記述)
  • 終了判定 gate に対応するテスト: required_auto_actions が残る状態で termination_reason: approved にならないことを fixture / assert で検証
  • Refs #626 をコミットメッセージまたは PR 本文に含める
  • required_auto_actions 実行後の rerun ルーティング:
required_auto_action_result_routing:
  update_pr_body_hygiene:
    head_change_expected: false
    rerun: { verification: false, pr_review: true }
  ensure_closing_keyword:
    head_change_expected: false
    rerun: { verification: false, pr_review: true }
  update_branch:
    head_change_expected: true
    rerun: { verification: true, pr_review: true }
  worker_status_failed: { route: human_escalation }
  worker_status_blocked: { route: human_escalation }
  worker_status_permission_blocked: { route: human_escalation }
  • APPROVE && merge_ready == true && required_auto_actions == [] の終了 gate において、merge_ready: true は mergeability.merge_state_status == CLEAN を要件とする。UNSTABLE の場合は人間判断(human_escalation)または repo policy 証跡による明示的な許可を必要とする

Out of Scope

Acceptance Criteria

  • AC1: step-5-feedback-and-termination.md に APPROVE 即終了ブロック(verdict: APPROVE のみを条件とする旧ロジック)が残っていない(rg で検証)
  • AC2: step-5-feedback-and-termination.md に required_auto_actions == [] を終了条件とする記述が追加されている(rg で検証)
  • AC3: step-5-feedback-and-termination.md に required_auto_actions が空でない場合は implementation-worker へ委譲して終了しないルーティングが記述されている(rg で検証)
  • AC4: required_auto_actions が残る状態で termination_reason: approved にならないことを決定論的に検証するテストが存在し PASS する(uv run pytest で検証)
  • AC5: step-5-mergeability-handling.md の BEHIND 分岐と step-5-feedback-and-termination.md の終了条件の間に矛盾(C5 vs C6 競合)が解消されており、APPROVE + BEHIND の場合に termination_reason: approved が立たないことが本文から読み取れる
  • AC6: impl-review-loop/SKILL.md のトップレベル終了条件が LOOP_VERDICT.verdict: APPROVE 単独での終了ではなく、APPROVE && merge_ready == true && required_auto_actions == [] に更新されている(rg で検証)
  • AC7: step-5-mergeability-handling.md が LOOP_VERDICT_V2 の fenced YAML のみを parse し、V2 consumer path では top-level mergeStateStatus / recommendations を参照しない(rg で検証)
  • AC8: body-only な required_auto_actions(ensure_closing_keyword / update_pr_body_hygiene)は head SHA 不変でも PR review を再実行する(fixture テストで検証)
  • AC9: update_branch auto action は worker の successful head SHA 変更後に verification と PR review の両方を再実行する(fixture テストで検証)
  • AC10: worker result の failed / blocked / permission_blocked は termination_reason: approved に到達しない(fixture テストで検証)
  • AC11: reviewed_head_sha が現在 head と不一致の場合、dispatch 前に PR review を再実行する(fixture テストで検証)
  • AC12: 最終 approved 終了時に IMPL_REVIEW_LOOP_RESULT_V1.status: draft_pr_ready かつ merge_ready: true を emit する(rg で検証)

Verification Commands

# AC1
# preflight-scope: pr_review_only
$ rg -c "verdict.*APPROVE" .claude/skills/impl-review-loop/steps/step-5-feedback-and-termination.md
# AC2
# preflight-scope: pr_review_only
$ rg -n "required_auto_actions" .claude/skills/impl-review-loop/steps/step-5-feedback-and-termination.md
# AC3
# preflight-scope: pr_review_only
$ rg -n "implementation-worker" .claude/skills/impl-review-loop/steps/step-5-feedback-and-termination.md
# AC4
$ uv run pytest .claude/skills/impl-review-loop/tests/ -v
# AC5
# preflight-scope: pr_review_only
$ rg -n "termination_reason.*approved" .claude/skills/impl-review-loop/steps/step-5-mergeability-handling.md
# AC6
# preflight-scope: pr_review_only
$ rg -n "LOOP_VERDICT.*APPROVE\|verdict.*APPROVE.*終了" .claude/skills/impl-review-loop/SKILL.md
# AC7
# preflight-scope: pr_review_only
$ rg -n "mergeStateStatus\|recommendations" .claude/skills/impl-review-loop/steps/step-5-mergeability-handling.md
# AC8
# AC9
# AC10
# AC11
# preflight-scope: pr_review_only
$ uv run pytest .claude/skills/impl-review-loop/tests/ -v -k "loop_verdict_v2 or required_auto_actions or termination_gate"
# AC12
# preflight-scope: pr_review_only
$ rg -n "IMPL_REVIEW_LOOP_RESULT_V1|draft_pr_ready|merge_ready" .claude/skills/impl-review-loop/steps/step-5-feedback-and-termination.md

Allowed Paths

  • .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/tests/ (テスト追加時)
  • .claude/skills/impl-review-loop/SKILL.md

Stop Conditions

  • Allowed Paths 外の変更が必要と判明した場合
  • In Scope の固定契約(キー集合・スキーマ・型定義)の変更が必要になった場合
  • 新規 Issue の起票が必要と判断した場合(スコープ分割が発生する場合)
  • 後続 Phase / 別スコープへの波及が判明した場合
  • nested SubAgent delegation が必要になった場合
  • 外部サービス利用・権限昇格・既存テスト大規模改変が必要になった場合
  • LOOP_VERDICT_V2 のスキーマ(child-3 / 実装: pr-review-judge の出力を LOOP_VERDICT_V2 に拡張し merge_ready / required_auto_actions を追加する #630 のスコープ)への変更が必要になった場合

Required Skills

なし

Scope Delta(任意)

N/A

Runtime Verification Applicability

本 Issue の変更対象はワークフロー文書・スクリプトのみです。ゲームの実行時動作には影響しません。

decision: not_applicable
reason: "Workflow documentation and script changes only. No runtime game behavior changed."

Delivery Rule

依存関係:

この Issue は 両依存がマージされるまで functional dispatcher 実装を行わない。どちらかが未マージの場合、実装はドキュメント専用の parser 準備に限定し、dispatch 実行コードは追加しない。

Activity

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

    @squne121
    OwnerAuthor

    判定: REQUEST_CHANGES

    Issue #632 の方向性は正しいです。APPROVE だけで終了せず、APPROVE && merge_ready == true && required_auto_actions == [] を唯一の成功終了条件にする方針は、親 Issue #626 の termination enforcement と一致しています。親 Issue でも、required_auto_actions が残る場合は implementation-worker に委譲し、検証・PR review を再実行して、空になって初めて approved 終了すると定義されています。([GitHub]1)

    ただし、#632 の現行 contract はまだ実装安全ではありません。このまま実装すると、旧 LOOP_VERDICT parser が残ったまま grep ベースの AC だけ通り、mergeStateStatus / recommendations / verdict: APPROVE の旧系統と LOOP_VERDICT_V2 の新系統が混在して、誤終了する余地があります。

    重大ブロッカー

    1. 依存関係が #630 のみになっているのは誤り

    #632 は Delivery Rule で #630 依存だけを明記していますが、#632 の in-scope は required_auto_actions を implementation-worker に委譲することを含みます。これは #631 / PR #638 が定義する IMPLEMENTATION_WORKER_REQUEST_V2 と worker mode が存在して初めて成立します。#631 側は update_pr_body_hygiene、update_branch、apply_pr_review_fix_delta の mode と、expected_head_sha を使う stale verdict 防止を定義しています。([GitHub]2)

    修正案: #632 の Delivery Rule に Depends on #630 and #631 を明記してください。さらに「#630/#631 が未マージなら parser-only 変更に限定し、dispatch 実行は blocked」とするか、「#630/#631 マージ後のみ着手」としてください。

    2. Allowed Paths に impl-review-loop/SKILL.md がない

    現行 main の .claude/skills/impl-review-loop/SKILL.md には、トップレベルの終了条件として LOOP_VERDICT: APPROVE なら終了、という旧記述が残っています。#632 の Allowed Paths は step-5-feedback-and-termination.md、step-5-mergeability-handling.md、tests のみなので、step ファイルを直しても SKILL.md の入口説明と矛盾します。([GitHub]3)

    修正案: Allowed Paths に以下を追加してください。

    .claude/skills/impl-review-loop/SKILL.md
    

    AC も追加するべきです。

    AC追加: impl-review-loop/SKILL.md のトップレベル終了条件が
    APPROVE 単独終了ではなく、APPROVE && merge_ready == true && required_auto_actions == []
    に更新されている。
    

    3. 旧 parser の除去条件が弱い

    現在の step-5-mergeability-handling.md は mergeStateStatus と recommendations を grep で読む旧設計です。一方、#630 / PR #637 の LOOP_VERDICT_V2 は snake_case 専用で、mergeStateStatus と recommendations を V2 では廃止し、mergeability.merge_state_status と required_auto_actions に寄せています。([GitHub]4)

    修正案: #632 の AC に以下を追加してください。

    AC追加:
    - step-5-mergeability-handling.md は LOOP_VERDICT_V2 の fenced YAML だけを parse する。
    - V2 consumer path では top-level mergeStateStatus / recommendations を参照しない。
    - nested mergeability.merge_state_status / required_auto_actions / merge_ready を parse する。
    - malformed YAML、duplicate reviewed_head_sha、V1/V2 混在、unknown field は fail-closed で human_escalation または re-review にする。
    

    grep ではなく、fixture YAML を Python で parse するテストにしてください。rg -c "verdict.*APPROVE" は「記述が残っているか」を見るだけで、制御フローの安全性を証明しません。

    4. required_auto_actions 実行後の再実行条件が雑

    #632 は「head changed なら verification rerun、pr-reviewer rerun」と書いていますが、ensure_closing_keyword / update_pr_body_hygiene は PR body を変えるだけで head SHA は変わりません。それでも required_auto_actions が消えたか確認するため、PR review は再実行必須です。逆に update_branch は head SHA が変わるので、verification と PR review の両方が必須です。#631 / PR #638 は worker result に rerun_required、before_head_sha、after_head_sha、wrapper_used、status を返す設計を置いています。([GitHub]5)

    修正案: #632 に dispatch result matrix を追加してください。

    required_auto_action_result_routing:
      update_pr_body_hygiene:
        expected_worker_status: ok
        head_change_expected: false
        rerun:
          verification: false
          pr_review: true
      ensure_closing_keyword:
        worker_mode: update_pr_body_hygiene
        head_change_expected: false
        rerun:
          verification: false
          pr_review: true
      update_branch:
        expected_worker_status: ok
        head_change_expected: true
        rerun:
          verification: true
          pr_review: true
      worker_status_failed:
        route: human_escalation
      worker_status_blocked:
        route: human_escalation
      worker_status_permission_blocked:
        route: human_escalation

    5. GitHub API の実装仕様を Issue に落とし込めていない

    GitHub の Update a pull request branch REST API は、base branch の HEAD を PR branch に merge して更新する endpoint です。GitHub App で実行する場合は head repository contents への write 権限も必要で、fine-grained token には Pull requests write 権限が必要です。expected_head_sha が PR HEAD と一致しない場合は 422 Unprocessable Entity になり、レスポンスは 202 / 403 / 422 を取り得ます。([GitHub Docs]6)

    修正案: #632 の Step 5 consumer 側に、#631 worker result の permission_blocked / blocked / failed を retry し続けない fail-closed ルールを追加してください。特に 403 は「自動継続」ではなく、人間判断または権限確認に落とすべきです。

    6. merge_ready が UNSTABLE を許可する設計は危険

    #630 の V2 定義では merge_state_status in [CLEAN, UNSTABLE] なら merge_ready: true にできる設計です。GitHub GraphQL の MergeStateStatus では UNSTABLE は merge 可能だが commit status が passing ではない状態として扱われます。([GitHub]7)

    これは repo の「人間が merge 判断だけを行える状態」と衝突する可能性があります。required checks が branch protection で必須なら UNSTABLE は実質 merge-ready ではありません。

    修正案はどちらかです。

    案A: merge_ready true は CLEAN のみに限定する。
    案B: UNSTABLE を許可するなら、repo policy と branch protection 条件に基づき
          "UNSTABLE but merge button enabled" を確認する追加証跡を必須にする。
    

    #632 の終了 gate は consumer 側なので、この判断を #630 に丸投げせず、少なくとも merge_ready=true を受け取った後に mergeability.merge_state_status を再検査する防御を入れるべきです。

    追加すべきテスト

    #632 の AC4 は「required_auto_actions が残る状態で approved にならない」だけでは不足です。最低限、以下の fixture テストを追加してください。

    1. APPROVE + merge_ready=true + required_auto_actions=[] -> termination_reason: approved
    2. APPROVE + merge_ready=false + required_auto_actions=[ensure_closing_keyword] -> worker dispatch, no termination
    3. APPROVE + merge_ready=false + required_auto_actions=[update_pr_body_hygiene] -> worker dispatch, pr-review rerun only
    4. APPROVE + merge_ready=false + required_auto_actions=[update_branch, expected_head_sha] -> worker dispatch, verification rerun + pr-review rerun
    5. APPROVE + required_auto_actions=[unknown_kind] -> human_escalation
    6. worker returns permission_blocked -> human_escalation
    7. reviewed_head_sha != current head -> do not dispatch, rerun pr-review
    8. malformed LOOP_VERDICT_V2 YAML -> human_escalation
    9. legacy LOOP_VERDICT with mergeStateStatus/recommendations only -> compatibility path明示、または fail-closed
    10. follow_up_issue_requests non-empty but blocking_merge_ready=false -> does not block merge_ready
    

    GitHub closing keyword の判定も、公式仕様に合わせて close/closes/closed/fix/fixes/fixed/resolve/resolves/resolved、大文字、コロン付き、同一 repo / cross repo syntax を扱うべきです。GitHub docs は PR description または commit message の supported keyword による issue auto-close と、default branch 以外では keyword が無視される点を明記しています。([GitHub Docs]8)

    Issue #632 に入れるべき具体修正

    ## Dependencies
    
    Depends on:
    - #630 / PR #637: LOOP_VERDICT_V2 producer
    - #631 / PR #638: IMPLEMENTATION_WORKER_REQUEST_V2 executor
    
    This issue MUST NOT be implemented as a functional dispatcher until both dependencies are merged.
    If either dependency is missing, implementation must stop or limit itself to documentation-only parser preparation.
    
    ## Additional Allowed Paths
    
    - `.claude/skills/impl-review-loop/SKILL.md`
    
    ## Additional Acceptance Criteria
    
    - AC6: `impl-review-loop/SKILL.md` no longer documents `LOOP_VERDICT: APPROVE` as a sufficient terminal condition.
    - AC7: `step-5-mergeability-handling.md` parses `LOOP_VERDICT_V2` fenced YAML and does not rely on top-level `mergeStateStatus` or `recommendations` in the V2 path.
    - AC8: body-only required auto actions rerun PR review even when head SHA is unchanged.
    - AC9: branch-update auto action reruns verification and PR review after successful head SHA change.
    - AC10: worker result statuses `failed`, `blocked`, and `permission_blocked` never lead to `termination_reason: approved`.
    - AC11: stale `reviewed_head_sha` causes re-review before any required_auto_action is dispatched.
    - AC12: final approved termination emits `IMPL_REVIEW_LOOP_RESULT_V1.status: draft_pr_ready` with `merge_ready: true`.
    
    ## Additional Verification Commands
    
    ```bash
    uv run pytest .claude/skills/impl-review-loop/tests/ -v \
      -k "loop_verdict_v2 or required_auto_actions or termination_gate"
    rg -n "LOOP_VERDICT: APPROVE|verdict: APPROVE.*終了|termination_reason: approved" \
      .claude/skills/impl-review-loop/SKILL.md \
      .claude/skills/impl-review-loop/steps/step-5-feedback-and-termination.md \
      .claude/skills/impl-review-loop/steps/step-5-mergeability-handling.md
    rg -n "mergeStateStatus|recommendations" \
      .claude/skills/impl-review-loop/steps/step-5-mergeability-handling.md
    
    ## 最終コメント
    
    #632 は parent #626 の核心に近い重要 issue ですが、現状は「方針 issue」としては良くても「実装 issue」としては詰めが甘いです。特に、#630 の producer、#631 の executor、#632 の consumer gate の三者を切り替える順番と互換期間を明文化しないと、最も避けたい「APPROVE だが merge_ready ではない PR を approved 終了する」事故が残ります。
    ::contentReference[oaicite:8]{index=8}
    
  3. squne121 commented on Jun 3, 2026

    @squne121
    OwnerAuthor

    issue-refinement-loop 完了: 実装準備完了状態に移行しました (2026-06-03T11:38:00Z)

    issue-refinement-loop が iteration 2 で approve となり、実装準備完了状態に移行しました。

    今回の refinement で適用された主な改善点は以下の通りです。依存関係の明記、Allowed Paths の拡張、AC の追加と VC のアノテーション付与を行いました。

    LOOP_HANDOFF_RESULT_V1:
      schema_version: 1
      issue_number: 632
      issue_url: https://github.com/squne121/loop-protocol/issues/632
      status: impl_ready
      verdict: approve
      iterations_used: 2
      anchor_comment_url: https://github.com/squne121/loop-protocol/issues/632#issuecomment-4611819717
      anchor_comment_classification: human_decision_request_changes
      improvements_applied:
        - Delivery Rule に #630/#631 依存関係と functional dispatcher 実装禁止制約を追加
        - Allowed Paths に impl-review-loop/SKILL.md を追加
        - AC6〜AC12 を追加(SKILL.md 整合 / V2 parser / dispatch routing / fail-closed / merge_ready)
        - required_auto_action_result_routing matrix を In Scope に追加
        - merge_ready UNSTABLE 人間判断ルールを In Scope に追加
        - AC8〜AC12 の VC に個別マーカーと preflight-scope pr_review_only を付与
      follow_up_issues: []
      termination_reason: approved
  4. added a commit that references this issue on Jun 3, 2026
  5. squne121 commented on Jun 3, 2026

    @squne121
    OwnerAuthor

    Contract Snapshot (2026-06-03T12:08:52Z)

    • Outcome: step-5-feedback-and-termination.md および step-5-mergeability-handling.md が更新され、required_auto_actions が空でない限り termination_reason: approved に到達しない終了条件 gate が実装されて、関連テストが PASS している状態。
    • Acceptance Criteria: AC1–AC12(全 12 件)
    • Verification Commands: AC4 (pytest regression_gate)、AC1/2/3/5/6/7/8-11/12 は pr_review_only
    • Allowed Paths:
      • .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/tests/
      • .claude/skills/impl-review-loop/SKILL.md
    • Worktree: .claude/worktrees/issue-632-impl-review-loop-approve-merge-ready-req
    • Branch: worktree-issue-632-impl-review-loop-approve-merge-ready-req
    • VC preflight: baseline fail expected = 0, regression gate pass = 1, pr_review_only skipped = 8, unexpected pass = 0, unrunnable = 0
    CONTRACT_REVIEW_RESULT_V1:
      status: go
      generated_at: "2026-06-03T12:08:52Z"
      generated_by: issue-contract-review
      issue_url: https://github.com/squne121/loop-protocol/issues/632
      checks:
        template_compliance: pass
        state_label: ok
        allowed_paths_present: pass
        vc_present: pass
        stop_conditions_complete: pass
        vc_preflight:
          passed: true
          vc_failed_as_expected: 0
          vc_passed_unexpectedly: 0
          vc_unrunnable: 0
          vc_expected_pass: 1
          vc_skipped: 8
          status: pass
          classifications:
            - ac: AC1
              command: "rg -c \"verdict.*APPROVE\" .claude/skills/impl-review-loop/steps/step-5-feedback-and-termination.md"
              exit_code: null
              category: preflight_scope_pr_review_only
              scope_class: pr_review_only
              classification: skipped
              confidence: low
              decision: go
              verification_owner: pr-review-judge
              deferred_reason: "VC marked pr_review_only; verification deferred to PR review"
              runtime_verification_required: false
            - ac: AC2
              command: "rg -n \"required_auto_actions\" .claude/skills/impl-review-loop/steps/step-5-feedback-and-termination.md"
              exit_code: null
              category: preflight_scope_pr_review_only
              scope_class: pr_review_only
              classification: skipped
              confidence: low
              decision: go
              verification_owner: pr-review-judge
              deferred_reason: "VC marked pr_review_only; verification deferred to PR review"
              runtime_verification_required: false
            - ac: AC3
              command: "rg -n \"implementation-worker\" .claude/skills/impl-review-loop/steps/step-5-feedback-and-termination.md"
              exit_code: null
              category: preflight_scope_pr_review_only
              scope_class: pr_review_only
              classification: skipped
              confidence: low
              decision: go
              verification_owner: pr-review-judge
              deferred_reason: "VC marked pr_review_only; verification deferred to PR review"
              runtime_verification_required: false
            - ac: AC4
              command: "uv run pytest .claude/skills/impl-review-loop/tests/ -v"
              exit_code: 0
              category: regression_gate
              scope_class: regression_gate
              classification: expected_pass
              confidence: low
              decision: go
            - ac: AC5
              command: "rg -n \"termination_reason.*approved\" .claude/skills/impl-review-loop/steps/step-5-mergeability-handling.md"
              exit_code: null
              category: preflight_scope_pr_review_only
              scope_class: pr_review_only
              classification: skipped
              confidence: low
              decision: go
              verification_owner: pr-review-judge
              deferred_reason: "VC marked pr_review_only; verification deferred to PR review"
              runtime_verification_required: false
            - ac: AC6
              command: "rg -n \"LOOP_VERDICT.*APPROVE|verdict.*APPROVE.*終了\" .claude/skills/impl-review-loop/SKILL.md"
              exit_code: null
              category: preflight_scope_pr_review_only
              scope_class: pr_review_only
              classification: skipped
              confidence: low
              decision: go
              verification_owner: pr-review-judge
              deferred_reason: "VC marked pr_review_only; verification deferred to PR review"
              runtime_verification_required: false
            - ac: AC7
              command: "rg -n \"mergeStateStatus|recommendations\" .claude/skills/impl-review-loop/steps/step-5-mergeability-handling.md"
              exit_code: null
              category: preflight_scope_pr_review_only
              scope_class: pr_review_only
              classification: skipped
              confidence: low
              decision: go
              verification_owner: pr-review-judge
              deferred_reason: "VC marked pr_review_only; verification deferred to PR review"
              runtime_verification_required: false
            - ac: AC11
              command: "uv run pytest .claude/skills/impl-review-loop/tests/ -v -k \"loop_verdict_v2 or required_auto_actions or termination_gate\""
              exit_code: null
              category: preflight_scope_pr_review_only
              scope_class: pr_review_only
              classification: skipped
              confidence: low
              decision: go
              verification_owner: pr-review-judge
              deferred_reason: "VC marked pr_review_only; verification deferred to PR review"
              runtime_verification_required: false
            - ac: AC12
              command: "rg -n \"IMPL_REVIEW_LOOP_RESULT_V1|draft_pr_ready|merge_ready\" .claude/skills/impl-review-loop/steps/step-5-feedback-and-termination.md"
              exit_code: null
              category: preflight_scope_pr_review_only
              scope_class: pr_review_only
              classification: skipped
              confidence: low
              decision: go
              verification_owner: pr-review-judge
              deferred_reason: "VC marked pr_review_only; verification deferred to PR review"
              runtime_verification_required: false
        ac_verifiability: pass
        product_spec_check:
          applicability: not_applicable
          decision: pass
          triggers:
            docs_product_allowed_paths: false
            tasks_md_mentioned: false
            specify_artifact_mentioned: false
            generated_task_mentioned: false
            product_spec_context_present: false
        worktree_branch_collision: clear
      next_action: implement_issue
      blocked_reasons: []
      warnings:
        - "check_blockers.sh: 'Depends on #630' を Delivery Rule 条件文から検出(native API は blockers なし)。#630 は CLOSED 済みのため実質ブロックなし。Delivery Rule 条件文除外規則の対象と判断。"
        - "#631 が OPEN のため Delivery Rule により docs-only mode 適用。Allowed Paths(step files / SKILL.md / tests/)は dispatch 実行コードを含まないため制約内で実装可能。"
      body_sha256: "sha256:e0c9683e4447f0d9716d62c89c278b1dd7e56372cbfb3818c16e272c21dfdc98"
  6. squne121 commented on Jun 3, 2026

    @squne121
    OwnerAuthor

    Issue #632 Contract Review: go

    全チェック通過。実装着手可能です。

    チェック結果サマリー:

    注意事項(warnings):


    • Outcome: step-5-feedback-and-termination.md および step-5-mergeability-handling.md が更新され、required_auto_actions が空でない限り termination_reason: approved に到達しない終了条件 gate が実装されて、関連テストが PASS している状態。
    • Acceptance Criteria: AC1〜AC12(APPROVE 即終了廃止・required_auto_actions gate・mergeability 整合・IMPL_REVIEW_LOOP_RESULT_V1 emit)
    • Allowed Paths: .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/tests/・.claude/skills/impl-review-loop/SKILL.md
    • Worktree: .claude/worktrees/issue-632-impl-review-loop-approve-merge-ready-req
    • Branch: worktree-issue-632-impl-review-loop-approve-merge-ready-req
    • VC preflight: regression_gate pass = 1(AC4)、pr_review_only skipped = 8、想定外 pass = 0、実行不可 = 0
    CONTRACT_REVIEW_RESULT_V1:
      status: go
      generated_at: 2026-06-03T12:15:00Z
      generated_by: issue-contract-review
      issue_url: https://github.com/squne121/loop-protocol/issues/632
      checks:
        template_compliance: pass
        state_label: ok
        allowed_paths_present: pass
        vc_present: pass
        stop_conditions_complete: pass
        vc_preflight:
          passed: true
          vc_failed_as_expected: 0
          vc_passed_unexpectedly: 0
          vc_unrunnable: 0
          vc_expected_pass: 1
          vc_skipped: 8
          classifications:
            - ac: AC1
              command: "rg -c \"verdict.*APPROVE\" .claude/skills/impl-review-loop/steps/step-5-feedback-and-termination.md"
              exit_code: null
              classification: skipped
              category: preflight_scope_pr_review_only
              scope_class: pr_review_only
              confidence: low
              evidence: {}
              decision: go
              verification_owner: pr-review-judge
              deferred_reason: "VC marked pr_review_only; verification deferred to PR review"
              runtime_verification_required: false
            - ac: AC2
              command: "rg -n \"required_auto_actions\" .claude/skills/impl-review-loop/steps/step-5-feedback-and-termination.md"
              exit_code: null
              classification: skipped
              category: preflight_scope_pr_review_only
              scope_class: pr_review_only
              confidence: low
              evidence: {}
              decision: go
              verification_owner: pr-review-judge
              deferred_reason: "VC marked pr_review_only; verification deferred to PR review"
              runtime_verification_required: false
            - ac: AC3
              command: "rg -n \"implementation-worker\" .claude/skills/impl-review-loop/steps/step-5-feedback-and-termination.md"
              exit_code: null
              classification: skipped
              category: preflight_scope_pr_review_only
              scope_class: pr_review_only
              confidence: low
              evidence: {}
              decision: go
              verification_owner: pr-review-judge
              deferred_reason: "VC marked pr_review_only; verification deferred to PR review"
              runtime_verification_required: false
            - ac: AC4
              command: "uv run pytest .claude/skills/impl-review-loop/tests/ -v"
              exit_code: 0
              classification: expected_pass
              category: regression_gate
              scope_class: regression_gate
              confidence: low
              evidence:
                stdout_excerpt: "28 passed in 0.09s"
              decision: go
            - ac: AC5
              command: "rg -n \"termination_reason.*approved\" .claude/skills/impl-review-loop/steps/step-5-mergeability-handling.md"
              exit_code: null
              classification: skipped
              category: preflight_scope_pr_review_only
              scope_class: pr_review_only
              confidence: low
              evidence: {}
              decision: go
              verification_owner: pr-review-judge
              deferred_reason: "VC marked pr_review_only; verification deferred to PR review"
              runtime_verification_required: false
            - ac: AC6
              command: "rg -n \"LOOP_VERDICT.*APPROVE|verdict.*APPROVE.*終了\" .claude/skills/impl-review-loop/SKILL.md"
              exit_code: null
              classification: skipped
              category: preflight_scope_pr_review_only
              scope_class: pr_review_only
              confidence: low
              evidence: {}
              decision: go
              verification_owner: pr-review-judge
              deferred_reason: "VC marked pr_review_only; verification deferred to PR review"
              runtime_verification_required: false
            - ac: AC7
              command: "rg -n \"mergeStateStatus|recommendations\" .claude/skills/impl-review-loop/steps/step-5-mergeability-handling.md"
              exit_code: null
              classification: skipped
              category: preflight_scope_pr_review_only
              scope_class: pr_review_only
              confidence: low
              evidence: {}
              decision: go
              verification_owner: pr-review-judge
              deferred_reason: "VC marked pr_review_only; verification deferred to PR review"
              runtime_verification_required: false
            - ac: "AC8/AC9/AC10/AC11"
              command: "uv run pytest .claude/skills/impl-review-loop/tests/ -v -k \"loop_verdict_v2 or required_auto_actions or termination_gate\""
              exit_code: null
              classification: skipped
              category: preflight_scope_pr_review_only
              scope_class: pr_review_only
              confidence: low
              evidence: {}
              decision: go
              verification_owner: pr-review-judge
              deferred_reason: "VC marked pr_review_only; verification deferred to PR review"
              runtime_verification_required: false
            - ac: AC12
              command: "rg -n \"IMPL_REVIEW_LOOP_RESULT_V1|draft_pr_ready|merge_ready\" .claude/skills/impl-review-loop/steps/step-5-feedback-and-termination.md"
              exit_code: null
              classification: skipped
              category: preflight_scope_pr_review_only
              scope_class: pr_review_only
              confidence: low
              evidence: {}
              decision: go
              verification_owner: pr-review-judge
              deferred_reason: "VC marked pr_review_only; verification deferred to PR review"
              runtime_verification_required: false
        ac_verifiability: pass
        product_spec_check:
          applicability: not_applicable
          decision: pass
        worktree_branch_collision: clear
      next_action: implement_issue
      blocked_reasons: []
      warnings:
        - kind: branch_exists_at_main_head
          description: "既存 branch が main HEAD と同一(コミットなし・PR なし)。過去の残骸だが実装未着手のため clear 判定。"
        - kind: delivery_rule_partial_dependency_open
          description: "#631(OPEN)が Delivery Rule に記載あり。機能ディスパッチャー実装は禁止。ドキュメント変更 + テスト追加のみで実装を限定すること。"
        - kind: check_blockers_script_false_positive
          description: "check_blockers.sh が Delivery Rule 内の Depends on #630 を fallback blocker として誤検出。native API: blockers なし。#630 は CLOSED。"
      body_sha256: "sha256:42a610cbda12d75a6418d8372174b4668a2dce10d1a1b3083ee377ee86778993"
  7. added a commit that references this issue on Jun 3, 2026
  8. squne121 commented on Jun 3, 2026

    @squne121
    OwnerAuthor

    impl-review-loop 完了: Draft PR 準備完了 (2026-06-03)

    impl-review-loop が iteration 1 で APPROVE となり、Draft PR が準備完了状態になりました。

    ループ結果

    IMPL_REVIEW_LOOP_RESULT_V1:
      status: draft_pr_ready
      issue_number: 632
      pr_url: https://github.com/squne121/loop-protocol/pull/640
      head_sha: ef1f99fd77a8079a2cf31e83ed287dd3b6c3039c
      merge_ready: true
      iterations: 2
      termination_reason: approved

    実装内容

    • step-5-feedback-and-termination.md: APPROVE 即終了を required_auto_actions == [] gate 付き三段終了条件に更新
    • step-5-mergeability-handling.md: C5 vs C6 競合解消、LOOP_VERDICT_V2 consumer 対応
    • SKILL.md: 終了条件テーブルを APPROVE && merge_ready == true && required_auto_actions == [] に更新
    • tests/test_termination_gate.py: 31 fixture テスト新規追加(全 59 テスト PASS)

    次のアクション

    PR #640 を確認し、マージの判断をしてください: #640

    非ブロッカー: impl-review-loop/tests/ を CI python-test の実行対象に追加する(現在は未対象)

  9. squne121 commented on Jun 3, 2026

    @squne121
    OwnerAuthor

    implement-issue: 実装完了

  10. added a commit that references this issue on Jun 3, 2026
  11. squne121 commented on Jun 3, 2026

    @squne121
    OwnerAuthor

    impl-review-loop 完了: Draft PR 準備完了 (2026-06-04)

    impl-review-loop が iteration 2(計 3 回)で APPROVE となり、Draft PR が準備完了状態になりました。

    ループ結果

    IMPL_REVIEW_LOOP_RESULT_V1:
      status: draft_pr_ready
      issue_number: 632
      pr_url: https://github.com/squne121/loop-protocol/pull/640
      head_sha: 5ca58f414b88c01f332266ef6c4d686a5a529c7a
      draft_pr_ready: true
      github_merge_ready: false
      github_merge_state_status: CLEAN
      iterations: 3
      termination_reason: approved

    実装内容(最終版)

    • step-5-feedback-and-termination.md: 三段 gate 終了条件 + required_auto_actions object schema + draft_pr_ready/github_merge_ready 分離 + worker status union 拡張
    • step-5-mergeability-handling.md: LOOP_VERDICT_V2 parse 方針更新(最初の yaml block 依存禁止)+ DRAFT/HAS_HOOKS 対応
    • SKILL.md: 終了条件テーブルを APPROVE && merge_ready == true && required_auto_actions == [] に更新
    • tests/test_termination_gate.py: 87 テスト(routing matrix fixture、B1-B6 regression guard 含む)

    イテレーション履歴

    • iteration 0: Safety Claim Matrix / Schema Change Applicability 欠落 + update_branch(BEHIND)
    • iteration 1: 人間レビュー 6 ブロッカー解消(object schema / YAML 抽出 / draft 分離 / worker status / fixture テスト / bidi guard)
    • iteration 2: APPROVE

    次のアクション

    PR #640 を Draft から準備完了に移行してマージをご判断ください: #640

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