Skip to content

実装: M6 current-main Ace Intervention causal baselineを取得する #2705

Open

Description

@squne121

Machine-Readable Contract

contract_schema_version: v1
issue_kind: implementation
parent_issue: "#2702"
goal_ref: "M6 HYP-001-ace-intervention の causal baseline evidence を exact current-main SHA に束縛して取得し、automation で検証可能な範囲(ally archetype / semi-autonomous behavior / command intent 上限 / causal evidence log / regression 有無 / canonical gates)を確認する"
change_kind: workflow
execution_kind: evidence_only
pr_required: false
dedupe_key: "m6-current-main-ace-intervention-causal-baseline:v1"

Parent Issue

#2702

(導入: M6 Ace Intervention 実装 parent tracker)

Parent Goal Ref

  • Goal: docs/product/playable-roadmap.md の M6 section と docs/product/game-thesis.md の HYP-001-ace-intervention を authority とし、M5 completion → M6 phase materialization → pre-landed M6 capability/spec reconciliation → current-main causal baseline → observed blocker only remediation → final HYP-001 integrated acceptance の順序で M6 を完了させる。
  • Desired Destination: current main 上で HYP-001-ace-intervention の causal baseline evidence が記録され、observed blocker(あれば)が conditional remediation child issue として起票され、最終的に HYP-001-ace-intervention の integrated acceptance が evidence-only child issue で PASS 判定される状態。

Current Validated Scope

  • 本 Issue は 実装: M5→M6 phase handoffのroadmap SSOT同期 #2703(M5→M6 phase handoff / milestone materialization)と 実装: M6 ally/NPC/assist_player feature specをcurrent mainへreconcileしimplementation authorityを確立する #2704(feature spec reconciliation)が完了した後にのみ実行する(Blocked By)。
  • current main には既に ally archetype(src/state/GameState.ts の createDefaultAllyState() / role: 'ally_basic')、semi-autonomous ally behavior(src/systems/AllyBehaviorSystem.ts の runAllyBehaviorSystem())、macro command intent 上限 1 種(CommandIntent = 'none' | 'assist_player')、deterministic causal evidence log(src/playtest/assistPlayerEventLog.ts)が実装済みであることを capability audit 済み(実ファイル確認済み)。
  • 既存 test(tests/systems/ally-behavior-system.test.ts、tests/systems/targeting-system.test.ts、tests/state/command-intent-buffer.test.ts)が存在する。
  • canonical quality/runtime gates(pnpm typecheck / pnpm lint / pnpm test(1939 tests)/ pnpm build)は全 PASS 確認済み(過去実行時点)。本 Issue では exact current-main SHA 上で再実行し再束縛する。
  • 本 Issue は repository diff / PR を作成しない(evidence-only)。

Remaining Parent Gaps

  • M6 の exact current-main SHA に束縛された causal baseline evidence が未取得。
  • HYP-001 のうち automation 検証可能な範囲(本 Issue の責務)と human 評価が必要な範囲(developer-self 3〜5 sortie playtest、後続 C5 final acceptance の責務)が明確に分離されていない。
  • baseline で observed blocker が出た場合の narrow remediation child(C4)が未起票(本 Issue は事前作成しない。blocker が実際に観測された場合のみ follow-up として提案する)。

Outcome

exact current-main SHA に束縛した状態で、M6 HYP-001-ace-intervention のうち automation で検証可能な causal baseline evidence(ally semi-autonomy、command intent 上限、mechanistic/combat-dynamics に分離された paired deterministic A/B causal evidence、player agency 非置換、M5 regression 有無、canonical quality/runtime gates PASS)を Issue コメントに記録し、developer-self playtest(human 評価)が必要な残余範囲(HYP-001 self-explanation)と明確に分離した上で、baseline 結果に応じて narrow remediation child(C4)の要否を判定できる状態にする。

Background

M6 parent tracker(#2702)の capability 監査により、以下が current main に pre-landed 済みであることを実ファイルで確認済み:

  • ally archetype: src/state/GameState.ts の createDefaultAllyState()、role: 'ally_basic'
  • semi-autonomous ally behavior: src/systems/AllyBehaviorSystem.ts の runAllyBehaviorSystem()
  • macro command intent 最大 1 種: CommandIntent = 'none' | 'assist_player'
  • deterministic causal evidence: src/playtest/assistPlayerEventLog.ts(command_use / command_noop / target_switch / local_threat_sample / ally_survival)
  • 既存 test: tests/systems/ally-behavior-system.test.ts、tests/systems/targeting-system.test.ts、tests/state/command-intent-buffer.test.ts
  • canonical quality/runtime gates: pnpm typecheck / pnpm lint / pnpm test(1939 tests)/ pnpm build 全 PASS 確認済み

未確認・genuine gap として残るのは HYP-001 developer-self 3〜5 sortie playtest(self-explanation の human 評価)であり、これは本 Issue(C3)ではなく後続 C5 final acceptance の責務である。本 Issue では automation 検証可能な範囲のみを扱う。

M5 precedent(#2599「検証: M5 Workstream 2 current-main baseline playable-slice acceptance」)の baseline execution contract 構造を踏襲し、exact SHA binding・evidence-only・PR 不要の運用を維持する。

In Scope

  1. 実装: M5→M6 phase handoffのroadmap SSOT同期 #2703 と 実装: M6 ally/NPC/assist_player feature specをcurrent mainへreconcileしimplementation authorityを確立する #2704 の完了(CLOSED)を確認してから実行を開始する。
  2. 実行開始時に GitHub live ref API から current-main の exact SHA を取得し、baseline evidence へ bind する(過去コメント時点の SHA を固定値として再利用しない)。
  3. assist command 有無での deterministic causal evidence を、同一 initial state・同一 player input 列・同一 tick 数で assist_player の有無のみを操作変数とする paired deterministic A/B run として収集する。収集結果は以下2種類に明示的に分離して記録する:
    • mechanistic delta(ally target/target switch/ally position・movement の変化): target_switch イベント等から収集。
    • combat/dynamics delta(enemy HP・player HP・local threat removal・relevant enemy count/state・sortie outcome 等、HYP-001 が要求する戦況変化): local_threat_sample(before/after)・ally_survival・protectedZoneStable 等の実装意味を repository evidence(src/playtest/assistPlayerEventLog.ts、src/systems/SortieSystem.ts の protectedZoneStable: result.outcome !== 'defeat' 実装等)から確認した上で、その実装意味に基づいて要約する。mechanistic delta のみを根拠に combat/dynamics causal PASS とは判定しない。paired run の結果、target/position は変わるが combat-state/outcome が変わらない、という結果も有効な baseline result として記録する(false-green 回避、C4 materialization の根拠になる)。
  4. ally が semi-autonomous であることを src/systems/AllyBehaviorSystem.ts の実装と tests/systems/ally-behavior-system.test.ts から確認する。
  5. command intent が最大 1 種類('assist_player' のみ、CommandIntent = 'none' | 'assist_player')であることを src/state/GameState.ts の型定義と tests/state/command-intent-buffer.test.ts から確認する。
  6. player control / combat agency を ally runtime が置換していないことを、設計(movement 命令なし、target scoring bias のみ)と tests/systems/targeting-system.test.ts から機械的に確認できる範囲で確認する。
  7. M5 progression / persistence / readability regression の有無を既存 unit/integration/E2E test 結果から確認する。
  8. canonical quality/runtime gates(pnpm typecheck / pnpm lint / pnpm test / pnpm build)を exact current-main SHA 上で実行し PASS を記録する(実行時の実数テスト件数を記録する)。
  9. HYP-001 のうち automation で検証可能な部分(上記 2〜8)と、人間評価が必要な部分(developer-self 3〜5 sortie self-explanation)を明確に分離して Issue コメントにレポートする。
  10. baseline 実行の結果、concrete blocker が観測された場合のみ、その責務単位で narrow remediation child(C4)を follow-up として提案する(本 Issue 自体は C4 を事前作成しない)。

Out of Scope

Runtime Verification Applicability

decision: immediate
reason: >-
  本 child は M6 parent tracker(#2702)から HYP-001-ace-intervention の
  automation 検証可能な causal baseline evidence 取得を委譲された execution
  owner であるため。
applicable_acs: [AC2, AC3, AC4, AC5, AC6, AC7]
execution_environment: >-
  既存 unit/integration test(vitest)と canonical quality/runtime gates
  (pnpm typecheck/lint/test/build)を exact current-main SHA 上で実行する。
  新しい harness / validator は追加しない。
skip_conditions: >-
  #2703 または #2704 が完了していない場合は本 Issue の実行を開始しない
  (blocked のまま維持し、PASS 扱いにしない)。
fallback_policy: >-
  stale SHA、未 fetch の origin/main、推測値は evidence として採用せず、
  fail または blocked として disposition する。
artifact_requirements: >-
  exact current-main SHA、各 automation 検証項目の individual record、
  canonical gate 実行結果(テスト件数含む)、automation 検証範囲と
  human 評価範囲の分離結果を Issue comment に記録する。repository
  artifact、diff、PR は作成しない。

Acceptance Criteria

  • AC1: 実装: M5→M6 phase handoffのroadmap SSOT同期 #2703 と 実装: M6 ally/NPC/assist_player feature specをcurrent mainへreconcileしimplementation authorityを確立する #2704 が CLOSED であることを確認してから実行を開始したことが記録されている。
  • AC2: GitHub live ref から取得した実行開始時点の exact current-main SHA が baseline evidence に記録されている。
  • AC3: assist command 有無での paired deterministic A/B run(同一 initial state・同一 player input 列・同一 tick 数、唯一の操作変数が assist_player の有無)が実施され、mechanistic delta(target switch / ally position)と combat/dynamics delta(enemy HP・player HP・local threat removal・sortie outcome 等)が明示的に分離して記録されている。local_threat_sample・ally_survival・protectedZoneStable の現在の実装意味が repository evidence から確認され、その実装意味に基づいて combat/dynamics delta が判定されている(名前だけで HYP-001 causal evidence と扱っていない)。target/position が変わるが combat-state/outcome が変わらないという結果が観測された場合も、false-green にせず有効な baseline result として記録されている。
  • AC4: ally が semi-autonomous であることが AllyBehaviorSystem の実装・test から確認され記録されている。
  • AC5: command intent が 'assist_player' の 1 種類のみであることが CommandIntent 型定義・test から確認され記録されている。
  • AC6: player control / combat agency を ally runtime が置換していないことが、設計(movement 命令なし、target scoring bias のみ)と targeting-system.test.ts から確認され記録されている。
  • AC7: M5 progression/persistence/readability regression の有無が既存 test 結果から確認され記録されている。
  • AC8: pnpm typecheck / pnpm lint / pnpm test / pnpm build が exact current-main SHA 上で実行され、それぞれの exit code と pnpm test の実行時テスト件数が記録されている。
  • AC9: HYP-001 のうち automation 検証済み範囲(AC2〜AC8)と、human 評価が必要な残余範囲(developer-self 3〜5 sortie self-explanation、C5 責務)が明確に分離されて Issue コメントに記録されている。
  • AC10: baseline 実行結果に concrete blocker がある場合は narrow remediation child(C4)候補が提案され 導入: M6 Ace Intervention 実装 parent tracker #2702 を parent 参照として明記されている。blocker がない場合は no observed M6 blocker と明記されている。

Verification Commands

# AC1
$ gh issue view 2703 --repo squne121/loop-protocol --json state -q .state
# AC1
$ gh issue view 2704 --repo squne121/loop-protocol --json state -q .state

# AC2
$ gh api repos/squne121/loop-protocol/git/refs/heads/main --jq .object.sha
# AC2
$ git rev-parse HEAD

# AC3
$ test -f src/playtest/assistPlayerEventLog.ts

# AC4
$ test -f tests/systems/ally-behavior-system.test.ts

# AC5
$ test -f tests/state/command-intent-buffer.test.ts

# AC6
$ test -f tests/systems/targeting-system.test.ts

# AC7
# AC8
# AC9
# AC10
$ pnpm typecheck
# AC7
# AC8
$ pnpm lint
# AC7
# AC8
$ pnpm test
# AC7
# AC8
$ pnpm build

AC2 は2つのコマンドの出力が一致すること(HEAD == live_main_sha)を PASS 条件とする。実行開始時に取得した GitHub live main SHA と、実行時の git rev-parse HEAD が一致しない場合、stale worktree/branch として扱い baseline evidence を記録しない。

Allowed Paths

  • none(evidence-only。repository diff は不要なため PR を作成しない)

Stop Conditions

  • Allowed Paths 外の変更が必要と判明した場合
  • In Scope の固定契約(キー集合・スキーマ・型定義)の変更が必要になった場合
  • 新規 Issue の起票が必要と判断した場合(スコープ分割が発生する場合)。ただし、baseline で実際に concrete blocker が観測された場合に限り、narrow remediation child(C4)候補の提案は例外として許可する(この Issue 自体が C4 を事前作成することはない)。
  • 後続 Phase / 別スコープへの波及が判明した場合
  • nested SubAgent delegation が必要になった場合
  • 外部サービス利用・権限昇格・既存テスト大規模改変が必要になった場合

Required Skills

なし

Required Design References

  • docs/product/game-thesis.md#HYP-001-ace-intervention
  • docs/product/playable-roadmap.md
  • docs/dev/runtime-verification-policy.md

Scope Delta(任意)

N/A

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent/implementerenhancementphase/implementation

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions