Skip to content

実装: playtest-log への AI/自動化プレイテスト用メタデータの追加 #417

Closed

Description

@squne121

Machine-Readable Contract

contract_schema_version: v1
issue_kind: implementation
parent_issue: none
goal_ref: "playtest-log への AI/自動化メタデータ追加による定量観測の効率化"
change_kind: docs

Parent Issue

none

Parent Goal Ref

  • Goal: AI駆動開発において定量的なプレイテスト観測を自動化・スケール可能にする
  • Desired Destination: docs/product/playtest-log.md が AI/自動化プレイテストの特性(再現性・定量メトリクス)を正確に記録できる構造になっている

Product Spec Context

  • diff_rationale: playtest-log テンプレートに AI/自動化実行時の定量メトリクスと再現性データを追加し、AI エージェントによるプレイテスト結果を構造化して記録可能にする。
  • affected_sections: docs/product/playtest-log.md の YAML テンプレート部分。
  • changed_requirement_id: N/A (既存要件の拡張)

Current Validated Scope

  • docs/product/playtest-log.md への automation ブロック追加および既存フィールドとの整合性確保
  • AI/自動化結果の UX 証拠禁止ポリシーの明記

Remaining Parent Gaps

  • なし

Outcome

docs/product/playtest-log.md の既存 session_mode を正本として維持しつつ、AI/自動化用の automation ブロックが構造化されて追加された状態。

In Scope

  • docs/product/playtest-log.md の YAML template に任意 automation ブロックを追加する
  • 既存 session_mode / validation_method enum は維持し、execution_mode は新設しない
  • automation.metrics は単位・分母が分かる machine-readable fields とする
  • automation.artifacts に metrics JSON / trace / replay / input script 参照を置けるようにする
  • AI/自動化結果は UX・感情証拠ではないことを log 側にも明記する
  • UX 影響がある場合は human_review_required: true を記録する

Out of Scope

  • Playwright / Vitest Browser Mode の導入
  • CI artifact upload workflow の実装
  • 自動プレイテスト runner の実装
  • docs/product/playtest-protocol.md の mode 定義変更
  • 実セッションログの追加

Acceptance Criteria

  • AC1: 既存 human playtest 記録キーを削除・改名しない
  • AC2: execution_mode を追加せず、既存 session_mode を正本として使う
  • AC3: automation.metrics に runs, success_count, failure_count, success_rate, duration_ms_p50, input_count_total, collision_count_total 等の単位付き項目がある
  • AC4: automation.random_seed, automation.reproduction_command, automation.artifacts.metrics_json, automation.artifacts.trace_ref が記録できる
  • AC5: AC5: ai_result_is_ux_evidence: false または同等の明記がある
  • AC6: AC6: human_review_required の意味が protocol の人間確認ゲートと一致している

Verification Commands

# AC1
# preflight-scope: pr_review_only
$ grep -q "session_mode" docs/product/playtest-log.md

# AC2
# preflight-scope: pr_review_only
$ grep -q "session_mode" docs/product/playtest-log.md

# AC3
$ grep -q "automation:" docs/product/playtest-log.md

# AC4
# preflight-scope: pr_review_only
$ grep -q "automation:" docs/product/playtest-log.md

# AC5
$ grep -q "ai_result_is_ux_evidence: false" docs/product/playtest-log.md

# AC6
$ grep -q "human_review_required:" docs/product/playtest-log.md

Runtime Verification Applicability

decision: not_applicable

Allowed Paths

  • docs/product/playtest-log.md

Stop Conditions

  • Allowed Paths 外の変更が必要と判明した場合
  • In Scope の固定契約(キー集合・スキーマ・型定義)の変更が必要になった場合
  • 新規 Issue の起票が必要と判断した場合(スコープ分割が発生する場合)
  • 後続 Phase / 別スコープへの波及が判明した場合
  • nested SubAgent delegation が必要になった場合
  • 外部サービス利用・権限昇格・既存テスト大規模改変が必要になった場合

Required Skills

  • YAML schema design
  • Playtest protocol knowledge

Source

Activity

  1. added
    triage-required
    on May 26, 2026
  2. squne121 commented on May 26, 2026

    @squne121
    OwnerAuthor

    Verdict: BLOCK / 作り直し推奨

    #417 の目的は妥当です。ただし、現行 main の docs/product/playtest-log.md には既に session_mode: human_internal | ai_simulation | browser_automation、tester_profile: developer | target_player_layer | ai_agent、validation_method: human_internal | ai_simulation | browser_automation | manual_reproduction が存在します。#417 の execution_mode: human_developer | ai_agent | scripted_automation をそのまま追加すると、同じ概念を別 enum で二重管理する破壊的な設計になります。([GitHub]1)

    #417 は「AI結果を感情的UX証拠として扱わない」「protocol と log の責務分離を維持する」ことを AC にしていますが、現行 playtest-protocol.md は既に AI/自動化の用途、禁止主張、人間確認ゲートを定義しています。つまり #417 は protocol 側で既に決まった判断規則を log 側へどう記録するか に絞るべきで、protocol の再定義や mode enum の新設に踏み込むべきではありません。([GitHub]2) ([GitHub]3)

    Blocking findings

    1. execution_mode は追加不可。既存 session_mode に統合すべき

    #417 は execution_mode を任意キーとして追加する想定ですが、現行 log schema は session 単位で session_mode を既に持っています。human_developer と human_internal、ai_agent と ai_simulation、scripted_automation と browser_automation が意味的に競合します。これは後続のログ集計・検索・検証で false fork を作ります。([GitHub]2) ([GitHub]1)

    修正要求: #417 の In Scope は「execution_mode の追加」ではなく、既存 session_mode の正本化と、AI/自動化時だけ使う automation ブロック追加に変更してください。

    session_mode: "human_internal | ai_simulation | browser_automation"
    
    automation:
      agent_profile: ""
      random_seed: null
      reproduction_command: ""
      metrics:
        runs: 0
        success_rate: null
        death_rate: null
        duration_ms: null
        input_count: null
        collision_count: null
      artifacts:
        metrics_json: ""
        trace_ref: ""
        replay_ref: ""
      human_review_required: false
      ai_result_is_ux_evidence: false

    2. automation_metrics が自由記述すぎる

    #417 の automation_metrics: 成功率、死亡率、所要時間、入力回数、衝突回数など は粒度・単位・分母が未定義です。成功率の分母が runs なのか tasks なのか、死亡率が sortie 単位なのか run 単位なのか、所要時間が wall-clock なのか simulation time なのか不明です。これでは定量ログとして比較不能です。([GitHub]2)

    修正要求: 少なくとも runs, success_count, failure_count, success_rate, death_count, death_rate, duration_ms_p50, duration_ms_p95, input_count_total, collision_count_total のように、単位と集計粒度を固定してください。

    3. reproduction_command だけでは再現性が足りない

    自動化プレイテストでは random_seed と reproduction_command だけでは不十分です。現行リポジトリは Vite + TypeScript + Canvas で、README も Canvas 戦闘領域・DOM HUD・固定タイムステップ・Vitest CI を前提にしています。再現には commit、依存関係、browser/headless 条件、入力スクリプト、trace/replay/metrics artifact の参照が必要です。([GitHub]4)

    Playwright は JSON reporter を使って構造化されたテスト結果を出力でき、trace は CI で失敗時・retry 時の trace.zip として保存できます。Vitest も JSON reporter と outputFile によるファイル出力をサポートしています。つまり log にはコマンド文字列だけでなく、機械可読 result と trace artifact への参照 を置く設計にすべきです。([Playwright]5) ([Playwright]6) ([Vitest]7)

    4. 現行依存関係では Browser automation 実行基盤が未導入

    package.json には Vite / Vitest / TypeScript などはありますが、@playwright/test や @vitest/browser-playwright は見当たりません。Vitest Browser Mode はブラウザ上でテストを実行できますが、CI では Playwright または WebdriverIO provider が必要です。したがって #417 は ログテンプレート改善 issue としては成立しますが、実際の browser_automation 実装完了を主張してはいけません。([GitHub]8) ([Vitest]9)

    修正要求: #417 の Out of Scope に「Playwright / Vitest Browser Mode 導入、CI artifact upload、実プレイテスト runner 実装」を明記してください。必要なら別 Issue 化。

    5. AI/自動化結果の UX 証拠禁止が log schema に落ちていない

    現行 protocol は ai_simulation を「仕組み・バランス・探索量の検査」とし、「楽しさ・感情の代替」を禁止しています。また UX や設計仮説に影響する場合は human playtest で確認してから分類する、としています。#417 はこれを log 側にも反映する必要があります。([GitHub]3)

    修正要求: human_review_required だけでなく、ux_evidence_allowed: false または ai_result_is_ux_evidence: false を固定値として追加してください。AI 実行時の emotional_signal は not_applicable にするか、human-only field と明記すべきです。

    追加すべき Acceptance Criteria

    #417 はこのままでは AC が弱いです。最低限、次を追加してください。

    ## Acceptance Criteria
    
    - `execution_mode` は追加しない。既存 `session_mode` を正本として維持する。
    - AI/自動化固有情報は `automation` ブロック配下に追加する。
    - 既存 human playtest fields (`observed_behavior`, `player_quote_redacted`, `emotional_signal`, `developer_interpretation`, `player_suggested_fix`) を削除・改名しない。
    - `automation.metrics` は単位と分母を明示した machine-readable fields とする。
    - `reproduction_command` に加え、`random_seed`, `input_script_ref`, `artifacts.metrics_json`, `artifacts.trace_ref` を記録できる。
    - `ai_result_is_ux_evidence: false` を schema または説明文に明記する。
    - AI/自動化で UX・面白さ・違和感に関わる疑義が出た場合は `human_review_required: true` とし、human playtest 後にのみ `design hypothesis invalidated` を確定できる。
    - protocol 側の mode 定義・人間確認ゲートを再定義しない。log 側は記録形式だけを扱う。

    起票し直すなら本文案

    ## Summary
    
    `docs/product/playtest-log.md` の既存 `session_mode` を正本として維持しつつ、`ai_simulation` / `browser_automation` 実行時に必要な再現性・定量メトリクス・artifact 参照を記録できる `automation` ブロックを追加する。
    
    ## In Scope
    
    - `docs/product/playtest-log.md` の YAML template に任意 `automation` ブロックを追加する
    - 既存 `session_mode` / `validation_method` enum は維持し、`execution_mode` は新設しない
    - `automation.metrics` は単位・分母が分かる machine-readable fields とする
    - `automation.artifacts` に metrics JSON / trace / replay / input script 参照を置けるようにする
    - AI/自動化結果は UX・感情証拠ではないことを log 側にも明記する
    - UX 影響がある場合は `human_review_required: true` を記録する
    
    ## Out of Scope
    
    - Playwright / Vitest Browser Mode の導入
    - CI artifact upload workflow の実装
    - 自動プレイテスト runner の実装
    - `docs/product/playtest-protocol.md` の mode 定義変更
    - 実セッションログの追加
    
    ## Acceptance Criteria
    
    - 既存 human playtest 記録キーを削除・改名しない
    - `execution_mode` を追加せず、既存 `session_mode` を正本として使う
    - `automation.metrics` に `runs`, `success_count`, `failure_count`, `success_rate`, `duration_ms_p50`, `input_count_total`, `collision_count_total` 等の単位付き項目がある
    - `automation.random_seed`, `automation.reproduction_command`, `automation.artifacts.metrics_json`, `automation.artifacts.trace_ref` が記録できる
    - `ai_result_is_ux_evidence: false` または同等の明記がある
    - `human_review_required` の意味が protocol の人間確認ゲートと一致している

    最終判断

    #417 は close ではなく rewrite が適切です。目的は正しいが、現在の In Scope は既存 schema と衝突します。特に execution_mode の追加は拒否し、既存 session_mode を正本にした automation ブロック追加へ縮退してください。#417 にはまだ Development branch / PR が紐づいていないため、実装前に本文を修正するのが最小コストです。([GitHub]2)

  3. added
    enhancement
    phase/implementation
    and removed
    triage-required
    on May 26, 2026
  4. squne121 commented on May 26, 2026

    @squne121
    OwnerAuthor

    Refinement Loop Completed

    The issue has been refined based on the anchor comment and project standards.

    Key Changes:

    • Integrated Feedback: Replaced execution_mode proposal with a structured automation block in existing session_mode context.
    • Clarified Metrics: Defined machine-readable fields with units for automation.metrics.
    • Improved Reproducibility: Added artifacts and random_seed fields.
    • Policy Alignment: Explicitly stated ai_result_is_ux_evidence: false.
    • Structural Quality: Added all mandatory sections (Outcome, Verification Commands, Allowed Paths, etc.) and passed all 11 contract checks (C1-C11).

    This issue is now ready for implementation.

  5. changed the title [-]改善: playtest-log に AI/自動化プレイテスト用メタデータを追加する[/-] [+]実装: playtest-log への AI/自動化プレイテスト用メタデータの追加[/+] on May 26, 2026
  6. squne121 commented on May 26, 2026

    @squne121
    OwnerAuthor

    Contract Snapshot (2026-05-26T22:31:00Z)

    CONTRACT_REVIEW_RESULT_V1:
      status: go
      generated_at: 2026-05-26T22:31:00Z
      generated_by: issue-contract-review
      issue_url: https://github.com/squne121/loop-protocol/issues/417
      checks:
        template_compliance: pass
        state_label: ok
        allowed_paths_present: pass
        vc_present: pass
        stop_conditions_complete: pass
        vc_preflight:
          passed: true
          vc_failed_as_expected: 3
          vc_passed_unexpectedly: 0
          vc_unrunnable: 0
          vc_expected_pass: 0
          vc_skipped: 3
          classifications: []
        ac_verifiability: pass
        product_spec_check:
          applicability: applicable
          decision: pass
        worktree_branch_collision: clear
      next_action: implement_issue
    • Outcome: docs/product/playtest-log.md の既存 session_mode を正本として維持しつつ、AI/自動化用の automation ブロックが構造化されて追加された状態。
    • Acceptance Criteria: AC1-AC6
    • Verification Commands: grep checks in fenced bash blocks
    • Allowed Paths: docs/product/playtest-log.md
    • Worktree: .claude/worktrees/issue-417-playtest-log-ai-automation-metadata
    • Branch: worktree-issue-417-playtest-log-ai-automation-metadata
    • VC preflight: baseline fail = 3, 想定外 pass = 0, 実行不可 = 0, skipped = 3
  7. squne121 commented on May 27, 2026

    @squne121
    OwnerAuthor

    Resolved by PR #418. Post-merge cleanup complete. Follow-up issues #419 and #420 have been created.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementphase/implementation

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions