Skip to content

docs(playtest): add m3 loop evidence (#860) - #865

Merged
squne121 merged 4 commits into
mainfrom
worktree-issue-860-pr854-save-reload-playtest-evidence
Jun 13, 2026
Merged

squne121 merged 4 commits into
mainfrom
worktree-issue-860-pr854-save-reload-playtest-evidence

Conversation

@squne121

@squne121 squne121 commented Jun 13, 2026 •

Copy link
Copy Markdown
Owner

Summary

この PR の要点を先にまとめます。

  • PR Implement reward claim progression snapshot persistence #854 の save→reload→restore happy-path evidence を docs/playtest/m3-loop-mvp.md として新規追加
  • HTTP origin 上で取得した reward claim 後の localStorage 保存結果と reload 後復元結果を記録
  • #740 の E2E 残件と save failure boundary 未解決を limitation として明記

Closes #860
この変更で issue #860 を閉じる想定です。

Checks

実行した品質確認の一覧です。

この PR では docs 変更に加えて、既存品質ゲートが壊れていないことを確認しました。

  • pnpm typecheck を通し、型整合性に回帰がないことを確認
  • pnpm lint を通し、静的解析の既存ルールに違反がないことを確認
  • pnpm test を通し、既存テスト群が維持されていることを確認
  • pnpm build を通し、配布ビルドが成立することを確認

受け入れ条件の達成状況

  • AC1: docs/playtest/m3-loop-mvp.md を新規作成し、docs-only happy-path evidence follow-up であることを明記
  • AC2: file:// ではなく HTTP origin、origin、command、browser、commit を記録
  • AC3: localStorage.removeItem('loop-protocol.mvp.save')、保存キー、raw JSON、parsed schemaVersion/resources/weaponPower/playerMaxHp を記録
  • AC4: reward claim 後 / reload 後の resources、loopPhase = preparation、enemies/projectiles 非持ち越し、current HP 非永続化を記録
  • AC5: QuotaExceededError を含む write failure 未証明、older readable snapshot 保全未解決、#740 E2E 別途必要を明記
  • AC6: production / PR preview の同一 origin / 同一 key 注意と clear 手順を記録

検証コマンド結果

検証コマンドの実行結果を以下にまとめます。

  • test -f docs/playtest/m3-loop-mvp.md ✅
  • rg -z -P "doc_id: playtest-m3-loop-mvp(?s).*HTTP origin.*origin:.*command:.*browser:.*commit:" docs/playtest ✅
  • rg -z -P "doc_id: playtest-m3-loop-mvp(?s).*localStorage\.removeItem\('loop-protocol\.mvp\.save'\).*raw JSON.*schemaVersion.*resources.*weaponPower.*playerMaxHp" docs/playtest ✅
  • rg -z -P "doc_id: playtest-m3-loop-mvp(?s).*resources after claim.*resources after reload.*loopPhase = preparation.*enemies/projectiles.*current HP" docs/playtest ✅
  • rg -z -P "doc_id: playtest-m3-loop-mvp(?s).*QuotaExceededError.*happy-path only.*未証明.*未解決.*#740" docs/playtest ✅
  • rg -z -P "doc_id: playtest-m3-loop-mvp(?s).*PR preview.*production.*同一 origin.*同一 key.*clear" docs/playtest ✅
  • rtk pnpm typecheck ✅
  • rtk pnpm lint ✅
  • rtk pnpm test ✅
  • rtk pnpm build ✅

Schema Change Applicability

schema 変更有無の判定結果です。

この変更は playtest evidence 文書の追加のみで、schema の producer-consumer 境界は変更しません。

  • decision: not_schema_change
  • reason: docs/playtest 配下の証跡文書追加のみで、producer-consumer 境界をまたぐ machine-readable schema 変更はない

Schema Consumer Inventory

consumer inventory の要否をここで明記します。

schema 変更がないため、このセクションは N/A です。

N/A
reason: schema を変更しないため inventory は不要

Safety Claim Matrix

安全性主張の変更有無をここで整理します。

安全境界そのものを変更する PR ではないため、このセクションは N/A です。

N/A
reason: docs-only PR であり、安全境界・権限・サンドボックス実装自体は変更しない

Runtime Verification Evidence

runtime で直接観測した証跡を要約します。

以下は local preview 上で取得した runtime evidence の要約です。happy-path のみを対象とし、failure boundary は別 issue に残しています。

  • local preview origin: http://localhost:4174/?playtest_evidence=1 を使用
  • browser: HeadlessChrome/148.0.7778.96 (Playwright) で観測
  • reward claim 前の終端状態は Debrief: reward pending / Defeat
  • resources は 0 -> 10 -> 10 (after reload) と推移
  • raw localStorage JSON は {"schemaVersion":1,"resources":10,"weaponPower":1,"playerMaxHp":8}
  • reload 後状態は Hull 8/8, Loop Phase = Preparation, Sortie Status = Idle, Quick Load enabled

Allowed Paths 遵守

Allowed Paths は docs/playtest で、実際の変更は 1 ファイルだけです。

  • 変更ファイルは docs/playtest/m3-loop-mvp.md のみ
  • live contract の docs/playtest 許可範囲内で、他の docs や code/test には変更なし

Notes

関連情報と採取手段を補足します。

補足情報をここにまとめます。

@github-actions

github-actions Bot commented Jun 13, 2026 •

Copy link
Copy Markdown
Contributor

Preview URL

Preview removed (PR #865 closed).

@squne121 squne121 left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LOOP_VERDICT_V2

verdict: REQUEST_CHANGES
reviewed_head_sha: "d336a34f4b63a0e59a701679f52b2de60baa81de"
merge_ready: false
mergeability:
mergeable: "MERGEABLE"
merge_state_status: "BEHIND"
blockers:

  • "allowed_paths_gate=fail_closed: linked issue contract snapshot allows docs/playtest, but actual changed file is docs/playtest/m3-loop-mvp.md"
    required_auto_actions:
  • kind: update_branch
    executor: implementation-worker
    skill: implement-issue.update_branch
    blocking_merge_ready: true
    mechanical: true
    expected_head_sha: "d336a34f4b63a0e59a701679f52b2de60baa81de"
    auto_fix_applied: []
    follow_up_issue_requests: []
    allowed_paths_gate:
    status: fail_closed
    allowed_paths_gate_source: review_subagent

@squne121

Copy link
Copy Markdown
Owner Author

判定

REQUEST_CHANGES。
PR #865 は #860 の docs-only follow-up としての方向性は合っていますが、証跡文書としての信用性に穴があります。 特に command と origin の不整合が強いブロッカーです。このままマージすると、後続の #740 / #739 close 判定で「実ブラウザ検証済み」と誤読されるリスクがあります。


確認した事実

PR #865 は docs/playtest/m3-loop-mvp.md を 1 ファイル追加する docs-only PR で、PR #854 の save→reload→restore happy-path 証跡を記録し、#740 の E2E 残件や save failure boundary 未解決を limitation として残す構成です。

#860 自体も docs-only follow-up で、Allowed Paths は docs/playtest/m3-loop-mvp.md に限定されています。一方、親の #740 は tests/e2e/ への Playwright E2E 追加と docs/playtest/m3-loop-mvp.md の作成を要求しており、#740 は現在も open です。

現在 head の CI は ci / deploy-pages / Check Japanese Content などが success で、CI job 内でも e2e / test / typecheck / build / lint は成功しています。これは「既存ゲートを壊していない」証拠にはなりますが、PR #865 の手動 evidence の数値・origin・commit が正しいことまでは証明しません。


ブロッカー

1. command と origin が食い違っている

文書では実行コマンドを次のように記録しています。

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

しかし、実際に証跡として記録している origin は http://localhost:4174/?playtest_evidence=1 です。

これは証跡文書として致命的です。少なくとも次のどれかが起きています。

  1. 実際の command が違う
  2. 実際の origin が違う
  3. 既存サーバー / 別 preview を見ていた
  4. 証跡の転記時に port を誤った

Vite は vite preview で build 済み dist をローカル配信し、通常 http://localhost:4173 で preview する説明になっています。port は変更可能ですが、その場合は記録 command と URL が一致している必要があります。([vitejs]1)

修正要求:
command / served URL / window.location.origin / window.location.href / git rev-parse HEAD を同じ採取ログから再記録してください。最低限、次のように分けるべきです。

- command:
- server stdout:
- page href observed via location.href:
- origin observed via location.origin:
- commit_under_test:
- pr_head_at_recording:

2. evidence の commit と PR head の関係が不明

PR metadata 上の head は 7a4d25206ad6dc685b22f14ff77397dd7eec41f0 ですが、文書内の runtime evidence は 6df9b3ae49d0222423f1d7483311589a1d9aa408 を commit として記録しています。

docs-only PR なので「証跡採取時の実装 commit」が PR head と一致しないこと自体はあり得ます。しかし、文書はその関係を説明していません。source_pr: #854 の実装 commitなのか、local preview の作業ツリー commit なのか、PR #865 head なのかが曖昧です。

修正要求:
次を明記してください。

- evidence_target: PR #854 merged implementation / local branch / PR #865 preview のどれか
- commit_under_test:
- evidence_recorded_on_pr_head:
- current_pr_head_when_doc_added:
- mismatch_reason:

この情報がないと、後から再検証できません。


3. enemies/projectiles の非持ち越しが直接検証ではなく推定になっている

文書は reload 後について、enemies/projectiles は「preparation state へ再初期化された前提」「manual observation と button state 上も combat runtime は再開していない」と書いています。

これは弱いです。#860 の AC4 は「enemies / projectiles が空、current HP は persistence 対象外」と読むべき内容です。UI の button state だけでは、内部配列が空か、combat runtime が停止しているかを十分に証明できません。

Playwright では page.evaluate() でページ側の window / document / localStorage を読めます。内部状態を E2E 用に expose しているなら、loopPhase / enemies.length / projectiles.length を直接採取すべきです。([Playwright]2)

修正要求:
直接観測できていないなら、表現を次のどちらかに寄せてください。

- enemies/projectiles: not directly inspected; UI-level observation only

または、E2E/debug hook で直接検証してください。

await page.evaluate(() => ({
  href: location.href,
  origin: location.origin,
  saveRaw: localStorage.getItem('loop-protocol.mvp.save'),
  loopPhase: window.__LOOP_PROTOCOL_E2E_STATE__?.loopPhase,
  enemies: window.__LOOP_PROTOCOL_E2E_STATE__?.enemies.length,
  projectiles: window.__LOOP_PROTOCOL_E2E_STATE__?.projectiles.length,
}))

重大だが PR #865 単体ではスコープ外のリスク

4. #854 の save failure 境界バグは残っている

PR #865 は limitation として QuotaExceededError / write failure / older readable snapshot preservation 未解決を明記しています。これは正しいです。

ただし、親スコープではかなり重要です。PR #854 のレビューでは、保存失敗時に既存の loadable snapshot を UI 上で失わせる問題と、reward-claim save wiring の本質がテストで証明されていない問題が指摘されています。

MDN でも Storage.setItem() は容量超過などで QuotaExceededError を投げ得るため、write failure は異常な edge case ではなく、設計すべき I/O failure boundary です。([MDN Web Docs]3)

結論:
PR #865 はこの問題を修正しないことを明記しているため、#860 の範囲なら許容可能です。ただし、#740 / M3 parent の sign-off には絶対に使えません。


5. localStorage / origin の説明は正しいが、証跡の再現性が不足している

repo の persistence spec は、storage key を loop-protocol.mvp.save とし、HTTP origin 前提、file:// 非保証、GitHub Pages production と PR preview が同一 origin/key を共有し得ることを定義しています。

MDN でも localStorage は origin に紐づき、HTTP と HTTPS で別 storage になり、file: URL の挙動は未定義・ブラウザ依存とされています。([MDN Web Docs]4)

PR #865 の文書はこの注意自体は書けています。
しかし、実際の証跡では 127.0.0.1 bind command と localhost URL が混ざっています。localhost と 127.0.0.1 はブラウザ origin としては別 host になり得るため、記録はより厳密にすべきです。


非ブロッカーだが修正推奨

6. verification marker が「regex 合格用の呪文」に見える

新規 doc 冒頭に AC2〜AC6 用の hidden marker コメントが並んでいます。

これは CI / preflight を安定化させる目的なら理解できますが、敵対的に見ると「実証内容ではなく regex を通すための marker」です。人間が evidence を読むときの信頼性は上がりません。

推奨:
marker は残してもよいですが、実証内容は machine-readable section と human-readable section に分離してください。

## Evidence Record

```yaml
evidence_schema: playtest_evidence/v1
target_pr: "#854"
target_commit:
recorded_at:
browser:
page_href:
location_origin:
storage_key:
raw_json:
parsed:
  schemaVersion:
  resources:
  weaponPower:
  playerMaxHp:
reload_assertion:
  resources:
  loopPhase:
  sortieStatus:
  quickLoadEnabled:
limitations:
  write_failure: unproven
  quota_exceeded: unproven
  older_snapshot_preservation: unresolved

---

### 7. PR preview と local preview の責務が混ざっている

PR comment には PR #865 preview URL が出ていますが、文書内の runtime evidence は local preview origin です。:contentReference[oaicite:19]{index=19} :contentReference[oaicite:20]{index=20}

これは許容できますが、文書上は次の区別を明記すべきです。

```md
- local evidence: collected
- PR preview evidence: not collected
- production evidence: not collected

PR preview の live assets verified は「配布物が存在する」確認であって、「save→reload→restore が PR preview 上で成功した」証拠ではありません。


最終レビューコメント案

## 判定

REQUEST_CHANGES。

#860 の docs-only follow-up としての方向性は合っていますが、runtime evidence としての再現性が不足しています。特に `command` は `--port 4173 --strictPort` なのに、記録 origin が `http://localhost:4174/?playtest_evidence=1` になっており、証跡の同一性を信用できません。

## Blockers

1. `command` / `origin` / `commit` の整合性を取り直してください。
   - `window.location.href`
   - `window.location.origin`
   - `git rev-parse HEAD`
   - server stdout
   - actual preview URL
   を同一採取ログから記録してください。

2. `enemies/projectiles` の非持ち越しを「前提」ではなく、直接観測または UI-level observation として正確に分類してください。
   内部状態を読めないなら `not directly inspected` と明記してください。

3. PR preview の verified assets と local preview evidence を混同しないでください。
   `local evidence: collected / PR preview evidence: not collected` のように分離してください。

## Parent scope

この PR は #860 を閉じる docs-only evidence としては修正後に許容可能ですが、#740 の Playwright E2E / parent-level runtime sign-off には使えません。#740 は引き続き open で、`tests/e2e/` による sortie→reward→save→reload→restore の検証が必要です。

マージ可否

現時点ではマージ不可。
ただし、コード変更を要求する PR ではないので、修正量は小さいです。最低限、4173 / 4174 / localhost / 127.0.0.1 / commit の不整合を解消し、直接観測できていない項目を「未直接確認」と明記すれば、#860 の docs-only PR としてはマージ候補になります。

@squne121
squne121 marked this pull request as ready for review June 13, 2026 10:00
@squne121
squne121 merged commit 649aa21 into main Jun 13, 2026
15 checks passed
@squne121
squne121 deleted the worktree-issue-860-pr854-save-reload-playtest-evidence branch June 13, 2026 10:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

実装: PR#854 save→reload 証跡を playtest docs に追加

1 participant