Skip to content

fix: separate allowed-paths diff and snapshot bases (#1296) - #1297

Merged
squne121 merged 8 commits into
mainfrom
worktree-issue-1296-pr-review-judge-allowed-paths-gate-diff
Jul 3, 2026
Merged

squne121 merged 8 commits into
mainfrom
worktree-issue-1296-pr-review-judge-allowed-paths-gate-diff

Conversation

@squne121

@squne121 squne121 commented Jul 2, 2026 •

Copy link
Copy Markdown
Owner

Summary

この概要セクションは reviewer 指摘への修正点を日本語で要約する。

Issue #1296 の allowed paths gate で、snapshot freshness 用の base_sha_at_snapshot と changed files 算出用の diff base を、入力 surface から明示分離しました。
今回の修正では Python API / CLI の legacy base_sha 入力 alias を削除し、current_base_sha と head_sha から evaluator 内で git merge-base を計算して local fallback を検証します。
外部入力の diff_base_sha が計算値と一致しない場合は indeterminate とし、changed_files_source: git_diff_current_merge_base_head は current merge-base を実際に検証できた場合だけ使います。

ALLOWED_PATHS_GATE_RESULT_V1 の top-level base_sha は diff_base_sha alias として維持します。
一方で provenance の追加保証は script output に限定し、現時点では LOOP_VERDICT_V2.allowed_paths_gate schema 自体が diff_base_sha や contract_fingerprint.base_sha_at_snapshot を直接 carry するとまでは主張しません。

受け入れ条件の達成状況

  • AllowedPathsGateEvaluator / CLI / test helper から legacy base_sha 単入力を除去し、base_sha_at_snapshot と current_base_sha / diff_base_sha を明示入力に統一した。
  • evaluator が git merge-base <current_base_sha> <head_sha> を内部計算し、外部入力の diff_base_sha が不一致なら indeterminate に倒すようにした。
  • changed_files_source: git_diff_current_merge_base_head は current merge-base を検証できた場合だけ出力し、未検証経路は git_diff_unvalidated_diff_base_head のまま merge-blocking になる。
  • update-branch 相当の実 git DAG fixture で false positive 回避と true violation 維持を確認し、snapshot base を diff_base_sha として流した場合の reject も追加で固定した。
  • test_allowed_paths_matcher_v2.py を含む Python tests を explicit input へ更新し、source hierarchy と consumer impact の説明を docs / SKILL / PR body で同期した。

検証コマンド結果

  • script 側の diff_base_sha 分離確認: rg -n "diff_base_sha" .claude/skills/pr-review-judge/scripts/allowed_paths_review_gate.py
  • false positive 回避テスト存在確認: rg -n "test_update_branch_no_false_positive" .claude/skills/pr-review-judge/tests/
  • 真の violation 維持テスト存在確認: rg -n "test_update_branch_true_violation_blocks" .claude/skills/pr-review-judge/tests/
  • freshness 分離テスト存在確認: rg -n "test_diff_base_sha_does_not_affect_freshness" .claude/skills/pr-review-judge/tests/
  • script と tests の provenance 確認: rg -n "diff_base_sha" .claude/skills/pr-review-judge/scripts/allowed_paths_review_gate.py .claude/skills/pr-review-judge/tests/
  • docs / SKILL の source policy 同期確認: rg -n "git_diff_current_merge_base_head" .claude/skills/pr-review-judge/references/allowed-paths-gate.md .claude/skills/pr-review-judge/SKILL.md
  • 実装と tests の source 名確認: rg -n "git_diff_current_merge_base_head" .claude/skills/pr-review-judge/scripts/allowed_paths_review_gate.py .claude/skills/pr-review-judge/tests/
  • review gate 全体 pytest: uv run pytest .claude/skills/pr-review-judge/tests/test_allowed_paths_review_gate.py -q → 43 passed
  • matcher v2 pytest: uv run pytest .claude/skills/pr-review-judge/tests/test_allowed_paths_matcher_v2.py -q → 12 passed
  • SKILL.md 日本語チェック: uv run python3 .claude/skills/create-issue/scripts/validate_japanese_content.py --file .claude/skills/pr-review-judge/SKILL.md
  • reference 日本語チェック: uv run python3 .claude/skills/create-issue/scripts/validate_japanese_content.py --file .claude/skills/pr-review-judge/references/allowed-paths-gate.md

Allowed Paths 遵守

  • この PR の変更パスは以下の 5 件のみで、Issue 実装: pr-review-judge の allowed_paths gate を diff base と snapshot base で分離する #1296 の Allowed Paths 内に収まる。
    • .claude/skills/pr-review-judge/SKILL.md
    • .claude/skills/pr-review-judge/references/allowed-paths-gate.md
    • .claude/skills/pr-review-judge/scripts/allowed_paths_review_gate.py
    • .claude/skills/pr-review-judge/tests/test_allowed_paths_matcher_v2.py
    • .claude/skills/pr-review-judge/tests/test_allowed_paths_review_gate.py
  • preferred oracle は引き続き github_pull_request_files_api / gh_pr_diff_name_only とし、この PR は deterministic local fallback の authority を厳密化する範囲に留めた。

Checks

  • 検証結果を本 PR body に反映した。
  • runtime fixture の回帰テストを test_allowed_paths_review_gate.py に含めた。

Schema Change Applicability

この変更は additive provenance と validation ルールの調整であり、既存 consumer への破壊的変更はない。

- decision: not_schema_change
- reason: `ALLOWED_PATHS_GATE_RESULT_V1` の additive provenance と validation ルールの調整であり、既存 consumer に破壊的変更は入れていない。

Schema Consumer Inventory

該当なし
理由: 追加 provenance は script output に出るが、現時点では LOOP_VERDICT_V2.allowed_paths_gate schema がそれを直接 carry する前提へは広げていない。

Safety Claim Matrix

Claim Implemented? Not controlled Evidence Follow-up
snapshot base と diff base の入力経路を分離し、single base_sha で両方を満たす実用経路を除去した Yes test_allowed_paths_matcher_v2.py, test_allowed_paths_review_gate.py なし
local fallback は current merge-base を evaluator 内で計算・検証できた場合だけ git_diff_current_merge_base_head を名乗る Yes test_diff_base_sha_must_equal_current_merge_base, test_changed_files_source_does_not_claim_current_merge_base_when_unvalidated なし
stale snapshot base を diff_base_sha として流しても reject され、update-branch false positive 条件を再導入しない Yes test_stale_snapshot_base_as_diff_base_is_rejected_or_indeterminate なし
rename / previous_filename metadata まで含む path provenance Yes local fallback は git diff --name-only の範囲であり rename metadata は扱わない follow-up issue: #1300(https://github.com/squne121/loop-protocol/issues/1300)

Notes

関連する実装 Issue は #1296 であり、closing keyword も維持する。

関連 Issue は #1296 です。Closes #1296.

@github-actions

github-actions Bot commented Jul 2, 2026 •

Copy link
Copy Markdown
Contributor

Preview URL

✅ verified live assets: https://squne121.github.io/loop-protocol/pr-1297/

The preview will be removed when this PR is closed.

@squne121

squne121 commented Jul 2, 2026

Copy link
Copy Markdown
Owner Author
TEST_VERDICT:
  result: FAIL
  issue_number: 1296
  pr_number: 1297
  head_sha: "90347f5a5931334eea144d42ce352ae83d36e309"
  mergeable: MERGEABLE
  merge_state_status: BLOCKED
  branch_behind_main: false
  baseline_only: false
  verification_commands_pass: 9
  verification_commands_fail: 1
  verification_skipped_count: 0
  runtime_ac_results:
    - ac: AC1
      command: 'rg -n "diff_base_sha" .claude/skills/pr-review-judge/scripts/allowed_paths_review_gate.py'
      exit_code: 0
      status: pass
      fallback_detected: false
      artifact_present: not_required
      human_review_required: false
      stop_condition_triggered: false
      notes: 'diff_base_sha の分離実装を確認'
    - ac: AC2
      command: 'rg -n "test_update_branch_no_false_positive" .claude/skills/pr-review-judge/tests/'
      exit_code: 0
      status: pass
      fallback_detected: false
      artifact_present: not_required
      human_review_required: false
      stop_condition_triggered: false
      notes: 'update_branch false positive 回帰テストを確認'
    - ac: AC3
      command: 'rg -n "test_update_branch_true_violation_blocks" .claude/skills/pr-review-judge/tests/'
      exit_code: 0
      status: pass
      fallback_detected: false
      artifact_present: not_required
      human_review_required: false
      stop_condition_triggered: false
      notes: 'update_branch true violation 回帰テストを確認'
    - ac: AC4
      command: 'rg -n "test_diff_base_sha_does_not_affect_freshness" .claude/skills/pr-review-judge/tests/'
      exit_code: 0
      status: pass
      fallback_detected: false
      artifact_present: not_required
      human_review_required: false
      stop_condition_triggered: false
      notes: 'freshness 分離テストを確認'
    - ac: AC5
      command: 'rg -n "diff_base_sha" .claude/skills/pr-review-judge/scripts/allowed_paths_review_gate.py .claude/skills/pr-review-judge/tests/'
      exit_code: 0
      status: pass
      fallback_detected: false
      artifact_present: not_required
      human_review_required: false
      stop_condition_triggered: false
      notes: 'script と tests の provenance field を確認'
    - ac: AC6
      command: 'rg -n "git_diff_current_merge_base_head" .claude/skills/pr-review-judge/references/allowed-paths-gate.md .claude/skills/pr-review-judge/SKILL.md'
      exit_code: 0
      status: pass
      fallback_detected: false
      artifact_present: not_required
      human_review_required: false
      stop_condition_triggered: false
      notes: 'docs と SKILL の source policy 同期を確認'
    - ac: AC7
      command: 'rg -n "git_diff_current_merge_base_head" .claude/skills/pr-review-judge/scripts/allowed_paths_review_gate.py .claude/skills/pr-review-judge/tests/'
      exit_code: 0
      status: pass
      fallback_detected: false
      artifact_present: not_required
      human_review_required: false
      stop_condition_triggered: false
      notes: '実装とテストの source 名を確認'
    - ac: AC2
      command: 'uv run pytest .claude/skills/pr-review-judge/tests/test_allowed_paths_review_gate.py -q'
      exit_code: 0
      status: pass
      fallback_detected: false
      artifact_present: not_required
      human_review_required: false
      stop_condition_triggered: false
      notes: '40 passed in 0.13s'
    - ac: AC2
      command: >-
        uv run pytest .claude/skills/pr-review-judge/tests/test_allowed_paths_review_gate.py -k 'update_branch_no_false_positive or update_branch_true_violation_blocks or diff_base_sha_does_not_affect_freshness or result_schema_includes_diff_base_sha_and_snapshot_fingerprint' -v
      exit_code: 0
      status: pass
      fallback_detected: false
      artifact_present: not_required
      human_review_required: false
      stop_condition_triggered: false
      notes: '4 passed, 36 deselected'
    - ac: CI1
      command: 'uv run pytest .claude/skills/pr-review-judge/tests/test_allowed_paths_matcher_v2.py::test_ac8_evaluator_returns_ok_not_indeterminate -q'
      exit_code: 1
      status: fail
      fallback_detected: false
      artifact_present: not_required
      human_review_required: false
      stop_condition_triggered: false
      notes: "AllowedPathsGateEvaluator.__init__() got an unexpected keyword argument 'base_sha'; current worktree reproduces the python-test CI failure"
  ci_check_result:
    name: python-test
    status: failure
    details_url: https://github.com/squne121/loop-protocol/actions/runs/28626906980/job/84895320739
    failing_test: .claude/skills/pr-review-judge/tests/test_allowed_paths_matcher_v2.py::test_ac8_evaluator_returns_ok_not_indeterminate
    failing_reason: "TypeError: AllowedPathsGateEvaluator.__init__() got an unexpected keyword argument 'base_sha'"
    ci_merge_state_status: BLOCKED

@squne121 squne121 left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TEST_VERDICT:
  result: FAIL
  mergeable: MERGEABLE
  merge_state_status: BEHIND
  branch_behind_main: true
  baseline_only: false
  verification_commands_pass: 10
  verification_commands_fail: 1
  verification_skipped_count: 0
  runtime_ac_results:
    - ac: AC1
      command: 'rg -n "diff_base_sha" .claude/skills/pr-review-judge/scripts/allowed_paths_review_gate.py'
      exit_code: 0
      status: pass
      fallback_detected: false
      artifact_present: not_required
      human_review_required: false
      stop_condition_triggered: false
      notes: 'diff_base_sha の分離実装を確認'
    - ac: AC2
      command: 'rg -n "test_update_branch_no_false_positive" .claude/skills/pr-review-judge/tests/'
      exit_code: 0
      status: pass
      fallback_detected: false
      artifact_present: not_required
      human_review_required: false
      stop_condition_triggered: false
      notes: 'update_branch false positive 回帰テストを確認'
    - ac: AC3
      command: 'rg -n "test_update_branch_true_violation_blocks" .claude/skills/pr-review-judge/tests/'
      exit_code: 0
      status: pass
      fallback_detected: false
      artifact_present: not_required
      human_review_required: false
      stop_condition_triggered: false
      notes: 'update_branch true violation 回帰テストを確認'
    - ac: AC4
      command: 'rg -n "test_diff_base_sha_does_not_affect_freshness" .claude/skills/pr-review-judge/tests/'
      exit_code: 0
      status: pass
      fallback_detected: false
      artifact_present: not_required
      human_review_required: false
      stop_condition_triggered: false
      notes: 'freshness 分離テストを確認'
    - ac: AC5
      command: 'rg -n "diff_base_sha" .claude/skills/pr-review-judge/scripts/allowed_paths_review_gate.py .claude/skills/pr-review-judge/tests/'
      exit_code: 0
      status: pass
      fallback_detected: false
      artifact_present: not_required
      human_review_required: false
      stop_condition_triggered: false
      notes: 'script と tests の provenance field を確認'
    - ac: AC6
      command: 'rg -n "git_diff_current_merge_base_head" .claude/skills/pr-review-judge/references/allowed-paths-gate.md .claude/skills/pr-review-judge/SKILL.md'
      exit_code: 0
      status: pass
      fallback_detected: false
      artifact_present: not_required
      human_review_required: false
      stop_condition_triggered: false
      notes: 'docs と SKILL の source policy 同期を確認'
    - ac: AC7
      command: 'rg -n "git_diff_current_merge_base_head" .claude/skills/pr-review-judge/scripts/allowed_paths_review_gate.py .claude/skills/pr-review-judge/tests/'
      exit_code: 0
      status: pass
      fallback_detected: false
      artifact_present: not_required
      human_review_required: false
      stop_condition_triggered: false
      notes: '実装とテストの source 名を確認'
    - ac: AC8
      command: 'uv run pytest .claude/skills/pr-review-judge/tests/test_allowed_paths_review_gate.py -q'
      exit_code: 0
      status: pass
      fallback_detected: false
      artifact_present: not_required
      human_review_required: false
      stop_condition_triggered: false
      notes: '40 passed in 0.15s'
    - ac: AC9
      command: 'uv run pytest .claude/skills/pr-review-judge/tests/test_allowed_paths_review_gate.py -k ''update_branch_no_false_positive or update_branch_true_violation_blocks or diff_base_sha_does_not_affect_freshness or result_schema_includes_diff_base_sha_and_snapshot_fingerprint'' -v'
      exit_code: 0
      status: pass
      fallback_detected: false
      artifact_present: not_required
      human_review_required: false
      stop_condition_triggered: false
      notes: '4 passed, 36 deselected'
    - ac: JP1
      command: 'gh pr view 1297 --repo squne121/loop-protocol --json body --jq .body | python3 .claude/skills/create-issue/scripts/validate_japanese_content.py --threshold 0.1'
      exit_code: 0
      status: pass
      fallback_detected: false
      artifact_present: not_required
      human_review_required: false
      stop_condition_triggered: false
      notes: 'current PR body validation passed locally'
    - ac: CI1
      command: 'uv run --locked python3 .claude/skills/pr-review-judge/scripts/ci_verdict_summary.py --pr 1297 --repo squne121/loop-protocol --expected-head-sha 0ed582ce1fe0e79f0507ea5399eebb0171f6853e'
      exit_code: 10
      status: fail
      fallback_detected: false
      artifact_present: not_required
      human_review_required: false
      stop_condition_triggered: false
      notes: 'status=failed; failed_checks=[PR Body Japanese Check]; head_sha=current head'

@squne121 squne121 left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LOOP_VERDICT_V2:
  verdict: APPROVE
  reviewed_head_sha: "0ed582ce1fe0e79f0507ea5399eebb0171f6853e"
  merge_ready: false
  mergeability:
    mergeable: MERGEABLE
    merge_state_status: BEHIND
  blockers: []
  required_auto_actions:
    - kind: update_branch
      executor: implementation-worker
      skill: implement-issue.update_branch
      blocking_merge_ready: true
      mechanical: true
      expected_head_sha: "0ed582ce1fe0e79f0507ea5399eebb0171f6853e"
  auto_fix_applied: []
  follow_up_issue_requests: []
  allowed_paths_gate:
    status: ok
  allowed_paths_gate_source: review_subagent

@squne121

squne121 commented Jul 2, 2026

Copy link
Copy Markdown
Owner Author
TEST_VERDICT:
  result: FAIL
  issue_number: 1296
  pr_number: 1297
  head_sha: "cd63c2bf58426c4c7a59edd9731821035e09ca88"
  mergeable: MERGEABLE
  merge_state_status: BLOCKED
  branch_behind_main: false
  baseline_only: false
  verification_commands_pass: 9
  verification_commands_fail: 0
  verification_skipped_count: 0
  runtime_ac_results:
    - ac: AC1
      command: "rg -n \"diff_base_sha\" .claude/skills/pr-review-judge/scripts/allowed_paths_review_gate.py"
      exit_code: 0
      status: pass
      fallback_detected: false
      artifact_present: not_required
      human_review_required: false
      stop_condition_triggered: false
    - ac: AC2
      command: "rg -n \"test_update_branch_no_false_positive\" .claude/skills/pr-review-judge/tests/"
      exit_code: 0
      status: pass
      fallback_detected: false
      artifact_present: not_required
      human_review_required: false
      stop_condition_triggered: false
    - ac: AC3
      command: "rg -n \"test_update_branch_true_violation_blocks\" .claude/skills/pr-review-judge/tests/"
      exit_code: 0
      status: pass
      fallback_detected: false
      artifact_present: not_required
      human_review_required: false
      stop_condition_triggered: false
    - ac: AC4
      command: "rg -n \"test_diff_base_sha_does_not_affect_freshness\" .claude/skills/pr-review-judge/tests/"
      exit_code: 0
      status: pass
      fallback_detected: false
      artifact_present: not_required
      human_review_required: false
      stop_condition_triggered: false
    - ac: AC5
      command: "rg -n \"diff_base_sha\" .claude/skills/pr-review-judge/scripts/allowed_paths_review_gate.py .claude/skills/pr-review-judge/tests/"
      exit_code: 0
      status: pass
      fallback_detected: false
      artifact_present: not_required
      human_review_required: false
      stop_condition_triggered: false
    - ac: AC6
      command: "rg -n \"git_diff_current_merge_base_head\" .claude/skills/pr-review-judge/references/allowed-paths-gate.md .claude/skills/pr-review-judge/SKILL.md"
      exit_code: 0
      status: pass
      fallback_detected: false
      artifact_present: not_required
      human_review_required: false
      stop_condition_triggered: false
    - ac: AC7
      command: "rg -n \"git_diff_current_merge_base_head\" .claude/skills/pr-review-judge/scripts/allowed_paths_review_gate.py .claude/skills/pr-review-judge/tests/"
      exit_code: 0
      status: pass
      fallback_detected: false
      artifact_present: not_required
      human_review_required: false
      stop_condition_triggered: false
    - ac: AC2
      command: "uv run pytest .claude/skills/pr-review-judge/tests/test_allowed_paths_review_gate.py -q"
      exit_code: 0
      status: pass
      fallback_detected: false
      artifact_present: not_required
      human_review_required: false
      stop_condition_triggered: false
    - ac: AC2
      command: "uv run pytest .claude/skills/pr-review-judge/tests/test_allowed_paths_review_gate.py -k 'update_branch_no_false_positive or update_branch_true_violation_blocks or diff_base_sha_does_not_affect_freshness or result_schema_includes_diff_base_sha_and_snapshot_fingerprint' -v"
      exit_code: 0
      status: pass
      fallback_detected: false
      artifact_present: not_required
      human_review_required: false
      stop_condition_triggered: false
  ci_check_result:
    name: "PR Body Japanese Check"
    status: failure
    details_url: "https://github.com/squne121/loop-protocol/actions/runs/28628050258/job/84898820648"
    blocker: "required PR-head check failed on current head"
    observed_pending:
      - name: "python-test"
        status: pending
        details_url: "https://github.com/squne121/loop-protocol/actions/runs/28628050282/job/84898820961"

@squne121

squne121 commented Jul 2, 2026

Copy link
Copy Markdown
Owner Author
TEST_VERDICT:
  result: FAIL
  issue_number: 1296
  pr_number: 1297
  head_sha: "cd63c2bf58426c4c7a59edd9731821035e09ca88"
  mergeable: MERGEABLE
  merge_state_status: UNSTABLE
  branch_behind_main: false
  baseline_only: false
  verification_commands_pass: 9
  verification_commands_fail: 0
  verification_skipped_count: 0
  runtime_ac_results:
    - ac: AC1
      command: "rg -n \"diff_base_sha\" .claude/skills/pr-review-judge/scripts/allowed_paths_review_gate.py"
      exit_code: 0
      status: pass
    - ac: AC2
      command: "rg -n \"test_update_branch_no_false_positive\" .claude/skills/pr-review-judge/tests/"
      exit_code: 0
      status: pass
    - ac: AC3
      command: "rg -n \"test_update_branch_true_violation_blocks\" .claude/skills/pr-review-judge/tests/"
      exit_code: 0
      status: pass
    - ac: AC4
      command: "rg -n \"test_diff_base_sha_does_not_affect_freshness\" .claude/skills/pr-review-judge/tests/"
      exit_code: 0
      status: pass
    - ac: AC5
      command: "rg -n \"diff_base_sha\" .claude/skills/pr-review-judge/scripts/allowed_paths_review_gate.py .claude/skills/pr-review-judge/tests/"
      exit_code: 0
      status: pass
    - ac: AC6
      command: "rg -n \"git_diff_current_merge_base_head\" .claude/skills/pr-review-judge/references/allowed-paths-gate.md .claude/skills/pr-review-judge/SKILL.md"
      exit_code: 0
      status: pass
    - ac: AC7
      command: "rg -n \"git_diff_current_merge_base_head\" .claude/skills/pr-review-judge/scripts/allowed_paths_review_gate.py .claude/skills/pr-review-judge/tests/"
      exit_code: 0
      status: pass
    - ac: AC2
      command: "uv run pytest .claude/skills/pr-review-judge/tests/test_allowed_paths_review_gate.py -q"
      exit_code: 0
      status: pass
    - ac: AC2
      command: "uv run pytest .claude/skills/pr-review-judge/tests/test_allowed_paths_review_gate.py -k 'update_branch_no_false_positive or update_branch_true_violation_blocks or diff_base_sha_does_not_affect_freshness or result_schema_includes_diff_base_sha_and_snapshot_fingerprint' -v"
      exit_code: 0
      status: pass
  ci_check_result:
    name: "PR Body Japanese Check"
    status: failure
    details_url: "https://github.com/squne121/loop-protocol/actions/runs/28628050258/job/84898820648"
    blocker: "required PR-head check failed on current head"
    live_ci_snapshot:
      - name: "python-test"
        status: success
      - name: "test"
        status: success
      - name: "e2e"
        status: success
      - name: "build"
        status: success
      - name: "lint"
        status: success
      - name: "ci-verdict-summary"
        status: success

@squne121

squne121 commented Jul 2, 2026 •

Copy link
Copy Markdown
Owner Author
TEST_VERDICT:
  result: PASS
  issue_number: 1296
  pr_number: 1297
  head_sha: "49420036e4d5585c8392b377fb5087d730440c12"
  mergeable: MERGEABLE
  merge_state_status: CLEAN
  branch_behind_main: false
  baseline_only: false
  verification_commands_pass: 9
  verification_commands_fail: 0
  verification_skipped_count: 0
  runtime_ac_results:
    - ac: AC1
      command: 'rg -n "diff_base_sha" .claude/skills/pr-review-judge/scripts/allowed_paths_review_gate.py'
      exit_code: 0
      status: pass
      fallback_detected: false
      artifact_present: not_required
      human_review_required: false
      stop_condition_triggered: false
      notes: 'diff_base_sha 分離実装を確認'
    - ac: AC2
      command: 'rg -n "test_update_branch_no_false_positive" .claude/skills/pr-review-judge/tests/'
      exit_code: 0
      status: pass
      fallback_detected: false
      artifact_present: not_required
      human_review_required: false
      stop_condition_triggered: false
      notes: 'update_branch false positive 回帰テストを確認'
    - ac: AC3
      command: 'rg -n "test_update_branch_true_violation_blocks" .claude/skills/pr-review-judge/tests/'
      exit_code: 0
      status: pass
      fallback_detected: false
      artifact_present: not_required
      human_review_required: false
      stop_condition_triggered: false
      notes: 'update_branch true violation 回帰テストを確認'
    - ac: AC4
      command: 'rg -n "test_diff_base_sha_does_not_affect_freshness" .claude/skills/pr-review-judge/tests/'
      exit_code: 0
      status: pass
      fallback_detected: false
      artifact_present: not_required
      human_review_required: false
      stop_condition_triggered: false
      notes: 'freshness 分離テストを確認'
    - ac: AC5
      command: 'rg -n "diff_base_sha" .claude/skills/pr-review-judge/scripts/allowed_paths_review_gate.py .claude/skills/pr-review-judge/tests/'
      exit_code: 0
      status: pass
      fallback_detected: false
      artifact_present: not_required
      human_review_required: false
      stop_condition_triggered: false
      notes: 'script と tests の provenance field を確認'
    - ac: AC6
      command: 'rg -n "git_diff_current_merge_base_head" .claude/skills/pr-review-judge/references/allowed-paths-gate.md .claude/skills/pr-review-judge/SKILL.md'
      exit_code: 0
      status: pass
      fallback_detected: false
      artifact_present: not_required
      human_review_required: false
      stop_condition_triggered: false
      notes: 'docs と SKILL の source policy 同期を確認'
    - ac: AC7
      command: 'rg -n "git_diff_current_merge_base_head" .claude/skills/pr-review-judge/scripts/allowed_paths_review_gate.py .claude/skills/pr-review-judge/tests/'
      exit_code: 0
      status: pass
      fallback_detected: false
      artifact_present: not_required
      human_review_required: false
      stop_condition_triggered: false
      notes: '実装とテストの source 名を確認'
    - ac: AC2
      command: 'uv run pytest .claude/skills/pr-review-judge/tests/test_allowed_paths_review_gate.py -q'
      exit_code: 0
      status: pass
      fallback_detected: false
      artifact_present: not_required
      human_review_required: false
      stop_condition_triggered: false
      notes: '40 passed in 0.16s'
    - ac: AC2
      command: >-
        uv run pytest .claude/skills/pr-review-judge/tests/test_allowed_paths_review_gate.py -k 'update_branch_no_false_positive or update_branch_true_violation_blocks or diff_base_sha_does_not_affect_freshness or result_schema_includes_diff_base_sha_and_snapshot_fingerprint' -v
      exit_code: 0
      status: pass
      fallback_detected: false
      artifact_present: not_required
      human_review_required: false
      stop_condition_triggered: false
      notes: '4 passed, 36 deselected'
  ci_check_result:
    name: ci-verdict-summary
    status: all_pass
    details_url: https://github.com/squne121/loop-protocol/actions/runs/28628335344/job/84899988481
    head_sha: "49420036e4d5585c8392b377fb5087d730440c12"
    required_checks:
      - name: typecheck
        status: success
      - name: lint
        status: success
      - name: test
        status: success
      - name: build
        status: success
      - name: e2e
        status: success
      - name: python-test
        status: success
      - name: node-backed-hook-tests
        status: success
      - name: actionlint
        status: success
      - name: PR Body Japanese Check
        status: success

@squne121 squne121 left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LOOP_VERDICT_V2:
  verdict: REQUEST_CHANGES
  reviewed_head_sha: "49420036e4d5585c8392b377fb5087d730440c12"
  merge_ready: false
  mergeability:
    mergeable: MERGEABLE
    merge_state_status: CLEAN
  blockers:
    - "provided contract_snapshot_url is stale: snapshot body_sha256=sha256:0538c1699f9c2239a2400338b907fceacb3877eb9ec8a368b10293b468f6be41, current issue body sha256=sha256:fed1badab3984637060dc38d802ab80bc529f0ffb388235299705f54da3a9f96; rerun issue-contract-review for Issue #1296 before merge-ready judgment"
  required_auto_actions:
    - kind: update_pr_body_hygiene
      executor: implementation-worker
      skill: open-pr.update_pr
      blocking_merge_ready: true
      mechanical: true
  auto_fix_applied: []
  follow_up_issue_requests: []
  allowed_paths_gate:
    status: stale_snapshot
  allowed_paths_gate_source: review_subagent
  evidence_refs:
    - contract_snapshot_url: https://github.com/squne121/loop-protocol/issues/1296#issuecomment-4871082434
    - latest_test_verdict: https://github.com/squne121/loop-protocol/pull/1297#issuecomment-4871335419
    - live_issue_body: gh issue view 1296 --repo squne121/loop-protocol --json body,updatedAt
    - pr_changed_files: gh pr diff 1297 --repo squne121/loop-protocol --name-only
    - ci_verdict_summary: uv run --locked python3 .claude/skills/pr-review-judge/scripts/ci_verdict_summary.py --pr 1297 --repo squne121/loop-protocol --expected-head-sha 49420036e4d5585c8392b377fb5087d730440c12

@squne121 squne121 left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LOOP_VERDICT_V2

LOOP_VERDICT_V2:
  verdict: APPROVE
  reviewed_head_sha: "49420036e4d5585c8392b377fb5087d730440c12"
  merge_ready: true
  mergeability:
    mergeable: MERGEABLE
    merge_state_status: CLEAN
  blockers: []
  required_auto_actions: []
  auto_fix_applied: []
  follow_up_issue_requests: []
  allowed_paths_gate:
    status: ok
  allowed_paths_gate_source: review_subagent

@squne121

squne121 commented Jul 3, 2026

Copy link
Copy Markdown
Owner Author

結論: REQUEST_CHANGES

実装方向は概ね正しいですが、この PR はまだ merge-ready と見るべきではありません。理由は単純で、PR の中心主張である「snapshot base と diff base の分離」が、出力名・一部テスト上は分離されている一方で、入力 surface と provenance の保証ではまだ分離し切れていないためです。

現 PR は draft/open で、head は 49420036e4d5585c8392b377fb5087d730440c12、変更は 4 ファイル、PR 本文では base_sha_at_snapshot と diff_base_sha の分離、base_sha の backward-compatible alias 維持、40 tests pass を主張しています。 直近 head の workflow runs は connector 上では全て success です。 ただし、敵対レビューでは CI success よりも「契約が本当に閉じているか」を優先します。


Blocker 1: base_sha 入力 alias が、Issue #1296 の禁止経路を残している

Issue #1296 の根本問題は、旧実装が base_sha 1 個を contract_fingerprint.base_sha_at_snapshot と git diff --name-only {base}...{head} の両方に使っていたことです。Issue 本文は、local fallback では diff_base_sha = merge-base(current_base_tip, head_sha) を使い、base_sha_at_snapshot を diff 算出へ渡す経路を禁止すると明記しています。

しかし現在の実装は、AllowedPathsGateEvaluator.__init__ で base_sha_at_snapshot / diff_base_sha / base_sha をすべて optional にし、resolved_diff_base_sha = diff_base_sha or base_sha、resolved_base_sha_at_snapshot = base_sha_at_snapshot or base_sha として、単一の base_sha から両方を復元できます。 これは「後方互換」ではなく、#1296 が除去したかった結合経路の温存です。

さらに、この alias は死んだ互換コードではありません。既存の test_allowed_paths_matcher_v2.py は _make_evaluator() で base_sha="basesha" だけを渡し、明示的な base_sha_at_snapshot / diff_base_sha を渡していません。 つまり、PR は「明示分離した」と主張しながら、テスト互換性のために旧 single-base API を実用経路として残しています。

要求修正:
入力としての base_sha alias は削除してください。残してよいのは 出力の top-level base_sha を diff_base_sha alias とすることだけです。Python caller と既存テストはすべて base_sha_at_snapshot と diff_base_sha を明示する形へ更新するべきです。どうしても legacy input を残すなら、review mode では indeterminate に落とし、changed_files_source も git_diff_current_merge_base_head ではなく git_diff_legacy_base_head のような低信頼 source に分ける必要があります。


Blocker 2: git_diff_current_merge_base_head と名乗っているが、current merge-base を計算も検証もしていない

現在の get_changed_files_from_git() は、渡された self.diff_base_sha をそのまま git diff --name-only {diff_base_sha}...{head_sha} に渡します。 CLI 側も diff_base_sha = args.diff_base_sha or args.base_sha として受け取るだけで、current_base_tip との git merge-base を内部計算・検証していません。

これは source label の詐称に近いです。reference doc は diff_base_sha を git merge-base <current_base_tip> <head_sha> 相当と定義しています。 しかし実装が保証しているのは「呼び出し元が diff_base_sha と称して渡した SHA を使う」ことだけです。

外部仕様上、この差は重要です。Git の A...B diff は $(git merge-base A B) と B の diff です。つまり stale な snapshot base を A として渡せば、PR が gh pr update-branch 後に base 側変更を含む merge commit を持つ場合、もとの false positive 条件を再現できます。(Git) gh pr update-branch は既定では base branch を PR branch に merge commit として取り込むため、このケースは実運用上あり得ます。([GitHub CLI]2)

現在追加された DAG fixture は良い方向ですが、正常値の diff_base_sha を作って渡しているだけです。 そのため「呼び出し元が stale snapshot base を diff_base_sha として渡したら拒否されるか」は検証していません。

要求修正:
--current-base-sha か、検証済みの base_ref tip を明示入力に追加し、evaluator 内で computed_diff_base_sha = git merge-base <current_base_tip> <head_sha> を計算してください。--diff-base-sha を外部から受け取る場合は、computed_diff_base_sha と一致しなければ indeterminate にするべきです。source label git_diff_current_merge_base_head は、この検証が成立した場合にだけ使えます。

追加すべきテストは最低限これです。

test_diff_base_sha_must_equal_current_merge_base
test_stale_snapshot_base_as_diff_base_is_rejected_or_indeterminate
test_changed_files_source_does_not_claim_current_merge_base_when_unvalidated

Blocker 3: CLI と Python API の互換性方針が矛盾している

CLI は --base-sha-at-snapshot を required にし、--diff-base-sha または deprecated --base-sha を changed-files diff base として受けます。 一方で Python constructor は base_sha だけでも snapshot base と diff base の両方を満たせます。

PR 本文は「既存 consumer は base_sha を継続利用できる」と説明していますが、実際には「CLI では base_sha_at_snapshot が必須」「Python API では base_sha だけで両方に入る」という二重仕様になっています。 これは監査ログとして悪い状態です。どの surface から実行したかで、同じ base_sha という語の意味が変わります。

要求修正:
互換性方針をどちらかに寄せてください。

  • 推奨: 入力 API は破壊的に明示化し、base_sha input alias を削除する。出力 base_sha だけを diff_base_sha alias として維持する。
  • 代替: legacy input mode を正式に別扱いし、changed_files_source: git_diff_legacy_base_head、status: indeterminate など、merge-ready 判定に使えない低信頼結果に落とす。

現状の「新旧どちらも動くが source は新仕様扱い」は false green を作ります。


Blocker 4: LOOP_VERDICT_V2.allowed_paths_gate consumer impact の説明が過大

PR 本文は、LOOP_VERDICT_V2.allowed_paths_gate consumer が必要に応じて diff_base_sha と contract_fingerprint.base_sha_at_snapshot を読めるようになる、と説明しています。 しかしリポジトリ内の LOOP_VERDICT_V2 schema は、allowed_paths_gate に status しか持っていません。

ALLOWED_PATHS_GATE_RESULT_V1 自体には diff_base_sha と contract_fingerprint.base_sha_at_snapshot が出ます。 ただし、それが LOOP_VERDICT_V2.allowed_paths_gate へ渡るとは schema 上読めません。pr-review-judge/SKILL.md も pr-reviewer が監査結果を LOOP_VERDICT_V2.allowed_paths_gate として受け渡すと書く一方、最小 schema は status 中心です。

要求修正:
PR 本文の consumer impact を下げるか、schema/doc を明示的に更新してください。少なくとも以下のどちらかが必要です。

allowed_paths_gate:
  status: ok
  result_ref: <comment-url-or-artifact-path>

または

allowed_paths_gate:
  status: ok
  diff_base_sha: <sha>
  contract_fingerprint:
    base_sha_at_snapshot: <sha>

現状のままだと、provenance は script output には存在しますが、loop verdict consumer がそれを読めるという主張は強すぎます。


Major: preferred oracle との関係が実装・docs で弱い

Issue #1296 は preferred oracle として GitHub PR files API / gh pr diff --name-only、local fallback として git_diff_current_merge_base_head を定義しています。 PR files API は PR の changed files を列挙する公式 API で、pagination と最大 3000 files の上限が明記されています。([GitHub Docs]3) gh pr diff --name-only も PR の changed file names を見る公式 CLI surface です。([GitHub CLI]4)

今回の実装範囲が GitHub API への全面移行を Out of Scope とするのは Issue と整合します。ただし、その場合でも docs は「local fallback だけを新しい正本のように書く」のではなく、source hierarchy と制約を残すべきです。Compare API は comparison の files が最大 300 files などの制約を持つため、PR 境界の file oracle としては Pull Request files API より弱い点も明記しておくべきです。([GitHub Docs]5)

要求修正:
references/allowed-paths-gate.md に次を明記してください。

changed_files_source_policy:
  preferred_oracle:
    - github_pull_request_files_api
    - gh_pr_diff_name_only
  deterministic_local_fallback:
    - git_diff_current_merge_base_head
  forbidden:
    - git_diff_snapshot_base_head

現在の reference doc は local fallback の説明としては良いですが、preferred oracle の優先順位と API 制約が薄いです。


Major: rename / previous filename の blind spot が残る

この PR の直接スコープ外かもしれませんが、Allowed Paths gate としては無視できません。現在の local fallback は git diff --name-only なので、file status や rename の previous_filename を扱いません。 GitHub の compare/changed files 形式では renamed file に previous_filename が出る仕様があり、path boundary audit では旧 path と新 path の両方を見る余地があります。([GitHub Docs]5)

たとえば「Allowed Paths 外の既存ファイルを Allowed Paths 内へ rename する」ケースをどう扱うかが、現 gate の契約にありません。単なる content diff ではなく repo path boundary enforcement なら、rename 元も監査対象にするべきです。

要求修正候補:
本 PR で直さないなら follow-up を要求してください。PR files API / git diff --name-status / rename metadata の扱いを決め、filename と previous_filename の両方を Allowed Paths 判定に入れるか、少なくとも rename は indeterminate に倒すべきです。


Minor: SKILL.md の差分に不要な文体変更が多い

.claude/skills/pr-review-judge/SKILL.md は、必要な ALLOWED_PATHS_GATE_RESULT_V1 説明追加以外に、見出しや箇条書きの日本語化・言い換えが多く入っています。 今回の Issue は diff base / snapshot base の分離が目的であり、reviewer skill 全体の文体整理は無関係です。

これは機能上の blocker ではありませんが、gate / reviewer tooling の変更では noise を減らすべきです。差分が広いと、将来の blame と regression review が難しくなります。

要求修正:
SKILL.md の変更は、ALLOWED_PATHS_GATE_RESULT_V1 の base 分離説明に必要な箇所へ絞ることを推奨します。現在の relevant な追加は、snapshot freshness 用 base_sha_at_snapshot と local fallback 用 diff_base_sha を別物として扱う説明です。


良い点

追加された update_branch 相当の temp git repo fixture は、今回の問題をテストとして固定する方向として正しいです。fixture は snapshot base、feature 側 allowed change、main 側 unrelated change、feature branch への merge を作り、merge-base(current_base_tip, head_sha) を diff_base_sha として返しています。 false positive 回避と true violation 維持の両方をテストしている点も妥当です。

また、reference doc が contract_fingerprint.base_sha_at_snapshot、diff_base_sha、base_sha alias、changed_files_source を明示した点は改善です。 これは #812 の trailing slash false positive や #1233 の matcher v2 grammar で見えていた「gate 仕様文書が弱いと誤検知・誤停止が再発する」履歴に対して、正しい方向です。


推奨する修正セット

  1. AllowedPathsGateEvaluator.__init__ から input base_sha alias を削除する。
  2. test_allowed_paths_matcher_v2.py の _make_evaluator() を base_sha_at_snapshot / diff_base_sha 明示に更新する。
  3. CLI に --current-base-sha を追加し、内部で git merge-base <current_base_sha> <head_sha> を計算する。
  4. --diff-base-sha を残すなら、computed value と一致する場合だけ受理する。
  5. changed_files_source を検証済み source と未検証 source で分ける。
  6. LOOP_VERDICT_V2.allowed_paths_gate に provenance を載せないなら、PR 本文の consumer impact を「script output の provenance に限る」と修正する。
  7. preferred oracle として GitHub PR files API / gh pr diff --name-only を reference doc に残す。
  8. rename / previous filename の扱いを follow-up issue にするか、この PR で indeterminate 扱いを追加する。

最終判定

REQUEST_CHANGES。

この PR は「正しい方向の半分」までは来ています。compute_contract_fingerprint() が base_sha_at_snapshot を使い、git diff が diff_base_sha を使うようになった点は有効です。 ただし、base_sha input alias と未検証 diff_base_sha のままでは、PR が掲げる git_diff_current_merge_base_head の安全性は保証されません。

この gate は worker self-report を canonical にしないための review-subagent boundary audit です。親 Issue #557/#758 の設計意図は、worker の自己申告ではなく PR 境界で独立再計算した ALLOWED_PATHS_GATE_RESULT_V1 を canonical にすることです。 その中核部で provenance が曖昧なまま merge-ready にするのは、設計上の後退です。

@squne121

squne121 commented Jul 3, 2026

Copy link
Copy Markdown
Owner Author
TEST_VERDICT:
  result: PASS
  issue_number: 1296
  pr_number: 1297
  head_sha: "deb3c9ee08536744734353398479aee579dd163a"
  mergeable: MERGEABLE
  merge_state_status: CLEAN
  branch_behind_main: false
  baseline_only: false
  verification_commands_pass: 11
  verification_commands_fail: 0
  verification_skipped_count: 0
  runtime_ac_results:
    - ac: AC1
      command: 'rg -n "diff_base_sha" .claude/skills/pr-review-judge/scripts/allowed_paths_review_gate.py'
      exit_code: 0
      status: pass
      fallback_detected: false
      artifact_present: not_required
      human_review_required: false
      stop_condition_triggered: false
    - ac: AC2
      command: 'rg -n "test_update_branch_no_false_positive" .claude/skills/pr-review-judge/tests/'
      exit_code: 0
      status: pass
      fallback_detected: false
      artifact_present: not_required
      human_review_required: false
      stop_condition_triggered: false
    - ac: AC3
      command: 'rg -n "test_update_branch_true_violation_blocks" .claude/skills/pr-review-judge/tests/'
      exit_code: 0
      status: pass
      fallback_detected: false
      artifact_present: not_required
      human_review_required: false
      stop_condition_triggered: false
    - ac: AC4
      command: 'rg -n "test_diff_base_sha_does_not_affect_freshness" .claude/skills/pr-review-judge/tests/'
      exit_code: 0
      status: pass
      fallback_detected: false
      artifact_present: not_required
      human_review_required: false
      stop_condition_triggered: false
    - ac: AC5
      command: 'rg -n "diff_base_sha" .claude/skills/pr-review-judge/scripts/allowed_paths_review_gate.py .claude/skills/pr-review-judge/tests/'
      exit_code: 0
      status: pass
      fallback_detected: false
      artifact_present: not_required
      human_review_required: false
      stop_condition_triggered: false
    - ac: AC6
      command: 'rg -n "git_diff_current_merge_base_head" .claude/skills/pr-review-judge/references/allowed-paths-gate.md .claude/skills/pr-review-judge/SKILL.md'
      exit_code: 0
      status: pass
      fallback_detected: false
      artifact_present: not_required
      human_review_required: false
      stop_condition_triggered: false
    - ac: AC7
      command: 'rg -n "git_diff_current_merge_base_head" .claude/skills/pr-review-judge/scripts/allowed_paths_review_gate.py .claude/skills/pr-review-judge/tests/'
      exit_code: 0
      status: pass
      fallback_detected: false
      artifact_present: not_required
      human_review_required: false
      stop_condition_triggered: false
    - ac: runtime_test_allowed_paths_review_gate
      command: 'uv run pytest .claude/skills/pr-review-judge/tests/test_allowed_paths_review_gate.py -q'
      exit_code: 0
      status: pass
      fallback_detected: false
      artifact_present: not_required
      human_review_required: false
      stop_condition_triggered: false
      notes: '43 passed in 0.26s'
    - ac: runtime_test_allowed_paths_matcher_v2
      command: 'uv run pytest .claude/skills/pr-review-judge/tests/test_allowed_paths_matcher_v2.py -q'
      exit_code: 0
      status: pass
      fallback_detected: false
      artifact_present: not_required
      human_review_required: false
      stop_condition_triggered: false
      notes: '12 passed in 0.03s'
    - ac: runtime_japanese_skill
      command: 'uv run python3 .claude/skills/create-issue/scripts/validate_japanese_content.py --file .claude/skills/pr-review-judge/SKILL.md'
      exit_code: 0
      status: pass
      fallback_detected: false
      artifact_present: not_required
      human_review_required: false
      stop_condition_triggered: false
    - ac: runtime_japanese_reference
      command: 'uv run python3 .claude/skills/create-issue/scripts/validate_japanese_content.py --file .claude/skills/pr-review-judge/references/allowed-paths-gate.md'
      exit_code: 0
      status: pass
      fallback_detected: false
      artifact_present: not_required
      human_review_required: false
      stop_condition_triggered: false
  ci_check_result:
    name: ci-verdict-summary
    status: all_pass
    details_url: https://github.com/squne121/loop-protocol/actions/runs/28654690889/job/84981302193
    head_sha: "deb3c9ee08536744734353398479aee579dd163a"
    summary:
      success: 13
      skipped: 5
      failed: 0
      in_progress: 0

@squne121 squne121 left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LOOP_VERDICT_V2:
  verdict: REQUEST_CHANGES
  reviewed_head_sha: "deb3c9ee08536744734353398479aee579dd163a"
  merge_ready: false
  mergeability:
    mergeable: MERGEABLE
    merge_state_status: CLEAN
  blockers:
    - "major: Safety Claim Matrix の rename / previous_filename blind spot 行で Not controlled が非空のまま Follow-up が未 materialize と記載されており、open な follow-up issue が current head に結び付いていません。current head deb3c9ee08536744734353398479aee579dd163a では blocker 1-4、VC 11/11 PASS、ci-verdict-summary all_pass、allowed_paths_gate ok までは確認できましたが、この行は docs/dev/runtime-verification-policy.md の follow-up 必須条件と pr-review-judge の Safety Claim Gate をまだ満たしていません。next_action: rename metadata / previous_filename 取り扱いの open follow-up issue を起票して PR body の Follow-up に結び付けるか、当該 Not controlled 行を解消する実装へ閉じてください。"
  required_auto_actions: []
  auto_fix_applied: []
  follow_up_issue_requests: []
  allowed_paths_gate:
    status: ok
  allowed_paths_gate_source: review_subagent

@squne121 squne121 left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LOOP_VERDICT_V2:
  verdict: REQUEST_CHANGES
  reviewed_head_sha: "deb3c9ee08536744734353398479aee579dd163a"
  merge_ready: false
  mergeability:
    mergeable: MERGEABLE
    merge_state_status: BEHIND
  blockers:
    - "current-head CI evidence is fail-closed: `uv run --locked python3 .claude/skills/pr-review-judge/scripts/ci_verdict_summary.py --pr 1297 --repo squne121/loop-protocol --expected-head-sha deb3c9ee08536744734353398479aee579dd163a` exited 10 with `status: failed` and `failed_checks: [PR Body Japanese Check]`. Per `references/ci-verdict-summary.md`, exit 10 is merge-blocking until the current-head CI summary returns `all_pass`."
  required_auto_actions:
    - kind: ensure_closing_keyword
      executor: implementation-worker
      skill: open-pr.update_pr
      blocking_merge_ready: true
      mechanical: true
    - kind: update_branch
      executor: implementation-worker
      skill: implement-issue.update_branch
      blocking_merge_ready: true
      mechanical: true
      expected_head_sha: "deb3c9ee08536744734353398479aee579dd163a"
  auto_fix_applied: []
  follow_up_issue_requests: []
  allowed_paths_gate:
    status: ok
  allowed_paths_gate_source: review_subagent

@squne121

squne121 commented Jul 3, 2026

Copy link
Copy Markdown
Owner Author
TEST_VERDICT:
  result: PASS
  issue_number: 1296
  pr_number: 1297
  head_sha: "994e16644e96dc0e43263d26cc0dcf27eb721093"
  mergeable: MERGEABLE
  merge_state_status: CLEAN
  branch_behind_main: false
  baseline_only: false
  verification_commands_pass: 12
  verification_commands_fail: 0
  verification_skipped_count: 0
  runtime_ac_results:
    - ac: AC1
      command: 'rg -n "diff_base_sha" .claude/skills/pr-review-judge/scripts/allowed_paths_review_gate.py'
      exit_code: 0
      status: pass
      fallback_detected: false
      artifact_present: not_required
      human_review_required: false
      stop_condition_triggered: false
      notes: 'diff_base_sha の分離実装を確認'
    - ac: AC2
      command: 'rg -n "test_update_branch_no_false_positive" .claude/skills/pr-review-judge/tests/'
      exit_code: 0
      status: pass
      fallback_detected: false
      artifact_present: not_required
      human_review_required: false
      stop_condition_triggered: false
      notes: 'update_branch false positive 回帰テストを確認'
    - ac: AC3
      command: 'rg -n "test_update_branch_true_violation_blocks" .claude/skills/pr-review-judge/tests/'
      exit_code: 0
      status: pass
      fallback_detected: false
      artifact_present: not_required
      human_review_required: false
      stop_condition_triggered: false
      notes: 'update_branch true violation 回帰テストを確認'
    - ac: AC4
      command: 'rg -n "test_diff_base_sha_does_not_affect_freshness" .claude/skills/pr-review-judge/tests/'
      exit_code: 0
      status: pass
      fallback_detected: false
      artifact_present: not_required
      human_review_required: false
      stop_condition_triggered: false
      notes: 'freshness 分離テストを確認'
    - ac: AC5
      command: 'rg -n "diff_base_sha" .claude/skills/pr-review-judge/scripts/allowed_paths_review_gate.py .claude/skills/pr-review-judge/tests/'
      exit_code: 0
      status: pass
      fallback_detected: false
      artifact_present: not_required
      human_review_required: false
      stop_condition_triggered: false
      notes: 'script と tests の provenance field を確認'
    - ac: AC6
      command: 'rg -n "git_diff_current_merge_base_head" .claude/skills/pr-review-judge/references/allowed-paths-gate.md .claude/skills/pr-review-judge/SKILL.md'
      exit_code: 0
      status: pass
      fallback_detected: false
      artifact_present: not_required
      human_review_required: false
      stop_condition_triggered: false
      notes: 'docs と SKILL の source policy 同期を確認'
    - ac: AC7
      command: 'rg -n "git_diff_current_merge_base_head" .claude/skills/pr-review-judge/scripts/allowed_paths_review_gate.py .claude/skills/pr-review-judge/tests/'
      exit_code: 0
      status: pass
      fallback_detected: false
      artifact_present: not_required
      human_review_required: false
      stop_condition_triggered: false
      notes: '実装とテストの source 名を確認'
  additional_verification:
    - name: allowed_paths_review_gate pytest
      command: 'uv run pytest .claude/skills/pr-review-judge/tests/test_allowed_paths_review_gate.py -q'
      exit_code: 0
      status: pass
      notes: '43 passed in 0.22s'
    - name: allowed_paths_matcher_v2 pytest
      command: 'uv run pytest .claude/skills/pr-review-judge/tests/test_allowed_paths_matcher_v2.py -q'
      exit_code: 0
      status: pass
      notes: '12 passed in 0.03s'
    - name: PR Body Japanese Check
      command: 'uv run python3 .claude/skills/create-issue/scripts/validate_japanese_content.py --file .claude/skills/pr-review-judge/SKILL.md'
      exit_code: 0
      status: pass
      notes: 'current head verified'
    - name: reference Japanese Check
      command: 'uv run python3 .claude/skills/create-issue/scripts/validate_japanese_content.py --file .claude/skills/pr-review-judge/references/allowed-paths-gate.md'
      exit_code: 0
      status: pass
      notes: 'current head verified'
    - name: PR body validator
      command: 'uv run python3 scripts/pr_body_validator.py --body-file <tmp> --changed-paths-file <tmp> --linked-issue 1296'
      exit_code: 0
      status: pass
      notes: 'body validator pass on current PR body'
  ci_check_result:
    name: ci-verdict-summary
    status: all_pass
    details_url: 'https://github.com/squne121/loop-protocol/actions/runs/28655635540/job/84984320885'
    head_sha: '994e16644e96dc0e43263d26cc0dcf27eb721093'
    summary:
      success: 13
      skipped: 5
      failed: 0
      in_progress: 0

@squne121
squne121 marked this pull request as ready for review July 3, 2026 10:58
@squne121
squne121 merged commit 8980d83 into main Jul 3, 2026
18 checks passed
@squne121
squne121 deleted the worktree-issue-1296-pr-review-judge-allowed-paths-gate-diff branch July 3, 2026 10:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

実装: pr-review-judge の allowed_paths gate を diff base と snapshot base で分離する

1 participant