Repository navigation
Description
Machine-Readable Contract
contract_schema_version: v1
issue_kind: implementation
parent_issue: "none"
goal_ref: "pr_review_only AC の current-head 実行が non-pass のとき、失敗を PASS に書き換えず lossless に保持したまま pr-reviewer の意味判断へ委譲できる canonical route を定義する"
change_kind: workflow
dedupe_key: "follow-up:squne121/loop-protocol:https://github.com/squne121/loop-protocol/issues/2912:pr-review-only-nonpass-reviewer-route"Parent Issue
none
(関連: #2912。#2912 は pr_review_only AC の「current-head 実行が executed PASS の独立 report」を canonical 経路で消費可能にすることだけを所有し、本 Issue はその Out of Scope である non-pass 側を分離したもの。)
Parent Goal Ref
- Source incident: 実装: opt-in Step 2 canary が通常 pytest 収集全体を exit 77 で中断しないようにする #2903 / fix: Step 2 canary が広域 pytest collection を exit 77 で中断しないようにする #2909 (head
15f1f1c0816058b91bfd220e3aaa46aad80be08d)。AC1-4 は exit 0、AC5(uv run --locked pytest .claude/skills/create-issue/tests/ .claude/skills/issue-refinement-loop/tests/ -q、pr_review_only)は exit 1(既存uv_version_mismatch3 件の独立失敗、3 failed / 2711 passed / 1 skipped / 3 deselected)。 - Desired Destination: pr_review_only scope の AC の current-head 実行が non-pass(exit != 0 / status fail / skip / fallback_detected)だったとき、adapter / adjudicator が失敗を PASS に書き換えず、skip metadata で覆わず、実行事実を lossless に保持したまま、「reviewer dispatch を許可すること」「AC 達成と判断されたこと」「terminal approval」を別状態として扱い、pr-reviewer が AC・diff・失敗内容を照合して意味判断できる canonical 経路が存在する状態。
Current Validated Scope
repo reality(main fc8bfe54a99b04302e8f938dc1703da098fbf56f)で確認済みの事実のみ:
.claude/skills/impl-review-loop/scripts/adjudicate_vc_result.pyのadapt_test_verdict_to_current_vc_result()はfailure_keysを常に[]にする(既知制約コメント、164 行付近)。status / exit_code / fallback_detected は current item に lossless に転記される。- 実装: pr_review_only VC を含む Issue が step4-adjudicate の canonical 経路で通らない defect を解消する #2912 実装後の予定契約: pr_review_only AC の current item が executed pass でない場合は
pr_review_only_current_execution_not_pass:<AC>で fail-closed(indeterminate / rerun)し、PASS へ書き換えない。reviewer dispatch は開かない。したがって 実装: pr_review_only VC を含む Issue が step4-adjudicate の canonical 経路で通らない defect を解消する #2912 だけでは AC5 が exit 1 の 実装: opt-in Step 2 canary が通常 pytest 収集全体を exit 77 で中断しないようにする #2903 / fix: Step 2 canary が広域 pytest collection を exit 77 で中断しないようにする #2909 事例は unblock されない。 - 通常 VC の既存 non-blocking 失敗分類は baseline の failure_keys 照合(
_classify_item)に依存し、pr_review_only baseline は failure_keys を持たない。 - 制約: 新 schema family / 新 ledger / CI artifact publisher / gate 緩和は不可(実装: test-runner の canonical Step 2 evidence report を certifiable にする #2479 は CLOSED / NOT_PLANNED、実装: 通常レビューの evidence authority を TEST_VERDICT 非依存の CI/merge_state_status 正本へ切替える(Phase 1: authority cutover) #1856 / 導入: AIエージェント運用をminimal harnessへ縮退し、過剰なcontrol-planeを廃止する #1860 minimal-harness 方針)。skip metadata で failure を覆う設計、failure の PASS 変換は禁止。skipped-only / bucket=skipping を成功としない既存契約を維持する。
Remaining Parent Gaps
なし(単独改善 Issue)。独立 current-head 経路の確定は #2912、test-runner.md の報告契約は #2892 が所有する。
Outcome
.claude/skills/impl-review-loop/scripts/adjudicate_vc_result.py(および必要最小の steps/step-4-pr-review.md / steps/step-5-feedback-and-termination.md)を更新して、non-pass の pr_review_only 実行事実を lossless に保持したまま reviewer dispatch を許可する条件・状態表現・terminal approval との分離を既存 payload field の範囲で定義し、新規回帰テスト .claude/skills/impl-review-loop/tests/test_step4_pr_review_only_nonpass_reviewer_route.py が、実 step4-adjudicate CLI から別 process の実 step5-terminal-gate CLI までの経路で FAIL/SKIP/fallback の保持・reviewer 未承認時の terminal 非到達・PASS 変換や forged identifier の fail-closed を検証して PASS している状態にする。
Runtime Verification Applicability
- decision: not_applicable
- reason: 変更対象は impl-review-loop の script / step 文書 / pytest のみで、agent 定義・hook・permission・settings を含まず、subprocess を使う pytest で挙動を決定論的に検証できるため。
In Scope
adjudicate_vc_result.py(+ 必要最小の step 文書): non-pass の pr_review_only 実行事実(exit_code / status / fallback_detected / skip)を persisted adjudication に lossless に保持し、reviewer dispatch 許可・AC 達成判断・terminal approval を別状態として扱う条件を定義する。設計は既存 payload field の範囲で行い、新 schema を作らない。- 新規 focused regression test
.claude/skills/impl-review-loop/tests/test_step4_pr_review_only_nonpass_reviewer_route.py: 実step4-adjudicateCLI → 別 process の実step5-terminal-gateCLI。reason_code / invoke_pr_reviewer / route を assert し、returncode だけで判定しない。 - 前提依存: 実装: pr_review_only VC を含む Issue が step4-adjudicate の canonical 経路で通らない defect を解消する #2912 の merge 後に着手する(実装: pr_review_only VC を含む Issue が step4-adjudicate の canonical 経路で通らない defect を解消する #2912 が independent current-head 経路を確定するため)。
- ownership note: step 文書(step-4-pr-review.md / step-5-feedback-and-termination.md)は 実装: impl-review-loop の terminal/human-escalation で GitHub human-history を必須化し Project memory-only handoff を防ぐ #2880 / 実装: pr_review_only VC を含む Issue が step4-adjudicate の canonical 経路で通らない defect を解消する #2912 と編集ファイルが重複しうる。hard dependency とはせず、着手時に最新 main へ rebase して整合させる。
Out of Scope
- 実装: pr_review_only VC を含む Issue が step4-adjudicate の canonical 経路で通らない defect を解消する #2912 の独立 current-head 経路定義
- 実装: test-runner.md の TEST_VERDICT_MACHINE/v2 報告契約を step-2 の委譲契約と consumer 要件に整合させる #2892 の test-runner.md 変更
- CI workflow / artifact の新設、新 schema・ledger の新設
- gate の緩和、runtime_only scope の意味変更
- failure の PASS 変換、skip envelope で failure を覆う設計
Acceptance Criteria
- AC1: pr_review_only AC の current 実行が FAIL / SKIP / fallback_detected のとき、実
step4-adjudicateの persisted adjudication に exit_code / status / fallback_detected が lossless に残り、PASS に書き換えられない。 - AC2: reviewer dispatch 許可(invoke_pr_reviewer)が許可されても、reviewer が REQUEST_CHANGES または未判断の間は、別 process の実
step5-terminal-gateが terminal approval に到達しない。 - AC3: 失敗を PASS に変換する入力、skip envelope で失敗を覆う入力、forged identifier を含む入力は fail-closed となる。
- AC4: テストは reason_code / invoke_pr_reviewer / route を assert し、returncode だけで判定しない。
- AC5: 既存の adjudicate 関連 pytest が退行しない。
Verification Commands
# AC1
# baseline-expect: fail
$ uv run --locked pytest .claude/skills/impl-review-loop/tests/test_step4_pr_review_only_nonpass_reviewer_route.py -q -k nonpass_facts_lossless
# AC2
# baseline-expect: fail
$ uv run --locked pytest .claude/skills/impl-review-loop/tests/test_step4_pr_review_only_nonpass_reviewer_route.py -q -k terminal_gate_blocks_without_reviewer_approval
# AC3
# baseline-expect: fail
$ uv run --locked pytest .claude/skills/impl-review-loop/tests/test_step4_pr_review_only_nonpass_reviewer_route.py -q -k fail_closed_on_pass_conversion_or_forged
# AC4
# baseline-expect: fail
$ uv run --locked pytest .claude/skills/impl-review-loop/tests/test_step4_pr_review_only_nonpass_reviewer_route.py -q -k asserts_reason_code_and_route
# AC5
$ uv run --locked pytest .claude/skills/impl-review-loop/tests/test_adjudicate_vc_result.py .claude/skills/impl-review-loop/tests/test_adjudicate_vc_result_non_regression_gate.py -qAllowed Paths
.claude/skills/impl-review-loop/scripts/adjudicate_vc_result.py.claude/skills/impl-review-loop/steps/step-4-pr-review.md.claude/skills/impl-review-loop/steps/step-5-feedback-and-termination.md.claude/skills/impl-review-loop/tests/test_step4_pr_review_only_nonpass_reviewer_route.py
Stop Conditions
- Allowed Paths 外の変更が必要と判明した場合
- In Scope の固定契約(キー集合・スキーマ・型定義)の変更が必要になった場合
- 新規 Issue の起票が必要と判断した場合(スコープ分割が発生する場合)
- 後続 Phase / 別スコープへの波及が判明した場合
- nested SubAgent delegation が必要になった場合
- 外部サービス利用・権限昇格・既存テスト大規模改変が必要になった場合
- 設計が既存 payload field のみで成立せず新 schema・ledger・CI artifact・gate 緩和が必要になる場合は実装せず、人間判断を待つ。
- 失敗の PASS 変換、skip metadata による failure の被覆、偽 identifier の生成が唯一の解決策になる場合。
Required Skills
なし
Required Design References
- docs/dev/agent-skill-boundaries.md
- docs/dev/workflow.md
Scope Delta(任意)
N/A
Delivery Rule
1 Issue = 1 PR。専用 worktree で作業し、Draft PR を既定とする。- Depends on 実装: pr_review_only VC を含む Issue が step4-adjudicate の canonical 経路で通らない defect を解消する #2912 merge。参照: 実装: pr_review_only VC を含む Issue が step4-adjudicate の canonical 経路で通らない defect を解消する #2912 、fix: Step 2 canary が広域 pytest collection を exit 77 で中断しないようにする #2909
Activity
fix: #2916 委譲時の fallback 検査を行単位にして通常 AC の fallback を免除しない
fix: #2916 fallback 由来の FAIL(exit 0) と runtime_only 混在 report を revie…
test: 委譲 entry の sibling が blocking:true に改ざんされた persisted state を fa…
Step 2 の test-runner report を lossless に Step 4 へ受け渡す手順と回帰テストを追加する (#…