Skip to content

feat: ci-test-performance hook advisory 実装(#1060 follow-up) #1080

Closed

Description

@squne121

概要

CI/test-lane 関連の file path または Bash command を PreToolUse hook で検出し、Claude Code および Codex CLI のエージェントに対して ci-test-performance Skill の参照と CI_TEST_PERFORMANCE_DECISION_V1 の後続出力を 非ブロッキングで 助言する仕組みを実装する。

#1060 / PR #1078 の Out of Scope 項目「hook による advisory suggestion の実装(別 follow-up Issue で対応)」を本 Issue で完結させる。

背景

Goal

CI/test-lane 関連 path または command を hook で検出し、エージェントに ci-test-performance Skill の参照と CI_TEST_PERFORMANCE_DECISION_V1 の後続出力を非ブロッキングで助言する。CI_TEST_PERFORMANCE_DECISION_V1 schema 自体は変更しない。

In Scope

  • Claude Code: .claude/settings.json の PreToolUse に非ブロッキング advisory hook を登録(matcher: Bash|Write|Edit|MultiEdit)
  • Claude Code: .claude/hooks/ci_test_performance_advisory.sh + unit test を追加
  • Codex CLI: .codex/hooks.json の PreToolUse に非ブロッキング advisory hook を登録(matcher: ^(Bash|apply_patch|Edit|Write)$)
  • Codex CLI: .codex/hooks/ci_test_performance_advisory.sh + unit test を追加
  • docs/dev/hook-boundaries.md に ci_test_performance_advisory の warning / fail_open エントリを追記
  • schemas/ci_test_performance_advisory_v1.schema.json — advisory output schema を定義
  • hook output contract: CI_TEST_PERFORMANCE_ADVISORY_V1(block: false、reason_code、matched_paths、required_skill、expected_followup_contract を含む)
  • classifier: ci-test-performance Skill の paths frontmatter と test-lane-policy 判断マトリクスに基づき CI/test-lane 関連 path のみで発火

Out of Scope

Allowed Paths

  • .claude/settings.json
  • .claude/hooks/ci_test_performance_advisory.sh
  • .claude/hooks/tests/test_ci_test_performance_advisory.py
  • .codex/hooks.json
  • .codex/hooks/ci_test_performance_advisory.sh
  • tests/codex/test_ci_test_performance_advisory.py
  • tests/codex/test_codex_hook_surface_guard.py
  • docs/dev/hook-boundaries.md
  • schemas/ci_test_performance_advisory_v1.schema.json

Acceptance Criteria

  • AC1: .claude/hooks/ci_test_performance_advisory.sh が新規作成され CI_TEST_PERFORMANCE_ADVISORY_V1 を出力する
  • AC2: advisory hook は fail-open であり、Claude / Codex のいずれでも通常 match 時に tool call を block しない(block: false)
  • AC3: schemas/ci_test_performance_advisory_v1.schema.json が新規作成され CI_TEST_PERFORMANCE_ADVISORY_V1 スキーマを定義する
  • AC4: Claude Code 側は .claude/settings.json の PreToolUse に hook が登録され、既存 fail-closed hooks の責務を変更しない
  • AC5: Codex CLI 側は .codex/hooks.json の PreToolUse のみを更新し、.codex/config.toml には hook を追加しない
  • AC6: classifier が CI/test-lane 関連 path で発火することを unit test で検証する(high-confidence trigger: .github/workflows/**、pyproject.toml、uv.lock、docs/dev/test-lane-policy.md、docs/dev/ci-performance.md、.claude/skills/ci-test-performance/**、.agents/skills/ci-test-performance/**、.codex/agents/**、schemas/**)
  • AC7: 通常の src/**/*.ts 編集や一般 docs 編集では advisory が発火しないことを unit test で検証する
  • AC8: docs/dev/hook-boundaries.md に ci_test_performance_advisory が warning / fail_open として追記される
  • AC9: CI_TEST_PERFORMANCE_DECISION_V1 schema 自体は変更されない(.claude/skills/ci-test-performance/SKILL.md の schema 定義が変更されていない)
  • AC10: .claude/agents/*.md の routing 更新は 実装: .claude/agents/implementation-worker.md / pr-reviewer.md / test-runner.md に ci-test-performance routing 契約を追記する #1097 に委譲し、本 Issue では変更しない(pnpm build が正常終了する)

Verification Commands

# AC1
# baseline-expect: fail
$ rg -l "CI_TEST_PERFORMANCE_ADVISORY_V1" .claude/hooks/ci_test_performance_advisory.sh

# AC2
$ uv run pytest .claude/hooks/tests/test_ci_test_performance_advisory.py -q

# AC3
# baseline-expect: fail
$ rg -l "CI_TEST_PERFORMANCE_ADVISORY_V1" schemas/ci_test_performance_advisory_v1.schema.json

# AC4
$ rg -n "ci_test_performance_advisory" .claude/settings.json

# AC5
$ rg -n "ci_test_performance_advisory" .codex/hooks.json

# AC6
$ uv run pytest tests/codex/test_ci_test_performance_advisory.py -q

# AC7
$ uv run pytest tests/codex/test_codex_hook_surface_guard.py -q

# AC8
$ rg -n "ci_test_performance_advisory" docs/dev/hook-boundaries.md

# AC9
$ rg -n "CI_TEST_PERFORMANCE_DECISION_V1" .claude/skills/ci-test-performance/SKILL.md

# AC10
$ pnpm build

Stop Conditions

Runtime Verification Applicability

decision: deferred
reason: advisory hook の非ブロッキング挙動・CI/test-lane path での発火と非 CI path での非発火は、pytest fixture test(subprocess 経由での hook 直接呼び出し)で検証する。テスト自体が実装物のため事前実行不可。
deferred_destination:
  destination_type: pytest
  destination_ref: "uv run pytest .claude/hooks/tests/test_ci_test_performance_advisory.py および uv run pytest tests/codex/test_ci_test_performance_advisory.py"
deferred_verification_condition: "uv run pytest .claude/hooks/tests/test_ci_test_performance_advisory.py が exit 0 かつ uv run pytest tests/codex/test_ci_test_performance_advisory.py が exit 0"

Required Skills

  • ci-test-performance(.claude/skills/ci-test-performance/SKILL.md)

Parent Issue

#1060

Parent Goal Ref

CI test lane ポリシーを docs 化し、ci-test-performance Skill を追加・consumer routing を確立した後、hook advisory layer として AI エージェントが CI 関連操作を検出した際に ci-test-performance Skill の参照と CI_TEST_PERFORMANCE_DECISION_V1 の後続出力を促す非ブロッキング仕組みを実装する(#1060 Out of Scope 項目)。

Current Validated Scope

  • .claude/hooks/ci_test_performance_advisory.sh は未作成(新規追加)
  • .claude/hooks/tests/test_ci_test_performance_advisory.py は未作成(新規追加)
  • .codex/hooks/ci_test_performance_advisory.sh は未作成(新規追加)
  • tests/codex/test_ci_test_performance_advisory.py は未作成(新規追加)
  • schemas/ci_test_performance_advisory_v1.schema.json は未作成(新規追加)
  • .claude/settings.json は既存(更新: PreToolUse hook エントリ追加)
  • .codex/hooks.json は既存(更新: PreToolUse hook エントリ追加)
  • docs/dev/hook-boundaries.md は既存(更新: ci_test_performance_advisory エントリ追記)
  • tests/codex/test_codex_hook_surface_guard.py は既存(更新: ci_test_performance_advisory を guard テストに追加)
  • CI_TEST_PERFORMANCE_DECISION_V1 schema は変更しない
  • .claude/agents/*.md は変更しない(→ 実装: .claude/agents/implementation-worker.md / pr-reviewer.md / test-runner.md に ci-test-performance routing 契約を追記する #1097)

Remaining Parent Gaps

Outcome

.claude/hooks/ci_test_performance_advisory.sh(Claude Code)と .codex/hooks/ci_test_performance_advisory.sh(Codex CLI)が追加され、CI/test-lane 関連 path 操作時に CI_TEST_PERFORMANCE_ADVISORY_V1 を non-blocking で返す。schemas/ci_test_performance_advisory_v1.schema.json で schema が定義され、docs/dev/hook-boundaries.md に warning / fail_open 分類が追記され、pnpm typecheck / test / build がすべて通ること。

関連 Issue

Machine-Readable Contract

contract_schema_version: v1
issue_kind: implementation
parent_issue: "1060"
goal_ref: "CI/test-lane 関連 path または command を hook で検出し、エージェントに ci-test-performance Skill の参照と CI_TEST_PERFORMANCE_DECISION_V1 の後続出力を非ブロッキングで助言する"
change_kind: hook-advisory
risk_class: agent_ops_guard
affected_runtimes:
  - claude_code
  - codex_cli
readiness: ready_after_refinement
hooks_boundary_contract_kind: warning
hooks_fail_policy: fail_open

Activity

  1. added
    state/queued
    on Jun 21, 2026
  2. squne121 commented on Jun 21, 2026

    @squne121
    OwnerAuthor

    結論

    #1080 は follow-up Issue としては妥当です。ただし、現本文は implementation issue ではなく placeholder です。今のまま実装に入ると、hook advisory が「非ブロッキング助言」ではなく新しいノイズ源・誤停止源・#1097 との重複スコープになりやすいです。#1080 本文自体も readiness: needs_refinement、change_kind: tbd で、コメントも 0 件です。

    #1060 / PR #1078 側では、ci-test-performance Skill、test lane policy、Codex 側 routing、consumer routing の設計は追加済みで、hook advisory と Claude Code agent 実更新は明示的に follow-up 化されています。PR #1078 は merge 済みで、AC1〜AC14 と CI は pass と報告されています。


    敵対的レビュー

    1. 最大の問題: CI_TEST_PERFORMANCE_DECISION_V1 を “hook が読む” という表現が危険

    #1080 の goal は「PreToolUse hook 等から CI_TEST_PERFORMANCE_DECISION_V1 を読み取り advisory suggestion を提供する」となっていますが、これは時系列が曖昧です。CI_TEST_PERFORMANCE_DECISION_V1 は本来、ci-test-performance Skill を読んだ agent が 変更パス分類・baseline確認・artifact整合性確認の結果として出力する contract です。既存 Skill でも、Step 1〜4 の手順の最後に CI_TEST_PERFORMANCE_DECISION_V1 を構築・出力する設計です。

    したがって、編集前の PreToolUse hook がやるべきことは「既存の decision を読む」ではなく、CI 関連の tool call / file path / command を検出して、Skill を読むことと後続で CI_TEST_PERFORMANCE_DECISION_V1 を残すことを助言することです。レビュー時にだけ、PR body / コメント / artifact に decision があるかを確認する、という分離が必要です。

    2. FileChanged を主軸にすると誤設計になりやすい

    #1060 の docs では将来案として FileChanged / PreToolUse hook から additionalContext を返すと書かれています。 ただし Claude Code の FileChanged は watched file 変更時に動く一方、matcher は | 区切りの literal filename であり、regex ではありません。また FileChanged には decision control がなく、block できません。([Claude API Docs]1)

    そのため、.github/workflows/** や schemas/** のような広い path pattern に対しては、FileChanged より PreToolUse の Write|Edit|MultiEdit|Bash 入力を分類する方式を主軸にするべきです。FileChanged は exact file watcher 用の補助に留めるか、初回実装では non-goal にした方が安全です。

    3. advisory hook は fail-open でなければならない

    この repo の hook 境界文書は、hook をローカルガードレールであってセキュリティ境界ではないと明記し、hook failure は non-blocking でも transcript を汚染しうると警告しています。 既存の fail-closed PreToolUse は secret / local main / worktree scope のような「止めるべき安全境界」に限定されています。

    #1080 の hook は “advisory suggestion” なので、permissionDecision: deny、Claude の exit 2、Codex の deny/block 相当は使うべきではありません。Claude Code では additionalContext によって Claude の context へ system reminder として短い助言を注入できます。([Claude API Docs]1) Codex CLI でも PreToolUse で hookSpecificOutput.additionalContext による非ブロッキング context 追加が可能ですが、Codex の PreToolUse は完全な enforcement boundary ではなく、plain stdout や unsupported fields の扱いにも制約があります。([OpenAI Developers]2)

    4. Codex / Claude の hook surface を混同しない

    Claude 側は .claude/settings.json に hooks が定義されており、現状 PreToolUse / Stop / SubagentStop / PostToolUse / PreCompact が登録されています。 Codex 側は .codex/hooks.json が正本で、PreToolUse / PermissionRequest / Stop / SubagentStart 等が登録されています。

    #1080 は、Claude Code と Codex CLI の両方を扱うなら Allowed Paths と AC を分ける必要があります。特に Codex は .codex/config.toml に hook を混ぜない方針が既存 Issue / docs で固定されています。

    5. #1097 と重複してはいけない

    #1097 は .claude/agents/implementation-worker.md、pr-reviewer.md、test-runner.md に CI_SKILL_ROUTING を追記する別 Issue です。#1080 が Claude Code agent ファイルまで触ると、#1097 と衝突します。

    #1080 の責務は hook advisory の実装 に限定し、Claude agent routing の本体更新は #1097、issue-contract-review の gate 化はさらに別 Issue として分離するのが妥当です。現行の consumer routing も「設計上の routing 定義であり、各 agent/skill ファイルの実更新は別 follow-up」と書かれています。


    推奨する #1080 の仕様化方針

    Machine-readable contract 案

    contract_schema_version: v1
    issue_kind: implementation
    parent_issue: "1060"
    change_kind: hook-advisory
    risk_class: agent_ops_guard
    affected_runtimes:
      - claude_code
      - codex_cli
    goal_ref: >
      CI/test-lane 関連 path または command を hook で検出し、
      agent に ci-test-performance Skill の参照と
      CI_TEST_PERFORMANCE_DECISION_V1 の後続出力を非ブロッキングで助言する。
    readiness: ready_after_refinement

    Scope

    In Scope

    • Claude Code: .claude/settings.json に非ブロッキング advisory hook を登録
    • Claude Code: .claude/hooks/ci_test_performance_advisory.* と unit test を追加
    • Codex CLI: .codex/hooks.json に非ブロッキング advisory hook を登録
    • Codex CLI: .codex/hooks/ci-test-performance-advisory.* と unit test を追加
    • docs/dev/hook-boundaries.md に ci_test_performance_advisory の fail-open / advisory contract を追記
    • hook output schema CI_TEST_PERFORMANCE_ADVISORY_V1 を定義
    • ci-test-performance Skill の existing paths と docs/dev/test-lane-policy.md の判断マトリクスに沿って classifier を実装

    Out of Scope


    hook 設計案

    イベント

    Claude Code:

    event: PreToolUse
    matcher: "Bash|Write|Edit|MultiEdit"
    classification: warning
    fail_policy: fail_open

    Codex CLI:

    {
      "event": "PreToolUse",
      "matcher": "^(Bash|apply_patch|Edit|Write)$",
      "classification": "warning",
      "fail_policy": "fail_open"
    }

    trigger path

    既存 Skill の frontmatter paths を正本にします。すでに .github/workflows/**、pyproject.toml、uv.lock、docs/dev/test-lane-policy.md、.claude/skills/ci-test-performance/**、.codex/agents/**、.claude/agents/**、.agents/skills/ci-test-performance/**、schemas/**、docs/dev/agent-skill-boundaries.md が列挙されています。

    ただし、advisory のノイズを避けるため、初期実装では以下を high-confidence trigger とするのがよいです。

    .github/workflows/**
    pyproject.toml
    uv.lock
    docs/dev/test-lane-policy.md
    docs/dev/ci-performance.md
    .claude/skills/ci-test-performance/**
    .agents/skills/ci-test-performance/**
    .codex/agents/**
    schemas/**
    

    .claude/agents/** は #1097 と関連しますが、#1080 側で編集対象にするべきではありません。classifier の trigger として扱う場合も、「#1097 の routing scope と衝突しないこと」を AC に入れるべきです。

    advisory output

    hook は block せず、短い context だけを返すべきです。Codex Skills は progressive disclosure 方式で、最初は skill 名・description・path だけを見て、必要時に SKILL.md 本文を読む設計です。([OpenAI Developers]3) そのため hook が SKILL.md 本文を丸ごと注入するのは不適切です。

    推奨 payload:

    CI_TEST_PERFORMANCE_ADVISORY_V1:
      schema: CI_TEST_PERFORMANCE_ADVISORY_V1
      runtime: claude_code | codex_cli
      event: PreToolUse
      triggered: true
      block: false
      reason_code: ci_related_path | ci_related_command | skill_surface_change | schema_artifact_change
      matched_paths: []
      required_skill: ".claude/skills/ci-test-performance/SKILL.md"
      expected_followup_contract: "CI_TEST_PERFORMANCE_DECISION_V1"
      message: >
        This tool call appears CI/test-lane related. Read ci-test-performance before editing/reviewing,
        and emit CI_TEST_PERFORMANCE_DECISION_V1 as PR evidence if the change remains in scope.

    推奨 AC

    - [ ] AC1: #1080 が placeholder ではなく implementation issue として再定義され、`change_kind: hook-advisory` を持つ
    - [ ] AC2: advisory hook は fail-open であり、Claude / Codex のいずれでも normal match 時に tool call を block しない
    - [ ] AC3: hook output は `CI_TEST_PERFORMANCE_ADVISORY_V1` として定義され、`block: false`、`reason_code`、`matched_paths`、`required_skill`、`expected_followup_contract` を含む
    - [ ] AC4: Claude Code 側は `.claude/settings.json` の `PreToolUse` に登録され、既存 fail-closed hooks の責務を変更しない
    - [ ] AC5: Codex CLI 側は `.codex/hooks.json` のみを更新し、`.codex/config.toml` に hook 設定を追加しない
    - [ ] AC6: classifier は `ci-test-performance` Skill の `paths` と `test-lane-policy` の判断マトリクスに基づき、CI/test-lane 関連 path のみで発火する
    - [ ] AC7: 通常の `src/**/*.ts` 編集や一般 docs 編集では advisory が出ない、または noisy にならないことを fixture test で検証する
    - [ ] AC8: hook-boundaries に `ci_test_performance_advisory` が `warning` または `telemetry` / `fail_open` として追加される
    - [ ] AC9: `CI_TEST_PERFORMANCE_DECISION_V1` schema 自体は変更しない
    - [ ] AC10: `.claude/agents/*.md` の routing 更新は #1097 に委譲し、本 Issue では変更しない

    推奨 Verification Commands

    # Claude hook unit
    uv run pytest .claude/hooks/tests/test_ci_test_performance_advisory.py -q
    
    # Hook integrity
    uv run python3 .claude/hooks/check_hook_integrity.py --format json
    
    # Codex hook surface / advisory tests
    uv run pytest tests/codex/test_ci_test_performance_advisory.py -q
    uv run pytest tests/codex/test_codex_hook_surface_guard.py -q
    
    # Static evidence
    rg -n "ci-test-performance|CI_TEST_PERFORMANCE_ADVISORY_V1" \
      .claude/settings.json \
      .codex/hooks.json \
      docs/dev/hook-boundaries.md \
      .claude/hooks \
      .codex/hooks
    
    # Canonical project gates
    pnpm typecheck
    pnpm lint
    pnpm test
    pnpm build

    既存 package.json でも typecheck、lint、test、build、hook / session-recording 系の検証 script が定義されています。


    Claude Code / Codex CLI 仕様面からの品質改善ポイント

    Claude Code では PreToolUse が tool call 前に動き、JSON output で decision や additional context を返せます。additionalContext は Claude の context に system reminder として挿入されるため、今回の advisory には適しています。([Claude API Docs]1) ([Claude API Docs]1)

    Codex CLI の PreToolUse は Bash / apply_patch / Edit / Write 等を捕捉できますが、完全な enforcement boundary ではありません。しかも unsupported fields を返すと hook failed 扱いになり継続されるため、#1080 は Codex 側の stdout schema を厳密に fixture 化する必要があります。([OpenAI Developers]2)

    したがって、#1080 の品質目標は「強制」ではなく 高信頼・低ノイズ・fail-open な context injection です。hook が agent の判断を代替するのではなく、ci-test-performance Skill の progressive disclosure を促し、PR 証跡として CI_TEST_PERFORMANCE_DECISION_V1 を残させる補助線に限定するべきです。


    Claude Code / Codex CLI に渡す実行プロンプト案

    https://github.com/squne121/loop-protocol/issues/1080
    
    #1080 は現状 placeholder / needs_refinement です。実装前に関連 Issue/PR/docs を読み、hook advisory 専用の implementation contract に refine してください。
    
    必ず確認すること:
    - #1080 本文とコメント
    - #1060 本文・コメント・PR #1078
    - #1097(Claude agent routing 更新 follow-up。#1080 と重複禁止)
    - `.claude/skills/ci-test-performance/SKILL.md`
    - `docs/dev/test-lane-policy.md`
    - `docs/dev/agent-skill-boundaries.md`
    - `docs/dev/hook-boundaries.md`
    - `.claude/settings.json`
    - `.codex/hooks.json`
    
    実装方針:
    - advisory hook は fail-open / non-blocking とする
    - Claude Code は PreToolUse で `Bash|Write|Edit|MultiEdit` を対象にする
    - Codex CLI は `.codex/hooks.json` の PreToolUse で `^(Bash|apply_patch|Edit|Write)$` を対象にする
    - `FileChanged` は初回実装では主軸にしない。採用する場合は literal filename matcher の制約と no-decision-control を明記する
    - hook は `CI_TEST_PERFORMANCE_ADVISORY_V1` を返し、`ci-test-performance` Skill の参照と `CI_TEST_PERFORMANCE_DECISION_V1` の後続出力を助言する
    - `CI_TEST_PERFORMANCE_DECISION_V1` schema 自体は変更しない
    - `.claude/agents/*.md` は #1097 のスコープなので変更しない
    - `.github/workflows/ci.yml` / `pyproject.toml` / `uv.lock` は変更しない
    - `.codex/config.toml` に hooks を追加しない
    
    必要なら Issue 本文を先に更新し、Allowed Paths / AC / Verification Commands / Stop Conditions を確定してから実装してください。
    破壊的操作、secret 露出、外部課金、権限不足、#1097 とのスコープ衝突、blocking hook 化が必要になった場合は停止してください。
  3. squne121 commented on Jun 21, 2026

    @squne121
    OwnerAuthor

    Refinement Loop: Approved

    The issue has been approved and is ready for implementation.

  4. squne121 commented on Jun 21, 2026

    @squne121
    OwnerAuthor

    CONTRACT_REVIEW_RESULT_V1

    schema: CONTRACT_REVIEW_RESULT_V1
    issue: 1080
    status: go
    generated_at: "2026-06-21T08:47:00Z"
    body_sha256: "sha256:9a27c46b19529b3aff8bf9c3e9b341768508a6f4b0c666fa8a68e980a81b640c"
    
    checks:
      template_compliance:
        status: pass
        notes: "必須セクション全て存在(Goal / In Scope / Out of Scope / Allowed Paths / AC / VC / Stop Conditions / Outcome / Machine-Readable Contract)"
    
      state_label:
        status: pass
        label: "state/queued"
        notes: "state/needs-human なし"
    
      allowed_paths_present:
        status: pass
        count: 9
    
      vc_present:
        status: pass
        count: 10
    
      stop_conditions_complete:
        status: pass
        notes: "6項目の明示的 Stop Conditions あり"
    
      blockers:
        status: pass
        native_dependencies: []
        notes: "親 Issue #1060 は MERGED。#1097 は Out of Scope として分離済み"
    
      product_spec_check:
        applicability: not_applicable
        decision: pass
        notes: "agent_ops_guard / hook-advisory — product spec トリガー条件を満たさない"
    
      worktree_branch_collision:
        status: pass
        worktree: ".claude/worktrees/issue-1080-ci-test-performance-hook-advisory"
        branch: "worktree-issue-1080-ci-test-performance-hook-advisory"
        notes: "既存 worktree list に issue-1080 なし"
    
      runtime_verification_applicability:
        decision: deferred
        destination_type: pytest
        destination_ref: "uv run pytest .claude/hooks/tests/test_ci_test_performance_advisory.py および uv run pytest tests/codex/test_ci_test_performance_advisory.py"
        notes: "テスト自体が実装物のため事前実行不可。deferred は issue-contract-review 規約上 go"
    
      vc_preflight:
        tool: baseline_vc_preflight/v1
        status: go
        summary:
          expected_fail: 5
          expected_pass: 2
          blocked: 1
          human_judgment: 2
        classifications:
          - ac: AC1
            command: "rg -l \"CI_TEST_PERFORMANCE_ADVISORY_V1\" .claude/hooks/ci_test_performance_advisory.sh"
            exit_code: 2
            preflight_decision: human_judgment
            human_override: go
            override_reason: "ファイル未作成(Current Validated Scope に明記)。rg exit2 = 対象ファイル不在 = baseline-expect:fail と等価"
          - ac: AC2
            command: "uv run pytest .claude/hooks/tests/test_ci_test_performance_advisory.py -q"
            exit_code: 4
            preflight_decision: expected_fail
            decision: go
          - ac: AC3
            command: "rg -l \"CI_TEST_PERFORMANCE_ADVISORY_V1\" schemas/ci_test_performance_advisory_v1.schema.json"
            exit_code: 2
            preflight_decision: human_judgment
            human_override: go
            override_reason: "ファイル未作成(Current Validated Scope に明記)。rg exit2 = 対象ファイル不在 = baseline-expect:fail と等価"
          - ac: AC4
            command: "rg -n \"ci_test_performance_advisory\" .claude/settings.json"
            exit_code: 1
            preflight_decision: expected_fail
            decision: go
          - ac: AC5
            command: "rg -n \"ci_test_performance_advisory\" .codex/hooks.json"
            exit_code: 1
            preflight_decision: expected_fail
            decision: go
          - ac: AC6
            command: "uv run pytest tests/codex/test_ci_test_performance_advisory.py -q"
            exit_code: 4
            preflight_decision: expected_fail
            decision: go
          - ac: AC7
            command: "uv run pytest tests/codex/test_codex_hook_surface_guard.py -q"
            exit_code: 0
            preflight_decision: expected_pass
            decision: go
            notes: "20 passed in 3.04s — regression gate GREEN"
          - ac: AC8
            command: "rg -n \"ci_test_performance_advisory\" docs/dev/hook-boundaries.md"
            exit_code: 1
            preflight_decision: expected_fail
            decision: go
          - ac: AC9
            command: "rg -n \"CI_TEST_PERFORMANCE_DECISION_V1\" .claude/skills/ci-test-performance/SKILL.md"
            exit_code: null
            preflight_decision: blocked
            preflight_category: broad_search_path_unbounded
            human_override: go
            override_reason: "特定ファイルパス指定(SKILL.md)。classifier が Allowed Paths 外パスを誤って broad 判定。read-only 不変性確認 VC であり問題なし"
          - ac: AC10
            command: "pnpm build"
            exit_code: 0
            preflight_decision: expected_pass
            decision: go
            notes: "regression gate GREEN"
    
      ac_verifiability:
        status: pass
        notes: "AC1–AC10 全 AC に対応する VC あり。チェックボックス形式"
    
      next_action: implement-issue
    
      blocked_reasons: []
    
    handoff:
      issue: 1080
      worktree: ".claude/worktrees/issue-1080-ci-test-performance-hook-advisory"
      branch: "worktree-issue-1080-ci-test-performance-hook-advisory"
      outcome: "`.claude/hooks/ci_test_performance_advisory.sh`(Claude Code)と `.codex/hooks/ci_test_performance_advisory.sh`(Codex CLI)が追加され、CI/test-lane 関連 path 操作時に `CI_TEST_PERFORMANCE_ADVISORY_V1` を non-blocking で返す。`schemas/ci_test_performance_advisory_v1.schema.json` で schema が定義され、`docs/dev/hook-boundaries.md` に `warning` / `fail_open` 分類が追記され、pnpm typecheck / test / build がすべて通ること"
      allowed_paths:
        - ".claude/settings.json"
        - ".claude/hooks/ci_test_performance_advisory.sh"
        - ".claude/hooks/tests/test_ci_test_performance_advisory.py"
        - ".codex/hooks.json"
        - ".codex/hooks/ci_test_performance_advisory.sh"
        - "tests/codex/test_ci_test_performance_advisory.py"
        - "tests/codex/test_codex_hook_surface_guard.py"
        - "docs/dev/hook-boundaries.md"
        - "schemas/ci_test_performance_advisory_v1.schema.json"
      required_skills:
        - "ci-test-performance"
      verification_commands: |
        uv run pytest .claude/hooks/tests/test_ci_test_performance_advisory.py -q
        uv run pytest tests/codex/test_ci_test_performance_advisory.py -q
        uv run pytest tests/codex/test_codex_hook_surface_guard.py -q
        pnpm typecheck
        pnpm lint
        pnpm test
        pnpm build
  5. squne121 commented on Jun 21, 2026

    @squne121
    OwnerAuthor

    IMPLEMENT_ISSUE_RESULT_V1

    IMPLEMENT_ISSUE_RESULT_V1:
      status: ok
      issue_number: 1080
      pr_url: https://github.com/squne121/loop-protocol/pull/1099
      branch: worktree-issue-1080-ci-test-performance-hook-advisory
      worktree: .claude/worktrees/issue-1080-ci-test-performance-hook-advisory
      commit_sha: 9c2e403d
      allowed_paths_compliance: true
      ac_results:
        - id: AC1
          status: pass
          evidence: rg CI_TEST_PERFORMANCE_ADVISORY_V1 .claude/hooks/ci_test_performance_advisory.sh → exit 0
        - id: AC2
          status: pass
          evidence: block=false, fail-open (exit 0 always), 21 pytest tests pass
        - id: AC3
          status: pass
          evidence: schemas/ci_test_performance_advisory_v1.schema.json 新規作成
        - id: AC4
          status: pass
          evidence: rg ci_test_performance_advisory .claude/settings.json → line 143
        - id: AC5
          status: pass
          evidence: rg ci_test_performance_advisory .codex/hooks.json → lines 40,63 (.codex/config.toml 変更なし)
        - id: AC6
          status: pass
          evidence: pytest .claude/hooks/tests/test_ci_test_performance_advisory.py -q → 21 passed
        - id: AC7
          status: pass
          evidence: 7 non-CI paths produce empty stdout in pytest → 21 passed (AC6/AC7 combined)
        - id: AC8
          status: pass
          evidence: rg ci_test_performance_advisory docs/dev/hook-boundaries.md → lines 303,306,378
        - id: AC9
          status: pass
          evidence: rg CI_TEST_PERFORMANCE_DECISION_V1 .claude/skills/ci-test-performance/SKILL.md → unchanged
        - id: AC10
          status: pass
          evidence: pnpm build → exit 0, .claude/agents/*.md 変更なし
      verification:
        pnpm_typecheck: pass
        pnpm_lint: pass
        pnpm_test: pass (922 tests)
        pnpm_build: pass
        pytest_claude_hook: pass (21 tests)
        pytest_codex_hook: pass (19 tests)
        pytest_surface_guard: pass (22 tests)

    PR: #1099

  6. added 2 commits that reference this issue on Jun 21, 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

    state/queued

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions