Repository navigation
Description
Machine-Readable Contract
contract_schema_version: v1
issue_kind: implementation
parent_issue: none
goal_ref: "check_issue_contract.py --json の deterministic failure を compact artifact と arbitration に正しく伝播させ、VC command format failure を non-blocking checker_gap として握りつぶさない"
change_kind: workflow
stage: 1
blocked_by: []
dedupe_key: ops-improvement:loop-protocol:compact-review-blocker-fix:2026-06Background
#985 の loop では check_issue_contract.py が C4_vc_commands_present を deterministic fail として検出した一方、compact_review_result.py では finding_kind=checker_gap, blocking=false, domain=vc_command_format へ落ちた。その結果 reviewer_claim_replay.py が reviewer claim を unbacked と扱い、2回目で reviewer_false_positive_suspected → human_escalation になった。
これは reviewer の問題というより、deterministic checker JSON から compact blocker を再構成する consumer 側の schema/semantics gap である。
一方で、#1042 / PR #1058 で固定した fail-closed semantics は維持する必要がある。checker_gap をそのまま blocking 化するのではなく、deterministic evidence と artifact の整合を判定した上で、必要なら checker_artifact_inconsistency か正規 deterministic_domain_blocker へ再構成する contract に寄せる。
Parent Issue
none
Parent Goal Ref
- Goal: check_issue_contract.py --json の deterministic failure が compact artifact と arbitration に正しく伝播し、VC command format failure が non-blocking checker_gap として握りつぶされない
- Desired Destination: 実装: existing enemy_chaser を new taxonomy へ非破壊移行する #985 再現 fixture で C4 deterministic fail が compact/arbitration を通じて blocking として保持され、unsupported deterministic-domain finding は引き続き fail-closed に留まる状態
Current Validated Scope
.claude/skills/review-issue/scripts/check_issue_contract.pyの findings / deterministic_checks / checker_evidence 出力整合を明確化する.claude/skills/review-issue/schemas/review_issue_result_v1.jsonにstructured_blockersと findings/evidence consistency expectation を固定する.claude/skills/issue-refinement-loop/scripts/compact_review_result.pyで full artifact から compact blocker を再構成する.claude/skills/issue-refinement-loop/scripts/reviewer_claim_replay.pyでchecker_artifact_inconsistencylane と fallback evidence 探索を固定する.claude/skills/issue-refinement-loop/scripts/build_refinement_phase_state.pyを含む JSON artifact/state の strict JSON policy を固定する.claude/skills/issue-refinement-loop/tests/とtests/test_issue_refinement_ops_review.py/tests/test_check_agent_friendly_stdout.pyに 実装: existing enemy_chaser を new taxonomy へ非破壊移行する #985 再現 fixture と strict JSON regression を追加する.claude/agents/issue-reviewer.md/.codex/agents/issue-reviewer.tomlに compact result schema surface を明記する
Remaining Parent Gaps
なし(単独改善 Issue のため)
Outcome
check_issue_contract.py --json の deterministic failure が compact artifact と arbitration に正しく伝播し、VC command format failure が non-blocking checker_gap として握りつぶされず、#1042 の fail-closed semantics を壊さない。
In Scope
check_issue_contract.pyの deterministic-domain finding とchecker_evidenceの整合整理review_issue_result_v1.jsonへのstructured_blockersと findings/evidence consistency expectation 追加compact_review_result.pyの findings / structured_blockers からの compact blocker 再構成reviewer_claim_replay.pyのchecker_artifact_inconsistencylane と fallback evidence 探索ルール整理build_refinement_phase_state.py/ compact artifact / replay state の strict JSON policy 追加- 実装: existing enemy_chaser を new taxonomy へ非破壊移行する #985 C4 failure 再現 fixture と strict JSON regression fixture 追加
- issue-reviewer surface 文書の current repo reality への同期
Out of Scope
check_issue_contract.pyの C1-C13 checker logic 自体の意味変更scope_signal_guardの変更- guard / hook / permission profile の変更
- runtime UI / Pages preview / deploy artifact の変更
Acceptance Criteria
- AC1:
check_issue_contract.py --jsonがC4_vc_commands_present=failを返す fixture で、REVIEW_ISSUE_RESULT_V1のblocking_issues/findings/deterministic_checksが相互矛盾しない - AC2: C4 fail は
finding_kind=deterministic_domain_blocker/blocking=true/checker_evidence>=1、またはchecker_artifact_inconsistencyとして fail-closed され、checker_gapのまま blocking 化しない - AC3:
structured_blockersがない compact artifact でも、findings[]の正規deterministic_domain_blockerからreviewer_claim_replay.pyが rewrite-ready blocker を再構成できる - AC4:
matched_findingsがchecker_gap/heuristic_concernのみの場合、reviewer_claim_replay.pyは readiness / vc_syntax / vc_preflight fallback evidence 探索を抑止しない - AC5:
deterministic_checks.C4_vc_commands_present=failとfindings[].checker_gapが同居する場合、reviewer_false_positive_suspectedではなくchecker_artifact_inconsistencyに分離される - AC6: 実装: existing enemy_chaser を new taxonomy へ非破壊移行する #985 再現 fixture で Pass 1 / Pass 2 が
human_escalationに直行せず、正規 blocker reconstruction またはchecker_artifact_inconsistencyになる - AC7:
compact_review_result.py/reviewer_claim_replay.py/build_refinement_phase_state.pyの JSON 出力と状態保存はallow_nan=False、読み込みはparse_constantreject を使う - AC8:
REVIEW_ISSUE_RESULT_V1schema にstructured_blockersと findings/evidence consistency の期待が明記され、schema または custom invariant test で固定される - AC9: 既存 実装: issue-reviewer の deterministic-domain blocker 生成を fail-closed に制限する #1042 方針を維持し、evidence なし deterministic-domain finding を単純に blocking 化しない
Stop Conditions
- Allowed Paths 外の変更が必要と判明した場合
- In Scope の固定契約(キー集合・スキーマ・型定義)の変更が必要になった場合
- 新規 Issue の起票が必要と判断した場合(スコープ分割が発生する場合)
- 後続 Phase / 別スコープへの波及が判明した場合
- nested SubAgent delegation が必要になった場合
- 外部サービス利用・権限昇格・既存テスト大規模改変が必要になった場合
Required Skills
- Python
- JSON Schema validation
Verification Commands
# AC1
# AC2
# AC8
# AC9
$ uv run pytest .claude/skills/review-issue/tests -q# AC3
# AC4
# AC5
# AC6
# AC7
$ uv run pytest .claude/skills/issue-refinement-loop/tests/test_compact_review_result.py .claude/skills/issue-refinement-loop/tests/test_reviewer_claim_replay.py .claude/skills/issue-refinement-loop/tests/test_issue_refinement_ops_review.py -q# strict_json regression detail
$ uv run pytest .claude/skills/issue-refinement-loop/tests -k "nan or infinity or strict_json" -q# canonical gates
$ pnpm typecheck
$ pnpm lint
$ pnpm test
$ pnpm buildAllowed Paths
- .claude/skills/review-issue/scripts/check_issue_contract.py
- .claude/skills/review-issue/schemas/review_issue_result_v1.json
- .claude/skills/review-issue/tests/test_check_issue_contract.py
- .claude/skills/issue-refinement-loop/scripts/compact_review_result.py
- .claude/skills/issue-refinement-loop/scripts/reviewer_claim_replay.py
- .claude/skills/issue-refinement-loop/scripts/build_refinement_phase_state.py
- .claude/skills/issue-refinement-loop/tests/
- tests/test_issue_refinement_ops_review.py
- tests/test_check_agent_friendly_stdout.py
- .claude/agents/issue-reviewer.md
- .codex/agents/issue-reviewer.toml
Runtime Verification Applicability
- decision: deferred
- reason: workflow artifact / schema / arbitration の変更であり、実装後の pytest と canonical gates が受け入れ証跡になる
- deferred_destination:
- destination_type: issue
- destination_ref: "実装: review checker compact artifact の blocking semantics を修正し C4 VC failure を human escalation に誤分類しない #1086"
- deferred_verification_condition: 対象 pytest と
pnpm typecheck/pnpm lint/pnpm test/pnpm buildが PASS すること
Related Issues
- 実装: existing enemy_chaser を new taxonomy へ非破壊移行する #985: 本改善のトリガー(C4 が non-blocking checker_gap に誤分類)
- 実装: issue-reviewer の deterministic-domain blocker 生成を fail-closed に制限する #1042 / PR fail-closed checker artifacts for review-issue findings #1058: review-issue fail-closed checker artifacts
- 実装: issue-refinement-loop fail_closed constraints の reason semantics と consumer rewrite budget を閉じる #1067 / PR fix(#1067): issue-refinement-loop reason semantics と consumer rewrite budget を修正 #1071: issue-refinement-loop reason semantics
Activity
squne121 commentedon Jun 21, 2026
判定
REQUEST_CHANGES / #1086 は必要だが、このまま実装に渡すと再び semantics が壊れる可能性が高いです。
#1086 の問題意識は正しいです。現行
check_issue_contract.pyは C4/C5 をdeterministic_domain_blockerとして_append_findings()に渡していますが、checker_evidenceを渡していないため、_append_findings()内でchecker_gap / blocking=falseに降格されます。これが #1086 の背景にある「C4 deterministic fail が non-blocking checker_gap に落ちる」現象と整合します。ただし、#1086 の現在の AC/Scope は #1042 / PR #1058 で作った
checker_gapsemantics と衝突しています。review_issue_result_v1.jsonはchecker_gapのblocking=falseを schema 上で固定し、deterministic_domain_blockerの場合だけblocking=trueかつchecker_evidence最低1件を要求しています。 JSON Schema のif/thenは条件に応じて subschema を適用する仕組みで、配列長もminItemsで制約できます。つまり現 schema 設計では「checker_gap のまま blocking に昇格」は schema 違反方向です。([JSON Schema]1) ([JSON Schema]2)Blocker 1: AC3 の表現が schema と衝突している
#1086 の AC3 は「
domain=vc_command_formatかつ deterministic evidence ありのchecker_gapは blocking へ昇格」としています。これは危険です。checker_gapは #1042 の目的上、「deterministic-domain に見えるが current checker evidence がないので non-blocking」として導入された分類です。実際、schema でもchecker_gapはblocking=falseに固定されています。修正すべき表現はこれです。
Blocker 2:
check_issue_contract.py側の evidence 生成方法が未定義現在の
check_issue_contract.pyはbody_sha256を持ち、findings[]も出しますが、C4/C5 には validchecker_evidenceを付けていません。結果として_append_findings()が deterministic blocker をchecker_gapに落とします。#1086 は「
check_issue_contract.py: structured_blockers 出力の追加または確認」と書いていますが、現在のREVIEW_ISSUE_RESULT_V1schema の required fields にはstructured_blockersが含まれていません。compact_review_result.pyはstructured_blockersを読むだけで、schema による契約固定はありません。したがって、#1086 の Allowed Paths に以下を追加すべきです。
- .claude/skills/review-issue/schemas/review_issue_result_v1.json追加しない場合、
structured_blockersを足しても「schema で保証されない optional side-channel」になります。Blocker 3:
reviewer_claim_replay.pyの fallback suppression が本質バグ現行
reviewer_claim_replay.pyは、対象 kind に一致するfindings[]が1件でもあると、readiness / vc_syntax / vc_preflight 側の fallback evidence 探索に入りません。つまりvc_command_formatのchecker_gapが存在するだけで、readiness artifact に VCS001 等の deterministic evidence があっても無視されます。これは #1086 の中核です。
compact_review_result.pyだけでなく、reviewer_claim_replay.py側にも明示 AC が必要です。Blocker 4:
checker_artifact_inconsistencyの判定条件が不足#1086 は
checker_artifact_inconsistencyとreviewer_false_positive_suspectedの分離を要求していますが、どの入力状態を inconsistency とするかが未定義です。最低限、以下を固定してください。
ここを曖昧にすると、単に「2回目 human escalation を避ける」ために何でも rewrite へ流す実装になり、#1042 の fail-closed 方針を破壊します。
Blocker 5: AC7 strict JSON が現行実装と噛み合っていない
#1086 の AC7 は「compact stdout は strict JSON serializable」としていますが、
compact_review_result.pyの stdout は JSON ではなくSTATUS: ...の line protocol です。一方、full artifact はjson.dumps(..., allow_nan=False)を使っていません。同様に
reviewer_claim_replay.pyも compact JSON をjson.dumps(..., ensure_ascii=False)で出しており、allow_nan=Falseがありません。build_refinement_phase_state.pyも同様です。Python の
json.dumpsは既定でNaN/Infinity/-Infinityを出力し得ます。厳密 JSON にするにはallow_nan=Falseが必要で、読み込み側もparse_constantでNaN等を reject できます。([Python documentation]3)AC7 はこう書き換えるべきです。
Major: #1086 は PR #1058 の失敗パターンを再発し得る
PR #1058 は
findings[]を追加したと主張しましたが、レビューでは「checker producer にフィールドを足しただけで、consumer と agent 配布面が閉じていない」と指摘されています。#1086 も同じ危険があります。
compact_review_result.pyの artifact 保持、reviewer_claim_replay.pyの fallback/arbitration、review_issue_result_v1.jsonの schema、issue-reviewer.md/.codexsurface の説明を同時に揃えないと、また「producer は出しているが consumer が意味を誤読する」状態になります。issue-reviewer.mdは full artifact にfindings[] / checker_evidence[] / body_sha256 / producer schema versionを lossless に保持すると明記しています。.codex/agents/issue-reviewer.tomlも同じ surface を要求しています。修正版 AC 案
#1086 は以下のように AC を差し替えるのが安全です。
Verification Commands 修正案
現行 #1086 の VC には AC 番号コメントがないため、C5 alignment 系の checker でまた事故る余地があります。こうしてください。
配布物・証跡の扱い
この Issue は runtime UI や Pages preview ではなく、workflow artifact / schema / arbitration の問題です。証跡は Preview URL ではなく、対象 pytest、
pnpm typecheck/lint/test/build、再現 fixture、compact artifact JSON の before/after で十分です。GitHub の artifact attestations は、利用者が検証する release binaries/packages/manifests には有効ですが、頻繁な automated testing build や個別 source/doc/image file には推奨されていません。([GitHub Docs]4)GitHub に貼るコメント案
結論として、#1086 は着手価値があります。ただし、まず Issue 本文を上記の形に補強してから実装させるべきです。今のままだと「checker_gap を blocking にする」という短絡修正で、#1042 の fail-closed safety net を逆に壊します。
squne121 commentedon Jun 21, 2026
Refinement Loop: Human Escalation Required
The loop has terminated and requires human review. Cause: human judgment required
human_escalationhuman_judgment_requiredBlockers
squne121 commentedon Jun 21, 2026
Contract Review Result
squne121 commentedon Jun 21, 2026
implement-issue: 実装完了 (2026-06-21T09:05:33Z)
.claude/worktrees/issue-1086-review-checker-compact-artifact-blockingworktree-issue-1086-review-checker-compact-artifact-blocking4b632af9uv run pytest .claude/skills/review-issue/tests -qPASSuv run pytest .claude/skills/issue-refinement-loop/tests/test_compact_review_result.py .claude/skills/issue-refinement-loop/tests/test_reviewer_claim_replay.py tests/test_issue_refinement_ops_review.py -qPASSuv run pytest .claude/skills/issue-refinement-loop/tests -k "nan or infinity or strict_json" -qPASSpnpm typecheckPASSpnpm lintPASSpnpm testPASSpnpm buildPASSsqune121 commentedon Jun 21, 2026
Contract Review Result
fix: restore C5 reviewer replay routing (#1086)
fix: tighten review artifact consumers (#1086)
fix: preserve deterministic review blockers (#1086) (#1101)