Skip to content

実装: catalog consumer contract tests — positive/negative fixture と pytest(#131 FU-4) #520

Open

Description

@squne121

Machine-Readable Contract

contract_schema_version: v1
issue_kind: implementation
parent_issue: "#131"
goal_ref: "catalog の positive / negative fixture を追加し、catalog validator と PR body validator の consumer pipeline を pytest で検証する"
change_kind: feature

Parent Issue

#131

Parent Goal Ref

  • Goal: schema governance の consumer pipeline を fixture で再現可能に検証する
  • Desired Destination: catalog の正常・異常入力が validator pipeline を通して決定論的に判定される

Current Validated Scope

Remaining Parent Gaps

Outcome

schemas/examples/ の positive / negative catalog fixture と、catalog validator および PR body validator pipeline を通す pytest が追加され、正常入力は pass、consumer 欠落入力は fail-close として検証される。

Background

ADR 0003 の Pact 的検証方針に従い、unit helper だけでなく consumer pipeline を fixture で通す。

In Scope

  • positive / negative catalog fixture を schemas/examples/ に追加する
  • fixture を validate_schema_catalog.py と validator pipeline の public entrypoint から検証する pytest を追加する
  • consumer 欠落を expected failure として確認する

Out of Scope

Acceptance Criteria

  • AC1: schemas/examples/catalog.valid.yaml が存在し validator pytest で pass する
  • AC2: schemas/examples/catalog.invalid-missing-consumer.yaml が存在し consumer 欠落として fail-close を確認できる
  • AC3: fixture test が validate_schema_catalog.py と PR body validator pipeline の public entrypoint を通す

Runtime Verification Applicability

decision: not_applicable
applicable_acs: []
reason: "fixture と pytest により決定論的に検証する"

Verification Commands

# AC1
$ uv run --locked pytest .claude/skills/open-pr/scripts/tests/test_validate_schema_catalog.py -q

# AC2
$ uv run --locked pytest .claude/skills/open-pr/scripts/tests/test_validate_schema_catalog.py -q

# AC3
$ uv run --locked pytest .claude/skills/open-pr/scripts/tests/test_validate_schema_catalog.py -q

Allowed Paths

  • schemas/examples/
  • .claude/skills/open-pr/scripts/tests/test_validate_schema_catalog.py

Stop Conditions

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

Required Skills

  • Python 3
  • pytest

Required Design References

  • docs/adr/0003-schema-catalog-adoption.md
  • .claude/skills/open-pr/SKILL.md

Scope Delta(任意)

N/A

Delivery Rule(配信ルール)

  • 1 Issue = 1 PR で完結する
  • worktree: .claude/worktrees/issue-520-schema-catalog-fixtures
  • Draft PR を既定とする

Notes for Reviewer(レビュアー向け補足)

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

    enhancementphase/implementation

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions