Skip to content

docs(#2): movement + projectile 最小仕様を feature spec として固定する - #440

Merged
squne121 merged 2 commits into
mainfrom
worktree-issue-2-movement-projectile-spec
May 28, 2026
Merged

squne121 merged 2 commits into
mainfrom
worktree-issue-2-movement-projectile-spec

Conversation

@squne121

Copy link
Copy Markdown
Owner

Summary

  • docs/product/features/movement-projectile.md を compact feature spec として新規追加(AC1〜AC6 対応)
  • docs/dev/ssot-registry.md に movement-projectile エントリを追加(AC7 対応)
  • docs/dev/workflow.md SSOT Routing Table に movement-projectile エントリを追加(条件付き更新: 追加が必要と判断)

Closes #2
Refs: #2 (comment) (contract snapshot)
Refs: #2 (comment) (anchor spec)

Verification Commands

コマンド 結果
pnpm typecheck PASS
pnpm lint PASS
pnpm test PASS (7 files, 75 tests)
pnpm build PASS

Allowed Paths Compliance

  • docs/product/features/movement-projectile.md (new) — in scope
  • docs/dev/ssot-registry.md (append) — in scope
  • docs/dev/workflow.md (conditional: SSOT Routing Table update) — in scope

Runtime Verification Applicability

decision: not_applicable — docs-only change, no runtime behavior.

🤖 Generated with Claude Code

player 移動・aim・fire・projectile の定数識別子・座標系・lifecycle・テスト AC を
docs/product/features/movement-projectile.md に compact spec として追加し、
#1 実装者が着手判断できる規約を一箇所に固定する。

- ssot-registry.md に movement-projectile エントリを追加
- workflow.md SSOT Routing Table に movement-projectile エントリを追加

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>

@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.

Verdict: APPROVE

Mergeability

  • mergeable=MERGEABLE, mergeStateStatus=CLEAN

Evidence Check

  • AC coverage: 8/8 PASS — AC1 frontmatter confirmed; AC2 all 7 required sections present; AC3 all 9 fixed constant identifiers present; AC4 requestAnimationFrame/60Hz/120Hz/devicePixelRatio all mentioned; AC5 all 4 test files enumerated; AC6 collision/damage/enemy AI/visual effects in non_goals; AC7 ssot-registry.md entry added; AC8 CI 6/6 pass
  • Allowed Paths: 遵守 — 変更ファイル 3 件 (docs/product/features/movement-projectile.md / docs/dev/ssot-registry.md / docs/dev/workflow.md) はすべて Allowed Paths 内
  • CI Verification: 6/6 pass (generate-agent-session-manifest / build / lint / python-test / test / typecheck)
  • 検証コマンド結果: PR 本文の Verification Commands 表に pnpm typecheck/lint/test/build が PASS と記録されている。TEST_VERDICT_MACHINE コメントは未投稿だが CI アーティファクトが全 pass のため証跡充足と判定
  • schema_change_applicability: not_schema_change — 変更はすべて prose docs であり consumer 境界をまたぐ contract 変更なし
  • safety-sensitive: false — 変更パスに transport/permission/sandbox/auth/mcp/tool/workflow/.claude/skills 等は含まれない
  • Runtime Verification Applicability: not_applicable — docs-only 変更。Issue contract に明示記載あり

Blockers

なし

Non-blockers(任意改善)

なし

LOOP_VERDICT

verdict: APPROVE
blockers: []
mergeable: MERGEABLE
mergeStateStatus: CLEAN
reviewed_head_sha: c666e69991c8ab69d2e6fb67183ed7d023e72772
follow_up_issue_requests: []

@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.

Verdict: APPROVE

Mergeability

  • mergeable=MERGEABLE, mergeStateStatus=CLEAN

Evidence Check

  • AC coverage: 8/8 PASS — AC1 frontmatter confirmed; AC2 all 7 required sections present; AC3 all 9 fixed constant identifiers present; AC4 requestAnimationFrame/60Hz/120Hz/devicePixelRatio all mentioned; AC5 all 4 test files enumerated; AC6 collision/damage/enemy AI/visual effects in non_goals; AC7 ssot-registry.md entry added; AC8 CI 6/6 pass
  • Allowed Paths: 遵守 — 変更ファイル 3 件はすべて Allowed Paths 内
  • CI Verification: 6/6 pass (generate-agent-session-manifest / build / lint / python-test / test / typecheck)
  • 検証コマンド結果: PR 本文 Verification Commands 表に pnpm typecheck/lint/test/build が PASS と記録。CI アーティファクト全 pass で証跡充足
  • schema_change_applicability: not_schema_change
  • safety-sensitive: false
  • Runtime Verification Applicability: not_applicable (docs-only)

Blockers

なし

Non-blockers

なし

LOOP_VERDICT

verdict: APPROVE
blockers: []
mergeable: MERGEABLE
mergeStateStatus: CLEAN
reviewed_head_sha: c666e69991c8ab69d2e6fb67183ed7d023e72772
follow_up_issue_requests: []

@squne121

Copy link
Copy Markdown
Owner Author

結論: REQUEST CHANGES

PR #440 は Issue #2 の表面的な AC は満たしていますが、fixed timestep / panic clamp の扱いで既存 SSOT と衝突しており、このまま #1 実装の参照仕様にすると実装者が誤った main loop を作るリスクがあります。Draft なので、ここで直すべきです。


Blocker 1: panic clamp 後の residual carry が既存 SSOT と矛盾している

PR の新規 spec は、60Hz 固定タイムステップについて「background 復帰時の panic clamp 後の残余時間は次フレームへ持ち越す」と規定しています。

一方、既存 docs/product/game-logic.md は panic clamp について「最大 5 step の catch-up のみ許可。6 step 以上必要な場合は頭を切る」と明記しており、遅延を避け、determinism と safety を優先する設計です。

これは単なる表現差ではありません。残余時間を無条件に持ち越すと、復帰後や高負荷時に backlog が残り続け、毎フレーム catch-up が発生します。固定ステップ実装では、処理が追いつかないと catch-up のためにさらに多くの step を要求し、いわゆる spiral of death に入るため、最大 step 数で clamp し、必要なら simulation が遅く見える方を選ぶのが一般的な回避策です。

修正要求

docs/product/features/movement-projectile.md の該当行を、既存 SSOT に合わせて次のように変更してください。

  • background 復帰時または長時間停止後は maxFrameSkip により catch-up step 数を上限化する。
  • 上限を超える accumulated time は破棄し、simulation time は実行済み tick のみを authority とする。
  • accumulator < dt の通常残余のみ次フレームへ持ち越す。

これで Gaffer 型 accumulator の「通常 remainder は持ち越す」と、panic clamp の「過剰 backlog は捨てる」を分離できます。通常 remainder を持ち越す accumulator pattern 自体は妥当です。


Blocker 2: AimIntent の表現が既存仕様と新規仕様で割れている

既存 game-logic.md は InputCommand を AimIntent の angle: number として例示しています。
一方、現行コードの InputCommand は aim に x/y 座標を持っています。
PR の新規 spec は「aim は logical arena 座標で保持する」「角度ではなくターゲット座標を推奨するが #1 実装者が選択」としており、既存 SSOT と実装現状の不一致を解消せず、むしろ「実装者が選択」に逃がしています。

Issue #2 の目的は、#1 実装者が迷わず着手できる最小仕様を固定することです。
ここで「座標 or 角度」を open question に残すと、CombatSystem / ProjectileSystem / tests の contract が決まりません。

修正要求

今回の feature spec では、既存コードに合わせて以下を固定してください。

  • AimCommand / aim は logical arena 座標 { x, y } を保持する。
  • projectile 発射時に player.center -> aim の正規化ベクトルを CombatSystem または ProjectileFactory が計算する。
  • 角度 radians は派生値であり、GameState / InputCommand の source of truth にはしない。

あわせて docs/product/game-logic.md 側の AimIntent; angle 例示は後続 PR で修正対象として follow-up issue にしてください。ここを放置すると SSOT registry に追加された新規 spec と既存 SSOT が競合します。


Major 1: speed_px_per_sec が player と projectile で同名になっており、識別子固定として弱い

PR は固定定数識別子として speed_px_per_sec を挙げていますが、open_questions では player と projectile の両方に同じ識別子を使っています。
現行 GameState には player 側の speed: 210、weaponIntervalMs: 280、radius: 14 が存在します。

このままだと実装者が以下のように割れます。

PLAYER_SPEED_PX_PER_SEC
PROJECTILE_SPEED_PX_PER_SEC
speed_px_per_sec // どちら?
state.player.speed
projectile.speed

修正提案

固定識別子を分離してください。

  • player_speed_px_per_sec
  • projectile_speed_px_per_sec
  • projectile_lifetime_ms
  • fire_cooldown_ms
  • player_radius_px
  • arena_width_px
  • arena_height_px

現行 GameState 値への対応も、単なる「要確認」ではなく「initial implementation default」と「balance tuning subject」を分けるべきです。


Major 2: pointer capture を要求するなら cancel / release / touch-action まで書くべき

PR は pointer capture により canvas 外 drag 中も aim 継続と書いています。
Pointer Events 自体は mouse / pen / touch を統一する API で、pointer capture はポインタが要素外へ移動してもイベントを特定要素へ retarget できます。

ただし MDN は、ブラウザが pan/zoom と判断すると pointercancel が発火しうること、touch 関連挙動は touch-action で制御する必要があることも説明しています。
つまり pointer capture を使う だけでは、Android Chrome / touch 環境で hold-to-repeat の cancel 処理が未定義です。

修正提案

InputMapper の責務に以下を追加してください。

  • pointerdown: primary pointer のみ受け付け、setPointerCapture(pointerId) を試行する。
  • pointermove: capture 中の pointerId のみ aim 更新対象とする。
  • pointerup / pointercancel / lostpointercapture: primaryPressed=false とし、fire hold を終了する。
  • canvas interaction target は touch-action: none を設定対象とする。

MDN でも primary pointer の識別や button/buttons の扱いが説明されているため、multi-touch を非ゴールにするなら「primary pointer only」と明記した方が安定します。


Major 3: boundary clamp が既存 MovementSystem の実装ギャップを正しく表現していない

現行 MovementSystem は diagonal normalization は実装済みですが、境界クランプは未実装です。
PR の spec は boundary_clamp を要求している点はよいです。

ただし、テスト観点として「境界クランプ」とだけ書くと不十分です。Issue #1 の AC は Canvas 境界外へ出ないことを要求しています。
実装では少なくとも以下の edge case を固定すべきです。

  • 左上 / 右下 / 各辺への overshoot clamp
  • dt が通常値より大きい場合でも clamp 後に範囲内
  • player_radius > arena_width / 2 等の invalid arena は非対応または明示エラー
  • diagonal movement 後の clamp

ここは blocker ではありませんが、#1 のテスト品質に直結します。


Minor: acceptance_criteria に CI コマンドを入れるのは product spec と process proof が混ざっている

PR は spec 本文の AC8 に pnpm typecheck / lint / test / build PASS を入れています。
PR 本文にも verification commands があり、CI 6/6 pass とレビューコメントにも記録されています。

しかし、docs/product/features/movement-projectile.md は今後 #1 実装者が読む product feature spec です。そこに「この docs PR の検証コマンド」を恒久的 AC として入れると、仕様とレビュー証跡が混ざります。

修正提案

spec 側は次のように分離してください。

implementation_verification

#1 implementation PR MUST pass:

  • pnpm typecheck
  • pnpm lint
  • pnpm test
  • pnpm build

acceptance_criteria は仕様達成条件に限定する方がよいです。


コメント・既存レビューへの反論

PR 上では既に approve コメントが2件あり、AC 8/8 PASS、CI 6/6 pass、docs-only なので runtime verification not applicable とされています。
しかし、そのレビューは「Issue #2 の形式 AC を満たしているか」を見ており、既存 SSOT との意味的整合性、特に panic clamp の衝突を見落としています。

この PR は docs-only ですが、#1 実装の前提仕様です。docs-only であることは安全性を上げません。むしろ誤った contract が固定されると、後続実装でより高コストに効きます。


推奨修正後の merge 条件

最低限、以下を満たせば approve に寄せられます。

  1. panic clamp の記述を game-logic.md と整合させる。

  2. aim source of truth を { x, y } に固定し、「実装者が選択」を削除する。

  3. player / projectile の定数識別子を分離する。

  4. pointer capture の cancel / release / primary pointer / touch-action を追記する。

  5. game-logic.md の AimIntent angle 不整合を follow-up issue として明記する。

現状の verdict は REQUEST CHANGES です。

- panic clamp 記述を game-logic.md REQ-LOGIC-TIME-002 と整合させる
  (maxFrameSkip で catch-up step 上限化、超過分は破棄、normal residual のみ持ち越し)
- aim source of truth を {x, y} arena 座標に固定 (角度は派生値)
- pointer capture の pointercancel / lostpointercapture / touch-action / primary pointer を追記
- 固定定数識別子を player / projectile で分離
  (player_speed_px_per_sec / projectile_speed_px_per_sec / projectile_lifetime_ms
   / fire_cooldown_ms / player_radius_px / arena_width_px / arena_height_px)
- open_questions に initial implementation default と balance tuning subject を区別
- boundary clamp の edge case を related_tests に enumerate
- implementation_verification を acceptance_criteria から分離
- game-logic.md AimIntent.angle 例示の follow-up issue 化を spec 内で明記

Refs: #440 (comment)
Refs #2

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>

@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.

Verdict: APPROVE

(self-authored PR: --comment のみ使用)

Mergeability

  • mergeable=MERGEABLE, mergeStateStatus=CLEAN
  • 前 iteration で BLOCKED と報告されていた mergeStateStatus は branch protection による human review 要件によるものであり、CI とは独立している。現時点では CLEAN に変化しており merge blocker ではない。

Evidence Check

  • AC coverage: 全 AC1-AC7 達成 (根拠: diff 検証済み)
    • AC1: frontmatter doc_id / status / issue / parent_issue / trace_links 全フィールド確認済み
    • AC2: 必須セクション 7 種全て存在確認済み
    • AC3: 全 14 識別子 (coordinate_space: arena logical pixels, diagonal_normalization, boundary_clamp, PointerEvent, cooldown_authority, GameState.projectiles, monotonic counter, player_speed_px_per_sec, projectile_speed_px_per_sec, projectile_lifetime_ms, fire_cooldown_ms, player_radius_px, arena_width_px, arena_height_px) 確認済み
    • AC4: requestAnimationFrame / 60Hz / 120Hz / devicePixelRatio 言及確認済み。maxFrameSkip と REQ-LOGIC-TIME-002 の trace 確認済み
    • AC5: 4 テストファイル列挙済み。boundary clamp edge case (左上/右下/各辺 overshoot / dt 大 / diagonal 後 / invalid arena) が related_tests に enumerate 確認済み
    • AC6: collision / damage / enemy AI / visual effects 全て non_goals に存在確認済み
    • AC7: docs/dev/ssot-registry.md に movement-projectile エントリ確認済み
  • Allowed Paths: 完全遵守 — docs/product/features/movement-projectile.md / docs/dev/ssot-registry.md / docs/dev/workflow.md の 3 ファイルのみ変更、全て Allowed Paths 内
  • CI Verification: 6/6 PASS (Generate agent session manifest / build / lint / python-test / test / typecheck 全 pass)
  • 検証コマンド結果: PR 本文の Verification Commands テーブルで pnpm typecheck / pnpm lint / pnpm test (7 files, 75 tests) / pnpm build 全 PASS 記録済み

Anchor 修正確認 (REQUEST_CHANGES 6 項目)

項目 修正内容 確認結果
Blocker 1 (panic clamp) maxFrameSkip で catch-up 上限化、超過分破棄、normal residual のみ持ち越し、REQ-LOGIC-TIME-002 trace 解決: spec L33-37 に明記確認済み
Blocker 2 (aim source of truth) aim を {x, y} arena 座標で固定、角度は派生値、game-logic.md AimIntent.angle は follow-up 化 解決: spec L49-51 に明記、L50-51 で follow-up 化も明示確認済み
Major 1 (identifier 分離) player_speed_px_per_sec 等 7 識別子に分離、open_questions に initial implementation default / balance tuning subject 区別 解決: spec L115 テーブル確認済み
Major 2 (pointer capture cancel) pointercancel / lostpointercapture / touch-action: none / primary pointer 限定を InputMapper 責務に追記 解決: spec L57-61 に明記確認済み
Major 3 (boundary clamp edge cases) 左上/右下/各辺 overshoot / dt 大 / diagonal 後 / invalid arena を related_tests に enumerate 解決: spec L139 に enumerate 確認済み
Minor (AC/process 分離) implementation_verification を acceptance_criteria から分離 解決: spec L96 で implementation_verification セクション分離確認済み

Safety / Schema 判定

  • Safety-sensitive: 対象は docs/product/features/ (game feature spec) のみ。.claude/skills/** / docs/dev/runtime-verification-policy.md / transport / permission / sandbox 関連パスに変更なし。diff キーワード検査でも該当なし。Safety Claim Matrix 不要
  • Schema change: docs/dev/schema-governance.md の Initial Known Schemas に対する before/after 変更なし。変更は docs-only の feature spec 追加。schema_change_applicability: not_schema_change — Schema Consumer Inventory 不要
  • Runtime Verification Applicability: decision: not_applicable (docs-only 変更、runtime 挙動なし) — 証跡要求なし

Blockers

なし

Non-blockers

なし

LOOP_VERDICT

verdict: APPROVE
blockers: []
mergeable: MERGEABLE
mergeStateStatus: CLEAN
reviewed_head_sha: 06decab0b3d3c9b8cf776f768fc2e5a5161f1aa2
follow_up_issue_requests: []

@squne121
squne121 marked this pull request as ready for review May 28, 2026 09:48
@squne121
squne121 merged commit 2a6060c into main May 28, 2026
6 checks passed
@squne121
squne121 deleted the worktree-issue-2-movement-projectile-spec branch May 28, 2026 09:48
squne121 added a commit that referenced this pull request May 28, 2026
PR #440 で movement-projectile spec が AimIntent の source of truth を
{x, y} arena logical coordinates に固定したため、
docs/product/game-logic.md の AimIntent; angle 例示を追従修正する。

Co-authored-by: Claude Sonnet 4.6 <[email protected]>
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.

movement + projectile の最小仕様を固定する

1 participant