Repository navigation
feat(#981): unit taxonomy 型5種を src/state に追加する(Faction / UnitRole / CommandIntent / NpcBehaviorState / TargetingPolicy) - #988
Conversation
§5 の 5 型(Faction / UnitRole / CommandIntent / NpcBehaviorState / TargetingPolicy)を src/state/GameState.ts に export type の literal union として追加する。 runtime value / enum object は追加しない。ally collection / command buffer は追加しない。 Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Preview URL⏳ publish requested(asset-level live check 未検証 / Pages source 設定後に有効化): https://squne121.github.io/loop-protocol/pr-988/ Pages source の設定が必要な場合: Settings → Pages → Source → gh-pages (root) |
squne121
left a comment
There was a problem hiding this comment.
レビュー判定: REQUEST_CHANGES(self-authored のため --comment で投稿)
LOOP_VERDICT_V2:
verdict: REQUEST_CHANGES
merge_ready: false
required_auto_actions: []
allowed_paths_gate:
status: ok
producer_role: review_subagent
worker_report_used_as_canonical: false
detail: >
contract_snapshot: https://github.com/squne121/loop-protocol/issues/981#issuecomment-4742232638
expected_contract_fingerprint: sha256:5e2c82e291614d65ba9b1f900c9d722d6988c3a26ed3b4adb75ebb39151106a1
contract_source_kind: issue_comment
contract_source_id: IC_kwDOSfQcDc8AAAABGqi6Pg
allowed_paths_in_contract:
- src/state/GameState.ts
- src/state/index.ts
- tests/state/unit-taxonomy-types.test.ts
actual_changed_files:
- src/state/GameState.ts
gate_result: ok (1ファイル、全て Allowed Paths 内)
blockers:
- id: B1
kind: ci_failure
detail: >
PR Body Japanese Check が失敗している。
prose_blocks=14 のうち failed_blocks=4。
block[1] ratio=0.000 (jp=0, total=10)
block[2] ratio=0.000 (jp=0, total=25)
block[3] ratio=0.000 (jp=0, total=19)
block[4] ratio=0.096 (jp=7, total=73)
threshold=0.1 未満。
検証結果テーブルの行と Safety Claim Matrix 行が英語主体で比率を下げている。
各 prose block に日本語テキストを補充するか、日本語比率を threshold 以上にする修正が必要。
fix_delta: >
PR body の日本語比率不足 prose block を修正する。
具体的には以下のセクション内の英語のみのブロックに日本語説明を追加する:
- 検証結果テーブル(PASS 等の英語のみセル行)
- Safety Claim Matrix セクション(現状 ratio=0.096)
各 prose block の日本語比率を 0.1 以上にすること。
notes: >
実装内容自体は正確。
diff は src/state/GameState.ts のみ(Allowed Paths 内)。
5型の値集合は SSOT §5 と逐語一致を確認(Faction/UnitRole/CommandIntent/NpcBehaviorState/TargetingPolicy)。
enum・runtime const object なし(export type literal union のみ)。
AC1/AC2/AC3/AC4 は全て充足。
pnpm lint/build/typecheck/test/e2e: CI pass。
python-test: pending。
唯一のブロッカーは PR body の日本語 CI ゲート失敗(B1)。
PR body の日本語比率を修正すれば即 APPROVE 可能。詳細
Allowed Paths Gate(review_subagent 独立再計算)
contract_snapshot(IC_kwDOSfQcDc8AAAABGqi6Pg、body_sha256=sha256:5e2c82e291614d65ba9b1f900c9d722d6988c3a26ed3b4adb75ebb39151106a1)の Allowed Paths:
src/state/GameState.tssrc/state/index.ts(変更なし可)tests/state/unit-taxonomy-types.test.ts(任意)
実際の変更ファイル(gh pr diff --name-only で確認):
src/state/GameState.tsのみ
Allowed Paths 外の変更: なし。Gate: ok。
AC 確認結果
| AC | 判定 | 根拠 |
|---|---|---|
| AC1: 5型が SSOT §5 と逐語一致 | PASS | diff で全5型の値集合を SSOT §5 と照合済み |
| AC2: pnpm typecheck 緑 | PASS | CI typecheck job: pass |
| AC3: 既存テスト緑 | PASS | CI test job: pass(725 tests) |
| AC4: ally collection / command buffer なし | PASS | diff に allies/commandBuffer フィールドなし確認 |
CI 状態
PR Body Japanese Check: fail(failed_blocks=4)← B1 ブロッカーactionlint: passbuild: passdeploy-pr: passe2e: passlint: passtest: passtypecheck: passvalidate-generated-artifact: passpython-test: pending
ブロッカー詳細(B1)
PR Body Japanese Check が以下のエラーで失敗:
aggregate_ratio: 0.319
threshold: 0.1
prose_blocks: 14
failed_blocks: 4
--- 日本語比率不足の prose block ---
[1] ratio=0.000 (jp=0, total=10)
[2] ratio=0.000 (jp=0, total=19)
[3] ratio=0.000 (jp=0, total=25)
[4] ratio=0.096 (jp=7, total=73)
FAIL: 日本語比率不足 (aggregate=0.319, threshold=0.1, failed_blocks=4)
per-block 判定のため aggregate_ratio が閾値を超えていても各 block が 0.1 未満なら fail となる。検証結果テーブルおよび Safety Claim Matrix の行が英語のみのため比率不足。各 block の日本語比率を 0.1 以上に修正する必要がある。
実装品質所見
実装内容は問題なし。export type literal union のみ、runtime object なし、Allowed Paths 遵守、SSOT §5 との逐語一致を確認。PR body の CI ゲート修正のみで merge_ready になる。
squne121
left a comment
There was a problem hiding this comment.
PR レビュー結果
LOOP_VERDICT: APPROVE
(自己 PR のため --approve フラグ不使用。--comment で同等の判定を記録する。)
全 AC・Allowed Paths Gate・CI が pass。以下に独立検証結果を示す。
Allowed Paths Gate(review_subagent 独立再計算)
- 変更ファイル(diff --name-only base...head):
src/state/GameState.tsのみ - Contract Allowed Paths:
src/state/GameState.ts— 変更あり(許可範囲内)src/state/index.ts— 変更なし(許可範囲内、既存export *で再 export 成立)tests/state/unit-taxonomy-types.test.ts— 変更なし(任意追加、未追加も問題なし)
- Gate 結果: ok
- Contract fingerprint:
body_sha256: sha256:5e2c82e291614d65ba9b1f900c9d722d6988c3a26ed3b4adb75ebb39151106a1 - Contract source:
issue_comment/IC_kwDOSfQcDc8AAAABGqi6Pg(#981#issuecomment-4742232638)
AC 独立検証
| AC | 結果 | 根拠 |
|---|---|---|
| AC1: 5型が SSOT §5 と逐語一致で export | PASS | diff で全5型を目視照合(下記参照) |
| AC2: pnpm typecheck 緑 | PASS | CI typecheck pass |
| AC3: 既存テスト緑 | PASS | CI test pass(725 tests) |
| AC4: allies / commandBuffer なし | PASS | diff に該当フィールドなし(pr_review_only 確認済み) |
SSOT §5 逐語照合:
Faction:'player' | 'ally' | 'enemy' | 'neutral'— 一致UnitRole:'ace_player' | 'ally_basic' | 'enemy_chaser' | 'objective' | 'neutral_obstacle'— 一致CommandIntent:'none' | 'assist_player'— 一致NpcBehaviorState:'inactive' | 'acquire_target' | 'move_to_engage' | 'attack' | 'retreat' | 'destroyed'— 一致TargetingPolicy:'focus_player' | 'assist_player_threat' | 'nearest_hostile' | 'ignore'— 一致
enum / runtime const object は追加されていない。export type のみ。
CI 全体状態
全 required ジョブ pass:
- typecheck, lint, build, test, e2e, python-test, actionlint: pass
- PR Body Japanese Check: pass(最新 run
27762337845) - ci-verdict-summary: pass
LOOP_VERDICT_V2:
verdict: APPROVE
merge_ready: true
required_auto_actions: []
reviewed_head_sha: "9e31e29256ebf5e5b8cbe6c895d7362cfcffb2e1"
allowed_paths_gate:
status: ok
producer_role: review_subagent
worker_report_used_as_canonical: false
expected_contract_fingerprint: "sha256:5e2c82e291614d65ba9b1f900c9d722d6988c3a26ed3b4adb75ebb39151106a1"
contract_source_kind: issue_comment
contract_source_id: "IC_kwDOSfQcDc8AAAABGqi6Pg"
changed_files:
- "src/state/GameState.ts"
allowed_paths:
- "src/state/GameState.ts"
- "src/state/index.ts"
- "tests/state/unit-taxonomy-types.test.ts"
violations: []
blockers: []
fix_delta: null
notes: >
5型全て SSOT §5 と逐語一致。runtime value(enum/const object)なし。
Allowed Paths 外変更なし。CI 全 pass。PR body に Closes #981 含む。
mergeStateStatus: CLEAN(branch protection required review 待ちのみ)。
自己 PR のため --approve 不可、--comment で判定記録。
判定コード差分は APPROVE 相当。merge 前の実質ブロッカーはコードではなく、PR がまだ draft である点です。 PR #988 は open / mergeable ですが 実装自体は、#981 の stage2 契約どおり 確認結果PR 差分は
TypeScript の CI / コメント状態初回レビューコメントでは CI job 単位でも 敵対的レビューで残すべき指摘1. draft のままなので merge_ready ではない実装は問題ありませんが、PR は draft です。merge する意思があるなら、CI 緑確認後に 2. #981 の AC4 検証コマンドはまだ危険#981 本文には AC4 として 過去コメントでも、禁止語検査は exit code 1 だけを「一致なし」として許容する形に修正すべき、と指摘されています。 PR #988 自体の差分には 推奨形: bash -lc 'set +e; rg -n "allies|commandBuffer" src/state; status=$?; test "$status" -eq 1'3. type-only なので preview URL を evidence 扱いしないPR comment には preview URL が出ていますが、コメント自体が「asset-level live check 未検証」と述べています。 この PR は type-only なので Pages preview は acceptance evidence ではありません。判断材料は 4. 型値集合の drift 検出は人間レビュー依存Issue #981 では 追加するなら runtime test ではなく、compile-only の型代入テストに限定してください。TypeScript の union / literal type は、既知の値集合を型レベルで固定する用途に適しています。(TypeScript) ただし今回の stage では必須ではありません。 関連 Issue / PR との整合#975 は「RTS/Z 指示 mode 前の unit taxonomy / NPC behavior の product SSOT 化」が目的で、8-stage follow-up の stage2 が「Faction / UnitRole / CommandIntent 型追加」です。 #978 はその SSOT を docs-only / research-only として merge 済みで、runtime 実装は後続 issue に deferred する方針でした。 #981 は stage2 として、5 型を 後続の #982 は stage3 command intent buffer で #981 に block され、#983 は stage4 deterministic scoring で #981/#982 に block されています。 #984 / #985 / #986 も taxonomy 型を前提にしているため、この PR の merge は後続 stage の前提条件として妥当です。 次に出す指示PR #988 の最終仕上げをしてください。
確認事項:
- head SHA `9e31e29256ebf5e5b8cbe6c895d7362cfcffb2e1` の最新 CI が全て success であることを確認する。
- `Check Japanese Content` の過去 failure は後続 success で解消済みとして扱う。
- 差分が `src/state/GameState.ts` の type-only export 追加のみであることを再確認する。
- `enum` / runtime const object / ally collection / command buffer / behavior runtime が追加されていないことを確認する。
- type-only PR のため Pages preview は acceptance evidence として扱わない。
修正が必要なら:
- #981 の AC4 VC を bare `rg -n "allies|commandBuffer" src/state` から、exit code 1 だけを「一致なし」として許容する fail-closed 形式へ修正する。
- PR が merge 対象なら draft を解除する。
完了条件:
- PR #988 を ready for review にする。
- PR コメントに「CI 緑、B1 解消、type-only のため runtime/Pages evidence N/A、#981 closes ready」と明記する。
- 人間承認が必要な merge 操作以外は停止しない。結論として、PR #988 はコードとしては通してよいです。merge 前に残すべき実務上の処理は、draft 解除と、#981 の AC4 検証コマンド負債を直すか少なくとも follow-up 化することです。 |
impl-review-loop 完了報告CI 緑・B1(PR body 日本語比率)解消済み・type-only のため runtime/Pages evidence N/A・#981 closes ready。
マージ判断を人間にお返しします。 |
概要
Issue #981(stage 2)の実装。
docs/product/features/unit-operations-and-npc-behavior.md§5 に定義された5型をsrc/state/GameState.tsにexport typeの literal union として追加する。Closes #981(本 PR は Issue #981 を解決します)
変更内容
src/state/GameState.tsに以下5型を追加した。値集合は SSOT §5 と逐語一致。enum/ runtime const object は一切追加していない。Faction(所属陣営):'player' | 'ally' | 'enemy' | 'neutral'UnitRole(行動役割):'ace_player' | 'ally_basic' | 'enemy_chaser' | 'objective' | 'neutral_obstacle'CommandIntent(コマンド意図):'none' | 'assist_player'NpcBehaviorState(NPC行動状態):'inactive' | 'acquire_target' | 'move_to_engage' | 'attack' | 'retreat' | 'destroyed'TargetingPolicy(照準方針):'focus_player' | 'assist_player_threat' | 'nearest_hostile' | 'ignore'src/state/index.tsは変更なし。既存のexport * from './GameState'により5型の再 export が成立するため変更不要。Allowed Paths 遵守
変更ファイルは
src/state/GameState.tsのみ。src/state/index.tsは変更なし(再 export 成立のため不要)。ally collection および command buffer は追加していない。検証結果
rg "export type Faction|..."→ 5件ヒットpnpm typecheck緑品質ゲート結果:
pnpm lintpnpm builduv run pytestモデルルーティングテストRuntime Verification Applicability(実行時検証適用判定)
型 alias の追加のみであり、runtime 挙動・プロセス起動・通信・I/O を伴わない。適用判定:
not_applicable。静的型チェック(pnpm typecheck)とpnpm testのみで検証完了。Safety Claim Matrix(安全性主張マトリクス)
本 PR は型定義の追加のみであり、runtime・認証・通信・権限・デプロイ・シークレット・Pages artifact を一切変更しない。該当項目なし。