Skip to content

実装: baseline VC preflight の Issue #393 snapshot fixture timeout を hermetic 化する #1796

Open

Description

@squne121

Machine-Readable Contract

contract_schema_version: v1
issue_kind: implementation
parent_issue: "none"
goal_ref: "Issue #393 snapshot fixture の baseline VC preflight が複数の実コマンドを90秒の単一テスト予算内で実行して timeout する問題を、構造検証と hermetic な実行検証へ分離して解消する"
change_kind: code|test|workflow

Parent Issue

なし(単独改善。#1764 の Ruff 設定変更には混入させない)

Parent Goal Ref

  • Goal: test_issue_393_snapshot_fixture_processed が current CI の python-test pipeline で決定論的に完了し、fixture の VC 形状と scope 分類を検証できること。
  • Desired Destination: baseline VC preflight の snapshot fixture 回帰テストを、全体 serial 隔離ではなく static parsing と最小 hermetic execution に分離する実装 Issue。

Current Validated Scope

  • .claude/skills/issue-contract-review/scripts/tests/test_baseline_vc_preflight.py::test_issue_393_snapshot_fixture_processed は19個の VC(pnpm/pytestを含む)を subprocess.run(..., timeout=90) で実行している。
  • このテストのアサーションは results の存在、件数、scope_class の列挙値だけであり、19個の実コマンド実行を必要としない。
  • .github/ci/python-test-plan.json は同テストディレクトリを python-test の対象に含めるため、テスト単体の予算超過はCIのparallel laneでも再現し得る。

Remaining Parent Gaps

なし

Outcome

Issue #393 snapshot fixture の構造検証を static-only preflight で10秒以内に完了し、別の最小 hermetic fixture で実行経路を決定論的に検証するテスト実装と実行予算の根拠が成果物として追加され、uv run --locked pytest の current python-test pipeline で timeout せず PASS する状態。

In Scope

  • test_issue_393_snapshot_fixture_processed を --static-only(または同等の parser-only API)で実行し、fixture 内のVC抽出・scope_class分類・結果件数を実コマンドなしで検証する。
  • 実行経路を検証する別テストを、tmp_path 配下の最小fixture(test -f 等の安全な単一観測コマンドのみ)と明示的な短い per-command/total test budget で追加する。
  • helper の timeout/argv をテストごとに明示し、snapshot fixture に90秒固定の実行予算を適用しない。timeout 発生時は fixture 名と budget を含む診断を保持する。
  • xdist parallel lane での再現性を確認し、python-test plan の lane 分割を変更せずに既存 pipeline と互換にする。

Out of Scope

Acceptance Criteria

  • AC1: test_issue_393_snapshot_fixture_processed は static-only/parser-only 経路を使い、pnpm、pytest、gh 等の外部実コマンドを起動せずに results 非空、全結果の scope_class が許可列挙値であることを検証する。
  • AC2: AC1 のテストは clean CI runner で10秒以内に完了する予算を持ち、timeout 失敗時に fixture 名と使用 budget を診断出力する。
  • AC3: 最小 hermetic fixture の実行テストは tmp_path のみを cwd とし、許可された単一観測コマンドの exit/classification/result schema を検証する。リポジトリ本体のファイルやネットワークへ依存しない。
  • AC4: helper の argv と timeout 設定に対する回帰テストが、snapshot fixture に本番相当の複数VC実行を再導入しないことを固定する。
  • AC5: current python-test pipeline の parallel lane で対象テストが PASS し、python-test plan の parallel/serial union と lane 分類を変更しない。

Verification Commands

# AC1
$ uv run --locked pytest .claude/skills/issue-contract-review/scripts/tests/test_baseline_vc_preflight.py::test_issue_393_snapshot_fixture_processed -q
# AC2
$ uv run --locked pytest .claude/skills/issue-contract-review/scripts/tests/test_baseline_vc_preflight.py::test_issue_393_snapshot_fixture_processed -q --durations=1
# AC3
$ uv run --locked pytest .claude/skills/issue-contract-review/scripts/tests/test_baseline_vc_preflight.py -k hermetic -q
# AC4
$ uv run --locked pytest .claude/skills/issue-contract-review/scripts/tests/test_baseline_vc_preflight.py -k 'issue_393 or hermetic' -q
# AC5
$ uv run --locked pytest .claude/skills/issue-contract-review/scripts/tests/test_baseline_vc_preflight.py -k 'issue_393 or hermetic' -n 2 -q

Allowed Paths

  • .claude/skills/issue-contract-review/scripts/tests/test_baseline_vc_preflight.py
  • .claude/skills/issue-contract-review/scripts/tests/test_baseline_vc_preflight.py::test_issue_393_snapshot_fixture_processed
  • .claude/skills/issue-contract-review/scripts/tests/test_baseline_vc_preflight.py::test_hermetic*
  • .claude/skills/issue-contract-review/scripts/tests/fixtures/issue_393_body.md

Stop Conditions

  • Allowed Paths 外の変更が必要と判明した場合
  • In Scope の固定契約(キー集合・スキーマ・型定義)の変更が必要になった場合
  • 新規 Issue の起票が必要と判断した場合(スコープ分割が発生する場合)
  • 後続 Phase / 別スコープへの波及が判明した場合
  • nested SubAgent delegation が必要になった場合
  • 外部サービス利用・権限昇格・既存テスト大規模改変が必要になった場合
  • static-only/parser-only API の変更が baseline_vc_preflight.py 本体に必要と判明した場合。
  • python-test plan の parallel/serial lane 分類を変更しないと AC5 を満たせない場合。

Required Skills

  • Python pytest

Required Design References

  • docs/dev/test-lane-policy.md
  • docs/dev/workflow.md
  • .github/ci/python-test-plan.json

Scope Delta(任意)

N/A

Delivery Rule

  • 1 Issue = 1 PR で完結する。
  • worktree: .claude/worktrees/issue-<番号>-baseline-vc-fixture-timeout
  • Draft PR を既定とする。

Notes for Reviewer

Activity

  1. added
    phase/implementation
    agent/implementer
    enhancement
    triage-required
    on Jul 26, 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

    agent/implementerenhancementphase/implementationtriage-required

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions