Skip to content

実装: command rail 統合前に UI IA と sortie timer authority を整理する #1372

Closed

Description

@squne121

Machine-Readable Contract

contract_schema_version: v1
issue_kind: implementation
parent_issue: "#1370"
goal_ref: "右側 command rail をゲーム内 DOM overlay UI へ段階移行する"
change_kind: docs

Parent Issue

#1370

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

Remaining Parent Gaps

  • overlay shell 実装
  • title / preparation phase screen 実装
  • running combat HUD 実装
  • result / pause overlay 実装
  • 旧 command rail 削除と E2E 検証

Outcome

UI information architecture と sortie timer authority の docs が更新され、右側 command rail 統合 child issue が参照する phase screen / DOM overlay / timer 表示の正本が明確になっている状態。

In Scope

  • ui-information-architecture.md に right command rail から in-game DOM overlay への移行方針を追記する
  • title / preparation / running / result / pause の surface mapping を明確化する
  • sortie.md と game-logic.md の 30 秒 timer authority の衝突を docs 上で解消する
  • [Deferred] 実装: 戦闘中ステータス(HULL/HP)を戦闘描画画面(Canvas)に集約表示する #727 は Canvas interactive UI 実装として再開しないことを routing note として明記する
  • pause overlay は LoopPhase ではなく productPause.isPaused から導出する interruption overlay として記載する
  • Canvas result fill は visual cue であり、result details / Return to hangar は DOM overlay が正本であることを記載する

Out of Scope

Product Spec Context

product_spec_id: UI-OVERLAY-DOCS-1372
requirement_id: REQ-1372
source_task_id: TASK-1372
source_of_truth: docs/product/features/ui-information-architecture.md
diff_rationale: "#1370 anchor review comment 4903849229 により、DOM overlay 統合前に sortie timer authority、pause source-of-truth、#727 routing を docs SSOT に同期するため"
changed_requirement_id: UI-OVERLAY-DOCS-1372
affected_sections:
  - command rail integration
  - phase-to-surface mapping
  - sortie timer authority
  - issue 727 routing
product_spec_change_mode: docs_ssot_sync_only

Acceptance Criteria

  • AC1: ui-information-architecture.md に command rail 統合の DOM overlay 方針が記載されている
  • AC2: title / preparation / running / result / pause の phase-to-surface mapping が docs に記載されている
  • AC3: sortie timer 表示の authority が 30 秒であることが sortie.md / game-logic.md 間で矛盾しない
  • AC4: [Deferred] 実装: 戦闘中ステータス(HULL/HP)を戦闘描画画面(Canvas)に集約表示する #727 を本 parent 方針へ routing する記述が docs または issue comment で確認できる
  • AC5: docs lint / roadmap refs validation が PASS する

Verification Commands

# AC1
$ rg -n "command rail" docs/product/features/ui-information-architecture.md
# AC2
$ rg -n "title_menu" docs/product/features/ui-information-architecture.md
# AC3
# baseline-expect: pass
$ rg -n "30秒" docs/product/features/sortie.md docs/product/game-logic.md
# AC4
# baseline-expect: pass
$ gh issue view 727 --json body,comments
# AC5
$ pnpm lint

Runtime Verification Applicability

decision: not_applicable
reason: docs-only child で runtime code を変更しない。

Allowed Paths

  • docs/product/features/ui-information-architecture.md
  • docs/product/features/sortie.md
  • docs/product/game-logic.md
  • docs/product/game-design.md

Stop Conditions

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

Required Skills

  • Product spec authoring
  • UI information architecture

Required Design References

  • docs/product/features/ui-information-architecture.md
  • docs/product/features/sortie.md
  • docs/product/game-logic.md
  • docs/adr/0001-architecture-baseline.md

Scope Delta(任意)

N/A

Delivery Rule

  • 1 Issue = 1 PR
  • 専用 worktree を使う
  • PR は parent issue を Refs する

Activity

  1. added
    phase/implementation
    agent/implementer
    enhancement
    on Jul 7, 2026
  2. squne121 commented on Jul 7, 2026

    @squne121
    OwnerAuthor

    判定

    REQUEST_CHANGES。#1372 の方向性は妥当ですが、blocker docs issue としてはまだ弱いです。
    #1372 は「command rail 統合前に UI IA と sortie timer authority を整理する」docs-only child で、コメントは現時点で 0 件です。親 #1370 は #1372 を #1373 以降の前提に置いており、#1373–#1377 も state/blocked の実装 child として #1372 後に進む設計です。つまり #1372 は単なる文書整理ではなく、後続 UI 実装の SSOT gate です。

    調査範囲は #1372、親 #1370、子 #1373–#1377、#727、#1282、PR #1365、関連コメント、ui-information-architecture.md / sortie.md / game-logic.md / game-design.md / ADR / main.ts / HudController.ts / SortieSystem.ts / CanvasRenderer.ts / deploy workflow / package scripts、および MDN・WAI-ARIA APG・Vite・Playwright の公式ドキュメントです。ローカルで pnpm は実行していません。

    P0: merge 前に直すべき点

    1. AC3 が「30秒と120秒の矛盾を本当に潰す」検証になっていない

    sortie.md は明確に 30 秒を正本にしています。targetTicks = ceil(30_000 / fixedDeltaMs)、durationMs = elapsedTicks * fixedDeltaMs、wall-clock / rAF / performance.now() を SortieResult duration や timeout 判定に使わない、という契約まで書かれています。

    一方で game-logic.md にはまだ timer 120s、sortie_timer_expired、normal_end、sortie timer ≥ 120s が残っています。特に REQ-LOGIC-VICTORY-001 と Victory/Defeat/Draw 節は、M2 現行実装の timeout と直接衝突します。

    #1372 の AC3 は「30s contradiction がなくなる」と言っていますが、VC は rg -n "30秒|30_000|targetTicks|120秒|120s" 程度に見えます。これは弱いです。文字列があることしか見ません。残った 120s が「superseded historical note」なのか「現役 requirements」なのかを判定できません。

    修正要求: game-logic.md の 120s / normal_end / outpost victory を、現行 M2 に対しては明示的に superseded / future scope に落としてください。単に 30 秒を追記するだけでは不可です。

    貼るならこの程度まで必要です。

    ### Current MVP override: sortie lifecycle
    

    For the current M2/M3 runtime, docs/product/features/sortie.md is the authoritative specification for sortie lifecycle, timer, terminal result, and duration derivation.

    • Timer authority: targetTicks = ceil(30_000 / fixedDeltaMs).
    • Timeout outcome: elapsed ticks reaching targetTicks with enemies remaining yields outcome: "timeout" and endReason: "timeout".
    • Duration authority: durationMs = elapsedTicks * fixedDeltaMs.
    • The older 120s / normal_end / outpost-destruction wording in this document is future-scope or superseded for the current MVP and MUST NOT be used by implementation issues unless a later spec delta reactivates it.

    VC も次に変えるべきです。

    pnpm lint:docs
    
    

    rg -n "targetTicks = ceil\(30_000 / fixedDeltaMs\)|durationMs = elapsedTicks \* fixedDeltaMs"
    docs/product/features/sortie.md docs/product/game-logic.md

    rg -n "120\s*秒|120s|sortie_timer_expired|normal_end|outpost" docs/product/game-logic.md

    expected: only in explicitly superseded / future-scope notes, not active Requirements or active Victory sections

    2. pause surface の derivation contract がまだ prose レベル

    現行 LoopPhase は title_menu / load_menu / preparation / running / result / legacy debrief だけで、pause は含みません。
    PhaseTransitionSystem にも pause transition はありません。
    pause は productPause.isPaused という runtime-local state で、handleTogglePause() は running 中だけ entry を許可し、paused 中は accumulator を進めず、render / HUD は継続します。

    #1372 はこの方向を認識していますが、「LoopPhase が正本」「pause は interruption overlay」の関係を実装者がそのまま関数化できる粒度に落としていません。ここが曖昧だと、#1376 で独立 uiScreen state が入りやすいです。

    修正要求: UI IA に次のような derivation contract を入れてください。

    type BattleOverlaySurface =
    | 'title'
    | 'load'
    | 'preparation'
    | 'combat'
    | 'result'
    | 'pause'
    | 'legacy-debrief-compat'

    function deriveBattleOverlaySurface(
    loopPhase: LoopPhase,
    isPaused: boolean,
    ): BattleOverlaySurface {
    if (isPaused && loopPhase === 'running') return 'pause'

    switch (loopPhase) {
    case 'title_menu': return 'title'
    case 'load_menu': return 'load'
    case 'preparation': return 'preparation'
    case 'running': return 'combat'
    case 'result': return 'result'
    case 'debrief_pending_reward':
    case 'debrief_reward_claimed':
    return 'legacy-debrief-compat'
    }
    }

    これに加えて、「pause は LoopPhase に追加しない」「独立 uiScreen state を追加しない」「legacy debrief は normal result UI ではなく compatibility-only」という文言を AC に入れるべきです。

    3. runtime timer display drift を #1372 が拾えていない

    SortieSystem は SORTIE_DURATION_MS = 30_000 を持ち、startSortie() で targetTicks = Math.ceil(SORTIE_DURATION_MS / fixedDeltaMs) を設定し、result の durationMs も elapsedTicks * fixedDeltaMs から作っています。

    しかし現行 HudController は result がない場合、duration 表示を s.elapsedTicks / 60 で近似しています。これは「60Hz 前提だから今は見た目上ほぼ合う」だけで、docs が固定した fixedDeltaMs authority とは一致していません。

    #1372 は docs-only なので runtime を直す必要はありません。ただし、後続 #1375 / #1376 が timer / duration を表示するため、#1372 の UI IA 側に「timer display authority」を明記しないと、後続実装で / 60 が温存されます。

    追加すべき契約:

    ### Timer display authority

    Normal-play timer / duration UI MUST derive elapsed and remaining sortie time
    from state.sortie.elapsedTicks, state.sortie.targetTicks, and the configured
    fixedDeltaMs.

    UI MUST NOT derive sortie duration from wall-clock time, requestAnimationFrame
    delta, performance.now(), or a hard-coded elapsedTicks / 60 approximation.

    #1375 / #1376 の AC にも「duration display does not hard-code 60Hz」を追加すべきです。

    4. #727 は docs routing だけでは足りない

    #727 は [Deferred] で、OWNER 判断により「再開条件を満たすまで実装 PR を作成しない」と明記されています。理由も、HULL/HP だけを先に Canvas 集約すると後で DOM HUD との責務境界を再設計する可能性が高い、というものです。

    UI IA も #727 について「そのまま resume しない」「元の Canvas aggregated player HP/HULL 方向を supersede する」「Canvas visual cues + DOM HUD player status integration へ rewrite または replace」と書いています。

    #1372 の AC4 は「#727 routed in docs/comment」程度ですが、敵対的に見ると不十分です。未来の agent は #727 単体を見て作業する可能性があります。#727 本文には古い Canvas 集約の実装契約が残っているため、UI IA 側だけで routing しても誤着手リスクは残ります。

    修正要求: AC4 は「docs または comment」ではなく、#727 への routing comment を必須にしてください。

    - AC4: #727 has an explicit routing comment linking #1370/#1372 and stating
    that the old Canvas-aggregated HULL/HP implementation contract must not be
    resumed as-is; future work must rewrite/replace it as Canvas visual cues +
    DOM HUD player status integration.

    5. UI IA の conceptual phase と runtime LoopPhase の対応が未整理

    現行 UI IA の Phase Matrix は preparation / combat / debrief / menu / debug という conceptual phase で構成されています。
    一方、runtime は title_menu / load_menu / preparation / running / result / legacy debrief です。

    #1372 の目的はこの差分を埋めることですが、Issue 本文のままだと「UI IA に title_menu とか running という語を追加した」だけで通せます。必要なのは、conceptual phase と runtime LoopPhase の mapping table です。

    追加すべき表:

    Runtime source Overlay surface Conceptual IA bucket Notes
    title_menu title screen menu New Game / Load entry only
    load_menu load screen menu no sortie mutation
    preparation preparation screen preparation launch / save / upgrade
    running + !isPaused combat HUD combat DOM HUD overlay + Canvas visual layer
    running + isPaused pause overlay menu interruption runtime-local interruption; no LoopPhase mutation
    result result screen debrief DOM result is authoritative
    debrief_pending_reward / debrief_reward_claimed legacy compat only debrief legacy hidden from normal result UI

    6. rg 中心の VC は false-green を許す

    #1372 は docs-only なので pnpm lint:docs は妥当です。package.json にも lint:docs は存在し、lint:md、lint:prose、validate:roadmap-refs を実行します。

    問題は、他の VC が rg 中心で意味検証になっていないことです。rg -n "30秒" は「正しく解決された」ことを証明しません。rg -n "title_menu" は「phase-to-surface mapping が実装可能な形で定義された」ことを証明しません。

    修正要求: #1372 では rg を「存在確認」ではなく「許容箇所の制限」に使ってください。

    # Active timer contract must mention 30_000/fixedDeltaMs.
    rg -n "30_000|targetTicks|fixedDeltaMs|durationMs" \
      docs/product/features/sortie.md docs/product/game-logic.md
    

    Legacy timer terms must be absent from active requirements.

    rg -n "120s|120 秒|120秒|normal_end|sortie_timer_expired" docs/product/game-logic.md

    expected: only in explicitly superseded/future-scope notes

    Runtime LoopPhase mapping must be explicitly documented.

    rg -n "title_menu|load_menu|preparation|running|result|productPause|isPaused|legacy-debrief"
    docs/product/features/ui-information-architecture.md

    #727 must be routed, not just mentioned.

    rg -n "#727|Canvas visual cues|DOM HUD player status|rewrite|replace|supersede"
    docs/product/features/ui-information-architecture.md

    P1: 高リスク設計指摘

    7. pointer-events は focus 管理ではない

    #1373 は .battle-ui-layer { pointer-events: none } と interactive descendants の pointer-events: auto を入れる方向で、これは pointer routing としては妥当です。MDN も pointer-events: none では要素自身が pointer target にならず、下層や targetable な子にイベントが流れると説明しています。(MDNウェブドキュメント)

    ただし、これは keyboard focus や accessibility tree を制御しません。MDN は inert について、対象要素と flat tree descendants がクリック不可・focus 不可になり、tab order と accessibility tree から外れると説明しています。(MDNウェブドキュメント)

    #1372 の UI IA には、次の規約を明文化してください。

    Pointer transparency and focus exclusion are separate requirements.

    • Overlay roots MAY use pointer-events: none so non-interactive regions do not block canvas input.

    • Interactive descendants MUST opt into pointer targeting.

    • Inactive screens MUST use hidden or inert; pointer-events: none alone is not sufficient.

    • Runtime tests MUST verify visibility, focusability, and tab order, not only disabled.

    8. pause overlay は modal か non-modal かを曖昧にしない

    WAI-ARIA APG は、modal dialog では背後の window が inert であり、Tab / Shift+Tab は dialog 内を循環し、Escape で閉じ、閉じた後は通常 invoking element に focus を戻す、としています。(W3C)

    #1376 はかなり良くなっていますが、#1372 の UI IA 側でも「pause overlay の semantics decision」を要求すべきです。aria-modal="true" を使うなら外側を本当に inert にする。そうしないなら aria-modal を使わず、role="status" / labelled region + Resume button の non-modal interruption として扱う。この二択を docs に固定しないと、後続で「見た目だけ modal」「ARIA だけ modal」という壊れ方になります。

    9. Canvas result fill は本当に visual-only に押し込めるべき

    現行 CanvasRenderer は state.sortie.result.outcome から画面全体の fill を描いています。
    これは visual cue としては許容できますが、MDN は <canvas> 単体は bitmap で、描画された object は semantic HTML のように accessibility tools へ露出しないと説明しています。(MDNウェブドキュメント)

    #1372 は「Canvas result fill は visual-only、result details / Return to hangar は DOM overlay が正本」と書くだけでなく、UI IA の Interaction Accessibility Boundary にも「Canvas result cue MUST NOT be the only result representation」を追加してください。

    10. 現行 HUD は phase screen ではなく「全パネル常時生成 + disabled」

    HudController は Pilot feed / Progress / Sortie / Wingmates / Armory / Pilot updates / pause status / actions を一括生成しています。
    render() は phase ごとに button disabled を切り替えるだけで、inactive screen を hidden / inert にしていません。
    既存テストも running 中に full action surface が disabled で残ることを検証しています。

    #1372 は #1374/#1375 の前段なので、UI IA に「disabled は移行中の legacy rail behavior。overlay phase screen 完了後の正本ではない」と明記してください。そうしないと、後続 PR が「battle-stage 内に disabled 旧 rail を置いた」だけで AC を通す余地が残ります。

    P2: 配布・E2E・証跡の品質

    11. Vite / GitHub Pages は現状かなり良い。#1372 では壊さないことを明記するだけでよい

    Vite 公式は、https://<USERNAME>.github.io/<REPO>/ に deploy する場合は base を '/<REPO>/' に設定する、と説明しています。(vitejs)
    この repo は VITE_BASE_PATH を normalize して Vite base に渡し、PR preview では /${repo}/pr-${number}/ を注入し、dist/index.html の asset base path と root /assets/ 直指定なしを検証しています。

    また PR preview storage namespace は pr-${number} として dist 内検証まで入っています。LocalGameStorage も namespace がある場合は loop-protocol.preview.<namespace>.mvp.save を使う設計です。

    したがって #1372 で workflow 変更は不要です。ただし #1377 の証跡 AC は維持すべきです。#1377 は既に preview URL / commit SHA / run ID / artifact / viewport / DPR / zoom / userAgent / timezone、asset base path、storage namespace まで AC に持っています。

    12. screenshot baseline は「同じ環境で比較」を明文化する

    Playwright 公式は toHaveScreenshot() が初回 reference を生成し、以後比較すること、かつ OS / version / hardware / power source / headless などで rendering が変わるため同一環境で実行する必要がある、と説明しています。(Playwright)

    #1372 自体で screenshot を要求する必要はありませんが、UI IA の Evidence Policy には「baseline 更新は CI/browser/project 名と一緒に記録する」「volatile UI は mask / style injection 等で安定化する」方向の downstream note を追加してよいです。現行 UI IA は viewport / DPR / zoom / userAgent / timezone / screenshot/video reference を要求しているので、#1377 に継承させる形が妥当です。

    Issue 本文への具体的修正案

    AC をこう強化

    ## Acceptance Criteria

  3. AC1: UI IA defines the command-rail replacement policy:
    normal play controls move to a battle-stage DOM overlay; Canvas remains
    world / visual cue only and is never the sole interactive control surface.

  4. AC2: UI IA contains an explicit runtime LoopPhase-to-overlay-surface
    mapping for title_menu / load_menu / preparation / running / result /
    legacy debrief, and pause is derived from productPause.isPaused without
    adding LoopPhase.pause or independent uiScreen state.

  5. AC3: game-logic.md no longer contains active 120s / normal_end / outpost
    termination authority for the current MVP. Any remaining 120s text is
    explicitly marked superseded / future-scope, and sortie.md remains the
    authoritative 30_000ms fixed-tick timer source.

  6. AC4: UI timer / duration display authority is documented: display derives
    from elapsedTicks / targetTicks / fixedDeltaMs, not wall-clock time,
    rAF delta, performance.now(), or hard-coded elapsedTicks / 60.

  7. AC5: [Deferred] 実装: 戦闘中ステータス(HULL/HP)を戦闘描画画面(Canvas)に集約表示する #727 has an explicit routing comment stating that the old Canvas
    HULL/HP aggregation contract must not be resumed as-is and is superseded
    by Canvas visual cues + DOM HUD player status integration.

  8. AC6: UI IA states that inactive overlay surfaces are hidden or inert and
    excluded from tab order / accessibility tree; pointer-events policy is not
    treated as a focus-management substitute.

  9. [ ] AC7: docs checks pass.

  10. VC をこう差し替え

    pnpm lint:docs

    30s fixed-tick authority is visible in both source and downstream docs.

    rg -n "30_000|targetTicks|fixedDeltaMs|durationMs"
    docs/product/features/sortie.md docs/product/game-logic.md

    Old timer terms are not active current-MVP requirements.

    rg -n "120\s*秒|120s|sortie_timer_expired|normal_end|outpost"
    docs/product/game-logic.md

    expected: only explicitly superseded / future-scope text

    Runtime surface mapping is explicit.

    rg -n "title_menu|load_menu|preparation|running|result|productPause|isPaused|legacy-debrief"
    docs/product/features/ui-information-architecture.md

    Canvas/DOM responsibility split is explicit.

    rg -n "Canvas visual cue|DOM HUD overlay|sole interactive|Return to hangar|result.*authoritative"
    docs/product/features/ui-information-architecture.md

    #727 routing is explicit in docs; issue comment must also be linked in PR notes.

    rg -n "#727|rewrite|replace|supersede|Canvas visual cues|DOM HUD player status"
    docs/product/features/ui-information-architecture.md

    最終判断

    #1372 は 「やるべきこと」は正しいです。特に、30s timer authority、DOM overlay、pause の runtime-local derivation、#727 の非再開、Canvas result cue の visual-only 化は、親 #1370 と後続 #1373–#1377 の失敗を防ぐために必要です。

    ただし現状の #1372 は、文書が存在することを確認する Issue に近く、下流実装者が誤解できない SSOT を作る Issue になり切っていません。merge 条件は「30秒と書いた」「#727 と書いた」ではなく、「120s 旧契約を current MVP から排除した」「pause/result/timer/Canvas/DOM の authority を機械的に読める形にした」「#727 単体を見ても誤着手しない状態にした」まで上げるべきです。

    ## 判定

    REQUEST_CHANGES。#1372 の方向性は妥当ですが、blocker docs issue としてはまだ弱いです。
    #1372 は「command rail 統合前に UI IA と sortie timer authority を整理する」docs-only child で、コメントは現時点で 0 件です。親 #1370 は #1372 を #1373 以降の前提に置いており、#1373–#1377 も state/blocked の実装 child として #1372 後に進む設計です。つまり #1372 は単なる文書整理ではなく、後続 UI 実装の SSOT gate です。

    調査範囲は #1372、親 #1370、子 #1373–#1377、#727、#1282、PR #1365、関連コメント、ui-information-architecture.md / sortie.md / game-logic.md / game-design.md / ADR / main.ts / HudController.ts / SortieSystem.ts / CanvasRenderer.ts / deploy workflow / package scripts、および MDN・WAI-ARIA APG・Vite・Playwright の公式ドキュメントです。ローカルで pnpm は実行していません。

    P0: merge 前に直すべき点

    1. AC3 が「30秒と120秒の矛盾を本当に潰す」検証になっていない

    sortie.md は明確に 30 秒を正本にしています。targetTicks = ceil(30_000 / fixedDeltaMs)、durationMs = elapsedTicks * fixedDeltaMs、wall-clock / rAF / performance.now() を SortieResult duration や timeout 判定に使わない、という契約まで書かれています。

    一方で game-logic.md にはまだ timer 120s、sortie_timer_expired、normal_end、sortie timer ≥ 120s が残っています。特に REQ-LOGIC-VICTORY-001 と Victory/Defeat/Draw 節は、M2 現行実装の timeout と直接衝突します。

    #1372 の AC3 は「30s contradiction がなくなる」と言っていますが、VC は rg -n "30秒|30_000|targetTicks|120秒|120s" 程度に見えます。これは弱いです。文字列があることしか見ません。残った 120s が「superseded historical note」なのか「現役 requirements」なのかを判定できません。

    修正要求: game-logic.md の 120s / normal_end / outpost victory を、現行 M2 に対しては明示的に superseded / future scope に落としてください。単に 30 秒を追記するだけでは不可です。

    貼るならこの程度まで必要です。

    ### Current MVP override: sortie lifecycle
    
    For the current M2/M3 runtime, `docs/product/features/sortie.md` is the authoritative specification for sortie lifecycle, timer, terminal result, and duration derivation.
    
    - Timer authority: `targetTicks = ceil(30_000 / fixedDeltaMs)`.
    - Timeout outcome: elapsed ticks reaching `targetTicks` with enemies remaining yields `outcome: "timeout"` and `endReason: "timeout"`.
    - Duration authority: `durationMs = elapsedTicks * fixedDeltaMs`.
    - The older 120s / `normal_end` / outpost-destruction wording in this document is future-scope or superseded for the current MVP and MUST NOT be used by implementation issues unless a later spec delta reactivates it.

    VC も次に変えるべきです。

    pnpm lint:docs
    
    rg -n "targetTicks = ceil\\(30_000 / fixedDeltaMs\\)|durationMs = elapsedTicks \\* fixedDeltaMs" \
      docs/product/features/sortie.md docs/product/game-logic.md
    
    rg -n "120\\s*秒|120s|sortie_timer_expired|normal_end|outpost" docs/product/game-logic.md
    # expected: only in explicitly superseded / future-scope notes, not active Requirements or active Victory sections

    2. pause surface の derivation contract がまだ prose レベル

    現行 LoopPhase は title_menu / load_menu / preparation / running / result / legacy debrief だけで、pause は含みません。
    PhaseTransitionSystem にも pause transition はありません。
    pause は productPause.isPaused という runtime-local state で、handleTogglePause() は running 中だけ entry を許可し、paused 中は accumulator を進めず、render / HUD は継続します。

    #1372 はこの方向を認識していますが、「LoopPhase が正本」「pause は interruption overlay」の関係を実装者がそのまま関数化できる粒度に落としていません。ここが曖昧だと、#1376 で独立 uiScreen state が入りやすいです。

    修正要求: UI IA に次のような derivation contract を入れてください。

    type BattleOverlaySurface =
      | 'title'
      | 'load'
      | 'preparation'
      | 'combat'
      | 'result'
      | 'pause'
      | 'legacy-debrief-compat'
    
    function deriveBattleOverlaySurface(
      loopPhase: LoopPhase,
      isPaused: boolean,
    ): BattleOverlaySurface {
      if (isPaused && loopPhase === 'running') return 'pause'
    
      switch (loopPhase) {
        case 'title_menu': return 'title'
        case 'load_menu': return 'load'
        case 'preparation': return 'preparation'
        case 'running': return 'combat'
        case 'result': return 'result'
        case 'debrief_pending_reward':
        case 'debrief_reward_claimed':
          return 'legacy-debrief-compat'
      }
    }

    これに加えて、「pause は LoopPhase に追加しない」「独立 uiScreen state を追加しない」「legacy debrief は normal result UI ではなく compatibility-only」という文言を AC に入れるべきです。

    3. runtime timer display drift を #1372 が拾えていない

    SortieSystem は SORTIE_DURATION_MS = 30_000 を持ち、startSortie() で targetTicks = Math.ceil(SORTIE_DURATION_MS / fixedDeltaMs) を設定し、result の durationMs も elapsedTicks * fixedDeltaMs から作っています。

    しかし現行 HudController は result がない場合、duration 表示を s.elapsedTicks / 60 で近似しています。これは「60Hz 前提だから今は見た目上ほぼ合う」だけで、docs が固定した fixedDeltaMs authority とは一致していません。

    #1372 は docs-only なので runtime を直す必要はありません。ただし、後続 #1375 / #1376 が timer / duration を表示するため、#1372 の UI IA 側に「timer display authority」を明記しないと、後続実装で / 60 が温存されます。

    追加すべき契約:

    ### Timer display authority
    
    Normal-play timer / duration UI MUST derive elapsed and remaining sortie time
    from `state.sortie.elapsedTicks`, `state.sortie.targetTicks`, and the configured
    `fixedDeltaMs`.
    
    UI MUST NOT derive sortie duration from wall-clock time, `requestAnimationFrame`
    delta, `performance.now()`, or a hard-coded `elapsedTicks / 60` approximation.

    #1375 / #1376 の AC にも「duration display does not hard-code 60Hz」を追加すべきです。

    4. #727 は docs routing だけでは足りない

    #727 は [Deferred] で、OWNER 判断により「再開条件を満たすまで実装 PR を作成しない」と明記されています。理由も、HULL/HP だけを先に Canvas 集約すると後で DOM HUD との責務境界を再設計する可能性が高い、というものです。

    UI IA も #727 について「そのまま resume しない」「元の Canvas aggregated player HP/HULL 方向を supersede する」「Canvas visual cues + DOM HUD player status integration へ rewrite または replace」と書いています。

    #1372 の AC4 は「#727 routed in docs/comment」程度ですが、敵対的に見ると不十分です。未来の agent は #727 単体を見て作業する可能性があります。#727 本文には古い Canvas 集約の実装契約が残っているため、UI IA 側だけで routing しても誤着手リスクは残ります。

    修正要求: AC4 は「docs または comment」ではなく、#727 への routing comment を必須にしてください。

    - AC4: #727 has an explicit routing comment linking #1370/#1372 and stating
      that the old Canvas-aggregated HULL/HP implementation contract must not be
      resumed as-is; future work must rewrite/replace it as Canvas visual cues +
      DOM HUD player status integration.

    5. UI IA の conceptual phase と runtime LoopPhase の対応が未整理

    現行 UI IA の Phase Matrix は preparation / combat / debrief / menu / debug という conceptual phase で構成されています。
    一方、runtime は title_menu / load_menu / preparation / running / result / legacy debrief です。

    #1372 の目的はこの差分を埋めることですが、Issue 本文のままだと「UI IA に title_menu とか running という語を追加した」だけで通せます。必要なのは、conceptual phase と runtime LoopPhase の mapping table です。

    追加すべき表:

    Runtime source Overlay surface Conceptual IA bucket Notes
    title_menu title screen menu New Game / Load entry only
    load_menu load screen menu no sortie mutation
    preparation preparation screen preparation launch / save / upgrade
    running + !isPaused combat HUD combat DOM HUD overlay + Canvas visual layer
    running + isPaused pause overlay menu interruption runtime-local interruption; no LoopPhase mutation
    result result screen debrief DOM result is authoritative
    debrief_pending_reward / debrief_reward_claimed legacy compat only debrief legacy hidden from normal result UI

    6. rg 中心の VC は false-green を許す

    #1372 は docs-only なので pnpm lint:docs は妥当です。package.json にも lint:docs は存在し、lint:md、lint:prose、validate:roadmap-refs を実行します。

    問題は、他の VC が rg 中心で意味検証になっていないことです。rg -n "30秒" は「正しく解決された」ことを証明しません。rg -n "title_menu" は「phase-to-surface mapping が実装可能な形で定義された」ことを証明しません。

    修正要求: #1372 では rg を「存在確認」ではなく「許容箇所の制限」に使ってください。

    # Active timer contract must mention 30_000/fixedDeltaMs.
    rg -n "30_000|targetTicks|fixedDeltaMs|durationMs" \
      docs/product/features/sortie.md docs/product/game-logic.md
    
    # Legacy timer terms must be absent from active requirements.
    rg -n "120s|120 秒|120秒|normal_end|sortie_timer_expired" docs/product/game-logic.md
    # expected: only in explicitly superseded/future-scope notes
    
    # Runtime LoopPhase mapping must be explicitly documented.
    rg -n "title_menu|load_menu|preparation|running|result|productPause|isPaused|legacy-debrief" \
      docs/product/features/ui-information-architecture.md
    
    # #727 must be routed, not just mentioned.
    rg -n "#727|Canvas visual cues|DOM HUD player status|rewrite|replace|supersede" \
      docs/product/features/ui-information-architecture.md

    P1: 高リスク設計指摘

    7. pointer-events は focus 管理ではない

    #1373 は .battle-ui-layer { pointer-events: none } と interactive descendants の pointer-events: auto を入れる方向で、これは pointer routing としては妥当です。MDN も pointer-events: none では要素自身が pointer target にならず、下層や targetable な子にイベントが流れると説明しています。([MDNウェブドキュメント]1)

    ただし、これは keyboard focus や accessibility tree を制御しません。MDN は inert について、対象要素と flat tree descendants がクリック不可・focus 不可になり、tab order と accessibility tree から外れると説明しています。([MDNウェブドキュメント]2)

    #1372 の UI IA には、次の規約を明文化してください。

    Pointer transparency and focus exclusion are separate requirements.
    
    - Overlay roots MAY use `pointer-events: none` so non-interactive regions do not block canvas input.
    - Interactive descendants MUST opt into pointer targeting.
    - Inactive screens MUST use `hidden` or `inert`; `pointer-events: none` alone is not sufficient.
    - Runtime tests MUST verify visibility, focusability, and tab order, not only `disabled`.

    8. pause overlay は modal か non-modal かを曖昧にしない

    WAI-ARIA APG は、modal dialog では背後の window が inert であり、Tab / Shift+Tab は dialog 内を循環し、Escape で閉じ、閉じた後は通常 invoking element に focus を戻す、としています。([W3C]3)

    #1376 はかなり良くなっていますが、#1372 の UI IA 側でも「pause overlay の semantics decision」を要求すべきです。aria-modal="true" を使うなら外側を本当に inert にする。そうしないなら aria-modal を使わず、role="status" / labelled region + Resume button の non-modal interruption として扱う。この二択を docs に固定しないと、後続で「見た目だけ modal」「ARIA だけ modal」という壊れ方になります。

    9. Canvas result fill は本当に visual-only に押し込めるべき

    現行 CanvasRenderer は state.sortie.result.outcome から画面全体の fill を描いています。
    これは visual cue としては許容できますが、MDN は <canvas> 単体は bitmap で、描画された object は semantic HTML のように accessibility tools へ露出しないと説明しています。([MDNウェブドキュメント]4)

    #1372 は「Canvas result fill は visual-only、result details / Return to hangar は DOM overlay が正本」と書くだけでなく、UI IA の Interaction Accessibility Boundary にも「Canvas result cue MUST NOT be the only result representation」を追加してください。

    10. 現行 HUD は phase screen ではなく「全パネル常時生成 + disabled」

    HudController は Pilot feed / Progress / Sortie / Wingmates / Armory / Pilot updates / pause status / actions を一括生成しています。
    render() は phase ごとに button disabled を切り替えるだけで、inactive screen を hidden / inert にしていません。
    既存テストも running 中に full action surface が disabled で残ることを検証しています。

    #1372 は #1374/#1375 の前段なので、UI IA に「disabled は移行中の legacy rail behavior。overlay phase screen 完了後の正本ではない」と明記してください。そうしないと、後続 PR が「battle-stage 内に disabled 旧 rail を置いた」だけで AC を通す余地が残ります。

    P2: 配布・E2E・証跡の品質

    11. Vite / GitHub Pages は現状かなり良い。#1372 では壊さないことを明記するだけでよい

    Vite 公式は、https://<USERNAME>.github.io/<REPO>/ に deploy する場合は base を '/<REPO>/' に設定する、と説明しています。([vitejs]5)
    この repo は VITE_BASE_PATH を normalize して Vite base に渡し、PR preview では /${repo}/pr-${number}/ を注入し、dist/index.html の asset base path と root /assets/ 直指定なしを検証しています。

    また PR preview storage namespace は pr-${number} として dist 内検証まで入っています。LocalGameStorage も namespace がある場合は loop-protocol.preview.<namespace>.mvp.save を使う設計です。

    したがって #1372 で workflow 変更は不要です。ただし #1377 の証跡 AC は維持すべきです。#1377 は既に preview URL / commit SHA / run ID / artifact / viewport / DPR / zoom / userAgent / timezone、asset base path、storage namespace まで AC に持っています。

    12. screenshot baseline は「同じ環境で比較」を明文化する

    Playwright 公式は toHaveScreenshot() が初回 reference を生成し、以後比較すること、かつ OS / version / hardware / power source / headless などで rendering が変わるため同一環境で実行する必要がある、と説明しています。([Playwright]6)

    #1372 自体で screenshot を要求する必要はありませんが、UI IA の Evidence Policy には「baseline 更新は CI/browser/project 名と一緒に記録する」「volatile UI は mask / style injection 等で安定化する」方向の downstream note を追加してよいです。現行 UI IA は viewport / DPR / zoom / userAgent / timezone / screenshot/video reference を要求しているので、#1377 に継承させる形が妥当です。

    Issue 本文への具体的修正案

    AC をこう強化

    ## Acceptance Criteria
    
    - [ ] AC1: UI IA defines the command-rail replacement policy:
          normal play controls move to a battle-stage DOM overlay; Canvas remains
          world / visual cue only and is never the sole interactive control surface.
    
    - [ ] AC2: UI IA contains an explicit runtime LoopPhase-to-overlay-surface
          mapping for title_menu / load_menu / preparation / running / result /
          legacy debrief, and pause is derived from productPause.isPaused without
          adding LoopPhase.pause or independent uiScreen state.
    
    - [ ] AC3: game-logic.md no longer contains active 120s / normal_end / outpost
          termination authority for the current MVP. Any remaining 120s text is
          explicitly marked superseded / future-scope, and sortie.md remains the
          authoritative 30_000ms fixed-tick timer source.
    
    - [ ] AC4: UI timer / duration display authority is documented: display derives
          from elapsedTicks / targetTicks / fixedDeltaMs, not wall-clock time,
          rAF delta, performance.now(), or hard-coded elapsedTicks / 60.
    
    - [ ] AC5: #727 has an explicit routing comment stating that the old Canvas
          HULL/HP aggregation contract must not be resumed as-is and is superseded
          by Canvas visual cues + DOM HUD player status integration.
    
    - [ ] AC6: UI IA states that inactive overlay surfaces are hidden or inert and
          excluded from tab order / accessibility tree; pointer-events policy is not
          treated as a focus-management substitute.
    
    - [ ] AC7: docs checks pass.

    VC をこう差し替え

    pnpm lint:docs
    
    # 30s fixed-tick authority is visible in both source and downstream docs.
    rg -n "30_000|targetTicks|fixedDeltaMs|durationMs" \
      docs/product/features/sortie.md docs/product/game-logic.md
    
    # Old timer terms are not active current-MVP requirements.
    rg -n "120\\s*秒|120s|sortie_timer_expired|normal_end|outpost" \
      docs/product/game-logic.md
    # expected: only explicitly superseded / future-scope text
    
    # Runtime surface mapping is explicit.
    rg -n "title_menu|load_menu|preparation|running|result|productPause|isPaused|legacy-debrief" \
      docs/product/features/ui-information-architecture.md
    
    # Canvas/DOM responsibility split is explicit.
    rg -n "Canvas visual cue|DOM HUD overlay|sole interactive|Return to hangar|result.*authoritative" \
      docs/product/features/ui-information-architecture.md
    
    # #727 routing is explicit in docs; issue comment must also be linked in PR notes.
    rg -n "#727|rewrite|replace|supersede|Canvas visual cues|DOM HUD player status" \
      docs/product/features/ui-information-architecture.md

    最終判断

    #1372 は 「やるべきこと」は正しいです。特に、30s timer authority、DOM overlay、pause の runtime-local derivation、#727 の非再開、Canvas result cue の visual-only 化は、親 #1370 と後続 #1373–#1377 の失敗を防ぐために必要です。

    ただし現状の #1372 は、文書が存在することを確認する Issue に近く、下流実装者が誤解できない SSOT を作る Issue になり切っていません。merge 条件は「30秒と書いた」「#727 と書いた」ではなく、「120s 旧契約を current MVP から排除した」「pause/result/timer/Canvas/DOM の authority を機械的に読める形にした」「#727 単体を見ても誤着手しない状態にした」まで上げるべきです。

  11. squne121 commented on Jul 7, 2026

    @squne121
    OwnerAuthor

    Refinement Loop: Approved

    The issue has been approved and is ready for implementation.

    LOOP_HANDOFF_RESULT_V1:
      status: human_judgment_required
      routing_action: ask_human
      contract_review:
        status: go
        gate_result: fresh_go
        latest_comment_url: https://github.com/squne121/loop-protocol/issues/1372#issuecomment-4904076672
        generated_at: '2026-07-07T22:05:00Z'
        body_sha256: sha256:406f4b8d98eede1b8a6d985d1f6dbf284ba6143ff3521867fe2d2b79e0747d30
      metadata:
        title_prefix_ready: false
        phase_label_ready: false
      auto_fixes:
        result: human_judgment_required
        required: []
        skipped: []
      blockers: []
      permissions:
        unavailable: []
      generated_at: '2026-07-07T22:05:10Z'
  12. squne121 commented on Jul 7, 2026

    @squne121
    OwnerAuthor

    Contract Review Result

    CONTRACT_REVIEW_RESULT_V1:
      status: go
      generated_at: "2026-07-07T13:10:13Z"
      generated_by: issue-contract-review
      issue_url: https://github.com/squne121/loop-protocol/issues/1372
      body_sha256: "sha256:01f6a59dbfeda449fc589579682646cd3a430b4bd208974ee97324cd5ca7cd38"
      checks:
        readiness: go
        blockers: pass
        product_spec: pass
        vc_preflight: pass
      source: ensure_contract_snapshot_auto
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/implementation

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions