Repository navigation
Closed
Labels
phase/implementationImplementation phase
Description
Machine-Readable Contract
contract_schema_version: v1
issue_kind: implementation
parent_issue: "none"
goal_ref: "reviewer_claim_replay.py の taxonomy に unexpected_pass を追加し、deterministic evidence を明示する"
change_kind: codeParent Issue
なし(単独改善)
Parent Goal Ref
- Goal: issue-refinement-loop の Step 2a(reviewer_claim_replay.py arbitration)が、reviewer blocker を deterministic evidence で裁定できること
- Desired Destination:
.claude/skills/issue-refinement-loop/scripts/reviewer_claim_replay.pyのREVIEWER_CHECKER_TAXONOMY_V1
Current Validated Scope
.claude/skills/issue-refinement-loop/scripts/reviewer_claim_replay.pyのREVIEWER_CHECKER_TAXONOMY_V1へ、baseline_vc_preflight.pyのcategory == "unexpected_pass"を裏付けとするentry_id: unexpected_passを追加するunexpected_pass用の replay 回帰テストを追加し、deterministic_fail_confirmedを確認する--dump-taxonomyの検証とtest_reviewer_claim_replay_taxonomy_parity.pyを用いた drift 検知を Scope に含める
Remaining Parent Gaps
なし
Outcome
unexpected_pass のみが REVIEWER_CHECKER_TAXONOMY_V1 に反映され、reviewer_claim_replay.py が
- readiness 側 (
--readiness-result-file) でunexpected_passを受けた場合にdeterministic_fail_confirmedを返す --vc-preflight-result-fileでresults[].category == "unexpected_pass"を受けた場合にも同等に deterministic 判定を返す
を満たすことを、既存回帰テスト+新規回帰テストで確認する。
unsafe_command / command_not_allowed は現時点では baseline 仕様の producer 変更を伴うため別Issueで対応し、本Issueは unexpected_pass に限定する。
In Scope
unexpected_pass向けのentry_idをREVIEWER_CHECKER_TAXONOMY_V1に追加するunexpected_passの readiness カテゴリ/ソースチェックを厳密化し、reviewer_claim_replay.pyの replay 判定で deterministic_fail_confirmed になること--vc-preflight-result-file経由で、category == "unexpected_pass"を受け取った場合にも deterministic 判定が行われるようにするrgの存在チェックに依存しない--dump-taxonomy+ parity テストでの検証を追加するsafe scopeとしてtest_reviewer_claim_replay_taxonomy_parity.pyを Allowed Paths に追加する
Out of Scope
unsafe_command/command_not_allowedの producer ルートやcontract_readiness_check.pyへの mapping 変更baseline_vc_preflight.pyのカテゴリー体系そのものの再設計- Issue 実装: hooks-stdout-policy AC7 の nested standalone smoke を Vitest 直実行へ統合して高速化する #1354 の本文修正(別対応)
Acceptance Criteria
- AC1:
--dump-taxonomy/REVIEWER_CHECKER_TAXONOMY_V1にentry_id == "unexpected_pass"が存在し、readiness_category_source_check == "baseline_vc_preflight"が付与される - AC2: readiness 結果(
unexpected_pass)を与えた replay がdeterministic_fail_confirmedを返し、should_consume_iteration == trueとなる - AC3:
--vc-preflight-result-fileにresults[].category == "unexpected_pass"を含む入力を与えた replay がdeterministic_fail_confirmedを返す - AC4:
test_reviewer_claim_replay.pyが PASS - AC5:
test_reviewer_claim_replay_taxonomy_parity.pyが PASS - AC6: 本 Issue の
safe scope内で既存 tests / lint が PASS - AC7:
unsafe_command/command_not_allowedの別対応方針(Issue)を明記する
Verification Commands
# AC1
$ uv run --locked pytest .claude/skills/issue-refinement-loop/tests/test_reviewer_claim_replay.py -v
# AC2
$ uv run --locked pytest .claude/skills/issue-refinement-loop/tests/test_reviewer_claim_replay.py -v
# AC3
$ uv run --locked pytest .claude/skills/issue-refinement-loop/tests/test_reviewer_claim_replay.py -v
# AC4
$ uv run --locked pytest .claude/skills/issue-refinement-loop/tests/test_reviewer_claim_replay.py -v
# AC5
$ uv run --locked pytest .claude/skills/issue-refinement-loop/tests/test_reviewer_claim_replay_taxonomy_parity.py -v
# AC6
$ uv run --locked pytest .claude/skills/issue-refinement-loop/tests/test_reviewer_claim_replay.py -v
# AC7
$ uv run --locked pytest .claude/skills/issue-refinement-loop/tests/test_reviewer_claim_replay_taxonomy_parity.py -vAllowed Paths
- .claude/skills/issue-refinement-loop/scripts/reviewer_claim_replay.py
- .claude/skills/issue-refinement-loop/tests/test_reviewer_claim_replay.py
- .claude/skills/issue-refinement-loop/tests/test_reviewer_claim_replay_taxonomy_parity.py
Runtime Verification Applicability
decision: immediate
applicable_acs:
- AC1
- AC2
- AC3
- AC4
- AC5
- AC6
- AC7
execution_environment:
cli_tools:
- python3
- uv
auth_required: false
network_required: false
skip_conditions:
- "AC いずれかが `needs-fix`/`human_judgment` の場合は SKIP ではなく再審査"
fallback_policy:
fallback_success_is_pass: false
notes: "skip や fallback の成功を PASS として扱わない"
artifact_requirements:
- "contract_readiness_check.py 出力"
- "pytest output"Stop Conditions
- Allowed Paths 外の変更が必要と判明した場合
- In Scope の固定契約(キー集合・スキーマ・型定義)の変更が必要になった場合
- 新規 Issue の起票が必要と判断した場合(スコープ分割が発生する場合)
- 後続 Phase / 別スコープへの波及が判明した場合
- nested SubAgent delegation が必要になった場合
- 外部サービス利用・権限昇格・既存テスト大規模改変が必要になった場合
Required Skills
なし
Required Design References
.claude/skills/issue-refinement-loop/SKILL.md#Step 2a Reviewer Claim Replay Arbitration
Scope Delta(任意)
N/A
Metadata
Metadata
Assignees
Labels
phase/implementationImplementation phase
Activity
squne121 commentedon Jul 7, 2026
判定: REQUEST_CHANGES
#1368 の方向性自体は妥当です。
baseline_vc_preflight.py由来のunexpected_pass/unsafe_command/command_not_allowedをreviewer_claim_replay.pyの taxonomy に接続し、reviewer blocker を deterministic evidence で裁定したい、という狙いは Step 2a の設計と整合します。#1368 は open で、Issue コメントは現時点で 0 件です。ただし、現Issue契約のまま実装すると「局所テストだけ green」「full suite では fail」「直接
baseline_vc_preflight/v1artifact 経路では未対応」「unsafe_command/command_not_allowedは実オーケストレーション上 human_judgment に落ち得る」という不一致が残ります。P0-1: Allowed Paths と AC5 が矛盾している
#1368 は taxonomy に3エントリを追加し、AC5で「既存テスト全件 PASS」を要求していますが、Allowed Paths は
reviewer_claim_replay.pyとtest_reviewer_claim_replay.pyだけです。ところが既存のtest_reviewer_claim_replay_taxonomy_parity.pyは entry_id 集合を 4件に固定しており、unexpected_pass/unsafe_command/command_not_allowedを追加した瞬間に drift 検出で落ちます。これは偶然ではなく、Issue #1286 / PR #1304 系の設計で「taxonomy parity / dump drift を検出する」ために作られたテストです。
--dump-taxonomyの出力と live constant が一致することも固定されています。修正要求: Allowed Paths に
.claude/skills/issue-refinement-loop/tests/test_reviewer_claim_replay_taxonomy_parity.pyを追加し、AC5 の Verification Command も少なくとも以下に変更してください。P0-2:
--vc-preflight-result-file経路が新カテゴリに対応しないStep 2a の documented invocation は
--vc-preflight-result-file <baseline_vc_preflight_v1_path>を受け取れる契約です。しかし現行
reviewer_claim_replay.pyの_matching_vc_preflight()はkind != "vc_command_format"の場合に即[]を返します。つまり、taxonomy に3エントリを足しても、直接渡されたbaseline_vc_preflight/v1.results[]のunexpected_pass/unsafe_command/command_not_allowedは backing evidence として使われません。既存テストも直接
vc_preflight_resultで backing するケースは C4 /compound_command_disallowedだけです。#1368 の AC2〜AC4 は「readiness 結果」を使う形なので、この直接 artifact 経路の穴を検出できません。修正要求: Issue本文のIn Scopeに、
_matching_vc_preflight()の一般化を明示してください。最小方針は次です。そのうえで、AC2〜AC4 は readiness 経路だけでなく、直接
vc_preflight_result経路でもdeterministic_fail_confirmedになることを要求してください。P0-3:
unsafe_command/command_not_allowedは producer 側でneeds_fixにならない可能性が高いbaseline_vc_preflight.pyは denylist command をblocked / unsafe_commandに分類し、allowlist外コマンドをblocked / command_not_allowedに分類します。これは shell / network / filesystem mutation を遮断する静的安全設計として妥当です。外部仕様・実装慣行の観点でも、この方向は正しいです。Python
subprocess.run()はshell=Falseを既定とし、引数列を渡す方法が quoting / escaping 管理上望ましいと説明しています。OWASP も OS command injection 対策として、OS command を直接呼ばないこと、避けられない場合は parameterization と command/argument の allowlist validation を使うことを推奨しています。([Python documentation]1) ([OWASP Cheat Sheet Series]2)問題は
contract_readiness_check.py側です。_PREFLIGHT_CATEGORY_TO_READINESSにはunexpected_pass -> needs_fixはありますが、unsafe_commandとcommand_not_allowedは見当たりません。未登録のblockedcategory はhuman_judgmentに倒れる実装です。したがって、#1368 のゴールである「needs-fix ループが不要な human_escalation に倒れないようにする」は、
reviewer_claim_replay.pyの taxonomy 追加だけでは達成できません。ユニットテストで fabricated readiness payload を渡せば AC3/AC4 は通せますが、実 producer 経路ではhuman_judgmentとして扱われ、Step 2a の前段で止まる可能性があります。修正要求: どちらかに絞ってください。
unexpected_passのみを対象にする。unsafe_command/command_not_allowedは別Issueで producer routing policy から設計する。contract_readiness_check.pyとそのテストを追加し、unsafe_command/command_not_allowedを body-author-fixableneeds_fixにするかどうかを明示的に決める。後者を選ぶ場合でも、安全ポリシーは緩めるべきではありません。修正対象は「危険コマンドを許可すること」ではなく、「危険/非allowlist VCを書いた Issue 本文を body-author に修正させる routing」です。
P1-1: AC2〜AC4 が source spoofing に弱い
#1368 の AC は「
category: "unsafe_command"を含む readiness 結果」としか言っていません。現行_matching_readiness_errors()は taxonomy entry 側のreadiness_category_source_checkがNoneならcategoryだけで一致します。これは category 文字列の衝突に弱いです。今回の3カテゴリは明確に
baseline_vc_preflight由来なので、entry は以下のように source を固定すべきです。unsafe_commandとcommand_not_allowedも同様に、readiness_category_source_check: baseline_vc_preflightを固定し、テストではresult["blockers"][0]["evidence"][0]["source_check"] == "baseline_vc_preflight"まで見るべきです。P1-2: AC1 の
rg -c "unexpected_pass"は検証として弱いAC1 の Verification Command は単なる文字列出現数です。コメント、fix_hint、テスト名、既存 fixtures に文字列が出ても通ります。#1286 由来の設計は
--dump-taxonomyと parity test で drift を検出する方向なので、AC1 も taxonomy JSON の構造を検証すべきです。推奨は pytest 側で
dump_taxonomy()を直接検査することです。CLIでやるなら--dump-taxonomyをjqで検査してください。P1-3: SKILL.md の exact mapping は今回も stale になる
#1368 は Required Design Reference として Step 2a を挙げていますが、現行 Step 2a の exact mapping は
vc_command_format/ac_vc_number_mismatch/missing_section/rva_immediate_field_missingの4件だけです。出力契約も legacy 値中心で、taxonomy拡張と完全には同期していません。#1368 の Allowed Paths には
SKILL.mdが入っていないため、実装Issueとしては「doc更新は別Issue」として許容できます。ただし、その場合は Issue 本文に「Step 2a mapping doc の追従は Out of Scope / follow-up」と明記すべきです。現状の書き方だと Required Design Reference を参照しながら、その文書と実装の mapping drift を増やします。推奨する修正版スコープ
最小で通すなら、#1368 を次のように書き換えるのが安全です。
Acceptance Criteria は以下に変更。
unsafe_command/command_not_allowedを end-to-end の needs-fix loop に乗せたいなら、別途contract_readiness_check.pyの category mapping を変更するスコープを追加してください。そこまでやらない場合、#1368 のゴール文から「needs-fix ループが不要な human_escalation に倒れない」を削り、「Step 2a が当該 category を deterministic evidence として認識できる」に狭めるべきです。squne121 commentedon Jul 7, 2026
Contract Review Result
[-]実装: reviewer_claim_replay.py の taxonomy に unexpected_pass/unsafe_command/command_not_allowed を追加する[/-][+]実装: reviewer_claim_replay.py の taxonomy に unexpected_pass を追加する[/+]squne121 commentedon Jul 7, 2026
implement-issue: 実装完了 (2026-07-08T00:00:00Z)
.claude/worktrees/issue-1368-reviewer-claim-replay-py-taxonomy-unexpeworktree-issue-1368-reviewer-claim-replay-py-taxonomy-unexpeuv run --locked pytest .claude/skills/issue-refinement-loop/tests/test_reviewer_claim_replay.py -vPASSuv run --locked pytest .claude/skills/issue-refinement-loop/tests/test_reviewer_claim_replay_taxonomy_parity.py -vPASSfix: harden vc preflight reviewer replay (#1368)
test: wrap long fixture command line (#1368)
fix: add unexpected_pass reviewer replay support (#1368) (#1394)