Skip to content

実装: test-runner が CI 実行中の mergeStateStatus: BLOCKED を理由に Verification Commands を 1 件も実行せず FAIL を返す欠陥を是正する #2905

Open

Description

@squne121

Machine-Readable Contract

contract_schema_version: v1
issue_kind: implementation
parent_issue: "none"
goal_ref: "test-runner が CI 実行中の mergeStateStatus: BLOCKED / UNSTABLE を理由に Verification Commands を実行せず FAIL を返す欠陥を、実際の git conflict のみ FAIL 化する契約へ是正する"
change_kind: workflow

Parent Issue

none

Parent Goal Ref

  • Goal: test-runner の mergeable 判定を、現行 impl-review-loop の mergeability 契約(git conflict のみ hard stop)と整合させる。
  • Desired Destination: .claude/agents/test-runner.md の「Mergeable 状態の検知」節が、BLOCKED / UNSTABLE を記録のみとし DIRTY / CONFLICTING だけを FAIL 化する状態。

Current Validated Scope

fresh 確認済みの事実:

  1. .claude/agents/test-runner.md の「Mergeable 状態の検知」節は mergeable: CONFLICTING または mergeStateStatus: DIRTY|BLOCKED を TEST_VERDICT: FAIL とし、BEHIND のみ FAIL 化の対象外としている。
  2. 現行 impl-review-loop(.claude/skills/impl-review-loop/steps/step-5-mergeability-handling.md と route_loop_verdict_v2.py)は BLOCKED / UNSTABLE を、required checks 未充足など current-head の CI / branch-protection evaluator に委ねるものとして扱い、git conflict(CONFLICTING / DIRTY)だけを conflict hard stop とする。両者が矛盾している。
  3. 実害: Issue 実装: Claude-GPT Auto に canonical workflow delegation context を投影し External System Writes false-deny を減らす #2843 / PR fix: Claude-GPT canonical workflow canary の測定契約を是正する (#2843) #2888 の独立検証で、新 head の push 直後(必須 CI が実行中で mergeStateStatus: BLOCKED、mergeable: MERGEABLE)に test-runner(task verification_i6)が Verification Commands を 1 件も実行せず TEST_VERDICT: FAIL(runtime_ac_results: [])を返した。root が「mergeStateStatus は記録のみ、BLOCKED では止まらない」と委譲文に明記して再起動するまで検証が進まなかった。CI 実行中は head 更新のたびに BLOCKED になりうるため再発しやすい。
  4. 重複確認: test-runner BLOCKED / mergeStateStatus test-runner / test-runner.md の検索で同一 root cause の OPEN Issue は未検出。実装: test-runner.md の TEST_VERDICT_MACHINE/v2 報告契約を step-2 の委譲契約と consumer 要件に整合させる #2892 は同じ .claude/agents/test-runner.md を扱うが TEST_VERDICT_MACHINE/v2 の報告契約(generated_at 等)が対象で、Outcome が異なる。

Remaining Parent Gaps

なし(単独改善 Issue)。

Outcome

.claude/agents/test-runner.md の「Mergeable 状態の検知」節を更新し、mergeStateStatus: BLOCKED / UNSTABLE は値を report に記録するだけで Verification Commands の実行を止めず、TEST_VERDICT: FAIL 化は実際の git conflict(mergeable: CONFLICTING または mergeStateStatus: DIRTY)に限定する。完了条件は、この契約を検証する新規 offline pytest(tests/agent_ops/test_test_runner_mergeability_contract.py)が baseline で fail し、実装後に PASS することである。

Runtime Verification Applicability

In Scope

  • .claude/agents/test-runner.md の「Mergeable 状態の検知」節の BLOCKED / UNSTABLE の扱いを変更し、DIRTY / CONFLICTING のみ FAIL 化と明記する。merge_state_status は実測値をそのまま report に記録する旨を維持・明記する。
  • tests/agent_ops/test_test_runner_mergeability_contract.py(新規)で上記記述を決定論的に検証する(live Claude / ネットワーク不使用)。

Out of Scope

Acceptance Criteria

  • AC1: .claude/agents/test-runner.md が、mergeStateStatus: BLOCKED / UNSTABLE では Verification Commands を止めず値を記録するだけである旨を明記している。
  • AC2: .claude/agents/test-runner.md が、TEST_VERDICT: FAIL 化の対象を mergeable: CONFLICTING または mergeStateStatus: DIRTY のみと記述し、DIRTY|BLOCKED の旧記述が残っていない。
  • AC3: 既存の BEHIND の扱い(FAIL 化しない)と merge_state_status / branch_behind_main の report 記録フォーマットが維持されている。
  • AC4: 新規 offline pytest tests/agent_ops/test_test_runner_mergeability_contract.py が AC1〜AC3 の記述を検証し、全件 PASS する(AC1 / AC2 の対応テストは変更前の test-runner.md では fail する)。

Verification Commands

# AC1
# baseline-expect: fail
$ uv run --locked pytest tests/agent_ops/test_test_runner_mergeability_contract.py -q -k blocked_unstable_not_stop

# AC2
# baseline-expect: fail
$ uv run --locked pytest tests/agent_ops/test_test_runner_mergeability_contract.py -q -k only_conflict_or_dirty_fails

# AC3
$ uv run --locked pytest tests/agent_ops/test_test_runner_mergeability_contract.py -q -k behind_and_record_format_preserved

# AC4
$ uv run --locked pytest tests/agent_ops/test_test_runner_mergeability_contract.py -q

Allowed Paths

  • .claude/agents/test-runner.md
  • tests/agent_ops/test_test_runner_mergeability_contract.py

Stop Conditions

  • Allowed Paths 外の変更が必要と判明した場合
  • In Scope の固定契約(キー集合・スキーマ・型定義)の変更が必要になった場合
  • 新規 Issue の起票が必要と判断した場合(スコープ分割が発生する場合)
  • 後続 Phase / 別スコープへの波及が判明した場合
  • nested SubAgent delegation が必要になった場合
  • 外部サービス利用・権限昇格・既存テスト大規模改変が必要になった場合

Required Skills

なし

Required Design References

  • docs/dev/agent-skill-boundaries.md

Scope Delta(任意)

N/A

Delivery Rule

Activity

  1. added
    phase/implementation
    agent/implementer
    enhancement
    on Oct 4, 2026
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