Skip to content

実装: impl-review-loop preparation の fail-closed handoff 改善(contract_snapshot_url missing 時の PREPARATION_RESULT_V1 出力) #259

Open

Description

@squne121

Machine-Readable Contract

contract_schema_version: v1
issue_kind: implementation
parent_issue: "none"
goal_ref: "impl-review-loop/steps/preparation.md の contract_snapshot_url missing 時の挙動を fail-closed 構造化出力に統一し、PREPARATION_RESULT_V1 で next_action・suggested_commands・invariant を明示して停止する"
change_kind: docs

Parent Issue

なし(単独改善)

Parent Goal Ref

  • Goal: contract_snapshot_url が missing または不正な場合に構造化停止出力(PREPARATION_RESULT_V1)を出し、次に打つコマンドを明示して操作ミスを削減する
  • Desired Destination: N/A(単独改善 Issue)

Current Validated Scope

  • .claude/skills/impl-review-loop/steps/preparation.md セクション 1 の missing contract_snapshot_url 時の停止メッセージを PREPARATION_RESULT_V1 形式に書き換える
  • invariant(auto_chain_allowed: false, contract_snapshot_url_required: true)の明示

Remaining Parent Gaps

なし

Outcome

.claude/skills/impl-review-loop/steps/preparation.md のセクション 1 が修正され、contract_snapshot_url missing 時に以下の PREPARATION_RESULT_V1 を出力して停止するようになった状態が main にマージされている。

PREPARATION_RESULT_V1:
  status: blocked
  reason: missing_contract_snapshot_url
  next_action: human_run_issue_contract_review
  issue_number: <issue_number>
  suggested_commands:
    - "/issue-contract-review <issue_number>"
    - "/impl-review-loop <issue_number> <contract_snapshot_url>"
  invariant:
    contract_snapshot_url_required: true
    auto_chain_allowed: false

In Scope

  • .claude/skills/impl-review-loop/steps/preparation.md セクション 1 の missing contract_snapshot_url 時の停止メッセージを PREPARATION_RESULT_V1 形式に書き換える
  • invariant(auto_chain_allowed: false, contract_snapshot_url_required: true)の明示

Out of Scope

  • contract_snapshot_url が正しく渡された場合の通常フロー変更
  • issue-contract-review skill 本体の変更
  • 自動委譲・自動 chain の追加(採用しない)
  • impl-review-loop の他の step の変更

Acceptance Criteria

  • AC1: preparation.md セクション 1 に PREPARATION_RESULT_V1 の schema(status/reason/next_action/suggested_commands/invariant)が明記されている
  • AC2: invariant.auto_chain_allowed: false と invariant.contract_snapshot_url_required: true が明示されている
  • AC3: missing 時に自動委譲・自動実行しない旨が明記されており、status: blocked で停止する

Verification Commands

# AC1: PREPARATION_RESULT_V1 の記載確認
rg "PREPARATION_RESULT_V1" .claude/skills/impl-review-loop/steps/preparation.md

# AC2: invariant 記載確認
rg "auto_chain_allowed|contract_snapshot_url_required" .claude/skills/impl-review-loop/steps/preparation.md

# AC3: 停止挙動記載確認(自動実行しないこと)
rg "status: blocked|auto_chain_allowed: false" .claude/skills/impl-review-loop/steps/preparation.md

# Standard gates
pnpm typecheck
pnpm lint
pnpm test
pnpm build
uv run pytest .claude/skills/gemini-cli-headless-delegation/tests/test_model_routing.py

Allowed Paths

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

Required Skills

なし

Stop Conditions

  • Allowed Paths 外の変更が必要と判明した場合
  • 自動委譲・auto_chain 追加が必要と判断した場合(採用しない)
  • nested SubAgent delegation が必要になった場合
  • In Scope の固定契約(キー集合・スキーマ・型定義)の変更が必要になった場合
  • 新規 Issue の起票が必要と判断した場合(スコープ分割が発生する場合)
  • 後続 Phase / 別スコープへの波及が判明した場合
  • 外部サービス利用・権限昇格・既存テスト大規模改変が必要になった場合

Runtime Verification Applicability

decision: not_applicable
reason: "docs-only change (.claude/skills/impl-review-loop/steps/preparation.md の Markdown 書き換え)。実行時動作確認不要。"

Background

現在の impl-review-loop/steps/preparation.md は、contract_snapshot_url が missing または不正な場合に「issue-contract-review を先に通すよう人間に提案して停止」という非構造的なテキスト停止をしている。この停止メッセージは次に何のコマンドを打てばよいかが曖昧で、操作ミスの原因になる。

また、auto_chain_allowed: false / contract_snapshot_url_required: true という invariant が文書化されていないため、将来の skill 改修で誤って自動委譲が追加されるリスクがある。

missing 時に PREPARATION_RESULT_V1 形式の構造化出力を出力し、次コマンドを明示して停止する。これにより人間起点を保ったまま操作ミスを削減する。

Source

follow-up:squne121/loop-protocol:issue/231:preparation-fail-closed-handoff
origin_issue: https://github.com/squne121/loop-protocol/issues/231
origin_decision: issue #231 close / not planned、自動 chain は reject、fail-closed handoff は採用

Activity

  1. added
    enhancement
    phase/implementation
    triage-required
    on May 23, 2026
  2. squne121 commented on May 23, 2026

    @squne121
    OwnerAuthor

    issue-refinement-loop: 完了 (2026-05-23T05:17:41Z)

    • iteration: 1

    • verdict: approve

    • termination_reason: approved

    • 改善履歴:

      • iteration 0: C1(Required Skills 追加), C2(Stop Conditions 4項目追記), C9(Runtime Verification Applicability 追加)
    • 次アクション: /issue-contract-review 259 を実行後、/impl-review-loop 259 <contract_snapshot_url> で実装開始

    FOLLOW_UP_MATERIALIZATION_RESULT_V1:
      follow_up_issues: []
      note_only_observations:
        - dedupe_key: "259-refinement-complete"
          summary: "Issue #259 は refinement APPROVE 済み。issue-contract-review → impl-review-loop で実装可能状態。"
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/implementationtriage-required

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions