Repository navigation
Open
Labels
enhancementNew feature or requestfollow-up後続 Issue として切り出された follow-uptriage-requiredNeeds owner triage for priority decision
Description
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: codeParent Issue
なし(単独改善)
Parent Goal Ref
- Source finding: 実装: get_ci_failed_log.py の KNOWN_TOKEN_PATTERN を新形式 ghs_ App installation token に対応させる #2728 comment 実装: get_ci_failed_log.py の KNOWN_TOKEN_PATTERN を新形式 ghs_ App installation token に対応させる #2728 (comment)
- 実装: get_ci_failed_log.py の KNOWN_TOKEN_PATTERN を新形式 ghs_ App installation token に対応させる #2728 は post-merge-cleanup 起点の follow-up Issue だったが、production file に対する既存 canonical test
tests/impl_review_loop/test_get_ci_failed_log.pyを見落とし、.claude/skills/impl-review-loop/tests/test_get_ci_failed_log.pyを新設する契約になっていた。 - さらに既存 suite は
.github/ci/python-test-plan.jsonの required target 外、新設候補は target 内であり、Issue 本文どおり実装すると同一 production helper の test responsibility と CI coverage が分裂する状態だった。
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
- 実装: get_ci_failed_log.py の KNOWN_TOKEN_PATTERN を新形式 ghs_ App installation token に対応させる #2728 自体の contract rewrite は 実装: get_ci_failed_log.py の KNOWN_TOKEN_PATTERN を新形式 ghs_ App installation token に対応させる #2728 の issue-refinement-loop で扱う。
get_ci_failed_log.pyの diagnostic redaction bypass は 実装: get_ci_failed_log.py の KNOWN_TOKEN_PATTERN を新形式 ghs_ App installation token に対応させる #2728 の別 follow-up 候補であり、本 Issue では扱わない。
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
- 既存 test suite の一括移動。
.github/ci/python-test-plan.jsonの repo-wide 整理。- 新しい汎用 dependency graph / test ownership database / persistent schema の導入。
- 実装: get_ci_failed_log.py の KNOWN_TOKEN_PATTERN を新形式 ghs_ App installation token に対応させる #2728 の regex 修正そのもの。
- 再発防止: ghs_ installation token の synthetic fixture / terminology を共通化する #2753 の synthetic fixture 共通化。
- test placement と無関係な create-issue guard の再設計。
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/testsAllowed 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
.claude/skills/create-issue/SKILL.md.claude/skills/create-issue/references/body-authoring.md.claude/skills/post-merge-cleanup/SKILL.md.claude/skills/post-merge-cleanup-executor/SKILL.md.github/ci/python-test-plan.json- Issue 実装: get_ci_failed_log.py の KNOWN_TOKEN_PATTERN を新形式 ghs_ App installation token に対応させる #2728 / target review comment
- Issue 再発防止: ghs_ installation token の synthetic fixture / terminology を共通化する #2753(fixture/terminology drift との責務分離確認)
Scope Delta(任意)
N/A
Notes for Reviewer
- 優先度: optional_follow_up。
- 目的は guard/harness の増築ではなく、Issue authoring の事実確認を 1 つ追加して後工程の手戻りを減らすこと。
- 実装: get_ci_failed_log.py の KNOWN_TOKEN_PATTERN を新形式 ghs_ App installation token に対応させる #2728 の concrete failure を regression fixture に使い、同種の follow-up Issue で「候補ディレクトリに無い = repo に無い」という誤推論を防ぐ。
- dedupe_key: follow-up:squne121/loop-protocol:issue-2728:test-placement-ci-discovery
Source
- dedupe_key: follow-up:squne121/loop-protocol:issue-2728:test-placement-ci-discovery
- origin: adversarial review of Issue 実装: get_ci_failed_log.py の KNOWN_TOKEN_PATTERN を新形式 ghs_ App installation token に対応させる #2728
- source_comment: 実装: get_ci_failed_log.py の KNOWN_TOKEN_PATTERN を新形式 ghs_ App installation token に対応させる #2728 (comment)
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestfollow-up後続 Issue として切り出された follow-uptriage-requiredNeeds owner triage for priority decision
Activity
実装: 再発防止: 列挙型ACを aggregate test pass だけで充足扱いしない PR review 契約を追加する (#2774