Skip to content

実装: issue-contract-review fingerprint refresh path を明示する #1329

Open

Description

@squne121

Machine-Readable Contract

contract_schema_version: v1
issue_kind: implementation
parent_issue: "none"
goal_ref: "allowed_paths_review_gate.py の fingerprint 必須要件を維持したまま、expected_contract_fingerprint 欠落時の回復経路(fresh contract-review go の再発行)を明示する"
change_kind: code

Parent Issue

none

Parent Goal Ref

  • Goal: 新規ファイル追加を伴う implementation Issue で issue-contract-review の status:go が構造的に発行できない問題を解消する
  • Desired Destination: N/A(parent なし、単独改善)

Current Validated Scope

  • .claude/skills/pr-review-judge/scripts/allowed_paths_review_gate.py の fingerprint 必須要件(expected_contract_fingerprint / contract_source_kind / contract_source_id)は変更せず維持する
  • expected_contract_fingerprint 欠落時の reason / fix_hint を action-oriented にし、contract refresh required 相当の次アクションを明示する
  • 対応するテストを .claude/skills/pr-review-judge/tests/test_allowed_paths_review_gate.py に追加する

Remaining Parent Gaps

なし

Outcome

.claude/skills/pr-review-judge/scripts/allowed_paths_review_gate.py の evaluate() が、expected_contract_fingerprint 欠落時に引き続き status: indeterminate を返しつつ、reviewer が次に取るべき行動(issue-contract-review の再実行によるfresh fingerprint再発行)を reason フィールドで明示するように更新され、.claude/skills/pr-review-judge/tests/test_allowed_paths_review_gate.py に追加されたテストが全件 PASS している状態。fingerprint 欠落時に status: ok へ昇格させる fallback が存在しないことがテストで固定されている。

In Scope

  • .claude/skills/pr-review-judge/scripts/allowed_paths_review_gate.py の evaluate()(現行 if self.expected_contract_fingerprint is None: 分岐、L677-681)の reason メッセージを、expected_contract_fingerprint_missing の事実提示だけでなく、reviewer が取るべき次アクション(issue-contract-review 再実行によるfresh fingerprint 再発行)を含む action-oriented な文言に更新する
  • contract_source_kind/contract_source_id 欠落時(L671-675)の reason も同様に action-oriented にする
  • expected_contract_fingerprint 欠落時に status: ok へ昇格させる fallback を実装しない(reject 済みの (b) 案を作らないことをテストで明示的に固定する)
  • fresh fingerprint が発行され self.expected_contract_fingerprint == result.contract_fingerprint の場合のみ status: ok を許可する既存動作(L692-696, L759-764)を変更せず、回帰テストで固定する

Out of Scope

  • baseline_vc_preflight.py の rg exit code 分類ロジック(別 Issue 実装: new-file VC preflight を missing Allowed Paths file として決定論的に分類する #1328 で扱う)
  • issue-contract-review の orchestrator 側で fresh contract-review go を自動的に再実行するロジックの新規実装(本 Issue は allowed_paths_review_gate.py の reason/fix_hint 明確化に限定し、orchestrator 変更が必要と判明した場合は Stop Conditions に従い follow-up に分離する)
  • PR files API pagination 対応

Acceptance Criteria

  • AC1: expected_contract_fingerprint が None の場合、evaluate() は status: indeterminate を返し、reason に issue-contract-review の再実行(fresh fingerprint 再発行)を促す action-oriented な文言が含まれる
  • AC2: contract_source_kind または contract_source_id が欠落している場合、evaluate() は status: indeterminate を返し、reason に action-oriented な次アクションが含まれる
  • AC3: stale fingerprint(expected_contract_fingerprint != result.contract_fingerprint)の場合、status: stale_snapshot を返す既存動作が回帰しない
  • AC4: fresh fingerprint が一致し、changed files が Allowed Paths 内の場合、status: ok を返す既存動作が回帰しない
  • AC5: expected_contract_fingerprint 欠落時に status: ok を返す fallback が存在しないことを固定するテストが追加されている(欠落時は必ず indeterminate であることを assert する)
  • AC6: 上記すべてのテストが .claude/skills/pr-review-judge/tests/test_allowed_paths_review_gate.py に追加され pass する

Verification Commands

# AC1
$ uv run --locked pytest .claude/skills/pr-review-judge/tests/test_allowed_paths_review_gate.py

# AC2
$ uv run --locked pytest .claude/skills/pr-review-judge/tests/test_allowed_paths_review_gate.py

# AC3
$ uv run --locked pytest .claude/skills/pr-review-judge/tests/test_allowed_paths_review_gate.py

# AC4
$ uv run --locked pytest .claude/skills/pr-review-judge/tests/test_allowed_paths_review_gate.py

# AC5
$ uv run --locked pytest .claude/skills/pr-review-judge/tests/test_allowed_paths_review_gate.py

# AC6
$ pnpm typecheck
$ pnpm lint
$ pnpm test
$ pnpm build

Allowed Paths

  • .claude/skills/pr-review-judge/scripts/allowed_paths_review_gate.py
  • .claude/skills/pr-review-judge/tests/test_allowed_paths_review_gate.py

Stop Conditions

  • Allowed Paths 外の変更が必要と判明した場合
  • In Scope の固定契約(キー集合・スキーマ・型定義)の変更が必要になった場合
  • 新規 Issue の起票が必要と判断した場合(スコープ分割が発生する場合)
  • orchestrator 側の自動再実行ロジックが別途必要と判明した場合(follow-up Issue 化を検討する)
  • 後続 Phase / 別スコープへの波及が判明した場合
  • nested SubAgent delegation が必要になった場合
  • 外部サービス利用・権限昇格・既存テスト大規模改変が必要になった場合
  • fingerprint 必須要件を弱める実装(fallback OK 等)が必要と判断した場合は即座に停止し人間判断を仰ぐ

Required Skills

なし

Scope Delta(任意)

N/A

Notes for Reviewer

Activity

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