Repository navigation
Description
Machine-Readable Contract
contract_schema_version: v1
issue_kind: implementation
parent_issue: "none"
goal_ref: "check_issue_contract.py の C9(Runtime Verification Applicability) blocker を deterministic_domain_blocker として structured_blockers に出力し、reviewer_claim_replay.py の taxonomy 照合が正しく機能する状態にする"
change_kind: codeParent Issue
none(単独改善)
Parent Goal Ref
なし(単独改善のため親 Issue の Goal を参照しない)
Current Validated Scope
.claude/skills/review-issue/scripts/check_issue_contract.pyの C9 ブロックを C4/C5 と同型の_append_findings呼び出しに変更し、structured_blockersに C9 由来の entry を出力させる- 対応する pytest テストの追加
Remaining Parent Gaps
なし(単独改善)
Outcome
.claude/skills/review-issue/scripts/check_issue_contract.py の C9(Runtime Verification Applicability 欠落)チェックが finding_kind: deterministic_domain_blocker かつ有効な checker_evidence・reviewer_blocker_code: "C9" を伴う finding を生成し、その結果 compact_review_result.py が生成する structured_blockers に C9 blocker が実際に含まれる状態。対応する pytest が全件 PASS している状態。
Background
issue-refinement-loop の Step 2a(reviewer_claim_replay.py arbitration)を Issue #1311 に対して実行したところ、review-issue skill が「## Runtime Verification Applicability セクションがない(レガシー Issue)」という単一の正当な blocker(C9_runtime_applicability_present: legacy_missing_applicability)を検出したにもかかわらず、reviewer_claim_replay.py が2回連続でこれを checker_gap(normalized_kind: unknown_blocker_type)と判定し、reviewer_false_positive_suspected → human_escalation に倒れた。
原因を worktree 内で特定済み:
.claude/skills/review-issue/scripts/check_issue_contract.pyの C9 呼び出し箇所(# C9コメント直後、check_c9_runtime_applicability呼び出しの次のブロック)は_append_findings(..., finding_kind=REVIEW_ISSUE_FINDING_KIND_HEURISTIC_CONCERN, blocking=True)のみを渡しており、checker_evidenceもreviewer_blocker_codeも渡していない_append_findingsはfinding_kind == REVIEW_ISSUE_FINDING_KIND_DETERMINISTIC_DOMAIN_BLOCKERかつreviewer_blocker_codeが truthy の場合のみresult.structured_blockersに追記する(同ファイル内_append_findings定義のif reviewer_blocker_code and finding_kind == ... and blocking:分岐)。C9 はHEURISTIC_CONCERNを渡しているため、この条件を満たさずstructured_blockersは常に空になる- 一方 C4(
vc_command_format)・C5(vc_number_alignment)の呼び出し箇所はfinding_kind=REVIEW_ISSUE_FINDING_KIND_DETERMINISTIC_DOMAIN_BLOCKER・checker_evidence=_make_self_checker_evidence(result, rule_id=..., category=...)・reviewer_blocker_code="C4"/"C5"を渡しており、正しくstructured_blockersに反映される。C9 もこれと同型の呼び出しに揃えれば同様に機能する .claude/skills/issue-refinement-loop/scripts/reviewer_claim_replay.pyのREVIEWER_CHECKER_TAXONOMY_V1には既にentry_id: "rva_immediate_field_missing"、reviewer_codes: ["c9", "rva_immediate_field_missing"]、deterministic_checks: ["C9_runtime_applicability_present"]、domain_keys: ["runtime_applicability"]というエントリが存在する。つまり taxonomy 側の受け皿は既にあり、producer 側(check_issue_contract.py)がreviewer_blocker_code="C9"を出力していないことだけが欠落している_append_findingsはfinding_kind == DETERMINISTIC_DOMAIN_BLOCKER and blockingのとき、checker_evidenceが_is_valid_deterministic_evidenceを満たすものだけにフィルタされ、フィルタ後に空ならfinding_kindをCHECKER_GAPに自動降格しblocking=Falseにする(fail-closed)。したがってfinding_kindの変更だけでなく、C4/C5 と同型のchecker_evidence=_make_self_checker_evidence(...)引数も同時に渡す必要がある
この状態のまま放置すると、Issue 本文が単一の正当な RVA 欠落 blocker しか持たない場合でも issue-refinement-loop が機械的に human_escalation へ倒れ続け、本来自動化できるはずの軽微な body 修正が毎回人間判断を要求してしまう。
In Scope
.claude/skills/review-issue/scripts/check_issue_contract.pyの# C9ブロック(check_c9_runtime_applicability呼び出し直後、checks.C9_runtime_applicability_present in (CheckResult.FAIL, CheckResult.LEGACY_MISSING)分岐内の_append_findings呼び出し)を、C4/C5 と同型の呼び出しに変更する:finding_kind=REVIEW_ISSUE_FINDING_KIND_DETERMINISTIC_DOMAIN_BLOCKERchecker_evidence=_make_self_checker_evidence(result, rule_id="C9_runtime_applicability_present", category="runtime_applicability") if checks.C9_runtime_applicability_present in (CheckResult.FAIL, CheckResult.LEGACY_MISSING) and issues else []reviewer_blocker_code="C9"
checks.C9_runtime_applicability_present == CheckResult.WARNの既存分岐(_add_warningを使う経路、code="c9_runtime_applicability_missing")は変更しない- 上記変更に対応する pytest テストの追加(
.claude/skills/review-issue/tests/test_check_issue_contract.pyへの追加、既存TestC9Failクラス周辺) .claude/skills/issue-refinement-loop/tests/に、C9 blocker がreviewer_claim_replay.pyの taxonomy 照合でdeterministic_backed: true(checker_gap: false)になることを固定する回帰テストを追加する
Out of Scope
- C1 / C6 / C7 / C8 など、他の
HEURISTIC_CONCERN系チェックをDETERMINISTIC_DOMAIN_BLOCKERに変更すること(本 Issue は C9 のみに限定する) reviewer_claim_replay.pyのREVIEWER_CHECKER_TAXONOMY_V1自体の変更(既存のrva_immediate_field_missingエントリをそのまま使う)_append_findings/_is_valid_deterministic_evidence/_make_self_checker_evidenceの実装ロジック自体の変更(既存関数をそのまま呼び出す)- Issue 実装: issue-refinement-loop の rewrite routing が既存 blocker contract を consume して non-body-author-fixable blocker を早期停止できるようにする #944(rewrite routing の digest 化)の実装(本 Issue は 実装: issue-refinement-loop の rewrite routing が既存 blocker contract を consume して non-body-author-fixable blocker を早期停止できるようにする #944 が consume する producer 側の evidence 欠落を埋めるものであり、実装: issue-refinement-loop の rewrite routing が既存 blocker contract を consume して non-body-author-fixable blocker を早期停止できるようにする #944 の routing ロジックには触れない)
- Issue 実装: issue-refinement-loop の termination report に LOOP_HANDOFF_RESULT_V1 marker 生成を実装する #1311 の本文修正(別 Issue で対応済み)
Acceptance Criteria
- AC1:
## Runtime Verification Applicabilityセクションが欠落した implementation issue body に対してcheck_issue_contract.py --file <body> --jsonを実行すると、出力 JSON のstructured_blockersにcodeが"C9"(大文字小文字を問わず taxonomy のnormalize_taxonomy_keyで"c9"に正規化される値)である entry が1件以上含まれる - AC2: AC1 の
structured_blockersentry のfinding_kindは"deterministic_domain_blocker"であり、対応するchecker_evidenceエントリはsource_check/rule_id/category/artifact_path/artifact_schema/body_sha256/iteration_idを全て含む - AC3:
checks.C9_runtime_applicability_present == CheckResult.WARN(research issue 等)のケースではstructured_blockersに C9 由来の entry が追加されない(既存の_add_warning経路のみが動作する) - AC4:
.claude/skills/issue-refinement-loop/scripts/reviewer_claim_replay.pyに AC1 のcheck_issue_contract.py出力由来の compact review result と、対応するcontract_readiness_check.py --mode preflight-static出力を同一 body から生成して渡すと、normalized_kind: "rva_immediate_field_missing"・deterministic_backed: true・checker_gap: falseを返す - AC5: 既存
.claude/skills/review-issue/tests/test_check_issue_contract.pyのTestC9Failクラスの既存テスト(test_c9_fails/test_c9_blocking_message)が回帰なく PASS する
Verification Commands
# AC1
$ uv run --locked python3 -m pytest .claude/skills/review-issue/tests/test_check_issue_contract.py -k test_c9_fail_emits_structured_blocker_code
# AC2
$ uv run --locked python3 -m pytest .claude/skills/review-issue/tests/test_check_issue_contract.py -k test_c9_structured_blocker_evidence_is_valid_deterministic_evidence
# AC3
$ uv run --locked python3 -m pytest .claude/skills/review-issue/tests/test_check_issue_contract.py -k test_c9_warn_does_not_emit_structured_blocker
# AC4
$ uv run --locked python3 -m pytest .claude/skills/issue-refinement-loop/tests/test_reviewer_claim_replay.py -k test_c9_blocker_is_deterministic_backed_not_checker_gap
# AC5
$ uv run --locked python3 -m pytest .claude/skills/review-issue/tests/test_check_issue_contract.py -k "test_c9_fails or test_c9_blocking_message"Allowed Paths
以下のファイルのみを変更対象とする:
- .claude/skills/review-issue/scripts/check_issue_contract.py
- .claude/skills/review-issue/tests/test_check_issue_contract.py
- .claude/skills/issue-refinement-loop/tests/test_reviewer_claim_replay.py
Stop Conditions
- Allowed Paths 外の変更が必要と判明した場合
- In Scope の固定契約(キー集合・スキーマ・型定義)の変更が必要になった場合(
REVIEWER_CHECKER_TAXONOMY_V1のキー集合・structured_blockersのスキーマを含む) - 新規 Issue の起票が必要と判断した場合(スコープ分割が発生する場合)
- 後続 Phase / 別スコープへの波及が判明した場合
- nested SubAgent delegation が必要になった場合
- 外部サービス利用・権限昇格・既存テスト大規模改変が必要になった場合
Scope Delta(該当時のみ記載)
N/A
Required Skills
なし
Delivery Rule(配信規則)
1 Issue = 1 PR- isolation worktree で作業する
- Draft PR を既定とする
Runtime Verification Applicability
- decision: not_applicable
- reason: 本 Issue の変更対象は
check_issue_contract.py内の finding 生成ロジック(純粋関数)であり、AC1〜AC5 の VC はすべてpytestユニットテストのみで完結する。プロセス起動・外部通信・ネットワーク I/O は不要なため、静的検証(typecheck / lint / unit test / build)のみで判定可能。
Notes for Reviewer(レビュアー向け注記)
- Issue 実装: issue-refinement-loop の rewrite routing が既存 blocker contract を consume して non-body-author-fixable blocker を早期停止できるようにする #944(
issue-refinement-loopの rewrite routing digest 化)は本 Issue が埋めるstructured_blockersの evidence 欠落を前提として consume する側の実装であり、本 Issue とは独立して進められるが、実装: issue-refinement-loop の rewrite routing が既存 blocker contract を consume して non-body-author-fixable blocker を早期停止できるようにする #944 着手前に本 Issue をマージしておくと 実装: issue-refinement-loop の rewrite routing が既存 blocker contract を consume して non-body-author-fixable blocker を早期停止できるようにする #944 の AC1(package_manager_no_tty_prompt等の既存 evidence を再分類せず consume する)の検証がより現実的な fixture で行える _make_self_checker_evidenceの正確なシグネチャ・戻り値は C4/C5 の既存呼び出し(check_issue_contract.py内# C4/# C5ブロック)をそのまま参照して実装すること。新しい evidence 生成ロジックを独自実装しない
Activity
squne121 commentedon Jul 4, 2026
敵対的レビュー結論
#1314 は 実装すべき単独改善 です。原因切り分けも概ね正しいです。問題は
reviewer_claim_replay.pyの taxonomy ではなく、check_issue_contract.py側が C9 をstructured_blockersに載せるための producer contract を満たしていない点です。#1314 本文は、C9 をdeterministic_domain_blocker+checker_evidence+reviewer_blocker_code="C9"に揃えることを明示しており、Issue コメントは現時点で 0 件です。現行コードでは
_append_findings()がstructured_blockersを追加する条件は、reviewer_blocker_codeがあり、finding_kind == deterministic_domain_blockerで、かつblockingが true の場合だけです。さらに deterministic blocker は valid evidence が空だとchecker_gap/blocking=Falseに fail-close します。 ところが現在の C9 fail/legacy path はfinding_kind=heuristic_concern、blocking=Trueだけで、checker_evidenceもreviewer_blocker_codeも渡していません。 したがって #1314 の修正方針は妥当です。REQUEST_CHANGES 相当の指摘
1. taxonomy / replay 側を触ったらスコープ逸脱
reviewer_claim_replay.pyには既に C9 用 taxonomy entry が存在します。c9/rva_immediate_field_missing/C9_runtime_applicability_present/runtime_applicabilityは同一 entry に結び付いています。 これは #1286 / PR #1304 で導入済みの領域であり、#1314 は producer 側の evidence emission だけを直す Issue です。#1286 自体もcheck_issue_contract.pyの checker 追加・判定変更を Out of Scope にしていました。PR で
REVIEWER_CHECKER_TAXONOMY_V1、normalize_taxonomy_key()、analyze()の routing、verdict enum、fallback evidence logic に触れたら原則 reject でよいです。#1314 の Allowed Paths は 3 ファイルに限定されています。2.
finding_kindだけ変える実装は不十分C9 は C4/C5 と同型にする必要があります。C4/C5 は
deterministic_domain_blocker、_make_self_checker_evidence(...)、reviewer_blocker_code="C4"/"C5"をセットしています。_make_self_checker_evidence()はsource_check、rule_id、category、artifact_path、artifact_schema、body_sha256、iteration_idを持つ evidence を返します。推奨される C9 patch はこの形です。
finding_kindだけを deterministic にして evidence を渡さない実装は、既存 fail-close によってchecker_gap/blocking=Falseへ落ちるため、AC1/AC2 を満たしません。3. WARN path を壊してはいけない
check_c9_runtime_applicability()は implementation issue では missing section / missing decision をLEGACY_MISSING、invalid decision をFAILとします。一方、research/tracking では Runtime Verification Applicability 欠落をWARNに留めます。 現行 C9 WARN path は_add_warning()と non-blocking heuristic finding を出す経路であり、#1314 でも変更しないのが正しいです。追加テストは「warning が 1 件だけ」では弱いです。既存テストは C9 WARN の duplicate finding しか見ていません。
structured_blockersに C9 が 存在しない ことまで明示してください。4. 既存 C9 テストは観測点が足りない
TestC9Failの既存テストは、C9 が fail/legacy_missing になることと blocking message の存在だけを見ています。structured_blockers、finding_kind、checker_evidenceは検査していません。 一方で C4/C5 には structured blocker/evidence を検査する既存テストがあります。最低限、以下を追加すべきです。
検査内容は
structured_blockers[0]前提ではなく、code == "C9"かつdeterministic_domain_key == "runtime_applicability"の entry を filter してください。複数 blocker が出た場合に順序依存で壊れるテストは避けるべきです。5. reviewer replay 回帰テストは fallback 成功を許してはいけない
reviewer_claim_replay.pyは、matched finding がない場合でも readiness / vc_preflight / vc_syntax 由来の fallback evidence でdeterministic_backed=Trueにできる設計です。 既存テストにも C9 の readiness fallback が用意されています。#1314 の AC4 は「C9 が producer の
structured_blockers/findingsから deterministic-backed になる」ことを固定すべきです。単にREADINESS_C9fallback で pass するテストでは、今回の producer 修正を証明できません。推奨する AC4 テスト形状は次です。
期待値は
normalized_kind == "rva_immediate_field_missing"、deterministic_backed is True、checker_gap is False、verdict == "deterministic_fail_confirmed"です。compact_review_result.pyは raw result からstructured_blockers、findings、deterministic_checks、producer_body_sha256を compact artifact に保持するため、この形は実経路に沿っています。6. schema 変更は不要。変更したら疑う
既存 schema は
structured_blockersを top-level required にしており、structured_blockerはfinding_kind == deterministic_domain_blocker、blocking == true、checker_evidence minItems: 1を要求します。 checker evidence の required fields も既に schema にあります。外部仕様上も、JSON Schema の
requiredは object に必須 property を宣言する keyword で、additionalPropertiesは余剰 property の可否を制御します。既存 schema で今回の表現は足りているため、新 schema や schema 緩和は不要です。(JSON Schema)関連 Issue / PR の読み
#1286 / PR #1304 は taxonomy parity 側の実装です。PR #1304 は
reviewer_claim_replay.pyに table-driven taxonomy、taxonomy_gap/checker_gap、body hash fail-closed、--dump-taxonomyを追加した PR です。 #1314 はその後段で見つかった「C9 producer が structured evidence を出していない」穴を埋めるものです。#944 は structured evidence を consume して rewrite routing / blocker digest に接続する文脈です。#1314 の output は #944 にとって有用ですが、#944 の routing / digest 実装は #1314 の Out of Scope です。
#1311 は C9 欠落に起因した実運用上の症状として参照されていますが、#1314 本文でも #1311 本文修正は別対応済み・Out of Scope とされています。#1314 PR で #1311 の body や termination report 系に触る必要はありません。
検証コマンドの品質
#1314 の
uv run --locked python3 -m pytest ... -k ...方針は妥当です。pytest の-kは test name / class name / file name 等に対する expression で絞り込む機能で、python -m pytestは通常のpytest実行とほぼ同じですが current directory がsys.pathに追加されます。ローカル script import が多いこの repo では後者の性質も有利です。([pytest ドキュメント]2)ただし
-k "test_c9_fails or test_c9_blocking_message"のような selection は typo でも広く拾うことがあります。AC 用には各 test name を固定し、最終確認で次も追加してください。PR レビュー時の合格条件
この PR は、以下を満たすまで merge 不可です。
structured_blockersにcode: "C9"を出す。finding_kindはdeterministic_domain_blocker、blockingは true。source_check=check_issue_contract、rule_id=C9_runtime_applicability_present、category=runtime_applicability、artifact_schema=CHECK_ISSUE_CONTRACT_V1、同一body_sha256を持つ。structured_blockersに C9 が出ない。reviewer_claim_replay.analyze()が C9 をrva_immediate_field_missingに正規化し、deterministic_backed=True/checker_gap=Falseにする。reviewer_claim_replay.py本体、taxonomy、schema、compact_review_result.py は変更しない。実装 Issue としては良いです。失敗パターンは「C9 を deterministic にするだけ」「readiness fallback のテストだけで満足する」「taxonomy/replay 側を余計に触る」の 3 つです。
squne121 commentedon Jul 4, 2026
Refinement Loop: Human Escalation Required
The loop has terminated and requires human review. Cause: human judgment required
human_escalationhuman_judgment_requiredBlockers
fix: PR #1319 reviewer blocker 対応としてテスト名を Issue #1314 の VC exact 名に揃える