Repository navigation
feat(data): bootstrap armament catalogs - #1263
Conversation
TEST_VERDICT:
result: PASS
mergeable: UNKNOWN
merge_state_status: UNKNOWN
branch_behind_main: false
baseline_only: false
verification_commands_pass: 19
verification_commands_fail: 0
verification_skipped_count: 0
runtime_ac_results: [] |
Preview URLPreview removed (PR #1263 closed). |
squne121
left a comment
There was a problem hiding this comment.
LOOP_VERDICT_V2
verdict: REQUEST_CHANGES
reviewed_head_sha: "82a1ec125a32567a3d086b7dff5ca3adf3734b24"
merge_ready: false
mergeability:
mergeable: "MERGEABLE"
merge_state_status: "BEHIND"
blockers:
- "TEST_VERDICT_MACHINE v1 が current head 82a1ec125a32567a3d086b7dff5ca3adf3734b24 に head-scoped で結び付いていません。comment YAML に head_sha がなく、https://github.com/squne121/loop-protocol/pull/1263#issuecomment-4854409270 の branch_behind_main: false が live merge_state_status=BEHIND と不整合なため、証拠を stale でないと判定できません。"
required_auto_actions:
- kind: update_branch
executor: implementation-worker
skill: implement-issue.update_branch
blocking_merge_ready: true
mechanical: true
expected_head_sha: "82a1ec125a32567a3d086b7dff5ca3adf3734b24"
auto_fix_applied: []
follow_up_issue_requests: []
allowed_paths_gate:
status: ok
allowed_paths_gate_source: review_subagent
TEST_VERDICT:
result: PASS
head_sha: "be9f6ede803f6d6d34f70597485c08322388431d"
reviewed_head_sha: "be9f6ede803f6d6d34f70597485c08322388431d"
mergeable: MERGEABLE
merge_state_status: BLOCKED
branch_behind_main: false
baseline_only: false
verification_commands_pass: 19
verification_commands_fail: 0
verification_skipped_count: 0
runtime_ac_results: [] |
squne121
left a comment
There was a problem hiding this comment.
Verdict: APPROVE
Mergeability
- mergeable=
MERGEABLE, merge_state_status=CLEAN
Evidence Check
- AC coverage: linked issue
#1175の AC1-AC10 は PR 本文の## 受け入れ条件の達成状況と current diff で充足を確認。 - Allowed Paths: current head
be9f6ede803f6d6d34f70597485c08322388431dの changed files はsrc/data/units.ts,src/data/weapons.tsのみで、ALLOWED_PATHS_GATE_RESULT_V1.status=ok。 - CI Verification:
ci_verdict_summary.py --expected-head-sha be9f6ede803f6d6d34f70597485c08322388431dはstatus=all_pass。 - 検証コマンド結果: 最新
TEST_VERDICT_MACHINEは current head にhead_sha/reviewed_head_sha=be9f6ede803f6d6d34f70597485c08322388431dで bind され、verification_commands_pass=19,verification_commands_fail=0,verification_skipped_count=0。
Blockers
- なし
Non-blockers
- 最新
TEST_VERDICT_MACHINEコメント内のmerge_state_status=BLOCKEDは、required checks 完了前の一時状態とみなし、current-head の live PR state (MERGEABLE/CLEAN) とci_verdict_summary.pyで再確認済み。
LOOP_VERDICT_V2
verdict: APPROVE
reviewed_head_sha: "be9f6ede803f6d6d34f70597485c08322388431d"
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_CHANGESPR #1263 は ただし、このまま merge すべきではありません。 理由は、 P0: |
| 項目 | PR catalog | 現runtime / SSOT | 判定 |
|---|---|---|---|
| fire cooldown | 350 | player.weaponIntervalMs = 280 |
不一致 |
| projectile radius | 8 | PROJECTILE_RADIUS_PX = 4 |
不一致 |
| projectile speed | 520 | PROJECTILE_SPEED_PX_PER_SEC = 520 |
一致 |
| projectile lifetime | 900 | PROJECTILE_LIFETIME_MS = 1200 |
不一致 |
createInitialGameState() の player default は weaponIntervalMs: 280 であり、runCombatSystem() は発射時に state.player.weaponIntervalMs を cooldown に使います。さらに projectile 生成は radius 4、speed 520、lifetime 1200、damage は state.progress.weaponPower snapshot です。
Issue #1175 は「後続 consumer が参照可能な最小 catalog seed」を作ることが目的で、runtime consumer 接続は out of scope です。だからこそ、catalog seed は future consumer が読んでも挙動を変えない値、つまり現runtime値の写像であるべきです。Issue側も damage を持ち込まず、progress.weaponPower の authority と衝突しない最小 schema に留める前提です。
movement-projectile.md でも fire_cooldown_ms の initial implementation default は既存 GameState weaponIntervalMs = 280 とされています。projectile speed / lifetime は当初 TBD 扱いでしたが、現runtimeではすでに CombatSystem 側に concrete value が存在します。
必須修正
player_weapon_basic は最低限こう直すべきです。
export const weaponDefinitions = [
{
definitionId: 'player_weapon_basic',
ownerFaction: 'player',
fireCooldownMs: 280,
projectileRadius: 4,
projectileSpeedPxPerSec: 520,
projectileLifetimeMs: 1200,
},
] as const satisfies readonly WeaponDefinition[]
このPRの性質は「balance tuning」ではなく「catalog bootstrap」です。したがって、350 / 8 / 900 のような新規 balance 値を混入させるのは危険です。src/data/CLAUDE.md も、src/data は純粋データ列挙のみ、型変更は import 元への影響が大きいので別Issue、としています。
P1: CI・preview・AC PASS は、このPRの本質的リスクを検出できていない
このPRは最新headで workflow が全て成功しており、deploy-pages / ci / hook integrity / manifest / Japanese content check が completed success です。
ただし、現時点で weaponDefinitions と unitDefinitions はそれぞれ定義ファイル以外から参照されていません。検索結果でも weaponDefinitions は src/data/weapons.ts のみ、unitDefinitions は src/data/units.ts のみです。
つまり、pnpm typecheck / lint / test / build が通っても、catalog値がruntime値と一致しているかは検証されません。 これは false green です。Issue #1175 のコメントでも、実装前レビュー段階から「consumer 不在」「grep AC の false green」「weapon damage / runtime authority conflict」が問題視されていました。
PR comment上は、一度 head binding 不備で REQUEST_CHANGES になった後、最新headでは APPROVE に転じています。これは証跡 freshness とCI整合の観点では改善されていますが、今回の数値衝突はその後も残っています。
P1: 配布物レビューとしては「live assets verified」だけでは動作保証にならない
PR preview workflow は self-repo PR のみを対象に、head SHA checkout、pnpm typecheck / lint / test、PR別 base path /loop-protocol/pr-<number>/、preview storage namespace pr-<number>、commit SHA injection を行っています。
さらに dist 内の asset base path、preview storage namespace、commit SHA を grep し、GitHub Pages 配下へ pr-<number> destination で deploy し、live index と asset path を curl で検証しています。
この実装は、Vite / GitHub Pages の基本に沿っています。Vite公式は GitHub Pages の repository page では base を /<REPO>/ にするよう説明しており、GitHub Pages は repository から HTML/CSS/JS 等を公開する静的ホスティングです。([vitejs]1)
ただし、このPRでは runtime consumer が存在しないため、previewで確認できるのは「bundleが配信され、asset path と namespace が壊れていない」ことまでです。weaponDefinitions が実際に発射挙動へ適用された場合に cooldown/radius/lifetime が維持されることは、現preview証跡では保証されません。
P2: UnitDefinition / ally_basic 側は妥当
unitDefinitions の ally_basic は、faction: 'ally'、role: 'ally_basic'、radius: 12、speedPxPerSec: 140、initialBehaviorState: 'inactive'、defaultTargetingPolicy: 'nearest_hostile' です。
これは現runtimeの createDefaultAllyState(1) と一致しています。runtime 側は role: 'ally_basic'、faction: 'ally'、behaviorState: 'inactive'、targetingPolicy: 'nearest_hostile'、radius: 12、speedPxPerSec: 140 を返します。
また、x / y を catalog に入れていない点も良いです。spawn位置と archetype definition を混ぜていません。
P2: as const satisfies readonly ...[] の採用は正しい
このPRは enemies.ts の既存 pattern に寄せています。enemies.ts は readonly definitionId を持つ interface と、as const satisfies readonly EnemyDefinition[] の readonly catalog を使っています。
TypeScript公式上も、satisfies は式の具体的な型情報を保持しながら target type への適合を検証するための機能です。as const は literal widening を抑制し、object property を readonly にし、array literal を readonly tuple にします。今回のような静的 catalog seed には適切です。([TypeScript]2) ([TypeScript]3)
P2: storage / preview namespace の扱いは現時点では良いが、後続PRで過信してはいけない
upgrade.md は target: progress.weaponPower を正本とし、validate → debit → apply → snapshot、保存成功後のみ live state commit、次 sortie 反映、既存 projectile への retroactive 適用禁止を定めています。
また、PR preview storage key は loop-protocol.preview.pr-<number>.mvp.save、production は loop-protocol.mvp.save と分離されています。VITE_LOOP_STORAGE_NAMESPACE は build-time namespace であり、非秘密値のみを許可する扱いです。
これはWeb仕様上も必要です。localStorage は origin 単位で保持され、file: URL の挙動は保証されません。WHATWG Web Storage は複数window間の locking を前提にできないこと、setItem() が QuotaExceededError を投げ得ることも明記しています。([MDNウェブドキュメント]4)
Viteの VITE_* env は client bundle に露出され、build時に静的置換されるため、namespaceのような非秘密値に限定するのは正しいです。([vitejs]5)
推奨する merge 条件
このPRは以下を満たせば approve 可能です。
-
src/data/weapons.tsのplayer_weapon_basicを runtime mirror 値に修正する。fireCooldownMs: 280projectileRadius: 4projectileSpeedPxPerSec: 520projectileLifetimeMs: 1200
-
PR本文またはコメントに明記する。
- この catalog は future consumer seed であり、現runtime consumer はまだ存在しない。
- 後続 consumer Issue では
CombatSystemhardcode と catalog 値の同値性をテストで固定してから移行する。 damageは追加しない。damage authority はprogress.weaponPowerのまま維持する。
-
可能なら follow-up Issue を切る。
weaponDefinitionsをCombatSystemに接続する migration。- migration時に、既存発射挙動の golden test を追加する。
weaponIntervalMs/ projectile constants の二重SSOTを解消する。
GitHubに貼るレビュー案
## Adversarial review: REQUEST_CHANGES
PR #1263 の目的(`src/data/weapons.ts` / `src/data/units.ts` の空 catalog を `definitionId` ベースの readonly seed にする)は妥当です。`UnitDefinition` / `ally_basic` は現 `createDefaultAllyState(1)` と一致しており、この部分は問題ありません。
ただし `player_weapon_basic` の数値 seed は merge 前に修正が必要です。
現 PR:
```ts
fireCooldownMs: 350
projectileRadius: 8
projectileSpeedPxPerSec: 520
projectileLifetimeMs: 900
現 runtime:
state.player.weaponIntervalMs = 280
PROJECTILE_RADIUS_PX = 4
PROJECTILE_SPEED_PX_PER_SEC = 520
PROJECTILE_LIFETIME_MS = 1200
このPRは runtime consumer をまだ追加しないため、CI / preview / grep AC はこの不一致を検出できません。しかし #1175 の目的は「後続 consumer が参照可能な最小 catalog seed」です。後続 consumer がこの catalog を読むと、fire cooldown / projectile radius / lifetime が意図せず変わります。
必須修正案:
export const weaponDefinitions = [
{
definitionId: 'player_weapon_basic',
ownerFaction: 'player',
fireCooldownMs: 280,
projectileRadius: 4,
projectileSpeedPxPerSec: 520,
projectileLifetimeMs: 1200,
},
] as const satisfies readonly WeaponDefinition[]
damage を追加していない点、as const satisfies readonly ...[] を使っている点、ally_basic が spawn position を持たない archetype seed に留まっている点は良いです。
修正後、pnpm typecheck / pnpm lint / pnpm test / pnpm build の再実行結果を current head に bind してください。
TEST_VERDICT:
result: PASS
head_sha: "5d5d1c1eeac512937e788cb287a458fb5bf28446"
reviewed_head_sha: "5d5d1c1eeac512937e788cb287a458fb5bf28446"
mergeable: MERGEABLE
merge_state_status: BLOCKED
branch_behind_main: false
baseline_only: false
verification_commands_pass: 19
verification_commands_fail: 0
verification_skipped_count: 0
runtime_ac_results: [] |
squne121
left a comment
There was a problem hiding this comment.
Verdict: APPROVE
Mergeability
- mergeable=
MERGEABLE, merge_state_status=CLEAN
Evidence Check
- 起点 comment: #1263 (comment) の
REQUEST_CHANGESが求めたplayer_weapon_basicの runtime mirror 修正(fireCooldownMs: 280,projectileRadius: 4,projectileSpeedPxPerSec: 520,projectileLifetimeMs: 1200)は current diff で反映済み。 - AC coverage: linked issue
#1175の AC1-AC10 は PR 本文の## 受け入れ条件の達成状況と current head5d5d1c1eeac512937e788cb287a458fb5bf28446の diff で充足を確認。 - Allowed Paths: current head の changed files は
src/data/units.ts,src/data/weapons.tsのみで、ALLOWED_PATHS_GATE_RESULT_V1.status=ok。 - CI Verification:
ci_verdict_summary.py --expected-head-sha 5d5d1c1eeac512937e788cb287a458fb5bf28446はstatus=all_pass。 - 検証コマンド結果: 最新
TEST_VERDICT_MACHINEは current head にhead_sha/reviewed_head_sha=5d5d1c1eeac512937e788cb287a458fb5bf28446で bind され、verification_commands_pass=19,verification_commands_fail=0,verification_skipped_count=0。
Blockers
- なし
Non-blockers
- 最新
TEST_VERDICT_MACHINEコメント内のmerge_state_status=BLOCKEDは required checks 完了前の一時状態で、required checks 完了後の live PR state (MERGEABLE/CLEAN) と current-headci_verdict_summary.pyで再確認済み。
LOOP_VERDICT_V2
verdict: APPROVE
reviewed_head_sha: "5d5d1c1eeac512937e788cb287a458fb5bf28446"
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
src/data/weapons.tsをreadonly definitionIdベースの readonly catalog に更新したplayer_weapon_basicの最小 weapon seed を追加し、cooldown / projectile 数値は現 runtime mirror に揃えたsrc/data/units.tsをreadonly definitionIdベースの readonly catalog に更新し、ally_basicarchetype seed を追加した受け入れ条件の達成状況
WeaponDefinitionがreadonly definitionId: stringを持つplayer_weapon_basicを readonly catalog entry として追加し、as const satisfies readonly WeaponDefinition[]を使用したUnitDefinitionがreadonly definitionId: stringを持つally_basicを readonly catalog entry として追加し、as const satisfies readonly UnitDefinition[]を使用したally_basicにfaction: 'ally'/role: 'ally_basic'/radius: 12/speedPxPerSec: 140/initialBehaviorState: 'inactive'/defaultTargetingPolicy: 'nearest_hostile'を反映したWeaponDefinitionをownerFaction/fireCooldownMs/projectileRadius/projectileSpeedPxPerSec/projectileLifetimeMsを含む最小 shape に限定したpnpm typecheckpnpm lintpnpm testpnpm build検証コマンド結果
rg -n "readonly definitionId: string" src/data/weapons.tsを実行し、型定義の更新を確認したrg -n "definitionId: 'player_weapon_basic'" src/data/weapons.tsを実行し、weapon seed の追加を確認したrg -n "readonly definitionId: string" src/data/units.tsを実行し、型定義の更新を確認したrg -n "definitionId: 'ally_basic'" src/data/units.tsを実行し、unit seed の追加を確認したrg -F -n "faction: 'ally'" src/data/units.tsを実行し、ally faction を確認したrg -F -n "role: 'ally_basic'" src/data/units.tsを実行し、ally role を確認したrg -F -n "radius: 12" src/data/units.tsを実行し、半径の seed 値を確認したrg -F -n "speedPxPerSec: 140" src/data/units.tsを実行し、速度の seed 値を確認したrg -F -n "initialBehaviorState: 'inactive'" src/data/units.tsを実行し、初期 behavior を確認したrg -F -n "defaultTargetingPolicy: 'nearest_hostile'" src/data/units.tsを実行し、初期 targeting を確認したrg -F -n "ownerFaction: 'player'" src/data/weapons.tsを実行し、owner faction を確認したrg -F -n "fireCooldownMs:" src/data/weapons.tsを実行し、cooldown field を確認したrg -F -n "projectileRadius:" src/data/weapons.tsを実行し、projectile radius field を確認したrg -F -n "projectileSpeedPxPerSec:" src/data/weapons.tsを実行し、projectile speed field を確認したrg -F -n "projectileLifetimeMs:" src/data/weapons.tsを実行し、projectile lifetime field を確認したpnpm typecheckを実行し、型検査が通ることを確認したpnpm lintを実行し、lint が通ることを確認したpnpm testを実行し、既存テスト一式が通ることを確認したpnpm buildを実行し、ビルドが通ることを確認したAllowed Paths 遵守
src/data/weapons.tsとsrc/data/units.tsのみChecks
pnpm typecheckを実行し、型検査が通ることを確認したpnpm lintを実行し、lint が通ることを確認したpnpm testを実行し、既存テスト一式が通ることを確認したpnpm buildを実行し、ビルドが通ることを確認したSchema Change Applicability
schema_changeWeaponDefinitionとUnitDefinitionの exported shape をdefinitionIdベースへ変更し、readonly catalog seed を追加したSchema Consumer Inventory
変更対象 schema:
src/data/weapons.ts:WeaponDefinition,src/data/units.ts:UnitDefinitionbefore/after 差分:
Consumer 列挙(rg コマンド例と結果):
rg -l "WeaponDefinition|weaponDefinitions|UnitDefinition|unitDefinitions" src tests docs src/data/units.ts src/data/weapons.tsConsumer 更新状況:
src/data/weapons.tssrc/data/units.ts互換性判断
この schema 変更は catalog producer 自身の整備であり、現時点では外部 consumer が存在しない前提で互換性を評価しています。
renamebreakingnoN/ASafety Claim Matrix
src/data/weapons.ts,src/data/units.tsのみNotes
player_weapon_basicはweaponIntervalMs=280/PROJECTILE_RADIUS_PX=4/PROJECTILE_SPEED_PX_PER_SEC=520/PROJECTILE_LIFETIME_MS=1200に合わせ、future consumer が読んでも現挙動を変えない seed にしています。gpt-5.3-codex-sparkを bounded edit helper として使い、src/data/weapons.ts/src/data/units.tsの 2 ファイルだけを更新しました。