Repository navigation
Closed
Labels
agent/implementerAI implementer agentenhancementNew feature or requestphase/implementationImplementation phase
Description
Machine-Readable Contract
contract_schema_version: v1
issue_kind: implementation
parent_issue: none
goal_ref: "issue-reviewer / review-issue が unsupported deterministic-domain finding を blocker として流せない fail-closed contract を確立する"
change_kind: workflowParent Issue
none
Parent Goal Ref
- Goal: unsupported deterministic-domain finding を reviewer blocker として通さない
- Desired Destination:
review-issueproducer contract、issue-reviewersurface、compact_review_result.pyconsumer artifact が current repo reality に揃い、deterministic-domain blocker は checker evidence なしに blocking routing へ寄与できない状態
Current Validated Scope
.claude/agents/issue-reviewer.md/.codex/agents/issue-reviewer.toml/.agents/skills/review-issue/SKILL.mdの reviewer contract / Codex parity surface を current repo reality に揃える.claude/skills/review-issue/の full artifact contract・findings[]・checker evidence・validator / test を fail-closed に更新する.claude/skills/issue-refinement-loop/scripts/compact_review_result.pyと関連 test で provenance を含む新 artifact contract を保持できるよう更新する
Remaining Parent Gaps
-
check_issue_contract.py/contract_readiness_check.pyの rule semantics 追加・意味変更は別 Issue で扱う - consumer-side arbitration / replay surface を追加または改修する判断は別 Issue で扱う
- PR feat(#1021): reviewer false-positive arbitration で unreasoned blocker を iteration 消費なしで降格する #1032 follow-up として safety net を削除・再設計する判断は別 Issue で扱う
Outcome
review-issue / issue-reviewer / compact_review_result.py が evidence なし deterministic-domain finding を blocking routing に流さない fail-closed contract を共有し、Codex parity drift を検出する test が PASS している状態。
In Scope
REVIEW_ISSUE_RESULT_V1full artifact にfindings[]と producer schema version を追加し、deterministic-domain blocker / checker_gap / heuristic_concern を機械可読に区別する- deterministic-domain blocker に checker evidence を必須化し、unsupported finding は producer 側で reject または non-blocking に降格する
compact_review_result.pyartifact に freshness / producer provenance を保持し、legacy field 併存時の fail-closed 条件を定義する.codex/agents/issue-reviewer.tomlのrepo_local_skill_surfaceを current repo の実在 surface に揃え、Claude/Codex parity を test で固定するreview-issue実 artifact shape を使った integration-oriented test を追加し、unsupported deterministic-domain finding が rewrite routing を消費しないことを確認する
Out of Scope
check_issue_contract.py/contract_readiness_check.py/baseline_vc_preflight.py/vc_contract_syntax.pyの rule semantics 変更- 存在しない consumer-side replay/arbitration surface を前提にした実装や、その recreate
- issue-author の rewrite strategy 全面改修
- unrelated agent permission / hook / runtime config 変更
Acceptance Criteria
- AC1:
REVIEW_ISSUE_RESULT_V1full artifact にfindings[]が追加され、各 finding は少なくともfinding_kind,blocking,deterministic_domain_key,checker_evidence[]を持つ - AC2:
finding_kind=deterministic_domain_blockerの finding はchecker_evidence[]を 1 件以上必須とし、evidence なし finding は blocker として artifact / compact output / routing に流れない - AC3:
checker_evidence[]は少なくともsource_check,rule_id,category,artifact_path,artifact_schema,body_sha256を保持し、current body と一致しない evidence は stale として reject される - AC4:
checker_gapは「deterministic-domain registry に該当するが current checker evidence がない finding」、heuristic_concernは「registry 外の主観的・構造的懸念」として明文化され、どちらもblocking=falseかつ rewrite iteration を消費しない - AC5:
compact_review_result.pyは新 full artifact contract を保持しつつ、legacy compact stdout を維持する。schema mismatch / stale provenance / unsupported finding 混在時は fail-closed にする - AC6:
.codex/agents/issue-reviewer.tomlのrepo_local_skill_surfaceが current repo の実在 skill surface を指し、.agents/skills/review-issue/SKILL.mdを含む parity test で drift を検出できる - AC7:
review-issue実 artifact fixture →compact_review_result.pyの経路を使う test で、unsupported deterministic-domain finding が non-blocking に留まることを確認する - AC8: checker-backed deterministic-domain finding を含む fixture では、従来どおり
needs-fixrouting されることを test で確認する
Verification Commands
# AC1
$ uv run pytest .claude/skills/review-issue/tests -q
# AC2
$ uv run pytest .claude/skills/review-issue/tests -q
# AC3
$ uv run pytest .claude/skills/review-issue/tests -q
# AC4
$ uv run pytest .claude/skills/review-issue/tests -q
# AC5
$ uv run pytest .claude/skills/issue-refinement-loop/tests/test_compact_review_result.py -q
# AC6
$ uv run pytest .claude/skills/issue-refinement-loop/tests/test_skill_md_wiring.py -q
# AC7
$ uv run pytest .claude/skills/issue-refinement-loop/tests -q
# AC8
$ uv run pytest .claude/skills/issue-refinement-loop/tests -qAllowed Paths
.claude/agents/issue-reviewer.md.codex/agents/issue-reviewer.toml.agents/skills/review-issue/SKILL.md.claude/skills/review-issue/SKILL.md.claude/skills/review-issue/scripts/*.claude/skills/review-issue/tests/*.claude/skills/issue-refinement-loop/scripts/compact_review_result.py.claude/skills/issue-refinement-loop/tests/*
Stop Conditions
- Allowed Paths 外の変更が必要と判明した場合
- In Scope の固定契約(キー集合・スキーマ・型定義)の変更が必要になった場合
- 新規 Issue の起票が必要と判断した場合(スコープ分割が発生する場合)
- 後続 Phase / 別スコープへの波及が判明した場合
- nested SubAgent delegation が必要になった場合
- 外部サービス利用・権限昇格・既存テスト大規模改変が必要になった場合
Required Skills
なし
Scope Delta(任意)
N/A
Delivery Rule
- 1 Issue = 1 PR
- Draft PR で開始する
- consumer-side replay safety net の有無に依存せず、producer-side fail-closed contract と Codex parity を先に固定する
- 既存 compact stdout 互換は維持しつつ、full artifact schema と validator を current repo reality に合わせて更新する
Runtime Verification Applicability
- decision: not_applicable
- reason: workflow / artifact contract / test の更新であり、runtime 動作検証よりも static validator と test suite が正本になるため
Metadata
Metadata
Assignees
Labels
agent/implementerAI implementer agentenhancementNew feature or requestphase/implementationImplementation phase
Activity
squne121 commentedon Jun 20, 2026
結論
#1042 は方向性は正しいですが、このまま実装に渡すにはまだ粗いです。
特に危険なのは、「deterministic-domain blocker を checker evidence なしに blocker 化しない」という目的が、schema / artifact / routing / Codex parity / state corruption のどこで強制されるかが曖昧な点です。
#1042 自体は open でコメントなし、主な前提は #1021 と PR #1032 です。#1021 は reviewer blocker が deterministic checker と結び付かないまま iteration を消費する問題への consumer-side arbitration で、すでに completed。PR #1032 も merged され、
reviewer_claim_replay.pyと Step 2a arbitration が入っています。#1042 はその後段 safety net ではなく、上流の issue-reviewer / review-issue artifact contract を fail-closed にする follow-up として扱うべきです。主要 Blocker
B1. 「instructions に追記」では既に足りない。既存 instructions はすでに checker SSOT と言っている
現行の
.claude/agents/issue-reviewer.mdは、LLM が C1〜C12 を独自判定しない、checker 結果の整形・pass-through のみ、non_blocking_improvementsやdiff_proposalへ独自追記しない、と明記済みです。つまり #1042 で単に「deterministic checker 対象領域を再判定しない」を追記しても、過去の失敗を防げません。必要なのは prompt 文言ではなく、artifact schema と validator が unsupported blocker を機械的に拒否することです。Claude Code の subagent は独自 context・tool/permission・system prompt を持つ仕組みで、project-local agent 定義や skill preload に依存します。公式 docs 上も、subagent/skill は制約を記述できる一方、最終的には local files・tools・permissions・hooks・validators の組み合わせで運用するものです。したがって、自然言語 instruction だけを enforcement boundary と見なす設計は弱いです。([Claude API Docs]1) ([Claude API Docs]2)
B2. 現行
reviewer_claim_replay.pyは mixed blocker を誤って通す現在の
analyze()は blocker ごとに evidence を作りますが、最終判定はany_backedです。つまり、reviewer output に「evidence 付き deterministic blocker 1件」と「unsupported deterministic-domain blocker 1件」が混在すると、全体がdeterministic_fail_confirmedになり、unsupported blocker が見逃されます。#1042 の目的はこの経路を閉じることなので、aggregate verdict をany_backedで決める実装を禁止する AC が必要です。必要な仕様は次です。
B3. producer-consumer contract がまだ壊れやすい
review-issue/SKILL.mdは readiness errors のfix_hintをblocking_issuesに転写し、errors[]構造体をstructured_blockersに転写すると書いています。一方、reviewer_claim_replay.pyはstructured_blockersを先に読み、dict のcode/reviewer_blocker_codeがなければ無視し、次にblocking_issuesの文字列全体を blocker code として扱います。さらに既存テストの
COMPACT_C4/COMPACT_MISSING_SECTIONは、blocking_issues: [{"code": "..."}]という手作り fixture です。これは real producer であるreview-issue -> compact_review_result.pyの実 artifact shape を十分に再現していません。#1042 には、次の integration test を明示的に入れるべきです。
fixture-only の
analyze()単体テストだけでは、再発防止になりません。B4.
artifact_pathと current-iteration freshness が不足している#1042 は
source_check / rule_id / artifact_pathなどの checker evidence を必須にすると書いていますが、現行reviewer_claim_replay.pyの evidence はsource_check / rule_id / category / line_start / line_end / body_sha256だけで、どの checker artifact から来た evidence なのかを保持していません。compact_review_result.pyの artifact にも、readiness result artifact path、checker artifact path、iteration id、producer schema version は入っていません。#1042 の AC は次のように強めるべきです。
これがないと、stale artifact や別 iteration の checker fail を reviewer blocker の裏付けとして誤用できます。
B5. phase state が rewrite に進みすぎる
issue-refinement-loop/SKILL.mdはVERDICT: needs-fixのとき、phase state をrewriteに更新し、その直後に Step 2a replay arbitration を実行すると書いています。しかし arbitration の結果がdowngrade_to_non_blockingなら、rewrite に進まないはずです。phase が先にrewriteになると、loop state / hard stop / routing log が実態とズレます。修正案はどちらかです。
#1042 の scope には
issue-refinement-loopの routing / compact artifact / tests が含まれているため、この点は入れるべきです。B6. state file corruption が fail-closed compact JSON になっていない
_load_json_file()は JSON decode error をValueErrorに包みますが、_load_state()はjson.loads()の例外をそのまま出します。main()が catch するのはValueErrorだけなので、壊れた state file は compactinput_or_runtime_errorではなく traceback になり得ます。#1042 は unsupported blocker だけでなく、arbitration state の破損も fail-closed output contract に含めるべきです。追加テストは最低限これです。
B7. Codex parity の allowed paths が足りない可能性がある
.codex/agents/issue-reviewer.tomlはrepo_local_skill_surface: .agents/skills/review-issue/SKILL.mdを参照しています。一方 #1042 の allowed paths は.claude/skills/review-issue/...と.codex/agents/issue-reviewer.tomlだけで、.agents/skills/review-issue/SKILL.mdが含まれていません。これは実装時に次のどちらかで止まるべきです。
.agents/skills/review-issue/SKILL.mdが実在し、Codex runtime がそれを使うなら、実装: issue-reviewer の deterministic-domain blocker 生成を fail-closed に制限する #1042 の allowed paths に追加する。.codex/agents/issue-reviewer.tomlの参照先を実際の skill surface に修正し、Codex parity test を追加する。Codex 公式 docs でも project-local
.codex/config/rules/hooks は trusted project でのみ読み込まれる前提です。つまり、Codex 側の配布品質は「TOML を置いた」だけでは成立せず、trusted project / project config / skill surface の実在性まで検証が必要です。([OpenAI Developers]3)B8.
checker_gapとheuristic_concernの分類基準が未定義#1042 は evidence のない deterministic-domain 指摘を
heuristic_concernまたはchecker_gapとして扱う、と書いています。しかし両者の差が未定義です。ここが曖昧だと、実装者は「checker_gap だから blocker」または「heuristic_concern だから無視」という恣意的 routing を入れます。明示すべき分類は次です。
B9.
ISSUE_REVIEW_RESULT_COMPACT_V1の versioning 方針がないcompact_review_result.pyはVALID_VERDICTS = {"approve", "needs-fix"}、VALID_STATUSES = {"ok", "failed"}に固定されています。一方review-issue/SKILL.mdはhuman_judgmentをneeds-fixに畳み込まないと書いており、既存 contract だけでもズレがあります。#1042 で full artifact schema に
finding_kindを追加するなら、次を決める必要があります。高品質化のための #1042 修正文案
#1042 の本文にそのまま追記するなら、最低限この差分が必要です。
実装時の優先順位
artifact schema を先に固定
finding_kind/checker_evidence/deterministic_domain_keyの schema を先に決める。ここを曖昧にすると、後続の routing test が意味を失います。producer-realistic integration test を先に追加
現行の hand-rolled fixture は弱いです。まず実際の
compact_review_result.pyartifact shape で落ちる test を作るべきです。any_backedを廃止blocker 単位で routing し、unsupported finding を別 lane に分離する。
phase state を
review_arbitrationにするか、rewrite 更新を遅延arbitration 前に
rewritephase を記録しない。Codex surface drift を解消
.codex/agents/issue-reviewer.tomlの参照先と allowed paths の不整合を潰す。最終判定
この Issue は必要。ただし現状のままでは実装者が「instructions を少し足して、fixture を追加して PASS」に逃げられる余地があります。
#1042 の成功条件は、PR #1032 の後段 replay を増強することではなく、
issue-reviewerが unsupported deterministic-domain blocker を 生成できない / blocker として compact artifact に入れられない / routing で iteration を消費できない ところまで上流で閉じることです。squne121 commentedon Jun 20, 2026
issue-refinement-loop: 本文更新
instructions追記中心の曖昧な改善から、producer-side fail-closed contract / compact artifact / Codex parity を固定する実装 Issue に絞り直しました。.agents/skills/review-issue/SKILL.mdを含む surface parity を明示し、存在しない consumer-side replay surface への依存は Out of Scope 側へ退避しました。Acceptance CriteriaをAC1-AC8の安定参照付きに更新し、finding_kind/checker_evidence/ stale evidence rejection /checker_gapとheuristic_concernの分類境界を明文化しました。Verification Commandsは bare# AC<N>形式へ正規化し、check_issue_contract.pyとcontract_readiness_check.py --mode preflight-staticの両方で green を確認済みです。squne121 commentedon Jun 20, 2026
Refinement Loop: Approved
The issue has been approved and is ready for implementation.
approvedsqune121 commentedon Jun 20, 2026
Contract Review Result
squne121 commentedon Jun 20, 2026
impl-review-loop: 完了 (2026-06-21T00:00:00Z)