Skip to content

実装: impl-review-loop production routerで mergeable と merge_state_status を分離し、conflict・unknown routingを正規化する #1853

Closed

Description

@squne121

Machine-Readable Contract

contract_schema_version: v1
issue_kind: implementation
parent_issue: "#1674"
relationship: part_of
goal_ref: "impl-review-loop production router が mergeable と merge_state_status を別フィールドとして扱い、GitHub の conflict・unknown・behind 状態を決定論的に routing する"
change_kind: code

Parent Issue

#1674

Parent Goal Ref

  • Goal: OPEN Issue の重複・依存順・実装優先順位判定を issue-refinement-loop に一元化する。
  • Desired Destination: impl-review-loop が semantic relation を再分類せず、live safety gate と target PR mergeability の production routing を維持する。

Current Validated Scope

  • .claude/skills/impl-review-loop/scripts/route_loop_verdict_v2.py の production mergeability consumer
  • 同 consumer の fixture-driven tests と、mergeability handling / conflicting PR escalation の設計記述

Remaining Parent Gaps

Outcome

route_loop_verdict_v2.py と fixture-driven truth table が mergeable と merge_state_status を分離し、conflict・unknown・behind の各状態を正規化して検証済みである状態。

In Scope

  • mergeability.mergeable と mergeability.merge_state_status を production router で別フィールドとして検証する
  • mergeable == CONFLICTING と merge_state_status == DIRTY を conflicting PR escalation へ route する
  • merge_state_status == CONFLICTING を schema invalid として fail-closed にする
  • mergeable == UNKNOWN、REST mergeable == null、merge_state_status == UNKNOWN を bounded retry 後の indeterminate または human escalation に route する
  • merge_state_status == BEHIND を既存 update-branch route に保つ
  • BLOCKED、DRAFT、HAS_HOOKS、UNSTABLE を Git conflict と誤認しない truth table と production behavior test を追加する

Out of Scope

Acceptance Criteria

  • AC1: production router は mergeable == CONFLICTING を conflicting PR escalation へ route する。
  • AC2: production router は merge_state_status == DIRTY を conflicting PR escalation へ route する。
  • AC3: merge_state_status == CONFLICTING は schema invalid として fail-closed になる。
  • AC4: mergeable == UNKNOWN、REST null 相当、または merge_state_status == UNKNOWN は bounded retry 後に indeterminate または human escalation へ route する。
  • AC5: merge_state_status == BEHIND は既存 update-branch route を維持する。
  • AC6: BLOCKED、DRAFT、HAS_HOOKS、UNSTABLE は Git conflict として escalation されない。
  • AC7: fixture-driven truth table が AC1〜AC6 の production consumer behavior を実行して検証する。

Verification Commands

# AC1
$ uv run --locked pytest .claude/skills/impl-review-loop/tests/fixtures/step5_routing_consumer/test_route_loop_verdict_v2.py -q
# AC2
$ uv run --locked pytest .claude/skills/impl-review-loop/tests/fixtures/step5_routing_consumer/test_route_loop_verdict_v2.py -q
# AC3
$ uv run --locked pytest .claude/skills/impl-review-loop/tests/fixtures/step5_routing_consumer/test_route_loop_verdict_v2.py -q
# AC4
$ uv run --locked pytest .claude/skills/impl-review-loop/tests/fixtures/step5_routing_consumer/test_route_loop_verdict_v2.py -q
# AC5
$ uv run --locked pytest .claude/skills/impl-review-loop/tests/test_termination_gate.py -q
# AC6
$ uv run --locked pytest .claude/skills/impl-review-loop/tests/test_termination_gate.py -q
# AC7
$ uv run --locked pytest .claude/skills/impl-review-loop/tests/test_v2_routing_boundary_regression.py -q
# preflight-scope: pr_review_only
$ uv run --locked ruff check .claude/skills/impl-review-loop/scripts/route_loop_verdict_v2.py .claude/skills/impl-review-loop/tests

Allowed Paths

  • .claude/skills/impl-review-loop/scripts/route_loop_verdict_v2.py
  • .claude/skills/impl-review-loop/tests/test_v2_routing_boundary_regression.py
  • .claude/skills/impl-review-loop/tests/test_handoff_pr_hygiene_regression.py
  • .claude/skills/impl-review-loop/tests/test_termination_gate.py
  • .claude/skills/impl-review-loop/tests/fixtures/step5_routing_consumer/
  • .claude/skills/impl-review-loop/steps/step-5-mergeability-handling.md
  • .claude/skills/impl-review-loop/steps/conflicting-pr-escalation-runbook.md

Stop Conditions

  • Allowed Paths 外の変更が必要と判明した場合
  • In Scope の固定契約(キー集合・スキーマ・型定義)の変更が必要になった場合
  • 新規 Issue の起票が必要と判断した場合(スコープ分割が発生する場合)
  • 後続 Phase / 別スコープへの波及が判明した場合
  • nested SubAgent delegation が必要になった場合
  • 外部サービス利用・権限昇格・既存テスト大規模改変が必要になった場合
  • 実装: ensure_contract_snapshot.py・open-pr・impl-review-loop に PAIRWISE_MERGE_OBSERVATION_V1 の再利用禁止 consumer 契約を配線する #1793 が未完了のまま pairwise merge observation を production-ready と仮定する必要が生じた場合
  • GitHub API enum の追加・変更により本 Issue の truth table を超える schema 変更が必要になった場合

Required Skills

なし

Required Design References

  • docs/dev/agent-skill-boundaries.md#impl-review-loop V2 routing boundary
  • docs/dev/workflows/impl-review-loop-design.md
  • .claude/skills/impl-review-loop/steps/step-5-mergeability-handling.md
  • .claude/skills/impl-review-loop/steps/conflicting-pr-escalation-runbook.md

Runtime Verification Applicability

  • decision: not_applicable
  • reason: pure-function production router と fixture-driven tests で検証するため

Scope Delta(任意)

N/A

Delivery Rule

1 Issue = 1 PR。#1793 完了後に専用 worktree で実装し、Draft PR を既定とする。

Notes for Reviewer

Activity

  1. added
    phase/implementation
    agent/implementer
    enhancement
    triage-required
    on Jul 29, 2026
  2. squne121 commented on Jul 30, 2026

    @squne121
    OwnerAuthor

    #1860 の owner decision(2026-07-30)に基づく実装child #1869(実装: semantic planning・overlap・contract artifactのblocking authorityを撤去する)に、本Issueのscope(impl-review-loop production routerでの mergeable/merge_state_status 分離、conflict/unknown routingの正規化)を統合します。#1869のPRがmergeされ、本Issueの残存差分がないことを確認できた時点でcloseします。

    Part of #1860 / absorbed by #1869

  3. squne121 commented on Jul 30, 2026

    @squne121
    OwnerAuthor

    実装child #1869 のPR #1871(Draft, head cc75632, CI全green, mergeable: MERGEABLE/CLEAN, 独立レビューAPPROVE)が merge-ready になりました。本Issueのscopeは #1871 に吸収されています。PR がマージされ、残存scopeがないことを確認できた時点でcloseします(現時点ではまだcloseしません)。

    Part of #1860 / absorbed by #1869 / see #1871

  4. squne121 commented on Jul 30, 2026

    @squne121
    OwnerAuthor

    実装child #1869 のPR #1871(Closes #1869)の状態を更新します。

    現状(2026-07-30 時点): head fa1fe901f405520c92331e2dce65b8b8624b7f7c、CI 16/16 pass、mergeable: MERGEABLE、mergeStateStatus: CLEAN、独立レビュー APPROVE・merge_ready: true(Draft のまま、人間マージ待ち)。

    過去のコメントで参照していた head cc756328 は初回実装時点のものです。その後、人間レビューで REQUEST_CHANGES(production router の mergeable/merge_state_status 分離不足等)を受けて fix_delta を適用し、途中で main 進行による実 Git conflict(route_loop_verdict_v2.py、Issue #1856 由来)を通常のマージで解消した上で、現在の head に至ります。

    本 Issue の scope 判定は PR #1871 の「Related / superseded Issues」節を正とします(詳細は #1871 参照)。PR merge 後、残存 scope の有無を再確認した上で close 可否を判断してください。

  5. squne121 commented on Jul 31, 2026

    @squne121
    OwnerAuthor

    実装child #1869(PR #1871, MERGED, merge commit c3cbc0dd, 2026-07-31T10:56:41Z)の「Related / superseded Issues」節で、route_loop_verdict_v2.py による mergeable/merge_state_status 分離のproduction実装により、本Issueの独立scopeが本PRに吸収されたことが明記されています。current mainで該当実装を確認済み。残存consumerなし。#1860 Closure Matrix参照。

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/implementationtriage-required

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions