Skip to content

実装: docs/adr: 人間プレイテスト動画証跡は GitHub attachment を正本とし ffmpeg フレーム抽出でエージェントレビューする #576

Closed

Description

@squne121

Machine-Readable Contract

contract_schema_version: v1
issue_kind: implementation
parent_issue: 543
goal_ref: "人間プレイテスト動画証跡の管理・レビュー方針を ADR として SSOT 化する"
change_kind: docs

Parent Issue

#543

Parent Goal Ref

Current Validated Scope(確定スコープ)

Remaining Parent Gaps(未解決の親課題)

Background

PR #570 の人間プレイテスト証跡で、動画ファイルが docs/playtest/ にローカル配置されており GitHub 上でレビュー不能だった。その後 Issue #543 コメントに添付して GitHub-hosted URL を取得することで解決した。また ClaudeCode は動画の意味認識を自動 gate に使うのは不安定であり、ffmpeg でキーフレームを切り出し画像として扱う動線が望ましいと判断した。

この判断を今後のプレイテストにも適用するため、ADR として記録する。

In Scope(対象範囲)

Out of Scope(対象外)

Outcome

docs/adr/0004-video-evidence-policy.md が存在し、以下が記録されている:

Acceptance Criteria

  • AC1: docs/adr/0004-video-evidence-policy.md が存在する
  • AC2: ADR に「GitHub attachment URL + SHA256 が reviewable video evidence の必須要素」が明記されている
  • AC3: ADR に「local-only path は temporary provenance であり reviewability を満たさない」が明記されている
  • AC4: ADR に「動画意味認識を自動 gate に使わない」が明記されている
  • AC5: ADR に ffmpeg frame extraction contract が記録されている(人間指定 timestamp、tolerance window、コマンドテンプレート、出力 frame path/sha256、observed result、自律スキャン禁止)
  • AC6: ADR に evidence schema が記録されている(artifact_url, artifact_sha256, artifact_bytes, mime_type, codec_profile, tested_commit, manual_operator, executed_at, scenario, human_confirmed_claims)
  • AC7: ADR に 実装: docs/playtest: manual-playtest-runbook.md を日本語化し、動画証跡提出フローを追加する #577(runbook 更新)と 実装: GitHub Pages/PR Preview に人間プレイテスト証跡エクスポートパネルを追加する #571(metadata schema 整合)への cross-reference が明記されている
  • AC8: pnpm typecheck && pnpm lint && pnpm test && pnpm build が通る

Verification Commands

# AC1
$ test -f docs/adr/0004-video-evidence-policy.md
# AC2
$ rg "user-attachments|github.*attachment" docs/adr/0004-video-evidence-policy.md
$ rg "sha256" docs/adr/0004-video-evidence-policy.md
# AC3
$ rg "local.only\|local.*path\|local path" docs/adr/0004-video-evidence-policy.md
# AC4
$ rg "semantic.*recognition\|video.*gate\|自動.*gate\|意味認識" docs/adr/0004-video-evidence-policy.md
# AC5
$ rg "ffmpeg" docs/adr/0004-video-evidence-policy.md
$ rg "tolerance\|frames:v\|-ss" docs/adr/0004-video-evidence-policy.md
# AC6
$ rg "artifact_url\|artifact_sha256\|artifact_bytes\|mime_type\|codec_profile\|manual_operator\|human_confirmed" docs/adr/0004-video-evidence-policy.md
# AC7
$ rg "#577\|#571" docs/adr/0004-video-evidence-policy.md
# AC8
$ pnpm typecheck
$ pnpm lint
$ pnpm test
$ pnpm build

Allowed Paths

  • docs/adr/0004-video-evidence-policy.md

Stop Conditions

  • Allowed Paths 外の変更が必要と判明した場合
  • In Scope の固定契約(キー集合・スキーマ・型定義)の変更が必要になった場合
  • 新規 Issue の起票が必要と判断した場合(スコープ分割が発生する場合)
  • 後続 Phase / 別スコープへの波及が判明した場合
  • nested SubAgent delegation が必要になった場合
  • 外部サービス利用・権限昇格・既存テスト大規模改変が必要になった場合
  • ADR 番号が既存ファイルと衝突する場合は停止して人間に確認
  • Evidence schema の key が 実装: GitHub Pages/PR Preview に人間プレイテスト証跡エクスポートパネルを追加する #571 collector 出力と競合する場合は停止

Runtime Verification Applicability

  • decision: not_applicable
  • reason: docs-only 変更のため

Required Skills

  • docs 作成

Notes

  • ADR 番号は docs/adr/ 配下の確認で 0001〜0003 が存在するため 0004 を使用
  • docs/adr/0003-schema-catalog-adoption.md が存在することを実装前に確認すること
  • 現行 manual-playtest-runbook.md は動画保存先として docs/playtest/ も許容しているが、この ADR の方針と一時的に不整合がある。この不整合は 実装: docs/playtest: manual-playtest-runbook.md を日本語化し、動画証跡提出フローを追加する #577 が解消する
  • 公開 repo の attachment は認証不要でアクセス可能。機密性のあるプレイテスト映像は添付しないこと
  • GitHub の動画 upload 上限はプランによって異なる(free: 10MB, paid: 100MB)。project policy として ≤10MB 圧縮を採用するが、これは GitHub の制限ではなく project の運用方針

Activity

  1. added
    documentation
    on Jun 2, 2026
  2. squne121 commented on Jun 2, 2026

    @squne121
    OwnerAuthor

    判定: REQUEST_CHANGES

    #576 の方向性は妥当です。ただし、現状の Issue 契約のまま実装すると ADR と runbook、現行 repo 状態、GitHub attachment の実際の性質がズレたまま固定化される 可能性があります。実装前に Issue 本文を修正すべきです。

    #576 は #543 / PR #570 の「ローカル動画だけでは第三者レビュー不能」という実害から出た ADR です。PR #570 では実際に local mp4 / sha256 はあっても、GitHub 上で取得できる artifact URL がなく、reviewable evidence として弱いことが blocker になっていました。([GitHub]1) GitHub 公式も Issue / PR コメント添付をサポートし、添付時に anonymized URL が comment text に入ると説明しています。公開 repo の添付は認証なしでアクセス可能です。([GitHub Docs]2)

    Blocking findings

    1. ADR 番号の前提が current main と矛盾している

    #576 の Notes は「現時点で 0001〜0003 が存在するため 0004 を使用」としていますが、私が確認できた main/docs/adr の listing では 0001-architecture-baseline.md、0002-sdd-tool-adoption.md、TEMPLATE.md しか見えていません。([GitHub]3)

    これは単なる命名の好みではなく、ADR 連番・履歴管理の信頼性に関わります。0003 が別 PR 予定なら #576 は Depends on を明示すべきです。存在しないなら 0003-video-evidence-policy.md にするか、なぜ 0004 を予約するのかを ADR registry 的に明記すべきです。

    修正要求:
    docs/adr/ の現状を再確認し、Issue の Allowed Paths / Outcome / Verification Commands を一致させる。


    2. Desired Destination と Allowed Paths / AC が矛盾している

    #576 の Desired Destination は「ADR が存在し、manual-playtest-runbook.md からも参照される」としていますが、Allowed Paths は docs/adr/0004-video-evidence-policy.md のみです。AC も runbook 参照を検証していません。([GitHub]3)

    一方、#577 は runbook 日本語化と動画証跡提出フロー追加の Issue で、Stop Conditions に「動画証跡 ADR が未策定なら #576 完了を待つ」とあります。([GitHub]4) つまり #576 と #577 の責務分担は本来「#576 = 方針 ADR」「#577 = runbook 実装」のはずです。

    修正要求:
    どちらかに寄せるべきです。

    option_a_preferred:
      issue_576_scope: ADR only
      change:
        - Desired Destination から manual-playtest-runbook.md 参照完了を外す
        - Notes に "#577 が operational runbook に反映する" と明記
    option_b:
      issue_576_scope: ADR + runbook reference
      change:
        - Allowed Paths に docs/playtest/manual-playtest-runbook.md を追加
        - AC に "runbook links to ADR" を追加

    私は option_a を推奨します。#577 が既に runbook 側を持っているためです。


    3. 「GitHub attachment を正本」と言い切るには、整合性・再取得・削除/公開範囲の扱いが弱い

    GitHub attachment はレビュー可能な配布先として妥当です。ただし、ADR の語彙として「正本」とするなら、URL だけでは不足です。GitHub 公式が保証しているのは、添付できること、URL が comment text に入ること、public/private のアクセス範囲、サイズ・形式制限です。内容の不変性や長期保存 SLA までは #576 内で補う必要があります。([GitHub Docs]2)

    #576 は artifact_sha256 を入れている点はよいですが、AC は rg "github.*attachment|user-attachments" と rg "ffmpeg" 程度で、実際に「URL が取得可能」「取得した bytes の SHA256 が一致」「どの commit / scenario の証跡か一意に追える」ことを検証していません。([GitHub]3)

    修正要求: ADR の Decision をこう弱めずに強化する。

    artifact_policy:
      canonical_record:
        - artifact_url
        - artifact_sha256
        - artifact_bytes
        - mime_type
        - codec_profile: "H.264 recommended for mp4"
        - tested_commit
        - manual_operator
        - executed_at
        - scenario
        - human_confirmed_claims
      integrity_rule:
        - GitHub attachment URL is the reviewable artifact locator.
        - SHA256 is the content identity.
        - Local path is provenance only and never sufficient.
      access_rule:
        - Public repo attachments are public; do not attach private/sensitive playtest footage.

    GitHub 公式も video codec は browser-specific で、互換性上 H.264 推奨としています。ADR に .mp4 H.264 推奨を入れるべきです。([GitHub Docs]2)


    4. ≤10MB が GitHub plan 依存の仕様を project policy と混同している

    #576 は「人間プレイテスト動画 ≤10MB は GitHub Issue または PR comment への添付を標準」としています。これは実運用上は妥当ですが、GitHub の仕様としては free plan の動画添付が 10MB、paid plan は 100MB です。([GitHub Docs]2)

    Project policy として「この repo では 10MB 以下に圧縮する」と決めるなら問題ありません。しかし ADR には「GitHub 制限だから 10MB」とだけ書くと、paid plan や将来変更時に誤読されます。

    修正要求:

    Project policy:
    - Human playtest videos SHOULD be compressed to <=10MB for predictable GitHub comment upload.
    - GitHub's actual video upload limit depends on the repository owner plan.
    - If the artifact exceeds the project limit, do not commit it to Git; use an explicitly approved alternative such as Actions artifact, Release asset, or Git LFS-backed storage.

    GitHub は通常 Git repository に 50MiB 超ファイルを追加すると警告し、100MiB 超は block します。動画を repository に入れない判断は正しいです。([GitHub Docs]5)


    5. ffmpeg フレーム抽出の仕様が AC として弱すぎる

    #576 は「人間が指定したタイムスタンプから ffmpeg でフレームを抽出し、静止画として確認する」と書いており、方向性はよいです。([GitHub]3) PR #570 の議論でも、動画そのものを AI が意味認識するのではなく、人間指定 timestamp → ffmpeg 抽出 frame → 画像証跡にする流れが推奨されていました。([GitHub]1)

    しかし AC3 は rg "ffmpeg" docs/adr/ だけです。これでは「ffmpeg と書いてあるだけ」の ADR が通ります。FFmpeg は動画から画像フレームを抽出でき、-ss や -frames:v と組み合わせて特定時刻・限定枚数の抽出が可能です。([FFmpeg]6)

    修正要求: ADR に最低限この operational contract を入れる。

    frame_extraction_contract:
      required_input:
        - video_url
        - video_sha256
        - scenario
        - timestamp
        - tolerance_seconds: 0.5
        - expected_observation
      extraction:
        command_template: >
          ffmpeg -ss {timestamp} -i {video_file} -frames:v 1 {scenario}-{frame_id}.png
      required_output:
        - frame_path_or_url
        - frame_sha256
        - observed_result
      prohibition:
        - Agent must not scan the whole video and infer acceptance autonomously.
        - Agent must not use video semantic recognition as a gate.

    6. 現行 runbook と #576 の方針が衝突している

    現行 manual-playtest-runbook.md は、証跡の保存先として docs/playtest/ に追加するか、Issue/PR comment に添付すると書いています。([GitHub]7) #576 は「動画コミットは原則しない」「local path のみは reviewable evidence とみなさない」とする方針です。([GitHub]3)

    この衝突は #577 で解消予定に見えますが、#576 の ADR には「current runbook is superseded; #577 updates the runbook」と明記すべきです。そうしないと、ADR と runbook の一時的不整合が残ります。


    7. #571 との schema 整合が未定義

    #571 は manual playtest の環境メタデータを自動採取して YAML 化する Issue で、executed_at、tested_commit、Chrome full version、viewport、device_pixel_ratio、OS などを出力対象にしています。([GitHub]8) #576 の動画証跡 schema はこれと連携すべきです。

    修正要求: ADR に「環境メタデータは #571 の collector 出力 schema と同じ key を使う」と明記する。これにより、runbook、collector、ADR、playtest docs の field drift を避けられます。


    修正後の #576 最小パッチ案

    ## Scope Clarification
    
    This Issue defines ADR-level policy only.
    Operational runbook updates are handled by #577.
    Environment metadata collection schema is aligned with #571.
    
    ## Outcome
    
    `docs/adr/0003-video-evidence-policy.md` exists, unless `docs/adr/0003-*`
    already exists on the implementation branch. If 0003 is already occupied,
    use the next available ADR number and update this Issue before implementation.
    
    The ADR records:
    - GitHub comment attachment URL is the reviewable artifact locator
    - SHA256 is the content identity
    - Local-only video path is not reviewable evidence
    - Video files are audit artifacts, not machine gates
    - Agent review uses human-provided timestamps and ffmpeg-extracted frames
    - Structured YAML/Markdown + automated tests remain the primary machine gates
    - Runbook implementation is delegated to #577
    - Environment metadata schema aligns with #571
    
    ## Acceptance Criteria
    
    - AC1: A new ADR exists under `docs/adr/` using the next valid ADR number.
    - AC2: ADR states that GitHub attachment URL + SHA256 are required for reviewable video evidence.
    - AC3: ADR states that local-only paths are temporary provenance and do not satisfy reviewability.
    - AC4: ADR prohibits using video semantic recognition as an automated gate.
    - AC5: ADR defines the frame extraction contract:
      - human-provided timestamp
      - tolerance window
      - ffmpeg command template
      - extracted frame path/url
      - frame sha256
      - observed result
    - AC6: ADR defines the evidence schema fields:
      - artifact_url
      - artifact_sha256
      - artifact_bytes
      - mime_type
      - codec/profile when known
      - tested_commit
      - manual_operator
      - executed_at
      - scenario
      - confirmed claims
    - AC7: ADR explicitly cross-references #577 for runbook update and #571 for metadata collection schema.
    - AC8: `pnpm typecheck && pnpm lint && pnpm test && pnpm build` pass, or CI equivalent is linked.
    
    ## Allowed Paths
    
    - `docs/adr/<next-valid-number>-video-evidence-policy.md`
    
    ## Stop Conditions
    
    - ADR numbering is ambiguous or conflicts with current `docs/adr/`.
    - Implementing runbook changes becomes necessary; defer to #577 instead.
    - Evidence schema conflicts with #571 collector fields.

    結論

    #576 は起票意図としては正しいです。PR #570 の実害に対する ADR 化として価値があります。ただし、現状のまま実装すると 「GitHub attachment URL を貼れば正本」程度の弱い ADR になり、将来また artifact reviewability / schema drift / runbook conflict が再発します。

    実装前に最低限直すべきなのは、ADR 番号、runbook との責務分離、GitHub attachment の integrity model、ffmpeg frame extraction contract、#571 metadata schema との整合です。

  3. changed the title [-]docs/adr: 人間プレイテスト動画証跡は GitHub attachment を正本とし ffmpeg フレーム抽出でエージェントレビューする[/-] [+]実装: docs/adr: 人間プレイテスト動画証跡は GitHub attachment を正本とし ffmpeg フレーム抽出でエージェントレビューする[/+] on Jun 3, 2026
  4. squne121 commented on Jun 3, 2026

    @squne121
    OwnerAuthor

    Contract Snapshot (2026-06-03T00:10:00Z)

    CONTRACT_REVIEW_RESULT_V1:
      status: go
      generated_at: "2026-06-03T00:10:00Z"
      generated_by: issue-contract-review
      issue_url: https://github.com/squne121/loop-protocol/issues/576
      body_sha256: "sha256:005554d12e4d63ad6a852ba7dc96e3ee6fd34fe4962935efd7c81c9b28f46385"
      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: 1
          vc_passed_unexpectedly: 0
          vc_unrunnable: 0
          vc_expected_pass: 4
          vc_skipped: 0
          human_judgment_resolved_as_go: 8
          classifications:
            - ac: AC1
              command: "test -f docs/adr/0004-video-evidence-policy.md"
              exit_code: 1
              category: file_not_found_expected
              scope_class: baseline_fail_expected
              confidence: high
              decision: go
            - ac: AC2
              command: "rg \"user-attachments|github.*attachment\" docs/adr/0004-video-evidence-policy.md"
              exit_code: 2
              category: unknown
              scope_class: baseline_fail_expected
              confidence: low
              decision: human_judgment
              human_judgment_resolution: rg exit_code=2 means file not found (new file creation expected baseline fail)
              resolved_decision: go
            - ac: AC2
              command: "rg \"sha256\" docs/adr/0004-video-evidence-policy.md"
              exit_code: 2
              category: unknown
              scope_class: baseline_fail_expected
              decision: human_judgment
              resolved_decision: go
            - ac: AC3
              command: "rg \"local.only|local.*path|local path\" docs/adr/0004-video-evidence-policy.md"
              exit_code: 2
              category: unknown
              scope_class: baseline_fail_expected
              decision: human_judgment
              resolved_decision: go
            - ac: AC4
              command: "rg \"semantic.*recognition|video.*gate|自動.*gate|意味認識\" docs/adr/0004-video-evidence-policy.md"
              exit_code: 2
              category: unknown
              scope_class: baseline_fail_expected
              decision: human_judgment
              resolved_decision: go
            - ac: AC5
              command: "rg \"ffmpeg\" docs/adr/0004-video-evidence-policy.md"
              exit_code: 2
              category: unknown
              scope_class: baseline_fail_expected
              decision: human_judgment
              resolved_decision: go
            - ac: AC5
              command: "rg \"tolerance|frames:v|-ss\" docs/adr/0004-video-evidence-policy.md"
              exit_code: 2
              category: unknown
              scope_class: baseline_fail_expected
              decision: human_judgment
              resolved_decision: go
            - ac: AC6
              command: "rg \"artifact_url|artifact_sha256|artifact_bytes|mime_type|codec_profile|manual_operator|human_confirmed\" docs/adr/0004-video-evidence-policy.md"
              exit_code: 2
              category: unknown
              scope_class: baseline_fail_expected
              decision: human_judgment
              resolved_decision: go
            - ac: AC7
              command: "rg \"#577|#571\" docs/adr/0004-video-evidence-policy.md"
              exit_code: 2
              category: unknown
              scope_class: baseline_fail_expected
              decision: human_judgment
              resolved_decision: go
            - ac: AC8
              command: "pnpm typecheck"
              exit_code: 0
              category: regression_gate
              scope_class: regression_gate
              confidence: low
              decision: go
            - ac: AC_UNKNOWN
              command: "pnpm lint"
              exit_code: 0
              category: regression_gate
              scope_class: regression_gate
              decision: go
            - ac: AC_UNKNOWN
              command: "pnpm test"
              exit_code: 0
              category: regression_gate
              scope_class: regression_gate
              decision: go
            - ac: AC_UNKNOWN
              command: "pnpm build"
              exit_code: 0
              category: regression_gate
              scope_class: regression_gate
              decision: go
        ac_verifiability: pass
        product_spec_check:
          applicability: not_applicable
          decision: pass
          triggers:
            docs_product_allowed_paths: false
            tasks_md_mentioned: false
            specify_artifact_mentioned: false
            generated_task_mentioned: false
            product_spec_context_present: false
        worktree_branch_collision: clear
      next_action: implement_issue
      blocked_reasons: []
      warnings:
        - "rg commands on non-existent target file return exit_code=2 (not 1); resolved as expected baseline fail for new file creation"
  5. squne121 commented on Jun 3, 2026

    @squne121
    OwnerAuthor

    implement-issue: 実装完了 (2026-06-03T09:15:00Z)

    IMPLEMENT_RESULT_V1:
      status: ok
      generated_at: "2026-06-03T09:15:00Z"
      generated_by: implement-issue
      issue_url: https://github.com/squne121/loop-protocol/issues/576
      pr_url: https://github.com/squne121/loop-protocol/pull/608
      worktree: .claude/worktrees/issue-576-github-attachment-ffmpeg
      branch: worktree-issue-576-github-attachment-ffmpeg
      verification:
        typecheck: pass
        lint: pass
        test:
          passed: 313
          failed: 0
          files: 16
        build: pass
      allowed_paths_compliance: true
      warnings: []
      errors: []
  6. added a commit that references this issue on Jun 3, 2026
  7. squne121 commented on Jun 3, 2026

    @squne121
    OwnerAuthor

    impl-review-loop: 完了 (2026-06-03T02:56:00Z)

    FOLLOW_UP_MATERIALIZATION_RESULT_V1:
      schema_version: 1
      materialized_by: impl-review-loop
      follow_up_issues: []
      note_only_observations: []
    
    ISSUE_SCOPE_ROLLUP_DECISION_V2:
      schema_version: 2
      recorded_at: "2026-06-03T02:56:00Z"
      rollup_plan_ref:
        body_sha256: null
        generated_at: null
      decision: skipped
      executed_actions: []
      skipped_reason: "scope rollup preflight not used in this docs-only fix loop"
      candidates_reviewed: []
    
    LOOP_STATE:
      issue_number: 576
      contract_snapshot_url: https://github.com/squne121/loop-protocol/issues/576#issuecomment-4607985300
      contract_snapshot_source: detected_existing
      iteration: 1
      max_iterations: 3
      worktree: .claude/worktrees/issue-576-github-attachment-ffmpeg
      branch: worktree-issue-576-github-attachment-ffmpeg
      last_step: judgment
      last_loop_verdict: APPROVE
      blockers_history:
        - iteration: 0
          blockers:
            - PR review comment https://github.com/squne121/loop-protocol/pull/608#issuecomment-4608127672
      external_research_skip_basis: "owner review comment supplied the required external-spec deltas"
      termination_reason: approved
  8. added a commit that references this issue on Jun 3, 2026
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

    documentationphase/implementation

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions