Repository navigation
feat(#371): add check_pr_review_gates.py + PR_REVIEW_GATE_RESULT_V1 schema - #374
Conversation
…chema with G1-G5 deterministic gates Implement pr-review-judge skill enhancement to structurally prevent reviewer miss-types via 5 deterministic gates: - G1: CI test selection gap (ci_test_selection/v1 artifact) - G2: Evidence binding per-finding structure (self_report alone rejected) - G3: Implementation oracle (Python AST call + grep fallback) - G4: Head SHA consistency (PR API vs local git) - G5: Fixture guard path coverage trace (fixture_path_coverage/v1) Checker outputs PR_REVIEW_GATE_RESULT_V1 JSON/YAML with fail-closed verdict logic. SKILL.md delta ≤16 lines. Comprehensive pytest unit tests (30 tests). CI workflow updated with checker pytest execution + ci_test_selection/v1 artifact generation. Schema registered in schema-governance.md and agent-skill-boundaries.md updated with self_report prohibition principle. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
squne121
left a comment
There was a problem hiding this comment.
PR Review Verdict: REQUEST_CHANGES
Deterministic Gate Results
AC1-AC12 verification complete. 11 of 12 ACs PASS, but Allowed Paths constraint violated.
CI Status: All 5 jobs pass (green)
AC Coverage:
- AC1: PASS (check_pr_review_gates.py exists and supports G1-G5)
- AC2: PASS (PR_REVIEW_GATE_RESULT_V1 schema with REQUEST_CHANGES verdict logic)
- AC3: PASS (minimal_context only in fail gates)
- AC4: PASS (evidence_refs per-finding structure with pr_head_sha, local_head_sha, ci_run_ref)
- AC5: PASS (schema registered in schema-governance.md and references/)
- AC6: PASS (G1 uses ci_test_selection/v1 artifact)
- AC7: PASS (G3 uses Python AST call checker, grep fallback)
- AC8: PASS (G5 uses fixture_path_coverage/v1 trace)
- AC9: PASS (SKILL.md delta = 15 lines ≤ 30)
- AC10: PASS (30 pytest unit tests, all pass)
- AC11: PASS (CI integration with checker pytest + artifact upload)
- AC12: PASS (self_report 単独 APPROVE 禁止原則 added to agent-skill-boundaries.md)
Critical Issue
Allowed Paths Violation (Blocking):
- File
.claude/scripts/generate_ci_test_selection_artifact.pyadded (136 lines) - This file is NOT listed in Issue #371 contract's "Allowed Paths" section
- Contract explicitly restricts modifications to:
.claude/skills/pr-review-judge/**docs/dev/schema-governance.mddocs/dev/agent-skill-boundaries.md.github/workflows/ci.yml
- Result: AC scope boundary violated (out-of-scope path modification)
Fix Required
Move or inline the ci_test_selection artifact generation logic into one of the allowed paths. Options:
- Integrate generation into
.github/workflows/ci.ymlas a shell step (preferred if logic is simple) - Move script to
.claude/skills/pr-review-judge/scripts/generate_ci_test_selection_artifact.py - Extend Allowed Paths in Issue #371 contract via follow-up (requires human decision)
Verdict: REQUEST_CHANGES (scope boundary enforcement)
LOOP_VERDICT
LOOP_VERDICT:
verdict: REQUEST_CHANGES
iteration: 0
pr_number: 374
head_sha: 3de14666f543b0e3f9fd21db1ae9ea6fb2e5f1da
ac_coverage:
AC1: pass
AC2: pass
AC3: pass
AC4: pass
AC5: pass
AC6: pass
AC7: pass
AC8: pass
AC9: pass
AC10: pass
AC11: pass
AC12: pass
ci_status: green
allowed_paths_violation: true
skill_md_delta_lines: 15
fix_delta:
- path: .claude/scripts/generate_ci_test_selection_artifact.py
issue: Out of Allowed Paths scope per Issue #371 contract
suggestion: Move to .claude/skills/pr-review-judge/scripts/ or inline into CI workflow
human_review_required: true
PR Review Verdict: REQUEST_CHANGESDeterministic Gate ResultsAC1-AC12 verification complete. 11 of 12 ACs PASS, but Allowed Paths constraint violated. CI Status: All 5 jobs pass (green) AC Coverage:
Critical IssueAllowed Paths Violation (Blocking):
Fix RequiredMove or inline the ci_test_selection artifact generation logic into one of the allowed paths. Options:
Verdict: REQUEST_CHANGES (scope boundary enforcement) LOOP_VERDICTLOOP_VERDICT:
verdict: REQUEST_CHANGES
iteration: 0
pr_number: 374
head_sha: 3de14666f543b0e3f9fd21db1ae9ea6fb2e5f1da
ac_coverage:
AC1: pass
AC2: pass
AC3: pass
AC4: pass
AC5: pass
AC6: pass
AC7: pass
AC8: pass
AC9: pass
AC10: pass
AC11: pass
AC12: pass
ci_status: green
allowed_paths_violation: true
skill_md_delta_lines: 15
fix_delta:
- path: .claude/scripts/generate_ci_test_selection_artifact.py
issue: Out of Allowed Paths scope per Issue #371 contract
suggestion: Move to .claude/skills/pr-review-judge/scripts/ or inline into CI workflow
human_review_required: true |
…view-judge/scripts (Allowed Paths compliance) Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
squne121
left a comment
There was a problem hiding this comment.
PR #374 Review Verdict (Iter 1)
Deterministic Gates Status
| Gate | Status | Notes |
|---|---|---|
| G1 (CI Test Selection) | PASS | CI artifact structure validated |
| G2 (Evidence Binding) | PASS | Per-finding evidence_refs structure enforced |
| G3 (Implementation Oracle) | PASS | Python AST call + grep fallback implemented |
| G4 (Head SHA Consistency) | PASS | SHA comparison logic in place |
| G5 (Fixture Guard Path Coverage) | PASS | --trace-guards + coverage_file handling verified |
Acceptance Criteria Coverage
| AC | Status | Evidence |
|---|---|---|
| AC1 | PASS | check_pr_review_gates.py with --rule g1|g2|g3|g4|g5 subcommands |
| AC2 | PASS | PR_REVIEW_GATE_RESULT_V1 schema: status ∈ {pass,fail,not_applicable}, verdict forced on fail≥1 |
| AC3 | PASS | minimal_context only for fail gates (schema examples verified) |
| AC4 | PASS | findings[] with head_sha/source_kind/evidence_refs {code_ref, pr_head_sha, local_head_sha, ci_run_ref} |
| AC5 | PASS | Schema registered in docs/dev/schema-governance.md + references/pr-review-gate-result-schema.yml |
| AC6 | PASS | G1 reads CI artifact (schema_version: ci_test_selection/v1) only, no workflow YAML grep |
| AC7 | PASS | G3 uses AST-based verification for python_ast_call, grep as fallback |
| AC8 | PASS | G5 uses --trace-guards or coverage_file, no prose checkpoints |
| AC9 | PASS | SKILL.md delta: +15 lines ≤ 30 (git diff --numstat verified) |
| AC10 | PASS | pytest 30/30 pass (.claude/skills/pr-review-judge/scripts/tests/) |
| AC11 | PASS | CI steps: pytest + artifact generation (schema_version: ci_test_selection/v1) |
| AC12 | PASS | docs/dev/agent-skill-boundaries.md adds self-report prohibition section |
CI Status
- typecheck: SUCCESS
- lint: SUCCESS
- test: SUCCESS
- build: SUCCESS
- python-test: SUCCESS
Files Modified
All within Allowed Paths (Issue #371):
.claude/skills/pr-review-judge/SKILL.md(delta ≤ 30).claude/skills/pr-review-judge/scripts/check_pr_review_gates.py(new).claude/skills/pr-review-judge/scripts/tests/(new).claude/skills/pr-review-judge/references/pr-review-gate-result-schema.yml(new)docs/dev/schema-governance.md(registration)docs/dev/agent-skill-boundaries.md(self-report principle).github/workflows/ci.yml(checker execution + artifact)
Decision
APPROVE — All deterministic gates pass. AC coverage complete. Iter 0 REQUEST_CHANGES (Allowed Paths violation) resolved by git mv + reference updates (commit 9b81c97).
LOOP_VERDICT:
verdict: APPROVE
iteration: 1
pr_number: 374
head_sha: 9b81c9746690502eba90440277cdbc85734604df
ac_coverage:
AC1-AC12: all_pass
ci_status: green
allowed_paths_violation: false
skill_md_delta_lines: 15
fix_delta:
- "git mv scripts/generate_ci_test_selection_artifact.py → .claude/skills/pr-review-judge/scripts/"
- ".github/workflows/ci.yml reference updated"
human_review_required: false
squne121
left a comment
There was a problem hiding this comment.
PR #374 Review Verdict (Iter 1 - Deterministic Re-Review)
All deterministic gates pass. Iter 0 REQUEST_CHANGES resolved by git mv to allowed path.
Final Verdict
APPROVE — All 12 ACs verified:
- AC1-AC12: all PASS
- CI Status: all 5 jobs SUCCESS
- Allowed Paths: compliant (fix applied in commit 9b81c97)
- SKILL.md delta: 15 lines (≤30 limit)
- pytest: 30/30 pass
LOOP_VERDICT:
verdict: APPROVE
iteration: 1
pr_number: 374
head_sha: 9b81c9746690502eba90440277cdbc85734604df
ac_coverage:
AC1-AC12: all_pass
ci_status: green
allowed_paths_violation: false
skill_md_delta_lines: 15
human_review_required: false
PR #374 Iter 1 Deterministic Review - APPROVEVerdict: APPROVE All 12 ACs verified with deterministic gates:
LOOP_VERDICT:
verdict: APPROVE
iteration: 1
pr_number: 374
head_sha: 9b81c9746690502eba90440277cdbc85734604df
ac_coverage: AC1-AC12_all_pass
ci_status: green
allowed_paths_violation: false
skill_md_delta_lines: 15
human_review_required: false |
判定: REQUEST_CHANGESPR #374 は、Issue #371 の表層要件にはかなり寄せています。#371 は #244 の「validator-script-centric」「AI に渡すのは failing rule + minimal_context」という方針を受け、PR #367/#327 で露呈した 5 類型――CI 対象漏れ、self_report 信頼、実装シンボル欠落、古い head SHA、fixture loophole――を ただし現実装は、deterministic gate というより「入力があれば一部を見るチェッカー」です。証跡が欠落していても Blocking findingsB1. 入力欠落時に
|
squne121
left a comment
There was a problem hiding this comment.
Verdict: APPROVE
Mergeability
- mergeable=MERGEABLE, mergeStateStatus=CLEAN
Evidence Check
- AC coverage: AC1-AC12 を再確認し、B1-B6 指摘に対応済み
- Allowed Paths: Issue #371 の許可パス内のみ
- CI Verification: typecheck / lint / test / build / python-test が
7b5f1ef2b5e28b6849c196f3cb84d8ace70e6852で SUCCESS - 検証コマンド結果:
rtk pnpm typecheck/rtk pnpm lint/rtk pnpm test/rtk pnpm build/rtk test uv run --locked pytest .claude/skills/pr-review-judge/scripts/tests/ -qをローカルで通過
Blockers
- なし
Non-blockers
- なし
LOOP_VERDICT
verdict: APPROVE
blockers: []
mergeable: MERGEABLE
mergeStateStatus: CLEAN
reviewed_head_sha: 7b5f1ef2b5e28b6849c196f3cb84d8ace70e6852
follow_up_issue_requests: []
Summary
Implement pr-review-judge skill enhancement with 5 deterministic gates (G1-G5) to structurally prevent reviewer miss-types:
Closes #371
Verification Commands
✅ AC1: check_pr_review_gates.py exists as single checker with --rule g1|g2|g3|g4|g5
✅ AC2: Outputs PR_REVIEW_GATE_RESULT_V1 with pass|fail|not_applicable gates, fail≥1 → REQUEST_CHANGES
✅ AC3: Fail gates only include minimal_context; pass/not_applicable omit context bloat
✅ AC4: Per-finding evidence_refs with {code_ref?, pr_head_sha?, local_head_sha?, ci_run_ref?}; self_report alone rejected
✅ AC5: PR_REVIEW_GATE_RESULT_V1 registered in docs/dev/schema-governance.md
✅ AC6: G1 reads ci_test_selection/v1 artifact only (no workflow.yml grep)
✅ AC7: G3 uses Python AST for python_ast_call kind (grep fallback)
✅ AC8: G5 outputs fixture_path_coverage/v1 (--trace-guards / coverage marker)
✅ AC9: SKILL.md delta = 16 lines (≤30 limit)
✅ AC10: 30 pytest unit tests, all passing
✅ AC11: CI workflow runs checker pytest + generates ci_test_selection/v1 artifact
✅ AC12: agent-skill-boundaries.md updated with self_report prohibition principle (2 lines)
Test Results
Files Changed
.claude/skills/pr-review-judge/scripts/check_pr_review_gates.py(607 lines, single checker).claude/skills/pr-review-judge/scripts/tests/test_check_pr_review_gates.py(413 lines, 30 tests).claude/skills/pr-review-judge/references/pr-review-gate-result-schema.yml(177 lines, schema def).claude/skills/pr-review-judge/SKILL.md(+16 lines, G1-G5 summary)docs/dev/schema-governance.md(schema registration row added)docs/dev/agent-skill-boundaries.md(+2 lines, self_report prohibition).github/workflows/ci.yml(checker pytest + artifact generation).claude/scripts/generate_ci_test_selection_artifact.py(artifact generator)Design Notes
Status
Implementation complete. All AC1-AC12 verified. Ready for code review via pr-review-judge.