Skip to content

再発防止: follow-up Issue 起票時に既存テストと CI coverage を repository-wide preflight する #2757

Open

Description

@squne121

Machine-Readable Contract

contract_schema_version: v1
issue_kind: implementation
parent_issue: "none"
goal_ref: "Issue #2728 の adversarial review で判明した、follow-up Issue 起票時の既存 canonical test / required CI coverage 発見漏れを再発防止する"
change_kind: code

Parent Issue

なし(単独改善)

Parent Goal Ref

Current Validated Scope

  • .claude/skills/create-issue/SKILL.md は anchor verification、類似 Issue、scope overlap 等の起票前 guard を持つ一方、「既存 test suite の repository-wide discovery」と「既存/候補 test path の required CI coverage 照合」を明示的な authoring preflight として要求していない。
  • .claude/skills/post-merge-cleanup-executor/SKILL.md は follow-up 候補を FOLLOW_UP_ISSUE_REQUEST_V1 として列挙し、本文 authoring は create-issue 側へ委譲するため、再発防止の主責務は create-issue authoring boundary に置くのが最小変更。
  • 再発防止: ghs_ installation token の synthetic fixture / terminology を共通化する #2753 は ghs_ synthetic fixture / terminology drift の共通化を扱っており、本 Issue の「既存 test placement / CI coverage discovery」とは別責務。

Remaining Parent Gaps

Outcome

follow-up Implementation Issue が「対応テストが存在しない」「新規 test file を作る」と主張する場合、起票前に対象 production file に対する既存 test suite を repository-wide に探索し、既存 suite と候補 test path の required CI coverage を照合した上で test placement を決めるため、#2728 のような二重 test suite / CI coverage 分裂を起票段階で検知できる。

In Scope

  • create-issue の follow-up authoring 経路に、test placement を主張する場合だけ発火する軽量 preflight を追加する。
  • preflight は少なくとも次を確認する:
    • production file の basename/stem、import/load 対象、主要 symbol を手掛かりに repository-wide で既存 test を探索する。
    • candidate directory だけを見て「test が無い」と断定しない。
    • 既存 test path と新設候補 test path が .github/ci/python-test-plan.json の required target に含まれるかを照合する。
    • canonical suite が既に存在する場合、二本目の部分 suite 新設を default にせず、既存 suite の利用・移動・CI target 追加のいずれが最小かを Issue 本文で明示する。
  • 実装: get_ci_failed_log.py の KNOWN_TOKEN_PATTERN を新形式 ghs_ App installation token に対応させる #2728 を regression scenario として、tests/impl_review_loop/test_get_ci_failed_log.py の存在と、.claude/skills/impl-review-loop/tests/ との coverage 差を検知できるテストを追加する。
  • workflow を妨げないよう、この preflight は「Issue 本文が test 不在を断定する / 新規 test path を契約する」場合だけ required とし、一般 Issue 起票の常時 repo-wide sweep にはしない。

Out of Scope

Acceptance Criteria

  • AC1: follow-up Issue authoring で「対応 test が無い」または新規 test path を契約する場合、repository-wide existing-test discovery が実行される。
  • AC2: discovery は candidate test directory 外にある既存 suite も検出でき、実装: get_ci_failed_log.py の KNOWN_TOKEN_PATTERN を新形式 ghs_ App installation token に対応させる #2728 scenario で tests/impl_review_loop/test_get_ci_failed_log.py を発見する。
  • AC3: 既存 test path と候補 test path の required Python CI coverage 差を .github/ci/python-test-plan.json から判定し、coverage 分裂を authoring finding として返せる。
  • AC4: canonical suite が存在する場合に二本目の部分 suite を無条件で新設する本文を生成しない regression test が PASS する。
  • AC5: test placement を主張しない通常の Issue authoring は追加 preflight によって不要に block / global sweep されない。
  • AC6: 新しい常設 schema / database / heavyweight harness を導入せず、既存 create-issue workflow 内の軽量な read-only preflight として完結する。

Verification Commands

# create-issue regression suite
uv run pytest .claude/skills/create-issue/tests -q

# test-placement preflight / authoring guidance が create-issue surface に接続されていること
rg -n "test.*placement|existing.*test|python-test-plan|CI coverage"   .claude/skills/create-issue/SKILL.md   .claude/skills/create-issue/references   .claude/skills/create-issue/scripts   .claude/skills/create-issue/tests

Allowed Paths

  • .claude/skills/create-issue/SKILL.md
  • .claude/skills/create-issue/references/
  • .claude/skills/create-issue/scripts/
  • .claude/skills/create-issue/tests/

Stop Conditions

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

Required Skills

なし

Required Design References

Scope Delta(任意)

N/A

Notes for Reviewer

Source

Activity

  1. added
    enhancement
    triage-required
    follow-up
    on Sep 25, 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

    enhancementfollow-uptriage-required

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions