Skip to content

実装: WSL2/Ubuntu human playtest 実行環境 runbook と preflight を追加する #561

Closed

Description

@squne121

Machine-Readable Contract

contract_schema_version: v1
issue_kind: implementation
goal_ref: "#543 の human manual playtest を WSL2/Ubuntu 環境で再現可能に実行できる状態にする"
change_kind: docs+tooling
parent_issue: 543

Parent Issue

#543

Parent Goal Ref

Current Validated Scope

  • docs/playtest/manual-playtest-runbook.md の新規追加(WSL2/Ubuntu primary path + Windows browser 経由)
  • docs/playtest/m2-combat-mvp.md からの runbook 参照追加
  • 必要なら scripts/check-manual-playtest-env.mjs を追加し preflight を自動化

Remaining Parent Gaps

Outcome

WSL2/Ubuntu で manual playtest を行うための runbook が追加され、#543 の tester が以下を迷わず実行できる状態になる: 環境確認 → 依存関係 install → preview server 起動 → Windows browser でアクセス → 操作確認 → screenshot / video evidence 取得 → docs/playtest/m2-combat-mvp.md へ証跡記録。

Background

#543 は human manual playtest の証跡追加を要求しているが、WSL2/Ubuntu 上で人間が pnpm dev / pnpm preview を起動し、ブラウザで確認できるかの実行環境準備が明文化されていない。

現状の docs/playtest/m2-combat-mvp.md には platform: linux (WSL2)、browser: chromium (Playwright) が記録されているが、これは Playwright 自動 E2E の環境証跡であり、human manual playtest の実行環境準備としては不足している。

WSL2/Ubuntu での実行可能性については技術的には可能であり、Windows 側ブラウザから WSL 内の Node/Vite サーバーへ localhost でアクセスする経路が利用できる。Vite の WSL2 での host/port binding に注意が必要。

In Scope

  • WSL2/Ubuntu manual playtest runbook の追加(docs/playtest/manual-playtest-runbook.md)
  • pnpm build → pnpm preview -- --host 127.0.0.1 --port 4173 --strictPort を primary path として明記
  • pnpm dev は fallback path として明記
  • Windows browser からは http://localhost:4173 でアクセスすることを明記
  • 0.0.0.0 / WSL IP / WSLg は fallback として明記(primary path には使わない)
  • Node / pnpm / browser install 状態の確認手順
  • Vite server の host / port 方針: primary は 127.0.0.1:4173 で fixed とする(--strictPort 必須)
  • screenshot / video evidence の取得手順
  • docs/playtest/m2-combat-mvp.md から runbook への参照追加
  • 必要なら scripts/check-manual-playtest-env.mjs を追加し最低限の preflight を自動化

Out of Scope

  • M2 戦闘仕様の変更
  • CanvasRenderer / HudController の描画仕様変更
  • Playwright E2E spec の拡張
  • Windows / macOS native 環境の完全サポート
  • LAN / mobile device からのアクセス保証
  • WSL2/Ubuntu 以外の環境での完全サポート
  • human manual playtest evidence の記入(test(#483): manual playtest の実施証跡を docs/playtest/m2-combat-mvp.md に追加する #543 の作業)
  • docs/playtest/m2-combat-mvp.md の status を accepted / accepted_with_deferred に変更すること
  • screenshot / video evidence を捏造または自動 E2E evidence で代替すること

Acceptance Criteria

  • AC1: docs/playtest/manual-playtest-runbook.md が追加されている
  • AC2: runbook に WSL2/Ubuntu primary path がある
  • AC3: runbook に required OS/runtime: WSL2 + Ubuntu が明記されている
  • AC4: runbook に pnpm build と pnpm preview -- --host 127.0.0.1 --port 4173 --strictPort の実行手順が明記されている
  • AC5: runbook に primary browser route(Windows browser → http://localhost:4173)が明記されている
  • AC6: runbook に optional browser route(WSLg/Linux browser)が明記されている
  • AC7: runbook に expected ports and host binding が明記されている(primary: 127.0.0.1:4173、--strictPort 必須)
  • AC8: runbook に screenshot/video evidence capture method が明記されている
  • AC9: runbook に common failure cases and remedies が明記されている
  • AC10: docs/playtest/m2-combat-mvp.md から runbook が参照されている
  • AC11: preflight script scripts/check-manual-playtest-env.mjs が追加され、Node version(Node 20 / pnpm 9〜10 互換 または Node 22+ / pnpm 11+ 互換)/ pnpm availability / pnpm-lock.yaml の存在 / pnpm build script の存在 / preview port 4173 の 127.0.0.1 bind 可否(net モジュールで確認)/ WSL2 detection(WSL_DISTRO_NAME または /proc/version)の確認が含まれる。exit code: 0=ok, 1=fail, 2=unsupported。pnpm install や pnpm build は実行しない(非破壊チェックのみ)。
  • AC12: pnpm typecheck && pnpm lint && pnpm test && pnpm build が通る。実装者は加えて pnpm lint:docs を手動実行し、docs lint が通ることを確認する。

Verification Commands

# AC12
$ pnpm typecheck
$ pnpm lint
$ pnpm test
$ pnpm build
# AC1
$ test -f docs/playtest/manual-playtest-runbook.md
# AC2
$ rg "WSL2\|Ubuntu" docs/playtest/manual-playtest-runbook.md
# AC3
$ rg "WSL2.*Ubuntu\|Ubuntu.*WSL2\|required.*OS\|OS.*WSL2" docs/playtest/manual-playtest-runbook.md
# AC4
$ rg -n "pnpm build" docs/playtest/manual-playtest-runbook.md
$ rg -n "pnpm preview -- --host 127\.0\.0\.1 --port 4173 --strictPort" docs/playtest/manual-playtest-runbook.md
# AC5
$ rg -n "http://localhost:4173" docs/playtest/manual-playtest-runbook.md
$ rg -n "Windows browser|Windows 側ブラウザ" docs/playtest/manual-playtest-runbook.md
# AC6
$ rg "WSLg\|optional\|Linux browser" docs/playtest/manual-playtest-runbook.md
# AC7
$ rg -n "127\.0\.0\.1|4173|strictPort" docs/playtest/manual-playtest-runbook.md
# AC8
$ rg "screenshot\|video\|evidence" docs/playtest/manual-playtest-runbook.md
# AC9
$ rg "failure\|troubleshoot\|remedy\|common" docs/playtest/manual-playtest-runbook.md
# AC10
$ rg "manual-playtest-runbook" docs/playtest/m2-combat-mvp.md
# AC11
$ test -f scripts/check-manual-playtest-env.mjs

Allowed Paths

  • docs/playtest/manual-playtest-runbook.md
  • docs/playtest/m2-combat-mvp.md
  • scripts/check-manual-playtest-env.mjs
  • package.json

Stop Conditions

  • WSL2/Ubuntu 以外の環境サポートが必要になった場合は作業を停止する
  • Vite config の恒久変更が必要になった場合は作業を停止する
  • Playwright E2E の設計変更が必要になった場合は作業を停止する
  • test(#483): manual playtest の実施証跡を docs/playtest/m2-combat-mvp.md に追加する #543 の manual playtest scope 自体を変更する必要が出た場合は作業を停止する
  • Allowed Paths 外の変更が必要になった場合は作業を停止する
  • runbook が特定の OS バージョン・ハードウェア依存になることが判明した場合は作業を停止する

Runtime Verification Applicability

decision: immediate
reason: scripts/check-manual-playtest-env.mjs は実行可能な runtime artifact であり、実装後に node 実行による動作検証が必要。exit code の仕様(0=ok/1=fail/2=unsupported)と非破壊性を確認すること。
applicable_acs:
  - AC11
execution_environment:
  cli_tools:
    - node
  auth_required: false
  network_required: false
skip_conditions:
  - "WSL2/Ubuntu 環境でない場合(exit code 2)は environment_blocked として扱う(SKIP ではない)"
fallback_policy:
  fallback_success_is_pass: false
  notes: "fallback 経由の成功を PASS に変換しない。exit code 0 のみ PASS"
artifact_requirements:
  - "node scripts/check-manual-playtest-env.mjs の stdout と exit code 記録"

Required Skills

  • WSL2/Ubuntu ネットワーキング(Windows browser → localhost 経路)
  • Vite server host/port 設定
  • Node.js / pnpm 環境操作
  • WSLg GUI アプリ基礎知識(optional path 用)

Activity

  1. added
    documentation
    triage-required
    on Jun 2, 2026
  2. squne121 commented on Jun 2, 2026

    @squne121
    OwnerAuthor

    結論: REQUEST_CHANGES

    #561 の方向性は正しいです。#543/#483 の「人間による M2 manual playtest」を実行可能にするため、WSL2/Ubuntu 用 runbook を先に整備するのは妥当です。ただし、現契約のままだと docs-only Issue を装いながら実行スクリプトを含める矛盾、preflight の optional/mandatory 不整合、WSL2/Vite/pnpm の実運用リスクの過小指定により、低品質な runbook でも AC を通過できます。

    関連関係はこう見ます。#561 は #543 の準備 Issue で、#543 は #483 の Product Acceptance Pending を解消するための人間 manual playtest 証跡を要求しています。#541/#548 で Canvas/HUD の自動 E2E 側は改善済みですが、#483 の close condition は依然として人間の manual playtest evidence を要求しています。したがって #561 は「証跡を作る Issue」ではなく、「人間が証跡を作れる環境手順を整える Issue」として閉じるべきです。([GitHub]1)

    Blocker 1: Runtime Verification: not_applicable が契約と矛盾している

    #561 は change_kind: docs かつ Runtime Verification を not_applicable としていますが、Allowed Paths と AC/VC に scripts/check-manual-playtest-env.mjs が入っています。これは docs ではなく実行可能配布物です。追加するなら runtime artifact であり、最低限「スクリプト自体の実行検証」「非破壊性」「exit code 仕様」「WSL2 以外での挙動」を契約化すべきです。([GitHub]1)

    修正案: どちらかに寄せるべきです。

    A. docs-only にする場合:

    allowed_paths:
      - docs/playtest/manual-playtest-runbook.md
      - docs/playtest/m2-combat-mvp.md
    runtime_verification:
      decision: not_applicable

    B. preflight を成果物にする場合:

    change_kind: docs+tooling
    allowed_paths:
      - docs/playtest/manual-playtest-runbook.md
      - docs/playtest/m2-combat-mvp.md
      - scripts/check-manual-playtest-env.mjs
      - package.json
    runtime_verification:
      decision: applicable
      required:
        - node scripts/check-manual-playtest-env.mjs
        - pnpm typecheck
        - pnpm lint
        - pnpm test
        - pnpm build

    私は B を推奨します。Issue タイトルが「runbook と preflight を追加する」なので、preflight を optional にすると成果物の芯がぼけます。

    Blocker 2: AC11 は optional なのに VC は mandatory

    AC11 は「preflight script を追加する場合」と条件付きですが、Verification Commands では node scripts/check-manual-playtest-env.mjs を無条件実行しています。これでは、スクリプトを追加しない実装が AC 上は合法でも VC で必ず失敗します。([GitHub]1)

    修正案:

    preflight を mandatory にするなら:

    test -f scripts/check-manual-playtest-env.mjs
    node scripts/check-manual-playtest-env.mjs

    optional のままにするなら:

    test ! -f scripts/check-manual-playtest-env.mjs || node scripts/check-manual-playtest-env.mjs

    ただし、manual playtest の再現性を上げる目的なら mandatory のほうがよいです。

    Blocker 3: WSL2 + Vite の接続手順が実運用に耐えるほど固定されていない

    #561 は Windows browser から WSL2 上の preview/dev server へアクセスする手順を要求していますが、AC は port|host の grep 程度です。これでは pnpm preview がデフォルト port 4173 から自動で別 port にずれた場合や、0.0.0.0 を不要に使って LAN exposure を広げた場合でも通ってしまいます。

    Microsoft の WSL docs では、既定 NAT モードなら Windows 側から Linux/WSL 側の server に localhost で接続できる一方、remote/LAN access では 0.0.0.0 bind や portproxy が別途問題になります。Vite も --host 0.0.0.0 や --host は全 interface listen であり、WSL2 で LAN 側へ出すには WSL 側の追加考慮が必要です。([Microsoft Learn]2)

    primary path は固定すべきです。

    pnpm build
    pnpm preview -- --host 127.0.0.1 --port 4173 --strictPort

    Windows browser:

    http://localhost:4173
    

    Vite preview の default port は 4173 ですが、空いていない場合は自動 increment します。manual evidence の URL を安定させるには --strictPort を明示したほうがよいです。([vitejs]3)

    --host 0.0.0.0 は primary ではなく fallback/troubleshooting に落とすべきです。#561 は LAN/mobile access を out-of-scope にしているため、最初から wildcard bind を推奨するのは scope と衝突します。([GitHub]1)

    Blocker 4: Node/pnpm の version contract が曖昧

    既存 README は corepack enable, pnpm install, pnpm dev, pnpm build, pnpm preview を案内しており、package.json には dev, build, preview, test:e2e などの scripts はあります。一方で、確認範囲の package.json には packageManager field が見えません。([GitHub]4)

    pnpm 公式は、pnpm 11 は Node.js 22 以上を要求し、pnpm 9/10 は Node.js 20 をサポートするとしています。つまり runbook が「Node >=20」「Corepack で pnpm latest」風の案内をすると、Node 20 環境で pnpm 11 を引いて壊れる可能性があります。([pnpm]5)

    修正案:

    • package.json に packageManager を入れるなら、Node 20 対応を維持するため exact な pnpm 10 系を pin する。
    • 逆に pnpm 11 を使うなら、runbook と preflight の Node requirement を Node 22+ に上げる。
    • preflight は node --version と pnpm --version の互換性を明示チェックする。

    例:

    {
      "packageManager": "[email protected]"
    }

    バージョン番号は実装時点で選定すべきですが、「Node 20 を許すなら pnpm 11 latest は不可」という制約は契約に入れるべきです。

    Blocker 5: docs 変更なのに docs lint が VC に入っていない

    #561 の VC は pnpm typecheck, pnpm lint, pnpm test, pnpm build を求めていますが、package.json には lint:docs, lint:md, lint:prose が存在します。docs/runbook Issue なら、通常の app gate よりも docs gate を優先して入れるべきです。([GitHub]1)

    追加すべき VC:

    pnpm lint:docs

    可能なら次も入れるべきです。

    pnpm lint:md
    pnpm lint:prose

    Blocker 6: #543 の manual evidence と #561 の runbook 整備を混同しやすい

    #543 は human manual playtest evidence として、日時、commit SHA、OS/browser、操作確認、screenshot/video、accepted/accepted_with_deferred の記録を要求しています。#483 も human manual playtest evidence 追加を close condition にしています。([GitHub]6)

    #561 の実装者が docs/playtest/m2-combat-mvp.md に evidence を埋めて「manual playtest 済み」のように更新すると、AI が人間作業を代替したことになります。これは #543 の趣旨に反します。

    #561 に明記すべき制約:

    out_of_scope:
      - human manual playtest evidence の記入
      - docs/playtest/m2-combat-mvp.md の status を accepted / accepted_with_deferred に変更すること
      - screenshot/video evidence を捏造または自動 E2E evidence で代替すること

    docs/playtest/m2-combat-mvp.md への変更は、runbook へのリンク追加に限定するべきです。

    推奨する preflight script 仕様

    check-manual-playtest-env.mjs を入れるなら、やりすぎないほうがよいです。preflight は「人間が実行前に環境差分を把握する」ための非破壊チェックに限定します。

    最低限:

    - WSL2/Ubuntu らしさを検出する
      - WSL_DISTRO_NAME
      - /proc/sys/kernel/osrelease または /proc/version
    - node --version を表示し、要求範囲外なら fail
    - pnpm --version を表示し、Node との互換性がなければ fail
    - package.json に build / preview scripts があることを確認
    - pnpm-lock.yaml の存在を確認
    - port 4173 が 127.0.0.1 で listen 可能か Node net module で確認
    - Windows browser access は自動判定できないため、manual step として表示する
    - `pnpm install` や `pnpm build` は勝手に実行しない
    

    exit code:

    0 = required checks passed
    1 = required checks failed
    2 = unsupported or out-of-scope environment, with explanation
    

    強化した Verification Commands 案

    現行の rg "port|host" のような広すぎる grep はやめるべきです。少なくとも以下くらいまで具体化してください。

    test -f docs/playtest/manual-playtest-runbook.md
    rg -n "pnpm build" docs/playtest/manual-playtest-runbook.md
    rg -n "pnpm preview -- --host 127\.0\.0\.1 --port 4173 --strictPort" docs/playtest/manual-playtest-runbook.md
    rg -n "http://localhost:4173" docs/playtest/manual-playtest-runbook.md
    rg -n "WSL2|Ubuntu" docs/playtest/manual-playtest-runbook.md
    rg -n "Windows browser|Windows 側ブラウザ" docs/playtest/manual-playtest-runbook.md
    rg -n "commit SHA|OS/browser|screenshot|video|evidence" docs/playtest/manual-playtest-runbook.md
    rg -n "WSLg|Linux browser|optional|fallback" docs/playtest/manual-playtest-runbook.md
    rg -n "manual-playtest-runbook" docs/playtest/m2-combat-mvp.md
    
    test -f scripts/check-manual-playtest-env.mjs
    node scripts/check-manual-playtest-env.mjs
    
    pnpm lint:docs
    pnpm typecheck
    pnpm lint
    pnpm test
    pnpm build

    WSLg は optional 扱いに限定すべき

    #561 は optional WSLg/Linux browser を含めていますが、WSLg は WSL2 が前提で、Windows 10 build 19044+ または Windows 11、vGPU driver などの条件があります。また Microsoft docs も WSLg は full desktop experience ではないと説明しています。したがって primary path に混ぜるべきではありません。([Microsoft Learn]7)

    runbook の構成は次がよいです。

    1. Primary: WSL2 Ubuntu server + Windows browser + localhost:4173
    2. Fallback A: localhost が失敗した場合の WSL IP 確認
    3. Fallback B: WSLg/Linux browser, optional
    4. Explicitly out of scope: LAN/mobile/native Windows/macOS support
    

    WSL IP fallback では hostname -I を使うほうが安全です。Microsoft docs は WSL2 VM の IP 確認で uppercase -I と lowercase -i の差分にも触れています。([Microsoft Learn]2)

    最終的なレビュー判定

    この Issue はそのまま implementation-worker に渡すべきではありません。

    最小修正は以下です。

    1. preflight を mandatory にし、change_kind: docs+tooling / Runtime Verification applicable に変更する。
    2. primary command を pnpm build + pnpm preview -- --host 127.0.0.1 --port 4173 --strictPort に固定する。
    3. 0.0.0.0 / WSL IP / WSLg は fallback として明確に降格する。
    4. Node/pnpm 互換性、特に pnpm 11 と Node 20 の不整合を契約化する。
    5. pnpm lint:docs を VC に追加する。
    6. 実装: WSL2/Ubuntu human playtest 実行環境 runbook と preflight を追加する #561 は test(#483): manual playtest の実施証跡を docs/playtest/m2-combat-mvp.md に追加する #543 の manual evidence を作らない、と明記する。

    この修正を入れれば、#561 は #543/#483 の Product Acceptance を実際に前進させる「人間作業を支える runbook/tooling Issue」になります。現状のままだと、grep を満たすだけの文書と曖昧な preflight で close され、肝心の manual playtest 実行時に WSL2/Vite/pnpm の環境差で詰まる可能性が高いです。

  3. squne121 commented on Jun 2, 2026

    @squne121
    OwnerAuthor

    ❯ #561 (comment)
    を対象に issue-refinement-loop を人間承認不要で行って。

    ● Skill(issue-refinement-loop)
    ⎿  Successfully loaded skill

    ● Issue #561 の内容とアンカーコメントを取得します。

    ● Bash(gh issue view 561 --repo squne121/loop-protocol --json
    number,title,body,labels,state,comments 2>&1 | head -200)
    ⎿  {"body":"## Machine-Readable Contract\n\nyaml\ncontract_schema_version: v1\niss ue_kind: implementation\ngoal_ref: \"#543 の human manual playtest を WSL2/Ubuntu 環境で再現可能に実行できる状態にする\"\nchange_kind: docs\nparent_issue: 543\n
    … +211 lines (ctrl+o to expand)

    ● Bash(gh api repos//issues/561/comments --jq '.[] | select(.id ==
    4598170431) | {id, body, created_at, user: .user.login}' 2>&1)
    ⎿  {"body":"## 結論: REQUEST_CHANGES\n\n#561 の方向性は正しいです。#543/#483 の「
    人間による M2 manual playtest」を実行可能にするため、WSL2/Ubuntu 用 runbook を先に
    整備するのは妥当です。ただし、現契約のままだと **docs-only Issue
    を装いながら実行ス
    … +138 lines (ctrl+o to expand)

    ● LOOP_STATE を初期化します。Step 0f: planner を実行します。

    ● Bash(uv run python3 .claude/skills/issue-refinement-loop/scripts/plan_refinement_loop.py
    --issue-number 561 \…)
    ⎿  Error: Exit code 2
    {
    "schema_version": "refinement_loop_plan/v1",
    "source": {
    "issue_number": null,
    "issue_body_sha256": null,
    "comments_sha256": null,
    "known_context_sha256": null,
    "generated_at": "2026-06-02T02:23:47.801656+00:00"
    },
    … +39 lines (ctrl+o to expand)

    ● Bash(uv run python3 .claude/skills/issue-refinement-loop/scripts/plan_refinement_loop.py
    --help 2>&1 | head -50)
    ⎿  {
    "schema_version": "refinement_loop_plan/v1",
    "source": {
    … +45 lines (ctrl+o to expand)

    Searched for 2 patterns, read 1 file (ctrl+o to expand)

    ● Bash(sed -n '1135,1180p'
    .claude/skills/issue-refinement-loop/scripts/plan_refinement_loop.py)
    ⎿  def main(argv: list[str] | None = None) -> None:
    """Main CLI entry point."""
    try:
    … +43 lines (ctrl+o to expand)

    ● Bash(sed -n '1200,1260p'
    .claude/skills/issue-refinement-loop/scripts/plan_refinement_loop.py)
    ⎿  if name == "main":
    main()

    ● Bash(sed -n '1185,1200p'
    .claude/skills/issue-refinement-loop/scripts/plan_refinement_loop.py)
    ⎿   "human_message": f"Invalid JSON input: {str(e)}",
    },
    }
    … +13 lines (ctrl+o to expand)

    Searched for 2 patterns (ctrl+o to expand)

    ● Bash(sed -n '803,850p'
    .claude/skills/issue-refinement-loop/scripts/plan_refinement_loop.py)
    ⎿  def plan_refinement_loop(input_data: dict[str, Any]) -> tuple[dict[str, Any], int]
    :
    """
    … +45 lines (ctrl+o to expand)

    ● 入力 JSON を構築して planner を実行します。

    ● Bash(gh issue view 561 --repo squne121/loop-protocol --json number,title,body >
    /tmp/issue561.json
    gh api repos//issues/561/comments --jq '[.[]…)
    ⎿  done

    ● Bash(python3 -c "
    import json…)
    ⎿  Input JSON written

    ● Bash(uv run python3 .claude/skills/issue-refinement-loop/scripts/plan_refinement_loop.py <
    /tmp/planner_input561.json 2>&1)
    ⎿  Error: Exit code 2
    {
    "schema_version": "refinement_loop_plan/v1",
    "source": {
    "issue_number": null,
    "issue_body_sha256": null,
    "comments_sha256": null,
    "known_context_sha256": null,
    "generated_at": "2026-06-02T02:24:36.119303+00:00"
    },
    … +9 lines (ctrl+o to expand)

    Searched for 1 pattern (ctrl+o to expand)

    ● Bash(sed -n '763,803p'
    .claude/skills/issue-refinement-loop/scripts/plan_refinement_loop.py)
    ⎿  def _validate_input_schema(data: Any) -> bool:
    """Validate input matches REFINEMENT_LOOP_PLANNER_INPUT_V1 schema."""
    if not isinstance(data, dict):
    … +38 lines (ctrl+o to expand)

    ● Bash(python3 -c "
    import json…)
    ⎿  Input JSON written

    ● Bash(uv run python3 .claude/skills/issue-refinement-loop/scripts/plan_refinement_loop.py <
    /tmp/planner_input561.json 2>&1)
    ⎿  {
    "schema_version": "refinement_loop_plan/v1",
    "source": {
    … +73 lines (ctrl+o to expand)

    ● scope_signal_guard が triggered しています。references を確認します。

    Read 2 files (ctrl+o to expand)

    ● anchor comment が scripts/ scope を明示的に承認しているので、anchor_reframe: true
    で再実行します。

    ● Bash(python3 -c "
    import json…)
    ⎿  done
    {
    "schema_version": "refinement_loop_plan/v1",
    … +74 lines (ctrl+o to expand)

    ● LOOP_STATE:
    LOOP_STATE:
    issue_number: 561
    iteration: 0
    max_iterations: 3
    last_verdict: null
    termination_reason: null
    anchor_comment:
    preliminary_classification: feedback_update_required
    final_classification: feedback_update_required
    scope_signal_guard:
    triggered: false
    excluded_by_anchor_reframe: true

    Step 1: Investigation を実行します(investigation_policy.required: true)。

    ● Bash(test -f docs/playtest/m2-combat-mvp.md && echo "EXISTS" || echo "NOT FOUND"
    test -f docs/playtest/manual-playtest-runbook.md && echo "EXISTS" || echo "NOT FOUND…)
    ⎿  EXISTS
    NOT FOUND
    NOT FOUND

    Read 1 file (ctrl+o to expand)

    ● Bash(cat package.json | python3 -c "import json,sys; d=json.load(sys.stdin);
    print('packageManager:', d.get('packageManager','NOT SET'));
    scripts=d.get('scripts',{})…)
    ⎿  packageManager: NOT SET
    lint:docs: pnpm run lint:md && pnpm run lint:prose
    lint:md: markdownlint-cli2 '/*.md' '#node_modules/' '#.claude/worktrees/**' '#

    Read 1 file (ctrl+o to expand)

    ● Bash(cat package.json | python3 -c "import json,sys; d=json.load(sys.stdin);
    print('packageManager:', d.get('packageManager','NOT SET'));
    scripts=d.get('scripts',{})…)
    ⎿  packageManager: NOT SET
    lint:docs: pnpm run lint:md && pnpm run lint:prose
    lint:md: markdownlint-cli2 '/*.md' '#node_modules/' '#.claude/worktrees/**' '#
    … +3 lines (ctrl+o to expand)

    ● 調査結果をまとめて Step 2 (Review) を実行します。

    investigation_summary:
    docs/playtest/manual-playtest-runbook.md: NOT EXIST (新規作成対象)
    scripts/check-manual-playtest-env.mjs: NOT EXIST (新規作成対象)
    docs/playtest/m2-combat-mvp.md: EXISTS (runbook参照なし)
    package.json.packageManager: NOT SET
    package.json.lint:docs: EXISTS → "pnpm lint:md && pnpm lint:prose"

    ● issue-reviewer(Issue #561 review (issue-reviewer))
    ⎿  Done (6 tool uses · 32.2k tokens · 1m 23s)
    (ctrl+o to expand)

    ● verdict: needs-fix 確認。iteration + 1 = 1 < 3 なので Step 4 (Rewrite) に自動継続します。

    正規化済み anchor_comment_feedback を issue-author に渡して Issue 本文を更新します。

    ● issue-author(Issue #561 本文の rewrite)
    ⎿  Done (4 tool uses · 20.9k tokens · 1m 16s)
    (ctrl+o to expand)

    ● Issue 本文更新完了。iteration 1 で Step 2 (Review) を再実行します。

    ● issue-reviewer(Issue #561 review iteration 1)
    ⎿  Done (6 tool uses · 34.6k tokens · 1m 20s)
    (ctrl+o to expand)

    ● C9 チェック失敗(applicable は無効値)と VCP issues を確認します。

    Searched for 9 patterns, read 1 file (ctrl+o to expand)

    ● 実際の checker を実行して正確なブロッカーを確認します。

    ● Bash(gh issue view 561 --repo squne121/loop-protocol --json body --jq '.body' >
    ⎿  fetched

    ● Bash(uv run python3 .claude/skills/review-issue/scripts/check_issue_contract.py --file
    /tmp/issue561_body.md --json 2>&1)
    ⎿  Error: Exit code 1
    /home/squne/projects/LOOP_PROTOCOL/.claude/skills/review-issue/scripts/check_issue_cont
    ract.py:1021: DeprecationWarning: datetime.datetime.utcnow() is deprecated and
    scheduled for removal in a future version. Use timezone-aware objects to represent
    datetimes in UTC: datetime.datetime.now(datetime.UTC).
    "generated_at": datetime.datetime.utcnow().strftime("%Y-%m-%dT%H:%M:%SZ"),
    {
    "verdict": "needs-fix",
    "issue_kind": "implementation",
    "generated_at": "2026-06-02T02:34:28Z",
    "deterministic_checks": {
    "C1_required_sections": "pass",
    "C2_stop_conditions_6": "pass",
    … +22 lines (ctrl+o to expand)

    ● Bash(uv run python3
    .claude/skills/issue-contract-review/scripts/contract_readiness_check.py --body-file
    /tmp/issue561_body.md --mode execute 2>&1 | head -60)
    ⎿  {
    "schema": "ISSUE_CONTRACT_READINESS_RESULT_V1",
    "status": "human_judgment",
    … +57 lines (ctrl+o to expand)

    ● Bash(uv run python3
    .claude/skills/issue-contract-review/scripts/contract_readiness_check.py --body-file
    /tmp/issue561_body.md --mode execute 2>&1 | tail -80)
    ⎿   "rule_id": "VCP_UNKNOWN",
    "severity": "error",
    "source_check": "baseline_vc_preflight",
    … +77 lines (ctrl+o to expand)

    ● pnpm lint の実際のコマンドと pnpm lint:docs の allowlist を確認します。

    ● Bash(cat package.json | python3 -c "import json,sys; d=json.load(sys.stdin);
    scripts=d.get('scripts',{}); print('lint:', scripts.get('lint','NOT SET'));
    print('lint:…)
    ⎿  lint: eslint .
    lint:docs: pnpm run lint:md && pnpm run lint:prose

    ● checker からの真のブロッカーを確認しました:

    1. decision: applicable → decision: immediate (+
      タグ必須)
    2. pnpm lint:docs が pnpm allowlist 外(blocked)→ VC から削除
    3. node scripts/... がunsafe(blocked)→ VC から削除、Runtime Verification
      セクションに記載

    これらを修正します。

    ● issue-author(Issue #561 本文 iteration 1 修正)
    ⎿  Done (3 tool uses · 19.8k tokens · 1m 4s)
    (ctrl+o to expand)

    ● checker で verification します。

    ● Bash(gh issue view 561 --repo squne121/loop-protocol --json body --jq '.body' >
    /tmp/issue561_body_v2.md &&
    uv run python3 .claude/skills/review-issue/scripts/chec…)
    ⎿  /home/squne/projects/LOOP_PROTOCOL/.claude/skills/review-issue/scripts/check_issue
    _contract.py:1021: DeprecationWarning: datetime.datetime.utcnow() is deprecated an
    d scheduled for removal in a future version. Use timezone-aware objects to represe
    … +26 lines (ctrl+o to expand)

    ● Bash(uv run python3
    .claude/skills/issue-contract-review/scripts/contract_readiness_check.py --body-file
    /tmp/issue561_body_v2.md --mode execute 2>&1 | python3 -c "i…)
    ⎿  status: human_judgment
    non-human-judgment errors: 5
    - RVA001 rva_immediate_field_missing Add 'applicable_acs' field to Runtime Verifi
    … +14 lines (ctrl+o to expand)

    ● decision: immediate に必要な追加フィールドが不足しています。runtime-verification-policy.md
    を確認します。

     … +26 lines (ctrl+o to expand)
    

    ● Bash(uv run python3
    .claude/skills/issue-contract-review/scripts/contract_readiness_check.py --body-file
    /tmp/issue561_body_v2.md --mode execute 2>&1 | python3 -c "i…)
    ⎿  status: human_judgment
    non-human-judgment errors: 5
    - RVA001 rva_immediate_field_missing Add 'applicable_acs' field to Runtime Verifi
    … +14 lines (ctrl+o to expand)

    ● decision: immediate に必要な追加フィールドが不足しています。runtime-verification-policy.md
    を確認します。

    Searched for 1 pattern, read 1 file (ctrl+o to expand)

    ● Bash(sed -n '512,580p'
    .claude/skills/issue-contract-review/scripts/contract_readiness_check.py)
    ⎿  def check_rva_immediate_fields(body: str) -> list[dict]:
    """
    AC4: Check that decision: immediate RVA section has all required fields.
    … +65 lines (ctrl+o to expand)

    Searched for 3 patterns (ctrl+o to expand)

    ● RVA の decision: immediate に必要な 5 フィールドを追加します。

    ● issue-author(Issue #561 RVA フィールド追加)
    ⎿  Done (6 tool uses · 22.8k tokens · 1m 15s)
    (ctrl+o to expand)

    ● Bash(gh issue view 561 --repo squne121/loop-protocol --json body --jq '.body' >
    /tmp/issue561_body_v3.md &&
    uv run python3 .claude/skills/review-issue/scripts/chec…)
    ⎿  check_issue_contract verdict: approve
    contract_readiness status: human_judgment
    blocked errors: 0

    ● 両 checker が通りました。Step 2 (Review) iteration 1 の最終チェックを実行します。

    ● issue-reviewer(Issue #561 review iteration 1 final)
    ⎿  Done (5 tool uses · 34.2k tokens · 1m 10s)
    (ctrl+o to expand)

    ● verdict: approve。Step 4.5 skip(delivery_rollup: false, follow_up candidates: [])。

    Step 5: Termination — termination_reason: approved

    LOOP_STATE_FINAL:
    issue_number: 561
    iteration: 1
    max_iterations: 3
    last_verdict: approve
    termination_reason: approved
    improvements_applied:
    - iteration: 0
    changes:
    - change_kind: docs → docs+tooling
    - In Scope: primary path を pnpm preview -- --host 127.0.0.1 --port 4173
    --strictPort に固定
    - Out of Scope: manual evidence 混同防止 3 項目追加
    ▐▛███▜▌ Claude Code v2.1.159
    ▝▜█████▛▘ Sonnet 4.6 with medium effort · Claude Max
    ▘▘ ▝▝ ~/projects/LOOP_PROTOCOL

    ❯ /clear
    ⎿  (no content)

    ❯ /impl-review-loop 561

    ● Skill(impl-review-loop)
    ⎿  Successfully loaded skill

    ● Issue #561 の impl-review-loop を開始します。まず準備ステップの手順と Issue
    本文を並行して確認します。

    Read 1 file (ctrl+o to expand)

    ● Bash(gh issue view 561 --repo squne121/LOOP_PROTOCOL 2>/dev/null || gh issue view 561)
    ⎿  title: docs/test: WSL2/Ubuntu human playtest 実行環境 runbook と preflight
    を追加す
    る
    state: OPEN
    … +198 lines (ctrl+o to expand)

    ● Issue #561 の内容を確認しました。コメントの CONTRACT_REVIEW_RESULT_V1 と ready tuple
    を確認します。

    ● Bash(REPO_FULL_NAME=$(gh repo view --json nameWithOwner --jq .nameWithOwner)
    gh api --paginate "repos/${REPO_FULL_NAME}/issues/561/comments?per_page=100" \…)
    ⎿  {
    "body": "## 結論: REQUEST_CHANGES\n\n#561 の方向性は正しいです。#543/#483 の
    「人間による M2 manual playtest」を実行可能にするため、WSL2/Ubuntu 用 runbook を先
    … +12 lines (ctrl+o to expand)

    ● コメントを全文取得して状況を確認します。

    ● Bash(REPO_FULL_NAME=$(gh repo view --json nameWithOwner --jq .nameWithOwner)
    gh api "repos/${REPO_FULL_NAME}/issues/561/comments/4598170431" --jq '.body')
    ⎿  Error: Exit code 1
    {
    "message": "Not Found",
    "documentation_url": "https://docs.github.com/rest",
    "status": "404"
    }gh: Not Found (HTTP 404)

    ● Bash(gh issue view 561 --json title,labels --jq '.title + " | " + (.labels | map(.name) |
    join(","))')
    ⎿  Cancelled: parallel tool call Bash(REPO_FULL_NAME=$(gh repo view --json nam…) errored

    ● Bash(REPO_FULL_NAME=$(gh repo view --json nameWithOwner --jq .nameWithOwner) && echo
    "REPO: $REPO_FULL_NAME" &amp;&amp; gh api --paginate "repos/${REPO_FULL_NAME}/issues/561…)
    ⎿  REPO: squne121/loop-protocol
    {"body":"## 結論: REQUEST_CHANGES\n\n#561 の方向性は正しいです。#543/#483 の「
    人間による M2 manual playtest」を実行可能にするため、WSL2/Ubuntu 用 runbook を先に
    … +140 lines (ctrl+o to expand)

    ● 準備ステップの確認が完了しました。以下を報告します。


    LOOP_STATE 初期化 — 停止(human_escalation)

    LOOP_STATE:
    issue_number: 561
    contract_snapshot_url: null
    contract_snapshot_source: null
    iteration: 0
    max_iterations: 3
    last_step: preparation
    last_loop_verdict: null
    termination_reason: human_escalation

    停止理由

    CONTRACT_REVIEW_RESULT_V1 status: go が存在しない

    Issue #561 のコメントは 1 件のみで、内容は status: go ではなく REQUEST_CHANGES
    レビューコメントです(generated_by: issue-contract-review の YAML block なし)。

    ready tuple が不一致

    ┌──────────────┬─────────────────────────┬────────────────────────────────┐
    │ 項目 │ 期待値 │ 現在値 │
    ├──────────────┼─────────────────────────┼────────────────────────────────┤
    │ title prefix │ 実装: または implement: │ docs/test: │
    ├──────────────┼─────────────────────────┼────────────────────────────────┤
    │ labels │ phase/implementation │ documentation, triage-required │
    └──────────────┴─────────────────────────┴────────────────────────────────┘

    背景

    コメント(2026-06-02T02:23:15Z)は 6 つの Blocker を指摘しており、Issue 本文はすでに
    そのすべてを取り込んだ内容に更新済みです(change_kind: docs+tooling、Runtime Verification:
    immediate、pnpm lint:docs 追記等)。ただし、更新後に issue-contract-review を再実行した
    CONTRACT_REVIEW_RESULT_V1 status: go コメントが存在しません。

    必要なアクション(人間判断)

    以下のいずれかをお願いします。

    1. ラベル・タイトルの更新: Issue 実装: WSL2/Ubuntu human playtest 実行環境 runbook と preflight を追加する #561 に phase/implementation ラベルを付与し、title を
      実装: prefix に変更する
    2. issue-contract-review の実行: /issue-contract-review 561 を実行して status: go
      コメントを生成する
    3. impl-review-loop の再起動: 上記が完了したら再度 /impl-review-loop 561 を呼び出す
  4. squne121 commented on Jun 2, 2026

    @squne121
    OwnerAuthor

    #561 (comment)

    結論

    原因は 実装内容の blocker ではなく、issue-refinement-loop から impl-review-loop への handoff 契約が未完成 なことです。

    issue-refinement-loop は最後に issue-reviewer の approve で終了していますが、impl-review-loop が要求しているのはそれではなく、少なくとも次の implementation-ready tuple です。

    1. CONTRACT_REVIEW_RESULT_V1 の status: go コメントが存在すること

    2. Issue title が 実装: または implement: prefix を持つこと

    3. Issue に phase/implementation label が付いていること

    4. status: go が現在の Issue 本文 snapshot に対応していること

    添付ログでは、impl-review-loop は preparation で停止しており、停止理由は明確に CONTRACT_REVIEW_RESULT_V1 status: go が存在しない、かつ ready tuple 不一致です。title は docs/test:、labels は documentation, triage-required のままで、期待値 phase/implementation に達していません。

    公開 GitHub 上でも、#561 は title が docs/test: ... のまま、labels が documentation と triage-required のままに見えます。(GitHub)


    直接原因

    1. issue-refinement-loop の approve が impl-ready と誤認されている

    添付ログでは、issue-refinement-loop は途中で checker の blocker を検出し、以下を修正しています。

    • decision: applicable → decision: immediate

    • pnpm lint:docs を Verification Commands から外す

    • node scripts/... を VC から外し Runtime Verification に移す

    • decision: immediate に必要な RVA fields を追加する

    その後、check_issue_contract verdict: approve、contract_readiness status: human_judgment / blocked errors: 0 になり、issue-reviewer が approve したため loop は termination_reason: approved で終了しています。

    しかし、ここで得られているのは refinement が終わった という意味であって、implementation-ready gate を通過した という意味ではありません。

    impl-review-loop は issue-reviewer approve を信用しておらず、CONTRACT_REVIEW_RESULT_V1 status: go を要求しています。そこが生成されていないため停止しています。

    2. metadata transition が未実行

    Issue 本文だけを整えても、impl-review-loop の ready 判定には title / label が含まれています。

    添付ログの ready tuple 不一致は以下です。

    項目 | 期待値 | 実際 -- | -- | -- title prefix | 実装: または implement: | docs/test: labels | phase/implementation | documentation, triage-required

    このため、仮に Issue 本文が完全でも impl-review-loop は止まります。

    3. 公開 Issue 本文はまだ old contract に見える

    公開 GitHub 上の #561 では、Machine-Readable Contract が change_kind: docs のままで、Allowed Paths に scripts/check-manual-playtest-env.mjs と package.json が含まれているため、実体としては docs+tooling に近い状態です。(GitHub)

    さらに Verification Commands には node scripts/check-manual-playtest-env.mjs が残っており、Runtime Verification Applicability は decision: not_applicable のままです。(GitHub)

    これは添付ログ内の「修正後は docs+tooling / decision: immediate / pnpm lint:docs 追記済み」という状態と食い違っています。可能性は二つあります。

    • issue-author の編集が GitHub に永続化されていない

    • 認証済み gh で見ている Issue body と公開 GitHub 表示に差分・遅延・別 snapshot がある

    どちらにせよ、loop の設計として agent の自己申告ではなく、同じ authoritative source から read-after-write して body hash を固定する必要があります。


    防止策

    A. issue-refinement-loop の終了状態を分ける

    現在の approved は曖昧です。少なくとも次に分けるべきです。

    termination_reason:
      - refinement_approved_gate_pending
      - implementation_ready
      - human_escalation
    

    issue-reviewer approve だけなら refinement_approved_gate_pending に止める。
    implementation_ready にしてよいのは、以下が全部そろった場合だけです。

    CONTRACT_REVIEW_RESULT_V1:
      status: go
      body_sha256: <current issue body sha>
    ready_tuple:
      title_prefix: pass
      phase_implementation_label: pass
      stale_request_changes_after_go: false
    

    重要なのは、issue-refinement-loop 自体に gate 責務を持たせないことです。gate は issue-contract-review、または同等の implementation-intake-gate worker に寄せるべきです。

    B. issue-contract-review を mandatory handoff にする

    issue-refinement-loop の最後に、直接 impl-review-loop へ進ませない。必ず次の順にする。

    issue-refinement-loop
      -> issue-contract-review
          -> CONTRACT_REVIEW_RESULT_V1 status: go
              -> impl-review-loop
    

    issue-contract-review は以下を machine-readable comment として投稿する。

    schema: CONTRACT_REVIEW_RESULT_V1
    generated_by: issue-contract-review
    status: go
    issue_number: 561
    body_sha256: ...
    title: ...
    labels:
      - phase/implementation
    verified_at: ...
    

    impl-review-loop はこの comment だけを implementation-ready の根拠にする。issue-reviewer approve は根拠にしない。

    C. metadata transition を専用 worker に寄せる

    Issue 本文 rewrite と title/label 更新を別々に扱うと今回のように壊れます。

    implementation-ready にする直前に、専用処理で以下を決定論的に実施する。

    gh issue edit 561 \
      --title "実装: WSL2/Ubuntu human playtest 実行環境 runbook と preflight を追加する" \
      --add-label phase/implementation \
      --remove-label triage-required
    

    documentation label は残してもよいですが、phase/implementation は必須にするべきです。

    D. impl-review-loop 側の preparation を「blocker」ではなく「intake gate failure」として扱う

    今回の停止は実装 blocker ではありません。まだ worker を起動してはいけない状態です。

    出力分類をこう分けるべきです。

    termination_reason: intake_gate_failed
    failure_kind:
      - missing_contract_go
      - metadata_not_ready
      - stale_contract_review
      - body_snapshot_mismatch
    

    これにより、人間やオーケストレータが「実装に blocker がある」と誤解しにくくなります。

    E. body hash / comment freshness を必須にする

    CONTRACT_REVIEW_RESULT_V1 status: go があっても、古い Issue 本文に対する go なら無効です。

    impl-review-loop preparation は次を確認するべきです。

    current_issue_body_sha256 == latest_contract_review.body_sha256
    latest_contract_review.status == go
    latest_request_changes_comment.created_at < latest_go_comment.created_at
    title_prefix_pass == true
    phase_implementation_label_pass == true
    

    これで「古い go コメントを拾って実装開始」「REQUEST_CHANGES 後に go がないのに開始」を防げます。


    #561 に対する即時復旧手順

    現在の #561 では、まず implementation-ready tuple を満たしてください。

    1. Issue 本文が実際に最新化されているか確認する

      • change_kind: docs+tooling

      • Runtime Verification は decision: immediate

      • decision: immediate に必要な RVA fields がある

      • unsafe / blocked な VC が Verification Commands に残っていない

    2. title / labels を更新する

      • title: 実装: WSL2/Ubuntu human playtest 実行環境 runbook と preflight を追加する

      • add label: phase/implementation

      • remove label: triage-required

    3. /issue-contract-review 561 を実行する

      • CONTRACT_REVIEW_RESULT_V1

      • status: go

      • current body hash と一致

    4. その後に /impl-review-loop 561 を再実行する


    起票するならこの Issue が妥当

    Title

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

    Scope

    - issue-refinement-loop の approved 終了を implementation-ready と区別する
    - issue-contract-review の CONTRACT_REVIEW_RESULT_V1 status: go を impl-review-loop の必須入力にする
    - title/label/body hash/comment freshness をまとめた implementation intake gate を追加する
    - #561 相当の regression fixture を追加する
    

    Acceptance Criteria

    AC1: issue-refinement-loop は issue-reviewer approve だけでは implementation_ready を返さない
    AC2: CONTRACT_REVIEW_RESULT_V1 status: go がない Issue は impl-review-loop preparation で intake_gate_failed になる
    AC3: title prefix または phase/implementation label が欠ける Issue は intake_gate_failed になる
    AC4: body_sha256 が current Issue body と一致しない古い go コメントは無効化される
    AC5: REQUEST_CHANGES が最新 go より後にある場合は無効化される
    AC6: #561 型 fixture で、refinement approved だが go comment / metadata がないケースが再現テストされる
    

    設計方針

    issue-refinement-loop は本文改善まで。
    issue-contract-review または新設 implementation-intake-gate が gate。
    impl-review-loop は gate 通過済み snapshot だけを実装対象にする。

    この分離にすると、control-plane が作業内容や gate 判断を抱えず、worker / deterministic checker 側に責務を寄せられます。

    ## 結論

    原因は 実装内容の blocker ではなく、issue-refinement-loop から impl-review-loop への handoff 契約が未完成 なことです。

    issue-refinement-loop は最後に issue-reviewer の approve で終了していますが、impl-review-loop が要求しているのはそれではなく、少なくとも次の implementation-ready tuple です。

    1. CONTRACT_REVIEW_RESULT_V1 の status: go コメントが存在すること
    2. Issue title が 実装: または implement: prefix を持つこと
    3. Issue に phase/implementation label が付いていること
    4. status: go が現在の Issue 本文 snapshot に対応していること

    添付ログでは、impl-review-loop は preparation で停止しており、停止理由は明確に CONTRACT_REVIEW_RESULT_V1 status: go が存在しない、かつ ready tuple 不一致です。title は docs/test:、labels は documentation, triage-required のままで、期待値 phase/implementation に達していません。

    公開 GitHub 上でも、#561 は title が docs/test: ... のまま、labels が documentation と triage-required のままに見えます。(GitHub)


    直接原因

    1. issue-refinement-loop の approve が impl-ready と誤認されている

    添付ログでは、issue-refinement-loop は途中で checker の blocker を検出し、以下を修正しています。

    • decision: applicable → decision: immediate
    • pnpm lint:docs を Verification Commands から外す
    • node scripts/... を VC から外し Runtime Verification に移す
    • decision: immediate に必要な RVA fields を追加する

    その後、check_issue_contract verdict: approve、contract_readiness status: human_judgment / blocked errors: 0 になり、issue-reviewer が approve したため loop は termination_reason: approved で終了しています。

    しかし、ここで得られているのは refinement が終わった という意味であって、implementation-ready gate を通過した という意味ではありません。

    impl-review-loop は issue-reviewer approve を信用しておらず、CONTRACT_REVIEW_RESULT_V1 status: go を要求しています。そこが生成されていないため停止しています。

    2. metadata transition が未実行

    Issue 本文だけを整えても、impl-review-loop の ready 判定には title / label が含まれています。

    添付ログの ready tuple 不一致は以下です。

    項目 期待値 実際
    title prefix 実装: または implement: docs/test:
    labels phase/implementation documentation, triage-required

    このため、仮に Issue 本文が完全でも impl-review-loop は止まります。

    3. 公開 Issue 本文はまだ old contract に見える

    公開 GitHub 上の #561 では、Machine-Readable Contract が change_kind: docs のままで、Allowed Paths に scripts/check-manual-playtest-env.mjs と package.json が含まれているため、実体としては docs+tooling に近い状態です。([GitHub]1)

    さらに Verification Commands には node scripts/check-manual-playtest-env.mjs が残っており、Runtime Verification Applicability は decision: not_applicable のままです。(GitHub)

    これは添付ログ内の「修正後は docs+tooling / decision: immediate / pnpm lint:docs 追記済み」という状態と食い違っています。可能性は二つあります。

    • issue-author の編集が GitHub に永続化されていない
    • 認証済み gh で見ている Issue body と公開 GitHub 表示に差分・遅延・別 snapshot がある

    どちらにせよ、loop の設計として agent の自己申告ではなく、同じ authoritative source から read-after-write して body hash を固定する必要があります。


    防止策

    A. issue-refinement-loop の終了状態を分ける

    現在の approved は曖昧です。少なくとも次に分けるべきです。

    termination_reason:
      - refinement_approved_gate_pending
      - implementation_ready
      - human_escalation

    issue-reviewer approve だけなら refinement_approved_gate_pending に止める。
    implementation_ready にしてよいのは、以下が全部そろった場合だけです。

    CONTRACT_REVIEW_RESULT_V1:
      status: go
      body_sha256: <current issue body sha>
    ready_tuple:
      title_prefix: pass
      phase_implementation_label: pass
      stale_request_changes_after_go: false

    重要なのは、issue-refinement-loop 自体に gate 責務を持たせないことです。gate は issue-contract-review、または同等の implementation-intake-gate worker に寄せるべきです。

    B. issue-contract-review を mandatory handoff にする

    issue-refinement-loop の最後に、直接 impl-review-loop へ進ませない。必ず次の順にする。

    issue-refinement-loop
      -> issue-contract-review
          -> CONTRACT_REVIEW_RESULT_V1 status: go
              -> impl-review-loop
    

    issue-contract-review は以下を machine-readable comment として投稿する。

    schema: CONTRACT_REVIEW_RESULT_V1
    generated_by: issue-contract-review
    status: go
    issue_number: 561
    body_sha256: ...
    title: ...
    labels:
      - phase/implementation
    verified_at: ...

    impl-review-loop はこの comment だけを implementation-ready の根拠にする。issue-reviewer approve は根拠にしない。

    C. metadata transition を専用 worker に寄せる

    Issue 本文 rewrite と title/label 更新を別々に扱うと今回のように壊れます。

    implementation-ready にする直前に、専用処理で以下を決定論的に実施する。

    gh issue edit 561 \
      --title "実装: WSL2/Ubuntu human playtest 実行環境 runbook と preflight を追加する" \
      --add-label phase/implementation \
      --remove-label triage-required

    documentation label は残してもよいですが、phase/implementation は必須にするべきです。

    D. impl-review-loop 側の preparation を「blocker」ではなく「intake gate failure」として扱う

    今回の停止は実装 blocker ではありません。まだ worker を起動してはいけない状態です。

    出力分類をこう分けるべきです。

    termination_reason: intake_gate_failed
    failure_kind:
      - missing_contract_go
      - metadata_not_ready
      - stale_contract_review
      - body_snapshot_mismatch

    これにより、人間やオーケストレータが「実装に blocker がある」と誤解しにくくなります。

    E. body hash / comment freshness を必須にする

    CONTRACT_REVIEW_RESULT_V1 status: go があっても、古い Issue 本文に対する go なら無効です。

    impl-review-loop preparation は次を確認するべきです。

    current_issue_body_sha256 == latest_contract_review.body_sha256
    latest_contract_review.status == go
    latest_request_changes_comment.created_at < latest_go_comment.created_at
    title_prefix_pass == true
    phase_implementation_label_pass == true
    

    これで「古い go コメントを拾って実装開始」「REQUEST_CHANGES 後に go がないのに開始」を防げます。


    #561 に対する即時復旧手順

    現在の #561 では、まず implementation-ready tuple を満たしてください。

    1. Issue 本文が実際に最新化されているか確認する

      • change_kind: docs+tooling
      • Runtime Verification は decision: immediate
      • decision: immediate に必要な RVA fields がある
      • unsafe / blocked な VC が Verification Commands に残っていない
    2. title / labels を更新する

      • title: 実装: WSL2/Ubuntu human playtest 実行環境 runbook と preflight を追加する
      • add label: phase/implementation
      • remove label: triage-required
    3. /issue-contract-review 561 を実行する

      • CONTRACT_REVIEW_RESULT_V1
      • status: go
      • current body hash と一致
    4. その後に /impl-review-loop 561 を再実行する


    起票するならこの Issue が妥当

    Title

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

    Scope

    - issue-refinement-loop の approved 終了を implementation-ready と区別する
    - issue-contract-review の CONTRACT_REVIEW_RESULT_V1 status: go を impl-review-loop の必須入力にする
    - title/label/body hash/comment freshness をまとめた implementation intake gate を追加する
    - #561 相当の regression fixture を追加する
    

    Acceptance Criteria

    AC1: issue-refinement-loop は issue-reviewer approve だけでは implementation_ready を返さない
    AC2: CONTRACT_REVIEW_RESULT_V1 status: go がない Issue は impl-review-loop preparation で intake_gate_failed になる
    AC3: title prefix または phase/implementation label が欠ける Issue は intake_gate_failed になる
    AC4: body_sha256 が current Issue body と一致しない古い go コメントは無効化される
    AC5: REQUEST_CHANGES が最新 go より後にある場合は無効化される
    AC6: #561 型 fixture で、refinement approved だが go comment / metadata がないケースが再現テストされる
    

    設計方針

    issue-refinement-loop は本文改善まで。
    issue-contract-review または新設 implementation-intake-gate が gate。
    impl-review-loop は gate 通過済み snapshot だけを実装対象にする。

    この分離にすると、control-plane が作業内容や gate 判断を抱えず、worker / deterministic checker 側に責務を寄せられます。

  5. added
    phase/implementation
    and removed
    triage-required
    on Jun 2, 2026
  6. changed the title [-]docs/test: WSL2/Ubuntu human playtest 実行環境 runbook と preflight を追加する[/-] [+]実装: WSL2/Ubuntu human playtest 実行環境 runbook と preflight を追加する[/+] on Jun 2, 2026
  7. squne121 commented on Jun 2, 2026

    @squne121
    OwnerAuthor

    Contract Snapshot (2026-06-02T03:02:11Z)

    • Outcome: WSL2/Ubuntu で manual playtest を行うための runbook と preflight script が追加され、test(#483): manual playtest の実施証跡を docs/playtest/m2-combat-mvp.md に追加する #543 の tester が環境確認→依存 install→preview server 起動→Windows browser アクセス→操作確認→evidence 取得 の流れを迷わず実行できる状態になる。
    • Acceptance Criteria: AC1〜AC12(docs/playtest/manual-playtest-runbook.md 追加、WSL2/Ubuntu primary path 明記、required OS 明記、pnpm build + preview コマンド明記、primary/optional browser route 明記、ports/strictPort 明記、screenshot/video evidence 手順明記、failure cases 明記、m2-combat-mvp.md から参照、preflight script 追加、pnpm typecheck/lint/test/build pass)
    • Verification Commands: AC12(regression gate)+ AC1〜AC11(file-exist / rg 検索)
    • Allowed Paths: docs/playtest/manual-playtest-runbook.md, docs/playtest/m2-combat-mvp.md, scripts/check-manual-playtest-env.mjs, package.json
    • Worktree: .claude/worktrees/issue-561-wsl2-ubuntu-human-playtest-runbook-prefl
    • Branch: worktree-issue-561-wsl2-ubuntu-human-playtest-runbook-prefl
    • VC preflight: regression_gate pass = 4, baseline_fail_expected = 3, human_judgment = 10 (rg exit 2 on nonexistent file — 既知 script 制限、意味的には expected baseline fail), blocked = 0
    • Runtime Verification: decision: immediate / applicable_acs: [AC11] / node 実行で exit code 0 のみ PASS
    CONTRACT_REVIEW_RESULT_V1:
      status: go
      generated_at: "2026-06-02T03:02:11Z"
      generated_by: issue-contract-review
      issue_url: "https://github.com/squne121/loop-protocol/issues/561"
      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: 3
          vc_passed_unexpectedly: 0
          vc_unrunnable: 0
          vc_expected_pass: 4
          vc_skipped: 0
          human_judgment: 10
          human_judgment_note: "rg on docs/playtest/manual-playtest-runbook.md (nonexistent) returns exit 2; semantically expected baseline fail. Known script limitation."
          classifications:
            - ac: AC12
              command: "pnpm typecheck"
              exit_code: 0
              category: regression_gate
              scope_class: regression_gate
              classification: expected_pass
              confidence: low
              decision: go
            - ac: AC12
              command: "pnpm lint"
              exit_code: 0
              category: regression_gate
              scope_class: regression_gate
              classification: expected_pass
              confidence: low
              decision: go
            - ac: AC12
              command: "pnpm test"
              exit_code: 0
              category: regression_gate
              scope_class: regression_gate
              classification: expected_pass
              confidence: low
              decision: go
            - ac: AC12
              command: "pnpm build"
              exit_code: 0
              category: regression_gate
              scope_class: regression_gate
              classification: expected_pass
              confidence: low
              decision: go
            - ac: AC1
              command: "test -f docs/playtest/manual-playtest-runbook.md"
              exit_code: 1
              category: file_not_found_expected
              scope_class: baseline_fail_expected
              classification: expected_fail
              confidence: high
              decision: go
            - ac: AC2
              command: "rg \"WSL2\\|Ubuntu\" docs/playtest/manual-playtest-runbook.md"
              exit_code: 2
              category: unknown
              scope_class: baseline_fail_expected
              classification: human_judgment
              confidence: low
              decision: go
              fix_hint: "rg exit 2 = file not found. Semantically expected baseline fail (file not yet created). Known script limitation."
            - ac: AC3
              command: "rg \"WSL2.*Ubuntu...\" docs/playtest/manual-playtest-runbook.md"
              exit_code: 2
              category: unknown
              scope_class: baseline_fail_expected
              classification: human_judgment
              confidence: low
              decision: go
              fix_hint: "Same as AC2 — rg exit 2 on nonexistent file"
            - ac: AC4
              command: "rg -n \"pnpm build\" docs/playtest/manual-playtest-runbook.md"
              exit_code: 2
              category: unknown
              scope_class: baseline_fail_expected
              classification: human_judgment
              confidence: low
              decision: go
            - ac: AC4
              command: "rg -n \"pnpm preview -- --host 127.0.0.1 --port 4173 --strictPort\" docs/playtest/manual-playtest-runbook.md"
              exit_code: 2
              category: unknown
              scope_class: baseline_fail_expected
              classification: human_judgment
              confidence: low
              decision: go
            - ac: AC5
              command: "rg -n \"http://localhost:4173\" docs/playtest/manual-playtest-runbook.md"
              exit_code: 2
              category: unknown
              scope_class: baseline_fail_expected
              classification: human_judgment
              confidence: low
              decision: go
            - ac: AC5
              command: "rg -n \"Windows browser|Windows 側ブラウザ\" docs/playtest/manual-playtest-runbook.md"
              exit_code: 2
              category: unknown
              scope_class: baseline_fail_expected
              classification: human_judgment
              confidence: low
              decision: go
            - ac: AC6
              command: "rg \"WSLg\\|optional\\|Linux browser\" docs/playtest/manual-playtest-runbook.md"
              exit_code: 2
              category: unknown
              scope_class: baseline_fail_expected
              classification: human_judgment
              confidence: low
              decision: go
            - ac: AC7
              command: "rg -n \"127.0.0.1|4173|strictPort\" docs/playtest/manual-playtest-runbook.md"
              exit_code: 2
              category: unknown
              scope_class: baseline_fail_expected
              classification: human_judgment
              confidence: low
              decision: go
            - ac: AC8
              command: "rg \"screenshot\\|video\\|evidence\" docs/playtest/manual-playtest-runbook.md"
              exit_code: 2
              category: unknown
              scope_class: baseline_fail_expected
              classification: human_judgment
              confidence: low
              decision: go
            - ac: AC9
              command: "rg \"failure\\|troubleshoot\\|remedy\\|common\" docs/playtest/manual-playtest-runbook.md"
              exit_code: 2
              category: unknown
              scope_class: baseline_fail_expected
              classification: human_judgment
              confidence: low
              decision: go
            - ac: AC10
              command: "rg \"manual-playtest-runbook\" docs/playtest/m2-combat-mvp.md"
              exit_code: 1
              category: expected_baseline_fail
              scope_class: baseline_fail_expected
              classification: expected_fail
              confidence: high
              decision: go
            - ac: AC11
              command: "test -f scripts/check-manual-playtest-env.mjs"
              exit_code: 1
              category: file_not_found_expected
              scope_class: baseline_fail_expected
              classification: expected_fail
              confidence: high
              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:
        - "VC preflight status was human_judgment (not blocked) due to rg exit 2 on nonexistent file. All human_judgment items are semantically expected baseline fails. Treated as go."
  8. squne121 commented on Jun 2, 2026

    @squne121
    OwnerAuthor

    implement-issue: 実装完了 (2026-06-02T03:07:12Z)

    • PR: feat(#561): add WSL2/Ubuntu manual playtest runbook and preflight script #565
    • Worktree: .claude/worktrees/issue-561-wsl2-ubuntu-human-playtest-runbook-prefl
    • Branch: worktree-issue-561-wsl2-ubuntu-human-playtest-runbook-prefl
    • Verification: 4/4 PASS (typecheck/lint/test/build) + lint:md PASS
    • Runtime Verification (AC11): exit code 0 — [ok] All checks passed
    • 後続: PR レビュー (pr-review-judge) → マージ → post-merge-cleanup
  9. added 2 commits that reference this issue on Jun 2, 2026
  10. added a commit that references this issue on Jun 2, 2026
    f043221
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

    documentationphase/implementation

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions