Skip to content

実装: impl-review-loop SKILL.md の contract_snapshot_url stale auto-call 記述を fail-only gate に合わせて修正する #612

Closed

Description

@squne121

Machine-Readable Contract

以下に機械可読コントラクトを示す。

contract_schema_version: v1
issue_kind: implementation
parent_issue: none
goal_ref: "impl-review-loop SKILL.md line 18 の stale auto-call 記述(issue-contract-review を自動呼び出し)を #564 fail-only gate に合わせて削除・修正し preparation.md と整合させる"
change_kind: docs

Parent Issue

なし(単独改善)

Parent Goal Ref

なし(単独改善のため該当なし)

Current Validated Scope

調査・refinement loop により検証されたスコープは以下の通り。

Remaining Parent Gaps

なし(単独改善のため該当なし)

Outcome

この Issue の実装完了後、以下の状態になる。

.claude/skills/impl-review-loop/SKILL.md の contract_snapshot_url 説明が preparation.md の fail-only gate 設計(#564 以降)と整合し、pnpm typecheck / lint / test / build が全て PASS している。

In Scope

変更対象は以下に限定する。

  • .claude/skills/impl-review-loop/SKILL.md の contract_snapshot_url に関する記述を fail-only gate の実際の動作(intake_gate_failed: missing_contract_go で停止)に合わせて修正する
  • stale な「issue-contract-review 自動呼び出し」の記述を削除し、「有効な CONTRACT_REVIEW_RESULT_V1 status: go が存在しない場合は intake_gate_failed: missing_contract_go で停止」に置き換える
  • .claude/skills/impl-review-loop/SKILL.md の LOOP_STATE.contract_snapshot_source から materialized_by_issue_contract_review を削除する(fail-only gate では使用されない enum 値)
  • .claude/skills/impl-review-loop/SKILL.md の refresh_contract_snapshot 関連の文言が auto-execution と誤読されないよう、「route only; no auto-run」または「停止して人間に再実行を依頼」と明記する

Out of Scope

以下は本 Issue のスコープ外とする。

Acceptance Criteria

各 AC の完了条件を以下に示す。

  • AC1: .claude/skills/impl-review-loop/SKILL.md の contract_snapshot_url 説明に「なければ issue-contract-review を自動呼び出し」という記述が含まれていない
  • AC2: .claude/skills/impl-review-loop/SKILL.md の contract_snapshot_url 説明に intake_gate_failed: missing_contract_go または fail-only gate の動作が記述されている
  • AC3: 変更後の SKILL.md の当該記述が preparation.md の fail-only gate 設計と矛盾しない
  • AC4: .claude/skills/impl-review-loop/SKILL.md の LOOP_STATE.contract_snapshot_source enum に materialized_by_issue_contract_review が含まれていない
  • AC5: .claude/skills/impl-review-loop/SKILL.md に issue-contract-review の自動実行・自動 materialization を示す表現が残っていない

Verification Commands

各 AC に対応する検証コマンドを以下に示す。

# AC1
$ rg --files-without-match "なければ.*issue-contract-review|issue-contract-review.*自動呼び出し" .claude/skills/impl-review-loop/SKILL.md
# AC2
$ rg "contract_snapshot_url.*intake_gate_failed|contract_snapshot_url.*missing_contract_go" .claude/skills/impl-review-loop/SKILL.md
# AC3
$ rg "contract_snapshot_url.*fail-only|contract_snapshot_url.*停止" .claude/skills/impl-review-loop/SKILL.md
# AC4
$ rg --files-without-match "materialized_by_issue_contract_review" .claude/skills/impl-review-loop/SKILL.md
# AC5
$ rg --files-without-match "issue-contract-review.*自動呼び出し|auto-call.*issue-contract-review|materialized_by_issue_contract_review" .claude/skills/impl-review-loop/SKILL.md
$ pnpm typecheck
$ pnpm lint
$ pnpm test
$ pnpm build

Allowed Paths

変更対象ファイルを以下に限定する。

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

Stop Conditions

以下の状況が発生した場合は実装を停止し人間に確認を求める。

Required Skills

なし

Background

本 Issue の背景および #597 との関係を説明する。

Issue #597 は「impl-review-loop の runtime が issue-contract-review を自動実行しないのはドリフト」という前提で起票されたが、refinement loop での調査・anchor comment レビューにより、この前提が誤りであることが確認された。

#597 クローズについて: #597 は refinement loop 中(2026-06-03)にクローズ済みであり、auto-execution 復活 Issue として実装されないことが確定している。auto-execution 復活は #564 アーキテクチャ変更として別途判断が必要。

Runtime Verification Applicability

本 Issue は docs-only 変更であり、runtime 検証の適用可否を以下に示す。

applicability: not_applicable
decision: not_applicable
reason: "Markdown skill-instruction update only. Product runtime behavior is not changed."
evidence_url: null

Activity

  1. added
    enhancement
    on Jun 3, 2026
  2. squne121 commented on Jun 3, 2026

    @squne121
    OwnerAuthor

    Verdict: REQUEST_CHANGES

    #612 の問題意識は正しいです。現行 SKILL.md には、contract_snapshot_url 未提供時に issue-contract-review を自動呼び出しするという stale 記述が残っています。一方、preparation.md は #564/#568 後の fail-only gate として、valid CONTRACT_REVIEW_RESULT_V1 status: go がない場合は issue-contract-review を自動実行せず intake_gate_failed: missing_contract_go で停止すると明記しています。([GitHub]1)

    ただし、現状の Issue #612 はそのまま実装に流すと失敗または不完全修正になる可能性が高いです。

    Blockers

    1. Issue 自体が impl-review-loop の intake gate を通らない

    #612 のタイトルは fix(docs): ... で、label も enhancement のみです。([GitHub]2) しかし現行 preparation.md は、title prefix が 実装: または implement: で始まり、phase/implementation label があることを intake gate の前提にしています。欠落時は metadata_not_ready で停止します。([GitHub]3)

    修正案:

    title: 実装: impl-review-loop SKILL.md の contract_snapshot_url stale auto-call 記述を fail-only gate に合わせて修正する
    labels: enhancement, phase/implementation
    

    この修正をしない場合、Issue 本文がどれだけ正しくても /impl-review-loop 612 は missing_contract_go 以前に metadata_not_ready で止まる設計です。

    2. contract_snapshot_source: materialized_by_issue_contract_review が stale として残る

    #612 は contract_snapshot_url 説明だけを修正対象にしていますが、現行 SKILL.md の LOOP_STATE には contract_snapshot_source: provided | detected_existing | materialized_by_issue_contract_review が残っています。([GitHub]1) fail-only gate では、missing go 時に issue-contract-review を自動 materialize しないため、この enum は少なくとも誤読リスクを残します。#597 はまさにこの materialized_by_issue_contract_review 経路を復活させる設計で、#612 はその前提を否定しているため、ここを放置すると #597 系の誤解が再発します。([GitHub]4)

    修正案として #612 の AC に追加すべきです。

    AC4: `.claude/skills/impl-review-loop/SKILL.md` の `LOOP_STATE.contract_snapshot_source` から
    `materialized_by_issue_contract_review` が削除される、または fail-only gate では使用されない legacy value と明記されている。
    

    個人的には削除が妥当です。

    contract_snapshot_source: provided | detected_existing

    3. AC1 の検証コマンドが CI/自動実行に不向き

    #612 の AC1 は「該当文字列が 0 件なら PASS」ですが、提示コマンドは単に rg -n ... です。([GitHub]2) ripgrep はマッチがない場合 exit status 1 を返すため、set -e や CI 的な runner では「PASS 条件なのに失敗」と扱われます。([Debian Manpages]5)

    修正案:

    # AC1: stale auto-call 記述が存在しないこと
    if rg -n "issue-contract-review.*自動呼び出し|auto-call.*issue-contract-review|なければ.*issue-contract-review|materialized_by_issue_contract_review" \
      .claude/skills/impl-review-loop/SKILL.md; then
      echo "FAIL: stale auto-call/materialization wording remains"
      exit 1
    fi
    echo "PASS: stale auto-call/materialization wording absent"

    4. #597 の supersede が運用状態に反映されていない

    #612 は #597 が supersede され、本 Issue に切り替えられたと書いています。([GitHub]2) しかし #597 は現在も Open で、triage-required 付きのままです。([GitHub]4) この状態だと、別の agent が #597 を拾って「auto materialization を復活させる」方向に進むリスクが残ります。

    修正案:

    - #612 の実装 PR で #597 を close する closing keyword を入れる
      例: Supersedes and closes #597
    - もしくは #597 に superseded/closed-by #612 のコメントを追加し、close する
    - #612 本文にも「#597 を実装しない。auto-execution 復活は別途 architecture decision が必要」と明記する
    

    5. Runtime Verification Applicability が docs-only と矛盾している

    #612 は docs-only 変更としながら、Runtime Verification Applicability を applicability: immediate, skip_reason: null, evidence_url: null にしています。([GitHub]2) 一方、同種の docs-only Issue #569 は decision: not_applicable、理由として “Markdown documentation-only change. No runtime behavior added or changed.” と整理しています。([GitHub]6)

    ここは定義を揃えるべきです。Claude Code の skills は SKILL.md が実行時に読み込まれる workflow instruction なので、単なる人間向け docs ではありませんが、プロダクト runtime 検証とは別物です。Claude Code 公式 docs でも、skill は SKILL.md の frontmatter と本文 instructions で構成され、必要時に読み込まれるものと説明されています。([Claude API Docs]7)

    修正案:

    Runtime Verification Applicability:
      decision: not_applicable
      reason: "Markdown skill-instruction update only. Product runtime behavior is not changed."

    または agent 挙動検証を要求するなら、次を AC に入れるべきです。

    # agent-behavior verification
    /impl-review-loop <metadata-ready issue without CONTRACT_REVIEW_RESULT_V1 go>
    # expected: intake_gate_failed: missing_contract_go
    # expected: issue-contract-review is NOT auto-invoked

    Non-blockers / quality improvements

    AC3 の「preparation.md の fail-only gate 設計(line 39, 41)」は brittle です。GitHub 表示や編集で行番号はすぐズレます。missing_contract_go 節に issue-contract-review を自動実行しない(fail-only gate) が存在すること、かつ SKILL.md の contract_snapshot_url 説明がそれに一致すること、という pattern-based 検証に寄せるべきです。([GitHub]3)

    また、SKILL.md の Product Spec Check 付近には refresh_contract_snapshot / issue-contract-review 再実行 系の文言が残っています。これは missing go の auto-call とは別経路ですが、今回の誤解と同種の「誰が再実行するのか」曖昧さを作ります。実装時は 自動実行 と読める表現を避け、停止して人間に再実行を依頼 または route only; no auto-run と明示した方が安全です。([GitHub]3)

    推奨する #612 追記

    ## Additional In Scope
    
    * `.claude/skills/impl-review-loop/SKILL.md` 内の `contract_snapshot_source` から
      `materialized_by_issue_contract_review` を削除する、または fail-only gate では使用しない legacy value と明記する
    * `refresh_contract_snapshot` / `issue-contract-review 再実行` 系の文言が auto-execution と誤読されないよう、
      「停止して人間に再実行を依頼」または「route only; no auto-run」と明記する
    
    ## Additional Acceptance Criteria
    
    * AC4: `SKILL.md` に `materialized_by_issue_contract_review` が残っていない、または legacy/deprecated と明記されている
    * AC5: `SKILL.md` に `issue-contract-review` の自動実行・自動 materialization を示す表現が残っていない
    * AC6: #597 が close/supersede され、auto-execution 復活 Issue として実装されないことが明確になっている

    最終判断

    実装対象は妥当ですが、今の #612 は metadata 不備 + stale enum 見落とし + VC コマンド不備 + #597 未整理 があるため、そのまま実装開始は避けるべきです。まず Issue 本文と metadata を直してから、1 PR で SKILL.md の stale auto-call 系表現を面で除去するのが安全です。

  3. changed the title [-]fix(docs): impl-review-loop SKILL.md の contract_snapshot_url stale auto-call 記述を fail-only gate に合わせて修正する[/-] [+]実装: impl-review-loop SKILL.md の contract_snapshot_url stale auto-call 記述を fail-only gate に合わせて修正する[/+] on Jun 3, 2026
  4. squne121 commented on Jun 3, 2026

    @squne121
    OwnerAuthor

    Contract Snapshot (2026-06-03T05:40:00Z)

    • Outcome: .claude/skills/impl-review-loop/SKILL.md の contract_snapshot_url 説明が preparation.md の fail-only gate 設計(実装: issue-refinement-loop と impl-review-loop の implementation-ready handoff を contract gate 化する #564 以降)と整合し、stale auto-call 記述が削除されている
    • Acceptance Criteria:
      • AC1: contract_snapshot_url 説明に「なければ issue-contract-review を自動呼び出し」が含まれていない
      • AC2: contract_snapshot_url 説明に intake_gate_failed: missing_contract_go または fail-only gate の動作が記述されている
      • AC3: 変更後の記述が preparation.md の fail-only gate 設計と矛盾しない
      • AC4: LOOP_STATE.contract_snapshot_source enum に materialized_by_issue_contract_review が含まれていない
      • AC5: issue-contract-review の自動実行・自動 materialization を示す表現が残っていない
    • Verification Commands:
      • AC1: rg --files-without-match "なければ.*issue-contract-review|issue-contract-review.*自動呼び出し" .claude/skills/impl-review-loop/SKILL.md
      • AC2: rg "contract_snapshot_url.*intake_gate_failed|contract_snapshot_url.*missing_contract_go" .claude/skills/impl-review-loop/SKILL.md
      • AC3: rg "contract_snapshot_url.*fail-only|contract_snapshot_url.*停止" .claude/skills/impl-review-loop/SKILL.md
      • AC4: rg --files-without-match "materialized_by_issue_contract_review" .claude/skills/impl-review-loop/SKILL.md
      • AC5: rg --files-without-match "issue-contract-review.*自動呼び出し|auto-call.*issue-contract-review|materialized_by_issue_contract_review" .claude/skills/impl-review-loop/SKILL.md
      • regression: pnpm typecheck && pnpm lint && pnpm test && pnpm build
    • Allowed Paths: .claude/skills/impl-review-loop/SKILL.md
    • Worktree: .claude/worktrees/issue-612-impl-review-loop-skill-md-contract-snaps
    • Branch: worktree-issue-612-impl-review-loop-skill-md-contract-snaps
    • VC preflight: baseline fail = 5, 想定外 pass = 0, 実行不可 = 0, regression_gate pass = 4
    CONTRACT_REVIEW_RESULT_V1:
      status: go
      generated_at: "2026-06-03T05:40:00Z"
      generated_by: issue-contract-review
      issue_url: "https://github.com/squne121/loop-protocol/issues/612"
      body_sha256: "sha256:67bc86f09724635df83ef912bce8e9b9f4169435afee0f79370f4bb092326a52"
      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: 5
          vc_passed_unexpectedly: 0
          vc_unrunnable: 0
          vc_expected_pass: 4
          vc_skipped: 0
          classifications:
            - ac: AC1
              command: "rg --files-without-match \"なければ.*issue-contract-review|issue-contract-review.*自動呼び出し\" .claude/skills/impl-review-loop/SKILL.md"
              exit_code: 1
              classification: expected_fail
              category: expected_baseline_fail
              scope_class: baseline_fail_expected
              confidence: high
              decision: go
            - ac: AC2
              command: "rg \"contract_snapshot_url.*intake_gate_failed|contract_snapshot_url.*missing_contract_go\" .claude/skills/impl-review-loop/SKILL.md"
              exit_code: 1
              classification: expected_fail
              category: expected_baseline_fail
              scope_class: baseline_fail_expected
              confidence: high
              decision: go
            - ac: AC3
              command: "rg \"contract_snapshot_url.*fail-only|contract_snapshot_url.*停止\" .claude/skills/impl-review-loop/SKILL.md"
              exit_code: 1
              classification: expected_fail
              category: expected_baseline_fail
              scope_class: baseline_fail_expected
              confidence: high
              decision: go
            - ac: AC4
              command: "rg --files-without-match \"materialized_by_issue_contract_review\" .claude/skills/impl-review-loop/SKILL.md"
              exit_code: 1
              classification: expected_fail
              category: expected_baseline_fail
              scope_class: baseline_fail_expected
              confidence: high
              decision: go
            - ac: AC5
              command: "rg --files-without-match \"issue-contract-review.*自動呼び出し|auto-call.*issue-contract-review|materialized_by_issue_contract_review\" .claude/skills/impl-review-loop/SKILL.md"
              exit_code: 1
              classification: expected_fail
              category: expected_baseline_fail
              scope_class: baseline_fail_expected
              confidence: high
              decision: go
            - ac: AC_UNKNOWN
              command: "pnpm typecheck"
              exit_code: 0
              classification: expected_pass
              category: regression_gate
              scope_class: regression_gate
              confidence: low
              decision: go
            - ac: AC_UNKNOWN
              command: "pnpm lint"
              exit_code: 0
              classification: expected_pass
              category: regression_gate
              scope_class: regression_gate
              confidence: low
              decision: go
            - ac: AC_UNKNOWN
              command: "pnpm test"
              exit_code: 0
              classification: expected_pass
              category: regression_gate
              scope_class: regression_gate
              confidence: low
              decision: go
            - ac: AC_UNKNOWN
              command: "pnpm build"
              exit_code: 0
              classification: expected_pass
              category: regression_gate
              scope_class: regression_gate
              confidence: low
              decision: go
        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
          blocked_reasons: []
        worktree_branch_collision: clear
      next_action: implement_issue
      blocked_reasons: []
      warnings: []
  5. squne121 commented on Jun 3, 2026

    @squne121
    OwnerAuthor

    implement-issue: 実装完了

  6. added 2 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

    enhancementphase/implementation

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions