Repository navigation
修正: impl-review-loop の独立VCを Step 4 起動前の current-head gate に接続する - #2312
Conversation
PR #2310 で独立Issue VCがStep 4初回reviewer起動前に渡されず、同一headに対して 不要な二重review(REQUEST_CHANGES→PASS追加後APPROVE)が発生した。 adjudicate_vc_result.py に evaluate_step4_vc_gate() / Step4AdjudicationCache を追加し、既存の VC_ADJUDICATION_RESULT_V1 判定ロジックを再利用したまま、 current head SHA・Issue body SHA256・literal command SHA256 のいずれかが drift すれば adjudication を stale として扱い、pr-reviewer を起動しない fail-closed gate を Step 4 起動直前に接続した。同一 binding tuple の valid adjudication は同一 root invocation 内で再利用し、test-runner の 二重実行を避ける(新規 persistent ledger・publisher・hook は追加しない)。 test-runner の contract を read-only report(PRコメント投稿なし)に統一し、 Claude Code(.claude/agents/test-runner.md)と Codex CLI (.codex/agents/test-runner.toml)で同一 semantic contract を明記した。 evidence-policy.md には TEST_VERDICT_MACHINE が diagnostics-only である旨を 明記した。 Closes #88 Co-Authored-By: Claude Sonnet 5 <[email protected]>
Preview URL✅ verified live assets: https://squne121.github.io/loop-protocol/pr-2312/ The preview will be removed when this PR is closed. |
判定REQUEST_CHANGES レビュー対象は最新 head 方向性自体は妥当です。Issue #1856/PR #1870 で、通常レビューの authority は Findings1. [P1]
|
…P_STATE ベースに再設計する (#88) - VC_ADJUDICATION_RESULT_V1 を LOOP_STATE.vc_adjudication へ永続化し、TEST_VERDICT_MACHINE/v2 -> baseline_vc_preflight/v1 の canonical adapter (adapt subcommand) と step4-gate CLI subcommand (exit 0/1/2) を実運用経路へ接続する - 各プロセス呼び出し間で状態が残らない Step4AdjudicationCache (in-memory object) を廃止し、LOOP_STATE 経由の再利用へ置き換える - ordered command hashes の照合を sorted 比較から順序保持比較へ修正し、reorder-only の binding を stale として検出する negative test を追加する - test-runner.md の read-only report 契約と矛盾する「PRコメントに明記」等の文言を修正する - evaluate_step4_vc_gate() に schema_version / errors / rerun_required / evidence_complete / evidence_fresh の malformed 判定を追加する Co-Authored-By: Claude Sonnet 5 <[email protected]>
概要
impl-review-loopの Step 4 (pr-reviewer) 起動直前に、独立実行 Issue VC のcurrent-head adjudication(
VC_ADJUDICATION_RESULT_V1)を再照合するfail-closed gate を接続し、TEST_VERDICT_MACHINE の PR コメント投稿を
diagnostics-only(旧経路として非規範化)にする。
背景
PR #2310 では、実装差分・Allowed Paths・required CI に問題がなかったにも
かかわらず、独立Issue VCがStep 4初回reviewer起動前に渡されなかったため、
同一headに対して不要な二重review(1. independent VC missing → REQUEST_CHANGES、
2. independent VC PASS追加後 → APPROVE)が発生した。
変更内容
.claude/skills/impl-review-loop/scripts/adjudicate_vc_result.pyevaluate_step4_vc_gate()を追加。既存のVC_ADJUDICATION_RESULT_V1判定を再利用しつつ、caller が渡す live binding triple
(current head SHA / Issue body SHA256 / literal command SHA256 一覧)
と照合し、head/body/command のいずれかが drift すれば
invoke_pr_reviewer: Falseを fail-closed で返す。Step4AdjudicationCache/step4_binding_key()を追加。同一binding tuple の valid adjudication を同一 root invocation 内で
再利用し、test-runner の二重実行を避ける(in-memory・非永続)。
hook・schema を追加しない(Issue 修正: impl-review-loop の独立VCを Step 4 起動前の current-head gate に接続し TEST_VERDICT 旧経路を非規範化する #88 Required Design Hooks(OS レベル防御)を整備し決定論的ガードレールを構築する #9 / Out of Scope)。
.claude/skills/impl-review-loop/steps/step-4-pr-review.mdfail-closed 条件(adjudication missing/malformed、blocking true、
head/body/command mismatch)を明記。
.claude/skills/impl-review-loop/steps/step-2-verification.mdcompletedとfinal result の両方を確認する旨、および 修正: impl-review-loop の独立VCを Step 4 起動前の current-head gate に接続し TEST_VERDICT 旧経路を非規範化する #88 reframe の経緯を追記。
.claude/skills/impl-review-loop/steps/context-protocol-and-guardrails.mdgh pr view --json commentsからのTEST_VERDICT 抽出」から「
spawn_agent/list_agentsの final resultからの直接受け取り」へ更新(normal routing からの除去)。
.claude/skills/impl-review-loop/SKILL.md.claude/agents/test-runner.md/.codex/agents/test-runner.toml明示(Claude Code / Codex CLI 間で同一 semantic contract、AC11)。
.claude/skills/pr-review-judge/references/evidence-policy.md.claude/skills/impl-review-loop/tests/test_step4_requires_current_vc.py(新規、AC1/AC4/AC7)
.claude/skills/impl-review-loop/tests/test_adjudicate_vc_result.pyに AC2/AC3 の binding triple テストを追加
.claude/skills/impl-review-loop/tests/test_adjudicate_vc_result_non_regression_gate.pyに AC5/AC6 の same-loop reuse / happy-path invocation count テストを追加
Verification Commands 実行結果(Issue #88 本文の記載通り、逐語実行)
追加で以下も実行し regression なしを確認:
Runtime Verification Applicability(動作検証の適用判定)
decision: not_applicable(Issue本文の通り)。AC1〜AC12 は pytest fixture /ruff / rg による静的・決定論的検証のみで完結する。
CI_TEST_PERFORMANCE_DECISION_V1(
.codex/agents/test-runner.toml変更に伴う advisory 対応)Safety Claim Matrix(安全性主張マトリクス)
本 PR は
.claude/skills/**/.claude/agents/**/.codex/agents/**配下(impl-review-loop のrouting gate ロジックを含む)を変更するため safety-sensitive 判定に該当する。
VC_ADJUDICATION_RESULT_V1が無い限り起動されないevaluate_step4_vc_gate()が Step 4 起動直前に head/body/command の binding triple を再照合し、いずれか mismatch ならinvoke_pr_reviewer: Falseを fail-closed で返すtest_step4_requires_current_vc.py(9 tests, AC1/AC4/AC7)、step-4-pr-review.mdの current-head gate 節Step4AdjudicationCacheは in-memory dict のみで実装し、プロセス終了で消えるtest_adjudicate_vc_result_non_regression_gate.py(21 tests, AC5/AC6).claude/agents/test-runner.md/ Codex.codex/agents/test-runner.toml)は read-only report のみを返し、PR にコメントを投稿しないrg -q "投稿しない" .claude/agents/test-runner.md(AC8)、同.codex/agents/test-runner.toml(AC11)TEST_VERDICT_MACHINEは diagnostics-only であり、approval / blocking / routing を左右しないevidence-policy.mdに diagnostics-only を明記し、step-4-pr-review.mdの normal flow から TEST_VERDICT comment 検索を除去TEST_VERDICT_MACHINEの legacy parser/schema/materializer 自体の物理削除は行っていない(Issue #88 Out of Scope)。既存の下流 consumer が独自に legacy 経路を authoritative 扱いしていないかの全数監査は本 PR の範囲外rg -q "diagnostics-only" evidence-policy.md(AC10)、step-4-pr-review.mdの TEST_VERDICT comment 検索除去(AC9 negative control)Closes #88(Issue #88 を close する)