Repository navigation
feat(#488): add hitbox collision detection, damage, and defeat system - #515
Conversation
Implement projectile-enemy / player-enemy circle hitbox collision (dx*dx+dy*dy <= (r1+r2)**2) in CollisionSystem as a pure function returning CollisionPair[]. Add resolveCombatCollisions to CombatSystem for damage application, enemy defeat, and player contact damage with proper tick-ordering guarantees. Snapshot weaponPower into ProjectileState.damage at fire time. Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
squne121
left a comment
There was a problem hiding this comment.
Verdict: APPROVE
Mergeability
- mergeable=MERGEABLE, mergeStateStatus=CLEAN
Evidence Check
- AC coverage: Summary covers AC1–AC16 with implementation references. All 16 AC items traceable in diff.
- Allowed Paths: Changed files (
src/main.ts,src/state/GameState.ts,src/systems/CollisionSystem.ts,src/systems/CombatSystem.ts,tests/collision-system.test.ts,tests/combat-system.test.ts) are all within the contract's Allowed Paths. No scope混入. - CI Verification: CI run
26682011591— headSha925036753e2eeaf89ab7541cfea2c2c1f23d1b55matches PR headRefOid. Jobs: build=pass, e2e=pass, lint=pass, python-test=pass, test=pass, typecheck=pass. CI_CHECK_RUN_SCOPED conditions satisfied for AC14, AC16. - 検証コマンド結果:
pnpm typecheck/pnpm lint/pnpm test(241 tests, 14 files) /pnpm build— all PASS, confirmed by CI.
AC-by-AC diff verification
| AC | Result | Evidence |
|---|---|---|
AC1: readonly CollisionPair[] 返却・mutate なし |
PASS | runCollisionSystem 返り値型 readonly CollisionPair[]、hp/projectile/resource 変更なし |
| AC2: boundary clamp は MovementSystem 責務(pr_review_only) | PASS | clamp コード削除確認。clampPlayerToArena は main.ts でそのまま呼ばれる |
AC3: resolveCombatCollisions 追加、runCombatSystem signature 変更なし |
PASS | 既存 signature そのまま、新関数追加のみ |
AC4: ProjectileState.damage 追加・発射時 snapshot |
PASS | damage: state.progress.weaponPower at fire time |
AC5: dx*dx + dy*dy <= (r1+r2)**2 (sqrt 不使用) |
PASS | distSq <= sumR * sumR 実装を確認 |
| AC6: 1 projectile = 最近傍 enemy 1 体(同距離 id ASC) | PASS | closestDistSq / closestEnemyId ループ + enemy.id < closestEnemyId tie-break |
| AC7: numeric comparator、localeCompare / priorityKey 禁止 | PASS | a.enemyId - b.enemyId numeric sort、localeCompare/priorityKey 一切なし |
AC8: Math.max(0, hp - projectile.damage) |
PASS | enemy.hp = Math.max(0, enemy.hp - projectile.damage) |
AC9: defeated = true, defeatedAtTick = state.tick(tick increment 前) |
PASS | resolveCombatCollisions は state.tick += 1 より前に呼ばれる |
| AC10: hit projectile は除去 | PASS | state.projectiles = state.projectiles.filter(p => !hitProjectileIds.has(p.id)) |
| AC11: 同一 tick defeated enemy は player contact damage スキップ | PASS | projectileDefeatedEnemyIds Set で除外 |
| AC12: player-enemy contact damage は enemy id ASC 順・クランプ | PASS | .sort((a, b) => a.enemyId - b.enemyId) + Math.max(0, hp - totalDamage) |
| AC13: player hp は 0 未満にならない | PASS | state.player.hp = Math.max(0, state.player.hp - totalDamage) |
| AC14: 既存 combat-system.test.ts PASS | PASS | CI test job pass(headSha 一致) |
| AC15: tests/collision-system.test.ts 新規作成(476 lines, regression tests) | PASS | diff に新規ファイル確認、CI test job pass |
| AC16: pnpm typecheck / lint / test / build PASS | PASS | CI jobs pass(headSha 一致) |
Schema Change Applicability
- TypeScript interface 追加(
CollisionPair,ProjectileState.damage)は内部コード変更であり、Initial Known Schemas(YAML/JSON machine-readable contracts)に該当しない。schema_change_applicability: not_schema_change。Schema Consumer Inventory 不要。
Safety-Sensitive Assessment
- Changed paths にセキュリティ・パーミッション・MCP 関連パスなし。diff キーワードに safety-boundary 語なし。safety-sensitive 非該当。Safety Claim Matrix 不要。
Runtime Verification Applicability
decision: not_applicable— unit tests + typecheck/lint/build で検証完了。ブラウザ起動不要。証跡要求なし。
Blockers
なし
Non-blockers(任意改善)
- PR 本文に
## 受け入れ条件の達成状況セクション(チェックリスト形式)がない。Summary の AC 列挙は機能的に同等だが、テンプレート準拠度の観点で次 PR から統一推奨。(severity: note_only)
LOOP_VERDICT
verdict: APPROVE
blockers: []
mergeable: MERGEABLE
mergeStateStatus: CLEAN
reviewed_head_sha: 925036753e2eeaf89ab7541cfea2c2c1f23d1b55
recommendations: []
follow_up_issue_requests: []
結論: REQUEST_CHANGESPR #515 は既存レビューで APPROVE されていますが、その判定は危険です。PR 本文は BLOCKER 1: 衝突処理順が仕様と逆転しているIssue #488 / combat-core の契約は、 ところが実装は二重に危険です。
これは「決定的に動く」ように見えるだけで、契約上の canonical order ではありません。たとえば 修正要求
export function compareCollisionPair(a: CollisionPair, b: CollisionPair): number {
const ar = a.kind === 'projectile-enemy' ? 0 : 1;
const br = b.kind === 'projectile-enemy' ? 0 : 1;
if (ar !== br) return ar - br;
if (a.kind === 'projectile-enemy' && b.kind === 'projectile-enemy') {
if (a.projectileId !== b.projectileId) return a.projectileId - b.projectileId;
return a.enemyId - b.enemyId;
}
if (a.kind === 'player-enemy' && b.kind === 'player-enemy') {
return a.enemyId - b.enemyId;
}
return 0;
}
BLOCKER 2: 「ヒット済み projectile」が同 tick 内で生存し得るIssue #488 は、ヒット済み projectile を同 tick の 現在の resolver は、対象 enemy がすでに このため、同 tick で複数 projectile が同じ低 HP enemy に当たった場合、先に処理された projectile が enemy を倒し、後続 projectile は「衝突 pair には入っていたのに」削除されず残る可能性があります。これは非貫通 projectile の直感にも、AC10 の「hit 済み projectile 除去」にも反します。 修正要求
推奨方針: for (const pair of projectileEnemyPairs) {
const projectile = state.projectiles.find((p) => p.id === pair.projectileId);
const enemy = state.enemies.find((e) => e.id === pair.enemyId);
if (!projectile || !enemy) continue;
// この tick の衝突 pair に含まれた projectile は消費する
hitProjectileIds.add(pair.projectileId);
// ただし、すでに倒れている enemy には追加 damage しない
if (enemy.defeated) continue;
// damage / defeatedAtTick 処理
}この挙動を採用しないなら、「同 tick で別 projectile が倒した enemy に当たった projectile は生存する」という仕様を明文化し、テスト名もその意味に合わせる必要があります。現状の契約からは後者は不自然です。 BLOCKER 3: テスト名が契約を満たしているように見せているが、実際には order を検証していない
同様に player-enemy の「enemy id 2 first」系テストも 追加すべきテスト最低限、以下を追加してください。 // projectiles を逆順に置いても pair は projectileId ASC
projectiles: [projectile10, projectile2]
expect(projectileEnemyPairs.map((p) => p.projectileId)).toEqual([2, 10]);
// enemies を逆順に置いても player-enemy は enemyId ASC
enemies: [enemy10, enemy2]
expect(playerEnemyPairs.map((p) => p.enemyId)).toEqual([2, 10]);
// resolver も同じ comparator を使う
expect(compareCollisionPair(pairP2E10, pairP10E2)).toBeLessThan(0);
// 同 tick で同一 low-HP enemy に複数 projectile が当たる
// 仕様上、両方 projectile を消費するか、少なくとも期待挙動を明文化するMUST FIX: spec drift を放置しないcombat-core.md の古い この差分自体は #488 の最終契約に従うなら許容できます。ただし、combat-core.md をそのまま残すと、後続 PR や AI agent が 修正候補:
SHOULD: runtime 配布物としての確認が薄い
ただし、親 Issue #483 の M2 ゴールは「1 sortie を collision/damage/victory/defeat まで通す」ことであり、システムは DOM/Canvas 非依存、60Hz fixed timestep、typecheck/lint/test/build を満たす必要があります。([GitHub]10) #486/#487 が enemy spawn / AI を担当する前提なら、#515 単体で runtime の手触りまで保証しないのは理解できますが、配布物品質としては spawn/AI/勝敗判定を含む smoke test がまだ不足しています。 非ブロッカー: contact damage は仕様通りだが、ゲームバランス上は危険combat-core は contactDamage を「collision tick ごと」に与えると定義しており、60Hz なら これは仕様上は正しいです。ただし、M2 で playable な sortie を目指すなら、初期 マージ条件この PR はそのままではマージ不可です。最低条件は以下です。
既存の APPROVE コメントは、テスト名と assertion の乖離を見落としているため、信頼しない方がよいです。 |
…on on defeated enemy BLOCKER1: add compareCollisionPair util (projectileId ASC -> enemyId ASC) and apply it in both runCollisionSystem return value and resolveCombatCollisions sort. BLOCKER2: consume projectile unconditionally before checking enemy.defeated, so same-tick collision pair projectiles are never left alive. BLOCKER3: replace toContain order checks with toEqual([2, 10]) in tests; add reverse-fixture tests and defeated-enemy projectile consumption tests. Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
squne121
left a comment
There was a problem hiding this comment.
Verdict: APPROVE
Mergeability
- mergeable=MERGEABLE, mergeStateStatus=CLEAN
Evidence Check
- AC coverage: All AC1–AC16 addressed in diff and PR body
- Allowed Paths: 全変更ファイルが Allowed Paths 内 (
src/systems/CollisionSystem.ts,src/systems/CombatSystem.ts,src/state/GameState.ts,src/main.ts,tests/collision-system.test.ts,tests/combat-system.test.ts) — 逸脱なし - CI Verification: CI run 26685556234、head_sha=88b3c15e5e8a7fd44089592b5342d5ca7f60aa95(PR head と一致)、全ジョブ conclusion=success(typecheck/lint/test/build/e2e/python-test)
- 検証コマンド結果: PR 本文
## Verification Resultsに pnpm typecheck/lint/test/build PASS を記録。CI_CHECK_RUN_SCOPED の条件(head_sha 一致・conclusion=success・workflow/job が対象 VC に対応)を満たす。
Fix Verification (前回 REQUEST_CHANGES 対応確認)
-
compareCollisionPairshared util —CollisionSystem.tsに追加済み。projectile-enemyrank=0、player-enemyrank=1。projectile-enemy同士はprojectileId ASC→enemyId ASCで比較。CORRECT -
runCollisionSystem返却値のソート —return [...pairs].sort(compareCollisionPair)追加済み。CORRECT -
hitProjectileIds.addがenemy.defeatedチェックより前 —resolveCombatCollisions内でhitProjectileIds.add(pair.projectileId)を実行してからif (!enemy || enemy.defeated || !projectile) continueで skip。CORRECT -
逆順 fixture テスト
toEqual([2, 10])—tests/collision-system.test.tsにprojectiles = [id=10, id=2]の逆順 fixture でexpect(projectileIds).toEqual([2, 10])を検証するテストを追加済み(BLOCKER3 ラベル付き)。CORRECT -
defeated enemy に当たった projectile も消費 —
resolveCombatCollisionsでhitProjectileIds.addを defeated check より前に実行し、state.projectiles.filterで消費。テストも 2 件追加(BLOCKER2 ラベル付き)。CORRECT
Schema Change Applicability
not_schema_change — GameState.ts への CollisionPair 型と ProjectileState.damage フィールドの追加は TypeScript 内部実装型であり、docs/dev/schema-governance.md の Initial Known Schemas(YAML machine-readable contract)の境界を越えない。Schema Consumer Inventory 提出不要。
Safety Claim Gate
変更パスに safety-sensitive パターン(transport/permission/sandbox/auth/mcp/tool/.claude/skills/.github/workflows)を含まない。Safety Claim Matrix 検査不要。
Blockers
なし
Non-blockers
なし
LOOP_VERDICT
verdict: APPROVE
blockers: []
mergeable: MERGEABLE
mergeStateStatus: CLEAN
reviewed_head_sha: 88b3c15e5e8a7fd44089592b5342d5ca7f60aa95
recommendations: []
follow_up_issue_requests: []
結論
確認範囲は PR #515、Issue #488、親 Issue #483、関連する #486/#487、PR本文・差分・コメント、 良い点 / 前回懸念の改善確認以前ブロッカー候補だった 順序決定の弱さ は、現在の差分ではかなり改善されています。 テストも また、同 tick 内で 2 発の projectile が同一 enemy に衝突し、1 発目で defeat された場合でも、2 発目を「命中済み」として消費する挙動はテストされています。実装も BLOCKER:
|
…k/playerId/priorityKey) Add tick, playerId (EntityId), and priorityKey to both CollisionPair variants to close COLLISION_PAIR_SSOT_DRIFT. distSq remains optional. priorityKey is dedupe-only; compareCollisionPair sort order is unchanged (AC7 preserved). Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
squne121
left a comment
There was a problem hiding this comment.
Verdict: APPROVE
Mergeability
- mergeable=MERGEABLE, mergeStateStatus=UNSTABLE (e2e and python-test jobs still in_progress; UNSTABLE is not a blocker per skill policy)
Evidence Check
AC coverage (Issue #488):
- AC1: CollisionSystem returns
readonly CollisionPair[], zero state mutations verified in diff and test — PASS - AC2: boundary clamp removed from CollisionSystem (old
clamp/telemetry code deleted) — PASS - AC3:
resolveCombatCollisionsadded;runCombatSystemsignature unchanged — PASS - AC4:
ProjectileState.damageadded; snapshot at fire time (damage: state.progress.weaponPower) — PASS - AC5:
dx*dx + dy*dy <= (r1+r2)**2, no sqrt — PASS - AC6: closest-enemy loop with id-ASC tie-break — PASS
- AC7:
compareCollisionPairuses numeric comparator only;priorityKeyis NOT referenced in sort — PASS (confirmed in diff: sort usesar - br,projectileId - projectileId,enemyId - enemyId) - AC8:
enemy.hp = Math.max(0, hp - projectile.damage)— PASS - AC9:
defeated = true,defeatedAtTick = state.tickon hp===0 — PASS - AC10:
state.projectiles = state.projectiles.filter(p => !hitProjectileIds.has(p.id))— PASS - AC11:
projectileDefeatedEnemyIdsset used to skip player-enemy pairs for same-tick kills — PASS - AC12: player-enemy pairs sorted by enemyId ASC, contactDamage accumulated — PASS
- AC13:
state.player.hp = Math.max(0, player.hp - totalDamage)— PASS - AC14: CI
testjob conclusion=success on head SHA 46d7ccc — PASS - AC15:
tests/collision-system.test.tscontains all required regression tests (projectileId ordering, enemyId ordering, projectile-enemy before player-enemy, same-tick kill blocks contact damage, no state mutation by CollisionSystem) — PASS - AC16: lint/test/typecheck/build all
conclusion=successon head SHA 46d7ccc — PASS
Allowed Paths: All changed files (src/main.ts, src/state/GameState.ts, src/systems/CollisionSystem.ts, src/systems/CombatSystem.ts, tests/collision-system.test.ts, tests/combat-system.test.ts) are within the issue's Allowed Paths. No out-of-scope changes detected.
CI Verification (CI_CHECK_RUN_SCOPED, run 26686382625, headSha=46d7ccc7ce269bdf624de950f753288ed769c485):
- lint: success
- test: success (pnpm test job, step 7)
- typecheck: success
- build: success
- e2e: in_progress (not yet concluded — UNSTABLE, not a blocker)
- python-test: in_progress (not yet concluded — UNSTABLE, not a blocker)
Schema Change Applicability: not_schema_change for schema-governance.md purposes. CollisionPair and ProjectileState.damage are game-domain TypeScript types; none appear in the Initial Known Schemas registry (docs/dev/schema-governance.md). No AI/workflow schema consumers are affected. Schema Consumer Inventory not required.
Safety Claim Gate: Not applicable. Changed paths (src/systems/, src/state/, src/main.ts, tests/) do not match safety-sensitive patterns. No safety/permission/sandbox keywords in diff.
Runtime Verification: decision: not_applicable (confirmed in both issue #488 and PR body). No browser/runtime evidence required.
Blockers
なし
Non-blockers(任意改善)
-
combat-core.mdpriorityKey format divergence: Spec example usesprojectile-enemy-${id}-${id}(dashes), implementation usesprojectile-enemy:${id}:${id}(colons). SincepriorityKeyis for deduplication only and not used in sort (AC7 satisfied), this is not a contract violation. Consider aligning format in a follow-up cleanup if the spec example is ever promoted to normative. -
Partial CollisionPair objects in
combat-system.test.ts: Tests at theresolveCombatCollisionsdescribe block pass objects withouttickandpriorityKeyfields (e.g.,{ kind: 'projectile-enemy', projectileId: 1, enemyId: 1, distSq: 0 }). TypeScript typecheck passed at CI time, which is authoritative. However, iftickandpriorityKeyare required fields in the discriminated union, this is technically a type gap worth investigating (possiblystrict: falsein tsconfig or structural subtyping behavior). No functional regression risk sinceresolveCombatCollisionsdoes not usetickorpriorityKeyinternally.
LOOP_VERDICT
verdict: APPROVE
blockers: []
mergeable: MERGEABLE
mergeStateStatus: UNSTABLE
reviewed_head_sha: 46d7ccc7ce269bdf624de950f753288ed769c485
recommendations: []
follow_up_issue_requests:
- title: "chore(#488 follow-up): align priorityKey format in CollisionPair with combat-core.md spec example"
issue_kind: implementation
severity: optional_follow_up
source:
kind: pr_review
url: "https://github.com/squne121/loop-protocol/pull/515"
note_id: "1"
dedupe_key: "follow-up:squne121/loop-protocol:https://github.com/squne121/loop-protocol/pull/515:1"
desired_destination: "CollisionPair.priorityKey format matches combat-core.md spec example (dashes vs colons) or spec is updated to mark the format as non-normative"
validated_scope_delta: "Update priorityKey template literal in CollisionSystem.ts (or update combat-core.md spec example comment) — 1-line change"
origin_skill: pr-review-judge
labels:
- triage-required
- title: "chore(#488 follow-up): investigate CollisionPair required fields accepted by TypeScript without tick/priorityKey in test"
issue_kind: research
severity: optional_follow_up
source:
kind: pr_review
url: "https://github.com/squne121/loop-protocol/pull/515"
note_id: "2"
dedupe_key: "follow-up:squne121/loop-protocol:https://github.com/squne121/loop-protocol/pull/515:2"
desired_destination: "Either tsconfig strict mode confirmed, or test objects updated to include required tick/priorityKey fields for full type safety"
validated_scope_delta: "Investigate tsconfig settings; add tick and priorityKey to partial CollisionPair objects in combat-system.test.ts resolveCombatCollisions tests"
origin_skill: pr-review-judge
labels:
- triage-required
squne121
left a comment
There was a problem hiding this comment.
Verdict: APPROVE
Mergeability
- mergeable=MERGEABLE, mergeStateStatus=UNSTABLE (e2e and python-test jobs still in_progress; UNSTABLE is not a blocker per skill policy)
Evidence Check
AC coverage (Issue #488):
- AC1: CollisionSystem returns
readonly CollisionPair[], zero state mutations verified in diff and test — PASS - AC2: boundary clamp removed from CollisionSystem (old
clamp/telemetry code deleted) — PASS - AC3:
resolveCombatCollisionsadded;runCombatSystemsignature unchanged — PASS - AC4:
ProjectileState.damageadded; snapshot at fire time (damage: state.progress.weaponPower) — PASS - AC5:
dx*dx + dy*dy <= (r1+r2)**2, no sqrt — PASS - AC6: closest-enemy loop with id-ASC tie-break — PASS
- AC7:
compareCollisionPairuses numeric comparator only;priorityKeyis NOT referenced in sort — PASS (confirmed in diff: sort usesar - br,projectileId - projectileId,enemyId - enemyId) - AC8:
enemy.hp = Math.max(0, hp - projectile.damage)— PASS - AC9:
defeated = true,defeatedAtTick = state.tickon hp===0 — PASS - AC10:
state.projectiles = state.projectiles.filter(p => !hitProjectileIds.has(p.id))— PASS - AC11:
projectileDefeatedEnemyIdsset used to skip player-enemy pairs for same-tick kills — PASS - AC12: player-enemy pairs sorted by enemyId ASC, contactDamage accumulated — PASS
- AC13:
state.player.hp = Math.max(0, player.hp - totalDamage)— PASS - AC14: CI
testjob conclusion=success on head SHA 46d7ccc — PASS - AC15:
tests/collision-system.test.tscontains all required regression tests (projectileId ordering, enemyId ordering, projectile-enemy before player-enemy, same-tick kill blocks contact damage, no state mutation by CollisionSystem) — PASS - AC16: lint/test/typecheck/build all
conclusion=successon head SHA 46d7ccc — PASS
Allowed Paths: All changed files (src/main.ts, src/state/GameState.ts, src/systems/CollisionSystem.ts, src/systems/CombatSystem.ts, tests/collision-system.test.ts, tests/combat-system.test.ts) are within the issue's Allowed Paths. No out-of-scope changes detected.
CI Verification (CI_CHECK_RUN_SCOPED, run 26686382625, headSha=46d7ccc7ce269bdf624de950f753288ed769c485):
- lint: success
- test: success (pnpm test job, step 7)
- typecheck: success
- build: success
- e2e: in_progress (not yet concluded — UNSTABLE, not a blocker)
- python-test: in_progress (not yet concluded — UNSTABLE, not a blocker)
Schema Change Applicability: not_schema_change for schema-governance.md purposes. CollisionPair and ProjectileState.damage are game-domain TypeScript types; none appear in the Initial Known Schemas registry (docs/dev/schema-governance.md). No AI/workflow schema consumers are affected. Schema Consumer Inventory not required.
Safety Claim Gate: Not applicable. Changed paths (src/systems/, src/state/, src/main.ts, tests/) do not match safety-sensitive patterns. No safety/permission/sandbox keywords in diff.
Runtime Verification: decision: not_applicable (confirmed in both issue #488 and PR body). No browser/runtime evidence required.
Blockers
なし
Non-blockers(任意改善)
-
combat-core.mdpriorityKey format divergence: Spec example usesprojectile-enemy-${id}-${id}(dashes), implementation usesprojectile-enemy:${id}:${id}(colons). SincepriorityKeyis for deduplication only and not used in sort (AC7 satisfied), this is not a contract violation. Consider aligning format in a follow-up cleanup if the spec example is ever promoted to normative. -
Partial CollisionPair objects in
combat-system.test.ts: Tests at theresolveCombatCollisionsdescribe block pass objects withouttickandpriorityKeyfields (e.g.,{ kind: 'projectile-enemy', projectileId: 1, enemyId: 1, distSq: 0 }). TypeScript typecheck passed at CI time, which is authoritative. However, iftickandpriorityKeyare required fields in the discriminated union, this is technically a type gap worth investigating (possiblystrict: falsein tsconfig or structural subtyping behavior). No functional regression risk sinceresolveCombatCollisionsdoes not usetickorpriorityKeyinternally.
LOOP_VERDICT
verdict: APPROVE
blockers: []
mergeable: MERGEABLE
mergeStateStatus: UNSTABLE
reviewed_head_sha: 46d7ccc7ce269bdf624de950f753288ed769c485
recommendations: []
follow_up_issue_requests:
- title: "chore(#488 follow-up): align priorityKey format in CollisionPair with combat-core.md spec example"
issue_kind: implementation
severity: optional_follow_up
source:
kind: pr_review
url: "https://github.com/squne121/loop-protocol/pull/515"
note_id: "1"
dedupe_key: "follow-up:squne121/loop-protocol:https://github.com/squne121/loop-protocol/pull/515:1"
desired_destination: "CollisionPair.priorityKey format matches combat-core.md spec example (dashes vs colons) or spec is updated to mark the format as non-normative"
validated_scope_delta: "Update priorityKey template literal in CollisionSystem.ts (or update combat-core.md spec example comment) — 1-line change"
origin_skill: pr-review-judge
labels:
- triage-required
- title: "chore(#488 follow-up): investigate CollisionPair required fields accepted by TypeScript without tick/priorityKey in test"
issue_kind: research
severity: optional_follow_up
source:
kind: pr_review
url: "https://github.com/squne121/loop-protocol/pull/515"
note_id: "2"
dedupe_key: "follow-up:squne121/loop-protocol:https://github.com/squne121/loop-protocol/pull/515:2"
desired_destination: "Either tsconfig strict mode confirmed, or test objects updated to include required tick/priorityKey fields for full type safety"
validated_scope_delta: "Investigate tsconfig settings; add tick and priorityKey to partial CollisionPair objects in combat-system.test.ts resolveCombatCollisions tests"
origin_skill: pr-review-judge
labels:
- triage-required
Summary
CollisionSystemを pure 判定関数に変更しreadonly CollisionPair[]を返す(AC1, AC2, AC5, AC6, AC7)CombatSystemにresolveCombatCollisions(state, pairs)を追加して damage / defeat / player contact damage を解決(AC3, AC8–AC13)ProjectileState.damageフィールドを追加し、発射時にstate.progress.weaponPowerをスナップショット(AC4)src/main.tsのstepSimulationでパイプライン接続(runCollisionSystem→resolveCombatCollisions)tests/collision-system.test.ts新規作成(AC15 regression tests を含む)tests/combat-system.test.tsに damage/defeat テストを追加(AC14: 既存テスト全件 PASS)Closes
Closes #488
Contract Snapshot
#488 (comment)
Verification Results
pnpm typecheckpnpm lintpnpm testpnpm buildAllowed Paths Compliance
src/state/GameState.ts—CollisionPair型とProjectileState.damage追加src/systems/CollisionSystem.ts— pure 判定関数に変更src/systems/CombatSystem.ts—resolveCombatCollisions追加、damageスナップショット追加src/main.ts— パイプライン wiringtests/collision-system.test.ts— 新規作成tests/combat-system.test.ts— テスト追加Allowed Paths 外の変更なし。
Runtime Verification Applicability
decision: not_applicable— unit テストと型チェック・lint・build で検証完了。ブラウザ起動不要。🤖 Generated with Claude Code