Skip to content

実装: impl-review-loop の missing_contract_go で issue-contract-review を自動 materialize する #817

Closed

Description

@squne121

Machine-Readable Contract

contract_schema_version: v1
issue_kind: implementation
parent_issue: "#816"
goal_ref: "impl-review-loop 系の決定論的 gate 自動化と compact verdict 化により token/context 浪費を削減する"
change_kind: workflow

Runtime Verification Applicability

decision: not_applicable
reason: "script 単体テスト(uv run pytest)と rg による静的検証で完結する。runtime UI / simulation 動作確認は不要"

Decisions Fixed

Parent Issue

#816

Parent Goal Ref

Current Validated Scope

  • .claude/skills/impl-review-loop/scripts/ensure_contract_snapshot.py を追加し、missing_contract_go 時に既存 valid CONTRACT_REVIEW_RESULT_V1 status: go の検出または issue-contract-review 相当チェックの一括実行で contract snapshot を materialize する(--mode check-only|auto|dry-run、--post、--artifact-dir、body sha256 stale 判定、idempotency marker 確認)
  • .claude/skills/issue-contract-review/scripts/run_contract_review_once.py を追加し、check_blockers / product spec preflight / baseline VC preflight / readiness check を 1 entrypoint に集約して compact JSON(CONTRACT_REVIEW_ONCE_RESULT_V1)のみを stdout に返す(wrapper status: go | blocked | human_judgment | runtime_error、subprocess JSON parse 失敗は human_judgment)
  • contract_readiness_check.py の --issue に --issue-number alias を追加する(Codex ログ 実装: implementation-worker の update_branch を expected_head_sha TOCTOU guard と REST contract test で堅牢化する #778 での引数 drift 解消)
  • impl-review-loop/SKILL.md と steps/preparation.md の missing_contract_go 分岐を「停止して人間に依頼(fail-only)」から「ensure_contract_snapshot.py を一度だけ実行して routing」に変更する(実装: issue-refinement-loop と impl-review-loop の implementation-ready handoff を contract gate 化する #564 fail-only 廃止文言と矛盾しない形で更新)

Remaining Parent Gaps

Outcome

ensure_contract_snapshot.py / run_contract_review_once.py / --issue-number alias / preparation.md の自動 routing 変更と対応する unit test が 1 PR で追加され、missing_contract_go から人間介入なしで go 採用・blocked routing・human_judgment escalation のいずれかへ決定論的に進める状態。

In Scope

  • ensure_contract_snapshot.py の実装(--mode check-only|auto|dry-run、--post、--artifact-dir、exit code: 0 ok / 10 blocked_needs_refinement / 20 human_judgment / 30 invalid_input / 40 runtime_error / 50 stale_or_conflicting_snapshot、stdout は CONTRACT_SNAPSHOT_ENSURE_RESULT_V1 compact JSON のみ)
  • 既存 valid go の検出・latest blocked precedence・body sha256 による stale 判定・dry-run での GitHub mutation 抑止・idempotency の実装
  • body/comment snapshot の atomicity: ensure_contract_snapshot.py が issue body / updated_at / comments を最初に一括取得し body_sha256 と comments_digest を artifact に保存する。投稿直前に body / updated_at を再取得し body_sha256 が変わっていたら exit 50 で投稿禁止にする
  • idempotent post: <!-- loop-protocol:contract-snapshot issue=<N> body_sha256=sha256:<...> schema=CONTRACT_REVIEW_RESULT_V1 --> marker を確認し、同一 body_sha256 / 同一 schema の marker があれば repost しない
  • 投稿 API の error classification: post_status は not_requested | dry_run | posted | deduped_existing | permission_denied | rate_limited | validation_failed_or_spam | ambiguous_no_retry を列挙。403/429/422 は盲目的 retry 禁止。transport error 後は comment 一覧を再取得し idempotency marker を確認してから再投稿
  • check_blockers.sh の fallback parser(body 全体 grep)が native API 不可 かつ dedicated ## Depends On セクション以外に Depends on #N がある場合は human_judgment に落とす
  • LOOP_STATE の contract_materialization フィールドを追加する(attempted / source / result_schema / contract_snapshot_url / artifact_path を保持)
  • run_contract_review_once.py の実装(既存 preflight scripts への薄い orchestration、詳細は artifact 保存、stdout は compact JSON のみ)
  • contract_readiness_check.py への --issue-number alias 追加(既存 --issue の挙動は不変)
  • impl-review-loop/SKILL.md / steps/preparation.md の missing_contract_go 分岐書き換え(自動実行は loop 1 回につき一度だけ、失敗時 fail-closed)
  • 上記の unit test 追加(GitHub API は fixture / mock で代替し、ネットワーク非依存で実行可能にする)。ensure_contract_snapshot.py は fake gh runner / golden JSON ベースの golden case で検証する(existing valid go → no post exit 0 / latest blocked newer → exit 10 / body sha mismatch → exit 50 / body updated between read and post → exit 50 / dry-run → mutation なし / 403/429 → no retry / duplicate marker → deduped_existing)。run_contract_review_once.py は fake runner で executable wrapper を叩く方式にする

Out of Scope

Acceptance Criteria

  • AC0: preparation.md に missing_contract_go の fail-only 廃止文言と自動 materialize 文言が矛盾して併存していない
  • AC1: .claude/skills/impl-review-loop/scripts/ensure_contract_snapshot.py が存在する
  • AC2: .claude/skills/issue-contract-review/scripts/run_contract_review_once.py が存在する
  • AC3: contract_readiness_check.py のソースに --issue-number alias の定義が存在する
  • AC4: steps/preparation.md の missing_contract_go 分岐に ensure_contract_snapshot への routing 記述が存在する
  • AC5: ensure_contract_snapshot.py の unit test(既存 go 検出 / latest blocked precedence / body sha mismatch stale / dry-run mutation 抑止)が PASS する
  • AC6: run_contract_review_once.py の unit test が PASS する(readiness go + blocker ok + product spec pass + VC pass → go / readiness needs_fix → blocked / subprocess JSON parse failure → runtime_error / native dependency API 不可 + ambiguous fallback → human_judgment)
  • AC7: 既存テストスイートが破壊されていない
  • AC8: CONTRACT_REVIEW_RESULT_V1.status に human_judgment を投稿しないことを unit test で固定する
  • AC9: issue body が materialization 中に更新された場合、投稿せず stale_or_conflicting_snapshot で exit 50 になる(unit test で確認)
  • AC10: GitHub comment 投稿は idempotency marker により重複投稿されない(unit test で確認)
  • AC11: 403/429/422 from comment create を盲目的に retry しない(unit test で確認)
  • AC12: 実装: contract_snapshot_url の status: go を自動確認するスクリプトを implement-issue に追加する #66 との統合・重複回避判断が PR body に記録されている

Verification Commands

# AC0
$ rg -n "ensure_contract_snapshot" .claude/skills/impl-review-loop/steps/preparation.md
# AC1
$ test -f .claude/skills/impl-review-loop/scripts/ensure_contract_snapshot.py
# AC2
$ test -f .claude/skills/issue-contract-review/scripts/run_contract_review_once.py
# AC3
$ rg -n "issue-number" .claude/skills/issue-contract-review/scripts/contract_readiness_check.py
# AC4
$ rg -n "ensure_contract_snapshot" .claude/skills/impl-review-loop/steps/preparation.md
# AC5
$ uv run pytest .claude/skills/impl-review-loop/tests/test_ensure_contract_snapshot.py -v
# AC6
$ uv run pytest .claude/skills/issue-contract-review/tests/test_run_contract_review_once.py -v
# AC7
$ pnpm test
# AC8
$ uv run pytest .claude/skills/impl-review-loop/tests/test_ensure_contract_snapshot.py -k "human_judgment" -v
# AC9
$ uv run pytest .claude/skills/impl-review-loop/tests/test_ensure_contract_snapshot.py -k "stale" -v
# AC10
$ uv run pytest .claude/skills/impl-review-loop/tests/test_ensure_contract_snapshot.py -k "idempotency or dedup" -v
# AC11
$ uv run pytest .claude/skills/impl-review-loop/tests/test_ensure_contract_snapshot.py -k "rate_limit or permission" -v
# AC12

Allowed Paths

  • .claude/skills/impl-review-loop/SKILL.md
  • .claude/skills/impl-review-loop/steps/preparation.md
  • .claude/skills/impl-review-loop/scripts/ensure_contract_snapshot.py
  • .claude/skills/impl-review-loop/tests/test_ensure_contract_snapshot.py
  • .claude/skills/issue-contract-review/SKILL.md
  • .claude/skills/issue-contract-review/scripts/run_contract_review_once.py
  • .claude/skills/issue-contract-review/scripts/contract_readiness_check.py
  • .claude/skills/issue-contract-review/scripts/contract_review_result_parser.py
  • .claude/skills/issue-contract-review/tests/test_run_contract_review_once.py
  • .claude/skills/issue-contract-review/tests/test_contract_readiness_check.py
  • .claude/skills/issue-contract-review/tests/test_contract_review_result_parser.py

Stop Conditions

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

Required Skills

  • Python(argparse / subprocess / JSON schema 出力)

Scope Delta(任意)

Allowed Paths に contract_review_result_parser.py と対応テストを追加(#66 との共有 parser 化に備えた canonical entry point)

Delivery Rule

Notes for Reviewer

  • run_contract_review_once.py の出力 schema 名 CONTRACT_REVIEW_ONCE_RESULT_V1 と ensure_contract_snapshot.py の CONTRACT_SNAPSHOT_ENSURE_RESULT_V1 は新規 schema として docs/dev/schema-governance.md への登録を必須とする(PR レビューではなく実装着手前に登録する)
  • 自動実行の安全条件: 既存 blocked が go より新しい場合は自動採用せず blocked routing を優先する(fail-closed)
  • LOOP_STATE に追加する contract_materialization フィールドは以下のスキーマとする:
    contract_materialization:
      attempted: true
      source: existing_go | materialized_go | latest_blocked | readiness_blocked | human_judgment | stale_conflict
      result_schema: CONTRACT_SNAPSHOT_ENSURE_RESULT_V1
      contract_snapshot_url: null
      artifact_path: artifacts/contract-snapshot/...

Activity

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

    @squne121
    OwnerAuthor

    総合判定: REQUEST_CHANGES

    #817 の方向性自体は妥当です。#816 の親目的は、missing_contract_go で停止して人間が Y を返し、issue-contract-review を手動起動する往復をなくすことなので、contract snapshot materialization の自動化は parent の最初の child として筋が通っています。#817 も ensure_contract_snapshot.py / run_contract_review_once.py / --issue-number alias / preparation.md の routing 変更を 1 PR で行う設計です。

    ただし、現状の Issue 本文のまま実装に回すと、既存の fail-only gate と矛盾した自動投稿 script、V1 schema 互換性を壊す wrapper、#66/#790 と重複する contract parser ができる可能性が高いです。#817 と #816 のコメントは空で、対応 PR 差分は今回確認できなかったため、以下は Issue 契約・既存実装・公式 docs に基づく敵対的レビューです。


    Blocker 1: #817 は #564 以降の fail-only gate を反転するが、状態機械の更新範囲が不足している

    現行 impl-review-loop/steps/preparation.md は、missing_contract_go 時に issue-contract-review を自動実行しない、intake_gate_failed: missing_contract_go で停止し、人間に実行を依頼する、と明記しています。さらに「#564 以降は旧自動実行パスを廃止」と書いています。

    一方で #817 は、この分岐を ensure_contract_snapshot.py で自動 materialize する設計に戻します。これは単なる文言変更ではなく、#564 の設計決定を部分的に supersede する状態遷移変更です。現在の Step 1-b も、valid CONTRACT_REVIEW_RESULT_V1 の検出条件、latest blocked precedence、既存 go の idempotency、go 不在時の自動実行廃止を細かく定義しています。

    修正必須です。Issue #817 に次を明記してください。

    decisions_fixed:
      - "#564 fail-only decision is superseded only for missing_contract_go."
      - "metadata_not_ready / stale_contract_review / body_snapshot_mismatch / request_changes_after_go remain fail-closed."
      - "auto materialization is attempted at most once per impl-review-loop invocation."
    

    また、LOOP_STATE に最低限これを追加するべきです。

    contract_materialization:
      attempted: true
      source: existing_go | materialized_go | latest_blocked | readiness_blocked | human_judgment | stale_conflict
      result_schema: CONTRACT_SNAPSHOT_ENSURE_RESULT_V1
      contract_snapshot_url: null
      artifact_path: artifacts/contract-snapshot/...
    

    現状の AC4 は ensure_contract_snapshot への routing 記述確認だけなので弱いです。preparation.md 内に「自動実行パスは廃止」と「自動 materialize」の両方が残っても AC が通ります。


    Blocker 2: CONTRACT_REVIEW_RESULT_V1 と wrapper schema の status 設計が混線している

    既存 issue-contract-review/SKILL.md の CONTRACT_REVIEW_RESULT_V1 は、top-level status: go | blocked です。human_judgment は nested decision や next_action には出ますが、V1 top-level status ではありません。

    一方、contract_readiness_check.py は ISSUE_CONTRACT_READINESS_RESULT_V1 として status: go | needs_fix | human_judgment を返し、exit code も 0/1/2/3 に分けています。

    #817 の run_contract_review_once.py / ensure_contract_snapshot.py は human_judgment を扱う設計ですが、それを CONTRACT_REVIEW_RESULT_V1.status: human_judgment として投稿してはいけません。V1 互換性を壊します。

    推奨 mapping はこれです。

    Source | Wrapper status | 投稿する CONTRACT_REVIEW_RESULT_V1 -- | -- | -- readiness go + blockers ok + product spec pass + VC pass | go | status: go readiness needs_fix / product spec fail / VC blocked | blocked | status: blocked tool error / auth error / native dependency ambiguity / classifier unknown | human_judgment | V1 snapshot は投稿しない。diagnostic artifact のみ、または別 marker stale body sha / newer blocked / conflicting comments | stale_or_conflicting_snapshot | 投稿しない

    V1 の top-level に human_judgment を入れたいなら、CONTRACT_REVIEW_RESULT_V2 として schema version を上げ、docs/dev/schema-governance.md 登録を必須化してください。#817 の Notes は「登録要否を PR レビューで判断」としていますが、これは弱いです。V1 互換性に関わるため Issue 側で固定すべきです。


    Blocker 3: #66 と #790 との責務境界が曖昧なまま、3 つ目の contract parser が生まれる

    #66 は contract_snapshot_url の status: go を自動確認する verify-contract-snapshot.py を implement-issue 側へ追加する open Issue です。#817 の Delivery Rule も #66 との近接を認識していますが、統合方針が AC になっていません。

    #790 は agent_preflight_bundle.py / generate_task_packet.py で intake 情報を compact stdout と artifact に固定し、missing contract snapshot 時に NEXT_ACTION: run issue-contract-review を返す設計です。ただし、CONTRACT_REVIEW_RESULT_V1 の自動 materialize は明確に out of scope です。

    #817 はこの 2 つと衝突します。今のままだと、以下が分裂します。

    修正案は 2 択です。

    1. 実装: impl-review-loop の missing_contract_go で issue-contract-review を自動 materialize する #817 を canonical parser 化する
      contract_review_result_parser.py のような共有 helper を作り、実装: contract_snapshot_url の status: go を自動確認するスクリプトを implement-issue に追加する #66 はそれを使う設計に変更する。実装: contract_snapshot_url の status: go を自動確認するスクリプトを implement-issue に追加する #66 は 実装: impl-review-loop の missing_contract_go で issue-contract-review を自動 materialize する #817 に統合クローズする。

    2. 実装: contract_snapshot_url の status: go を自動確認するスクリプトを implement-issue に追加する #66 を canonical parser として先に実装する
      実装: impl-review-loop の missing_contract_go で issue-contract-review を自動 materialize する #817 は 実装: contract_snapshot_url の status: go を自動確認するスクリプトを implement-issue に追加する #66 の parser を呼び出し、materialization だけを追加する。

    どちらでもよいですが、#817 の AC に「#66 との統合・重複回避が記録されている」を追加すべきです。


    Blocker 4: Issue body / comments / subprocess 結果が non-atomic で、stale snapshot を投稿しうる

    #817 は body_sha256 による stale 判定を要求していますが、既存 script はそれぞれ独立に GitHub から Issue body を取得します。contract_readiness_check.py は gh issue view --json body を呼びます。 check_product_spec_contract.py も別途 gh issue view --json title,body,labels を呼びます。

    このまま run_contract_review_once.py が「薄い orchestration」として各 script を順番に叩くと、途中で Issue body が更新された場合に、複数の body version に基づく合成 snapshot が生成されます。これは contract snapshot として危険です。

    GitHub issue comments API はデフォルトで ascending ID 順、per_page は最大 100 です。コメント選択は全ページ取得と明示的な ordering が必要です。(GitHub Docs) また、comment 作成には Issues または Pull requests の write permission が必要で、201 以外に 403/404/410/422 が返り得ます。(GitHub Docs)

    必要な実装契約はこれです。

    1. ensure_contract_snapshot が issue body, issue updated_at, comments を最初に取得
    2. body_sha256 と comments_digest を artifact に保存
    3. subprocess には可能な限り --body-file を渡す
    4. body-file 非対応 script を呼ぶ場合、実行前後で issue.updated_at が変わっていないことを検証
    5. 投稿直前に issue body / updated_at を再取得
    6. body_sha256 が変わっていたら exit 50 stale_or_conflicting_snapshot、投稿禁止
    

    check_product_spec_contract.py に --body-file を追加しないなら、#817 の “deterministic materialization” はかなり弱いです。Allowed Paths へ check_product_spec_contract.py を追加するか、non-atomic を明示的な human_judgment に落としてください。


    Blocker 5: check_blockers.sh の fallback parser が SKILL.md の仕様と矛盾している

    issue-contract-review/SKILL.md は、fallback Depends on #N parsing を「専用セクションの line-anchored 宣言文のみ」に限定し、Delivery Rule や歴史的注記や conditional examples は blocker と見なさない、と明記しています。

    しかし実装の check_blockers.sh は、Pattern 1 で body 全体から Depends on #N を grep しています。つまり Delivery Rule や Notes に出た Depends on #N も拾います。

    #817 は「既存 preflight scripts 自体のロジック変更」を out of scope にしています。だが、このまま自動 materialize すると、既存の曖昧な fallback parser による false block / false mismatch を自動 workflow に組み込むことになります。

    推奨対応:

    GitHub の issue dependencies API は “List dependencies an issue is blocked by” として公式に提供され、read permission で取得できます。native API を primary にする設計自体は妥当です。(GitHub Docs)


    Blocker 6: 自動投稿の idempotency / rate limit / permission handling が粗い

    #817 は --post と dry-run 既定を要求していますが、投稿時の error classification が不足しています。GitHub REST API では secondary rate limit 超過時に 403 または 429 が返り、retry-after 等に従う必要があります。(GitHub Docs) また、GitHub は同時・高頻度 request による secondary limit も明記しています。(GitHub Docs)

    ensure_contract_snapshot.py には最低限これを入れるべきです。

    post_status:
      not_requested
      dry_run
      posted
      deduped_existing
      permission_denied
      rate_limited
      validation_failed_or_spam
      ambiguous_no_retry
    

    盲目的 retry は禁止です。投稿 API が timeout / transport error になった場合も、再投稿前に comment 一覧を再取得し、idempotency marker が存在するか確認する必要があります。

    推奨 marker:

    <!-- loop-protocol:contract-snapshot issue=817 body_sha256=sha256:<...> schema=CONTRACT_REVIEW_RESULT_V1 -->
    

    created_at desc, id desc の latest 判定とは別に、同一 body_sha256 の同一 schema marker があれば repost しない、を AC にしてください。


    Blocker 7: run_contract_review_once.py の unit test が「Markdown grep test」になる危険がある

    #778 の review で指摘されたのと同じ罠です。仕様書に文字列があることを確認するだけでは、executor / classifier / poller / result builder は保証されません。#778 では fake gh runner / fake poller で executable wrapper を叩く方向に修正されました。

    #817 の AC6 は「unit test が PASS」としか書いていないため不十分です。以下の golden case を AC に追加してください。

    ensure_contract_snapshot.py
    - existing valid go → no post, source=existing_go, exit 0
    - latest blocked newer than go → no post, exit 10
    - go body_sha mismatch → no post, exit 50
    - issue body updated between read and post → no post, exit 50
    - dry-run --post equivalent path → would_post=true, mutationなし
    - 403/429 from comment create → no retry, rate_limited/permission_denied
    - duplicate idempotency marker exists → deduped_existing
    

    run_contract_review_once.py

    • readiness go + blocker ok + product spec pass + VC pass → go

    • readiness needs_fix → blocked

    • product spec fail → blocked

    • product spec human_judgment → human_judgment

    • native dependency API unavailable + ambiguous fallback → human_judgment

    • subprocess JSON parse failure → runtime_error / human_judgment, not go


    --issue-number alias は妥当。ただし実装は最小でよい

    contract_readiness_check.py は現在 --issue だけを受け取り、--issue-number はありません。 Python argparse は parser.add_argument('-f', '--foo') のように複数 option string を 1 つの argument に割り当てられるため、alias 追加は安全にできます。(Python documentation)

    実装はこれで足ります。

    parser.add_argument(
    "--issue",
    "--issue-number",
    dest="issue",
    type=int,
    help="GitHub Issue number",
    )

    追加 test は --issue と --issue-number が同じ args.issue へ入ること、help に両方出ること、既存 --body-file 優先挙動が壊れないこと、の 3 つで十分です。


    Issue #817 本文への具体的な修正案

    1. Decisions Fixed を追加

    ## Decisions Fixed

  3. CONTRACT_REVIEW_RESULT_V1.status は go | blocked のまま維持する。

  4. human_judgment は CONTRACT_REVIEW_ONCE_RESULT_V1 / CONTRACT_SNAPSHOT_ENSURE_RESULT_V1 の wrapper status として扱い、V1 snapshot として投稿しない。

  5. #564 の fail-only gate は missing_contract_go に限って supersede する。他の intake failure は fail-closed のまま。

  6. #66 の verify-contract-snapshot.py と valid snapshot parser を重複実装しない。統合方針を PR 本文に記録する。

  7. #790 の preflight bundle artifact が存在する場合は再読解せず入力として利用する。存在しない場合のみ self-contained に取得する。

  8. 2. Acceptance Criteria を増やす

    - [ ] AC0: preparation.md に missing_contract_go の fail-only 廃止文言と自動 materialize 文言が矛盾して併存していない

  9. AC8: CONTRACT_REVIEW_RESULT_V1.status に human_judgment を投稿しないことを unit test で固定する

  10. AC9: issue body が materialization 中に更新された場合、投稿せず stale_or_conflicting_snapshot で exit 50 になる

  11. AC10: GitHub comment 投稿は idempotency marker により重複投稿されない

  12. AC11: 403 / 429 / 422 from comment create を盲目的に retry しない

  13. [ ] AC12: #66 との統合・重複回避判断が PR body に記録されている

  14. 3. Allowed Paths の見直し

    今の Allowed Paths だけでは、共有 parser や product spec body-file 対応を入れにくいです。少なくとも次を検討してください。

    - .claude/skills/issue-contract-review/scripts/contract_review_result_parser.py

  15. .claude/skills/issue-contract-review/tests/test_contract_review_result_parser.py

  16. check_product_spec_contract.py に --body-file を追加するなら、これも Allowed Paths に入れるべきです。check_blockers.sh の fallback parser 修正は #817 に入れるとスコープ肥大化するので、別 Issue 推奨です。


    最終評価

    #817 は parent #816 の token/context 削減には必要です。ただし現状のままでは、人間の Y を減らす代わりに、自動化された stale/duplicate/ambiguous comment 投稿リスクを増やす設計です。

    実装に回す前に直すべき優先順位は次です。

    1. CONTRACT_REVIEW_RESULT_V1 と wrapper schema の status mapping を固定する。

    2. 実装: issue-refinement-loop と impl-review-loop の implementation-ready handoff を contract gate 化する #564 fail-only gate をどこまで supersede するか明文化する。

    3. 実装: contract_snapshot_url の status: go を自動確認するスクリプトを implement-issue に追加する #66 / 実装: agent preflight bundle と task packet generator を追加する #790 との parser・intake 重複を解消する。

    4. body/comment snapshot の atomicity と idempotent post を AC 化する。

    5. check_blockers.sh fallback parser 矛盾を human_judgment または follow-up に逃がす。

    6. unit test を fake runner / golden JSON 中心にし、Markdown grep test にしない。

    この修正後なら、#817 は実装に回してよいです。現時点では REQUEST_CHANGES が妥当です。

    ## 総合判定: **REQUEST_CHANGES**

    #817 の方向性自体は妥当です。#816 の親目的は、missing_contract_go で停止して人間が Y を返し、issue-contract-review を手動起動する往復をなくすことなので、contract snapshot materialization の自動化は parent の最初の child として筋が通っています。#817 も ensure_contract_snapshot.py / run_contract_review_once.py / --issue-number alias / preparation.md の routing 変更を 1 PR で行う設計です。

    ただし、現状の Issue 本文のまま実装に回すと、既存の fail-only gate と矛盾した自動投稿 script、V1 schema 互換性を壊す wrapper、#66/#790 と重複する contract parser ができる可能性が高いです。#817 と #816 のコメントは空で、対応 PR 差分は今回確認できなかったため、以下は Issue 契約・既存実装・公式 docs に基づく敵対的レビューです。


    Blocker 1: #817 は #564 以降の fail-only gate を反転するが、状態機械の更新範囲が不足している

    現行 impl-review-loop/steps/preparation.md は、missing_contract_go 時に issue-contract-review を自動実行しない、intake_gate_failed: missing_contract_go で停止し、人間に実行を依頼する、と明記しています。さらに「#564 以降は旧自動実行パスを廃止」と書いています。

    一方で #817 は、この分岐を ensure_contract_snapshot.py で自動 materialize する設計に戻します。これは単なる文言変更ではなく、#564 の設計決定を部分的に supersede する状態遷移変更です。現在の Step 1-b も、valid CONTRACT_REVIEW_RESULT_V1 の検出条件、latest blocked precedence、既存 go の idempotency、go 不在時の自動実行廃止を細かく定義しています。

    修正必須です。Issue #817 に次を明記してください。

    decisions_fixed:
      - "#564 fail-only decision is superseded only for missing_contract_go."
      - "metadata_not_ready / stale_contract_review / body_snapshot_mismatch / request_changes_after_go remain fail-closed."
      - "auto materialization is attempted at most once per impl-review-loop invocation."

    また、LOOP_STATE に最低限これを追加するべきです。

    contract_materialization:
      attempted: true
      source: existing_go | materialized_go | latest_blocked | readiness_blocked | human_judgment | stale_conflict
      result_schema: CONTRACT_SNAPSHOT_ENSURE_RESULT_V1
      contract_snapshot_url: null
      artifact_path: artifacts/contract-snapshot/...

    現状の AC4 は ensure_contract_snapshot への routing 記述確認だけなので弱いです。preparation.md 内に「自動実行パスは廃止」と「自動 materialize」の両方が残っても AC が通ります。


    Blocker 2: CONTRACT_REVIEW_RESULT_V1 と wrapper schema の status 設計が混線している

    既存 issue-contract-review/SKILL.md の CONTRACT_REVIEW_RESULT_V1 は、top-level status: go | blocked です。human_judgment は nested decision や next_action には出ますが、V1 top-level status ではありません。

    一方、contract_readiness_check.py は ISSUE_CONTRACT_READINESS_RESULT_V1 として status: go | needs_fix | human_judgment を返し、exit code も 0/1/2/3 に分けています。

    #817 の run_contract_review_once.py / ensure_contract_snapshot.py は human_judgment を扱う設計ですが、それを CONTRACT_REVIEW_RESULT_V1.status: human_judgment として投稿してはいけません。V1 互換性を壊します。

    推奨 mapping はこれです。

    Source Wrapper status 投稿する CONTRACT_REVIEW_RESULT_V1
    readiness go + blockers ok + product spec pass + VC pass go status: go
    readiness needs_fix / product spec fail / VC blocked blocked status: blocked
    tool error / auth error / native dependency ambiguity / classifier unknown human_judgment V1 snapshot は投稿しない。diagnostic artifact のみ、または別 marker
    stale body sha / newer blocked / conflicting comments stale_or_conflicting_snapshot 投稿しない

    V1 の top-level に human_judgment を入れたいなら、CONTRACT_REVIEW_RESULT_V2 として schema version を上げ、docs/dev/schema-governance.md 登録を必須化してください。#817 の Notes は「登録要否を PR レビューで判断」としていますが、これは弱いです。V1 互換性に関わるため Issue 側で固定すべきです。


    Blocker 3: #66 と #790 との責務境界が曖昧なまま、3 つ目の contract parser が生まれる

    #66 は contract_snapshot_url の status: go を自動確認する verify-contract-snapshot.py を implement-issue 側へ追加する open Issue です。#817 の Delivery Rule も #66 との近接を認識していますが、統合方針が AC になっていません。

    #790 は agent_preflight_bundle.py / generate_task_packet.py で intake 情報を compact stdout と artifact に固定し、missing contract snapshot 時に NEXT_ACTION: run issue-contract-review を返す設計です。ただし、CONTRACT_REVIEW_RESULT_V1 の自動 materialize は明確に out of scope です。

    #817 はこの 2 つと衝突します。今のままだと、以下が分裂します。

    修正案は 2 択です。

    1. 実装: impl-review-loop の missing_contract_go で issue-contract-review を自動 materialize する #817 を canonical parser 化する
      contract_review_result_parser.py のような共有 helper を作り、実装: contract_snapshot_url の status: go を自動確認するスクリプトを implement-issue に追加する #66 はそれを使う設計に変更する。実装: contract_snapshot_url の status: go を自動確認するスクリプトを implement-issue に追加する #66 は 実装: impl-review-loop の missing_contract_go で issue-contract-review を自動 materialize する #817 に統合クローズする。

    2. 実装: contract_snapshot_url の status: go を自動確認するスクリプトを implement-issue に追加する #66 を canonical parser として先に実装する
      実装: impl-review-loop の missing_contract_go で issue-contract-review を自動 materialize する #817 は 実装: contract_snapshot_url の status: go を自動確認するスクリプトを implement-issue に追加する #66 の parser を呼び出し、materialization だけを追加する。

    どちらでもよいですが、#817 の AC に「#66 との統合・重複回避が記録されている」を追加すべきです。


    Blocker 4: Issue body / comments / subprocess 結果が non-atomic で、stale snapshot を投稿しうる

    #817 は body_sha256 による stale 判定を要求していますが、既存 script はそれぞれ独立に GitHub から Issue body を取得します。contract_readiness_check.py は gh issue view --json body を呼びます。 check_product_spec_contract.py も別途 gh issue view --json title,body,labels を呼びます。

    このまま run_contract_review_once.py が「薄い orchestration」として各 script を順番に叩くと、途中で Issue body が更新された場合に、複数の body version に基づく合成 snapshot が生成されます。これは contract snapshot として危険です。

    GitHub issue comments API はデフォルトで ascending ID 順、per_page は最大 100 です。コメント選択は全ページ取得と明示的な ordering が必要です。([GitHub Docs]1) また、comment 作成には Issues または Pull requests の write permission が必要で、201 以外に 403/404/410/422 が返り得ます。([GitHub Docs]1)

    必要な実装契約はこれです。

    1. ensure_contract_snapshot が issue body, issue updated_at, comments を最初に取得
    2. body_sha256 と comments_digest を artifact に保存
    3. subprocess には可能な限り --body-file を渡す
    4. body-file 非対応 script を呼ぶ場合、実行前後で issue.updated_at が変わっていないことを検証
    5. 投稿直前に issue body / updated_at を再取得
    6. body_sha256 が変わっていたら exit 50 stale_or_conflicting_snapshot、投稿禁止
    

    check_product_spec_contract.py に --body-file を追加しないなら、#817 の “deterministic materialization” はかなり弱いです。Allowed Paths へ check_product_spec_contract.py を追加するか、non-atomic を明示的な human_judgment に落としてください。


    Blocker 5: check_blockers.sh の fallback parser が SKILL.md の仕様と矛盾している

    issue-contract-review/SKILL.md は、fallback Depends on #N parsing を「専用セクションの line-anchored 宣言文のみ」に限定し、Delivery Rule や歴史的注記や conditional examples は blocker と見なさない、と明記しています。

    しかし実装の check_blockers.sh は、Pattern 1 で body 全体から Depends on #N を grep しています。つまり Delivery Rule や Notes に出た Depends on #N も拾います。

    #817 は「既存 preflight scripts 自体のロジック変更」を out of scope にしています。だが、このまま自動 materialize すると、既存の曖昧な fallback parser による false block / false mismatch を自動 workflow に組み込むことになります。

    推奨対応:

    GitHub の issue dependencies API は “List dependencies an issue is blocked by” として公式に提供され、read permission で取得できます。native API を primary にする設計自体は妥当です。([GitHub Docs]2)


    Blocker 6: 自動投稿の idempotency / rate limit / permission handling が粗い

    #817 は --post と dry-run 既定を要求していますが、投稿時の error classification が不足しています。GitHub REST API では secondary rate limit 超過時に 403 または 429 が返り、retry-after 等に従う必要があります。([GitHub Docs]3) また、GitHub は同時・高頻度 request による secondary limit も明記しています。([GitHub Docs]3)

    ensure_contract_snapshot.py には最低限これを入れるべきです。

    post_status:
      not_requested
      dry_run
      posted
      deduped_existing
      permission_denied
      rate_limited
      validation_failed_or_spam
      ambiguous_no_retry

    盲目的 retry は禁止です。投稿 API が timeout / transport error になった場合も、再投稿前に comment 一覧を再取得し、idempotency marker が存在するか確認する必要があります。

    推奨 marker:

    <!-- loop-protocol:contract-snapshot issue=817 body_sha256=sha256:<...> schema=CONTRACT_REVIEW_RESULT_V1 -->

    created_at desc, id desc の latest 判定とは別に、同一 body_sha256 の同一 schema marker があれば repost しない、を AC にしてください。


    Blocker 7: run_contract_review_once.py の unit test が「Markdown grep test」になる危険がある

    #778 の review で指摘されたのと同じ罠です。仕様書に文字列があることを確認するだけでは、executor / classifier / poller / result builder は保証されません。#778 では fake gh runner / fake poller で executable wrapper を叩く方向に修正されました。

    #817 の AC6 は「unit test が PASS」としか書いていないため不十分です。以下の golden case を AC に追加してください。

    ensure_contract_snapshot.py
    - existing valid go → no post, source=existing_go, exit 0
    - latest blocked newer than go → no post, exit 10
    - go body_sha mismatch → no post, exit 50
    - issue body updated between read and post → no post, exit 50
    - dry-run --post equivalent path → would_post=true, mutationなし
    - 403/429 from comment create → no retry, rate_limited/permission_denied
    - duplicate idempotency marker exists → deduped_existing
    
    run_contract_review_once.py
    - readiness go + blocker ok + product spec pass + VC pass → go
    - readiness needs_fix → blocked
    - product spec fail → blocked
    - product spec human_judgment → human_judgment
    - native dependency API unavailable + ambiguous fallback → human_judgment
    - subprocess JSON parse failure → runtime_error / human_judgment, not go
    

    --issue-number alias は妥当。ただし実装は最小でよい

    contract_readiness_check.py は現在 --issue だけを受け取り、--issue-number はありません。 Python argparse は parser.add_argument('-f', '--foo') のように複数 option string を 1 つの argument に割り当てられるため、alias 追加は安全にできます。([Python documentation]4)

    実装はこれで足ります。

    parser.add_argument(
        "--issue",
        "--issue-number",
        dest="issue",
        type=int,
        help="GitHub Issue number",
    )

    追加 test は --issue と --issue-number が同じ args.issue へ入ること、help に両方出ること、既存 --body-file 優先挙動が壊れないこと、の 3 つで十分です。


    Issue #817 本文への具体的な修正案

    1. Decisions Fixed を追加

    ## Decisions Fixed
    
    - `CONTRACT_REVIEW_RESULT_V1.status` は `go | blocked` のまま維持する。
    - `human_judgment` は `CONTRACT_REVIEW_ONCE_RESULT_V1` / `CONTRACT_SNAPSHOT_ENSURE_RESULT_V1` の wrapper status として扱い、V1 snapshot として投稿しない。
    - #564 の fail-only gate は `missing_contract_go` に限って supersede する。他の intake failure は fail-closed のまま。
    - #66 の `verify-contract-snapshot.py` と valid snapshot parser を重複実装しない。統合方針を PR 本文に記録する。
    - #790 の preflight bundle artifact が存在する場合は再読解せず入力として利用する。存在しない場合のみ self-contained に取得する。

    2. Acceptance Criteria を増やす

    - [ ] AC0: `preparation.md` に `missing_contract_go` の fail-only 廃止文言と自動 materialize 文言が矛盾して併存していない
    - [ ] AC8: `CONTRACT_REVIEW_RESULT_V1.status` に `human_judgment` を投稿しないことを unit test で固定する
    - [ ] AC9: issue body が materialization 中に更新された場合、投稿せず `stale_or_conflicting_snapshot` で exit 50 になる
    - [ ] AC10: GitHub comment 投稿は idempotency marker により重複投稿されない
    - [ ] AC11: 403 / 429 / 422 from comment create を盲目的に retry しない
    - [ ] AC12: #66 との統合・重複回避判断が PR body に記録されている

    3. Allowed Paths の見直し

    今の Allowed Paths だけでは、共有 parser や product spec body-file 対応を入れにくいです。少なくとも次を検討してください。

    - .claude/skills/issue-contract-review/scripts/contract_review_result_parser.py
    - .claude/skills/issue-contract-review/tests/test_contract_review_result_parser.py

    check_product_spec_contract.py に --body-file を追加するなら、これも Allowed Paths に入れるべきです。check_blockers.sh の fallback parser 修正は #817 に入れるとスコープ肥大化するので、別 Issue 推奨です。


    最終評価

    #817 は parent #816 の token/context 削減には必要です。ただし現状のままでは、人間の Y を減らす代わりに、自動化された stale/duplicate/ambiguous comment 投稿リスクを増やす設計です。

    実装に回す前に直すべき優先順位は次です。

    1. CONTRACT_REVIEW_RESULT_V1 と wrapper schema の status mapping を固定する。
    2. 実装: issue-refinement-loop と impl-review-loop の implementation-ready handoff を contract gate 化する #564 fail-only gate をどこまで supersede するか明文化する。
    3. 実装: contract_snapshot_url の status: go を自動確認するスクリプトを implement-issue に追加する #66 / 実装: agent preflight bundle と task packet generator を追加する #790 との parser・intake 重複を解消する。
    4. body/comment snapshot の atomicity と idempotent post を AC 化する。
    5. check_blockers.sh fallback parser 矛盾を human_judgment または follow-up に逃がす。
    6. unit test を fake runner / golden JSON 中心にし、Markdown grep test にしない。

    この修正後なら、#817 は実装に回してよいです。現時点では REQUEST_CHANGES が妥当です。

  17. squne121 commented on Jun 12, 2026

    @squne121
    OwnerAuthor

    Refinement Loop: Approved

    The issue has been approved and is ready for implementation.

  18. squne121 commented on Jun 12, 2026

    @squne121
    OwnerAuthor

    ClaudeCode作業ログ

     ▐▛███▜▌   Claude Code v2.1.175
    ▝▜█████▛▘  Sonnet 4.6 with medium effort · Claude Max
      ▘▘ ▝▝    ~/projects/LOOP_PROTOCOL
    
     ▎ Meet Fable 5, our newest model for complex, long-running work. Switch anytime with
     ▎ /model.
     ▎ Included in your plan limits until Jun 22, then switch to usage credits to continue.
    
    ❯ /clear
    
    ❯ https://github.com/squne121/loop-protocol/issues/817#issuecomment-4692693974
      を対象に issue-refinement-loop を人間承認不要で行って。
    
    ● Skill(issue-refinement-loop)
      ⎿  Successfully loaded skill
    
    ● Issue #817 の refinement loop を開始します。まず Step 0f の preflight を実行します。
    
    ● Bash(uv run python3
          .claude/skills/issue-refinement-loop/scripts/run_refinement_preflight.py \
            --issue-number 817 \…)
      ⎿  STATUS: pass
         NEXT_ACTION: proceed
         MUST_READ:
         … +12 lines (ctrl+o to expand)
    
    ● Bash(cat /home/squne/projects/LOOP_PROTOCOL/.claude/artifacts/issue-refinement-loop/817/re
          finement_preflight_result_v1.json | python3 -m json.tool 2>&1 | head -100)
      ⎿  {
             "schema_version": "refinement_preflight_result/v1",
             "status": "pass",
         … +39 lines (ctrl+o to expand)
    
    ● preflight pass。planner input を確認して investigation policy を確認します。
    
    ● Bash(cat /home/squne/projects/LOOP_PROTOCOL/.claude/artifacts/issue-refinement-loop/817/pl
          anner_input.json | python3 -m json.tool 2>&1)
      ⎿  {
             "schema_version": "refinement_loop_planner_input/v1",
             "issue": {
         … +382 lines (ctrl+o to expand)
    
    ● Bash(cat /home/squne/projects/LOOP_PROTOCOL/.claude/artifacts/issue-refinement-loop/817/pl
          anner_input.json | python3 -c "
          import json, sys…)
      ⎿  investigation_policy: {}
         web_research_policy: {}
         scope_rollup_decision: {}
    
    ● Bash(cat /home/squne/projects/LOOP_PROTOCOL/.claude/artifacts/issue-refinement-loop/817/pl
          anner_input.json | python3 -c "
          import json, sys…)
      ⎿  top-level keys: ['schema_version', 'issue', 'comments']
         plan keys: not found
    
      Listed 1 directory (ctrl+o to expand)
    
    ● Bash(cat /home/squne/projects/LOOP_PROTOCOL/.claude/artifacts/issue-refinement-loop/817/pl
          anner_input.json | \
            uv run python3 .claude/skills/issue-refinement-loop/…)
      ⎿  {
           "schema_version": "refinement_loop_plan/v1",
           "source": {
         … +97 lines (ctrl+o to expand)
    
    ● investigation_policy と web_research_policy の両方が required。anchor comment
      の内容を確認します。
    
    ● Bash(gh issue view 817 --repo squne121/loop-protocol --json title,body,state 2>&1 |
          python3 -c "
          import json, sys…)
      ⎿  Title: 実装: impl-review-loop の missing_contract_go で issue-contract-review を自
         動 materialize する
         State: OPEN
         … +55 lines (ctrl+o to expand)
    
    ● Bash(gh api repos/squne121/loop-protocol/issues/comments/4692693974 --jq '.body' 2>&1 |
          head -100)
      ⎿  <html>
         <body>
         <!--StartFragment--><html><head></head><body><h2>総合判定: <strong>REQUEST_CHANGES
         … +207 lines (ctrl+o to expand)
    
    ● Bash(gh api rate_limit --jq '.resources.core | {limit, used, remaining, reset}' 2>&1)
      ⎿  {
           "limit": 5000,
           "remaining": 4932,
         … +3 lines (ctrl+o to expand)
    
    ● Rate limit は問題なし。Step 1(investigation)と Step 1b(web research)を実行します。まず
      investigation を codebase-investigator に委譲します。
    
    ● codebase-investigator(Issue #817 codebase investigation)
      ⎿  Done (12 tool uses · 51.2k tokens · 43s)
      (ctrl+o to expand)
    
    ● investigation 完了。ensure_contract_snapshot.py / run_contract_review_once.py
      は未作成。Step 2: review を実行します。
    
    ● issue-reviewer(Issue #817 review)
      ⎿  Done (8 tool uses · 30.7k tokens · 1m 7s)
      (ctrl+o to expand)
    
    ● VERDICT: needs-fix。Step 4: Rewrite を実行します。まず現在の Issue 本文全体を確認します。
    
    ● Bash(gh issue view 817 --repo squne121/loop-protocol --json body --jq '.body' 2>&1)
      ⎿  ## Machine-Readable Contract
    
         ```yaml
         … +124 lines (ctrl+o to expand)
    
    ● 現在の Issue 本文全体を確認しました。anchor comment の 7 つの Blocker と C4 VC
      不備を反映した新本文を作成して issue-author に適用します。
    
    ● issue-author(Issue #817 body rewrite)
      ⎿  Done (9 tool uses · 26.9k tokens · 1m 59s)
      (ctrl+o to expand)
    
    ● 本文更新成功。Step 2 (Review) を再実行します。
    
    ● issue-reviewer(Issue #817 review iteration 2)
      ⎿  Done (7 tool uses · 29.9k tokens · 1m 16s)
      (ctrl+o to expand)
    
    ● あと1箇所だけ: AC12 の VC コメント行を # AC12 のみに修正します。
    
    ● Bash(gh issue view 817 --repo squne121/loop-protocol --json body --jq '.body' >
          /tmp/issue_817_body.md && grep -n "AC12" /tmp/issue_817_body.md)
      ⎿  88:- [ ] AC12: #66 との統合・重複回避判断が PR body に記録されている
         117:# AC12: PR body に #66 言及あり(PR 作成時に人間 reviewer が確認)
    
    ● Bash(sed -i 's|# AC12: PR body に #66 言及あり(PR 作成時に人間 reviewer が確認)|# AC12|'
          /tmp/issue_817_body.md && grep -n "AC12" /tmp/issue_817_body.md)
      ⎿  88:- [ ] AC12: #66 との統合・重複回避判断が PR body に記録されている
         117:# AC12
    
    ● Bash(gh issue edit 817 --repo squne121/loop-protocol --body-file /tmp/issue_817_body.md &&
          echo "updated")
      ⎿  https://github.com/squne121/loop-protocol/issues/817
         updated
    
    ● Step 2 (Review) 最終確認を実行します。
    
    ● issue-reviewer(Issue #817 final review)
      ⎿  Done (8 tool uses · 28.5k tokens · 1m 16s)
      (ctrl+o to expand)
    
    ● VERDICT: approve。Step 4.5 (follow-up materialization) を確認して Step 5 (Termination)
      に進みます。
    
    ● Bash(echo '{"termination_reason":"approved","issue_number":817}' | \
            uv run python3
          .claude/skills/issue-refinement-loop/scripts/publish_termination_report.py \…)
      ⎿  [publish_termination_report] comment posted for issue #817
    
    ● Issue #817 の refinement loop が完了しました。
    
      結果:
      - anchor comment (#issuecomment-4692693974) の REQUEST_CHANGES(7 Blockers)を全て反映
      - ## Decisions Fixed セクションを新設(#564 supersede 範囲・V1 schema 互換性・#66/#790
      統合方針)
      - AC0, AC8–AC12 を追加(V1 human_judgment 投稿禁止・stale snapshot exit
      50・idempotency・rate limit・#66 統合記録)
      - Allowed Paths に contract_review_result_parser.py を追加
      - ## In Scope に atomicity / idempotent post / check_blockers.sh fallback /
      LOOP_STATE.contract_materialization を明記
      - VERDICT: approve で終了、終了レポートを Issue にコメント投稿済み
    
    ✻ Brewed for 12m 4s
    
  19. squne121 commented on Jun 12, 2026

    @squne121
    OwnerAuthor

    Contract Snapshot (2026-06-13T08:01:00Z)

    • Outcome: ensure_contract_snapshot.py / run_contract_review_once.py / --issue-number alias / preparation.md の自動 routing 変更と対応 unit test が 1 PR で追加され、missing_contract_go から人間介入なしで決定論的に進める状態
    • Acceptance Criteria: AC0〜AC12(13 項目)
    • Verification Commands: AC0–AC12 各 rg / test -f / uv run pytest / pnpm test
    • Allowed Paths:
      • .claude/skills/impl-review-loop/SKILL.md
      • .claude/skills/impl-review-loop/steps/preparation.md
      • .claude/skills/impl-review-loop/scripts/ensure_contract_snapshot.py
      • .claude/skills/impl-review-loop/tests/test_ensure_contract_snapshot.py
      • .claude/skills/issue-contract-review/SKILL.md
      • .claude/skills/issue-contract-review/scripts/run_contract_review_once.py
      • .claude/skills/issue-contract-review/scripts/contract_readiness_check.py
      • .claude/skills/issue-contract-review/scripts/contract_review_result_parser.py
      • .claude/skills/issue-contract-review/tests/test_run_contract_review_once.py
      • .claude/skills/issue-contract-review/tests/test_contract_readiness_check.py
      • .claude/skills/issue-contract-review/tests/test_contract_review_result_parser.py
    • Worktree: .claude/worktrees/issue-817-impl-review-loop-missing-contract-go-iss
    • Branch: worktree-issue-817-impl-review-loop-missing-contract-go-iss
    • VC preflight: baseline fail = 11, 想定外 pass = 0, 実行不可 = 0, regression gate pass = 1 (pnpm test)
    CONTRACT_REVIEW_RESULT_V1:
      status: go
      generated_at: "2026-06-13T08:01:00Z"
      generated_by: issue-contract-review
      issue_url: https://github.com/squne121/loop-protocol/issues/817
      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: 11
          vc_passed_unexpectedly: 0
          vc_unrunnable: 0
          vc_expected_pass: 1
          vc_skipped: 0
          classifications:
            - ac: AC0
              command: "rg -n \"ensure_contract_snapshot\" .claude/skills/impl-review-loop/steps/preparation.md"
              exit_code: 1
              category: expected_baseline_fail
              scope_class: baseline_fail_expected
              confidence: high
              decision: go
            - ac: AC1
              command: "test -f .claude/skills/impl-review-loop/scripts/ensure_contract_snapshot.py"
              exit_code: 1
              category: file_not_found_expected
              scope_class: baseline_fail_expected
              confidence: high
              decision: go
            - ac: AC2
              command: "test -f .claude/skills/issue-contract-review/scripts/run_contract_review_once.py"
              exit_code: 1
              category: file_not_found_expected
              scope_class: baseline_fail_expected
              confidence: high
              decision: go
            - ac: AC3
              command: "rg -n \"issue-number\" .claude/skills/issue-contract-review/scripts/contract_readiness_check.py"
              exit_code: 1
              category: expected_baseline_fail
              scope_class: baseline_fail_expected
              confidence: high
              decision: go
            - ac: AC4
              command: "rg -n \"ensure_contract_snapshot\" .claude/skills/impl-review-loop/steps/preparation.md"
              exit_code: 1
              category: expected_baseline_fail
              scope_class: baseline_fail_expected
              confidence: high
              decision: go
            - ac: AC5
              command: "uv run pytest .claude/skills/impl-review-loop/tests/test_ensure_contract_snapshot.py -v"
              exit_code: 4
              category: expected_baseline_fail
              scope_class: baseline_fail_expected
              confidence: high
              decision: go
            - ac: AC6
              command: "uv run pytest .claude/skills/issue-contract-review/tests/test_run_contract_review_once.py -v"
              exit_code: 4
              category: expected_baseline_fail
              scope_class: baseline_fail_expected
              confidence: high
              decision: go
            - ac: AC7
              command: "pnpm test"
              exit_code: 0
              category: regression_gate
              scope_class: regression_gate
              confidence: low
              decision: go
            - ac: AC8
              command: "uv run pytest .claude/skills/impl-review-loop/tests/test_ensure_contract_snapshot.py -k \"human_judgment\" -v"
              exit_code: 4
              category: expected_baseline_fail
              scope_class: baseline_fail_expected
              confidence: high
              decision: go
            - ac: AC9
              command: "uv run pytest .claude/skills/impl-review-loop/tests/test_ensure_contract_snapshot.py -k \"stale\" -v"
              exit_code: 4
              category: expected_baseline_fail
              scope_class: baseline_fail_expected
              confidence: high
              decision: go
            - ac: AC10
              command: "uv run pytest .claude/skills/impl-review-loop/tests/test_ensure_contract_snapshot.py -k \"idempotency or dedup\" -v"
              exit_code: 4
              category: expected_baseline_fail
              scope_class: baseline_fail_expected
              confidence: high
              decision: go
            - ac: AC11
              command: "uv run pytest .claude/skills/impl-review-loop/tests/test_ensure_contract_snapshot.py -k \"rate_limit or permission\" -v"
              exit_code: 4
              category: expected_baseline_fail
              scope_class: baseline_fail_expected
              confidence: high
              decision: go
        ac_verifiability: pass
        product_spec_check:
          applicability: not_applicable
          decision: pass
        worktree_branch_collision: clear
      next_action: implement_issue
      blocked_reasons: []
      warnings: []
  20. squne121 commented on Jun 13, 2026

    @squne121
    OwnerAuthor

    post-merge-cleanup: 完了 (2026-06-13T00:05:00Z)

    FOLLOW_UP_MATERIALIZATION_RESULT_V1:
      schema_version: 1
      materialized_by: post-merge-cleanup
      follow_up_issues:
        - request_dedupe_key: "schema-governance:CONTRACT_REVIEW_ONCE_RESULT_V1/CONTRACT_SNAPSHOT_ENSURE_RESULT_V1"
          status: reused_open
          issue:
            number: 832
            url: "https://github.com/squne121/loop-protocol/issues/832"
          reason: "PR #830 で既に起票済み"
    
      note_only_observations: []
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