Skip to content

実装: CI 運用設計を docs/dev/ci-operations.md で定義し required / advisory / evidence の責務を分離する #894

Closed

Description

@squne121

Machine-Readable Contract

contract_schema_version: v1
issue_kind: implementation
parent_issue: "none"
goal_ref: "CI の job 分類・merge ゲート・AIエージェント判定条件を明文化し、required / advisory / evidence の責務を分離する"
change_kind: docs

Parent Issue

none(単独改善)

Parent Goal Ref

  • Goal: CI 運用設計を定義し、AIエージェントと人間が merge-ready 判定を一貫して行える基盤を作る
  • Desired Destination: docs/dev/ci-operations.md が追加され、CI job taxonomy / merge-ready 判定条件 / pending・skipped 扱いが定義された状態

Current Validated Scope

  • docs/dev/ci-operations.md を新規作成する

Remaining Parent Gaps

  • CI Runtime Baseline 計測(別 Issue 化予定)
  • Node/pnpm/uv setup の Composite Action 化(別 Issue 化予定)
  • Playwright E2E 安定化(別 Issue 化予定)
  • CI verdict artifact v2 正規化(別 Issue 化予定)

Outcome

docs/dev/ci-operations.md が追加され、CI job taxonomy・required/advisory/evidence 分類表・AIエージェント向け merge-ready 判定条件・pending/skipped/head_sha_null 扱い定義・#846/#863 との責務分界が記述された状態になる。GitHub platform semantics(required checks・neutral/skipped 扱い)と AI agent merge-ready semantics(required evidence 判定・head_sha=null 除外ルール)が別セクションで定義され、#863 の誤判定再生産を防ぐ設計正本となる状態。

In Scope

  • docs/dev/ci-operations.md を新規作成する
  • CI job taxonomy を以下の 4 分類で定義する
    • product quality gate(typecheck / lint / test / build)
    • runtime/browser evidence gate(e2e / playwright)
    • agent-ops/skill regression gate(python-test / actionlint)
    • PR hygiene gate(check-japanese 等)
  • required check と advisory check の違いを定義する
  • AIエージェントが merge-ready と判定してよい条件を定義する
  • pending / skipped / cancelled / failure / neutral / head_sha=null / head_sha mismatch の扱いを表で定義する
  • 既存 Issue feat: Allowed Paths 外ファイル変更を commit 前に検出する pre-commit gate を整備する #846(Allowed Paths pre-commit gate)および 実装: ci_verdict_summary.py で head_sha=null の skipped ジョブを failed 扱いしない #863(head_sha=null skipped job 扱い)との責務分界を明記する
  • CI 高速化の採用順序(計測→重複 setup 削減→E2E 安定化→cache 拡張)を明記する
  • S3 cache は現時点で採用せず計測後判断とする旨を明記する
  • GitHub branch protection semantics(required checks、neutral/skipped の扱い)と AI agent merge-ready semantics を別セクションで定義する
  • 実 CI job inventory を分類表に記載する(typecheck / lint / test / build / e2e / python-test / actionlint)
  • success/failure/timed_out/action_required/cancelled/neutral/skipped/stale(conclusion)と queued/in_progress/waiting/requested/pending(status)の扱いを表で定義する
  • head_sha=null + skipped は allowlisted retrospective/conditional job のみ excluded とする定義を含める
  • required evidence artifact の missing policy と retention policy を定義する
  • 実装担当エージェントへの注記として以下を追記する

Out of Scope

Acceptance Criteria

  • AC1: docs/dev/ci-operations.md が追加されている
  • AC2: 実 CI job inventory として typecheck, lint, test, build, e2e, python-test, actionlint が分類表に記載されている
  • AC3: GitHub branch protection semantics と AI agent merge-ready semantics が別セクションで定義されている
  • AC4: success/failure/timed_out/action_required/cancelled/neutral/skipped/stale と queued/in_progress/waiting/requested/pending の扱いが表で定義されている
  • AC5: head_sha=null, head_sha mismatch, expected_head_sha の扱いが表で定義されている
  • AC6: head_sha=null + skipped は allowlisted retrospective/conditional job のみ excluded であり、required PR-head evidence に数えないことが明記されている
  • AC7: feat: Allowed Paths 外ファイル変更を commit 前に検出する pre-commit gate を整備する #846 は Allowed Paths pre-commit gate の実装スコープ、実装: ci_verdict_summary.py で head_sha=null の skipped ジョブを failed 扱いしない #863 は ci_verdict_summary.py の実装修正スコープとして責務分界が明記されている
  • AC8: CI 高速化は baseline measurement → setup 重複削減 → E2E 安定化 → cache 拡張の順であり、S3/external cache は計測・security・cost 条件を満たす別 Issue まで採用しないと明記されている
  • AC9: required evidence artifact の missing policy と retention policy が定義されている
  • AC10: pnpm lint がエラーなしで通る

Verification Commands

# AC1
$ test -f docs/dev/ci-operations.md

# AC2
$ rg -c "typecheck" docs/dev/ci-operations.md
$ rg -c "python-test" docs/dev/ci-operations.md
$ rg -c "actionlint" docs/dev/ci-operations.md

# AC3
$ rg -c "branch protection" docs/dev/ci-operations.md
$ rg -c "merge.ready" docs/dev/ci-operations.md

# AC4
$ rg -c "timed_out" docs/dev/ci-operations.md
$ rg -c "in_progress" docs/dev/ci-operations.md

# AC5
$ rg -c "head_sha" docs/dev/ci-operations.md

# AC6
$ rg -c "allowlist" docs/dev/ci-operations.md

# AC7
$ rg -c "#846" docs/dev/ci-operations.md
$ rg -c "#863" docs/dev/ci-operations.md

# AC8
$ rg -c "S3" docs/dev/ci-operations.md

# AC9
$ rg -c "retention" docs/dev/ci-operations.md

# AC10
$ pnpm lint

Allowed Paths

  • docs/dev/ci-operations.md

Stop Conditions

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

Required Skills

  • Markdown / YAML フロントマター
  • GitHub Actions CI 基礎知識(job / step / check / status)
  • GitHub Check Run API の status/conclusion field の区別

Implementation Notes

Scope Delta(任意)

N/A

Runtime Verification Applicability

本 Issue の変更対象はワークフロー文書・スクリプトのみです。ゲームの実行時動作には影響しません。

decision: not_applicable
reason: "Workflow documentation and script changes only. No runtime game behavior changed."

Delivery Rule

1 Issue = 1 PR。worktree を使用。Draft PR として起票し、CI 通過後に ready にする。

Activity

  1. added
    enhancement
    phase/implementation
    triage-required
    agent/implementer
    on Jun 13, 2026
  2. squne121 commented on Jun 13, 2026

    @squne121
    OwnerAuthor

    確認範囲

    Issue #894 は、docs/dev/ci-operations.md を追加し、CI job taxonomy、required/advisory/evidence、AI エージェント向け merge-ready 判定、pending/skipped/cancelled/head_sha=null 等の扱いを文書化する docs-only Issue です。Allowed Paths も docs/dev/ci-operations.md のみです。
    #894 / #846 / #863 の Issue コメントはいずれも空でした。

    総評

    方向性は正しいが、このまま実装に渡すと「CI 運用設計書らしい文章」は作れても、AI エージェントの誤判定を止める実効性は弱いです。
    特に危険なのは、GitHub の branch protection 上の “required check” と、リポジトリ独自の “agent merge-ready” を同じ意味で扱いかねない点です。GitHub 公式 docs では required status check は successful / skipped / neutral でも要件を満たす扱いですが、AI エージェントの merge-ready では skipped や neutral をそのまま pass とみなすと証跡偽陽性になります。(GitHub Docs)


    Blocking / High severity

    1. skipped / neutral の扱いが危険に曖昧

    GitHub Check Run API の conclusion には action_required, cancelled, failure, neutral, success, skipped, stale, timed_out があり、status には queued, in_progress, completed, waiting, requested, pending があります。(GitHub Docs)
    一方、現在の ci_verdict_summary.py は neutral / skipped / stale を fail bucket に分類し、determine_check_verdict でも neutral / skipped を failed として扱っています。

    これは #863 の問題意識そのものです。#863 は、PR #856 起点で head_sha=null かつ conclusion=skipped の retrospective / conditional job が exit 10 偽陽性を起こすため、deploy-main, cleanup-pr, issue-body-japanese 等を failed 扱いしない修正を求めています。 PR #856 自体は merged 済みで、この false positive の発見元として参照されています。

    修正案: #894 では次の 3 層を明示分離すべきです。

    層 | 意味 | skipped / neutral の扱い -- | -- | -- GitHub branch protection | GitHub が merge gate として見る状態 | GitHub 上は required check として許容され得る Repository CI policy | LOOP_PROTOCOL として品質証跡に採用するか | 原則 pass ではない。job class ごとに定義 Agent merge-ready verdict | AI が merge-ready と判断してよいか | required evidence には数えない。明示 allowlist の skipped のみ exclude

    特に e2e は単なる runtime gate ではなく、Playwright report / test-results / visual evidence summary を持つ evidence producer でもあります。現在の workflow は playwright-report と test-results を !cancelled() 条件で upload し、環境 fingerprint や artifact URL を summary に書いています。


    5. docs-only Issue なのに「運用の実装済み感」が出る

    #894 は Allowed Paths が docs/dev/ci-operations.md のみなので、.github/workflows/ci.yml や ci_verdict_summary.py は変更できません。
    したがって文書には、この Issue は enforcement 実装ではなく normative design / decision record である と明記すべきです。

    特に #863 が未解決のままなら、head_sha=null skipped の実装挙動は現行コードと設計文書で乖離します。現行コードは skipped を fail 扱いしています。


    Medium severity / 高品質化ポイント

    6. CI 高速化の順序はよいが、S3 cache 判断基準が曖昧

    #894 は「計測 → setup 重複削減 → E2E 安定化 → cache 拡張」「S3 cache は計測後判断」としており、順序自体は妥当です。
    ただし判断基準がありません。

    GitHub Actions の cache は exact match / prefix match / restore-keys の順で探索され、cache miss 時は job 成功後に新規 cache が作成されます。また、cache には機密情報を入れるべきではなく、fork PR などから base branch cache へのアクセスがあり得ます。(GitHub Docs)
    actions/setup-node の pnpm cache は依存ファイルを前提にし、node_modules 自体は cache しません。(GitHub) pnpm/action-setup も Node.js はセットアップしないため、actions/setup-node との併用が前提です。(GitHub)

    追記すべき判断基準:

    S3/external cache は次を満たすまで採用しない:
    - 直近 N=20 CI runs の job duration P50/P95 を取得済み
    - setup/install 部分が全体時間の X% 以上を占める
    - GitHub 標準 cache の hit/miss と restore-key 設計を確認済み
    - cache path に .env, token, credentials, generated secrets が含まれない
    - 外部サービス利用のため別 Issue で security / cost / invalidation policy をレビューする
    

    7. Artifact policy が不足

    actions/upload-artifact v4+ 系では artifact 名の衝突や再アップロードに制約があり、artifact は immutable です。artifact 名は job 間でユニークにする必要があります。また if-no-files-found は warn/error/ignore を選べます。(GitHub)

    現在の e2e は if-no-files-found: warn で Playwright report と test-results を upload しています。
    これは evidence としては少し弱いです。required evidence とするなら missing artifact は warn ではなく block すべき、advisory evidence なら warn でよい、という区別を文書化してください。


    8. cancellation / concurrency の扱いが不足

    現在の workflow は concurrency.cancel-in-progress: true です。
    つまり古い PR head の CI run はキャンセルされ得ます。#894 の表では cancelled を扱う予定ですが、次の区別が必要です。

    - cancelled かつ stale/superseded run:
      - 旧 head の run なら merge-ready 判定対象から除外可
    
    • cancelled かつ current head の required job:

      • block。rerun または新 run 完了待ち
    • pending/current head:

      • block。wait_for_ci
    • workflow/path filter により required check が pending のまま:

      • GitHub 上も merge blocking になり得る

    GitHub docs でも、workflow が path / branch filtering 等で skip されると required check が Pending のまま残り、merge がブロックされる場合があります。(GitHub Docs)


    9. check-japanese 等 が現 CI inventory と接続されていない

    #894 は PR hygiene gate の例として check-japanese 等 を挙げていますが、取得した .github/workflows/ci.yml には check-japanese job は見当たりません。
    別 workflow / GitHub App / 外部 check 由来なら、その source を表に入れるべきです。

    GitHub 公式 docs は、複数 workflow で同じ job 名を使うと required status check が曖昧になり、merge がブロックされ得ると警告しています。(GitHub Docs)
    抽象名だけを書くのは危険です。


    #894 の改善草案

    Issue 本文に次を追加するのがよいです。

    ## Required Design Constraints
    
    
    
  3. This issue is docs-only. It defines normative CI operations policy but does not implement enforcement.

  4. GitHub branch protection semantics and AI agent merge-ready semantics MUST be separated.

  5. GitHub may treat success, skipped, and neutral as acceptable for required checks, but agent merge-ready MUST NOT count skipped or neutral as required PR-head evidence unless explicitly classified.

  6. head_sha=null checks MUST NOT be treated as proof for the current PR head.

  7. head_sha=null + skipped MAY be excluded only for explicitly named retrospective / conditional jobs, and only when the job is not required PR-head evidence.

  8. head_sha mismatch MUST block merge-ready as stale evidence.

  9. If the policy described here conflicts with current ci_verdict_summary.py, the document MUST mark the conflict and point to #863 rather than pretending enforcement exists.

  10. 追加すべき CI inventory:

    ## Current CI Inventory

    job/check workflow taxonomy required/advisory/evidence PR-head evidence required artifact merge-ready rule
    typecheck ci product quality gate required yes none success on expected head required
    lint ci product quality gate / PR hygiene required yes none success on expected head required
    test ci product quality gate required yes none success on expected head required
    build ci product quality gate required yes dist build logs success on expected head required
    e2e ci runtime/browser evidence gate required/evidence yes playwright-report, test-results success and artifact availability required
    python-test ci agent-ops/skill regression gate required yes ci_test_selection success on expected head required
    actionlint ci agent-ops/skill regression gate required yes none success on expected head required

    追加すべき status matrix:

    observed state GitHub/platform meaning agent merge-ready verdict next action
    --- --- --- ---
    success completed successfully pass if head_sha matches expected none
    failure / timed_out / action_required failed block inspect logs
    queued / in_progress / waiting / requested / pending not complete block wait_for_ci
    cancelled cancelled block unless stale/superseded non-current run rerun or wait
    neutral GitHub may allow in required checks not pass for required evidence unless explicitly advisory manual review
    skipped GitHub may allow in required checks not pass for required evidence; exclude only if explicit non-PR conditional job verify classification
    stale stale block refresh head SHA
    head_sha mismatch evidence for another commit block refresh / rerun
    head_sha=null + skipped no PR-head proof exclude only for allowlisted retrospective/conditional jobs do not count as evidence
    head_sha=null + success/failure/cancelled/neutral no PR-head proof block or manual review inspect source

    改善後 Acceptance Criteria 案

    - [ ] AC1: docs/dev/ci-operations.md が追加されている
    • AC2: 実 CI job inventory として typecheck, lint, test, build, e2e, python-test, actionlint が分類表に記載されている
    • AC3: GitHub branch protection semantics と AI agent merge-ready semantics が別セクションで定義されている
    • AC4: success/failure/timed_out/action_required/cancelled/neutral/skipped/stale と queued/in_progress/waiting/requested/pending の扱いが表で定義されている
    • AC5: head_sha=null, head_sha mismatch, expected_head_sha の扱いが表で定義されている
    • AC6: head_sha=null + skipped は allowlisted retrospective/conditional job のみ excluded であり、required PR-head evidence に数えないことが明記されている
    • AC7: feat: Allowed Paths 外ファイル変更を commit 前に検出する pre-commit gate を整備する #846 は Allowed Paths pre-commit gate の実装スコープ、実装: ci_verdict_summary.py で head_sha=null の skipped ジョブを failed 扱いしない #863 は ci_verdict_summary.py の実装修正スコープとして責務分界が明記されている
    • AC8: CI 高速化は baseline measurement → setup 重複削減 → E2E 安定化 → cache 拡張の順であり、S3/external cache は計測・security・cost 条件を満たす別 Issue まで採用しないと明記されている
    • AC9: required evidence artifact の missing policy と retention policy が定義されている
    • [ ] AC10: pnpm lint がエラーなしで通る

    実装担当エージェントへの注意

    この Issue は docs-only なので、実装担当に次を明示した方が安全です。

    Do not modify .github/workflows/** or .claude/skills/**.
    Do not implement #846 or #863.
    If the desired policy conflicts with current ci_verdict_summary.py, document the conflict and reference #863.
    Do not claim enforcement exists unless the current repository code already enforces it.
    Use actual job names from .github/workflows/ci.yml; do not invent check names.

    結論として、#894 は 「CI 運用設計の SSOT を作る Issue」にはなっているが、「AI が merge-ready を誤判定しないための契約」としてはまだ甘い です。特に skipped/neutral/head_sha=null を GitHub の平台 semantics と agent policy に分けて書かないと、#863 の false positive / false negative を再生産します。

    ## 確認範囲

    Issue #894 は、docs/dev/ci-operations.md を追加し、CI job taxonomy、required/advisory/evidence、AI エージェント向け merge-ready 判定、pending/skipped/cancelled/head_sha=null 等の扱いを文書化する docs-only Issue です。Allowed Paths も docs/dev/ci-operations.md のみです。
    #894 / #846 / #863 の Issue コメントはいずれも空でした。

    総評

    方向性は正しいが、このまま実装に渡すと「CI 運用設計書らしい文章」は作れても、AI エージェントの誤判定を止める実効性は弱いです。
    特に危険なのは、GitHub の branch protection 上の “required check” と、リポジトリ独自の “agent merge-ready” を同じ意味で扱いかねない点です。GitHub 公式 docs では required status check は successful / skipped / neutral でも要件を満たす扱いですが、AI エージェントの merge-ready では skipped や neutral をそのまま pass とみなすと証跡偽陽性になります。([GitHub Docs]1)


    Blocking / High severity

    1. skipped / neutral の扱いが危険に曖昧

    GitHub Check Run API の conclusion には action_required, cancelled, failure, neutral, success, skipped, stale, timed_out があり、status には queued, in_progress, completed, waiting, requested, pending があります。([GitHub Docs]2)
    一方、現在の ci_verdict_summary.py は neutral / skipped / stale を fail bucket に分類し、determine_check_verdict でも neutral / skipped を failed として扱っています。

    これは #863 の問題意識そのものです。#863 は、PR #856 起点で head_sha=null かつ conclusion=skipped の retrospective / conditional job が exit 10 偽陽性を起こすため、deploy-main, cleanup-pr, issue-body-japanese 等を failed 扱いしない修正を求めています。 PR #856 自体は merged 済みで、この false positive の発見元として参照されています。

    修正案: #894 では次の 3 層を明示分離すべきです。

    層 意味 skipped / neutral の扱い
    GitHub branch protection GitHub が merge gate として見る状態 GitHub 上は required check として許容され得る
    Repository CI policy LOOP_PROTOCOL として品質証跡に採用するか 原則 pass ではない。job class ごとに定義
    Agent merge-ready verdict AI が merge-ready と判断してよいか required evidence には数えない。明示 allowlist の skipped のみ exclude

    2. head_sha=null の判定規則が足りない

    #894 は head_sha=null を表で扱うことを求めていますが、どの head_sha=null を除外してよく、どれをブロックすべきか が未定義です。これでは #863 と同じ誤判定が再発します。

    最低限、文書には次のルールが必要です。

    - head_sha == expected_head_sha:
      - PR head の証跡として評価可能
    
    - head_sha != null かつ head_sha != expected_head_sha:
      - stale_head_sha。merge-ready 不可
    
    - head_sha == null かつ conclusion == skipped:
      - 明示 allowlist の retrospective / conditional job のみ excluded
      - required PR-head evidence には絶対に数えない
    
    - head_sha == null かつ conclusion != skipped:
      - PR head の証跡ではないため manual review または block
    

    GitHub CLI の gh pr checks は bucket を pass/fail/pending/skipping/cancel に分類します。つまり実装側では GitHub API の conclusion=skipped と CLI の bucket=skipping の両方を意識する必要があります。(GitHub CLI)


    3. AC が keyword grep 中心で、低品質な文書でも通る

    #894 の Verification Commands は rg -c "product quality gate" や rg -c "head_sha" のような存在確認が中心です。
    これは敵対的には簡単にすり抜けられます。たとえば、表がなくても、実際の job 名がなくても、矛盾したルールでも、単語だけ書けば AC を満たせます。

    修正案: AC を最低限こう強化すべきです。

    # actual CI jobs are all classified
    rg -n "\btypecheck\b" docs/dev/ci-operations.md
    rg -n "\blint\b" docs/dev/ci-operations.md
    rg -n "\btest\b" docs/dev/ci-operations.md
    rg -n "\bbuild\b" docs/dev/ci-operations.md
    rg -n "\be2e\b" docs/dev/ci-operations.md
    rg -n "\bpython-test\b" docs/dev/ci-operations.md
    rg -n "\bactionlint\b" docs/dev/ci-operations.md
    
    # status/conclusion matrix is complete
    rg -n "queued|in_progress|waiting|requested|pending" docs/dev/ci-operations.md
    rg -n "success|failure|timed_out|action_required|cancelled|neutral|skipped|stale" docs/dev/ci-operations.md
    
    # GitHub platform semantics and agent semantics are explicitly separated
    rg -n "GitHub branch protection.*skipped.*neutral" docs/dev/ci-operations.md
    rg -n "agent merge-ready.*skipped.*required evidence" docs/dev/ci-operations.md

    pnpm lint は必要ですが、Markdown の意味的妥当性までは検証できません。AC8 を「最低限の形式チェック」と明記し、意味検証は grep 条件・表構造・実 CI job inventory で担保すべきです。


    4. 実 CI と taxonomy の対応が固定されていない

    現在の .github/workflows/ci.yml には typecheck, lint, test, build, e2e, python-test, actionlint が存在します。typecheck/lint/test/build は各ジョブで pnpm setup と pnpm install --frozen-lockfile を繰り返し、e2e は Playwright Chromium install と pnpm test:e2e:ci を実行します。
    python-test は uv / pnpm / ripgrep / pytest 群を実行し、ci_test_selection artifact を生成します。actionlint は workflow lint を行います。

    #894 の taxonomy は抽象カテゴリだけでなく、実ジョブ名との対応表 を必須にすべきです。

    推奨列:

    check/job workflow class required/advisory/evidence PR head SHA 必須 artifact merge-ready 影響

    特に e2e は単なる runtime gate ではなく、Playwright report / test-results / visual evidence summary を持つ evidence producer でもあります。現在の workflow は playwright-report と test-results を !cancelled() 条件で upload し、環境 fingerprint や artifact URL を summary に書いています。


    5. docs-only Issue なのに「運用の実装済み感」が出る

    #894 は Allowed Paths が docs/dev/ci-operations.md のみなので、.github/workflows/ci.yml や ci_verdict_summary.py は変更できません。
    したがって文書には、この Issue は enforcement 実装ではなく normative design / decision record である と明記すべきです。

    特に #863 が未解決のままなら、head_sha=null skipped の実装挙動は現行コードと設計文書で乖離します。現行コードは skipped を fail 扱いしています。


    Medium severity / 高品質化ポイント

    6. CI 高速化の順序はよいが、S3 cache 判断基準が曖昧

    #894 は「計測 → setup 重複削減 → E2E 安定化 → cache 拡張」「S3 cache は計測後判断」としており、順序自体は妥当です。
    ただし判断基準がありません。

    GitHub Actions の cache は exact match / prefix match / restore-keys の順で探索され、cache miss 時は job 成功後に新規 cache が作成されます。また、cache には機密情報を入れるべきではなく、fork PR などから base branch cache へのアクセスがあり得ます。([GitHub Docs]4)
    actions/setup-node の pnpm cache は依存ファイルを前提にし、node_modules 自体は cache しません。([GitHub]5) pnpm/action-setup も Node.js はセットアップしないため、actions/setup-node との併用が前提です。([GitHub]6)

    追記すべき判断基準:

    S3/external cache は次を満たすまで採用しない:
    - 直近 N=20 CI runs の job duration P50/P95 を取得済み
    - setup/install 部分が全体時間の X% 以上を占める
    - GitHub 標準 cache の hit/miss と restore-key 設計を確認済み
    - cache path に .env, token, credentials, generated secrets が含まれない
    - 外部サービス利用のため別 Issue で security / cost / invalidation policy をレビューする
    

    7. Artifact policy が不足

    actions/upload-artifact v4+ 系では artifact 名の衝突や再アップロードに制約があり、artifact は immutable です。artifact 名は job 間でユニークにする必要があります。また if-no-files-found は warn/error/ignore を選べます。([GitHub]7)

    現在の e2e は if-no-files-found: warn で Playwright report と test-results を upload しています。
    これは evidence としては少し弱いです。required evidence とするなら missing artifact は warn ではなく block すべき、advisory evidence なら warn でよい、という区別を文書化してください。


    8. cancellation / concurrency の扱いが不足

    現在の workflow は concurrency.cancel-in-progress: true です。
    つまり古い PR head の CI run はキャンセルされ得ます。#894 の表では cancelled を扱う予定ですが、次の区別が必要です。

    - cancelled かつ stale/superseded run:
      - 旧 head の run なら merge-ready 判定対象から除外可
    
    - cancelled かつ current head の required job:
      - block。rerun または新 run 完了待ち
    
    - pending/current head:
      - block。wait_for_ci
    
    - workflow/path filter により required check が pending のまま:
      - GitHub 上も merge blocking になり得る
    

    GitHub docs でも、workflow が path / branch filtering 等で skip されると required check が Pending のまま残り、merge がブロックされる場合があります。([GitHub Docs]8)


    9. check-japanese 等 が現 CI inventory と接続されていない

    #894 は PR hygiene gate の例として check-japanese 等 を挙げていますが、取得した .github/workflows/ci.yml には check-japanese job は見当たりません。
    別 workflow / GitHub App / 外部 check 由来なら、その source を表に入れるべきです。

    GitHub 公式 docs は、複数 workflow で同じ job 名を使うと required status check が曖昧になり、merge がブロックされ得ると警告しています。([GitHub Docs]1)
    抽象名だけを書くのは危険です。


    #894 の改善草案

    Issue 本文に次を追加するのがよいです。

    ## Required Design Constraints
    
    - This issue is docs-only. It defines normative CI operations policy but does not implement enforcement.
    - GitHub branch protection semantics and AI agent merge-ready semantics MUST be separated.
    - GitHub may treat `success`, `skipped`, and `neutral` as acceptable for required checks, but agent merge-ready MUST NOT count `skipped` or `neutral` as required PR-head evidence unless explicitly classified.
    - `head_sha=null` checks MUST NOT be treated as proof for the current PR head.
    - `head_sha=null + skipped` MAY be excluded only for explicitly named retrospective / conditional jobs, and only when the job is not required PR-head evidence.
    - `head_sha mismatch` MUST block merge-ready as stale evidence.
    - If the policy described here conflicts with current `ci_verdict_summary.py`, the document MUST mark the conflict and point to #863 rather than pretending enforcement exists.

    追加すべき CI inventory:

    ## Current CI Inventory
    
    | job/check | workflow | taxonomy | required/advisory/evidence | PR-head evidence required | artifact | merge-ready rule |
    |---|---|---|---|---|---|---|
    | typecheck | ci | product quality gate | required | yes | none | success on expected head required |
    | lint | ci | product quality gate / PR hygiene | required | yes | none | success on expected head required |
    | test | ci | product quality gate | required | yes | none | success on expected head required |
    | build | ci | product quality gate | required | yes | dist build logs | success on expected head required |
    | e2e | ci | runtime/browser evidence gate | required/evidence | yes | playwright-report, test-results | success and artifact availability required |
    | python-test | ci | agent-ops/skill regression gate | required | yes | ci_test_selection | success on expected head required |
    | actionlint | ci | agent-ops/skill regression gate | required | yes | none | success on expected head required |

    追加すべき status matrix:

    | observed state | GitHub/platform meaning | agent merge-ready verdict | next action |
    |---|---|---|---|
    | success | completed successfully | pass if head_sha matches expected | none |
    | failure / timed_out / action_required | failed | block | inspect logs |
    | queued / in_progress / waiting / requested / pending | not complete | block | wait_for_ci |
    | cancelled | cancelled | block unless stale/superseded non-current run | rerun or wait |
    | neutral | GitHub may allow in required checks | not pass for required evidence unless explicitly advisory | manual review |
    | skipped | GitHub may allow in required checks | not pass for required evidence; exclude only if explicit non-PR conditional job | verify classification |
    | stale | stale | block | refresh head SHA |
    | head_sha mismatch | evidence for another commit | block | refresh / rerun |
    | head_sha=null + skipped | no PR-head proof | exclude only for allowlisted retrospective/conditional jobs | do not count as evidence |
    | head_sha=null + success/failure/cancelled/neutral | no PR-head proof | block or manual review | inspect source |

    改善後 Acceptance Criteria 案

    - [ ] AC1: `docs/dev/ci-operations.md` が追加されている
    - [ ] AC2: 実 CI job inventory として `typecheck`, `lint`, `test`, `build`, `e2e`, `python-test`, `actionlint` が分類表に記載されている
    - [ ] AC3: GitHub branch protection semantics と AI agent merge-ready semantics が別セクションで定義されている
    - [ ] AC4: `success/failure/timed_out/action_required/cancelled/neutral/skipped/stale` と `queued/in_progress/waiting/requested/pending` の扱いが表で定義されている
    - [ ] AC5: `head_sha=null`, `head_sha mismatch`, `expected_head_sha` の扱いが表で定義されている
    - [ ] AC6: `head_sha=null + skipped` は allowlisted retrospective/conditional job のみ excluded であり、required PR-head evidence に数えないことが明記されている
    - [ ] AC7: #846 は Allowed Paths pre-commit gate の実装スコープ、#863 は `ci_verdict_summary.py` の実装修正スコープとして責務分界が明記されている
    - [ ] AC8: CI 高速化は baseline measurement → setup 重複削減 → E2E 安定化 → cache 拡張の順であり、S3/external cache は計測・security・cost 条件を満たす別 Issue まで採用しないと明記されている
    - [ ] AC9: required evidence artifact の missing policy と retention policy が定義されている
    - [ ] AC10: `pnpm lint` がエラーなしで通る

    実装担当エージェントへの注意

    この Issue は docs-only なので、実装担当に次を明示した方が安全です。

    Do not modify `.github/workflows/**` or `.claude/skills/**`.
    Do not implement #846 or #863.
    If the desired policy conflicts with current `ci_verdict_summary.py`, document the conflict and reference #863.
    Do not claim enforcement exists unless the current repository code already enforces it.
    Use actual job names from `.github/workflows/ci.yml`; do not invent check names.
    

    結論として、#894 は 「CI 運用設計の SSOT を作る Issue」にはなっているが、「AI が merge-ready を誤判定しないための契約」としてはまだ甘い です。特に skipped/neutral/head_sha=null を GitHub の平台 semantics と agent policy に分けて書かないと、#863 の false positive / false negative を再生産します。

  11. squne121 commented on Jun 13, 2026

    @squne121
    OwnerAuthor

    Refinement Loop: Approved

    The issue has been approved and is ready for implementation.

  12. squne121 commented on Jun 14, 2026

    @squne121
    OwnerAuthor

    CONTRACT_REVIEW_RESULT_V1

    schema: CONTRACT_REVIEW_RESULT_V1
    issue_number: 894
    status: go
    reviewed_at: "2026-06-14T00:03:30Z"
    body_sha256: "sha256:16241f027d7447dd1119c5a163e18c81f358b4474b61adadf1a14235a463d69d"

    判定サマリ

    status: go — 実装着手可能。

    checks

    checks:
      template_compliance: pass
      state_label: pass  # triage-required は blocking ラベルではない(state/needs-human のみが blocking)
      allowed_paths_present: pass  # docs/dev/ci-operations.md
      vc_present: pass
      stop_conditions_complete: pass
      ac_verifiability: pass
      worktree_branch_collision: pass  # worktree-issue-894-ci-operations-doc は未使用
      product_spec_check:
        applicability: not_applicable
        decision: pass
        reason: "docs-only change (docs/dev/ci-operations.md 新規作成)、ゲーム仕様変更なし"
      vc_preflight:
        status: go_with_human_judgment_override
        summary:
          expected_fail: 1      # AC1: test -f docs/dev/ci-operations.md → exit1 (file_not_found_expected)
          expected_pass: 1      # AC10: pnpm lint → exit0 (regression_gate)
          human_judgment: 13    # AC2-AC9: rg -c on non-existent file → exit2 (docs-creation false positive)
          blocked: 0
        human_judgment_override:
          decision: go
          rationale: >
            AC2-AC9 の rg コマンドはすべて docs/dev/ci-operations.md(未作成)を対象にしており、
            exit2 (No such file or directory) は docs-creation false positive パターン。
            対象ファイルが存在しないため rg が exit2 を返すのは baseline_fail_expected と等価。
            実装後に全コマンドが正常終了することを確認する PR review gate で担保する。
        classifications:
          - ac: AC1
            command: "test -f docs/dev/ci-operations.md"
            exit_code: 1
            classification: expected_fail
            scope_class: baseline_fail_expected
            decision: go
          - ac: AC2
            commands: ["rg -c \"typecheck\" docs/dev/ci-operations.md", "rg -c \"python-test\" docs/dev/ci-operations.md", "rg -c \"actionlint\" docs/dev/ci-operations.md"]
            exit_code: 2
            classification: human_judgment (docs-creation override → go)
            scope_class: baseline_fail_expected
            decision: go
          - ac: AC3
            commands: ["rg -c \"branch protection\" docs/dev/ci-operations.md", "rg -c \"merge.ready\" docs/dev/ci-operations.md"]
            exit_code: 2
            classification: human_judgment (docs-creation override → go)
            scope_class: baseline_fail_expected
            decision: go
          - ac: AC4
            commands: ["rg -c \"timed_out\" docs/dev/ci-operations.md", "rg -c \"in_progress\" docs/dev/ci-operations.md"]
            exit_code: 2
            classification: human_judgment (docs-creation override → go)
            scope_class: baseline_fail_expected
            decision: go
          - ac: AC5
            command: "rg -c \"head_sha\" docs/dev/ci-operations.md"
            exit_code: 2
            classification: human_judgment (docs-creation override → go)
            scope_class: baseline_fail_expected
            decision: go
          - ac: AC6
            command: "rg -c \"allowlist\" docs/dev/ci-operations.md"
            exit_code: 2
            classification: human_judgment (docs-creation override → go)
            scope_class: baseline_fail_expected
            decision: go
          - ac: AC7
            commands: ["rg -c \"#846\" docs/dev/ci-operations.md", "rg -c \"#863\" docs/dev/ci-operations.md"]
            exit_code: 2
            classification: human_judgment (docs-creation override → go)
            scope_class: baseline_fail_expected
            decision: go
          - ac: AC8
            command: "rg -c \"S3\" docs/dev/ci-operations.md"
            exit_code: 2
            classification: human_judgment (docs-creation override → go)
            scope_class: baseline_fail_expected
            decision: go
          - ac: AC9
            command: "rg -c \"retention\" docs/dev/ci-operations.md"
            exit_code: 2
            classification: human_judgment (docs-creation override → go)
            scope_class: baseline_fail_expected
            decision: go
          - ac: AC10
            command: "pnpm lint"
            exit_code: 0
            classification: expected_pass
            scope_class: regression_gate
            decision: go
      next_action: implement-issue
      blocked_reasons: []

    Worktree / Branch

    worktree: .claude/worktrees/issue-894-ci-operations-doc
    branch: worktree-issue-894-ci-operations-doc
    base: main

    Handoff to implement-issue

    handoff:
      issue_number: 894
      contract_snapshot_url: "(本コメント URL)"
      outcome: "docs/dev/ci-operations.md が追加され、CI job taxonomy・required/advisory/evidence 分類表・AIエージェント向け merge-ready 判定条件・pending/skipped/head_sha_null 扱い定義・#846/#863 との責務分界が記述された状態"
      allowed_paths:
        - docs/dev/ci-operations.md
      worktree: .claude/worktrees/issue-894-ci-operations-doc
      branch: worktree-issue-894-ci-operations-doc
      runtime_verification_applicability: not_applicable
  13. added 2 commits that reference this issue on Jun 14, 2026
  14. squne121 commented on Jun 14, 2026

    @squne121
    OwnerAuthor

    post-merge-cleanup: 完了 (2026-06-14T00:50:00Z)

    • status: ok
    • 次アクション: なし(standalone Issue / follow-up は既存 Issue で追跡済み)
    FOLLOW_UP_MATERIALIZATION_RESULT_V1:
      schema_version: 1
      materialized_by: post-merge-cleanup
      follow_up_issues:
        - request_dedupe_key: "follow-up:squne121/loop-protocol:pr/902:fup1-ci-runtime-baseline"
          status: reused_open
          issue:
            number: 895
            url: "https://github.com/squne121/loop-protocol/issues/895"
          reason: "CI Runtime Baseline は #895 (OPEN) で追跡済み"
    
        - request_dedupe_key: "follow-up:squne121/loop-protocol:pr/902:fup2-composite-action"
          status: reused_open
          issue:
            number: 896
            url: "https://github.com/squne121/loop-protocol/issues/896"
          reason: "Composite Action 化は #896 (OPEN) で追跡済み"
    
        - request_dedupe_key: "follow-up:squne121/loop-protocol:pr/902:fup3-e2e-stabilize"
          status: reused_open
          issue:
            number: 897
            url: "https://github.com/squne121/loop-protocol/issues/897"
          reason: "Playwright E2E 安定化は #897 (OPEN) で追跡済み"
    
        - request_dedupe_key: "follow-up:squne121/loop-protocol:pr/902:fup4-verdict-artifact"
          status: reused_open
          issue:
            number: 898
            url: "https://github.com/squne121/loop-protocol/issues/898"
          reason: "CI verdict artifact 正規化は #898 (OPEN) で追跡済み"
    
        - request_dedupe_key: "follow-up:squne121/loop-protocol:pr/902:fup5-863"
          status: reused_open
          issue:
            number: 863
            url: "https://github.com/squne121/loop-protocol/issues/863"
          reason: "head_sha=null + skipped allowlist は #863 (OPEN) で追跡済み"
    
        - request_dedupe_key: "follow-up:squne121/loop-protocol:pr/902:fup6-e2e-artifact-gate"
          status: skipped_closed_not_planned
          issue: null
          reason: "e2e artifact if-no-files-found: error 化は Implementation Status Matrix に記録済み。Implementation Issue として別途起票予定(人間判断)"
    
      note_only_observations: []

    cleanup 実施内容

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

    agent/implementerenhancementphase/implementationtriage-required

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions