Skip to content

feat(agent-ops): broad regex VC を検出する vc_text_assert.py を追加し、positive assertion の unexpected_pass を事前に潰す #996

Open

Description

@squne121

背景

Issue #950 の AC2 VC rg -n "AC5.*localStorage snapshot" は broad すぎて、実装前から既存英語コメントに一致した。baseline preflight は unexpected_pass を検出したが、検出が遅く、review iteration を消費した。

In Scope

  • 汎用 text assertion helper vc_text_assert.py を追加する
    • vc_text_assert contains-all --path <file> --line-regex <pat> --literal <str>...
    • vc_text_assert not-contains --path <file> --literal <str>
  • helper を baseline preflight allowlist に追加する
  • Issue authoring docs に「複数語彙の同一行/同一ブロック確認は broad .* regex より helper 優先」と明記する

Out of Scope

  • rg コマンドの廃止
  • baseline preflight の全面置き換え

Acceptance Criteria

  • AC1: AC5.*localStorage snapshot のような broad rg fixture に warning または fail が出る
  • AC2: vc_text_assert contains-all は required literal が全部揃った場合のみ pass
  • AC3: 実装前 fixture では expected fail、実装後 fixture では pass になる
  • AC4: helper は single argv-safe command として baseline preflight から実行できる
  • AC5: helper は対象 path が Allowed Paths 外なら blocked になる

Allowed Paths

  • .claude/skills/issue-contract-review/scripts/vc_text_assert.py
  • .claude/skills/issue-contract-review/scripts/baseline_vc_preflight.py
  • .claude/skills/create-issue/references/body-authoring.md
  • .claude/skills/issue-contract-review/tests/**
  • tests/fixtures/**

Verification Commands

# AC1
# baseline-expect: fail
$ uv run pytest .claude/skills/issue-contract-review/tests/test_vc_text_assert.py -v

# AC2
# baseline-expect: fail
$ uv run python3 .claude/skills/issue-contract-review/scripts/vc_text_assert.py contains-all --path tests/fixtures/text/ac5-before.ts --line-regex "AC5" --literal "保持"

Runtime Verification Applicability

  • decision: not_applicable
  • reason: 新規スクリプト追加。pytest + fixture で完結。

Stop Conditions

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

Required Skills

なし

Parent Issue

none

Parent Goal Ref

  • Goal: broad regex VC の事前検出
  • Desired Destination: unexpected_pass が review 以前に検出される状態

Current Validated Scope

  • vc_text_assert.py の新規追加

Remaining Parent Gaps

なし

Outcome

broad regex VC が authoring 段階で warning / fail になる状態。

Activity

  1. added
    enhancement
    on Jun 18, 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

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions