Repository navigation
Open
Labels
agent/implementerAI implementer agentenhancementNew feature or requestphase/implementationImplementation phasetriage-requiredNeeds owner triage for priority decision
Description
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: codeParent 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 buildAllowed 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
- 参照: Issue 調査: baseline_vc_preflight rg exit2 判定と allowed_paths_review_gate fingerprint 必須要件の contract-review ブロック問題の対応方針を決定する #1324(research-only、方針決定), Issue 実装: UpgradeSystem で quote / atomic purchase / snapshot save を実装する #1281 / PR feat: add UpgradeSystem atomic purchase core (#1281) #1318(実例), Issue 実装: new-file VC preflight を missing Allowed Paths file として決定論的に分類する #1328(rg exit2 分類の姉妹 Issue)
- 採用方針:
allowed_paths_review_gate.pyの fingerprint 必須要件は維持する。expected fingerprint 欠落時のstatus: okfallback は reject 済み。本 Issue は reason/fix_hint の action-oriented 化に限定する。 - orchestrator(issue-contract-review)側で Allowed Paths 更新後に fresh go を自動的に再発行する決定論的経路が別途必要と判明した場合は、Stop Conditions に従い本 Issue のスコープに含めず follow-up Issue を起票する。
Metadata
Metadata
Assignees
Labels
agent/implementerAI implementer agentenhancementNew feature or requestphase/implementationImplementation phasetriage-requiredNeeds owner triage for priority decision
Activity