Skip to content

実装: impl-review-loop の contract_snapshot_url を任意化し preparation ステップで status: go を自動検出・自動先行実行する #149

Closed

Description

@squne121

Machine-Readable Contract

contract_schema_version: v1
issue_kind: implementation
parent_issue: none
goal_ref: "impl-review-loop の preparation ステップが contract_snapshot_url 未提供時に issue-contract-review を自動先行実行し、ユーザーが /impl-review-loop N の短文のみでループを開始できるようにする"
change_kind: docs

Parent Issue

なし(単独改善)

Parent Goal Ref

Current Validated Scope

  • impl-review-loop の SKILL.md および steps/preparation.md を更新し、contract_snapshot_url を任意(省略可)とする
  • preparation ステップで Issue コメントを走査し、CONTRACT_REVIEW_RESULT_V1 marker + generated_by: issue-contract-review + status: go の組み合わせで最新の go コメントを検出(文字列のみ拾わない)。存在すれば自動採用。存在しない場合は issue-contract-review を自動先行実行して URL を取得する手順を追加する(idempotency: 既存 go が存在する場合は再実行しない)
  • LOOP_STATE への contract_snapshot_source フィールド(provided | detected_existing | materialized_by_issue_contract_review)追加を明記する

Remaining Parent Gaps

なし(#66 は verify-contract-snapshot.py の実装で別 Allowed Paths。本 Issue は preparation ロジックの変更)

Outcome

impl-review-loop の SKILL.md と steps/preparation.md が更新され、contract_snapshot_url が未提供の場合に preparation ステップが Issue コメントから CONTRACT_REVIEW_RESULT_V1 status: go コメントを自動検出(存在すれば採用、なければ issue-contract-review を自動呼び出し)するよう明文化された状態が main にマージされている。

In Scope

  • SKILL.md の Inputs セクションで contract_snapshot_url を「任意(省略時は preparation ステップで自動取得)」に変更
  • steps/preparation.md のステップ 1 に「contract_snapshot_url 未提供時の自動取得フロー」を追記:
    1. Issue コメントを gh issue view <N> --comments で取得し、CONTRACT_REVIEW_RESULT_V1 marker + generated_by: issue-contract-review + status: go の組み合わせで最新コメント URL を抽出(文字列のみ拾わない)
    2. 存在すれば採用(contract_snapshot_url に設定)— 既存 go が存在する場合は issue-contract-review を再実行しない(idempotency)
    3. 存在しなければ issue-contract-review skill を先行実行し、生成された contract-snapshot コメント URL を採用
  • preparation に「最新 CONTRACT_REVIEW_RESULT_V1 status: blocked が存在する場合は古い status: go を採用せず停止する」規則を追加
  • LOOP_STATE に contract_snapshot_source フィールド(provided | detected_existing | materialized_by_issue_contract_review)を追加

Out of Scope

Acceptance Criteria

  • AC1: impl-review-loop/SKILL.md の Inputs セクションで contract_snapshot_url が「任意」と明記されている
  • AC2: impl-review-loop/steps/preparation.md のステップ 1 に「contract_snapshot_url 未提供時は Issue コメントから CONTRACT_REVIEW_RESULT_V1 status: go URL を自動検出し(generated_by: issue-contract-review + status: go の組み合わせ)、なければ issue-contract-review を先行実行する」フローが記載されている
  • AC3: 既存の contract_snapshot_url 必須チェック記述が削除または「任意」に変更されている
  • AC4: LOOP_STATE に contract_snapshot_source フィールド(provided | detected_existing | materialized_by_issue_contract_review)が追加され、いずれかを区別できる
  • AC5: preparation に「最新 CONTRACT_REVIEW_RESULT_V1 status: blocked が存在する場合は古い status: go を採用せず停止する」規則がある
  • AC6: contract_snapshot_url 未提供時の issue-contract-review 先行実行は、既存 status: go が存在しない場合に限ると明記されている(idempotency 保証)
  • AC7: docs: AI agent session 記録ツールの人間導入手順サジェスト (tool-onboarding/session-recording.md) #245 の ready tuple / label drift は本 Issue のスコープ外であり、本 Issue は contract snapshot materialization のみ扱うと明記されている

Verification Commands

  • rg -n "contract_snapshot_url.*任意|任意.*contract_snapshot_url" .claude/skills/impl-review-loop/SKILL.md # AC1: contract_snapshot_url が任意表記か確認(max_iterations の任意表記との混同を防ぐため対象フィールドを限定)
  • rg -n "status: go" .claude/skills/impl-review-loop/steps/preparation.md && rg -n "generated_by.*issue-contract-review" .claude/skills/impl-review-loop/steps/preparation.md # AC2: 自動検出フロー(status: go + generated_by 組み合わせ)が記載されているか
  • rg -n "必須" .claude/skills/impl-review-loop/SKILL.md | rg -v "issue_number" # AC3: 必須表記が削除・変更されているか(一致なし = 変更済み)
  • rg -n "contract_snapshot_source" .claude/skills/impl-review-loop/steps/preparation.md # AC4: contract_snapshot_source フィールドが追加されているか
  • rg -n "status: blocked" .claude/skills/impl-review-loop/steps/preparation.md # AC5: blocked 時停止規則が記載されているか
  • rg -n "idempotent|idempotency|再実行しない|既存.*go" .claude/skills/impl-review-loop/steps/preparation.md # AC6: idempotency 保証が明記されているか
  • rg -rn "label drift" .claude/skills/impl-review-loop/ # AC7: docs: AI agent session 記録ツールの人間導入手順サジェスト (tool-onboarding/session-recording.md) #245 スコープ外(label drift は docs: AI agent session 記録ツールの人間導入手順サジェスト (tool-onboarding/session-recording.md) #245 関連語。一致なし = Out of Scope 確認済み。ready tuple は preparation.md Step 2 で正当な用途のため対象外)

Runtime Verification Applicability

decision: not_applicable
reason: "本 Issue は .md ファイル 2 件(SKILL.md / preparation.md)の docs 変更のみ。コード・スクリプト変更なし。ランタイム検証は不要。"

Allowed Paths

  • .claude/skills/impl-review-loop/SKILL.md
  • .claude/skills/impl-review-loop/steps/preparation.md

Stop Conditions

  • Allowed Paths 外の変更が必要と判明した場合
  • Python / bash スクリプトの新規実装が必要になった場合(本 Issue は docs 変更のみ)
  • issue-contract-review skill 自体への変更が必要になった場合
  • 新規 Issue の起票やスコープ分割が必要と判断した場合
  • nested SubAgent delegation が必要になった場合
  • ADR 起票が必要な設計判断が発生した場合

Required Skills

なし

Delivery Rule

  • 1 Issue = 1 PR 原則
  • Worktree: .claude/worktrees/issue-<N>-<slug>
  • Draft PR 既定

Notes

Activity

  1. added
    enhancement
    state/queued
    on May 21, 2026
  2. squne121 commented on May 21, 2026

    @squne121
    OwnerAuthor

    create-issue transaction partial-failure

    Issue: #149
    Failure stage: label-readback
    Message: label read-back mismatch

    Requested:

    • labels: enhancement,state/queued
    • parent: (none)
    • dependencies: (none)
      Completed steps: create, label

    Failure context:
    matching_issue_numbers=[149]
    issue_number=149

    Recovery hint: label-readback failed for #149.
    Manual re-apply command (idempotent: yes):
    gh issue edit 149 --repo squne121/loop-protocol --add-label
    Verify:
    gh issue view 149 --repo squne121/loop-protocol --json labels

    Please recover deterministically before re-running the create issue transaction.

  3. squne121 commented on May 23, 2026

    @squne121
    OwnerAuthor

    PR #240 実体験の追記 (2026-05-23)

    本 Issue の背景として、PR #240(Issue #83 impl-review-loop)実施中に以下の事例が発生しました:

    • impl-review-loop に contract_snapshot_url なしで呼び出しがあり、orchestrator が独自判断で先行 issue-contract-review を実行して対応した
    • この判断フローが SKILL.md に明示されていないため、毎回 orchestrator の個別判断に依存している状態

    本 Issue(#149)はこの問題をより広いスコープ(contract_snapshot_url 任意化 + status: go 自動検出フロー)で解決する設計になっており、今回の観察はその必要性を裏付けます。

    dedupe_key: follow-up:squne121/loop-protocol:pr/240:contract-snapshot-url-auto-trigger
    source: #240

  4. squne121 commented on May 24, 2026

    @squne121
    OwnerAuthor

    #245 の preflight で再現したため、#149 を canonical destination として再利用したいです。

    再現内容

    • issue 本文は implementation contract を満たしている
    • check_blockers.sh は PASS
    • しかし impl-review-loop の preparation は contract_snapshot_url を必須 Input として扱うため、## Contract Snapshot / status: go comment が未作成の時点で main session 側が手動で止まりやすい
    • 実運用上は /impl-review-loop <issue-number> の短文起動時に URL が渡されないケースが自然で、issue-contract-review を先行実行して URL を materialize する責務は orchestrator 側にある

    今回の具体例

    補足

    この comment は duplicate 起票の代わりに、#149 の再現証跡として追加しています。ready tuple / label drift 側は別 issue で扱います。

  5. squne121 commented on May 24, 2026

    @squne121
    OwnerAuthor

    判定

    #149 を canonical destination として再利用する判断は妥当です。#240 と #245 の両方で同じ UX 欠陥、つまり「/impl-review-loop <issue-number> の自然な短文起動に対し、contract_snapshot_url 必須が main session を止める」問題が再現しています。#149 本文も、contract_snapshot_url 任意化、既存 status: go コメント自動検出、なければ issue-contract-review 先行実行、という解決方向を既に持っています。

    ただし、現状の #149 はこのまま実装すると REQUEST_CHANGES 相当です。理由は、現在の main では impl-review-loop/SKILL.md がまだ contract_snapshot_url を必須 Input として扱い、preparation.md も「不一致なら issue-contract-review を先に通すよう人間に提案して停止」となっており、今回の問題をまさに再発させる状態だからです。

    敵対的レビュー

    B1. status: go 自動検出の定義が粗い

    #149 の現在案は「Issue コメントを走査し、最新の CONTRACT_REVIEW_RESULT_V1 status: go コメント URL を抽出」としていますが、これだけでは危険です。status: go という文字列だけを拾うと、古い snapshot、引用、blocked 後に残った go、別コメント内の説明文を誤採用する可能性があります。issue-contract-review は CONTRACT_REVIEW_RESULT_V1 を機械可読出力として定義しているため、検出条件はこの marker + YAML parse + generated_by: issue-contract-review + status: go に限定すべきです。

    修正方針:

    contract_snapshot_detection:
      source: issue_comments
      required_marker: CONTRACT_REVIEW_RESULT_V1
      required_fields:
        status: go
        generated_by: issue-contract-review
        issue_url: current_issue_url
      sort_order: generated_at desc, updated_at desc
      accept_latest_go_only_if:
        - no newer CONTRACT_REVIEW_RESULT_V1 status: blocked exists
        - issue_url matches current issue
      otherwise: run_issue_contract_review_or_stop

    B2. 自動先行実行は side effect なので、idempotency が必要

    issue-contract-review は status: go 時に contract-snapshot コメントを投稿する設計です。つまり、impl-review-loop が自動で先行実行すると GitHub comment mutation が発生します。これは workflow 上は許容してよいですが、「何度も同じ snapshot コメントを増殖させない」設計がないと、Issue コメントがノイズ化します。

    現スコープが docs-only なら、最低限 preparation.md に以下を明記すべきです。

    `contract_snapshot_url` 未提供時は、まず既存コメントを再利用する。
    既存の `CONTRACT_REVIEW_RESULT_V1 status: go` が存在しない場合のみ
    `issue-contract-review` を先行実行する。再実行後は新規または更新された
    contract snapshot comment URL を取得して LOOP_STATE に保存する。

    高品質化するなら、docs-only ではなく小さな helper script を追加した方がよいです。Codex の Agent Skills 公式 docs でも、skill は instructions / resources / optional scripts を束ねる形式で、決定論的処理や外部 tooling が必要な場合は scripts を使う方が適しています。([OpenAI デベロッパー]1)

    B3. LOOP_STATE が更新されていない

    LOOP_STATE には現在 contract_snapshot_url しかありません。自動 materialize を入れるなら、後続レビューで「渡された URL なのか、自動検出なのか、自動生成なのか」が追跡できないと監査不能です。

    追加すべきです。

    LOOP_STATE:
      contract_snapshot_url: <URL>
      contract_snapshot_source: provided | detected_existing | materialized_by_issue_contract_review
      contract_snapshot_generated_at: <ISO8601|null>
      contract_snapshot_comment_id: <int|null>
      contract_snapshot_status: go | blocked | unknown

    B4. #245 の再現証跡は有効だが、#149 だけでは #245 は進まない

    #245 は docs: title で、labels も kind/implementation, area/docs, area/ai-ops です。一方、現行 preparation.md は canonical ready tuple として title prefix 実装: または implement:、label phase/implementation を期待しています。

    したがって、#149 が直っても、#245 は別件の ready tuple / label drift で停止する可能性が残ります。今回のコメントが「ready tuple / label drift 側は別 issue」と切っているのは正しいですが、#149 本文にも “この修正は contract snapshot materialization のみを扱い、ready tuple 判定は変更しない” と明記した方がよいです。

    B5. #240 の観察と #149 の関係は強い

    PR #240 は #83 の runtime verification 改善 PRですが、PR 本文内で impl-review-loop 実行中に contract_snapshot_url 未提供時の先行 issue-contract-review 自動起動が SKILL.md に明示されていない、と明記しています。これは #149 の出所である PR #141 の観察と同じ系統の再発です。

    つまり #149 は単なる UX 改善ではなく、orchestrator の責務境界不備です。impl-review-loop が control-plane なら、contract snapshot の materialization は preparation の routing 責務に含めるべきです。

    #149 の高品質化パッチ方針

    最小修正

    Allowed Paths を維持するなら、次の 2 ファイルだけでよいです。

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

    SKILL.md の Inputs はこう変えるべきです。

    - `issue_number`(必須): implementation child issue 番号
    - `contract_snapshot_url`(任意):
      `issue-contract-review` で `status: go` を返したコメント URL。
      未提供時は `steps/preparation.md` が既存 `CONTRACT_REVIEW_RESULT_V1 status: go`
      コメントを検出し、存在しなければ `issue-contract-review` を先行実行して materialize する。
    - `max_iterations`(任意、デフォルト 5)

    preparation.md の Step 1 は、停止ではなく state machine にすべきです。

    ## 1. Inputs / contract snapshot materialization
    
    1. `issue_number` を確認する。
    2. `contract_snapshot_url` が提供されている場合:
       - comment body を取得する
       - `CONTRACT_REVIEW_RESULT_V1.status == go` を parse して確認する
       - 不一致なら停止し、人間判断
    3. `contract_snapshot_url` が未提供の場合:
       - Issue comments から最新の `CONTRACT_REVIEW_RESULT_V1` を走査する
       - 最新有効 snapshot が `status: go` なら採用する
       - 最新有効 snapshot が `status: blocked` なら停止する
       - 有効 snapshot が存在しなければ `issue-contract-review <issue_number>` を先行実行する
       - 実行後、生成された `status: go` comment URL を取得して採用する
       - `status: blocked` の場合は実装へ進まない
    
    4. `LOOP_STATE.contract_snapshot_source` に
       `provided | detected_existing | materialized_by_issue_contract_review`
       のいずれかを記録する。

    強い修正

    長期的には helper script を追加した方がよいです。理由は、GitHub comments の並び替え、YAML parse、blocked/go precedence、comment URL 抽出を自然言語手順だけに置くと、また orchestrator の裁量に戻るためです。Claude Code / Codex の skill 仕様はいずれも SKILL.md を entrypoint とし、supporting files/scripts を組み合わせて再利用 workflow を安定化させる前提です。([Claude API Docs]2) ([OpenAI デベロッパー]1)

    追加候補:

    .claude/skills/impl-review-loop/scripts/resolve_contract_snapshot.py
    

    入力:

    python3 .claude/skills/impl-review-loop/scripts/resolve_contract_snapshot.py \
      --repo squne121/loop-protocol \
      --issue 149 \
      --provided-url "$contract_snapshot_url"

    出力:

    CONTRACT_SNAPSHOT_RESOLUTION_V1:
      status: resolved | needs_materialization | blocked | invalid
      contract_snapshot_url: <url|null>
      source: provided | detected_existing | materialized_by_issue_contract_review | none
      latest_contract_review_status: go | blocked | none
      comment_id: <int|null>
      generated_at: <ISO8601|null>
      reason: <string>

    ただしこれは #149 の Out of Scope「自動検出スクリプト新規実装なし」と衝突します。高品質化を優先するなら、#149 の Allowed Paths / Out of Scope を拡張するか、#149 は docs-only の短期修正、follow-up で script 化、という分割が妥当です。

    #149 に追加すべき AC

    現在の AC1〜AC3 だけだと、「任意化された」ことは検査できますが、誤った snapshot 採用や blocked 後の go 採用を防げません。追加を推奨します。

    - [ ] AC4: `LOOP_STATE` に `contract_snapshot_source` が追加され、
          provided / detected_existing / materialized_by_issue_contract_review を区別できる
    - [ ] AC5: preparation に「最新 `CONTRACT_REVIEW_RESULT_V1 status: blocked` が存在する場合は
          古い `status: go` を採用せず停止する」規則がある
    - [ ] AC6: `contract_snapshot_url` 未提供時の `issue-contract-review` 先行実行は、
          既存 `status: go` が存在しない場合に限ると明記されている
    - [ ] AC7: #245 の ready tuple / label drift は本 Issue のスコープ外であり、
          本 Issue は contract snapshot materialization のみ扱うと明記されている

    検証コマンド例:

    rg -n "contract_snapshot_url.*任意|optional" .claude/skills/impl-review-loop/SKILL.md
    rg -n "CONTRACT_REVIEW_RESULT_V1|status: go|status: blocked" .claude/skills/impl-review-loop/steps/preparation.md
    rg -n "contract_snapshot_source|provided|detected_existing|materialized_by_issue_contract_review" .claude/skills/impl-review-loop/SKILL.md .claude/skills/impl-review-loop/steps/preparation.md
    rg -n "ready tuple|label drift|scope.*out|スコープ外" .claude/skills/impl-review-loop/steps/preparation.md

    最終提案

    このコメントは duplicate 起票ではなく #149 の再現証跡として残すのが正しいです。ただし、#149 本体は次のように強化してください。

    decision:
      canonical_destination: "#149"
      comment_validity: keep_as_reproduction_evidence
      implementation_readiness: request_changes
      required_fix:
        - make contract_snapshot_url optional
        - detect latest valid CONTRACT_REVIEW_RESULT_V1 status: go
        - fail-closed if latest valid status is blocked
        - auto-run issue-contract-review only when no valid go snapshot exists
        - record contract_snapshot_source in LOOP_STATE
        - keep #245 ready tuple / label drift out of scope
      stronger_followup:
        - deterministic resolver script for comment parsing and URL extraction

    #149 は「URL を任意にする」Issue ではなく、orchestrator preparation が contract snapshot を materialize する責務を持つことを明文化する Issueとして扱うべきです。これを入れないと、#240/#245 と同じく main session の個別判断に戻ります。

  6. removed
    state/queued
    on May 24, 2026
  7. squne121 commented on May 24, 2026

    @squne121
    OwnerAuthor

    edit-issue: Issue #149 本文更新 (review-issue needs-fix 対応)

    変更セクション一覧

    セクション 変更内容
    In Scope 検出条件を強化(CONTRACT_REVIEW_RESULT_V1 marker + generated_by: issue-contract-review + status: go の組み合わせ)、idempotency 明記、status: blocked 停止規則追加、contract_snapshot_source フィールド追加
    Out of Scope 「#245 の ready tuple / label drift は対象外。本 Issue は contract snapshot materialization のみを扱う」を追加
    Acceptance Criteria AC4〜AC7 を追加(contract_snapshot_source フィールド / blocked 停止規則 / idempotency 保証 / #245 スコープ外)
    Verification Commands grep 形式から rg -n 実行可能形式に統一、各 AC に 1 対 1 対応するコマンドに整理(AC1〜AC7 各 1 行)
    Runtime Verification Applicability 新規セクション追加: applicability: not_applicable(docs 変更のみ、コード変更なし)

    変更理由

    review-issue フィードバックへの対応:

    Guard 結果サマリ

    all_passed: true
    guards:
      template_guard: pass
      outcome_quality_guard: pass
      diff_threshold: pass (orig=102 lines, new=106 lines)
      ac_vc_alignment: pass (ac_count=7, vc_ac_count=7)

    バックアップ

    tmp/issue_149_backup_1779592537.md

  8. squne121 commented on May 24, 2026

    @squne121
    OwnerAuthor

    Issue Edit — edit-issue skill 実行記録

    edit_reason: reviewer_feedback (REVIEW_ISSUE_RESULT_V1 verdict: needs-fix)

    変更内容:

    • ## Runtime Verification Applicability セクション内のフィールド名を applicability: → decision: に変更
    • スキーマ正本 (docs/dev/runtime-verification-policy.md) の定義と整合させた
    • 他のセクションへの変更なし

    変更箇所:

    -applicability: not_applicable
    +decision: not_applicable
  9. squne121 commented on May 24, 2026

    @squne121
    OwnerAuthor

    issue-refinement-loop: 完了 (2026-05-24T03:21:53Z)

    • iteration: 2
    • verdict: approve
    • termination_reason: approved
    • 改善履歴:
      • iter 0: AC4〜AC7 追加(contract_snapshot_source / status:blocked 停止規則 / idempotency / docs: AI agent session 記録ツールの人間導入手順サジェスト (tool-onboarding/session-recording.md) #245 スコープ外明記)、VC を rg コマンド形式に修正、Runtime Verification Applicability セクション追加(decision: not_applicable)、In Scope 検出条件強化(CONTRACT_REVIEW_RESULT_V1 + generated_by + status:go の組み合わせ)
      • iter 1: Runtime Verification Applicability フィールド名を applicability: → decision: に修正(schema 正本 runtime-verification-policy.md 準拠)
    FOLLOW_UP_MATERIALIZATION_RESULT_V1:
      follow_up_issues: []
      note_only_observations:
        - dedupe_key: "follow-up:squne121/loop-protocol:pr/262:impl_review_loop_contract_snapshot_fallback"
          source_url: "https://github.com/squne121/loop-protocol/issues/149"
          source_note_id: "review-issue-iter2-non-blocking"
          summary: "Issue #266(impl-review-loop contract_snapshot_url 未指定時の fallback 手順ドキュメント Issue)は OPEN。#149 実装完了後に #266 が duplicate になる可能性がある。#149 PR マージ後に #266 のクローズ判定を推奨。"
    • 次アクション: issue-contract-review を実行して実装着手の preflight を行ってください
  10. squne121 commented on May 24, 2026

    @squne121
    OwnerAuthor

    Contract Review: BLOCKED (2026-05-24T03:29:34Z)

    判定

    VC preflight で AC1・AC7 が構造的に human_judgment となり自動 GO できません。

    不足項目

    AC1 VC: 想定外 pass(VC が under-constraining)

    rg -n "任意|optional" .claude/skills/impl-review-loop/SKILL.md
    # 実行結果:
    # 19:- `max_iterations`(任意、デフォルト 5): 上限回数。...
    # exit: 0

    問題: 実装前に max_iterations の 任意 にマッチして exit 0。実装前後どちらでも exit 0 のため VC が実装を識別できません。
    AC3 の VC が補完的に機能するため semantic は担保されますが、AC1 の VC 単独では preflight 判定不可 → unknown → human_judgment。

    推奨修正(1 行):

    rg -n "contract_snapshot_url.*任意|任意.*contract_snapshot_url" .claude/skills/impl-review-loop/SKILL.md

    AC7 VC: 構造的に pass 不可能(pre-existing content にマッチ)

    rg -rn "ready tuple|label drift" .claude/skills/impl-review-loop/
    # 実行結果:
    # .claude/skills/impl-review-loop/steps/preparation.md:## 2. ready tuple の再確認
    # .claude/skills/impl-review-loop/steps/preparation.md:期待する canonical ready tuple:
    # exit: 0

    問題: preparation.md の Step 2 セクションヘッダ "ready tuple の再確認" が恒久的に存在し、#149 実装後も変わりません。このため AC7 VC は実装前後ともに exit 0 → 期待する exit 1 には永遠に到達不能です。
    AC7 の semantic(#245 スコープ外)は Issue Out of Scope セクションで正しく宣言されていますが、VC が実態とミスマッチしています → unknown → human_judgment。

    推奨修正: label drift だけを対象にするか、AC7 VC を削除して Out of Scope セクションを正本とする

    rg -rn "label drift" .claude/skills/impl-review-loop/
    # または
    rg -n "#245" .claude/skills/impl-review-loop/steps/preparation.md

    通過チェック一覧

    CONTRACT_REVIEW_RESULT_V1:
      status: blocked
      generated_at: "2026-05-24T03:29:34Z"
      generated_by: issue-contract-review
      issue_url: https://github.com/squne121/loop-protocol/issues/149
      checks:
        template_compliance: pass
        state_label: ok
        allowed_paths_present: pass
        vc_present: pass
        stop_conditions_complete: pass
        vc_preflight:
          passed: false
          vc_failed_as_expected: 5  # AC2(compound), AC3, AC4, AC5, AC6
          vc_passed_unexpectedly: 2  # AC1, AC7
          vc_unrunnable: 0
          classifications:
            - ac: AC1
              command: "rg -n \"任意|optional\" .claude/skills/impl-review-loop/SKILL.md"
              exit_code: 0
              category: unknown
              confidence: high
              evidence:
                stdout_excerpt: "19:- `max_iterations`(任意、デフォルト 5):"
                stderr_excerpt: ""
              decision: human_judgment
            - ac: AC2
              command: "rg -n \"status: go\" preparation.md && rg -n \"generated_by.*issue-contract-review\" preparation.md"
              exit_code: 1
              category: expected_baseline_fail
              confidence: high
              evidence:
                stdout_excerpt: "cmd2: no match"
                stderr_excerpt: ""
              decision: go
            - ac: AC3
              command: "rg -n \"必須\" SKILL.md | rg -v \"issue_number\""
              exit_code: 0
              category: expected_baseline_fail
              confidence: high
              evidence:
                stdout_excerpt: "18:- `contract_snapshot_url`(必須):"
                stderr_excerpt: ""
              decision: go
            - ac: AC4
              command: "rg -n \"contract_snapshot_source\" preparation.md"
              exit_code: 1
              category: expected_baseline_fail
              confidence: high
              evidence:
                stdout_excerpt: ""
                stderr_excerpt: ""
              decision: go
            - ac: AC5
              command: "rg -n \"status: blocked\" preparation.md"
              exit_code: 1
              category: expected_baseline_fail
              confidence: high
              evidence:
                stdout_excerpt: ""
                stderr_excerpt: ""
              decision: go
            - ac: AC6
              command: "rg -n \"idempotent|idempotency|再実行しない|既存.*go\" preparation.md"
              exit_code: 1
              category: expected_baseline_fail
              confidence: high
              evidence:
                stdout_excerpt: ""
                stderr_excerpt: ""
              decision: go
            - ac: AC7
              command: "rg -rn \"ready tuple|label drift\" .claude/skills/impl-review-loop/"
              exit_code: 0
              category: unknown
              confidence: high
              evidence:
                stdout_excerpt: "preparation.md:## 2. ready tuple の再確認 (pre-existing, won't change)"
                stderr_excerpt: ""
              decision: human_judgment
        ac_verifiability: pass
        worktree_branch_collision: clear
      next_action: human_judgment
      blocked_reasons:
        - "AC1 VC: pre-existing '任意' (max_iterations) にマッチして expected baseline fail にならず。VC が実装前後を識別不可能"
        - "AC7 VC: pre-existing 'ready tuple の再確認' (preparation.md step 2) が恒久的にマッチし、VC が構造的に pass 不可能"
      warnings: []

    推奨アクション

    最小修正(Issue #149 本文の VC 2 行を変更するだけ):

    1. AC1 VC を以下に変更:
      rg -n "contract_snapshot_url.*任意|任意.*contract_snapshot_url" .claude/skills/impl-review-loop/SKILL.md
    2. AC7 VC を以下に変更(label drift のみで ready tuple は除外):
      rg -rn "label drift" .claude/skills/impl-review-loop/

    Issue 本文 VC を修正後、再度 issue-contract-review を実行してください。


    他のすべてのチェック(template, blockers, Stop Conditions, AC2-AC6 VC, worktree/branch)は PASS です。

  11. squne121 commented on May 24, 2026

    @squne121
    OwnerAuthor

    Contract Snapshot (2026-05-24T03:29:34Z)

    • Outcome: impl-review-loop/SKILL.md と steps/preparation.md が更新され、contract_snapshot_url が未提供の場合に preparation ステップが Issue コメントから CONTRACT_REVIEW_RESULT_V1 status: go コメントを自動検出(存在すれば採用、なければ issue-contract-review を自動呼び出し)するよう明文化された状態が main にマージされている
    • Acceptance Criteria:
      • AC1: SKILL.md Inputs で contract_snapshot_url が「任意」と明記
      • AC2: preparation.md に contract_snapshot_url 未提供時の自動検出フロー(CONTRACT_REVIEW_RESULT_V1 status: go + generated_by: issue-contract-review)が記載
      • AC3: 既存の contract_snapshot_url 必須チェック記述が削除または「任意」に変更
      • AC4: LOOP_STATE に contract_snapshot_source フィールド追加
      • AC5: preparation に status: blocked 存在時は古い status: go を採用せず停止する規則
      • AC6: idempotency 保証(既存 status: go 存在時は issue-contract-review 再実行しない)が明記
      • AC7: docs: AI agent session 記録ツールの人間導入手順サジェスト (tool-onboarding/session-recording.md) #245 の ready tuple / label drift は本 Issue スコープ外と明記
    • Verification Commands:
      • rg -n "contract_snapshot_url.*任意|任意.*contract_snapshot_url" .claude/skills/impl-review-loop/SKILL.md
      • rg -n "status: go" .claude/skills/impl-review-loop/steps/preparation.md && rg -n "generated_by.*issue-contract-review" .claude/skills/impl-review-loop/steps/preparation.md
      • rg -n "必須" .claude/skills/impl-review-loop/SKILL.md | rg -v "issue_number"
      • rg -n "contract_snapshot_source" .claude/skills/impl-review-loop/steps/preparation.md
      • rg -n "status: blocked" .claude/skills/impl-review-loop/steps/preparation.md
      • rg -n "idempotent|idempotency|再実行しない|既存.*go" .claude/skills/impl-review-loop/steps/preparation.md
      • rg -rn "label drift" .claude/skills/impl-review-loop/
    • Allowed Paths:
      • .claude/skills/impl-review-loop/SKILL.md
      • .claude/skills/impl-review-loop/steps/preparation.md
    • Worktree: .claude/worktrees/issue-149-go
    • Branch: worktree-issue-149-go
    • VC preflight: baseline fail = 6, 想定外 pass = 0, 実行不可 = 0
    CONTRACT_REVIEW_RESULT_V1:
      status: go
      generated_at: "2026-05-24T03:29:34Z"
      generated_by: issue-contract-review
      issue_url: https://github.com/squne121/loop-protocol/issues/149
      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: 6
          vc_passed_unexpectedly: 0
          vc_unrunnable: 0
          classifications:
            - ac: AC1
              command: "rg -n \"contract_snapshot_url.*任意|任意.*contract_snapshot_url\" .claude/skills/impl-review-loop/SKILL.md"
              exit_code: 1
              category: expected_baseline_fail
              confidence: high
              evidence:
                stdout_excerpt: "(no match)"
                stderr_excerpt: ""
              decision: go
            - ac: AC2
              command: "rg -n \"status: go\" preparation.md && rg -n \"generated_by.*issue-contract-review\" preparation.md"
              exit_code: 1
              category: expected_baseline_fail
              confidence: high
              evidence:
                stdout_excerpt: "cmd2 no match: generated_by"
                stderr_excerpt: ""
              decision: go
            - ac: AC3
              command: "rg -n \"必須\" SKILL.md | rg -v \"issue_number\""
              exit_code: 0
              category: expected_baseline_fail
              confidence: high
              evidence:
                stdout_excerpt: "18: contract_snapshot_url(必須)"
                stderr_excerpt: ""
              decision: go
            - ac: AC4
              command: "rg -n \"contract_snapshot_source\" preparation.md"
              exit_code: 1
              category: expected_baseline_fail
              confidence: high
              decision: go
            - ac: AC5
              command: "rg -n \"status: blocked\" preparation.md"
              exit_code: 1
              category: expected_baseline_fail
              confidence: high
              decision: go
            - ac: AC6
              command: "rg -n \"idempotent|idempotency|再実行しない|既存.*go\" preparation.md"
              exit_code: 1
              category: expected_baseline_fail
              confidence: high
              decision: go
            - ac: AC7
              command: "rg -rn \"label drift\" .claude/skills/impl-review-loop/"
              exit_code: 1
              category: expected_baseline_fail
              confidence: high
              decision: go
        ac_verifiability: pass
        worktree_branch_collision: clear
      next_action: implement_issue
      blocked_reasons: []
      warnings:
        - "AC1・AC7 の VC を VC 品質修正のため Issue 本文で更新済み(contract_snapshot_url に特定化 / ready tuple 除外)"
  12. squne121 commented on May 24, 2026

    @squne121
    OwnerAuthor

    implement-issue: 実装完了 (2026-05-24T03:36:26Z)

  13. added a commit that references this issue on May 24, 2026
  14. squne121 commented on May 24, 2026

    @squne121
    OwnerAuthor

    Iteration 1 Fix 完了

    PR #344 の REQUEST_CHANGES に対応する 4 blocker をすべて修正しました。同じ branch / worktree に修正コミットを追加して push 済みです。

    修正内容

    Blocker 1: gh issue view → gh api --paginate への変更

    • createdAt / id / updated_at を含める取得方式に変更
    • REPO_FULL_NAME と ISSUE_NUMBER を Step 1 冒頭で定義
    • 最新判定ロジック(created_at desc, id desc)を明記

    Blocker 2: valid CONTRACT_REVIEW_RESULT_V1 の定義を明確化

    • fenced YAML block(yaml ...)のみを対象に限定
    • prose や example code blocks の引用を採用しない条件を追記
    • 必須フィールド(status / generated_by / issue_url / generated_at)の検証ルールを明記

    Blocker 3: issue-contract-review 先行実行後の blocked ハンドリング

    • status: blocked 時は URL を採用せず停止する分岐を追加
    • status: go のみを contract_snapshot_url として採用

    Blocker 4: #245 のスコープ説明を修正

    検証状況

    • ✅ AC1-AC7 すべて PASS
    • ✅ pnpm typecheck: OK
    • ✅ pnpm lint: OK
    • ✅ pnpm test: 100 passed
    • ✅ pnpm build: OK
    • ✅ uv run pytest: 21 passed

    PR #344 はこちらの修正コミット(e6d6c6c)を含めて再評価ください。

    更新内容: e6d6c6c

  15. added 3 commits that reference this issue on May 24, 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

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions