Repository navigation
Description
Machine-Readable Contract
contract_schema_version: "1"
issue_kind: implementation
change_kind: docs
scope: single_file_narrow_edit
parent_issue: none
dedupe_key: "follow-up:squne121/loop-protocol:pr/440:aim-intent-angle-inconsistency"
diff_rationale: "PR #440 で movement-projectile spec が AimIntent の source of truth を {x, y} arena coordinate に固定したため、既存 docs/product/game-logic.md の AimIntent; angle 例示を追従修正する"
changed_requirement_id: "movement-projectile:aim-source-of-truth"
affected_sections:
- "docs/product/game-logic.md#入力-input"Parent Issue
none
Parent Goal Ref
- Goal:
docs/product/game-logic.mdのAimIntent例示をmovement-projectile.mdの source of truth に整合させる - Desired Destination:
game-logic.mdのInputCommand例示が feature spec・実コードと一致した状態
Current Validated Scope
docs/product/game-logic.mdの## 入力 / Inputセクション内AimIntentbranch のみ
Remaining Parent Gaps
なし
In Scope
docs/product/game-logic.mdのAimIntentbranch を| { type: 'AimIntent'; x: number; y: number; } // arena logical coordinatesに修正
Out of Scope
docs/product/features/movement-projectile.mdの変更src/配下のコード変更InputCommandの他 branch の変更pnpm test回帰確認(issue-447 worktree 混入問題のため別 Issue で追跡)
Required Skills
なし
Outcome
docs/product/game-logic.md の ## 入力 / Input にある InputCommand 例示の AimIntent branch が、角度ではなく arena logical coordinate を保持する形に修正される。
Expected branch:
| { type: 'AimIntent'; x: number; y: number; } // arena logical coordinatesangle: および // radians は AimIntent branch から除去する。修正後は docs/product/features/movement-projectile.md で確定した「aim の source of truth は logical arena 座標 { x, y } で固定、角度は派生値」という方針と整合する。
Product Spec Context
- spec delta source: PR docs(#2): movement + projectile 最小仕様を feature spec として固定する #440(
docs/product/features/movement-projectile.mdで aim の source of truth を{x, y}arena coordinates に固定) - related issue: movement + projectile の最小仕様を固定する #2(movement + projectile feature)
- anchor comment: docs(game-logic): AimIntent 例示を {x, y} arena 座標表現に修正する #443 (comment)
- この Issue 自体が spec delta の実装追従(docs 整合修正)であり、新規仕様追加ではない
Background
PR #440(Issue #2 の movement + projectile feature spec)で、docs/product/features/movement-projectile.md の aim・fire セクションにて以下が確定した。
aim の source of truth は logical arena 座標
{ x, y }で固定 する。角度(radians)は GameState / InputCommand には保持せず、CombatSystem / ProjectileFactory が発射時にplayer.center → aimの正規化ベクトルとして派生計算する
一方、docs/product/game-logic.md の InputCommand 例示には以下の記述が残っていた。
| { type: 'AimIntent'; angle: number; } // radiansこの angle: number 例示は上記方針と矛盾する。movement-projectile.md でも「follow-up issue で修正対象とする」と明記されていた。実コード(src/input/InputMapper.ts)は既に { type: 'aim'; x: number; y: number } を使用しており、docs との SSOT 競合を解消する。
Allowed Paths
docs/product/game-logic.md- 編集対象は
## 入力 / Inputセクション内のInputCommandTypeScript code block にあるAimIntentbranch のみ - それ以外の prose / requirements / time model / collision / persistence セクションは変更禁止
- 編集対象は
Acceptance Criteria
- AC1:
docs/product/game-logic.mdのAimIntentbranch が| { type: 'AimIntent'; x: number; y: number; } // arena logical coordinates形式になっていること - AC2:
AimIntentbranch にangle:フィールドが存在しないこと - AC3:
AimIntentbranch に// radiansコメントが存在しないこと - AC4:
AimIntentbranch に arena logical coordinates であることを示すコメントが存在すること - AC5:
docs/product/features/movement-projectile.mdの aim source of truth 記述(source of truth は logical arena 座標 { x, y } で固定かつGameState / InputCommand には保持せず)と整合していること
Verification Commands
# AC1
$ uv run python3 -c "from pathlib import Path; import re, sys; s=Path('docs/product/game-logic.md').read_text(); sys.exit(0 if re.search(r\"type: 'AimIntent';\\s*x:\\s*number;\\s*y:\\s*number\", s) else 1)"
# AC2
$ uv run python3 -c "from pathlib import Path; import re, sys; s=Path('docs/product/game-logic.md').read_text(); sys.exit(1 if re.search(r\"AimIntent[^\\n]*angle\", s) else 0)"
# AC3
$ uv run python3 -c "from pathlib import Path; s=Path('docs/product/game-logic.md').read_text(); lines=[l for l in s.splitlines() if 'AimIntent' in l]; raise SystemExit(1 if any('radians' in l for l in lines) else 0)"
# AC4
$ uv run python3 -c "from pathlib import Path; s=Path('docs/product/game-logic.md').read_text(); lines=[l for l in s.splitlines() if 'AimIntent' in l]; raise SystemExit(0 if any('arena' in l or 'logical' in l for l in lines) else 1)"
# AC5
# preflight-scope: pr_review_only
$ uv run python3 -c "from pathlib import Path; s=Path('docs/product/features/movement-projectile.md').read_text(); raise SystemExit(0 if 'source of truth は logical arena 座標' in s and 'GameState / InputCommand には保持せず' in s else 1)"
$ pnpm typecheck
$ pnpm lint
$ pnpm buildRuntime Verification Applicability
decision: not_applicable
reason: docs-only single-file edit。実行環境前提・動作検証 AC なし。
Stop Conditions
実装中にこれらの状況が発生したら直ちに作業を停止し、Issue comment に状況を記録して人間の判断を待つ。
- Allowed Paths 外の変更が必要と判明した場合
- In Scope の固定契約(キー集合・スキーマ・型定義)の変更が必要になった場合
- 新規 Issue の起票が必要と判断した場合(スコープ分割が発生する場合)
- 後続 Phase / 別スコープへの波及が判明した場合
- nested SubAgent delegation が必要になった場合
- 外部サービス利用・権限昇格・既存テスト大規模改変が必要になった場合
docs/product/game-logic.md以外のファイルへの変更が必要と判明した場合(Issue 固有)AimIntentbranch 以外のInputCommand定義に影響が出ると判明した場合(Issue 固有)
References
- PR docs(#2): movement + projectile 最小仕様を feature spec として固定する #440: docs(#2): movement + projectile 最小仕様を feature spec として固定する #440
- anchor comment: docs(game-logic): AimIntent 例示を {x, y} arena 座標表現に修正する #443 (comment)
- 修正元:
docs/product/features/movement-projectile.md(aim source of truth 確定箇所) - 修正対象:
docs/product/game-logic.md(## 入力 / InputのAimIntentbranch)
Activity
squne121 commentedon May 28, 2026
Verdict: REQUEST_CHANGES
Issue #443 の方向性は正しいです。
movement-projectile.mdは aim の source of truth を{ x, y }arena 座標に固定し、角度はGameState / InputCommandに保持しない、と明記しています。一方でgame-logic.mdのInputCommand例示はまだAimIntent.angleのままです。これは実装 Issue #1 の「pointer down 中に照準方向へ Projectile を発射する」要求と、PR #440 で固定された座標系 spec の間に残った明確な SSOT 競合です。([GitHub]1) ([GitHub]2) ([GitHub]3)ただし、Issue contract と Verification Commands が弱いので、このまま実装に渡すと「見た目だけ直した PR」を通しやすいです。
Blockers
1. VC が pass/fail を機械判定していない
#443 の VC は
rg 'AimIntent' docs/product/game-logic.mdとrg 'source of truth' ...で、どちらも結果を表示するだけです。angleが残っていても exit code は成功し得ます。AC2 は「AimIntent.*angleが残っていないこと」なので、negative assertion が必要です。([GitHub]4)置き換え案:
python -c "from pathlib import Path; import re; s=Path('docs/product/game-logic.md').read_text(); raise SystemExit(1 if re.search(r'\{\s*type:\s*[\"'\"']AimIntent[\"'\"'][^}]*angle\s*:', s, re.S) else 0)"AC1 用:
python -c "from pathlib import Path; s=Path('docs/product/game-logic.md').read_text(); raise SystemExit(0 if \"{ type: 'AimIntent'; x: number; y: number; }\" in s else 1)"AC3 用:
python -c "from pathlib import Path; s=Path('docs/product/features/movement-projectile.md').read_text(); raise SystemExit(0 if 'source of truth は logical arena 座標 `{ x, y }` で固定' in s and 'GameState / InputCommand には保持せず' in s else 1)"2. 期待する型例示が曖昧
Issue は「
{ x: number; y: number }arena 座標形式」と書いていますが、実装者が以下のどれを選んでも表面上は AC1 を満たしたと言い張れます。src/input/InputMapper.tsの現行InputCommandは{ type: 'aim'; x: number; y: number }で、GameStateもaimX/aimYを持っています。つまり coordinate source of truth はコード側にも既に存在しています。([GitHub]5) ([GitHub]6)#443 では、少なくとも docs の例示として次を固定した方がよいです。
3. Allowed Paths が「71 行目付近」に依存していて脆い
#443 は
docs/product/game-logic.mdの「71 行目付近のAimIntent型例示の編集のみ」としています。これは line-based すぎます。ファイルが数行動くだけで contract が不明確になります。([GitHub]4)推奨は、行番号ではなく構造で縛ることです。
4. AC2 の negative pattern が狭い
AimIntent.*angleだけだと、改行をまたぐ例示やコメント上の// radiansを取りこぼします。現状のgame-logic.mdでは同一 branch にangle: numberと// radiansが存在するので、少なくとも branch 単位で禁止すべきです。([GitHub]2)追加 AC:
Major non-blockers
1. #443 の lineage metadata が弱い
Issue body は PR #440 / Issue #2 を参照していますが、Metadata は
parent_issue: noneです。#443 は PR #440 のレビューで明示された follow-up なので、機械処理上もparent_issue: "#2"またはtrace_links: ["#2", "#440", "#1"]を持たせた方がよいです。PR #440 のレビューでは、game-logic.mdのAimIntent.angle例示を follow-up issue にするよう明示され、その後の修正 commit でも follow-up issue 化が記録されています。([GitHub]7) ([GitHub]7)2. discriminator 名のズレは別 Issue 化候補
game-logic.mdはMoveIntent/AimIntent/FireIntentという semantic docs 名を使っていますが、現行コードはmove/aim/fireです。#443 でここまで直すとスコープ過多です。ただし、後続で「docs の semantic command 名と実コード command discriminator の対応表」を作る価値はあります。([GitHub]2) ([GitHub]5)Web 調査からの品質観点
座標 source of truth を
{x, y}にする判断は妥当です。Pointer Events は mouse / pen / touch を統一する入力モデルで、pointer は画面座標を target できる抽象です。MDN もPointerEventがMouseEventを継承し、client coordinates を持つと説明しています。([MDNウェブドキュメント]8)Canvas 内の logical 座標へ変換するには、
clientX / clientYとgetBoundingClientRect()の組み合わせが妥当です。MDN はgetBoundingClientRect()が viewport 相対の位置・サイズを返すと説明しており、これはmovement-projectile.mdのclientX/clientY → canvas logical coordinate方針と整合します。([MDNウェブドキュメント]9) ([GitHub]1)また、PR #440 で追加された pointer capture /
pointercancel/touch-actionの補強は維持すべきです。MDN は pointer capture が pointer events を特定 element に retarget できるとし、pointercancelは pan/zoom/scroll 等で発火し得ると説明しています。W3C Pointer Events も single-pointer interaction では non-primary pointer を無視できると説明しています。([MDNウェブドキュメント]8) ([MDNウェブドキュメント]10) ([W3C]11)推奨 Issue 修正版の要点
angle:および// radiansはAimIntentbranch から除去する。squne121 commentedon May 28, 2026
Contract Review: BLOCKED (2026-05-28T16:24:30Z)
```yaml
CONTRACT_REVIEW_RESULT_V1:
status: blocked
generated_at: "2026-05-28T16:24:30Z"
generated_by: issue-contract-review
issue_url: #443
checks:
template_compliance: pass
state_label: ok
allowed_paths_present: pass
vc_present: pass
stop_conditions_complete: pass
vc_preflight:
passed: false
vc_failed_as_expected: 0
vc_passed_unexpectedly: 1
vc_unrunnable: 0
vc_expected_pass: 3
vc_skipped: 0
classifications:
- ac: AC1
command: "python3 -c '...AimIntent x: number; y: number...'"
exit_code: 1
category: unknown
scope_class: baseline_fail_expected
decision: human_judgment
fix_hint: "Unable to automatically classify exit code"
- ac: AC2a
command: "python3 -c '...re.search...angle...' "
exit_code: 1
category: unknown
scope_class: baseline_fail_expected
decision: human_judgment
fix_hint: "Unable to automatically classify exit code"
- ac: AC2b
command: "python3 -c '...radians...'"
exit_code: 1
category: unknown
scope_class: baseline_fail_expected
decision: human_judgment
fix_hint: "Unable to automatically classify exit code"
- ac: AC3
command: "python3 -c '...source of truth は logical arena 座標...'"
exit_code: 0
category: unexpected_pass
scope_class: baseline_fail_expected
decision: blocked
fix_hint: "Command unexpectedly passed at baseline"
- ac: pnpm_typecheck
exit_code: 0
category: regression_gate
decision: go
- ac: pnpm_lint
exit_code: 0
category: regression_gate
decision: go
- ac: pnpm_test
exit_code: 1
category: regression_gate
decision: blocked
fix_hint: "Regression gate command failed (worktree contamination suspected)"
- ac: pnpm_build
exit_code: 0
category: regression_gate
decision: go
ac_verifiability: pass
product_spec_check:
applicability: applicable
decision: fail
triggers:
docs_product_allowed_paths: true
blocked_reasons:
- rule_id: PS001
source: allowed_paths
excerpt: "docs/product/** 更新ありかつ spec delta Issue リンク / Product Spec Context 欠落"
- rule_id: PS004
source: issue_body
excerpt: "diff_rationale / changed_requirement_id / affected_sections 欠落"
worktree_branch_collision: clear
next_action: propose_refinement_loop
blocked_reasons:
- "VC preflight: AC3 が baseline で unexpected_pass(movement-projectile.md は既に正しい状態)"
- "VC preflight: pnpm test が regression gate で失敗(issue-447 worktree のテストが混入している可能性)"
- "Product Spec Check PS001: docs/product/** 更新に spec delta Issue リンクまたは Product Spec Context が欠落"
- "Product Spec Check PS004: diff_rationale / changed_requirement_id / affected_sections が欠落"
```
不足項目
1. VC: AC3 が baseline で
unexpected_pass問題: AC3 は「修正対象でないファイル(movement-projectile.md)の内容確認」であり、baseline で pass するのは仕様上正しい。しかし preflight は
scope_class: baseline_fail_expectedとして扱い、unexpected_pass/blockedと判定する。修正案: AC3 の VC に
# preflight-scope: pr_review_onlymarker を追加してスキップ対象にするか、scope_class: regression_gateとして扱われるよう preflight-scope を明示する。2. VC: pnpm test が regression gate で失敗
.claude/worktrees/issue-447-e2e-browser-playtest-foundation-movement/のテストが混入している可能性あり(issue-447 worktree のファイルが main worktree の vitest pattern にマッチ)。Issue #443 とは無関係な既存の失敗。修正案: issue-447 worktree を確認するか、
pnpm testをpnpm test --exclude '**/.claude/worktrees/**'に変更する。またはpnpm testに# preflight-scope: regression_gateを明示してスキップしない。3. Product Spec Check PS001
docs/product/game-logic.mdへの変更はdocs/product/**更新に該当するため、spec delta Issue リンクが必要。修正案: Issue 本文に以下のいずれかを追加:
## Product Spec Contextセクションで spec delta の根拠を明示(PR docs(#2): movement + projectile 最小仕様を feature spec として固定する #440 が spec 確定の根拠)issue_kindをspec_updateに変更4. Product Spec Check PS004
diff_rationale/changed_requirement_id/affected_sectionsが欠落。修正案: Machine-Readable Contract または Background に以下を追加:
推奨アクション
issue-refinement-loopの起動を推奨します。上記4項目を修正後にissue-contract-reviewを再実行してください。squne121 commentedon May 28, 2026
#443 は実装に進めず、先に issue-refinement-loop で contract を修正してください。
修正方針:
Product Spec Check の PS001 / PS004 を解消すること
## Product Spec Contextを追加diff_rationale,changed_requirement_id,affected_sectionsを Machine-Readable Contract に追加{x, y}arena coordinate に固定したため、既存docs/product/game-logic.mdのAimIntent; angle例示を追従修正する」とするAC3 / VC を baseline-fail 対象から外すこと
docs/product/features/movement-projectile.mdはこの Issue の変更対象ではなく、既に正しい参照元 spec# preflight-scope: pr_review_onlyを付けるか、Review Evidence 扱いにするdocs/product/game-logic.mdのAimIntent angle除去と{ x, y }化に限定するpnpm testの issue-447 worktree 混入疑いは docs(game-logic): AimIntent 例示を {x, y} arena 座標表現に修正する #443 の scope に含めないことこの修正後に issue-contract-review を再実行し、BLOCKED が解除されてから impl-review-loop に戻してください。
squne121 commentedon May 28, 2026
Contract Review: BLOCKED (2026-05-28T16:33:00Z)
```yaml
CONTRACT_REVIEW_RESULT_V1:
status: blocked
generated_at: "2026-05-28T16:33:00Z"
generated_by: issue-contract-review
issue_url: #443
checks:
template_compliance: fail
state_label: ok
allowed_paths_present: pass
vc_present: pass
stop_conditions_complete: fail
vc_preflight:
passed: false
vc_failed_as_expected: 0
vc_passed_unexpectedly: 0
vc_unrunnable: 0
vc_expected_pass: 3
vc_skipped: 1
status: human_judgment
human_judgment_count: 4
note: "uv run python3 コマンドが preflight script で unknown 分類(baseline fail expected だが classification 不能)"
ac_verifiability: pass
product_spec_check:
applicability: applicable
decision: pass
worktree_branch_collision: clear
next_action: propose_refinement_loop
blocked_reasons:
- "template_compliance: 必須セクション欠落(Parent Issue / Parent Goal Ref / Current Validated Scope / Remaining Parent Gaps / In Scope / Out of Scope / Required Skills)"
- "stop_conditions_complete: 定型 6 項目が未設定(現在 3 条件のみ)"
- "Runtime Verification Applicability セクションが欠落(implementation issue では必須)"
- "VC preflight: human_judgment(uv run python3 コマンドの AC ラベルが AC_UNKNOWN)"
```
不足項目(最小追加案)
以下を追加すれば BLOCKED が解除されます。契約を肥大化させない最小形式で記載しています。
1. 欠落している必須セクション
2. Stop Conditions に定型 6 項目を追加
現在 3 条件 → 定型 6 条件 + Issue 固有条件に変更:
3. VC の AC ラベルを単独行に移動(AC_UNKNOWN 解消)
現在の VC コメントが
# AC1: 説明テキストと同一行になっているため、preflight がAC_UNKNOWNと認識しています。AC ラベルを独立行にし、説明はその次行以降に書いてください:
推奨アクション
issue-refinement-loopで上記3点を追加修正後、issue-contract-reviewを再実行してください。squne121 commentedon May 28, 2026
Contract Snapshot (2026-05-28T16:44:42Z)
docs/product/game-logic.mdのAimIntentbranch が{ type: 'AimIntent'; x: number; y: number; } // arena logical coordinates形式に修正されるdocs/product/game-logic.md(## 入力 / Input内AimIntentbranch のみ).claude/worktrees/issue-443-aimintent-x-y-arenaworktree-issue-443-aimintent-x-y-arenasqune121 commentedon May 28, 2026
implement-issue: 実装完了 (2026-05-29T00:00:00Z)
docs(game-logic): AimIntent 例示を {x, y} arena 座標表現に修正する (#443) (#458)
squne121 commentedon May 28, 2026
post-merge-cleanup: 完了 (2026-05-28T22:16:27Z)