Repository navigation
Open
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: "test-runner が CI 実行中の mergeStateStatus: BLOCKED / UNSTABLE を理由に Verification Commands を実行せず FAIL を返す欠陥を、実際の git conflict のみ FAIL 化する契約へ是正する"
change_kind: workflowParent 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 確認済みの事実:
.claude/agents/test-runner.mdの「Mergeable 状態の検知」節はmergeable: CONFLICTINGまたはmergeStateStatus: DIRTY|BLOCKEDをTEST_VERDICT: FAILとし、BEHINDのみ FAIL 化の対象外としている。- 現行 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 とする。両者が矛盾している。 - 実害: 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(taskverification_i6)が Verification Commands を 1 件も実行せずTEST_VERDICT: FAIL(runtime_ac_results: [])を返した。root が「mergeStateStatus は記録のみ、BLOCKED では止まらない」と委譲文に明記して再起動するまで検証が進まなかった。CI 実行中は head 更新のたびに BLOCKED になりうるため再発しやすい。 - 重複確認:
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
- decision: deferred
- reason: 本 Issue は agent 定義の記述契約を静的 offline テストで固定する。実 SubAgent での runtime smoke は live Claude を要するため本 Issue の VC に含めず、follow-up または 実装: test-runner.md の TEST_VERDICT_MACHINE/v2 報告契約を step-2 の委譲契約と consumer 要件に整合させる #2892 側の runtime smoke で扱う。
- deferred_destination: 実装: test-runner.md の TEST_VERDICT_MACHINE/v2 報告契約を step-2 の委譲契約と consumer 要件に整合させる #2892(test-runner.md の実 SubAgent runtime smoke を扱う follow-up 経路)
- deferred_verification_condition: test-runner.md の agent 定義変更が main に取り込まれた後、実 SubAgent runtime smoke(BLOCKED かつ MERGEABLE の PR で Verification Commands が実行されること)で確認する。
- fallback_policy: 静的テストの PASS を runtime 動作の証明として扱わない。
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
BEHINDの既存扱いの変更route_loop_verdict_v2.pyおよび.claude/skills/impl-review-loop/**の変更(read-only authority)- test-runner の他の挙動(実装: test-runner.md の TEST_VERDICT_MACHINE/v2 報告契約を step-2 の委譲契約と consumer 要件に整合させる #2892 が扱う TEST_VERDICT_MACHINE/v2 報告契約を含む)
- CI / branch protection の設定
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 -qAllowed 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
1 Issue = 1 PR。専用 worktree で作業し、Draft PR を既定とする。- 発見元(参照のみ・吸収しない): 実装: Claude-GPT Auto に canonical workflow delegation context を投影し External System Writes false-deny を減らす #2843 / PR fix: Claude-GPT canonical workflow canary の測定契約を是正する (#2843) #2888。関連: 実装: 再発防止: 独立 VC の正規消費経路を Step 2 / 4 / 5 に接続し、検証未了・失効後の approved を防ぐ #2837(閉じ済み)。実装: test-runner.md の TEST_VERDICT_MACHINE/v2 報告契約を step-2 の委譲契約と consumer 要件に整合させる #2892 と
.claude/agents/test-runner.mdが重複するため、並行実装せず直列で処理する。
Metadata
Metadata
Assignees
Labels
agent/implementerAI implementer agentenhancementNew feature or requestphase/implementationImplementation phase
Activity