Skip to content

実装: issue-refinement-loop と impl-review-loop の implementation-ready handoff を contract gate 化する #564

Closed

Description

@squne121

Machine-Readable Contract

contract_schema_version: v1
issue_kind: implementation
parent_issue: "none"
goal_ref: "issue-refinement-loop と impl-review-loop の implementation-ready handoff を contract gate 化し、refinement approved と implementation-ready を別状態として厳密に区別する"
change_kind: mixed

Parent Issue

なし(スタンドアロン Issue)

Parent Goal Ref

  • Goal: issue-refinement-loop の termination_reason: approved が impl-review-loop の preparation で "implementation-ready" と誤認される handoff gap を解消する
  • Desired Destination: CONTRACT_REVIEW_RESULT_V1 status: go の存在・鮮度チェックが impl-review-loop preparation の intake gate として機能し、gap が確定論的に検出される状態

Current Validated Scope

  • issue-refinement-loop の終了状態を refinement_approved_gate_pending と implementation_ready に分ける
  • issue-contract-review の CONTRACT_REVIEW_RESULT_V1 status: go を impl-review-loop の必須入力として明文化する(ドキュメントまたはスクリプト修正)
  • impl-review-loop preparation で intake_gate_failed を独立した termination_reason として扱う(missing_contract_go / metadata_not_ready / stale_contract_review / body_snapshot_mismatch のサブ理由付き)
  • body_sha256 / comment freshness チェックを preparation の intake gate に追加する
  • 実装: WSL2/Ubuntu human playtest 実行環境 runbook と preflight を追加する #561 相当の regression fixture を追加する

Remaining Parent Gaps

本 Issue スコープ外として残存:

  1. issue-contract-review skill の gate-only / idempotent mode の execution-level 実装
  2. title prefix 自動付与・phase/implementation label 自動更新のロジック(現在は手動/ヒューリスティック)
  3. impl-review-loop の preparation 以降フローへの影響調査(intake_gate_failed 後の human escalation 動線)

背景

issue-refinement-loop が issue-reviewer approve で終了すると、impl-review-loop が "implementation-ready" と誤認する handoff gap が存在する。

具体的には:

  • issue-refinement-loop の終了(termination_reason: approved)は「本文の refinement が完了した」意味だが、「implementation-ready gate を通過した」意味ではない
  • impl-review-loop の preparation は CONTRACT_REVIEW_RESULT_V1 status: go コメントを必須としているが、refinement loop はこれを生成しない
  • Issue の title prefix(実装: / implement:)と phase/implementation label の更新も refinement loop では行われない
  • 古い status: go コメント(body_sha256 が現在の Issue 本文と一致しないもの)を誤採用するリスクもある

この gap により、refinement が完了した Issue でも impl-review-loop が preparation で停止し、人間が手動で metadata 更新と issue-contract-review 実行を行う必要が生じる(#561 で再現)。

設計方針:

issue-refinement-loop(本文改善のみ)
  → issue-contract-review(CONTRACT_REVIEW_RESULT_V1 status: go 生成 + title/label 更新)
      → impl-review-loop(go snapshot のみを実装対象とする)

control-plane が作業内容や gate 判断を抱えず、worker / deterministic checker 側に責務を寄せる。

設計決定: fail-only gate
impl-review-loop は CONTRACT_REVIEW_RESULT_V1 status: go コメントが存在しない場合に issue-contract-review を自動実行しない。最新の valid go コメントがなければ intake_gate_failed: missing_contract_go で停止する(fail-only gate)。gate 判定と成果物生成を同一 loop で混在させない。

Outcome

以下のファイルが更新・追加され、pnpm test および pnpm build が PASS した状態でコミットされている:

  • 終了状態分離: issue-refinement-loop の termination 定義(SKILL.md または references/termination-policy.md)に refinement_approved_gate_pending(issue-contract-review 未実行)と implementation_ready(go comment 確認済み)の 2 状態が明文化される
  • intake gate 明文化: impl-review-loop preparation(SKILL.md または steps/preparation.md)に CONTRACT_REVIEW_RESULT_V1 status: go が必須入力として記述され、欠ける場合の termination_reason: intake_gate_failed と 4 つのサブ理由(missing_contract_go / metadata_not_ready / stale_contract_review / body_snapshot_mismatch)が定義される
  • freshness チェック: body_sha256 と comment freshness(status: go より後の REQUEST_CHANGES 無効化)ルールが preparation gate に追記される
  • regression fixture: 実装: WSL2/Ubuntu human playtest 実行環境 runbook と preflight を追加する #561 型(refinement approved だが go comment / metadata がない状態)の fixture またはテストが追加される

Note: 具体的な変更対象ファイルパスは実装前調査で確定する(Allowed Paths 参照)。

In Scope

  • issue-refinement-loop SKILL.md または references/termination-policy.md への終了状態分離定義の追記
  • impl-review-loop SKILL.md または steps/preparation.md への intake gate 必須入力・intake_gate_failed termination 定義の追記
  • preparation intake gate への body_sha256 freshness チェックルール追記
  • preparation intake gate への「status: go より後の REQUEST_CHANGES コメントは go を無効化する」ルール追記
  • 実装: WSL2/Ubuntu human playtest 実行環境 runbook と preflight を追加する #561 型の regression fixture または integration test の追加
  • title prefix(実装: / implement:)と phase/implementation label の欠如チェックを intake gate に追加

Out of Scope

Acceptance Criteria

  • AC1: issue-refinement-loop の定義に refinement_approved_gate_pending 状態が追加され、issue-reviewer approve だけでは implementation_ready を返さないことが明文化されている
  • AC2: impl-review-loop preparation の定義に CONTRACT_REVIEW_RESULT_V1 status: go が必須入力として明記され、欠ける場合の termination_reason: intake_gate_failed が定義されている。failure subreason の優先順位(metadata_not_ready > missing_contract_go > stale_contract_review > body_snapshot_mismatch > request_changes_after_go)が明記されている
  • AC3: title prefix(実装: / implement:)または phase/implementation label が欠ける Issue は intake_gate_failed になることが定義されている
  • AC4: go コメントの freshness チェックが preparation gate に定義されている。body_sha256 フィールドが存在する場合は hash 比較で検証、存在しない場合は generated_at < issue.updated_at を stale_contract_review とするフォールバックを使用することが明記されている
  • AC5: go 無効化 marker が machine-readable block として定義されている(free text REQUEST_CHANGES 検出を避ける)。少なくとも source: issue_comment、accepted_marker: fenced_yaml REVIEW_RESULT_V1.status == request_changes、target_issue_url_must_match: true、ordering_key: created_at が定義されており、最新 go より後の valid marker が go を無効化することが preparation gate に定義されている
  • AC6: 実装: WSL2/Ubuntu human playtest 実行環境 runbook と preflight を追加する #561 型の fixture(refinement approved だが go comment / metadata がない状態)で regression テストまたは検証手順が追加されている
  • AC7: pnpm test が PASS する(回帰なし)
  • AC8: pnpm build が PASS する(回帰なし)

Verification Commands

# AC1
# preflight-scope: pr_review_only
$ rg -rn 'refinement_approved_gate_pending' .claude/skills/issue-refinement-loop/

# AC2
# preflight-scope: pr_review_only
$ rg -rn 'intake_gate_failed' .claude/skills/impl-review-loop/

# AC2
# preflight-scope: pr_review_only
$ rg -rn 'CONTRACT_REVIEW_RESULT_V1.*go\|status.*go.*required\|必須入力' .claude/skills/impl-review-loop/

# AC3
# preflight-scope: pr_review_only
$ rg -rn 'metadata_not_ready\|phase/implementation.*label\|title.*prefix' .claude/skills/impl-review-loop/

# AC4
# preflight-scope: pr_review_only
$ rg -rn 'body_sha256\|body_snapshot_mismatch\|stale_contract_review' .claude/skills/impl-review-loop/

# AC5
# preflight-scope: pr_review_only
$ rg -rn 'REQUEST_CHANGES\|missing_contract_go\|go.*無効' .claude/skills/impl-review-loop/

# AC6
# preflight-scope: pr_review_only
$ rg -rn '561\|refinement_approved_gate_pending\|go.*comment.*missing' .claude/skills/impl-review-loop/tests/

# AC7
# preflight-scope: runtime_only
$ pnpm test

# AC8
# preflight-scope: runtime_only
$ pnpm build

Allowed Paths

実装前調査で確定する。暫定候補:

  • .claude/skills/issue-refinement-loop/SKILL.md
  • .claude/skills/issue-refinement-loop/references/termination-policy.md(存在する場合)
  • .claude/skills/impl-review-loop/SKILL.md
  • .claude/skills/impl-review-loop/steps/preparation.md
  • .claude/skills/impl-review-loop/tests/(regression fixture 追加先)

実装開始前に ls .claude/skills/issue-refinement-loop/ および ls .claude/skills/impl-review-loop/ を実行して実際のファイル構成を確認し、Allowed Paths を確定する。

Stop Conditions

実装中にこれらの状況が発生したら直ちに作業を停止し、Issue comment に状況を記録して人間の判断を待つ。

Runtime Verification Applicability

  • decision: not_applicable
  • reason: 変更対象は skill SKILL.md / references Markdown ファイル + regression fixture(テストファイル)。pnpm test で回帰確認が完結し、プロセス起動・ネットワーク通信・外部サービス依存はない。

Required Skills

なし

Delivery Rule

  • 1 Issue = 1 PR
  • worktree: .claude/worktrees/issue-<N>-handoff-contract-gate
  • Draft PR 既定

関連 Issue

Source

dedupe_key: "workflow:impl-review-loop:implementation-ready-handoff-contract-gate"
source:
  kind: post_impl_loop_failure
  origin_issue: "https://github.com/squne121/loop-protocol/issues/561"
  note: "refinement approved → impl-review-loop 停止の handoff gap を contract gate で解消する"

Activity

  1. squne121 commented on Jun 2, 2026

    @squne121
    OwnerAuthor

    結論

    Verdict: REQUEST_CHANGES。#564 は方向性は正しいが、このまま実装に渡すと失敗しやすいです。
    主因は、#560/#563 との責務重複、現行 impl-review-loop の「go コメントがなければ issue-contract-review を自動実行する」挙動との衝突、実在しない Allowed Path、body_sha256 の producer 契約未確定です。#564 自体は「refinement approved を implementation-ready と誤読する gap」を塞ぐ Issue で、CONTRACT_REVIEW_RESULT_V1 status: go を impl-review-loop の intake gate にする設計です。([GitHub]1)

    公開ページ上で確認できる範囲では、#564 自体にはまだ紐づく PR はなく、Development も空です。([GitHub]1)


    関連 Issue / PR の読み合わせ

    #564 は #561 を再現元として参照しています。#561 は WSL2/Ubuntu human playtest runbook と preflight を追加する implementation issue で、本文上は phase/implementation 相当の Issue に見えますが、#564 が問題にしているのは「refinement approve 済みでも contract go がないなら implementation-ready ではない」という handoff gap です。([GitHub]2)

    #561 には PR #565 が紐づき、preflight script、manual runbook、WSL2 runtime 検証、CI 通過、review approve まで進んでいます。したがって #564 の regression fixture は、実 Issue/PR 状態に依存するのではなく、「#561 型の metadata は揃っているが CONTRACT_REVIEW_RESULT_V1 status: go がない」最小 fixture として hermetic に作るべきです。([GitHub]3)

    重大なのは #560/#563 との重複です。#560 はすでに issue-refinement-loop の完了条件に issue-contract-review gate を追加する Issue で、latest CONTRACT_REVIEW_RESULT_V1.status == "go"、snapshot idempotency、body freshness invalidation を扱っています。([GitHub]4) PR #563 も同じ方向の docs 変更を含み、termination-policy / dor / workflow を更新して test/build 通過、review approve まで進んでいます。([GitHub]5)

    つまり #564 は、#560/#563 が merge 済みである前提に立つ consumer-side gate に絞るか、#560/#563 を supersede する Issue として再定義する必要があります。現状のままだと、同じ「final go gate」を複数 Issue が別名・別状態で定義し、loop state が drift します。


    Blocker 1: Allowed Paths が現行 repo と合っていない

    #564 の Allowed Paths には impl-review-loop/references/preparation.md が「存在する場合」として出ていますが、現行 main ではこの path は存在せず、実体は .claude/skills/impl-review-loop/steps/preparation.md です。実際の preparation は、missing snapshot 時に issue comments から status: go を探し、なければ issue-contract-review を自動実行する設計になっています。([GitHub]6)

    これは単なる path typo ではありません。#564 の主対象が intake gate なら、変更対象は少なくとも以下です。

    .claude/skills/impl-review-loop/SKILL.md
    .claude/skills/impl-review-loop/steps/preparation.md
    .claude/skills/issue-refinement-loop/references/termination-policy.md   # #560/#563 未mergeの場合のみ
    .claude/skills/*/tests or fixtures
    docs/dev/workflow.md                                                    # 必要最小限
    

    Issue 本文の Allowed Paths は修正必須です。Codex/Claude worker に渡すと、存在しない path を探索して無駄な実装判断を始めます。


    Blocker 2: missing_contract_go と「自動 issue-contract-review 実行」が衝突している

    現行 impl-review-loop は、contract_snapshot_url がなければ issue comments から valid go を探し、見つからなければ issue-contract-review を auto-run する流れです。([GitHub]6)

    一方 #564 は、CONTRACT_REVIEW_RESULT_V1 status: go を impl-review-loop preparation の必須入力にし、失敗理由として missing_contract_go / metadata_not_ready / stale_contract_review / body_snapshot_mismatch を導入しようとしています。([GitHub]1)

    ここは設計決定が必要です。

    推奨は fail-only gate です。
    impl-review-loop は issue-contract-review を自動実行せず、最新の valid go がなければ intake_gate_failed: missing_contract_go で停止する。gate 判定と成果物生成を同じ loop がやると、control-plane が gate と作業生成を混ぜる構造に戻ります。

    代替案として auto-materialization を残すなら、#564 の failure taxonomy は破綻します。missing_contract_go は「自動生成に失敗した後の状態」になるため、Issue 名と AC を書き換えるべきです。


    Blocker 3: body_sha256 は producer 契約が未確定

    #564 は body_sha256 / comment freshness による stale 検出を求めています。([GitHub]1) しかし #560/#563 側では、producer-side の body_sha256 出力は out-of-scope 気味で、当面は generated_at と Issue updated_at の比較による stale check が現実的です。([GitHub][7])

    したがって #564 は次のどちらかに倒す必要があります。

    1. producer 契約を別 Issue に切る
      issue-contract-review が body_sha256 を必ず emit するようにする。その Issue が merge されるまで 実装: issue-refinement-loop と impl-review-loop の implementation-ready handoff を contract gate 化する #564 は blocked。

    2. consumer fallback を仕様化する
      body_sha256 がある場合は hash 比較。ない場合は generated_at < issue.updated_at を stale_contract_review とする。ただしこれは edit noise に弱い暫定判定。

    この明記がないと、実装者は「body_sha256 がない古い go comment」を valid として通すか、逆に全件 stale にして運用を止めます。


    Blocker 4: REQUEST_CHANGES の意味が未定義

    #564 は「REQUEST_CHANGES 後の stale go」を止めたい趣旨ですが、REQUEST_CHANGES の source が曖昧です。GitHub には issue comments、PR review comments、timeline events、review state など複数のイベント面があります。Issue comments API は issue/PR の一般コメントを扱い、PR も issue として扱われますが、PR の line review comment や review state は別面です。([GitHub Docs][8])

    最低限、次を定義してください。

    request_changes_marker:
      source: issue_comment
      accepted_forms:
        - fenced_yaml: REVIEW_RESULT_V1.status == request_changes
        - literal_heading: "REQUEST_CHANGES"
      target_issue_url_must_match: true
      ordering_key:
        - created_at
        - id
      edited_comment_policy: updated_at != created_at を stale 扱いするか、updated_at で再評価するか

    個人的には、free text の REQUEST_CHANGES 検出は避けるべきです。CONTRACT_REVIEW_RESULT_V1 と同様に machine-readable block に寄せるべきです。free text は引用・例示・過去ログで false positive になります。


    Blocker 5: failure reason の優先順位がない

    #564 の failure subreason は並んでいますが、複数同時に成立する場合の precedence がありません。これは regression test の不安定化要因です。

    推奨 precedence はこれです。

    1. malformed_contract_review
    2. metadata_not_ready
    3. missing_contract_go
    4. stale_contract_review
    5. body_snapshot_mismatch
    6. request_changes_after_go
    7. pass
    

    ただし request_changes_after_go は #564 の列挙にありません。追加を推奨します。REQUEST_CHANGES 後に古い go が残っている状態を stale_contract_review に混ぜると、原因が「Issue body が変わった」のか「review verdict が更新された」のか分からなくなります。


    Blocker 6: metadata gate は GitHub の権限・確認仕様を考慮すべき

    #564 は title prefix、phase label、dependency freshness を扱います。GitHub REST API では issue labels は update 時に replace され、push access がない場合 label 変更が silent drop され得ます。([GitHub Docs][9]) Label 取得は issue/PR 共通の issue endpoint 面で扱われます。([GitHub Docs][10])

    したがって、将来 automation で title/label を直すなら、mutation 後に必ず read-back verification が必要です。#564 は automation 自体を out-of-scope にしていますが、gate としては read-only に固定し、metadata_not_ready で止めるのが安全です。

    dependency についても、本文中の Depends on 文字列だけに頼らず、GitHub の issue dependencies API を使えるなら native dependency を正とすべきです。GitHub REST には “blocked by” dependencies を list/add/remove する endpoint が存在します。([GitHub Docs][11])


    推奨する再設計

    #564 は次のように scope を狭めるのがよいです。

    issue_564_reframe:
      responsibility: impl-review-loop consumer-side intake gate
      not_responsible_for:
        - issue-contract-review producer implementation
        - issue-refinement-loop final gate if #560/#563 is merged
        - title/label mutation automation
        - PR review state aggregation
      required_behavior:
        - impl-review-loop must not auto-run issue-contract-review
        - impl-review-loop must fail closed without latest valid go
        - failure must be machine-readable
        - parser must ignore examples, quotes, and non-fenced YAML
        - fixtures must be hermetic, not live GitHub dependent

    追加する machine-readable result はこの程度まで具体化した方がよいです。

    INTAKE_GATE_RESULT_V1:
      status: pass | fail
      termination_reason: null | intake_gate_failed
      subreason:
        - null
        - malformed_contract_review
        - metadata_not_ready
        - missing_contract_go
        - stale_contract_review
        - body_snapshot_mismatch
        - request_changes_after_go
      checked_issue_number: 564
      contract_snapshot_url: null
      latest_go_comment_id: null
      latest_blocking_comment_id: null
      body_sha256_expected: null
      body_sha256_actual: null
      metadata:
        title_prefix_ok: true
        phase_implementation_label_ok: true
        dependencies_closed: true
      freshness:
        issue_updated_at: "..."
        contract_generated_at: "..."
        comment_created_at: "..."
        comment_updated_at: "..."

    追加すべき regression fixtures

    最低限、以下の fixture を AC に入れてください。

    1. metadata ready / no CONTRACT_REVIEW_RESULT_V1 go
       => intake_gate_failed: missing_contract_go
    
    2. title prefix missing or phase label missing
       => intake_gate_failed: metadata_not_ready
    
    3. older go exists, newer blocked exists
       => missing_contract_go or request_changes_after_go, whichever policy defines
    
    4. go exists, body_sha256 mismatch
       => body_snapshot_mismatch
    
    5. go exists, no body_sha256, issue.updated_at > generated_at
       => stale_contract_review
    
    6. go exists only inside quoted text or example YAML
       => ignored, missing_contract_go
    
    7. comments >100 requiring pagination
       => latest valid result still selected
    
    8. edited go comment where updated_at != created_at
       => explicit policy tested
    
    9. #561-like fixture:
       title/label/dependency are implementation-ready-looking,
       but contract go absent
       => missing_contract_go
    

    GitHub issue comments are paginated, default 30 and max 100 per page, and comment ordering/fields such as id, body, created_at, updated_at are available. Tests should simulate pagination instead of assuming one page.([GitHub Docs][8])


    Issue #564 へのコメント案

    REQUEST_CHANGES
    
    #564 の方向性には賛成ですが、このまま実装に渡すと以下で drift します。
    
    1. #560/#563 と責務が重複しています。#563 が merge 済みなら #564 は impl-review-loop consumer-side intake gate に限定してください。未mergeなら #564 は #563 blocked/rebase 前提を明記してください。
    
    2. Allowed Paths が現行 repo と合っていません。
       `.claude/skills/impl-review-loop/references/preparation.md` ではなく、
       実体は `.claude/skills/impl-review-loop/steps/preparation.md` です。
    
    3. 現行 impl-review-loop preparation は go comment がない場合に issue-contract-review を auto-run します。
       #564 の `missing_contract_go` / `intake_gate_failed` と衝突するため、
       fail-only gate にするのか auto-materialization を残すのかを明記してください。
       推奨は fail-only gate です。
    
    4. `body_sha256` は producer-side contract が未確定です。
       `issue-contract-review` が必ず body_sha256 を emit する前提にするなら別 Issue dependency が必要です。
       そうでないなら `generated_at < issue.updated_at` fallback を仕様化してください。
    
    5. `REQUEST_CHANGES` の source/grammar/order が未定義です。
       free text 検出ではなく machine-readable block を推奨します。
       少なくとも source, accepted marker, issue_url match, ordering key, edited comment policy を定義してください。
    
    6. failure subreason の precedence がありません。
       `metadata_not_ready`, `missing_contract_go`, `stale_contract_review`,
       `body_snapshot_mismatch`, `request_changes_after_go` の優先順位を AC に入れてください。
    
    7. `.claude/skills/**` を触るため、PR では Safety Claim Matrix または not-safety-claim-change の明示を必須にしてください。
    
    推奨 reframe:
    - #564 は `impl-review-loop` の intake gate 実装に限定
    - `impl-review-loop` は `issue-contract-review` を自動実行しない
    - latest valid `CONTRACT_REVIEW_RESULT_V1.status: go` がない場合は fail closed
    - result は `INTAKE_GATE_RESULT_V1` として machine-readable に出す
    - tests は live GitHub に依存しない hermetic fixtures にする

    最終判断

    #564 は「正しい問題」を扱っています。ただし現在の Issue contract は、gate producer / gate consumer / metadata automation / refinement-loop termination を一つに混ぜています。

    実装前に次の 4 点を直せば、かなり品質が上がります。

    1. 実装: issue-refinement-loop の完了条件に issue-contract-review gate を追加し VC 差分性違反を refinement 中に検出する #560/docs(#560): establish final gate, VC diff rules, preflight-scope per-command, stale-result invalidation #563 との依存関係を明記する
    2. Allowed Paths を現行 repo に合わせる
    3. impl-review-loop は auto-run ではなく fail-only intake gate にする
    4. body_sha256 と REQUEST_CHANGES の machine-readable 契約を定義する

    この修正なしで進めると、また approved / go / implementation-ready の意味が loop 間でズレます。

    # 既存衝突確認
    git worktree list | grep "$WORKTREE" && echo "[WARN] worktree 既存" || echo "[OK] worktree 未作成"
    git branch --list "$BRANCH" && echo "[WARN] branch 既存" || echo "[OK] branch 未作成"
    ```

    既存衝突あり → 過去のイテレーションの残骸の可能性。人間判断を仰ぐ。

    ## 4. Product Spec Gate 評価完了後の LOOP_STATE 初期化

    Product Spec Check 評価(1-d)を完了後、iteration = 0 で以下の状態で開始:

    ```yaml
    LOOP_STATE:
    issue_number:
    contract_snapshot_url:
    contract_snapshot_source: provided | detected_existing | materialized_by_issue_contract_review
    iteration: 0
    max_iterations: 3
    worktree: .claude/worktrees/issue-<番号>-
    branch: worktree-issue-<番号>-
    last_step: null
    last_loop_verdict: null
    blockers_history: []
    external_research_skip_basis: null
    termination_reason: null
    product_spec_preflight:
    source: contract_snapshot.checks.product_spec_check
    applicability: applicable | not_applicable | missing
    decision: pass | fail | human_judgment | missing
    blocked_rule_ids: []
    contract_snapshot_url: ""
    body_sha256: ""
    routing_action: continue | stop_human | refresh_contract_snapshot
    ```

    routing_action が stop_human または refresh_contract_snapshot の場合は、ループを開始せず人間判断へ escalate する。

    ## 5. 外部仕様調査スキップ判断(任意)

    internal-only 変更(src/state / src/systems 内の純粋ロジック変更等)なら external_research_skip_basis に理由を記録してスキップ。
    外部仕様が絡む場合は gemini-cli-headless-delegation を先行起動して情報を集める。

    ## 出力

    LOOP_STATE 初期値を会話履歴に明示記録し、Step 1(Implementation)へ進む。
    "
    [7]: https://raw.githubusercontent.com/squne121/loop-protocol/worktree-issue-560-issue-refinement-loop-issue-contract-rev/.claude/skills/issue-refinement-loop/references/termination-policy.md "raw.githubusercontent.com"
    [8]: https://docs.github.com/rest/issues/comments "REST API endpoints for issue comments - GitHub Docs"
    [9]: https://docs.github.com/rest/issues/issues "REST API endpoints for issues - GitHub Docs"
    [10]: https://docs.github.com/rest/issues/labels "REST API endpoints for labels - GitHub Docs"
    [11]: https://docs.github.com/en/rest/issues/issue-dependencies "REST API endpoints for issue dependencies - GitHub Docs"

  2. squne121 commented on Jun 2, 2026

    @squne121
    OwnerAuthor

    Contract Snapshot (2026-06-02T03:54:00Z)

    • Outcome: .claude/skills/issue-refinement-loop/ の終了状態に refinement_approved_gate_pending / implementation_ready 区分が追加され、.claude/skills/impl-review-loop/steps/preparation.md に CONTRACT_REVIEW_RESULT_V1 status: go 必須 intake gate と intake_gate_failed 4 サブ理由・body_sha256 freshness チェック・go 無効化 marker 定義が追記され、regression fixture が .claude/skills/impl-review-loop/tests/ に追加された状態で pnpm test / pnpm build が PASS している。
    • Acceptance Criteria:
      1. AC1: refinement_approved_gate_pending 状態が issue-refinement-loop 定義に追加、issue-reviewer approve だけでは implementation_ready を返さないことが明文化
      2. AC2: impl-review-loop preparation に CONTRACT_REVIEW_RESULT_V1 status: go 必須入力明記、intake_gate_failed と 4 サブ理由の優先順位が定義
      3. AC3: title prefix (実装: / implement:) または phase/implementation label 欠落 Issue が intake_gate_failed: metadata_not_ready になることが定義
      4. AC4: go コメントの freshness チェックが preparation gate に定義(body_sha256 / generated_at < issue.updated_at フォールバック)
      5. AC5: go 無効化 marker が machine-readable block として定義(REVIEW_RESULT_V1.status == request_changes fenced yaml 形式)
      6. AC6: 実装: WSL2/Ubuntu human playtest 実行環境 runbook と preflight を追加する #561 型 regression fixture が .claude/skills/impl-review-loop/tests/ に追加
      7. AC7: pnpm test PASS(回帰なし)
      8. AC8: pnpm build PASS(回帰なし)
    • Verification Commands: 全 7 rg コマンド(pr_review_only)+ pnpm test / build(runtime_only)、VC preflight: skipped=9, blocked=0, unexpected_pass=0
    • Allowed Paths:
      • .claude/skills/issue-refinement-loop/SKILL.md
      • .claude/skills/issue-refinement-loop/references/termination-policy.md
      • .claude/skills/impl-review-loop/SKILL.md
      • .claude/skills/impl-review-loop/steps/preparation.md
      • .claude/skills/impl-review-loop/tests/(regression fixture 追加先)
    • Worktree: .claude/worktrees/issue-564-issue-refinement-loop-impl-review-loop-i
    • Branch: worktree-issue-564-issue-refinement-loop-impl-review-loop-i
    • VC preflight: baseline fail = 0, 想定外 pass = 0, 実行不可 = 0, skipped = 9 (pr_review_only=7, runtime_only=2)

    CONTRACT_REVIEW_RESULT_V1:
      status: go
      generated_at: "2026-06-02T03:54:00Z"
      generated_by: issue-contract-review
      issue_url: https://github.com/squne121/loop-protocol/issues/564
      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: 0
          vc_skipped: 9
          status: pass
          classifications:
            - ac: AC1
              command: "rg -rn 'refinement_approved_gate_pending' .claude/skills/issue-refinement-loop/"
              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 -rn 'intake_gate_failed' .claude/skills/impl-review-loop/"
              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 -rn 'CONTRACT_REVIEW_RESULT_V1.*go|status.*go.*required|必須入力' .claude/skills/impl-review-loop/"
              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 -rn 'metadata_not_ready|phase/implementation.*label|title.*prefix' .claude/skills/impl-review-loop/"
              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: "rg -rn 'body_sha256|body_snapshot_mismatch|stale_contract_review' .claude/skills/impl-review-loop/"
              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: AC5
              command: "rg -rn 'REQUEST_CHANGES|missing_contract_go|go.*無効' .claude/skills/impl-review-loop/"
              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 -rn '561|refinement_approved_gate_pending|go.*comment.*missing' .claude/skills/impl-review-loop/tests/"
              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: "pnpm test"
              exit_code: null
              category: preflight_scope_runtime_only
              scope_class: runtime_only
              classification: skipped
              confidence: low
              decision: go
              verification_owner: impl-review-loop
              deferred_reason: "VC marked runtime_only; verification deferred to post-implementation runtime"
              runtime_verification_required: true
            - ac: AC8
              command: "pnpm build"
              exit_code: null
              category: preflight_scope_runtime_only
              scope_class: runtime_only
              classification: skipped
              confidence: low
              decision: go
              verification_owner: impl-review-loop
              deferred_reason: "VC marked runtime_only; verification deferred to post-implementation runtime"
              runtime_verification_required: true
        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
          conditions:
            docs_product_requires_spec_evidence:
              status: pass
              evidence: []
            tasks_md_not_direct_source:
              status: pass
              evidence: []
            specify_not_canonical:
              status: pass
              evidence: []
            diff_first_rationale_present:
              status: pass
              evidence: []
            generated_task_trace_present:
              status: pass
              evidence: []
            task_dependencies_materialized:
              status: pass
              evidence: []
          blocked_reasons: []
        worktree_branch_collision: clear
      next_action: implement_issue
      blocked_reasons: []
      warnings: []
      body_sha256: "sha256:4d347f920c780fedaa962f4efbf0f71c7518f6ce39cd729506e13753808a8c6d"
  3. squne121 commented on Jun 2, 2026

    @squne121
    OwnerAuthor

    implement-issue: 実装完了 (2026-06-02T13:00:30Z)

    ```yaml
    IMPLEMENT_RESULT_V1:
    status: ok
    generated_at: "2026-06-02T13:00:30Z"
    generated_by: implement-issue
    issue_url: #564
    pr_url: #568
    worktree: .claude/worktrees/issue-564-issue-refinement-loop-impl-review-loop-i
    branch: worktree-issue-564-issue-refinement-loop-impl-review-loop-i
    verification:
    typecheck: skipped
    lint: skipped
    test:
    passed: 313
    failed: 0
    files: 16
    build: pass
    allowed_paths_compliance: true
    warnings: []
    errors: []
    ```

  4. added 2 commits that reference this issue on Jun 2, 2026
  5. added 3 commits that reference this issue on Jun 3, 2026
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

    phase/implementation

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions