Repository navigation
feat(#1): 自機移動と Projectile 射撃システム (AC1-AC22) - #444
Conversation
WASD 移動・PointerEvent 射撃・60Hz fixed timestep・Projectile Canvas 描画の deterministic MVP を実装する。 主な変更: - src/state/GameState.ts: ProjectileState 型と projectiles[]/nextProjectileId 追加 - src/systems/MovementSystem.ts: boundary clamp と斜め入力正規化を保証 - src/systems/CombatSystem.ts: resources 非 mutate、aim epsilon fallback、projectile spawn - src/systems/ProjectileSystem.ts (新規): 移動・ageMs・lifetime/境界外削除 - src/systems/SimulationLoop.ts (新規): panic clamp をテスト可能な純関数に切り出し - src/main.ts: panic clamp 残余破棄 (accumulatorMs % fixedDeltaMs) と ProjectileSystem 統合 - src/input/InputBindings.ts (新規): KeyboardEvent.code + PointerEvent lifecycle (setPointerCapture/pointercancel/lostpointercapture) - src/render/CanvasRenderer.ts: devicePixelRatio 対応と Projectile 円描画 - src/style.css: canvas に touch-action: none 適用 - tests/: movement-system/combat-system/projectile-system/input-mapper/main-loop の拡充・新規 pnpm typecheck && pnpm lint && pnpm test (124 tests) && pnpm build: 全 PASS Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
squne121
left a comment
There was a problem hiding this comment.
Verdict: REQUEST_CHANGES
Mergeability
- mergeable=MERGEABLE, mergeStateStatus=BLOCKED(DRAFT 状態によるブロック、Conflict なし)
Evidence Check
AC coverage: △ — PR 本文の ## AC VC Results は AC3/AC5/AC9/AC11/AC12/AC14/AC15/AC17/AC18/AC19/AC21 の 11 件のみ記載。AC1/AC2/AC4/AC6/AC7/AC8/AC10/AC13/AC16/AC20/AC22 の 11 件は pnpm test PASS で代替されているが、PR テンプレートが求める [x] AC<N>: <達成(根拠)> 形式のチェックボックス一覧がない。個別 AC の達成根拠が確認できない。
Allowed Paths: △ — 以下 3 ファイルが Issue ## Allowed Paths に未記載:
src/systems/SimulationLoop.ts(新規)src/systems/index.ts(更新)tests/main-loop.test.ts(新規)
AC3 の「テスト可能な純関数 / ヘルパに切り出し」で機能的に意図された変更と解釈可能。ただし Allowed Paths への明示的な記載がない。src/systems/index.ts は既存ファイルの更新であり src/systems/ 配下の整合上必要な変更。PR 本文の Allowed Paths Compliance: true — 変更は全て contract の Allowed Paths 内 主張は根拠が薄い。
CI Verification: PASS — build/lint/test/typecheck/python-test すべて pass(gh pr checks 確認済み)
検証コマンド結果: △ — pnpm typecheck/lint/test/build は PASS 記載あり。rg/test -f 系コマンドは表で記録あり。ただし全 AC VC(AC1〜AC22 の完全一覧)との対応付けがなく部分的。
Schema Change Applicability: × — PR テンプレートが必須とする ## Schema Change Applicability セクションが欠落。GameState.ts への ProjectileState 追加は TypeScript 内部型であり Initial Known Schemas(issue_contract/v1 等)には該当しないが、not_schema_change の明示宣言がない。SKILL Step 4.5 の「not_schema_change を明示し根拠が diff と一致している場合は不要」に該当するためには明示が必要。
Safety Claim Matrix: × — PR テンプレートが必須とする ## Safety Claim Matrix セクションが欠落。changed paths・diff キーワードに safety-sensitive 条件は認められず N/A と判断されるが、N/A の一行記載もない。
Runtime Verification Applicability: PASS — decision: deferred を明示し、deferred_destination に後続 playtest issue への参照あり。Issue の <!-- runtime-verification: deferred --> と一致。
Blockers
-
[BLOCKER] PR テンプレート必須セクションの欠落 — Schema Change Applicability:
## Schema Change Applicabilityセクションが存在しない。not_schema_changeの明示と根拠(GameState への ProjectileState 追加が Initial Known Schemas の変更でない理由)を記載してください。APPROVE 禁止条件(SKILL Step 4.5)。 -
[BLOCKER] PR テンプレート必須セクションの欠落 — Safety Claim Matrix:
## Safety Claim Matrixセクションが存在しない。changed paths・diff に safety-sensitive 条件が認められない場合はN/Aと理由一行の記載で足ります。APPROVE 禁止条件(SKILL Step 4.6)。 -
[BLOCKER] Allowed Paths の逸脱または未記載:
src/systems/SimulationLoop.ts、src/systems/index.ts、tests/main-loop.test.tsが Issue## Allowed Pathsに記載されていない。PR 本文の「変更は全て contract の Allowed Paths 内」主張が成立していない。Allowed Paths 逸脱として記録(SKILL Step 4 Allowed Paths 遵守チェック)。補足: AC3「テスト可能な純関数 / ヘルパに切り出し」という仕様意図からすると
SimulationLoop.tsは意図された変更と読めるため、Issue## Allowed Pathsにこの 3 ファイルを追記 または PR 本文で逸脱の根拠と Issue 担当者承認を明示することで解消できます。 -
[BLOCKER] AC coverage の形式不備: PR テンプレートが求める
## 受け入れ条件の達成状況のチェックボックス一覧([x] AC<N>: <達成(根拠)>)が存在しない。AC1〜AC22 の全件について、達成根拠の記載が必要です。
Non-blockers
mergeStateStatus=BLOCKEDは DRAFT 状態によるものと推測。Ready for Review への移行と同時に解消見込み。確認推奨。
LOOP_VERDICT
verdict: REQUEST_CHANGES
blockers:
- schema_change_applicability_section_missing
- safety_claim_matrix_section_missing
- allowed_paths_undeclared_files
- ac_coverage_format_missing
mergeable: MERGEABLE
mergeStateStatus: BLOCKED
reviewed_head_sha: f2bfa15014d6347b9fec28298007819f5fe33505
follow_up_issue_requests: []
squne121
left a comment
There was a problem hiding this comment.
Verdict: APPROVE
iteration: 1 — 前回 iteration 0 で指摘した 4 blockers(Schema Change Applicability / Safety Claim Matrix / Allowed Paths Scope Delta / AC checkbox list)がすべて解消された。
Mergeability
- mergeable=MERGEABLE, mergeStateStatus=CLEAN
Evidence Check
- AC coverage: 全 22 件 [x] 済み・根拠記載あり
- Allowed Paths: 全 16 ファイルが issue Allowed Paths または Scope Delta(SimulationLoop.ts / systems/index.ts / main-loop.test.ts)に収まる。Issue #1 の Allowed Paths に Scope Delta 追記済みで整合。
- CI Verification: build / lint / python-test / test / typecheck / Generate agent session manifest がすべて pass
- 検証コマンド結果: PR 本文 Verification Commands Results テーブルで pnpm typecheck / lint / test / build 全件 PASS 記録あり
- Schema Change Applicability:
not_schema_changeを明示・根拠(GameState.projectiles は runtime 初期化のみ・永続化 schema 変更なし)が diff と整合 - Safety Claim Matrix:
N/Aを明示・根拠(認証/権限/sandbox/MCP 非関与、決定論的状態更新のみ)が diff と整合 - Runtime Verification:
decision: deferred— M1 Foundation Gate playtest phase への deferred destination 参照あり - Scope Delta: PR 本文 Scope Delta テーブルと Issue #1 Allowed Paths が一致
Blockers
なし
Non-blockers(任意改善)
なし
LOOP_VERDICT
verdict: APPROVE
blockers: []
mergeable: MERGEABLE
mergeStateStatus: CLEAN
reviewed_head_sha: f2bfa15014d6347b9fec28298007819f5fe33505
follow_up_issue_requests: []
結論:
|
… / clamp invariant / blur+visibility reset / setTransform - src/main.ts: replace hand-written accumulator/while/panic with advanceSimulationLoop(); call clampPlayerToArena() in resizeArena() - src/state/GameState.ts: add runtime-only lastAimDirectionX/Y to PlayerState (not in GameSnapshot) - src/systems/CombatSystem.ts: save direction on normal aim; use lastAimDirection when dist < epsilon (AC14) - src/systems/MovementSystem.ts: extract clampPlayerToArena() export; always clamp regardless of move command presence - src/input/InputBindings.ts: resetInput() on window blur and document visibilitychange (guarded for non-browser envs) - src/render/CanvasRenderer.ts: replace context.scale(dpr,dpr) with setTransform(dpr,0,0,dpr,0,0) - tests: add clamp-without-move / resize-clamp tests; add AC14 last-aim fallback test (upward aim → same-position → uses last direction) Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
squne121
left a comment
There was a problem hiding this comment.
Verdict: APPROVE
iteration 2 として前回 REQUEST_CHANGES(Blocker 1-3 + 2 minor)の全件対応を確認。
Mergeability
- mergeable=MERGEABLE, mergeStateStatus=CLEAN
Evidence Check
- AC coverage: AC1〜AC22 全件 [x] 記載、各項目に根拠あり(placeholder なし)
- Allowed Paths: 変更 15 ファイルが全て Issue #1 の Allowed Paths + Scope Delta 3 件(SimulationLoop.ts / systems/index.ts / main-loop.test.ts)の範囲内。Scope Delta は Issue 本文に追記済み
- CI Verification: build/lint/typecheck/test/python-test 全 pass(GitHub Actions 確認済み)
- 検証コマンド結果: PR 本文の Verification Commands Results テーブルに PASS 記録あり(127 tests / 9 files)
Blocker 1 解消確認: SimulationLoop production wiring
src/main.ts が advanceSimulationLoop を import し、frame() 内で advanceSimulationLoop(accumulatorMs, deltaMs, defaultSimulationConfig, stepSimulation) を呼び result.accumulatorMs で accumulator を更新している。production と test helper が同一実装であることを確認。
Blocker 2 解消確認: AC14 lastAimDirection fallback
PlayerState に lastAimDirectionX / lastAimDirectionY を追加(初期値 +X)。CombatSystem で非ゼロ aim 時に persist し、dist < AIM_EPSILON_PX 時に参照。tests/combat-system.test.ts に「上方向 aim → 同一点 aim → 上方向 projectile」の分岐テストが追加されていることを確認(lastAimDirectionY が -1 になることを assertion している)。
Blocker 3 解消確認: clampPlayerToArena 分離と resize 後呼び出し
clampPlayerToArena() を独立 export として MovementSystem.ts に実装。runMovementSystem() 末尾で move コマンド有無に関係なく呼び出し。resizeArena() 後にも clampPlayerToArena(currentState) を明示呼び出し。tests/movement-system.test.ts に「no move command でも clamp される」「arena 縮小後に clampPlayerToArena を呼ぶと境界内に収まる」の 2 テストが追加されていることを確認。
Minor 解消確認
window.blur/visibilitychangeでresetInput()呼び出し実装済み(InputBindings.ts確認)context.setTransform(dpr, 0, 0, dpr, 0, 0)使用確認済み(CanvasRenderer.ts確認)
Schema / Safety ゲート
- Schema Change Applicability:
not_schema_changeを明示・根拠が diff と整合(GameSnapshot 変更なし、runtime state のみ) - Safety Claim Matrix:
N/Aとして根拠記載あり(認証・権限・外部 I/O 非該当)
Blockers
なし
Non-blockers
なし
LOOP_VERDICT
verdict: APPROVE
blockers: []
mergeable: MERGEABLE
mergeStateStatus: CLEAN
reviewed_head_sha: ad638dbe0eeff2e8aecd21ef89e503673a0b7c06
follow_up_issue_requests: []|
結論としては、PR #444 の deferred を直接消化する「playtest issue」より先に、E2E / browser playtest 基盤を作る Issue を 1 本切るべきです。理由は、PR #444 は実ブラウザ上の弾道・pointer 体感確認を後続 playtest issue に deferred している一方で、現状の 既存の 起票案TitleBody## Machine-Readable Contract
contract_schema_version: v1
issue_kind: implementation
parent_issue: "#1"
goal_ref: "PR #444 で deferred された『ブラウザ上での実際の弾道・pointer 体感確認』を、後続 playtest issue で実行可能にするため、E2E / browser playtest foundation を導入する"
change_kind: test-infra
## Parent Issue
#1
## Parent Goal Ref
- Goal: 自機移動と Projectile 射撃システムを、Canvas 上で実際に操作・確認できる状態にする
- Deferred source: PR #444 `Runtime Verification Applicability`
- `decision: deferred`
- ブラウザ上での実際の弾道・pointer 体感確認は後続 playtest issue で実施
## Problem
PR #444 では unit test / build は通っているが、実ブラウザ上で以下を確認する基盤が未整備である。
- WASD 入力が実ブラウザで player movement に接続されていること
- pointer down / move / up / cancel / lostpointercapture が実ブラウザで破綻しないこと
- projectile が Canvas 上で視認できること
- fixed timestep / render / input binding / Canvas の統合がブラウザ環境で最低限成立すること
- 人間による体感確認結果を playtest-log へ残す導線があること
既存の `docs/product/playtest-protocol.md` は `browser_automation` を UI/Canvas/DOM 統合・リグレッションの根拠として認めているが、現状の package scripts には `test:e2e` 相当の入口がない。
## Outcome
Playwright ベースの最小 E2E foundation が導入され、PR #444 相当の movement + projectile を対象に、以下が可能になっている。
- `pnpm test:e2e` でローカル / CI から実ブラウザ smoke test を実行できる
- `pnpm test:e2e:ui` または `pnpm test:e2e:debug` で人間が操作確認しやすい導線がある
- Canvas / input / projectile の最低限の統合テストが存在する
- failure 時に trace / screenshot / video の少なくとも trace が保存される
- `docs/product/playtest-log.md` の schema に従って、PR #444 の deferred runtime verification を記録できる最小サンプルまたは手順がある
## In Scope
- Playwright Test の導入
- `@playwright/test` の devDependency 追加
- `playwright.config.ts` の追加
- `pnpm test:e2e` script の追加
- 必要なら `pnpm test:e2e:ui` / `pnpm test:e2e:debug` script を追加
- E2E smoke test の追加
- Vite preview または dev server を Playwright から起動
- 初期画面が表示されること
- Canvas 要素が存在し、表示サイズを持つこと
- `W/A/S/D` 入力を送れること
- pointer down / move / up による射撃操作を送れること
- projectile 生成の観測は、可能なら debug/test-only DOM overlay または exported state hook で検証する
- Canvas / state の観測方法の最小設計
- 過度な本番 UI 汚染を避ける
- `import.meta.env.DEV` または test-only hook など、production behavior を変えない観測境界を明示する
- Playtest 記録導線
- `docs/product/playtest-protocol.md` の `browser_automation` / `human_internal` の使い分けに沿う
- `docs/product/playtest-log.md` に記録するための最小テンプレート、または `docs/product/playtest-sessions/README.md` を追加する
- CI 統合
- 既存 CI に `pnpm test:e2e` を追加する、または CI 追加を別 Issue に deferred する場合は理由を明示する
## Out of Scope
- 敵、当たり判定、ダメージ、sortie 終了条件の実装
- balance / tuning の決定
- 「面白さ」「操作感が良い」などの UX 妥当性を自動 E2E の結果だけで主張すること
- 外部テスター募集
- raw video / PII を public repository に保存すること
- 大規模な telemetry 基盤
- Vitest Browser Mode への全面移行
- visual regression snapshot の厳密な baseline 運用
## Acceptance Criteria
- AC1: `package.json` に `test:e2e` script が追加されている
- AC2: `@playwright/test` が devDependency として追加されている
- AC3: `playwright.config.ts` が存在し、Vite app を起動して E2E test を実行できる
- AC4: `tests/e2e/` 配下に movement + projectile smoke test が存在する
- AC5: E2E smoke test は Canvas の存在・表示サイズ・keyboard 入力・pointer 入力を実ブラウザで検証する
- AC6: failure 時の trace が保存される設定になっている
- AC7: `pnpm test:e2e` がローカルで PASS する
- AC8: `pnpm typecheck && pnpm lint && pnpm test && pnpm build` が PASS する
- AC9: playtest-log への記録方法が `docs/product/playtest-log.md` の schema と矛盾しない
- AC10: 自動 E2E の結果を UX 妥当性の証拠として扱わない旨が docs または PR body に明記されている
## Verification Commands
# AC1: script 確認
node -e "const p=require('./package.json'); if (!p.scripts?.['test:e2e']) process.exit(1)"
# AC2: dependency 確認
node -e "const p=require('./package.json'); if (!p.devDependencies?.['@playwright/test']) process.exit(1)"
# AC3: config 確認
test -f playwright.config.ts
# AC4: E2E test 存在確認
test -d tests/e2e && rg -n "projectile|pointer|keyboard|canvas|WASD|KeyW|mouse" tests/e2e
# AC7: E2E 実行
pnpm test:e2e
# AC8: 既存品質ゲート
pnpm typecheck && pnpm lint && pnpm test && pnpm build
# AC9/AC10: playtest policy との整合確認
rg -n "browser_automation|human_internal|UX|playtest-log|trace" docs tests package.json playwright.config.ts
## Allowed Paths
- `package.json`
- `pnpm-lock.yaml`
- `playwright.config.ts`
- `tests/e2e/**`
- `.github/workflows/**`
- `docs/product/playtest-log.md`
- `docs/product/playtest-protocol.md`
- `docs/product/playtest-sessions/**`
- `src/**`
- ただし test-only observability hook に必要な最小変更のみ
## Stop Conditions
- production behavior を変えないと E2E 観測が成立しない場合
- Canvas 描画の pixel-perfect visual regression を必須にしないと AC 達成できない場合
- Playwright ではなく別ツールへ全面移行する必要が判明した場合
- CI 実行時間・browser install・環境依存で既存 CI を不安定化させる場合
- `docs/product/playtest-protocol.md` の UX evidence policy と矛盾する場合
- 外部テスター、録画、PII 保存が必要になる場合
## Runtime Verification Applicability
decision: required
reason: この Issue は runtime code の主要挙動を変更しないが、実ブラウザ上の input / Canvas / render 統合を検証する基盤を導入するため、`pnpm test:e2e` による browser_automation runtime verification を必須とする。
deferred_destination: null
deferred_verification_condition: null後続 Issue として分けるべきものこの基盤 Issue とは別に、PR #444 の deferred を実際に消化する playtest execution issue を 1 本切るのが妥当です。 こちらは実装ではなく、 補足すると、Playwright は keyboard / mouse 操作、trace viewer、video、visual screenshot comparison を公式に持っているため、今回の「実ブラウザで pointer と Canvas を確認する」基盤には Playwright が第一候補でよいです。Vitest Browser Mode はブラウザ globals を使えるため component/browser test には向きますが、この Issue では「実アプリを起動して WASD / pointer / Canvas をまたぐ E2E」が主眼なので、まず Playwright Test に寄せるのが安全です。([Playwright]4) |
… smoke test (#451) * feat(#447): E2E / browser playtest foundation — movement + projectile smoke test Introduces Playwright-based E2E foundation for the movement + projectile integration established in PR #444. The implementation: - Adds `@playwright/test` devDependency and `playwright.config.ts` using Vite preview server (pnpm build && pnpm preview, port 4173) - Adds 11 behavioral smoke tests in `tests/e2e/movement-projectile.spec.ts` covering canvas visibility, WASD movement axes, keyup stop, projectile generation via pointer down, projectile movement, pointerup/pointercancel state clearing (AC5, AC11) - Adds `test:e2e`, `test:e2e:ui`, `test:e2e:debug`, `test:e2e:headed`, `playwright:install`, `playwright:install:ci` scripts to package.json (AC1) - Adds read-only `window.__LOOP_E2E__` observability hook in src/main.ts, gated by `VITE_E2E_MODE=true`; absent from production builds (AC12) - Adds CI e2e job with Chromium install + failure artifact upload (AC13) - Adds `docs/product/playtest-sessions/` directory with README and sample session record aligned to playtest-log.md schema (AC9) - Excludes `tests/e2e/**` from vitest to prevent Playwright test mixing All 11 E2E tests PASS locally. Production build confirmed free of `__LOOP_E2E__`. pnpm typecheck && lint && test && build all PASS. NOTE: Automatic E2E results confirm integration correctness only and are NOT UX validity evidence. Human playtesting remains required for feel/UX. Co-Authored-By: Claude Sonnet 4.6 <[email protected]> * fix(e2e): CI webServer timeout を解消するため build を CI step に分離する playwright.config.ts の webServer.command から pnpm build を除去し、 CI e2e ジョブに独立した build step (VITE_E2E_MODE=true pnpm build) を追加。 120 秒以内に build + preview 起動が完了しない問題を解消する (Option B)。 Co-Authored-By: Claude Sonnet 4.6 <[email protected]> * fix(#447): use pnpm exec vite preview to correctly pass --host flag pnpm preview -- --host 127.0.0.1 caused the -- separator to stop Vite's option parsing, so --host was never received. This resulted in Playwright's webServer timing out in CI because it could not connect to the expected URL. Co-Authored-By: Claude Sonnet 4.6 <[email protected]> * fix(#447): address PR #451 human review blockers (B1–B5) - B1: test:e2e now includes build step (VITE_E2E_MODE=true pnpm build && playwright test) so it is self-contained without a pre-built dist/ - B2: __LOOP_E2E__.getState() returns a spread-copy snapshot instead of the live state reference; adds input.{primaryPressed,activePointerId} to the snapshot - B3: pointerup and pointercancel tests now explicitly assert primaryPressed===false and activePointerId===null after the event - B4: new test 'lostpointercapture clears active pointer state' verifies the lostpointercapture handler - B5: new smoke test 'projectile renders on canvas' confirms canvas pixel data changes after firing Also: adds activePointerId to InputState and writes it from InputBindings.ts (replaces closure-local capturedPointerId so the field is observable from the E2E hook). Co-Authored-By: Claude Sonnet 4.6 <[email protected]> * fix(#447): iteration 4 blockers — oracle, CI double-build, playtest template B1: template-ize PT-20260529-001 playtest session file; replace stale build_ref/success_count/runs with <FILL_IN_FROM_CI> placeholders and add header clarifying this is a format sample, not an actual run record. B2: strengthen projectile movement oracle to use expect.poll with 1s timeout so the test fails (not silently passes) if the projectile never moves. Removed the expired-fallback exit path. B3: add test:e2e:ci script (playwright test only, no build step); update CI e2e job to use test:e2e:ci to eliminate double-build; fix playwright.config.ts comment to reflect actual webServer.command. Co-Authored-By: Claude Sonnet 4.6 <[email protected]> --------- Co-authored-by: Claude Sonnet 4.6 <[email protected]>
* fix(test): exclude .claude/worktrees/** from Vitest discovery Orphaned worktrees containing E2E spec files were being picked up by vitest, causing Playwright test context errors in unit test runs. Co-Authored-By: Claude Sonnet 4.6 <[email protected]> * docs(#448): add PR #444 deferred playtest session records Discharges the deferred runtime verification from PR #444 by adding: - PT-20260529-001-pr444-browser-automation.md: actual pnpm test:e2e results (13/13 passed, build_ref 75cfc1e, retain-on-failure artifacts) - PT-20260529-002-pr444-human-internal.md: developer-self human internal playtest of movement + projectile, with 10-step task script Co-Authored-By: Claude Sonnet 4.6 <[email protected]> * fix(#448): fix playtest session schema violations - success_rate: "100%" → 1.0 (schema invariant: 0.0–1.0 fraction) - storage_class: "retain-on-failure" → "local_git" (Playwright retention policy moved to artifact_absent_reason) - automation: null added to human_internal session - confidence: high → medium for developer-self UX observations - decision: no_action → defer for entries where UX validity is unconfirmed - Remove overconfident "no tuning concerns" / "acceptable" phrasing Co-Authored-By: Claude Sonnet 4.6 <[email protected]> --------- Co-authored-by: Claude Sonnet 4.6 <[email protected]>
Closes #1
Summary
ProjectileState型とprojectiles[]/nextProjectileIdをGameStateに追加し、Projectile ライフサイクルの state 契約を固定CombatSystemを fire/cooldown/spawn に限定しprogress.resourcesの非意図的 mutate を除去ProjectileSystem(新規)がdirection * speed * dt移動・ageMs 管理・lifetime/境界外削除を担当SimulationLoop(新規純関数)で panic clamp 残余破棄をテスト可能に切り出し;src/main.tsがadvanceSimulationLoop()を呼ぶよう接続済みInputBindings(新規)でKeyboardEvent.code(KeyW/A/S/D)と PointerEvent lifecycle(setPointerCapture/pointercancel/lostpointercapture)を実装;blur/visibilitychange時に入力リセット追加CanvasRendererにdevicePixelRatiobacking store 拡大と Projectile 円描画を追加;context.scale→setTransformに変更touch-action: noneを canvas に CSS 適用PlayerStateに runtime-onlylastAimDirectionX/Yを追加(GameSnapshot対象外); 同一点 aim fallback で前回 aim 方向を利用(AC14)clampPlayerToArena()を独立 export として切り出し; move command なし / resize 後でも invariant 保証Schema Change Applicability
not_schema_changeGameState.projectiles/nextProjectileId/lastAimDirectionX/Y)の追加であり、永続化フォーマット・wire format・on-disk schema を含まない。createGameSnapshotの出力 schema(resources/weaponPower/playerMaxHp)は 変更なし。localStorage永続化されるGameSnapshotは backwards-compatible。projectilesは runtime 初期化時に空配列で生成、永続化対象外)。Safety Claim Matrix
N/Adocs/dev/secret-policy.md)に影響する要素なし(VITE_*への sensitive 値追加なし、external API 呼び出しなし)。Scope Delta
Issue #1 の Allowed Paths に対し、以下 3 ファイルを 追加スコープ として変更している。AC3「panic clamp 残余破棄をテスト可能な純関数 / ヘルパに切り出し」を実現するための最小派生で、Issue contract の意図と整合する。
src/systems/SimulationLoop.ts(新規)runFixedTimestep純関数を Issue Allowed Paths のsrc/systems/配下に新設src/systems/index.tstests/main-loop.test.ts(新規)Issue #1 本文の
## Allowed Pathsに同 3 件を Scope Delta として追記済み: #1受け入れ条件の達成状況
fixedDeltaMs = 1000/60/SimulationConfig.ts)maxFrameSkip = 5で catch-up step 上限化(SimulationConfig.ts/main.ts)accumulatorMs = accumulatorMs % fixedDeltaMsで残余破棄(src/main.tsがadvanceSimulationLoop()経由 /SimulationLoop.ts純関数 /tests/main-loop.test.ts)weaponCooldownMs -= deltaMs(simulation tick)で管理(CombatSystem.ts、wall clock 非依存)KeyboardEvent.code(KeyW/KeyA/KeyS/KeyD)で取得しInputCommandに正規化(src/input/InputBindings.ts)MovementSystem.tsのMath.hypot/tests/movement-system.test.ts)[player.radius, arena_size - player.radius]boundary clamp(MovementSystem.ts/tests/movement-system.test.ts); move command なし / resize 後も保証{aimX, aimY}で保持し角度をGameState/InputCommandに保持しない(CombatSystem で派生計算)pointerdownでevent.isPrimary && event.button === 0のみ受理、canvas.setPointerCapture(event.pointerId)呼び出し(InputBindings.ts)pointerIdに一致するpointermoveのみ aim 更新(InputBindings.ts)pointerup/pointercancel/lostpointercaptureでprimaryPressed = false(InputBindings.ts)touch-action: noneを CSS 適用(src/style.css)tests/combat-system.test.ts)AIM_EPSILON_PX = 0.001未満で前回 aim 方向保存・利用 fallback、初期値+X(PlayerState.lastAimDirectionX/Y/CombatSystem.ts/tests/combat-system.test.ts— 上方向 aim → 同一点 aim → 上方向 projectile を検証)ProjectileState(id/x/y/radius/directionX/directionY/speedPxPerSec/ageMs/lifetimeMs)+nextProjectileIdをGameState.tsに追加CombatSystemがprogress.resourcesを mutate せず、damage 発生なし(tests/combat-system.test.tsで検証)src/systems/ProjectileSystem.ts新規作成ageMs >= lifetimeMsまたは arena 境界 +margin で削除、残存順 deterministic(ProjectileSystem.ts/tests/projectile-system.test.ts)devicePixelRatioで backing store 拡大 +setTransform(dpr,0,0,dpr,0,0)(CanvasRenderer.ts)src/state/src/systems配下にdevicePixelRatio参照なし(grep 確認済み)MovementSystem → CombatSystem → ProjectileSystem → CollisionSystemの順でstepSimulation内に統合(src/main.ts)pnpm typecheck && pnpm lint && pnpm test && pnpm buildが PASS(127 tests / 9 files)Verification Commands Results
pnpm typecheckpnpm lintpnpm testpnpm buildRuntime Verification Applicability
decision: deferred— ブラウザ上での実際の弾道・pointer 体感確認は feature spec PH-1〜PH-4 を扱う後続 playtest issue(M1 Foundation Gate phase)で実施。Contract Snapshot
#1 (comment)