Repository navigation
Open
Labels
Description
Machine-Readable Contract
contract_schema_version: v1
issue_kind: implementation
parent_issue: "none"
goal_ref: "vc_negative_grep_without_literal_inventory warning を inventory marker の実質確認と複数 negative grep pattern に対応させる"
change_kind: codeParent Issue
none
Parent Goal Ref
- Goal: review-issue checker の vc_negative_grep_without_literal_inventory warning を、marker 存在チェック以上に削除対象 literal の実質確認、および
! rg以外の negative grep pattern(if rg ...; then exit 1、test "$(rg ... | wc -l)" -eq 0等)にも対応させる - Desired Destination: N/A
Current Validated Scope
.claude/skills/review-issue/scripts/check_issue_contract.pyのdetect_warning_vc_negative_grep_without_literal_inventory()関数を拡張:- inventory marker(
removed_paths|削除対象|deleted_files|literal_list)の後続に path/literal item が 1 件以上あることを必須化 - 既存
! rg/! grepパターンに加え、if rg ...; then exit 1、test "$(rg ... | wc -l)" -eq 0、rg ... && exit 1形式も検出
- inventory marker(
.claude/skills/review-issue/tests/test_check_issue_contract_c12.pyに fixture-driven test を追加
Remaining Parent Gaps
なし
Outcome
detect_warning_vc_negative_grep_without_literal_inventory() が (1) inventory marker の後続に literal item 1 件以上を要求、(2) 4 種の negative grep pattern(! rg、! grep、if rg ... then exit 1、test wc -eq 0 形式)を検出、(3) 削除対象 literal と禁止 pattern を区別する evidence を出力するようになった状態。
In Scope
detect_warning_vc_negative_grep_without_literal_inventory()の改善:- inventory marker detection:marker 行の直後に path/file 列挙が 1 件以上あることを regex で検査(e.g.,
removed_paths:\n - <path>or削除対象\n- <literal>) - negative grep pattern enumeration:以下 4 パターンを regex で抽出
! rg/! grep(既存)if rg ... then exit 1/if grep ... then exit 1test "$(rg ... | wc -l)" -eq 0/ 同 grep 版rg ... && exit 1/ 同 grep 版
- evidence 分類:
deleted_literalsとnegation_patternsを別フィールドに出力
- inventory marker detection:marker 行の直後に path/file 列挙が 1 件以上あることを regex で検査(e.g.,
- fixture-driven test:
- positive: negation grep + 削除対象 literal 列挙なし → warning
- negative: negation grep + 削除対象 literal 列挙あり → warning なし
- positive: 複数 pattern 形式(if/test/&& exit)のみ → warning
Out of Scope
- 削除 VC 以外の anti-pattern 追加
- 新規 warning code 追加
- literal item の形式検証(path / filename / glob など)
Acceptance Criteria
- AC1: inventory marker 後続に literal 0 件の場合、warning が発火する
- AC2:
! rg/! greppattern 検出ロジック維持、test を PASS - AC3:
if rg ... then exit 1形式が検出される(rg sentinel で確認) - AC4:
test "$(rg ... | wc -l)" -eq 0形式が検出される - AC5:
rg ... && exit 1形式が検出される - AC6: positive/negative fixture テスト(
test_vc_negative_grep_inventory_marker_*/test_vc_negative_grep_pattern_variants_*)が 3 件以上追加され全 PASS - AC7: evidence が
deleted_literalsとnegation_patternsを別フィールドで出力する
Verification Commands
rg -n "if_rg_then_exit|wc_eq_zero|negation_patterns|deleted_literals" .claude/skills/review-issue/scripts/check_issue_contract.py— 新規 pattern + evidence 分類ロジック存在確認rg -n "test_vc_negative_grep" .claude/skills/review-issue/tests/— 新規 test ケース存在確認uv run pytest .claude/skills/review-issue/tests/test_check_issue_contract_c12.py -k vc_negative_grep -v— vc_negative_grep 関連テスト全 PASSpnpm typecheck— TypeScript 型エラーなしpnpm lint— ESLint エラーなし
Stop Conditions
- Allowed Paths 外の変更が必要と判明した場合
- In Scope の固定契約(pattern セット、evidence schema)の変更が必要になった場合
- 新規 Issue の起票が必要と判断した場合(スコープ分割が発生する場合)
- 後続 Phase / 別スコープへの波及が判明した場合
- nested SubAgent delegation が必要になった場合
- 外部サービス利用・権限昇格・既存テスト大規模改変が必要になった場合
Required Skills
- Python 3 / regex(複数 pattern enumeration)
- pytest fixture 設計
Scope Delta(任意)
N/A
Source
- dedupe_key:
follow-up:squne121/loop-protocol:pr/390:vc_negative_grep_patterns - source_pr: feat(#338): consolidate review-issue checker SSOT with C12 + warnings, shrink SKILL.md #390
- source_review_comment: feat(#338): consolidate review-issue checker SSOT with C12 + warnings, shrink SKILL.md #390 (comment)
- parent_pr_merge_commit: 4eb53bf
Activity