Skip to content

実装: compact_review_result.py の REVIEWER_BLOCKER_CLAIM が structured_blockers ではなく blocking_issues の prose から code を構築している問題を修正する #1554

Closed

Description

@squne121

Machine-Readable Contract

contract_schema_version: v1
issue_kind: implementation
parent_issue: "none"
goal_ref: "compact_review_result.py の REVIEWER_BLOCKER_CLAIM 生成を structured_blockers[].code から構築するよう修正し、Step 2a の parent-local replay が checker-backed blocker を正しく裏付けられるようにする"
change_kind: code

Parent Issue

none(単独改善)

依存関係

Parent Goal Ref

Current Validated Scope

Remaining Parent Gaps

Outcome

compact_review_result() が needs-fix 判定時に生成する REVIEWER_BLOCKER_CLAIM_V1.blockers[].reviewer_blocker_code を、raw_result["structured_blockers"][].code(決定論的 checker が付与する正式な code)から損失なく転記し、structured_blockers が空配列の場合のみ blocking_issues(人間可読な prose)へフォールバックするように修正し、対応するテストが全 AC PASS している状態。producer 自身が生成直後に strict validation を行い、schema 上は valid だが consumer 側で拒否される入力(空白のみの code・過長 code・型不正な line フィールド等)を黙って skip・変換せず producer failure として扱うことも保証する。

この修正が保証するのは、child claim(REVIEWER_BLOCKER_CLAIM_V1)に正式な checker code が structured_blockers 優先で残ることと、parent-local replay(Step 2a、parent_replay_binding.py)がその code を taxonomy 経由で parent-owned evidence(readiness / VC preflight / VC syntax の再取得結果)と照合できることのみである。deterministic_fail_confirmed は、登録済み taxonomy と一致する parent-owned evidence が別途存在する場合にのみ成立する。child の structured_blockers[].checker_evidence それ自体が parent replay の backing evidence として直接使用されることはない(PR #1535 で確立された trust boundary を維持する)。

In Scope

  • .claude/skills/issue-refinement-loop/scripts/compact_review_result.py の compact_review_result() 内、REVIEWER_BLOCKER_CLAIM_V1 構築ロジックを次のように変更する

    • raw_result["structured_blockers"](各要素は schema 上 code / message / checker_evidence を必須で持つ structured_blocker)が非空の場合、その code フィールドから claim_blockers[].reviewer_blocker_code を構築する(message は structured_blockers[].message を使う)。複数要素がある場合は structured_blockers の配列順序をそのまま保持し、並べ替え・重複排除を行わない
    • structured_blockers が空配列の場合のみ、既存の blocking_issues(prose)フォールバックを維持する(structured_blockers を必須 property として持つが空配列になり得る現行 schema との整合。schema 自体が structured_blockers を required としているため、property 欠落形式への互換性は主張しない — current-schema の degraded fallback として扱う)
    • structured_blockers と blocking_issues の両方が非空の場合は structured_blockers を優先する(決定論的 checker code を正本として扱う)
    • claim の blockers[].line_start / line_end は、structured_blockers の各要素が top-level に line_start / line_end を持つ場合のみ転記し、持たない場合は null とする(checker_evidence 内の複数 entry から自動選択するロジックは実装しない)
  • producer 側 strict validation(PR fix: compact_review_result の REVIEWER_BLOCKER_CLAIM を structured_blockers 優先で構築する #1581 OWNER レビュー Blocker 2 対応): compact_review_result() は structured_blockers から claim を構築した直後、stdout へ出力する前に、consumer(parent_replay_binding.py)と同一の strict validation(code は strip 後も非空かつ最大200文字、message は最大2000文字、line_start/line_end は int または null、blocker item は所定4キーのみ、blockers 配列は最大100件)を実行する。実装は既存の parent_replay_binding.py が持つ validate_reviewer_blocker_claim()(または同等の検証ロジック)を import して再利用し、parent_replay_binding.py 自体のロジックは変更しない(import のみ、Out of Scope は維持)。妥当性検証に失敗した場合は該当 claim を黙って skip・型変換せず、producer failure として扱い、成功 envelope を一切出力しない

    • code フィールドは str(...).strip() 等での暗黙変換を行わない(元の文字列をそのまま検証に通す)。strip 後空文字列になる、または200文字を超える code は producer failure とする
    • top-level line_start / line_end が int でも null でもない場合(文字列等)は producer failure とする
  • 上記変更を検証する新規テストケースを新規ファイル .claude/skills/issue-refinement-loop/tests/test_compact_review_result_reviewer_blocker_claim.py に追加する。fixture は PR fix: C9 blocker を structured_blockers に deterministic evidence 付きで出力する #1319 が固定した実 producer shape(finding_kind == deterministic_domain_blocker / deterministic_domain_key / blocking == true / 完全な checker_evidence を持つ code: "C9" の structured blocker)を基礎とし、競合する blocking_issues 側は object ではなく "C9: Runtime Verification Applicability セクションがない..." のような 人間向け prose string で固定する(実装: reviewer checker taxonomy の最小 SSOT foundation と既存ファイル未登録node-id resolver #1549 で実際に発生した障害形状に合わせる)

  • production chain 統合テスト(PR fix: compact_review_result の REVIEWER_BLOCKER_CLAIM を structured_blockers 優先で構築する #1581 OWNER レビュー Blocker 1 対応): 少なくとも1件、現行 SSOT(PR 実装: issue-reviewer envelope 生成を決定論的スクリプトに統合する #1557、2026-07-18 04:17 UTC マージ)が規定する production command chain を real CLI subprocess 実行で通す統合テストを追加する。手動の startswith() / json.loads() によるフィールド抽出、および PARENT_REPLAY_* の手動 f-string assembly は禁止する(production 経路から既に廃止済み)。少なくとも次の経路を通すこと:

    1. schema-valid な producer result(blocking_issues に prose string、structured_blockers に完全な evidence shape を持つ要素)を compact_review_result.py の実 CLI に渡す
    2. その stdout を emit_parent_review_envelope_v2.py --validate-intermediate(review_compact.validate_intermediate_v1 相当)の実 CLI に渡し、strict validation 済みの canonical_reviewer_blocker_claim を得る(手動抽出禁止)
    3. canonical_reviewer_blocker_claim のみをファイル化し、parent_replay_binding.py の実 CLI に一致する parent-owned evidence とともに渡し、binding artifact を得る
    4. binding artifact と claim envelope を emit_parent_review_envelope_v2.py の実 CLI に渡し、ISSUE_REVIEW_RESULT_COMPACT_V2 envelope を生成する(PARENT_REPLAY_* の手動組み立て禁止)
    5. 生成された envelope を validate_review_compact_output.py --v2 の実 CLI に渡し、validation_status == valid を確認する
    6. 可能であれば reviewer_claim_replay_state_store.py --write-v2 まで通し、既存の production command-chain テストと同じ境界を検証する

    実装は新規ファイル .claude/skills/issue-refinement-loop/tests/test_compact_review_result_reviewer_blocker_claim.py 内で既存 production CLI を subprocess 実行する形で行う。各 CLI の正確な引数・出力契約は該当スクリプト自身(--help や既存テスト test_emit_parent_review_envelope_v2.py / test_production_v2_command_chain.py 等)を参照して実装すること

  • 同一 structured code の checker evidence が child 側にあっても、parent-owned evidence が存在しない場合は deterministic_fail_confirmed にならないことを確認するセキュリティ回帰テストを新規ファイルに追加する(trust boundary が本修正によって逆流していないことの証明)

  • 既存の structured_blockers 空配列ケース(blocking_issues フォールバック)を検証する既存テスト(.claude/skills/issue-refinement-loop/tests/test_compact_review_result.py)との互換性を確認し、必要なら期待値を明示的に更新する

  • 複数 blocker(structured_blockers に2件以上、順序・重複・異なる message/line を含む)を入力した場合に、claim の blockers 配列が入力順序を保持し、blocking_issues 側の順序や prose が混入しないことを固定するテストを新規ファイルに追加する

  • producer strict validation の negative regression テスト(AC9): structured_blockers に以下のいずれかを含む入力を渡した場合、claim 生成が producer failure となり、黙った skip や型変換をせず、成功 envelope を一切出力しないことを固定するテストを新規ファイルに追加する: (a) code が空白のみの文字列、(b) code が201文字以上、(c) top-level line_start が文字列型、(d) top-level line_end が文字列型、(e) structured_blockers に valid な要素と上記 invalid な要素が混在する複数件

Out of Scope

  • .claude/skills/issue-refinement-loop/scripts/reviewer_claim_replay.py の REVIEWER_CHECKER_TAXONOMY_V1 へのエントリ追加・normalize ロジック変更(taxonomy 拡張は別 Issue のスコープ)
  • review-issue SubAgent が structured_blockers[].code に実際にどの checker code を書き込むかの決定ロジック変更
  • parent_replay_binding.py / validate_review_compact_output.py / emit_parent_review_envelope_v2.py 自体のロジック変更(本 Issue はこれらを import・subprocess 呼び出しするのみで、実装変更はしない)
  • REVIEWER_BLOCKER_CLAIM_V1 以外の compact output フィールド(SUMMARY / BLOCKERS)の値計算ロジック変更。ただし SUMMARY / BLOCKERS は引き続き blocking_issues(人間向け全 blocker)から計算され、claim の blockers(deterministic subset)とは件数が一致しない場合があることを Notes for Reviewer および PR 本文の Notes に明記する(一対一対応の producer invariant は導入しない)
  • structured_blockers の schema(review_issue_result_v1.json)自体の変更
  • .claude/agents/issue-reviewer.md のうち REVIEWER_BLOCKER_CLAIM 説明箇所以外の記述変更

Acceptance Criteria

  • AC1: compact_review_result() に structured_blockers(code: "C9" を含む、PR fix: C9 blocker を structured_blockers に deterministic evidence 付きで出力する #1319 準拠の完全な checker_evidence 付き 1 要素)と、異なる prose の blocking_issues("C9: Runtime Verification Applicability セクションがない..." 形式の string)を同時に渡した場合、REVIEWER_BLOCKER_CLAIM の blockers[0].reviewer_blocker_code == "C9" になり、blocking_issues の prose 値は使われない
  • AC2: structured_blockers が空配列で blocking_issues のみが非空の場合、既存互換の fallback として blocking_issues から reviewer_blocker_code が構築される(後方互換の回帰なし)
  • AC3: REVIEWER_BLOCKER_CLAIM_V1 の schema 形状(schema / body_sha256 / blockers[].reviewer_blocker_code / blockers[].message / blockers[].line_start / blockers[].line_end)が変更前後で同一であることを、生成 claim を実際に parent_replay_binding.validate_reviewer_blocker_claim() へ通して確認する(余分なキー・欠落キー・空 code・型違反がないことを含む)
  • AC4: 複数 blocker(順序 B, A, B の3件、duplicate 含む、異なる message/line)を入力した場合、claim の blockers が入力順序をそのまま保持し、blocking_issues 側の順序や prose が混入しないことを確認する
  • AC5: 同じ structured code と一致する parent-owned evidence がある場合、compact_review_result.py → parent_replay_binding.py の実 CLI chain を通して PARENT_REPLAY_VERDICT == deterministic_fail_confirmed になることを確認する
  • AC6: child の structured_blockers[].checker_evidence が存在していても、parent-owned evidence が存在しない場合は PARENT_REPLAY_VERDICT != deterministic_fail_confirmed になることを確認する(trust boundary の逆流がないことの回帰テスト)
  • AC7: compact_review_result.py の実 CLI → emit_parent_review_envelope_v2.py --validate-intermediate の実 CLI(canonical claim 抽出、手動 startswith()/json.loads() 禁止)→ parent_replay_binding.py の実 CLI → emit_parent_review_envelope_v2.py の実 CLI(V2 envelope 生成、PARENT_REPLAY_* 手動 f-string assembly 禁止)→ validate_review_compact_output.py --v2 の実 CLI を、すべて subprocess で連結し、validation_status == valid になることを確認する(現行 production command-chain 全体の統合テスト)
  • AC8: .claude/skills/issue-refinement-loop/tests/test_compact_review_result.py の既存テストが全件 PASS する(回帰なし)
  • AC9: structured_blockers に (a) 空白のみの code、(b) 201文字以上の code、(c) 文字列型の top-level line_start、(d) 文字列型の top-level line_end、(e) valid/invalid 混在の複数 blocker、のいずれかを含む入力を渡した場合、claim 生成が producer failure となり黙った skip・型変換をせず、成功 envelope を一切出力しないことを確認する
  • AC10: .claude/agents/issue-reviewer.md の REVIEWER_BLOCKER_CLAIM は raw_result.blocking_issues から機械的に構成される、という stale な記述が、structured_blockers が非空の場合は structured_blockers の code/message を優先し、空配列の場合のみ blocking_issues へフォールバックする、という現行実装と一致する記述に更新されている

Verification Commands

# AC1
$ uv run --locked pytest .claude/skills/issue-refinement-loop/tests/test_compact_review_result_reviewer_blocker_claim.py::test_reviewer_blocker_claim_prefers_structured_blockers_code -q
# AC2
$ uv run --locked pytest .claude/skills/issue-refinement-loop/tests/test_compact_review_result_reviewer_blocker_claim.py::test_reviewer_blocker_claim_falls_back_to_blocking_issues_when_structured_blockers_empty -q
# AC3
$ uv run --locked pytest .claude/skills/issue-refinement-loop/tests/test_compact_review_result_reviewer_blocker_claim.py::test_reviewer_blocker_claim_schema_shape_unchanged -q
# AC4
$ uv run --locked pytest .claude/skills/issue-refinement-loop/tests/test_compact_review_result_reviewer_blocker_claim.py::test_reviewer_blocker_claim_preserves_multi_blocker_order -q
# AC5
$ uv run --locked pytest .claude/skills/issue-refinement-loop/tests/test_compact_review_result_reviewer_blocker_claim.py::test_parent_replay_confirms_deterministic_fail_with_matching_parent_owned_evidence -q
# AC6
$ uv run --locked pytest .claude/skills/issue-refinement-loop/tests/test_compact_review_result_reviewer_blocker_claim.py::test_parent_replay_does_not_confirm_without_parent_owned_evidence -q
# AC7
$ uv run --locked pytest .claude/skills/issue-refinement-loop/tests/test_compact_review_result_reviewer_blocker_claim.py::test_production_chain_compact_to_parent_replay_to_v2_validation -q
# AC8
$ uv run --locked pytest .claude/skills/issue-refinement-loop/tests/test_compact_review_result.py -q
# AC9
$ uv run --locked pytest .claude/skills/issue-refinement-loop/tests/test_compact_review_result_reviewer_blocker_claim.py::test_producer_rejects_invalid_structured_blocker_fields -q
# AC10
$ rg -n "非空の場合は structured_blockers の code" .claude/agents/issue-reviewer.md

Allowed Paths

  • .claude/skills/issue-refinement-loop/scripts/compact_review_result.py
  • .claude/skills/issue-refinement-loop/tests/test_compact_review_result.py
  • .claude/skills/issue-refinement-loop/tests/test_compact_review_result_reviewer_blocker_claim.py
  • .claude/agents/issue-reviewer.md

Stop Conditions

  • Allowed Paths 外の変更が必要と判明した場合
  • In Scope の固定契約(キー集合・スキーマ・型定義)の変更が必要になった場合
  • 新規 Issue の起票が必要と判断した場合(スコープ分割が発生する場合)
  • 後続 Phase / 別スコープへの波及が判明した場合
  • nested SubAgent delegation が必要になった場合
  • 外部サービス利用・権限昇格・既存テスト大規模改変が必要になった場合
  • 既存テストの期待値変更が AC2 の後方互換要件と矛盾する場合: 変更せず Issue comment で報告し、人間の判断を待つ
  • structured_blockers の schema(review_issue_result_v1.json)自体の変更が必要に見える場合: 本 Issue のスコープ外のため変更せず、別 Issue 化を提案して停止する
  • AC5-AC7 の統合テストが parent_replay_binding.py / validate_review_compact_output.py / emit_parent_review_envelope_v2.py 自体のバグを露呈し、それらの実装変更なしには通せないと判明した場合: 変更せず Issue comment で報告し、別 Issue 化を提案して停止する(本 Issue はそれらのロジック変更を Out of Scope とする)
  • parent_replay_binding.py の validate_reviewer_blocker_claim()(または同等の検証関数)を compact_review_result.py から import できない構造上の制約が判明した場合: 独自にロジックを複製せず、Issue コメントで報告し人間の判断を待つ

Required Skills

  • Python(jsonschema validation / dict 処理 / subprocess 統合テスト)

Required Design References

  • .claude/skills/issue-refinement-loop/SKILL.md
  • .claude/skills/review-issue/SKILL.md
  • .claude/skills/issue-refinement-loop/scripts/emit_parent_review_envelope_v2.py(AC7 production chain の正確な CLI 契約)
  • .claude/skills/issue-refinement-loop/tests/test_emit_parent_review_envelope_v2.py / test_production_v2_command_chain.py(既存 production command-chain テストの参考実装)

Scope Delta(任意)

Notes for Reviewer

Runtime Verification Applicability

本 Issue の変更対象はワークフロー文書・スクリプトのみです。ゲームの実行時動作には影響しません。

decision: not_applicable
reason: "Workflow documentation and script changes only. No runtime game behavior changed."

Activity

  1. added
    phase/implementation
    agent/implementer
    enhancement
    on Jul 17, 2026
  2. squne121 commented on Jul 18, 2026

    @squne121
    OwnerAuthor

    判定

    REQUEST_CHANGES — 修正方向は正しいものの、現行の Issue 契約のままでは実装着手不可です。

    根本原因は実在します。現行 compact_review_result.py は blocking_issues だけを走査し、要素が文字列なら prose 全体を reviewer_blocker_code に格納します。一方、replay 側は小文字化・trim・空白圧縮後の taxonomy 完全一致しか行わないため、"C9: Runtime Verification..." から C9 は抽出されません。

    この障害は #1549 で実際に unknown_blocker_type → reviewer_claim_unbacked_by_deterministic_checker → reviewer_false_positive_suspected → human_escalation として再現されています。#1555 のレビューでも producer 境界での structured code 消失が最上流原因として特定されています。

    ただし、Issue #1554 本体には現時点でコメントがなく、以下の契約矛盾が未解決です。


    P0-1 — Issue 自身の Verification Commands が command_not_allowed になる

    Issue #1554 の AC1–AC4 はすべて次の形式です。

    uv run --locked python3 -m pytest ...

    しかし現行の baseline VC policy は、uv run の argv に --locked が含まれ、unwrap 後が python3 -m ... である場合、それを runtime-smoke option の不正利用として先に command_not_allowed に分類します。後段には python3 -m pytest の許可分岐がありますが、そこへ到達しません。

    同じ policy は、unwrap 後の先頭が直接 pytest なら許可します。

    これは理論上の懸念ではなく、#1549 で同じ uv run --locked python3 -m pytest 形が VCP_COMMAND_NOT_ALLOWED と判定されています。

    --locked 自体は uv の正規オプションであり、lockfile が古い場合に更新せずエラーにするためのものです。問題は uv ではなく、このリポジトリ固有の VC allowlist です。([Astral Docs]1)

    必須修正: すべて次の形へ変更してください。

    # AC1
    $ uv run --locked pytest .claude/skills/issue-refinement-loop/tests/test_compact_review_result.py \
        -k test_reviewer_blocker_claim_prefers_structured_blockers_code -q
    
    # AC2
    $ uv run --locked pytest .claude/skills/issue-refinement-loop/tests/test_compact_review_result.py \
        -k test_reviewer_blocker_claim_falls_back_to_blocking_issues_when_structured_blockers_empty -q
    
    # AC3
    $ uv run --locked pytest .claude/skills/issue-refinement-loop/tests/test_compact_review_result.py \
        -k test_reviewer_blocker_claim_schema_shape_unchanged -q
    
    # AC4
    $ uv run --locked pytest .claude/skills/issue-refinement-loop/tests/test_compact_review_result.py -q

    この修正がない限り、#1554 は自身の preflight で再び blocker を生成し、修正対象と同じ replay failure chain を踏み得ます。


    P0-2 — Outcome が parent-local trust boundary を誤って説明している

    Issue の Outcome は、structured_blockers[].checker_evidence に裏付けられた blocker が deterministic_fail_confirmed と認識される、と説明しています。

    しかし PR #1535 後の trust boundary は、その動作を明示的に禁止しています。

    REVIEWER_BLOCKER_CLAIM_V1 が child から運べるのは、次の4項目だけです。

    • reviewer_blocker_code
    • message
    • line_start
    • line_end

    findings、checker_evidence、deterministic_checks は claim に含められず、parent はそれらを空にした review_result を自分で構築します。deterministic_backed は、parent が独自に取得した readiness/VC preflight/VC syntax evidence からしか成立しません。

    したがって、#1554 の変更が保証するのは次だけです。

    child claim に短い正式 code が残り、parent がその code を taxonomy に照合できる。

    次は保証しません。

    child 側の structured_blockers[].checker_evidence が parent replay の backing evidence として使用される。

    必須修正: Outcome を次の意味に狭めてください。

    structured_blockers[].code を bounded claim に損失なく転記し、parent-local replay がその code を parent-owned readiness/VC evidence と照合可能にする。deterministic_fail_confirmed は、登録済み taxonomy と一致する parent-owned evidence が存在する場合に限る。

    また、AC には正負の両方が必要です。

    1. 同じ structured code と一致する parent-owned evidence がある
      → deterministic_fail_confirmed
    2. child の structured blocker に checker evidence があっても、parent-owned evidence がない
      → deterministic_fail_confirmed にならない

    後者は、今回の修正が trust boundary を逆流させていないことを証明するセキュリティ回帰テストです。


    P0-3 — 現行 AC は実際の producer chain を証明しない

    既存の test_compact_review_result_preserves_structured_blockers_for_replay は、full artifact を書き出した後、その full artifact を直接 reviewer_claim_replay.analyze() に渡しています。

    さらに、

    • blocking_issues[].code == "C4"
    • structured_blockers[].code == "C4"

    で一致しているため、code source の競合自体がありません。REVIEWER_BLOCKER_CLAIM 行も検証していません。

    これは次の経路を迂回しています。

    raw REVIEW_ISSUE_RESULT_V1
      → compact_review_result.py
      → bounded REVIEWER_BLOCKER_CLAIM_V1
      → parent_replay_binding.py
      → parent-owned evidence replay
      → V2 validation
    

    既存の isolation runtime E2E も、fixture の structured_blockers が空配列で、helper が blocking_issues だけを上書きしています。したがって fallback path しか通らず、structured-preferred regression は検出できません。

    必須修正: 少なくとも1件、次の実経路テストが必要です。

    schema-valid producer result
      blocking_issues = ["C9: 長い人間向け prose ..."]
      structured_blockers = [{code: "C9", ...完全な evidence shape...}]
    
    → real compact_review_result.py CLI
    → emitted claim code == "C9"
    → real parent_replay_binding.py with matching parent-owned evidence
    → PARENT_REPLAY_VERDICT == deterministic_fail_confirmed
    → real validate_review_compact_output.py --v2
    → validation_status == valid
    

    実装場所は次のいずれかです。

    • test_parent_replay_isolation_runtime.py を Allowed Paths に追加する
    • 既存 Allowed Paths を維持するなら、test_compact_review_result.py 内で既存 production CLI を subprocess 実行する

    単に compact_review_result() の戻り値を inspect するだけでは、Issue が掲げる Step 2a 修復は証明できません。


    P1-1 — 「過去形式への後方互換」という説明が現行 schema と矛盾する

    現行 REVIEW_ISSUE_RESULT_V1 schema は structured_blockers を required property としています。

    さらに compact_review_result() は source 選択より前に schema validation を実行します。

    したがって、Issue に書かれている次の説明は成立しません。

    structured_blockers を持たない過去形式を read-back するための fallback

    property が欠落した input は fallback 分岐へ到達する前に validation error になります。

    JSON Schema 2020-12 の required は property の存在を要求します。一方、minItems を省略した array は空配列を許容します。つまり現行契約で到達可能なのは「property 欠落」ではなく「required property は存在するが空配列」というケースです。(JSON Schema)

    しかも #1555 のレビューでは、

    structured_blockers が存在しない場合のみ fallback

    と要求されている一方、#1554 は、

    空配列の場合に fallback

    としています。両者は同じ契約ではありません。

    必須修正: 次のどちらかを明示的に選択してください。

    選択肢A — 現行 schema の empty-array fallback

    • structured_blockers: [] の場合は blocking_issues を使用する
    • これは「旧 schema 互換」ではなく「current-schema degraded fallback」と記述する
    • prose string が taxonomy code ではないため、fallback path は引き続き checker-gap になり得ることを明記する

    選択肢B — 本当に property 欠落形式を受け入れる

    • schema validation 前の version-aware migration が必要
    • 受理可能 input contract の変更として schema governance と consumer inventory が必要
    • 現行の Out of Scope/Stop Conditions/Allowed Paths では扱えない

    現状では選択肢Aが narrow fix と整合します。


    P1-2 — テスト fixture が実 producer shape に固定されていない

    AC1 は「code: "C9" を持つ1要素」としか要求していません。しかし schema-valid な structured_blocker には次がすべて必要です。

    • code
    • message
    • finding_kind == deterministic_domain_blocker
    • deterministic_domain_key
    • blocking == true
    • 1件以上の完全な checker_evidence

    最小の {"code": "C9", "message": "..."} fixture は claim logic に到達する前に schema validation で失敗します。

    また、実障害は blocking_issues が object だったケースではなく、人間向け prose の string だったケースです。#1549 の再現内容に合わせ、競合側は次のような string に固定すべきです。

    "blocking_issues": [
        "C9: Runtime Verification Applicability セクションがない..."
    ]

    PR #1319 は C9 の実 producer shape として、deterministic finding、domain key、self-checker evidence、code: "C9" を既に固定しています。この fixture を基礎にすべきです。

    AC3 も単なる key-set assertion ではなく、生成 claim を実際に次へ通すべきです。

    parent_replay_binding.validate_reviewer_blocker_claim(claim)

    この validator は top-level/blocker item の余分なキー、欠落キー、空 code、型違反を fail-closed で検査します。


    P1-3 — 複数 blocker の順序・重複・message・位置情報が未定義

    Issue の AC は1 blocker だけです。しかし replay は先頭 blocker を primary とし、同一 lane 判定と連続 unbacked state の基準に使用します。したがって array order は routing state の意味を持ちます。

    また現行 schema には uniqueItems: true がありません。JSON Schema では uniqueItems 省略時は重複を許容します。(JSON Schema)

    RFC 8785 の JSON canonicalization でも、object property はソートしても array element order は変更してはならないと規定されています。claim/binding digest を安定させるなら、structured source の順序保存は明示的な契約です。([RFCエディタ]4)

    #1555 の先行レビューも、重複、順序、message 対応をテストで固定するよう要求しています。

    追加すべきケース:

    structured_blockers:
      1. code=B, message=b1, line=20
      2. code=A, message=a1, line=10
      3. code=B, message=b2, line=30
    
    blocking_issues:
      A, B の異なる順序と異なる prose
    

    期待値は最低でも次です。

    • claim は B, A, B の順序を保持
    • duplicate を勝手に除去しない
    • 各 code と message/line の対応を壊さない
    • blocking_issues の順序や prose は混入しない
    • 同じ input から同じ canonical claim bytes/binding digest が生成される

    なお structured_blocker schema は top-level の line_start/line_end を必須化しておらず、行番号は checker evidence 内にあります。

    そのため Issue は、claim の位置情報を次のどちらにするか固定する必要があります。

    • top-level line がある場合だけ転記し、それ以外は null
    • checker evidence のどの entry から採用するかを決定論的に定義する

    無指定のまま「位置情報も維持する」とすると、複数 evidence 時に実装差が出ます。narrow fix なら前者が安全です。


    P1-4 — BLOCKERS/SUMMARY と claim の整合性が未解決

    変更後は次のようになります。

    • BLOCKERS、SUMMARY、first=
      → blocking_issues 由来
    • REVIEWER_BLOCKER_CLAIM.blockers
      → structured_blockers 由来

    現行コードは blocker count と first summary を blocking_issues から計算しています。

    compact output の BLOCKERS も同じ値です。

    一方、V2 validator は BLOCKERS が非ゼロかだけを検査し、claim の blocker 数との一致を検査しません。claim 側も最低限「blockers が list であること」までで、BLOCKERS field との count consistency はありません。

    そのため例えば、

    blocking_issues:      3件
    structured_blockers:  1件
    

    なら、validator が受理する envelope が、

    SUMMARY: 3 blocker(s); first=<prose側の先頭>
    BLOCKERS: 3
    REVIEWER_BLOCKER_CLAIM: blockersは1件
    

    となり得ます。

    Issue は SUMMARY/BLOCKERS を Out of Scope としていますが、少なくとも次のどちらかを契約として明記する必要があります。

    1. blocking_issues は人間向け全 blocker、claim は deterministic subset であり、件数不一致は意図した仕様
    2. 2配列は一対一対応する producer invariant があり、件数・順序・message 対応をテストする

    現行 schema は一対一対応を保証していません。明文化なしでは、内部矛盾した compact envelope を正常系として固定することになります。


    推奨する修正版 Acceptance Criteria

    以下まで修正すれば、narrow implementation Issue として実装可能です。

    AC1 — producer-derived precedence

    schema-valid な C9 structured blocker と、異なる prose string の blocking_issues を同時に入力し、claim code/message が structured 側から生成される。

    AC2 — claim trust-boundary shape

    生成 claim が validate_reviewer_blocker_claim() を通過し、checker_evidence/findings/deterministic_checks を含まない。

    AC3 — fallback semantics

    structured_blockers: [] の current-schema input に対する fallback のみを検証する。property 欠落形式への互換性は主張しない。

    AC4 — sequence fidelity

    複数 blocker、duplicate、異なる順序、message、line/null の対応を byte-for-byte 固定する。

    AC5 — parent-owned positive replay

    real compact claim と一致する parent-owned evidence を parent binding に渡し、deterministic_fail_confirmed を確認する。

    AC6 — trust-boundary negative replay

    child structured evidence が存在しても、parent-owned evidence がなければ deterministic_fail_confirmed にならないことを確認する。

    AC7 — envelope consistency

    BLOCKERS/SUMMARY と claim blocker list の関係を仕様化し、その選択をテストする。

    AC8 — production chain

    少なくとも次を real CLI で通す。

    compact_review_result
    → parent_replay_binding
    → validate_review_compact_output --v2
    

    AC9 — regression suite

    $ uv run --locked pytest \
        .claude/skills/issue-refinement-loop/tests/test_compact_review_result.py \
        .claude/skills/issue-refinement-loop/tests/test_parent_replay_isolation_runtime.py \
        -q

    E2E test を追加する場合は、Allowed Paths に次を加える必要があります。

    .claude/skills/issue-refinement-loop/tests/test_parent_replay_isolation_runtime.py
    

    総括

    #1554 の中心的なコード変更は小さく、structured_blockers 優先という方向も正しいです。しかし、現行 Issue は次の3点で実装完了を誤認する危険があります。

    1. 記載 VC がリポジトリ policy 上実行不能
    2. child checker evidence が parent replay に使われるという誤った trust model
    3. bounded claim と実 parent replay を通さない unit test だけで Step 2a 修復を宣言している

    まず P0 の3件を Issue 本文に反映し、その後に P1 の fallback、順序、fixture、cross-field invariant を固定すべきです。現状の AC1–AC4だけを通した実装は、局所的な claim 値は直しても、運用経路の修復と fail-closed 境界の維持を証明しません。

    本判定は、2026年7月18日時点の main、Issue/PR/コメント履歴、および公開一次仕様を用いた静的・契約レビューです。リポジトリのテストコマンド自体は実行していません。

  3. squne121 commented on Jul 18, 2026

    @squne121
    OwnerAuthor

    Refinement Loop: Approved

    The issue has been approved and is ready for implementation.

  4. squne121 commented on Jul 18, 2026

    @squne121
    OwnerAuthor

    Contract Review Result

    CONTRACT_REVIEW_RESULT_V1:
      status: go
      generated_at: "2026-07-18T05:05:01Z"
      generated_by: issue-contract-review
      issue_url: https://github.com/squne121/loop-protocol/issues/1554
      body_sha256: "sha256:292b65fdc93d003bd0e68d1dd2300cab69d9e50057154495a9340e0cfa1cc071"
      checks:
        readiness: go
        blockers: pass
        product_spec: pass
        product_spec_check: {"schema":"product_spec_check/v1","applicability":"applicable","decision":"pass","triggers":{"docs_product_allowed_paths":false,"tasks_md_mentioned":false,"specify_artifact_mentioned":false,"generated_task_mentioned":false,"product_spec_context_present":false,"machine_readable_contract_present":true},"conditions":{"docs_product_requires_spec_evidence":{"status":"pass","evidence":[]},"tasks_md_not_direct_source":{"status":"pass","evidence":[]},"specify_not_canonical":{"status":"pass","evidence":[]},"diff_first_rationale_present":{"status":"pass","evidence":[]},"generated_task_trace_present":{"status":"pass","evidence":[]},"task_dependencies_materialized":{"status":"pass","evidence":[]}},"blocked_reasons":[],"body_sha256":"sha256:292b65fdc93d003bd0e68d1dd2300cab69d9e50057154495a9340e0cfa1cc071","source_provenance":{"source_type":"github_api","body_file":null}}
        vc_preflight:
          decision: pass
          classifications: [{"ac":"AC1","line":2,"raw_command":"uv run --locked pytest .claude/skills/issue-refinement-loop/tests/test_compact_review_result_reviewer_blocker_claim.py::test_reviewer_blocker_claim_prefers_structured_blockers_code -q","command_hash":"sha256:2cb0445cd38dca258123d0ee487f6b964b48912d9da45eb68a6d3382c894ba44","execution_key_hash":"sha256:8de98eb170059edcab9da6c20455f20790de7eede1767b4c564625894a134a86","runner":"exec","exit_code":4,"classification":"expected_fail","category":"expected_baseline_fail","decision":"go","scope_class":"baseline_fail_expected","confidence":"high","stdout_head":["no tests ran in 0.01s"],"stdout_truncated":false,"stdout_original_line_count":3,"stderr_head":["ERROR: file or directory not found: .claude/skills/issue-refinement-loop/tests/test_compact_review_result_reviewer_blocker_claim.py::test_reviewer_blocker_claim_prefers_structured_blockers_code"],"stderr_truncated":false,"stderr_original_line_count":3,"runner_env_delta":{},"duration_ms":156,"fix_hint":null,"certified_target_paths":null,"annotations":{"baseline_expect":null,"vc_role":null,"missing_baseline_expect":false},"annotation_source":{"line":null,"raw":null},"strict":null,"repair":null},{"ac":"AC2","line":4,"raw_command":"uv run --locked pytest .claude/skills/issue-refinement-loop/tests/test_compact_review_result_reviewer_blocker_claim.py::test_reviewer_blocker_claim_falls_back_to_blocking_issues_when_structured_blockers_empty -q","command_hash":"sha256:ca292cfd040e901414f2413e04dd56279a2e8576a0c7ab671755c04e91604b27","execution_key_hash":"sha256:487277dcdfd9ce351ab25e0900be74f1eab0c7d03782d51c959297d2494d408e","runner":"exec","exit_code":4,"classification":"expected_fail","category":"expected_baseline_fail","decision":"go","scope_class":"baseline_fail_expected","confidence":"high","stdout_head":["no tests ran in 0.01s"],"stdout_truncated":false,"stdout_original_line_count":3,"stderr_head":["ERROR: file or directory not found: .claude/skills/issue-refinement-loop/tests/test_compact_review_result_reviewer_blocker_claim.py::test_reviewer_blocker_claim_falls_back_to_blocking_issues_when_structured_blockers_empty"],"stderr_truncated":false,"stderr_original_line_count":3,"runner_env_delta":{},"duration_ms":170,"fix_hint":null,"certified_target_paths":null,"annotations":{"baseline_expect":null,"vc_role":null,"missing_baseline_expect":false},"annotation_source":{"line":null,"raw":null},"strict":null,"repair":null},{"ac":"AC3","line":6,"raw_command":"uv run --locked pytest .claude/skills/issue-refinement-loop/tests/test_compact_review_result_reviewer_blocker_claim.py::test_reviewer_blocker_claim_schema_shape_unchanged -q","command_hash":"sha256:7f22f0870c2abdd1b543604541a3cc8157d9107fa00c6a66c3b0a946598e7201","execution_key_hash":"sha256:c9fce029b8cacd308c267303fb32e65da5eb5b2ebd2667c11e51ee80bd14663a","runner":"exec","exit_code":4,"classification":"expected_fail","category":"expected_baseline_fail","decision":"go","scope_class":"baseline_fail_expected","confidence":"high","stdout_head":["no tests ran in 0.01s"],"stdout_truncated":false,"stdout_original_line_count":3,"stderr_head":["ERROR: file or directory not found: .claude/skills/issue-refinement-loop/tests/test_compact_review_result_reviewer_blocker_claim.py::test_reviewer_blocker_claim_schema_shape_unchanged"],"stderr_truncated":false,"stderr_original_line_count":3,"runner_env_delta":{},"duration_ms":165,"fix_hint":null,"certified_target_paths":null,"annotations":{"baseline_expect":null,"vc_role":null,"missing_baseline_expect":false},"annotation_source":{"line":null,"raw":null},"strict":null,"repair":null},{"ac":"AC4","line":8,"raw_command":"uv run --locked pytest .claude/skills/issue-refinement-loop/tests/test_compact_review_result_reviewer_blocker_claim.py::test_reviewer_blocker_claim_preserves_multi_blocker_order -q","command_hash":"sha256:31d0449718e9cf398a78d2bc50144de087c519e11f4022122ae5cc09e0e773ca","execution_key_hash":"sha256:725c85fbda7d4e6c48ed0759e10464cf8658bdf69e73e757ce81b1333a00b7dc","runner":"exec","exit_code":4,"classification":"expected_fail","category":"expected_baseline_fail","decision":"go","scope_class":"baseline_fail_expected","confidence":"high","stdout_head":["no tests ran in 0.01s"],"stdout_truncated":false,"stdout_original_line_count":3,"stderr_head":["ERROR: file or directory not found: .claude/skills/issue-refinement-loop/tests/test_compact_review_result_reviewer_blocker_claim.py::test_reviewer_blocker_claim_preserves_multi_blocker_order"],"stderr_truncated":false,"stderr_original_line_count":3,"runner_env_delta":{},"duration_ms":173,"fix_hint":null,"certified_target_paths":null,"annotations":{"baseline_expect":null,"vc_role":null,"missing_baseline_expect":false},"annotation_source":{"line":null,"raw":null},"strict":null,"repair":null},{"ac":"AC5","line":10,"raw_command":"uv run --locked pytest .claude/skills/issue-refinement-loop/tests/test_compact_review_result_reviewer_blocker_claim.py::test_parent_replay_confirms_deterministic_fail_with_matching_parent_owned_evidence -q","command_hash":"sha256:9ae7cbd98ef560399f1b17294421671ee1264ab0daae9dc3057fadde42b5e523","execution_key_hash":"sha256:38b38063655a0e1b37e7f2f7d170446781daa6d72480ab639b9db5e404f6985f","runner":"exec","exit_code":4,"classification":"expected_fail","category":"expected_baseline_fail","decision":"go","scope_class":"baseline_fail_expected","confidence":"high","stdout_head":["no tests ran in 0.01s"],"stdout_truncated":false,"stdout_original_line_count":3,"stderr_head":["ERROR: file or directory not found: .claude/skills/issue-refinement-loop/tests/test_compact_review_result_reviewer_blocker_claim.py::test_parent_replay_confirms_deterministic_fail_with_matching_parent_owned_evidence"],"stderr_truncated":false,"stderr_original_line_count":3,"runner_env_delta":{},"duration_ms":159,"fix_hint":null,"certified_target_paths":null,"annotations":{"baseline_expect":null,"vc_role":null,"missing_baseline_expect":false},"annotation_source":{"line":null,"raw":null},"strict":null,"repair":null},{"ac":"AC6","line":12,"raw_command":"uv run --locked pytest .claude/skills/issue-refinement-loop/tests/test_compact_review_result_reviewer_blocker_claim.py::test_parent_replay_does_not_confirm_without_parent_owned_evidence -q","command_hash":"sha256:746485e92e8124662ced739d843cbc2bbac2bb17d63cdfdc2aafb112845bd19a","execution_key_hash":"sha256:76020cc98ae4edad5a63e857d91b9166cc002beb94135c26847274dfa5ba788d","runner":"exec","exit_code":4,"classification":"expected_fail","category":"expected_baseline_fail","decision":"go","scope_class":"baseline_fail_expected","confidence":"high","stdout_head":["no tests ran in 0.01s"],"stdout_truncated":false,"stdout_original_line_count":3,"stderr_head":["ERROR: file or directory not found: .claude/skills/issue-refinement-loop/tests/test_compact_review_result_reviewer_blocker_claim.py::test_parent_replay_does_not_confirm_without_parent_owned_evidence"],"stderr_truncated":false,"stderr_original_line_count":3,"runner_env_delta":{},"duration_ms":173,"fix_hint":null,"certified_target_paths":null,"annotations":{"baseline_expect":null,"vc_role":null,"missing_baseline_expect":false},"annotation_source":{"line":null,"raw":null},"strict":null,"repair":null},{"ac":"AC7","line":14,"raw_command":"uv run --locked pytest .claude/skills/issue-refinement-loop/tests/test_compact_review_result_reviewer_blocker_claim.py::test_production_chain_compact_to_parent_replay_to_v2_validation -q","command_hash":"sha256:b2a0659148626f9424ef87e5f7a7f31c14bb7f40772ff9be41677ab714bd2821","execution_key_hash":"sha256:b033ddf5a9f4c8526f59aa62ce01a5a842b6d870190de6810a0885f8a8959f29","runner":"exec","exit_code":4,"classification":"expected_fail","category":"expected_baseline_fail","decision":"go","scope_class":"baseline_fail_expected","confidence":"high","stdout_head":["no tests ran in 0.01s"],"stdout_truncated":false,"stdout_original_line_count":3,"stderr_head":["ERROR: file or directory not found: .claude/skills/issue-refinement-loop/tests/test_compact_review_result_reviewer_blocker_claim.py::test_production_chain_compact_to_parent_replay_to_v2_validation"],"stderr_truncated":false,"stderr_original_line_count":3,"runner_env_delta":{},"duration_ms":157,"fix_hint":null,"certified_target_paths":null,"annotations":{"baseline_expect":null,"vc_role":null,"missing_baseline_expect":false},"annotation_source":{"line":null,"raw":null},"strict":null,"repair":null},{"ac":"AC8","line":16,"raw_command":"uv run --locked pytest .claude/skills/issue-refinement-loop/tests/test_compact_review_result.py -q","command_hash":"sha256:adbee703579128a562c24187a5e8994c9c5e9cb5d1c4b44bb11fde9739d610df","execution_key_hash":"sha256:81bc7e4f7472a1186f1d5032556e7a0c80e9f3f61023cdb02c5c59cebf3b8e15","runner":"exec","exit_code":0,"classification":"expected_pass","category":"regression_gate","decision":"go","scope_class":"regression_gate","confidence":"low","stdout_head":["........................                                                 [100%]","24 passed in 0.44s"],"stdout_truncated":false,"stdout_original_line_count":3,"stderr_head":[],"stderr_truncated":false,"stderr_original_line_count":1,"runner_env_delta":{},"duration_ms":645,"fix_hint":null,"certified_target_paths":null,"annotations":{"baseline_expect":null,"vc_role":null,"missing_baseline_expect":false},"annotation_source":{"line":null,"raw":null},"strict":null,"repair":null}]
      source: ensure_contract_snapshot_auto
      expected_contract_fingerprint: {"issue_number":1554,"contract_source_kind":"issue_comment","contract_source_id":"5010002161","contract_body_sha256":"sha256:292b65fdc93d003bd0e68d1dd2300cab69d9e50057154495a9340e0cfa1cc071","allowed_paths_normalized_sha256":"f39a8ad543a4fdd948681c52fd14059acc3b67a88b52a1e961697fe00126f5a3","base_ref":"main","base_sha_at_snapshot":"6cc00c58fa9c2690ac88f80012b74c0d33e62d30"}
  5. squne121 commented on Jul 18, 2026

    @squne121
    OwnerAuthor

    implement-issue: 実装完了・overlap preflight で human_review_required(人間判断待ち)

    実装状況

    .claude/skills/issue-refinement-loop/scripts/compact_review_result.py の REVIEWER_BLOCKER_CLAIM_V1 構築ロジックを、structured_blockers[].code を優先し structured_blockers が空配列の場合のみ blocking_issues(prose)へフォールバックするよう修正した。新規テストファイル .claude/skills/issue-refinement-loop/tests/test_compact_review_result_reviewer_blocker_claim.py を追加し、AC1〜AC7 に対応するテストケース(AC5〜AC7 は compact_review_result.py / parent_replay_binding.py / validate_review_compact_output.py --v2 の実 CLI を subprocess 連結する統合テスト)を実装した。

    検証結果(Issue 本文の Verification Commands を個別実行、すべて PASS):

    • AC1: test_reviewer_blocker_claim_prefers_structured_blockers_code — PASS
    • AC2: test_reviewer_blocker_claim_falls_back_to_blocking_issues_when_structured_blockers_empty — PASS
    • AC3: test_reviewer_blocker_claim_schema_shape_unchanged — PASS
    • AC4: test_reviewer_blocker_claim_preserves_multi_blocker_order — PASS
    • AC5: test_parent_replay_confirms_deterministic_fail_with_matching_parent_owned_evidence — PASS
    • AC6: test_parent_replay_does_not_confirm_without_parent_owned_evidence — PASS
    • AC7: test_production_chain_compact_to_parent_replay_to_v2_validation — PASS
    • AC8: 既存 test_compact_review_result.py(24 テスト)— 全件 PASS(回帰なし)
    • ruff check — 変更ファイル 2 件とも violation 0

    変更は Allowed Paths の 3 ファイルのみ(compact_review_result.py 差分 + 新規テストファイル)。

    ブロッカー: Step 2 overlap preflight が human_review_required を返した

    check_implementation_overlap.py --issue-number 1554 --repo squne121/loop-protocol --limit 300(--limit はデフォルト 100 では OPEN phase/implementation Issue が 165 件あり saturated になったため引き上げ、source.complete: true を確認済み)を実行した結果、route: human_review_required となった。

    原因は OPEN Issue #1028(実装: agent-ops: contract_readiness execute-mode human_judgment を環境 triage に正規化する)との構造的衝突検出:

    issue_number: 1028
    policy_class: C1
    reasons: [structural_or_textual_collision_detected, independent_strong_signal_detected]
    shared_specific_edit_targets: [.claude/skills/issue-refinement-loop/scripts/compact_review_result.py]
    non_conflict_reason: null
    readback_complete: true
    

    evidence_sha256: sha256:e2a977aa405985df67de4b76543ac3175cc1780af825af0670d2c2b8a710ce75
    decision_inputs_sha256: sha256:b2c8b5879649fa1293c5c8906b0f391a7782bfe50d9b1cdb99641055d17b8333

    同一ファイル(compact_review_result.py)を編集対象とすることによる shared_specific_edit_target の構造的シグナルのみで collision 判定されており、non_conflict_reason が classifier 側で自動記録されなかったため proceed_with_collision_evidence には昇格せず fail-closed で human_review_required になっている。

    手動 readback による意味的評価(人間判断の参考情報、canonical ではない)

    #1028 の Outcome / In Scope を読むと、対象は contract_readiness_check.py execute-mode の human_judgment を contract_readiness_environment_triage として扱う 新規の compact 分岐追加であり、本 Issue(#1554)が変更した verdict == "needs-fix" 時の REVIEWER_BLOCKER_CLAIM_V1 構築ロジックとはコード上の分岐・目的ともに別物に見える(#1028 は OPEN・未実装のため現状ファイルには triage 分岐は存在しない)。ただし本 SubAgent の役割上この評価を最終判断として proceed_with_collision_evidence へ自動昇格させることはせず、implement-issue SKILL.md Step 2 の fail-closed ルール(human_review_required は実装開始前に人間判断へ停止)に従い、ここで停止する。

    お願い

    • 実装: agent-ops: contract_readiness execute-mode human_judgment を環境 triage に正規化する #1028 との実際の意味的重複有無をご確認いただき、
      • 重複なしと判断される場合は proceed_with_collision_evidence として本 Issue の実装(ローカル worktree で完了済み・未 push)を push / Draft PR 起票まで進めてよいか指示をお願いします。
      • 重複ありと判断される場合は、どちらの Issue を先行させるか(または統合するか)の指示をお願いします。

    実装済みの差分・新規テストは worktree 内にコミット前の状態で保持しています。

  6. squne121 commented on Jul 18, 2026

    @squne121
    OwnerAuthor

    implement-issue: 実装完了・PR 作成は open_pr.py の deterministic hard gate(E_OVERLAP_PREFLIGHT_UNSAFE_ROUTE)でブロック中

    人間判断(proceed_with_collision_evidence で進行、#1028 は disjoint)を受け、branch を push し open_pr.py 経由での Draft PR 作成を試みましたが、open_pr.py 自身の Overlap Preflight Hard Gate(Issue #1458 / #1470、gh pr create 直前にオンラインで check_implementation_overlap.py を再実行し route を再検証する TOCTOU 対策)で E_OVERLAP_PREFLIGHT_UNSAFE_ROUTE により停止しました。

    実施内容

    • branch worktree-agent-a0cf02d3ca62b5fcd(commit 47077ebc)を push 済み: https://github.com/squne121/loop-protocol/tree/worktree-agent-a0cf02d3ca62b5fcd
    • PR body(Summary / Checks / Schema Change Applicability / Schema Consumer Inventory / Safety Claim Matrix / Overlap Preflight Evidence / Notes を含む)を作成し、validate_pr_body.py(LP050-LP058)と PR Body Japanese Check の両方を PASS させた(dry-run で確認済み)
    • open_pr.py --overlap-preflight-required --overlap-preflight-evidence-file ... --overlap-preflight-expected-evidence-sha256 ... --overlap-preflight-expected-decision-inputs-sha256 ... で本番実行したところ、以下で停止:
    OVERLAP_PREFLIGHT_FORCED_BY_LABEL=true
    ERROR=E_OVERLAP_PREFLIGHT_UNSAFE_ROUTE
    ERROR_DETAIL=unsafe_route:'human_review_required'
    

    原因(open-pr SKILL.md 4.5 節 Overlap Preflight Hard Gate の仕様)

    open_pr.py は gh pr create 呼び出し直前に check_implementation_overlap.py を オンラインで再実行し、fresh route が proceed / proceed_with_collision_evidence のいずれかであることを必須とする(安全性 predicate、docs: TOCTOU 対策の bounded freshness gate)。linked issue #1554 は phase/implementation ラベルを持つため OVERLAP_PREFLIGHT_FORCED_BY_LABEL=true となり、--overlap-preflight-required の指定有無に関わらずこの gate は強制される。

    再実行時の route は --limit 300(source complete 確認済み)でも依然 human_review_required(#1028 との shared_specific_edit_target 構造衝突)のままであり、これは classifier(check_implementation_overlap.py)の設計上、explicit_supersession(supersedes:/superseded-by: の Machine-Readable Contract 明記)以外に人間判断だけで proceed_with_collision_evidence へ昇格させる経路を持たない(Blocker 1: 自然言語類似度・人間の意味的disjoint判断を唯一の根拠にしない設計)。open-pr 側の overlap_readback_waiver 例外機構も #519/#520/#1429 に固定 binding された過去 Issue 専用のものであり、本ケース(#1554/#1028)には適用できない。

    つまり「Step 2 の overlap preflight で human_review_required が出た場合に人間が disjoint と判断して進行してよい」という手順上の判断は成立しますが、その判断を open_pr.py の gh pr create 直前 hard gate へ機械的に反映する正規の入力経路が現状存在しません。gh pr create を open_pr.py を経由せず直接呼び出すことは open-pr / implement-issue 両 SKILL.md が明示的に禁止しており、この hard gate は意図的な fail-closed security control(TOCTOU 対策)であるため、本 SubAgent の判断で bypass しませんでした。

    実装自体は完了・検証済み(変更なし)

    • .claude/skills/issue-refinement-loop/scripts/compact_review_result.py / 新規 .claude/skills/issue-refinement-loop/tests/test_compact_review_result_reviewer_blocker_claim.py
    • AC1〜AC8 個別実行ですべて PASS、ruff check violation 0、Allowed Paths 外の変更なし(前回コメント参照)
    • push 済み branch: worktree-agent-a0cf02d3ca62b5fcd(commit 47077ebc)
    • PR body 草稿(Japanese Check / LP050-058 PASS 済み)は用意済みだが gh pr create 未実行

    お願い(いずれかのご指示をお願いします)

    1. 人間が GitHub UI / gh pr create を直接実行して Draft PR を作成する(本 SubAgent は open_pr.py を bypass しないため、この hard gate を機械的に満たす正規の入力が現状ない以上、最も早い解決策です)。用意済みの PR body 草稿はこのコメントに続けて提示可能です。
    2. check_implementation_overlap.py / open_pr.py に、人間確認済み disjoint 判断を安全に反映できる waiver 機構(現状の overlap_readback_waiver は readback_incomplete 専用・実装: LP050 拡張 — PR body Schema Consumer Inventory vs catalog 照合(#131 FU-3) #519/実装: catalog consumer contract tests — positive/negative fixture と pytest(#131 FU-4) #520/実装: update_branch.py を canonical branch-update executor に統一し、入力・race・postcondition を自己検証する #1429 固定)を一般化する follow-up Issue を起票する。
    3. 実装: agent-ops: contract_readiness execute-mode human_judgment を環境 triage に正規化する #1028 の解消(実装完了 or close)を待ってから再実行する。

    いずれの場合も、push 済みの branch とコミット内容はそのまま利用可能です。

  7. squne121 commented on Jul 18, 2026

    @squne121
    OwnerAuthor

    implement-issue: 実装完了・Draft PR 作成完了

    Issue #1028 が人間の指示で stale として CLOSE されたことを受け、overlap preflight(check_implementation_overlap.py --limit 300)を再実行したところ route: proceed_with_collision_evidence になったことを確認しました(残る candidate は #944 / #1006 / #1007 のみ、いずれも readback 済み disjoint C1)。

  8. squne121 commented on Jul 18, 2026

    @squne121
    OwnerAuthor

    Contract Review Result

    CONTRACT_REVIEW_RESULT_V1:
      status: go
      generated_at: "2026-07-18T06:22:18Z"
      generated_by: issue-contract-review
      issue_url: https://github.com/squne121/loop-protocol/issues/1554
      body_sha256: "sha256:8abe9dafe33d4ed6c4cbe4b0f962de666bdf74e299364a2095dc4e68bcfe2a49"
      checks:
        readiness: go
        blockers: pass
        product_spec: pass
        product_spec_check: {"schema":"product_spec_check/v1","applicability":"applicable","decision":"pass","triggers":{"docs_product_allowed_paths":false,"tasks_md_mentioned":false,"specify_artifact_mentioned":false,"generated_task_mentioned":false,"product_spec_context_present":false,"machine_readable_contract_present":true},"conditions":{"docs_product_requires_spec_evidence":{"status":"pass","evidence":[]},"tasks_md_not_direct_source":{"status":"pass","evidence":[]},"specify_not_canonical":{"status":"pass","evidence":[]},"diff_first_rationale_present":{"status":"pass","evidence":[]},"generated_task_trace_present":{"status":"pass","evidence":[]},"task_dependencies_materialized":{"status":"pass","evidence":[]}},"blocked_reasons":[],"body_sha256":"sha256:8abe9dafe33d4ed6c4cbe4b0f962de666bdf74e299364a2095dc4e68bcfe2a49","source_provenance":{"source_type":"github_api","body_file":null}}
        vc_preflight:
          decision: pass
          classifications: [{"ac":"AC1","line":2,"raw_command":"uv run --locked pytest .claude/skills/issue-refinement-loop/tests/test_compact_review_result_reviewer_blocker_claim.py::test_reviewer_blocker_claim_prefers_structured_blockers_code -q","command_hash":"sha256:2cb0445cd38dca258123d0ee487f6b964b48912d9da45eb68a6d3382c894ba44","execution_key_hash":"sha256:8de98eb170059edcab9da6c20455f20790de7eede1767b4c564625894a134a86","runner":"exec","exit_code":4,"classification":"expected_fail","category":"expected_baseline_fail","decision":"go","scope_class":"baseline_fail_expected","confidence":"high","stdout_head":["no tests ran in 0.01s"],"stdout_truncated":false,"stdout_original_line_count":3,"stderr_head":["ERROR: file or directory not found: .claude/skills/issue-refinement-loop/tests/test_compact_review_result_reviewer_blocker_claim.py::test_reviewer_blocker_claim_prefers_structured_blockers_code"],"stderr_truncated":false,"stderr_original_line_count":3,"runner_env_delta":{},"duration_ms":188,"fix_hint":null,"certified_target_paths":null,"annotations":{"baseline_expect":null,"vc_role":null,"missing_baseline_expect":false},"annotation_source":{"line":null,"raw":null},"strict":null,"repair":null},{"ac":"AC2","line":4,"raw_command":"uv run --locked pytest .claude/skills/issue-refinement-loop/tests/test_compact_review_result_reviewer_blocker_claim.py::test_reviewer_blocker_claim_falls_back_to_blocking_issues_when_structured_blockers_empty -q","command_hash":"sha256:ca292cfd040e901414f2413e04dd56279a2e8576a0c7ab671755c04e91604b27","execution_key_hash":"sha256:487277dcdfd9ce351ab25e0900be74f1eab0c7d03782d51c959297d2494d408e","runner":"exec","exit_code":4,"classification":"expected_fail","category":"expected_baseline_fail","decision":"go","scope_class":"baseline_fail_expected","confidence":"high","stdout_head":["no tests ran in 0.01s"],"stdout_truncated":false,"stdout_original_line_count":3,"stderr_head":["ERROR: file or directory not found: .claude/skills/issue-refinement-loop/tests/test_compact_review_result_reviewer_blocker_claim.py::test_reviewer_blocker_claim_falls_back_to_blocking_issues_when_structured_blockers_empty"],"stderr_truncated":false,"stderr_original_line_count":3,"runner_env_delta":{},"duration_ms":196,"fix_hint":null,"certified_target_paths":null,"annotations":{"baseline_expect":null,"vc_role":null,"missing_baseline_expect":false},"annotation_source":{"line":null,"raw":null},"strict":null,"repair":null},{"ac":"AC3","line":6,"raw_command":"uv run --locked pytest .claude/skills/issue-refinement-loop/tests/test_compact_review_result_reviewer_blocker_claim.py::test_reviewer_blocker_claim_schema_shape_unchanged -q","command_hash":"sha256:7f22f0870c2abdd1b543604541a3cc8157d9107fa00c6a66c3b0a946598e7201","execution_key_hash":"sha256:c9fce029b8cacd308c267303fb32e65da5eb5b2ebd2667c11e51ee80bd14663a","runner":"exec","exit_code":4,"classification":"expected_fail","category":"expected_baseline_fail","decision":"go","scope_class":"baseline_fail_expected","confidence":"high","stdout_head":["no tests ran in 0.01s"],"stdout_truncated":false,"stdout_original_line_count":3,"stderr_head":["ERROR: file or directory not found: .claude/skills/issue-refinement-loop/tests/test_compact_review_result_reviewer_blocker_claim.py::test_reviewer_blocker_claim_schema_shape_unchanged"],"stderr_truncated":false,"stderr_original_line_count":3,"runner_env_delta":{},"duration_ms":165,"fix_hint":null,"certified_target_paths":null,"annotations":{"baseline_expect":null,"vc_role":null,"missing_baseline_expect":false},"annotation_source":{"line":null,"raw":null},"strict":null,"repair":null},{"ac":"AC4","line":8,"raw_command":"uv run --locked pytest .claude/skills/issue-refinement-loop/tests/test_compact_review_result_reviewer_blocker_claim.py::test_reviewer_blocker_claim_preserves_multi_blocker_order -q","command_hash":"sha256:31d0449718e9cf398a78d2bc50144de087c519e11f4022122ae5cc09e0e773ca","execution_key_hash":"sha256:725c85fbda7d4e6c48ed0759e10464cf8658bdf69e73e757ce81b1333a00b7dc","runner":"exec","exit_code":4,"classification":"expected_fail","category":"expected_baseline_fail","decision":"go","scope_class":"baseline_fail_expected","confidence":"high","stdout_head":["no tests ran in 0.01s"],"stdout_truncated":false,"stdout_original_line_count":3,"stderr_head":["ERROR: file or directory not found: .claude/skills/issue-refinement-loop/tests/test_compact_review_result_reviewer_blocker_claim.py::test_reviewer_blocker_claim_preserves_multi_blocker_order"],"stderr_truncated":false,"stderr_original_line_count":3,"runner_env_delta":{},"duration_ms":165,"fix_hint":null,"certified_target_paths":null,"annotations":{"baseline_expect":null,"vc_role":null,"missing_baseline_expect":false},"annotation_source":{"line":null,"raw":null},"strict":null,"repair":null},{"ac":"AC5","line":10,"raw_command":"uv run --locked pytest .claude/skills/issue-refinement-loop/tests/test_compact_review_result_reviewer_blocker_claim.py::test_parent_replay_confirms_deterministic_fail_with_matching_parent_owned_evidence -q","command_hash":"sha256:9ae7cbd98ef560399f1b17294421671ee1264ab0daae9dc3057fadde42b5e523","execution_key_hash":"sha256:38b38063655a0e1b37e7f2f7d170446781daa6d72480ab639b9db5e404f6985f","runner":"exec","exit_code":4,"classification":"expected_fail","category":"expected_baseline_fail","decision":"go","scope_class":"baseline_fail_expected","confidence":"high","stdout_head":["no tests ran in 0.01s"],"stdout_truncated":false,"stdout_original_line_count":3,"stderr_head":["ERROR: file or directory not found: .claude/skills/issue-refinement-loop/tests/test_compact_review_result_reviewer_blocker_claim.py::test_parent_replay_confirms_deterministic_fail_with_matching_parent_owned_evidence"],"stderr_truncated":false,"stderr_original_line_count":3,"runner_env_delta":{},"duration_ms":170,"fix_hint":null,"certified_target_paths":null,"annotations":{"baseline_expect":null,"vc_role":null,"missing_baseline_expect":false},"annotation_source":{"line":null,"raw":null},"strict":null,"repair":null},{"ac":"AC6","line":12,"raw_command":"uv run --locked pytest .claude/skills/issue-refinement-loop/tests/test_compact_review_result_reviewer_blocker_claim.py::test_parent_replay_does_not_confirm_without_parent_owned_evidence -q","command_hash":"sha256:746485e92e8124662ced739d843cbc2bbac2bb17d63cdfdc2aafb112845bd19a","execution_key_hash":"sha256:76020cc98ae4edad5a63e857d91b9166cc002beb94135c26847274dfa5ba788d","runner":"exec","exit_code":4,"classification":"expected_fail","category":"expected_baseline_fail","decision":"go","scope_class":"baseline_fail_expected","confidence":"high","stdout_head":["no tests ran in 0.01s"],"stdout_truncated":false,"stdout_original_line_count":3,"stderr_head":["ERROR: file or directory not found: .claude/skills/issue-refinement-loop/tests/test_compact_review_result_reviewer_blocker_claim.py::test_parent_replay_does_not_confirm_without_parent_owned_evidence"],"stderr_truncated":false,"stderr_original_line_count":3,"runner_env_delta":{},"duration_ms":221,"fix_hint":null,"certified_target_paths":null,"annotations":{"baseline_expect":null,"vc_role":null,"missing_baseline_expect":false},"annotation_source":{"line":null,"raw":null},"strict":null,"repair":null},{"ac":"AC7","line":14,"raw_command":"uv run --locked pytest .claude/skills/issue-refinement-loop/tests/test_compact_review_result_reviewer_blocker_claim.py::test_production_chain_compact_to_parent_replay_to_v2_validation -q","command_hash":"sha256:b2a0659148626f9424ef87e5f7a7f31c14bb7f40772ff9be41677ab714bd2821","execution_key_hash":"sha256:b033ddf5a9f4c8526f59aa62ce01a5a842b6d870190de6810a0885f8a8959f29","runner":"exec","exit_code":4,"classification":"expected_fail","category":"expected_baseline_fail","decision":"go","scope_class":"baseline_fail_expected","confidence":"high","stdout_head":["no tests ran in 0.01s"],"stdout_truncated":false,"stdout_original_line_count":3,"stderr_head":["ERROR: file or directory not found: .claude/skills/issue-refinement-loop/tests/test_compact_review_result_reviewer_blocker_claim.py::test_production_chain_compact_to_parent_replay_to_v2_validation"],"stderr_truncated":false,"stderr_original_line_count":3,"runner_env_delta":{},"duration_ms":190,"fix_hint":null,"certified_target_paths":null,"annotations":{"baseline_expect":null,"vc_role":null,"missing_baseline_expect":false},"annotation_source":{"line":null,"raw":null},"strict":null,"repair":null},{"ac":"AC8","line":16,"raw_command":"uv run --locked pytest .claude/skills/issue-refinement-loop/tests/test_compact_review_result.py -q","command_hash":"sha256:adbee703579128a562c24187a5e8994c9c5e9cb5d1c4b44bb11fde9739d610df","execution_key_hash":"sha256:81bc7e4f7472a1186f1d5032556e7a0c80e9f3f61023cdb02c5c59cebf3b8e15","runner":"exec","exit_code":0,"classification":"expected_pass","category":"regression_gate","decision":"go","scope_class":"regression_gate","confidence":"low","stdout_head":["........................                                                 [100%]","24 passed in 0.45s"],"stdout_truncated":false,"stdout_original_line_count":3,"stderr_head":[],"stderr_truncated":false,"stderr_original_line_count":1,"runner_env_delta":{},"duration_ms":644,"fix_hint":null,"certified_target_paths":null,"annotations":{"baseline_expect":null,"vc_role":null,"missing_baseline_expect":false},"annotation_source":{"line":null,"raw":null},"strict":null,"repair":null},{"ac":"AC9","line":18,"raw_command":"uv run --locked pytest .claude/skills/issue-refinement-loop/tests/test_compact_review_result_reviewer_blocker_claim.py::test_producer_rejects_invalid_structured_blocker_fields -q","command_hash":"sha256:ab823ddfc85cd8aa3fdb0bdb94cc62d1b0e89420f5beb1c1e02168ae39f6279d","execution_key_hash":"sha256:682b3bb4acc8ba92a9bae023f2ccd05b3226a8b3f5a34fedc81c0406e4f83ac7","runner":"exec","exit_code":4,"classification":"expected_fail","category":"expected_baseline_fail","decision":"go","scope_class":"baseline_fail_expected","confidence":"high","stdout_head":["no tests ran in 0.01s"],"stdout_truncated":false,"stdout_original_line_count":3,"stderr_head":["ERROR: file or directory not found: .claude/skills/issue-refinement-loop/tests/test_compact_review_result_reviewer_blocker_claim.py::test_producer_rejects_invalid_structured_blocker_fields"],"stderr_truncated":false,"stderr_original_line_count":3,"runner_env_delta":{},"duration_ms":174,"fix_hint":null,"certified_target_paths":null,"annotations":{"baseline_expect":null,"vc_role":null,"missing_baseline_expect":false},"annotation_source":{"line":null,"raw":null},"strict":null,"repair":null},{"ac":"AC10","line":20,"raw_command":"rg -n \"非空の場合は structured_blockers の code\" .claude/agents/issue-reviewer.md","command_hash":"sha256:6bdfc49454b4607d98faade9e067b5c882c2780994006743579967d440d7f002","execution_key_hash":"sha256:7f41f1d3530986f70e51e183d03fc2ab39d1c4f0280615f486aa0c7b735f755d","runner":"exec","exit_code":1,"classification":"expected_fail","category":"expected_baseline_fail","decision":"go","scope_class":"baseline_fail_expected","confidence":"high","stdout_head":[],"stdout_truncated":false,"stdout_original_line_count":1,"stderr_head":[],"stderr_truncated":false,"stderr_original_line_count":1,"runner_env_delta":{},"duration_ms":2,"fix_hint":null,"certified_target_paths":null,"annotations":{"baseline_expect":null,"vc_role":null,"missing_baseline_expect":false},"annotation_source":{"line":null,"raw":null},"strict":null,"repair":null}]
      source: ensure_contract_snapshot_auto
      expected_contract_fingerprint: {"issue_number":1554,"contract_source_kind":"issue_comment","contract_source_id":"5010221291","contract_body_sha256":"sha256:8abe9dafe33d4ed6c4cbe4b0f962de666bdf74e299364a2095dc4e68bcfe2a49","allowed_paths_normalized_sha256":"f18d9507b97083a55b93ba29b9bbe73ad0bc2cef528dbfdce393b6f315f660be","base_ref":"main","base_sha_at_snapshot":"6cc00c58fa9c2690ac88f80012b74c0d33e62d30"}
  9. added a commit that references this issue on Jul 18, 2026
  10. squne121 commented on Jul 18, 2026

    @squne121
    OwnerAuthor

    implement-issue: fix_delta 実装完了(PR #1581 OWNER REQUEST_CHANGES 対応)

    更新済み Issue contract(go: #1554 (comment) )に基づき、AC7(production chain SSOT更新)/ AC9(producer strict validation 負回帰)/ AC10(.claude/agents/issue-reviewer.md 同期)を実装した。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent/implementerenhancementphase/implementation

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions