Repository navigation
feat: add ally basic behavior (#984) - #1070
Conversation
Add allies collection and deterministic ally_basic behavior before combat. Reset ally runtime and command intent state on sortie start, centralize TargetEntityId bridges, and cover the new behavior with deterministic tests.
Preview URLPreview removed (PR #1070 closed). |
TEST_VERDICT:
result: PASS
mergeable: MERGEABLE
merge_state_status: BEHIND
branch_behind_main: true
baseline_only: false
verification_commands_pass: 11
verification_commands_fail: 0
verification_skipped_count: 0
runtime_ac_results:
- ac: AC1
command: "rg -n \"interface AllyState\" src/state/GameState.ts"
exit_code: 0
status: pass
fallback_detected: false
artifact_present: not_required
human_review_required: false
stop_condition_triggered: false
notes: "src/state/GameState.ts:82"
- ac: AC2
command: "rg -n \"faction: 'ally'\" src/state/GameState.ts"
exit_code: 0
status: pass
fallback_detected: false
artifact_present: not_required
human_review_required: false
stop_condition_triggered: false
notes: "src/state/GameState.ts:85,330"
- ac: AC3
command: "rg -n \"resetCommandIntentRuntime\" src/systems/SortieSystem.ts"
exit_code: 0
status: pass
fallback_detected: false
artifact_present: not_required
human_review_required: false
stop_condition_triggered: false
notes: "src/systems/SortieSystem.ts:3,53"
- ac: AC4
command: "rg -n \"enemyTargetEntityId\" src/systems/TargetingSystem.ts"
exit_code: 0
status: pass
fallback_detected: false
artifact_present: not_required
human_review_required: false
stop_condition_triggered: false
notes: "src/systems/TargetingSystem.ts:63"
- ac: AC5
command: "rg -n \"runAlly.*System\" src/systems/SortieSystem.ts"
exit_code: 0
status: pass
fallback_detected: false
artifact_present: not_required
human_review_required: false
stop_condition_triggered: false
notes: "src/systems/SortieSystem.ts:13,281"
- ac: AC6
command: "rg -n \"CommandIntent.none acquires target deterministically\" tests"
exit_code: 0
status: pass
fallback_detected: false
artifact_present: not_required
human_review_required: false
stop_condition_triggered: false
notes: "tests/systems/ally-behavior-system.test.ts:7,34"
- ac: AC7
command: "rg -n \"stale target is cleared deterministically\" tests"
exit_code: 0
status: pass
fallback_detected: false
artifact_present: not_required
human_review_required: false
stop_condition_triggered: false
notes: "tests/systems/ally-behavior-system.test.ts:81"
- ac: AC8
command: "rg -n \"ally emits no projectile and no damage\" tests"
exit_code: 0
status: pass
fallback_detected: false
artifact_present: not_required
human_review_required: false
stop_condition_triggered: false
notes: "tests/systems/ally-behavior-system.test.ts:120"
- ac: AC9
command: "pnpm typecheck"
exit_code: 0
status: pass
fallback_detected: false
artifact_present: not_required
human_review_required: false
stop_condition_triggered: false
notes: "tsc --noEmit"
- ac: AC10
command: "pnpm test"
exit_code: 0
status: pass
fallback_detected: false
artifact_present: not_required
human_review_required: false
stop_condition_triggered: false
notes: "69 files, 918 tests passed"
- ac: AC11
command: "pnpm build"
exit_code: 0
status: pass
fallback_detected: false
artifact_present: not_required
human_review_required: false
stop_condition_triggered: false
notes: "vite build success"検証サマリ:
|
squne121
left a comment
There was a problem hiding this comment.
Verdict: APPROVE
Mergeability
- mergeable=MERGEABLE, merge_state_status=BEHIND
Evidence Check
- linked issue #984 の contract snapshot comment を確認し、reviewed head
f11018bd77d91c311eb9434ebbdb9ff4116f1d63に対して照合しました。 - TEST_VERDICT_MACHINE v1: PASS, verification_skipped_count=0, reviewed head と一致。
- CI_VERDICT_SUMMARY_V1: status=all_pass。
- ALLOWED_PATHS_GATE_RESULT_V1: status=ok, changed_files_count=8。
Required Auto Actions
update_branch: PR は BEHIND のため、main 取り込み後に再 push が必要です。update_pr_body_hygiene: PR 本文に## 受け入れ条件の達成状況/## 検証コマンド結果/## Allowed Paths 遵守の必須セクションが不足しています。
LOOP_VERDICT_V2
verdict: APPROVE
reviewed_head_sha: "f11018bd77d91c311eb9434ebbdb9ff4116f1d63"
merge_ready: false
mergeability:
mergeable: "MERGEABLE"
merge_state_status: "BEHIND"
blockers: []
required_auto_actions:
- kind: update_branch
executor: implementation-worker
skill: implement-issue.update_branch
blocking_merge_ready: true
mechanical: true
expected_head_sha: "f11018bd77d91c311eb9434ebbdb9ff4116f1d63"
- kind: update_pr_body_hygiene
executor: implementation-worker
skill: open-pr.update_pr
blocking_merge_ready: true
mechanical: true
auto_fix_applied: []
follow_up_issue_requests: []
allowed_paths_gate:
status: ok
allowed_paths_gate_source: review_subagent
TEST_VERDICT:
result: PASS
mergeable: MERGEABLE
merge_state_status: CLEAN
branch_behind_main: false
baseline_only: false
verification_commands_pass: 11
verification_commands_fail: 0
verification_skipped_count: 0
runtime_ac_results:
- ac: AC1
command: "rg -n \"interface AllyState\" src/state/GameState.ts"
exit_code: 0
status: pass
fallback_detected: false
artifact_present: not_required
human_review_required: false
stop_condition_triggered: false
notes: "src/state/GameState.ts:82"
- ac: AC2
command: "rg -n \"faction: 'ally'\" src/state/GameState.ts"
exit_code: 0
status: pass
fallback_detected: false
artifact_present: not_required
human_review_required: false
stop_condition_triggered: false
notes: "src/state/GameState.ts:85,330"
- ac: AC3
command: "rg -n \"resetCommandIntentRuntime\" src/systems/SortieSystem.ts"
exit_code: 0
status: pass
fallback_detected: false
artifact_present: not_required
human_review_required: false
stop_condition_triggered: false
notes: "src/systems/SortieSystem.ts:3,53"
- ac: AC4
command: "rg -n \"enemyTargetEntityId\" src/systems/TargetingSystem.ts"
exit_code: 0
status: pass
fallback_detected: false
artifact_present: not_required
human_review_required: false
stop_condition_triggered: false
notes: "src/systems/TargetingSystem.ts:63"
- ac: AC5
command: "rg -n \"runAlly.*System\" src/systems/SortieSystem.ts"
exit_code: 0
status: pass
fallback_detected: false
artifact_present: not_required
human_review_required: false
stop_condition_triggered: false
notes: "src/systems/SortieSystem.ts:13,281"
- ac: AC6
command: "rg -n \"CommandIntent.none acquires target deterministically\" tests"
exit_code: 0
status: pass
fallback_detected: false
artifact_present: not_required
human_review_required: false
stop_condition_triggered: false
notes: "tests/systems/ally-behavior-system.test.ts:7,34"
- ac: AC7
command: "rg -n \"stale target is cleared deterministically\" tests"
exit_code: 0
status: pass
fallback_detected: false
artifact_present: not_required
human_review_required: false
stop_condition_triggered: false
notes: "tests/systems/ally-behavior-system.test.ts:81"
- ac: AC8
command: "rg -n \"ally emits no projectile and no damage\" tests"
exit_code: 0
status: pass
fallback_detected: false
artifact_present: not_required
human_review_required: false
stop_condition_triggered: false
notes: "tests/systems/ally-behavior-system.test.ts:120"
- ac: AC9
command: "pnpm typecheck"
exit_code: 0
status: pass
fallback_detected: false
artifact_present: not_required
human_review_required: false
stop_condition_triggered: false
notes: "TypeScript: No errors found"
- ac: AC10
command: "pnpm test"
exit_code: 0
status: pass
fallback_detected: false
artifact_present: not_required
human_review_required: false
stop_condition_triggered: false
notes: "Executed via `rtk run \"CI=true pnpm test\"`; 69 files, 918 tests passed"
- ac: AC11
command: "pnpm build"
exit_code: 0
status: pass
fallback_detected: false
artifact_present: not_required
human_review_required: false
stop_condition_triggered: false
notes: "Executed in /tmp/loop-protocol-pr1070-verify via `rtk run \"CI=true pnpm build\"`; built successfully" |
squne121
left a comment
There was a problem hiding this comment.
LOOP_VERDICT_V2
verdict: APPROVE
reviewed_head_sha: "71c6673085cda63fadef1e36707ad05656f1f1ac"
merge_ready: true
mergeability:
mergeable: "MERGEABLE"
merge_state_status: "CLEAN"
blockers: []
required_auto_actions: []
auto_fix_applied: []
follow_up_issue_requests: []
allowed_paths_gate:
status: ok
allowed_paths_gate_source: review_subagent
結論: REQUEST_CHANGES 相当PR #1070 は #984 の主要 AC の多くを拾っています。 ただし、このまま merge すると assist_player が実プレイ経路では ally targeting に届かない可能性が高いです。さらに TEST_VERDICT コメントが現在 head と一致しておらず、証跡として弱いです。draft のまま修正してください。 Blocker 1:
|
TEST_VERDICT:
result: FAIL
mergeable: MERGEABLE
merge_state_status: BLOCKED
branch_behind_main: false
baseline_only: false
verification_commands_pass: 11
verification_commands_fail: 0
verification_skipped_count: 0
runtime_ac_results:
- ac: AC1
command: "rg -n \"interface AllyState\" src/state/GameState.ts"
exit_code: 0
status: pass
fallback_detected: false
artifact_present: not_required
human_review_required: false
stop_condition_triggered: false
notes: "head_sha=b263d067af8d1c5bc49b65730ac7a90a1ff930e2"
- ac: AC2
command: "rg -n \"faction: 'ally'\" src/state/GameState.ts"
exit_code: 0
status: pass
fallback_detected: false
artifact_present: not_required
human_review_required: false
stop_condition_triggered: false
notes: "head_sha=b263d067af8d1c5bc49b65730ac7a90a1ff930e2"
- ac: AC3
command: "rg -n \"resetCommandIntentRuntime\" src/systems/SortieSystem.ts"
exit_code: 0
status: pass
fallback_detected: false
artifact_present: not_required
human_review_required: false
stop_condition_triggered: false
notes: "head_sha=b263d067af8d1c5bc49b65730ac7a90a1ff930e2"
- ac: AC4
command: "rg -n \"enemyTargetEntityId\" src/systems/TargetingSystem.ts"
exit_code: 0
status: pass
fallback_detected: false
artifact_present: not_required
human_review_required: false
stop_condition_triggered: false
notes: "head_sha=b263d067af8d1c5bc49b65730ac7a90a1ff930e2"
- ac: AC5
command: "rg -n \"runAlly.*System\" src/systems/SortieSystem.ts"
exit_code: 0
status: pass
fallback_detected: false
artifact_present: not_required
human_review_required: false
stop_condition_triggered: false
notes: "head_sha=b263d067af8d1c5bc49b65730ac7a90a1ff930e2"
- ac: AC6
command: "rg -n \"CommandIntent.none acquires target deterministically\" tests"
exit_code: 0
status: pass
fallback_detected: false
artifact_present: not_required
human_review_required: false
stop_condition_triggered: false
notes: "head_sha=b263d067af8d1c5bc49b65730ac7a90a1ff930e2"
- ac: AC7
command: "rg -n \"stale target is cleared deterministically\" tests"
exit_code: 0
status: pass
fallback_detected: false
artifact_present: not_required
human_review_required: false
stop_condition_triggered: false
notes: "head_sha=b263d067af8d1c5bc49b65730ac7a90a1ff930e2"
- ac: AC8
command: "rg -n \"ally emits no projectile and no damage\" tests"
exit_code: 0
status: pass
fallback_detected: false
artifact_present: not_required
human_review_required: false
stop_condition_triggered: false
notes: "head_sha=b263d067af8d1c5bc49b65730ac7a90a1ff930e2"
- ac: AC9
command: "pnpm typecheck"
exit_code: 0
status: pass
fallback_detected: false
artifact_present: not_required
human_review_required: false
stop_condition_triggered: false
notes: "head_sha=b263d067af8d1c5bc49b65730ac7a90a1ff930e2"
- ac: AC10
command: "pnpm test"
exit_code: 0
status: pass
fallback_detected: false
artifact_present: not_required
human_review_required: false
stop_condition_triggered: false
notes: "head_sha=b263d067af8d1c5bc49b65730ac7a90a1ff930e2"
- ac: AC11
command: "pnpm build"
exit_code: 0
status: pass
fallback_detected: false
artifact_present: not_required
human_review_required: false
stop_condition_triggered: false
notes: "head_sha=b263d067af8d1c5bc49b65730ac7a90a1ff930e2" |
squne121
left a comment
There was a problem hiding this comment.
LOOP_VERDICT_V2
verdict: APPROVE
reviewed_head_sha: "b263d067af8d1c5bc49b65730ac7a90a1ff930e2"
merge_ready: true
mergeability:
mergeable: "MERGEABLE"
merge_state_status: "CLEAN"
blockers: []
required_auto_actions: []
auto_fix_applied: []
follow_up_issue_requests: []
allowed_paths_gate:
status: ok
allowed_paths_gate_source: review_subagent
Summary
この PR は Issue #984 の通常実装モードとして、ally runtime を既存 sortie loop に最小統合する変更です。
GameStateに ally runtime を追加し、ally_basicがrunEnemyAISystem後 /runCombatSystem前に deterministic に target を取得して移動する最小実装を追加しました。resetCombatRuntime/startSortieで ally runtime とcommandIntentRuntimeを初期化し、ally projectile / damage を出さないこともテストで固定しています。Checks
この変更で実行した主要な検証結果は次のとおりです。契約で要求された静的検証とテストを通し、ally runtime の追加が既存 sortie loop を壊していないことを確認しました。
pnpm typecheck→ PASSpnpm test→ PASSpnpm build→ PASSpnpm lint→ PASS受け入れ条件の達成状況
Issue #984 の AC1 から AC11 までについて、今回の変更で満たした内容を簡潔に整理します。state shape、reset、TargetEntityId bridge、ally 挿入順、deterministic behavior、no projectile / no damage、主要検証のすべてをこの PR で満たしています。
GameStateにAllyState、allies: AllyState[]、nextAllyIdを追加しました。ally_basicは top-level field ではなくAllyState.role === 'ally_basic'とfaction === 'ally'で表現しています。resetCombatRuntime/startSortieでallies、nextAllyId、commandIntentRuntimeを初期化します。enemyTargetEntityId/playerTargetEntityId/allyTargetEntityIdをTargetingSystemに集約しました。runEnemyAISystemの後、runCombatSystemの前に統合しています。CommandIntent.noneでも ally が deterministic に target を取得して移動するテストを追加しました。pnpm typecheckが PASS しました。pnpm testが PASS しました。pnpm buildが PASS しました。検証コマンド結果
実装後に実行した主要コマンドの結果をここに残します。いずれも worktree 上で実行し、今回の ally runtime 追加後の状態で成功を確認しました。
pnpm typecheck: PASSpnpm test: PASSpnpm build: PASSpnpm lint: PASSAllowed Paths 遵守
この PR の変更は issue contract の Allowed Paths 内に閉じています。変更対象は
src/state/GameState.ts、src/systems/、tests/のみで、assets/、LICENSES/、その他の範囲外パスには触れていません。src/state/GameState.ts: ally runtime shape と default ally state を追加しました。src/systems/:AllyBehaviorSystem追加、SortieSystem/TargetingSystem/index.ts更新に限定しています。tests/: sortie / targeting / ally behavior の deterministic test 追加に限定しています。Schema Change Applicability
この PR は runtime 実装の追加ではありますが、外部 consumer と共有する機械可読スキーマ契約の変更は含みません。そのため schema governance 上は
not_schema_changeとして扱います。Schema Consumer Inventory
not_schema_changeのため consumer inventory は不要です。今回の変更はローカル runtime 実装とその検証に閉じており、別 consumer の追従更新は発生していません。N/A
reason:
not_schema_changeのため consumer inventory は不要です。Safety Claim Matrix
この変更で意図した安全側の制約と、その確認方法を次の表にまとめます。scope を stage5 の ally movement までに保ち、後続 stage の projectile / damage / direct command を持ち込まないことを重視しました。
pnpm testで ally target acquisition / stale target clear / no projectile-no damage を確認pnpm testの startSortie/reset 関連テストで確認src/state/GameState.ts、src/systems/、tests/に限定Notes
補足事項をここに残します。今回の PR は stage5 の最小実装であり、ally projectile / damage / direct command / UI affordance は後続 issue の責務として維持しています。
Closes #984。linked issue は open のため、この PR の merge 時に自動 close される想定です。