Skip to content

実装: impl-review-loop preparation から scope rollup preflight(Step 2.5)を除去し、issue-refinement-loop の判定を再実行しない #1676

Closed

Description

@squne121

Machine-Readable Contract

contract_schema_version: v1
issue_kind: implementation
parent_issue: "#1674"
relationship: part_of
goal_ref: "impl-review-loop preparationからOPEN Issue間のsemantic overlap・ordering再判定と、そのためのscope-rollup-runner自動dispatchを撤去し、runnerを明示手動呼出し専用のadvisory diagnosticとして保持する"
change_kind: workflow

Parent Issue

#1674

Parent Goal Ref

  • Goal: issue-refinement-loopを OPEN Issue 間の重複・吸収候補・依存順・実装優先順位判定の唯一の場所(SSOT)にし、impl-review-loopはこの判定を再実行しない。
  • Desired Destination: impl-review-loopはsemantic relationを再分類せず、live repository・Allowed Paths・test・CI・review・Git/PR conflict・sandbox/approvalの安全境界を維持する。

Current-State Summary

Owner Migration Decision

OWNER_MIGRATION_DECISION_V1:
  issue_number: 1676
  source_pr: 1685
  source_pr_state: merged
  decision: retain_as_explicit_advisory_diagnostic
  capability:
    retained: true
    invocation_mode: explicit_manual_invocation_only
    automatic_impl_review_loop_dispatch: forbidden
    routing_authority: advisory_only
    semantic_reclassification_authority: none
  failure_effect:
    missing: warning_only
    stale: warning_only
    invalid: warning_only
    runner_unavailable: warning_only
    execution_failed: warning_only
  impl_review_loop_policy_precedence:
    issue: 1830
    artifact_required_for_authorization: false
    artifact_required_for_continuation: false
    artifact_required_for_merge_readiness: false
  preserved_live_safety_gates:
    - linked_issue_and_worktree_identity
    - non_root_non_detached_clean_worktree
    - allowed_paths
    - tests
    - product_ci
    - pr_review
    - pairwise_git_merge_observation
    - target_pr_mergeability
    - sandbox_and_approval
    - github_protection

Dependency and Relationship Record

parent_issue: "#1674"
relationship: part_of
completed_prerequisites:
  - "#1675"
  - "#1677"
  - "#1680"
open_sibling_scope:
  - "#1679"
required_predecessors:
  - "#1793"
  - "#1853"
transitive_order:
  - "#1792"
  - "#1793"
  - "#1853"
  - "#1676"

#1674 は delivery-rollup parent であり、本 Issue は parent完了を待つ実行依存を設定しない。#1679 は parent goalの兄弟scopeであり、#1676の直接実装依存ではない。#1792/#1793 未完了の間、pairwise gate を production-ready と主張しない。

Current Validated Scope

  • preparationから scope-rollup-runner のautomatic dispatch、marker capture、marker不備を理由とするhuman escalation、semantic overlap / ordering 再判定を撤去し、#1830に従うadvisory-only表現へ置換する。
  • scope-rollup-runnerのClaude/Codex agent定義を explicit manual invocation only のread-only advisory diagnosticへ更新し、discoverabilityを維持する。
  • dispatch validator、parity/config validator、bridge contract test、runtime-contract fixtureをautomatic dispatch禁止・manual advisory保持のbehavior contractへ更新する。
  • 実装: impl-review-loop production routerで mergeable と merge_state_status を分離し、conflict・unknown routingを正規化する #1853 が所有する target PR mergeability production routerを変更せず、#1676ではその完了をrequired predecessorとして記録する。

Remaining Parent Gaps

Outcome

impl-review-loop preparationからOPEN Issue間のsemantic overlap・ordering再判定と、そのためのscope-rollup-runner自動dispatchを撤去する。scope-rollup-runner capability自体は明示手動呼出し専用のadvisory diagnosticとして保持する。impl-review-loopはsemantic relationを再分類せず、advisory handoffを参照できるが、その欠落・stale・invalidを停止理由にしない。既存のlive repository、Allowed Paths、test、CI、review、Git/PR conflict、sandbox/approval安全境界は維持する。

In Scope

Out of Scope

Acceptance Criteria

  • AC1: preparation のproduction pathで scope-rollup-runner がautomatic spawnされない。
  • AC2: dispatch validatorは preparation へのscope-rollup-runner mappingを要求しない。
  • AC3: bridge contract testは Step 2.5のexact named spawn文言を要求しない。
  • AC4: scope-rollup-runnerは explicit manual invocation用のread-only agentとしてdiscoverableである。
  • AC5: manual runnerの結果はadvisory-onlyで、impl-review-loop routingを変更しない。
  • AC6: missing / stale / invalid / runner_unavailable / execution_failed は impl-review-loopの停止理由にならない。
  • AC7: semantic overlap または ordering ambiguity は impl-review-loop独自の停止理由にならない。
  • AC8: linked Issue/worktree identity、non-root/non-detached clean worktree、Allowed Paths、tests、product CI、PR review、sandbox/approval、GitHub protection のlive safety gateが維持される。
  • AC9: pairwise conflictのblocking claimは 実装: ensure_contract_snapshot.py・open-pr・impl-review-loop に PAIRWISE_MERGE_OBSERVATION_V1 の再利用禁止 consumer 契約を配線する #1793 完了後のproduction consumerを前提とし、#1793未完了時にproduction-readyと主張しない。
  • AC10: target PR mergeabilityのblocking claimは 実装: impl-review-loop production routerで mergeable と merge_state_status を分離し、conflict・unknown routingを正規化する #1853 完了後のproduction routerを前提とし、#1853未完了時にproduction-readyと主張しない。

Verification Commands

# AC1
$ uv run --locked pytest tests/test_codex_agent_bridge_contract.py -q
# AC2
$ uv run --locked python3 scripts/check_impl_review_loop_codex_dispatch.py
# AC3
$ uv run --locked pytest tests/test_codex_agent_bridge_contract.py -q
# AC4
$ uv run --locked pytest tests/codex/test_scope_rollup_runner_agent_config.py -q
# AC5
$ uv run --locked pytest tests/codex/test_scope_rollup_runner_agent_config.py -q
# AC6
$ uv run --locked pytest tests/test_codex_agent_bridge_contract.py -q
# AC7
$ uv run --locked pytest tests/test_codex_agent_bridge_contract.py -q
# AC8
$ uv run --locked pytest tests/test_codex_agent_bridge_contract.py -q
# AC9
$ uv run --locked pytest tests/test_codex_agent_bridge_contract.py -q
# AC10
$ uv run --locked pytest tests/codex/test_scope_rollup_runner_agent_config.py -q
# preflight-scope: pr_review_only
$ uv run --locked python3 scripts/check_claude_codex_agent_parity.py
# preflight-scope: pr_review_only
$ uv run --locked python3 scripts/check_codex_agent_config.py --assert-required-fields --assert-runtime-contract

Allowed Paths

  • .claude/skills/impl-review-loop/SKILL.md
  • .claude/skills/impl-review-loop/steps/preparation.md
  • .claude/skills/impl-review-loop/steps/step-5-feedback-and-termination.md
  • .claude/agents/scope-rollup-runner.md
  • .codex/agents/scope-rollup-runner.toml
  • scripts/check_impl_review_loop_codex_dispatch.py
  • scripts/check_claude_codex_agent_parity.py
  • scripts/check_codex_agent_config.py
  • tests/test_codex_agent_bridge_contract.py
  • tests/codex/test_scope_rollup_runner_agent_config.py
  • tests/fixtures/codex-agent-config/expected-runtime-contract.json

Stop Conditions

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/preparation.md
  • .claude/skills/impl-review-loop/steps/step-5-feedback-and-termination.md

Runtime Verification Applicability

  • decision: not_applicable
  • reason: agent contract、validator、fixture-driven production consumerを静的・unit testで検証するため

Scope Delta

kind before after authority
migration decision PR #1685 をOPEN Draftとして扱う merged SHAを記録し、manual advisory diagnostic保持へ確定 OWNER_MIGRATION_DECISION_V1
dependency parent #1674へのDepends on relationship: part_ofのみを残し、#1793 / #1853を実装前提として記録 owner-authorized refinement
allowed paths preparation文書中心 manual agent / validator / parity / bridge contract consumerまで拡張 current-main inventory

Delivery Rule

1 Issue = 1 PR。#1793と#1853が完了し、本Issueのcontract reviewがfresh goとなった後に専用worktreeで実装し、Draft PRを既定とする。

Notes for Reviewer

Activity

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

    @squne121
    OwnerAuthor

    判定

    REQUEST_CHANGES — 現状の #1676 は実装着手不可です。

    「OPEN Issue 間の semantic relation 判定を issue-refinement-loop に一元化し、impl-review-loop では再分類しない」という方向性自体は妥当です。

    ただし現在の Issue 本文は、依存関係、main 上の現行ポリシー、既にマージされた PR、実際の CI 契約、未実装の pairwise conflict producer、production mergeability consumer の間で矛盾しています。Allowed Paths 内の変更だけでは完了せず、現状のまま実装すると either CI failure、routing split-brain、または安全機構の空白が発生します。

    P0 — 実装阻害事項

    P0-1. 親 Issue への Depends on が循環依存を形成している

    #1676 は parent_issue: "#1674" である一方、GitHub native relation でも Depends on #1674 を持っています。#1674 は全 child Issue の完了を自身の closure 条件にしています。したがって native dependency を実行順判定へ使う場合、次の循環になります。

    #1676 は #1674 完了待ち
    #1674 は #1676 完了待ち
    

    これは ISSUE_EXECUTION_DECISION_V1 が native dependency を正しく読むようになった時点で、#1676 が永久に blocked / deferred になり得る関係です。parent_issue は維持し、GitHub の Depends on #1674 は削除すべきです。(GitHub) #1674 の closure rule は全 child の完了を要求しています。

    P0-2. PR #1685 の前提が失効しており、migration decision が未確定

    Issue 本文は現在も PR #1685 を「OPEN Draft、mergeable: true、Step 2.5 に機能を追加中」と記述しています。実際には PR #1685 は 2026年7月26日にマージ済みで、23 commits・17 changed files の実装が main に入っています。Issue 内の選択肢 (a) 先にマージ、(b) マージ前に移設、(c) supersede は既に過去の状態を前提としています。([GitHub]1)

    さらに、現在の Claude/Codex の両 runner 定義は、用途を明示的に impl-review-loop preparation Step 2.5 に固定しています。Step 2.5 の文書だけを消して runner を放置すると、agent definition、dispatcher、runtime contract が互いに矛盾します。

    推奨判断は (d) です。

    migration_decision: retain_as_explicit_advisory_diagnostic
    owner: issue-refinement-loop
    trigger: explicit_manual_invocation_only
    automatic_impl_review_loop_dispatch: forbidden
    routing_authority: advisory_only
    missing_stale_invalid_effect: warning_only

    Codex custom agent は project-scoped の .codex/agents/*.toml として読み込まれ、name、description、developer_instructions が agent 契約になります。そのため、移行は preparation.md の削除だけでは完結せず、agent definition と検証資産まで変更対象にする必要があります。なお child agent は parent の permission mode や runtime override を継承するため、read-only 設定を独立した security boundary として扱うべきでもありません。([OpenAI Developers]2)

    P0-3. 現在の Allowed Paths では既存 CI が決定的に失敗する

    #1676 の Allowed Paths は SKILL.md、2つの step 文書、新規 pytest の4系統だけです。([GitHub]1)

    一方、main 上の scripts/check_impl_review_loop_codex_dispatch.py は次を必須化しています。

    • preparation.md から scope-rollup-runner への mapping
    • exact named spawn 文言
    • generic/default fallback を使わない旨の文言

    これらが欠落すると checker は非ゼロ終了します。

    tests/test_codex_agent_bridge_contract.py も同じ exact spawn 契約を assertion しており、当該テストは現行 CI test plan に含まれています。

    したがって、現在のスコープで Step 2.5 を消した場合の結果は次のいずれかです。

    1. checker/test が失敗して CI が落ちる
    2. production behavior と validator の契約が split-brain になる
    3. validator を形骸化するが、変更先が Allowed Paths 外になる

    これは実装上の確定的 blocker です。

    P0-4. #1830 の現行 main 方針と ISSUE_EXECUTION_DECISION_V1 の契約が衝突している

    現行 impl-review-loop は #1830 の precedence により、scope-rollup、overlap、contract snapshot、body SHA 等を 任意 telemetry としています。missing / stale / invalid / malformed でも停止せず、live Issue、worktree identity、Allowed Paths、実テスト、CI、PR review を正本として routing します。

    一方、issue-refinement-loop の current contract は、downstream に対して次を要求しています。

    semantic_reclassification: forbidden
    freshness_validation: required
    stale_action: rerun_issue_refinement

    しかも ISSUE_EXECUTION_DECISION_V1 自体はまだ additive/optional で、native dependency・duplicate・absorb から genuine relation を構築する production 接続も未完了です。

    #1676 は ISSUE_EXECUTION_DECISION_V1 / downstream_policy を consume するとだけ記述しており、次の競合を解決していません。

    #1830:
      stale artifact → warning、live state で継続
    
    ISSUE_EXECUTION_DECISION_V1.downstream_policy:
      stale artifact → issue-refinement-loop を再実行
    

    同じ入力に対して continue と rerun が成立するため、routing が決定的ではありません。

    #1676 では現行 main の #1830 を明示的に優先し、以下に固定すべきです。

    issue_execution_decision_usage:
      semantic_reclassification: forbidden
      routing_authority: advisory_only
      missing_stale_invalid: warn_and_continue_to_live_gates
      downstream_policy_enforcement: superseded_by_issue_1830_for_impl_review_loop

    ISSUE_EXECUTION_DECISION_V1 schema 自体の freshness_validation: required を変更するなら、それは #1677 owner contract の変更なので別 Issue が必要です。

    P0-5. pairwise_merge_conflict は現在、停止理由として実装されていない

    #1676 の Outcome は、semantic gate 撤去後も pairwise_merge_conflict が live blocking reason として残ると主張しています。([GitHub]1)

    しかし現在は次の状態です。

    #1792 の本文自身も producer 未着手、consumer wiring は #1793 と明記しています。#1793 も #1792 が main に入るまで着手しない契約です。

    正しい Git conflict 観測は、固定した commit pair を git merge-tree --write-tree で merge simulation する設計です。同コマンドは worktree/indexを変更せず、3-way content merge、rename detection、directory/file conflict、複数 merge-base 処理を実際の merge と同等に行います。clean は exit 0、conflict は exit 1、その他は tool error と区別できます。([Git]3)

    安全な順序は以下です。

    #1792 producer
      ↓
    #1793 consumer wiring
      ↓
    #1676 semantic Step 2.5 removal
    

    したがって #1676 は Depends on #1793 を追加すべきです。これを追加しない場合は、Outcome と AC から「pairwise gate が残る」という主張を削除しなければなりません。

    P0-6. mergeable / merge_state_status の問題は文書だけでなく production code に存在する

    #1676 の AC4 は step-5-feedback-and-termination.md に正しい文言が存在することしか検証しません。([GitHub]1)

    実際の production router である route_loop_verdict_v2.py は、

    • mergeability.mergeable を routing に取り込んでいない
    • CONFLICTING を merge_state_status の許容値に混入させている
    • _check_behind_invariant() でも同じ不正 enum を受理している

    という状態です。

    step-5-mergeability-handling.md の routing table も CONFLICTING を merge_state_status の値として列挙しています。

    一方、リポジトリ内の LOOP_VERDICT_V2 schema は正しく分離しています。

    GitHub GraphQL の正式 enum は次の通りです。

    mergeable:
      CONFLICTING | MERGEABLE | UNKNOWN
    
    mergeStateStatus:
      BEHIND | BLOCKED | CLEAN | DIRTY | DRAFT |
      HAS_HOOKS | UNKNOWN | UNSTABLE
    

    CONFLICTING は mergeStateStatus には存在しません。また REST API の mergeable=null は mergeability 計算中を意味し、時間を置いて再取得する必要があります。([GitHub Docs]4)

    正しい production matrix は少なくとも以下です。

    mergeable == CONFLICTING
      → conflicting PR escalation
    
    merge_state_status == DIRTY
      → conflicting PR escalation
    
    mergeable == UNKNOWN
    or REST mergeable == null
    or merge_state_status == UNKNOWN
      → bounded retry → indeterminate / human escalation
    
    merge_state_status == BEHIND
      → update_branch route
    
    merge_state_status in BLOCKED/DRAFT/HAS_HOOKS/UNSTABLE
      → 個別の非conflict routing
    
    merge_state_status == CONFLICTING
      → schema invalid、fail-closed
    

    この修正には route_loop_verdict_v2.py と fixture-driven tests が必要であり、現在の Allowed Paths では実装できません。production consumer の既存テスト位置は既に存在しています。

    P1 — 契約品質上の問題

    P1-1. 「PR実conflictのみで停止」は安全境界を過剰に削っている

    #1676 の goal_ref と Outcome は、PR実 conflict だけが停止理由として残るように読めます。([GitHub]1)

    しかし現行 main では、次も正当な停止条件です。

    • live Issue 不在
    • Issue と linked worktree identity の不一致
    • root checkout
    • detached HEAD
    • dirty worktree
    • Allowed Paths 違反
    • 実テスト・CI・PR review の失敗

    これらは scope-rollup の semantic reclassification とは無関係な live safety boundary です。

    正しい表現は次です。

    OPEN Issue 間の semantic overlap / ordering ambiguity を impl-review-loop 自身の停止理由にしない。既存の live repository、Allowed Paths、test、CI、review、mergeability、pairwise Git observation の安全境界は維持する。

    P1-2. ISSUE_EXECUTION_DECISION_V1 を必須 handoff とみなせない

    現在の production 接続では、decision は additive/optional です。native dependency 等から genuine graph を構成する経路も未接続で、scope-rollup 由来の曖昧な signal は保守的に deferred へ倒れます。

    さらに planner は scope-rollup input がない場合、対象 Issue 単体の minimal selected decision を生成し得ます。つまり「artifact がある」ことは、「OPEN Issue 全体の semantic relation が完全に確定している」ことを意味しません。

    #1676 では artifact の存在を権威化せず、#1830 に従う advisory telemetry として扱うのが現行実装との整合点です。

    P1-3. Verification Commands が behavior を検証していない

    現在の VC は大半が rg -c による語句検索です。

    • AC1: 特定の日本語文言がないことを検索
    • AC2: read-only という一般語があることを検索
    • AC3: ordering ambiguity だけを検索
    • AC4: merge_state_status という文字列だけを検索
    • AC5: Issue 本文を表示するだけ
    • AC6: 新規 test 1本だけ

    これでは、別表現の自動dispatch、production router の enum、既存 checker、agent contract、CI plan、pairwise consumer preservationを検証できません。([GitHub]1)

    VC は文言検索ではなく、production module と validator を実行する必要があります。

    P2 — 修正すべきメタデータ


    推奨する #1676 の再定義

    修正版タイトル

    実装: impl-review-loop の semantic scope-rollup 自動再実行を撤去し、
    runner の advisory 移行と mergeability consumer 境界を確定する
    

    Machine-Readable Contract

    contract_schema_version: v1
    issue_kind: implementation
    parent_issue: "#1674"
    goal_ref: >
      impl-review-loop が OPEN Issue 間の semantic relation を再分類せず、
      preparation から scope-rollup-runner の自動 dispatch を撤去する。
      scope-rollup / ISSUE_EXECUTION_DECISION_V1 は Issue #1830 に従う
      advisory telemetry とし、live repository・Allowed Paths・test・CI・
      PR review・pairwise Git observation・target PR mergeability の
      安全境界は維持する。
    change_kind: workflow
    depends_on:
      - "#1793"
    migration_decision: retain_as_explicit_advisory_diagnostic

    Depends on #1674 は削除し、parent_issue: "#1674" だけを残します。

    修正版 Outcome

    impl-review-loop preparation から scope-rollup-runner の自動 named dispatch、
    marker待機、marker validation、semantic route 判定が除去されている。
    
    ISSUE_EXECUTION_DECISION_V1、ISSUE_SCOPE_ROLLUP_RUN_RESULT_V1、
    ISSUE_SCOPE_ROLLUP_DECISION_V2 は Issue #1830 の advisory telemetry としてのみ
    記録可能であり、missing/stale/invalid を単独の停止・承認・merge-ready 根拠にしない。
    
    scope-rollup-runner capability は issue-refinement-loop 配下の明示的な
    manual diagnostic として保持され、impl-review-loop から暗黙起動されない。
    
    #1793 で導入された current-head pairwise merge observation は維持される。
    
    target PR の mergeability は production consumer で、
    mergeable == CONFLICTING と merge_state_status == DIRTY を別フィールドとして
    判定し、UNKNOWN/null は bounded retry 後に indeterminate へ倒す。
    
    既存の live Issue/worktree identity、dirty state、Allowed Paths、test、CI、
    PR review gate は変更されない。
    

    In Scope

    1. preparation.md から Step 2.5 の自動 dispatch と blocking route を除去する。
    2. Claude/Codex の scope-rollup-runner 定義を manual/advisory diagnostic に更新する。
    3. dispatcher validator と bridge tests を「自動dispatch禁止」契約へ反転する。
    4. step-5-feedback-and-termination.md と step-5-mergeability-handling.md を整合させる。
    5. route_loop_verdict_v2.py で mergeable と merge_state_status を別々に検証する。
    6. 実装: ensure_contract_snapshot.py・open-pr・impl-review-loop に PAIRWISE_MERGE_OBSERVATION_V1 の再利用禁止 consumer 契約を配線する #1793 の pairwise consumer を削除・迂回していないことを回帰テストする。
    7. 実装: Codex enforcing harness を quarantine し、advisory session recorder のみ維持して標準 sandbox / approval workflow に戻す #1830 の live-state safety boundary が維持されることを回帰テストする。

    Out of Scope

    - ISSUE_EXECUTION_DECISION_V1 schema / downstream_policy の変更
    - scope_rollup.run exact executor の削除または書き換え
    - PAIRWISE_MERGE_OBSERVATION_V1 producer / consumer の新規実装
      (#1792 / #1793 が所有)
    - implement-issue / open-pr の overlap migration(#1679)
    - capture hook / parser schema の削除
    

    Allowed Paths

    少なくとも以下が必要です。

    .claude/skills/impl-review-loop/SKILL.md
    .claude/skills/impl-review-loop/steps/preparation.md
    .claude/skills/impl-review-loop/steps/step-5-feedback-and-termination.md
    .claude/skills/impl-review-loop/steps/step-5-mergeability-handling.md
    .claude/skills/impl-review-loop/steps/conflicting-pr-escalation-runbook.md
    .claude/skills/impl-review-loop/scripts/route_loop_verdict_v2.py
    .claude/skills/impl-review-loop/tests/**
    .claude/agents/scope-rollup-runner.md
    .codex/agents/scope-rollup-runner.toml
    scripts/check_impl_review_loop_codex_dispatch.py
    scripts/check_codex_agent_config.py
    scripts/check_claude_codex_agent_parity.py
    scripts/check-codex-agents.mjs
    tests/test_codex_agent_bridge_contract.py
    tests/codex/test_scope_rollup_runner_agent_config.py
    tests/fixtures/codex-agent-config/expected-runtime-contract.json
    docs/dev/session-recording-policy.md
    

    修正版 Acceptance Criteria

    AC1:
      preparation の production path から scope-rollup-runner の自動起動が
      到達不能であることをテストで確認する。文言不在だけでは不可。
    
    AC2:
      ISSUE_EXECUTION_DECISION_V1 / scope-rollup artifact が
      missing・stale・invalid の各場合に warning のみとなり、
      live-state gates へ継続することを parametrized test で確認する。
    
    AC3:
      semantic relation を impl-review-loop 内で再分類する code path がない。
    
    AC4:
      Claude/Codex runner definition が manual/advisory diagnostic を明記し、
      impl-review-loop Step 2.5 を caller/owner として参照しない。
    
    AC5:
      check_impl_review_loop_codex_dispatch.py が、
      preparation 自動dispatch禁止と explicit manual runner 保持を検証する。
    
    AC6:
      #1793 の pairwise current-head observation consumer が残り、
      stale/incomplete/indeterminate を再利用しないことを確認する。
    
    AC7:
      production router が以下を検証する。
      - mergeable=CONFLICTING → escalation
      - merge_state_status=DIRTY → escalation
      - mergeable=UNKNOWN / status=UNKNOWN → retry/indeterminate
      - merge_state_status=CONFLICTING → schema invalid
      - status=BEHIND → update_branch
      - MERGEABLE+CLEAN → 他gate通過時のみ approved
    
    AC8:
      live Issue/worktree identity、dirty state、Allowed Paths、
      test、CI、PR review の既存停止条件が維持される。
    
    AC9:
      targeted tests、agent validators、impl-review-loop test suite が PASS する。
    

    修正版 Verification Commands

    uv run --locked pytest \
      .claude/skills/impl-review-loop/tests/test_preparation_scope_rollup_consume_only.py \
      -q
    
    python scripts/check_impl_review_loop_codex_dispatch.py
    
    python scripts/check_codex_agent_config.py \
      --assert-required-fields \
      --assert-runtime-contract
    
    uv run --locked pytest \
      tests/test_codex_agent_bridge_contract.py \
      tests/codex/test_scope_rollup_runner_agent_config.py \
      -q
    
    uv run --locked pytest \
      .claude/skills/impl-review-loop/tests/fixtures/step5_routing_consumer/test_route_loop_verdict_v2.py \
      .claude/skills/impl-review-loop/tests/test_v2_routing_boundary_regression.py \
      .claude/skills/impl-review-loop/tests/test_termination_gate.py \
      -q
    
    uv run --locked pytest \
      .claude/skills/impl-review-loop/tests/ \
      -q
    
    uv run --locked ruff check \
      .claude/skills/impl-review-loop/scripts \
      .claude/skills/impl-review-loop/tests \
      tests/test_codex_agent_bridge_contract.py \
      tests/codex/test_scope_rollup_runner_agent_config.py

    修正版 Stop Conditions

    - #1793 が未マージで、Outcome が pairwise gate 維持を要求する場合
    - #1830 の advisory policy 自体を反転する必要が生じた場合
    - ISSUE_EXECUTION_DECISION_V1 schema/downstream_policy の変更が必要な場合
    - scope-rollup runner/executor/capture chain の完全削除が必要な場合
    - Allowed Paths 外の architecture layer 変更が必要な場合
    

    GitHub に投稿するレビューコメント案

    ## 判定
    
    **REQUEST_CHANGES — 現状のままでは実装着手不可です。**
    
    方向性、すなわち semantic relation の再分類を issue-refinement-loop に一元化し、
    impl-review-loop から Step 2.5 の自動 scope-rollup を撤去することには同意します。
    
    ただし、以下の P0 blocker があります。
    
    1. `parent_issue: #1674` と `Depends on #1674` が循環依存を形成している。
       `Depends on #1674` を削除し、parent relation のみ残す必要がある。
    
    2. PR #1685 は既に 2026-07-26 にマージ済みであり、
       本文の「OPEN Draft / mergeable:true」は失効している。
       migration decision は `(d) runner を explicit manual/advisory diagnostic として保持`
       に確定することを推奨する。
    
    3. 現在の Allowed Paths では
       `check_impl_review_loop_codex_dispatch.py`、
       `tests/test_codex_agent_bridge_contract.py`、
       Codex/Claude runner definitions を更新できず、既存 CI が失敗する。
    
    4. main 上の #1830 は scope-rollup artifact を advisory telemetry としており、
       missing/stale/invalid で停止しない。
       一方 ISSUE_EXECUTION_DECISION_V1 は freshness required / stale rerun を宣言している。
       impl-review-loop では #1830 を優先することを本文に明記する必要がある。
    
    5. `pairwise_merge_conflict` producer/consumer の #1792/#1793 は未実装・未配線である。
       pairwise gate 維持を Outcome に残すなら #1676 を #1793 依存にする必要がある。
    
    6. `mergeable` / `merge_state_status` の split-brain は文書だけでなく
       production `route_loop_verdict_v2.py` に存在する。
       `merge_state_status=CONFLICTING` を拒否し、
       `mergeable=CONFLICTING`、`merge_state_status=DIRTY`、
       UNKNOWN/null retry を production test で固定する必要がある。
    
    また、「PR実conflictのみで停止」という表現は広すぎます。
    撤去対象は semantic overlap / ordering ambiguity の再判定だけであり、
    live Issue/worktree identity、dirty state、Allowed Paths、test、CI、PR review の
    安全境界は維持してください。
    
    Verification Commands は `rg -c` による文言検索ではなく、
    production router、dispatch validator、agent contract、pairwise consumer preservationを
    実行する behavior test に置き換える必要があります。

    今回の判定は GitHub API で current main のソース、テスト、関連 Issue/PR/コメントを照合した静的レビューです。ローカルでの pytest 実行は行っていませんが、既存 checker と assertion が Step 2.5 の exact dispatch を要求しているため、現在の Allowed Paths のままでは失敗する点は静的に確定できます。

  3. squne121 commented on Jul 29, 2026

    @squne121
    OwnerAuthor

    Refinement Loop: Human Escalation Required

    The loop has terminated and requires human review. Cause: human judgment required

    Blockers

    "PR #1685 は 2026-07-26 に merge 済みだが、anchor が提案する migration decision(retain_as_explicit_advisory_diagnostic)の採用済み一次証跡を確認できない"
    
    "migration decision を本文へ確定記録するには owner の明示決定が必要"
    
    "#1677 と #1680 は CLOSED、#1679 は OPENであり、本文の依存・スコープを current state へ再束縛する必要がある"
    
  4. squne121 commented on Jul 29, 2026

    @squne121
    OwnerAuthor

    推奨アクション

    owner decision は retain_as_explicit_advisory_diagnostic を採用してください。

    PR #1685 は既にマージされ、Claude/Codex双方の scope-rollup-runner 定義が impl-review-loop preparation Step 2.5 専用として main に残っています。Step 2.5だけを削除すると、agent定義・dispatch validator・既存テストが矛盾します。

    実施順は次が妥当です。

    1. #1676本文とコメントにowner決定を一次証跡として記録する。

      • runner capabilityは残す。
      • 自動dispatchは禁止する。
      • 明示的な手動呼出し専用にする。
      • routing authorityは持たせない。
      • missing/stale/invalid/failedはwarning-onlyとする。
    2. 依存関係をcurrent stateへ修正する。

    3. #1676は現時点では実装開始しない。

      • pairwise_merge_conflict producerの#1792とconsumer配線の#1793はいずれもOPENです。#1676が「実Git競合gateを維持した」と主張するには、少なくとも#1793完了が先です。
    4. GitHub mergeability routing修正は別Issueへ分割する。

    5. #1830をimpl-review-loop内の優先方針とする。

      • ISSUE_EXECUTION_DECISION_V1やscope-rollup artifactはsemantic reclassificationを禁止するためのadvisory inputにはできますが、存在・freshness・digestをcontinuation prerequisiteにはしません。
      • worktree identity、Allowed Paths、実テスト、CI、PR review、Git/PR競合などのlive safety gateは維持します。#1830はcompletedです。

    現行の自動dispatchはpreparation.mdに明記され、validatorとテストもexact spawnを必須化しています。このため、#1676のAllowed Pathsには少なくともagent定義・validator・bridge contract testを追加する必要があります。

    実行用プロンプト

    リポジトリ squne121/loop-protocol の Issue #1676 に対して、owner-authorized refinementを実施してください。

    これはコード実装ではありません。Issue本文のcurrent-state再束縛、owner decisionの一次証跡記録、必要な別Issueの起票までを行い、worktree・branch・commit・PRは作成しないでください。

    Owner Decision

    以下を確定判断として採用してください。

    OWNER_MIGRATION_DECISION_V1:
      issue_number: 1676
      source_pr: 1685
      source_pr_state: merged
      decision: retain_as_explicit_advisory_diagnostic
      capability:
        retained: true
        invocation_mode: explicit_manual_invocation_only
        automatic_impl_review_loop_dispatch: forbidden
        routing_authority: advisory_only
        semantic_reclassification_authority: none
      failure_effect:
        missing: warning_only
        stale: warning_only
        invalid: warning_only
        runner_unavailable: warning_only
        execution_failed: warning_only
      impl_review_loop_policy_precedence:
        issue: 1830
        artifact_required_for_authorization: false
        artifact_required_for_continuation: false
        artifact_required_for_merge_readiness: false
      preserved_live_safety_gates:
        - linked_issue_and_worktree_identity
        - non_root_non_detached_clean_worktree
        - allowed_paths
        - tests
        - product_ci
        - pr_review
        - pairwise_git_merge_observation
        - target_pr_mergeability
        - sandbox_and_approval
        - github_protection

    このYAMLをIssue #1676本文のmigration decision節へ記録し、同じ内容をowner decisionの一次証跡としてIssueコメントにも投稿してください。

    Current-State Rebinding

    GitHub APIとcurrent mainを再取得し、少なくとも次を確認して本文を更新してください。

    Dependency修正

    Issue #1676冒頭のDepends on #1674を削除してください。

    親子関係は次の形式で表現してください。

    parent_issue: "#1674"
    relationship: part_of

    #1674はdelivery-rollup parentであり、#1676から親の完了を待つ実行依存を設定しないでください。

    本文の依存・関連関係を次のように再整理してください。

    completed_prerequisites:
      - "#1675"
      - "#1677"
      - "#1680"
    
    open_sibling_scope:
      - "#1679"
    
    required_predecessors:
      - "#1793"
      - "<new target mergeability router issue>"
    
    transitive_order:
      - "#1792"
      - "#1793"
      - "<new target mergeability router issue>"
      - "#1676"

    #1679は親goalを完成させるための兄弟Issueですが、#1676の直接実装依存にはしないでください。

    #1676のScope再定義

    #1676のgoalを次に限定してください。

    impl-review-loop preparationからOPEN Issue間のsemantic overlap・ordering再判定と、そのためのscope-rollup-runner自動dispatchを撤去する。scope-rollup-runner capability自体は明示手動呼出し専用のadvisory diagnosticとして保持する。impl-review-loopはsemantic relationを再分類せず、advisory handoffを参照できるが、その欠落・stale・invalidを停止理由にしない。既存のlive repository、Allowed Paths、test、CI、review、Git/PR conflict、sandbox/approval安全境界は維持する。

    以下を明記してください。

    • ISSUE_EXECUTION_DECISION_V1はimpl-review-loop内ではadvisory telemetryである。
    • semantic_reclassification: forbiddenは維持する。
    • missing/stale/invalid時にissue-refinement-loop再実行をrequired continuation gateにしない。
    • #1830の方針をimpl-review-loop内で優先する。
    • scope-rollup-runnerの自動dispatch、marker capture、marker不備によるhuman escalationをpreparationから削除する。
    • scope-rollup-runner自体の手動実行能力は残す。
    • 手動診断結果は認可、実装開始、継続、PR publication、merge readinessの根拠にしない。

    Allowed Paths再調査

    repository-wide searchでStep 2.5、scope-rollup-runner、ISSUE_SCOPE_ROLLUP_RUN_RESULT_V1、exact spawn、Codex/Claude parityの全consumerを列挙してください。

    少なくとも次のパスを候補として調査し、実際に変更が必要なものを#1676のAllowed Pathsへ追加してください。

    .claude/skills/impl-review-loop/SKILL.md
    .claude/skills/impl-review-loop/steps/preparation.md
    .claude/skills/impl-review-loop/steps/step-5-feedback-and-termination.md
    .claude/skills/impl-review-loop/tests/**
    .claude/agents/scope-rollup-runner.md
    .codex/agents/scope-rollup-runner.toml
    scripts/check_impl_review_loop_codex_dispatch.py
    tests/test_codex_agent_bridge_contract.py
    scripts/check_claude_codex_agent_parity.py
    scripts/check_codex_agent_config.py
    tests/fixtures/codex-agent-config/**
    

    単なる候補パスを無条件に追加せず、参照・validator・fixture・CI test-planの実在を確認してください。

    route_loop_verdict_v2.pyの修正は#1676へ混載せず、後述の別Issueで扱ってください。

    新規Issueの起票

    次の目的を持つimplementation Issueを新規起票してください。

    推奨タイトル:

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

    親Issueは#1674とし、#1793完了後に実施する順序を設定してください。

    必須Outcome:

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

    実際のファイル位置を調査して、Allowed PathsとVerification Commandsを確定してください。

    起票後、#1676のrequired predecessorとして新Issue番号を本文へ記録してください。

    Acceptance Criteriaの置換

    #1676の既存ACを、語句の存在確認ではなくbehavior contractへ置き換えてください。

    最低限、次を含めてください。

    1. preparation実行時にscope-rollup-runnerが自動spawnされない。
    2. dispatch validatorがpreparationへのscope-rollup-runner mappingを要求しない。
    3. bridge contract testがStep 2.5 exact spawn文言を要求しない。
    4. scope-rollup-runnerは明示的な手動呼出し用agentとして引き続きdiscoverableである。
    5. manual runnerの結果はadvisory-onlyで、impl-review-loop routingを変更しない。
    6. missing/stale/invalid/runner_unavailableがimpl-review-loopの停止理由にならない。
    7. semantic overlapまたはordering ambiguityがimpl-review-loop独自の停止理由にならない。
    8. worktree identity、Allowed Paths、test、CI、PR review等の既存live safety gateが維持される。
    9. pairwise conflictのblocking claimは#1793完了後のproduction consumerを前提とする。
    10. target PR mergeabilityのblocking claimは新規Issue完了後のproduction routerを前提とする。

    Verification Commandsはrg -cだけで完了させず、既存validator、production consumer、fixture test、CI test planを実行するコマンドにしてください。

    Completion Conditions

    この作業では以下だけを行ってください。

    • #1676本文の更新
    • owner decisionコメントの投稿
    • mergeability router用の別Issue起票
    • #1676への新Issue番号・依存順の反映
    • refinement再実行に必要なcurrent-state summaryの投稿

    以下は禁止します。

    最後に、次の形式で結果を報告してください。

    ISSUE_1676_OWNER_REFINEMENT_RESULT_V1:
      issue_number: 1676
      owner_decision_recorded: true
      migration_decision: retain_as_explicit_advisory_diagnostic
      parent_dependency_cycle_removed: true
      completed_prerequisites: [1675, 1677, 1680]
      open_sibling_scope: [1679]
      pairwise_predecessor: 1793
      mergeability_router_issue: <new issue number>
      implementation_status: blocked_on_predecessors
      code_changes_performed: false
      worktree_created: false
      pr_created: false
      issue_body_sha256_before: "<sha256>"
      issue_body_sha256_after: "<sha256>"
      remaining_human_decisions: []

    このプロンプトは、実装を急がず、human escalationの原因だけをowner decisionとcurrent-state再束縛で解消する構成です。

  5. squne121 commented on Jul 29, 2026

    @squne121
    OwnerAuthor

    Owner Decision Record

    OWNER_MIGRATION_DECISION_V1:
      issue_number: 1676
      source_pr: 1685
      source_pr_state: merged
      decision: retain_as_explicit_advisory_diagnostic
      capability:
        retained: true
        invocation_mode: explicit_manual_invocation_only
        automatic_impl_review_loop_dispatch: forbidden
        routing_authority: advisory_only
        semantic_reclassification_authority: none
      failure_effect:
        missing: warning_only
        stale: warning_only
        invalid: warning_only
        runner_unavailable: warning_only
        execution_failed: warning_only
      impl_review_loop_policy_precedence:
        issue: 1830
        artifact_required_for_authorization: false
        artifact_required_for_continuation: false
        artifact_required_for_merge_readiness: false
      preserved_live_safety_gates:
        - linked_issue_and_worktree_identity
        - non_root_non_detached_clean_worktree
        - allowed_paths
        - tests
        - product_ci
        - pr_review
        - pairwise_git_merge_observation
        - target_pr_mergeability
        - sandbox_and_approval
        - github_protection

    Current-State Rebinding

    本文にはowner decision、current-state、親子関係、前提順序、Allowed Paths、behavior ACを再束縛済みです。#1793と#1853の完了までは実装開始しません。

  6. 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 Step 2.5 scope rollup preflightの除去)を吸収します。#1869のPRがmergeされ、本Issueの残存scopeがないことを確認できた時点でcloseします。

    Part of #1860 / absorbed by #1869

  7. 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

  8. 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 可否を判断してください。

  9. squne121 commented on Jul 31, 2026

    @squne121
    OwnerAuthor

    実装child #1869(PR #1871, MERGED, merge commit c3cbc0dd, 2026-07-31T10:56:41Z)の「Related / superseded Issues」節で、本Issueのscope(scope-rollup-runnerのautomatic dispatch撤去・manual-only化・dispatch validator反転)が本PRに吸収されたことが明記されています。current mainで該当実装(.claude/skills/impl-review-loop/steps/preparation.md、.claude/agents/scope-rollup-runner.md、scripts/check_impl_review_loop_codex_dispatch.py)を確認済みです。残存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