Repository navigation
Description
Machine-Readable Contract
contract_schema_version: v1
issue_kind: implementation
parent_issue: "#1370"
goal_ref: "右側 command rail をゲーム内 DOM overlay UI へ段階移行する"
change_kind: codeParent Issue
Parent Goal Ref
- Goal: 右側 command rail を廃止し、LoopPhase を正本にしたゲーム内 DOM overlay UI として title / preparation / running / result / pause の画面体験を統合する
- Desired Destination: battle-stage 内 DOM overlay UI で通常プレイが完結する
Current Validated Scope
- 先行 child により title / preparation / running / result / pause UI は battle-stage 内 DOM overlay へ移される
- この Issue は機能パリティ確認後の旧 rail 削除と E2E 回帰確認だけを担当する
Remaining Parent Gaps
なし
Outcome
aside.command-rail と二列 shell CSS が削除され、title -> preparation -> running -> result -> preparation の通常プレイ導線が battle-stage 内 overlay だけで E2E 検証されている状態。
In Scope
src/main.tsからaside.command-railと command rail query を削除する.app-shellの 340px 右列を削除し、一列 stage 中心 layout へ更新する- command rail 前提の CSS / tests / E2E selectors を更新する
- title -> preparation -> running -> pause / resume -> result -> preparation の keyboard-only E2E flow を確認する
- screenshot baseline が必要な場合は該当 baseline を更新する
- PR preview URL で live assets / Vite base path / preview storage namespace を検証し、evidence metadata を残す
- [Deferred] 実装: 戦闘中ステータス(HULL/HP)を戦闘描画画面(Canvas)に集約表示する #727 の final routing が記録済みであることを parent close 前に確認する
Out of Scope
- 新しい phase screen 機能の追加
- reward / save / load semantics の変更
- CanvasRenderer の描画変更
- upgrade purchase surface の仕様変更
Acceptance Criteria
- AC1:
src/main.tsにclass="command-rail"の DOM shell もcommand-railを対象とするquerySelectorも残っていない(予約シナリオ名リテラルfinal-no-command-railはこの AC の対象外) - AC2:
src/style.cssに 340px right rail grid が残っていない - AC3: E2E が battle-stage 内 overlay selectors で title -> preparation -> running -> pause/resume -> result -> preparation を keyboard-only で検証している。ここでの keyboard-only とは、対象要素への
Locator.focus()によるプログラム的focus注入ではなく、実際のTab/Shift+Tabキー操作によって到達可能であることを検証することを指す(bounded Tab探索や同等の到達可能性アサーションを用いる) - AC4: normal-play controls は
.battle-stagedescendants であり、running 中の Save / Load / Reset / New Game は visible でも focusable でもない。「focusable でない」は実際のTab順序探索でこれらの要素に到達しないことを検証することを含む(document.activeElement到達確認のみでは不足) - AC5: command rail 前提の overflow / screenshot tests が新 UI に更新され、1280x720 / 1366x768 / 1920x1080 の evidence を残す
- AC6: PR preview evidence に page URL / commit SHA / GitHub Actions run ID / artifact names または availability reason / viewport / DPR / zoom / userAgent / timezone が残る
- AC7:
dist/index.htmlは/loop-protocol/pr-<PR>/assets/を参照し、root/assets/直指定がなく、VITE_LOOP_STORAGE_NAMESPACE=pr-<PR>が preview bundle に反映される - AC8: typecheck / lint / test / build / e2e が PASS する
Verification Commands
# AC1
$ ! rg -q 'class="command-rail"' src/main.ts
# AC1
$ ! rg -q 'querySelector.*command-rail' src/main.ts
# AC2
$ ! rg -q "340px" src/style.css
# AC3
$ rg -n "battle-stage" tests/e2e/m3-loop-mvp.spec.ts
# AC4
# baseline-expect: pass
$ rg -n "battle-stage" tests/e2e/hud-hull-overflow.spec.ts tests/e2e/m2-combat-mvp.spec.ts
# AC5
# baseline-expect: pass
$ rg -n "toHaveScreenshot" tests/e2e/m2-combat-mvp.spec.ts tests/e2e/m3-loop-mvp.spec.ts tests/e2e/hud-hull-overflow.spec.ts tests/e2e/product-pause.spec.ts
# baseline-expect: pass
$ rg -n "screenshot" tests/e2e/m2-combat-mvp.spec.ts tests/e2e/m3-loop-mvp.spec.ts tests/e2e/hud-hull-overflow.spec.ts tests/e2e/product-pause.spec.ts
# baseline-expect: pass
$ rg -n "1920" tests/e2e/m2-combat-mvp.spec.ts tests/e2e/m3-loop-mvp.spec.ts tests/e2e/hud-hull-overflow.spec.ts tests/e2e/product-pause.spec.ts
# AC6
# preflight-scope: pr_review_only
$ rg -n "commit SHA" docs/product/playtest-protocol.md
# preflight-scope: pr_review_only
$ rg -n "run ID" docs/product/playtest-protocol.md
# preflight-scope: pr_review_only
$ rg -n "viewport" docs/product/playtest-protocol.md
# AC7
# preflight-scope: pr_review_only
$ rg -n "VITE_BASE_PATH" vite.config.ts .github/workflows/deploy-pages.yml
# preflight-scope: pr_review_only
$ rg -n "VITE_LOOP_STORAGE_NAMESPACE" vite.config.ts .github/workflows/deploy-pages.yml
# preflight-scope: pr_review_only
$ rg -n "pr-" vite.config.ts .github/workflows/deploy-pages.yml
# AC8
# preflight-scope: pr_review_only
$ pnpm test:e2eRuntime Verification Applicability
decision: immediate
reason: command rail removal, E2E navigation, preview asset base path, and storage namespace are runtime/browser-visible behavior.
applicable_acs: AC1, AC2, AC3, AC4, AC5, AC6, AC7
execution_environment: local build, Playwright E2E, and PR preview evidence when PR is opened
skip_conditions: PR preview unavailable before publish
fallback_policy: local build/E2E evidence を残し、preview verification を PR check/comment の blocking follow-up とする
artifact_requirements: E2E output, screenshot metadata, preview URL, commit SHA, run ID, asset path, namespace, viewport, DPR, zoom, userAgent, timezone
Allowed Paths
- src/main.ts
- src/style.css
- tests/main-loop.test.ts
- tests/hud-controller.test.ts
- tests/e2e/m2-combat-mvp.spec.ts
- tests/e2e/m3-loop-mvp.spec.ts
- tests/e2e/hud-hull-overflow.spec.ts
- tests/e2e/product-pause.spec.ts
- tests/e2e/screenshots/
- src/ui/battleOverlay.ts
- tests/battle-overlay.test.ts
- scripts/ci/preview_playability_smoke.mjs
- tests/e2e/visual-utils.ts
- tests/e2e/visual-overlay.spec.ts
- tests/component/combat-hud-running.vrt.test.ts
- docs/dev/visual-baseline-registry.md
Stop Conditions
- Allowed Paths 外の変更が必要と判明した場合
- In Scope の固定契約(キー集合・スキーマ・型定義)の変更が必要になった場合
- 新規 Issue の起票が必要と判断した場合(スコープ分割が発生する場合)
- 後続 Phase / 別スコープへの波及が判明した場合
- nested SubAgent delegation が必要になった場合
- 外部サービス利用・権限昇格・既存テスト大規模改変が必要になった場合
Required Skills
- TypeScript
- CSS responsive layout
- Playwright
- Vitest
Required Design References
- docs/product/features/ui-information-architecture.md
- docs/product/game-design.md
- docs/adr/0001-architecture-baseline.md
Scope Delta(任意)
- 2026-08-05: 実装着手時に AC1 の Verification Command(
! rg -q "command-rail" src/main.ts)がsrc/main.tsの予約シナリオ名リテラル'final-no-command-rail'と衝突することが判明した。このリテラルはtests/e2e/visual-utils.ts/tests/e2e/visual-overlay.spec.ts/tests/component/combat-hud-running.vrt.test.ts/docs/dev/visual-baseline-registry.mdから type-level(exhaustive union)で参照されており、旧 Allowed Paths のままでは AC1 を安全に満たせない。人間承認により上記 4 ファイルを Allowed Paths に追加した(Owner Decision, 2026-08-05)。 - 2026-08-05(PR 実装: 旧 command rail を削除し overlay UI を E2E 検証する (#1377) #1998 レビュー、Owner 敵対的レビュー 実装: 旧 command rail を削除し overlay UI を E2E 検証する (#1377) #1998 (comment) により訂正): 上記の対応として
final-no-command-railをfinal-overlay-onlyへ改名したが、この識別子は後続 Issue 実装: Playwright + Vitest Browser Mode 段階導入で #1370 battle-stage DOM overlay を VRT 保護 #1380 / 実装: #1377 merge後 final-no-command-rail VRT baseline と anti-rail guard を追加する #1393 の固定契約(baseline registry ID・AC・VC)でもfinal-no-command-railとして参照されており、改名は後続 Issue の契約を破壊すると判明した。方針を撤回し、final-no-command-railの識別子は維持したまま、AC1 の VC をclass="command-rail"の DOM shell とcommand-rail関連querySelectorのみを対象とする構造的チェックへ狭める(上記 AC1 / Verification Commands 参照)。Allowed Paths の4ファイル追加(tests/e2e/visual-utils.ts等)はこの巻き戻し作業のためにそのまま維持する。
Delivery Rule
- 1 Issue = 1 PR
- 専用 worktree を使う
- result / pause child の merge 後に着手する
Activity
実装: Playwright primary VRT suite を pending/provisional baseline だけで導入…
fix(vrt): complete AC12 by promoting running-hud-paused/result-timeou…
feat(ui): result screen と pause overlay を battle-stage 内に統合する (#1984)
squne121 commentedon Aug 4, 2026
敵対的レビュー結果
判定: REQUEST CHANGES / 着手不能
Issue #1377 の目的自体は妥当ですが、現在の Allowed Paths・依存関係・検証契約のままでは、Issue内の Stop Condition に即座に該当します。実装を開始する前に Issue refinement が必要です。
P0-1: Allowed Pathsだけでは command rail を削除できない
#1377 は変更可能範囲を
src/main.ts、src/style.css、一部unit/E2E、スクリーンショットに限定し、範囲外変更が必要なら停止する契約です。しかし現行実装では、単に
src/main.tsの<aside class="command-rail">を削除できません。BattleOverlayElementsの必須フィールドにcommandRailが含まれるresolveBattleOverlayElements()は.command-railが存在しなければnullを返すconfigureBattleOverlayFoundation()もcommandRailを必須入力として破棄・非表示処理するつまり rail を削除すると、現行の overlay resolver 契約自体が成立しません。修正必須の
src/ui/battleOverlay.tsが Allowed Paths に含まれていません。さらに、PR preview の playability smoke も
aside.command-railの存在を必須としており、見つからなければRequired overlay layout elements are missing.で失敗します。scripts/ci/preview_playability_smoke.mjsも Allowed Paths 外です。修正方針
少なくとも以下を Allowed Paths に追加する必要があります。
commandRailを optional にするのではなく、#1377 完了後は型・resolver・設定関数から概念ごと削除する方が安全です。optional 化では旧rail依存が温存されます。P0-2: final-no-command-rail VRTを有効化するファイルも変更禁止
現行の visual contract では
final-no-command-railは明示的に未実装扱いです。visual-overlay.spec.ts:pending-baselineとして通常撮影されず、fail-closed確認だけを実施visual-utils.ts:pending-fixtureregistry上も frozen baseline ではない
ところが、これらのファイルはすべて #1377 の Allowed Paths 外です。そのため、AC5 の「final-no-command-rail のスクリーンショット証跡」を正式なVRTとして実装できません。
追加候補は以下です。
または責務を明確に分割します。
現在の #1393 は、明示的に「#1377 merge後に final-no-command-rail VRT baseline と anti-rail guard を追加する」と定義されています。#1377のAC5と責務が重複しています。
P0-3: 先行PRの基準線が赤い
#1376 の実装PR #1984 はマージ済みですが、確認できたPR headのActions run
30953701654では、test・typecheck・lint・buildが成功する一方、e2eと最終CI verdictが失敗しています。E2Eの最終結果は次のとおりです。
失敗には以下が含まれます。
phase-screens.spec.tsの6 baselineこのregressionを追跡する #1986 も open です。
したがって、#1377 のAC8を「全ゲート成功」とするなら、次のいずれかが必要です。
現状のまま実装すると、#1377起因の差分と既存の10件の差分を区別できません。
P1-1: Verification Commandsが空虚な合格を許す
現在の静的grep中心の検証は、ACを証明できません。
rg "command-rail" src/main.tsこれは以下を検出しません。
src/ui/battleOverlay.tsの型・resolver依存少なくとも runtime assertion が必要です。
toBeHidden()だけでは不可Playwrightの
toBeHidden()は、要素が非表示の場合だけでなく、DOM要素が0件の場合にも成功します。旧selectorを誤って使用してもテストが通るため、存在を期待する要素は先にtoHaveCount(1)を検証する必要があります。(Playwright)逆に完全削除を要求する旧railや旧controlは
toHaveCount(0)を使うべきです。P1-2: 「visibleでない」と「focus不能」を分離して検証すべき
pointer-events: noneはマウス操作を抑制しても、Tabによる順次フォーカスから除外しません。([MDN Web Docs]2)inertは子孫をクリック・フォーカス・アクセシビリティツリーから除外します。([MDN Web Docs]3)したがって、AC4は「Save/Load/Reset/New Gameが見えない」の確認だけでは不十分です。
推奨契約は次のどちらかです。
toHaveCount(0)hiddenとinertを設定し、Tab巡回から除外されることを実操作で証明CSS計算値や
pointer-eventsのgrepだけでは不可です。P1-3: keyboard-only ACが曖昧
AC3は「タイトル→準備→running→pause/resume→result→準備」をkeyboard-onlyで確認するとしていますが、禁止操作とfocus oracleが定義されていません。
最低限、primary pathでは以下を禁止すべきです。
操作は
Tab、Shift+Tab、Enter、Space、Escape等で行い、各遷移でtoBeFocused()を確認すべきです。特にmodal pauseでは、WAI-ARIA APGが次を要求しています。
([W3C]4)
#1984の説明上はこの設計を意図していますが、#1377ではrail削除後のfocus orderを改めて固定する必要があります。
P1-4: Vite base/storageのgrepでは配布物を検証できない
Viteでは
import.meta.envがbuild時に静的置換され、BASE_URLはbase設定から決まります。([vitejs]5)またGitHub Pagesのようなrepository配下への配置では、実際の公開パスに合わせた
baseが必要です。([vitejs]6)リポジトリのdeploy workflowは、PR番号別namespaceを設定してbuildしています。
したがってAC7は文字列grepではなく、PR preview上で次を実測すべきです。
P1-5: VRT生成環境を固定する必要がある
Playwright公式も、OS・ブラウザversion・設定・headless mode等で描画結果が変わるため、baseline生成と比較を同じ環境で行うよう求めています。([Playwright]7)
AC5には次を追加すべきです。
推奨するIssue修正
Dependencies
#1983は paused/result baseline昇格を現在もopenで追跡していますが、#1984側でも同じ昇格を実施した旨が記録されています。二重のSSOTを残すべきではありません。
必須ゲート
加えて、PR headに結び付いた以下を必須証跡とすべきです。
最終判定
#1377は実装待ちではなく、契約修正待ちです。
最大の問題は、rail削除に必須の
battleOverlay.ts、preview smoke、visual scenario資産が変更禁止になっていることです。Allowed Pathsを拡張せず着手した場合、正しい実装ほどStop Conditionに到達します。先に #1986 の赤い基準線を処理し、#1393とのVRT責務を一意化したうえで、#1377を再開するのが妥当です。squne121 commentedon Aug 4, 2026
issue-refinement-loop: human_escalation
Blockers
PLANNER_FAIL_CLOSED: anchor comment(OWNER の敵対的レビュー)が Allowed Paths 拡張・Verification Commands 変更を要求しているが、ANCHOR_SCOPE_REFRAME_V1構造化ペイロード形式ではないためscope_delta_authority(contract patch plan の自動適用)がno_anchor_scope_reframe_v1_payloadで fail-closed した。自動適用できる patch plan が存在しない。repair_diagnostics(dry-run, 未適用): AC8 の Verification Command$ pnpm test:e2eが runtime-only command allowlist に含まれておらず、repair_issue_contractは# preflight-scope: pr_review_only reason=runtime_only_commandを付与する修復候補を提示しているが、これは VC の実行契約を変える変更のため自動適用しなかった。内容要約(アンカーコメントの主張)
OWNER のレビューは「現行 Allowed Paths(
src/main.ts/src/style.css等)だけでは command rail を安全に削除できない」と指摘している。src/ui/battleOverlay.tsのBattleOverlayElements必須フィールドにcommandRailが含まれ、resolveBattleOverlayElements()は.command-rail不在でnullを返す契約になっているconfigureBattleOverlayFoundation()もcommandRailを必須入力として扱うscripts/ci/preview_playability_smoke.mjsもaside.command-railの存在を前提にしているこのため、rail 削除を安全に行うには少なくとも
src/ui/battleOverlay.ts/tests/battle-overlay.test.ts/scripts/ci/preview_playability_smoke.mjsを Allowed Paths に追加する必要があるという主張だが、この判断・適用を自動 patch plan 経由で行う契約上の根拠(構造化 anchor payload)が今回のコメントには含まれていない。Next Action(人間判断が必要な理由)
src/ui/battleOverlay.ts等の追加)を人間が判断し、妥当であれば Issue 本文の## Allowed Pathsを直接更新するか、ANCHOR_SCOPE_REFRAME_V1形式の follow-up コメントを追加して scope delta authority 経路を通すpnpm test:e2eruntime-only 分類(pr_review_onlyへのマーク要否)を人間が判断するいずれも自動化された refinement loop の safe action の範囲外のため、Investigation / Review ステップに進まず本 Issue で停止する。
squne121 commentedon Aug 5, 2026
issue-refinement-loop: approved
Issue #1377 の issue-refinement-loop が完了しました。3 iteration の rewrite を経て
issue-reviewerが APPROVE を返し、issue-contract-review(run_contract_review_once.py --mode static)でstatus: goを確認しました(Final Gate 成功)。経緯サマリー
ANCHOR_SCOPE_REFRAME_V1構造化フォーマットでなかったためscope_delta_authorityが fail-closed。人間指示により Allowed Paths 拡張(src/ui/battleOverlay.ts/tests/battle-overlay.test.ts/scripts/ci/preview_playability_smoke.mjs)を手動適用repair_issue_contract.pyが検出した AC8 の runtime-only command 未注釈を、LP018 準拠形(# preflight-scope: pr_review_only)で解消VERDICT: needs-fix(12 blocker: AC1/AC2/AC4 のVCP_UNEXPECTED_PASS、AC5/AC6/AC7 のVCP_BROAD_SEARCH_PATH_UN)! rg -q)へ反転、AC4 にbaseline-expect: pass、AC5〜AC7 の search path を具体ファイルへ narrowVERDICT: needs-fix(9 blocker: AC5 の3コマンドがbaseline-expect: pass未注釈、AC6/AC7 の narrow 後パスが Allowed Paths 外で依然 broad 判定)baseline-expect: pass、AC6/AC7 の6コマンドにpreflight-scope: pr_review_only(Runtime Verification Applicability の既存宣言と整合)VERDICT: approve(blocker 0)squne121 commentedon Aug 5, 2026
implement-issue: 実装完了 (2026-08-05T12:11:10Z)
.claude/worktrees/issue-1377-remove-command-railworktree-issue-1377-remove-command-railtests/e2e/visual-overlay.spec.tsrunning-hud VRT baseline、0.01 pixel ratio。clean main(11d72d8a)でも同一差分で再現することを確認済みで本PR由来ではない)・2件skipfix(ci): capture DPR/userAgent/timezone in preview playability smoke …
fix: 敵対的レビュー指摘の4件を修正する (#1377)
実装: 旧 command rail を削除し overlay UI を E2E 検証する (#1377) (#1998)