Skip to content

調査: issue-refinement-loop の root_entry_router が post-merge の duplicate impl-review-loop handoff を防げない blind spot を調査し、follow-up 実装方針を確定する #2680

Open
1 of 1 issue completed

Description

@squne121

Machine-Readable Contract

contract_schema_version: v1
issue_kind: research
parent_issue: "none"
goal_ref: "post-merge recovery で current implementation scope が既に landed している場合に duplicate impl-review-loop dispatch を防ぐため、root_entry_router の freshness/integrity 責務を維持したまま impl-review-loop の pre-Step-1 intake へ evidence-based landing disposition を追加する実装方針を確定し、follow-up implementation Issue を安全に materialize 可能にする"
change_kind: research-only

Parent Issue

none

Outcome

issue-refinement-loop の root entry は current body / base SHA / capability / identity の freshness-integration gate のまま維持し、post-merge duplicate prevention は impl-review-loop の既存 pre-Step-1 intake choke point で扱う方針を確定する。

この調査は、候補 PR の merged 状態だけで current implementation scope が landed したと推論しない evidence model と behavior matrix を確定する。Issue #2119 / PR #2137 の non-closing Refs #2119 reproducer を必須回帰シナリオにし、Issue #2565 の pr_merged_observed は closing-relation evidence source として利用できるが sole authority ではないことを明記する。fresh contract review が creation-ready と認めた場合だけ、専用の follow-up implementation Issue を materialize 可能にする。

In Scope

  • .claude/skills/issue-refinement-loop/scripts/root_entry_router.py の freshness / integrity responsibility と lifecycle authority を持たない現在の境界を記録する
  • .claude/skills/impl-review-loop/steps/preparation.md の既存 pre-Step-1 choke point と .claude/skills/impl-review-loop/scripts/route_loop_verdict_v2.py の resolve_already_satisfied_early_exit_decision() を、worker / worktree / new PR の前に duplicate dispatch を止める insertion point として比較・採用する
  • current intake の closingIssuesReferences に依存する pr_exists acquisition が PR feat: Playwright E2E responsive matrix を専用 lane へ分離する #2137 の non-closing candidate を発見できないこと、および pr_exists / pr_is_merged boolean だけでは current scope coverage を表現できないことを記録する
  • target Issue/repository identity、candidate PR identity と discovery provenance、relation classification、live lifecycle と merge commit が current main に landed した証跡、immutable implementation-scope coverage reference、current scope reference、later scope expansion comparison、freshness/provenance、contradictory / insufficient disposition を含む evidence model を確定する
  • Issue 実装: workflow trusted signalsとIssue/PR Task equivalenceをTask Contextへ統合する #2565 の .claude/skills/post-merge-cleanup/scripts/task_context_workflow_signal.py::_merged_evidence() が strict closing relation を扱う boundary と、PR feat: Playwright E2E responsive matrix を専用 lane へ分離する #2137 が closingIssuesReferences: [] であることを記録する
  • 実装: CI: Playwright E2E の responsive matrix を専用 lane へ分離し critical path を短縮する #2119 / feat: Playwright E2E responsive matrix を専用 lane へ分離する #2137、merged closing PR、historical merged PR 後の scope expansion、open/draft PR、closed-unmerged PR、contradictory / insufficient evidence を含む behavior matrix と follow-up regression contract を定義する
  • follow-up materialization の dedupe key、source、validated scope、materialization condition、stop condition を定義する

Out of Scope

Machine-Consumable Landing Evidence Contract

本調査は、future implementation が次の content-addressed records を producer / consumer として実装することを、current implementation scope already landed の必要 authority として選択する。未充足、欠落、型不正、identity mismatch、freshness mismatch は landed へ補完推論しない。

IMPLEMENTATION_LANDED_EVIDENCE_V1:
  schema_version: "1"
  target:
    repository: "<owner>/<repo>"
    issue_number: <positive-int>
    issue_body_sha256: "sha256:<hex>"
  candidate:
    pr_number: <positive-int-or-null>
    discovery:
      provenance: closing_relation | verified_cross_reference | no_qualified_candidate
      source_url: "https://github.com/<owner>/<repo>/pull/<number-or-null>"
      relation_class: closing | non_closing_cross_reference | unavailable | contradiction
    lifecycle: open | draft | closed_unmerged | merged | unavailable
    merge:
      commit_oid: "<40-hex-or-null>"
      current_main_ancestry: verified | not_landed | unavailable
  coverage:
    merged_snapshot:
      required_when: "candidate.lifecycle == merged"
      schema: IMPLEMENTATION_SCOPE_COVERAGE_V1
      sha256: "sha256:<hex>"
      repository: "<owner>/<repo>"
      issue_number: <positive-int>
      source_commit_oid: "<40-hex>"
      normalized_scope_manifest_sha256: "sha256:<hex>"
    resume_scope:
      required_when: "candidate.lifecycle in [open, draft]"
      pr_head_sha: "<40-hex>"
      normalized_scope_manifest_sha256: "sha256:<hex>"
      current_scope_ownership: verified | unavailable | contradiction
    current_scope:
      issue_body_sha256: "sha256:<hex>"
      normalized_scope_manifest_sha256: "sha256:<hex>"
    comparison: covered_exactly | expanded_after_landing | unavailable | contradiction | insufficient
  freshness:
    observed_base_sha: "<40-hex>"
    observed_at: "<ISO-8601 UTC>"
    source_identity_verified: true | false
  decision:
    disposition: implementation_already_landed | existing_pr_resume | ordinary_dispatch_or_explicit_recovery | reconciliation_required
    reason_code: "<closed-enum value>"

IMPLEMENTATION_SCOPE_COVERAGE_V1 は merged candidate の merge commit に束縛された immutable scope manifest を保持し、target repository / Issue identity、source commit OID、normalized scope manifest digest を必須にする。current_scope は live Issue body の issue_body_sha256 に束縛して同じ canonical normalizer で manifest digest を生成する。open / draft candidate では merge snapshot を要求せず、exact pr_head_sha と verified current_scope_ownership を持つ resume_scope を要求する。

decision.disposition は caller が自由に指定する値ではなく、以下の precedence table から導出する。 (1) relation / lifecycle / identity / freshness / required state-specific coverage の矛盾・欠落・stale は常に reconciliation_required であり、他 disposition より優先する。 (2) implementation_already_landed は lifecycle: merged、current_main_ancestry: verified、valid merged_snapshot、comparison: covered_exactly が全て揃う場合だけ許可する。 (3) existing_pr_resume は lifecycle: open|draft、verified candidate identity / discovery、fresh pr_head_sha、current_scope_ownership: verified が全て揃う場合だけ許可する。 (4) ordinary_dispatch_or_explicit_recovery は no-qualified-candidate、closed_unmerged、current_main_ancestry: not_landed、または comparison: expanded_after_landing の場合だけ許可する。 (5) 上記に該当しない state は reconciliation_required とする。reconciliation_required は terminal no-op、worker dispatch、worktree、new PR の自動開始をしない。

Materialization Approval Binding

follow-up materialization は、次の immutable request binding を生成し、全 field を fresh readback と比較したときだけ許可する。

FOLLOW_UP_MATERIALIZATION_BINDING_V1:
  schema_version: "1"
  source_anchor:
    url: "https://github.com/<owner>/<repo>/issues/<number>#issuecomment-<id>"
    body_sha256: "sha256:<hex>"
    fetched_at: "<ISO-8601 UTC>"
  parent:
    repository: "<owner>/<repo>"
    issue_number: <positive-int>
    issue_body_sha256: "sha256:<hex>"
  approvals:
    root_review:
      artifact: "ROOT_REVIEW_PIPELINE_RESULT_V1"
      body_sha256: "sha256:<hex>"
      verdict: approve
      generated_at: "<ISO-8601 UTC>"
    semantic_review:
      artifact: "SEMANTIC_REVIEW_RESULT_V1"
      body_sha256: "<hex>"
      assessment: clear
    joined_review:
      artifact: "JOIN_REVIEW_RESULT_V1"
      checked_body_sha256: "<hex>"
      effective_verdict: approve
  evidence_contract:
    schema: IMPLEMENTATION_LANDED_EVIDENCE_V1
    schema_version: "1"
    parent_body_sha256: "sha256:<hex>"
    runtime_instance_required_before_child_creation: false
    child_must_implement: producer | parser | validator | canonical_normalizer | storage_retrieval
  dedupe:
    key: "follow-up:<repo>:<source>:implementation-landed-intake-v1"
    all_state_readback_sha256: "sha256:<hex>"
    readback_at: "<ISO-8601 UTC>"
    semantic_overlap: no_materialized_duplicate_detected
  validated_child_scope:
    rendered_child_body_sha256: "sha256:<hex>"
    post_create_body_readback_sha256: "sha256:<hex>"

source_anchor.body_sha256 は selected anchor の full content hash であり URL だけでは代替できない。materializer は live anchor fetch の URL / body hash / fetched-at identity を binding と比較し、anchor が編集された、取得不能、hash が不一致、または readback のいずれかが stale の場合に作成を拒否する。fresh ROOT_REVIEW_PIPELINE_RESULT_V1 は status: ok、merged_review_result.verdict: approve、body_sha256 が live parent body と一致しなければならない。fresh SEMANTIC_REVIEW_RESULT_V1 と JOIN_REVIEW_RESULT_V1 は同じ body SHA に束縛され、effective verdict が approve、open blocker / high finding がないことを要する。

Issue body、base SHA、source anchor URL / body hash、evidence contract schema/version、rendered child body digest、dedupe result のいずれかが approval 後に変化した場合、binding は invalid であり fresh review / semantic review / dedupe を最初から再実行する。evidence_contract.parent_body_sha256 は parent.issue_body_sha256 と一致しなければならない。materialization は runtime IMPLEMENTATION_LANDED_EVIDENCE_V1 instance や IMPLEMENTATION_SCOPE_COVERAGE_V1 manifest を要求・生成・推測してはならず、prepared child body の readback と child contract が producer / parser / validator / canonical normalizer / storage-retrieval を実装する責務を持つことを検証する。ROOT_REVIEW_PIPELINE_RESULT_V1 単独、merged state 単独、generic reference 単独、または anchor URL 単独を creation authorization にしない。

Acceptance Criteria

  • AC1: root entry の責務が live Issue body / base SHA / capability / identity の freshness / integrity 判定であり、candidate PR lifecycle と current scope coverage の authority を持たないことが、対象 source とともに記録されている。
  • AC2: existing pre-Step-1 intake choke point が worker dispatch、worktree 作成、new PR creation より前に実行されること、および current pr_exists gate が non-closing PR feat: Playwright E2E responsive matrix を専用 lane へ分離する #2137 を発見できず scope coverage を表現できないことが記録されている。
  • AC3: Issue 実装: workflow trusted signalsとIssue/PR Task equivalenceをTask Contextへ統合する #2565 の strict closing-relation boundary と PR feat: Playwright E2E responsive matrix を専用 lane へ分離する #2137 の non-closing merged evidence を区別し、pr_merged_observed / Refs #N / merged state のいずれも current scope coverage の sole authority ではないことが記録されている。
  • AC4: root router extension ではなく impl-review-loop pre-Step-1 intake を採用する理由と、target identity、candidate provenance、relation class、lifecycle / landed commit、scope coverage、scope expansion、freshness、contradictory / insufficient disposition を含む evidence model が記録されている。
  • AC5: behavior matrix が 実装: CI: Playwright E2E の responsive matrix を専用 lane へ分離し critical path を短縮する #2119 / feat: Playwright E2E responsive matrix を専用 lane へ分離する #2137 landed non-closing current scope、merged closing current scope、historical merged scope expansion、open/draft resume、closed-unmerged、contradictory / insufficient evidence を分け、それぞれの no-op、resume、ordinary dispatch、non-mutating reconciliation disposition を定義している。
  • AC6: follow-up implementation contract が 実装: CI: Playwright E2E の responsive matrix を専用 lane へ分離し critical path を短縮する #2119 / feat: Playwright E2E responsive matrix を専用 lane へ分離する #2137 fixture を含む regression tests、pre-Step-1-before-worker/worktree/new-PR invariant、exact dedupe key、source、validated scope、creation-ready materialization condition を定義し、fresh review が approve するまで materialize しないことを記録している。
  • AC7: 調査中および follow-up materialization 前に production implementation、worktree、implementation worker、new PR を開始しない stop boundary が明記されている。
  • AC8: IMPLEMENTATION_LANDED_EVIDENCE_V1 が lifecycle-specific coverage requiredness と exhaustive decision precedence を定義し、contradictory / insufficient / stale / identity mismatch を常に最優先の reconciliation_required、merged + main ancestry + covered scope を限定的な implementation_already_landed、verified open/draft ownership を existing_pr_resume、closed-unmerged / expanded / no-qualified-candidate を ordinary_dispatch_or_explicit_recovery とすることが記録されている。
  • AC9: FOLLOW_UP_MATERIALIZATION_BINDING_V1 が selected source anchor の URL / full-body hash / fetched-at、parent body、root / semantic / joined review artifact、normative evidence-contract schema/version と parent-body binding、all-state dedupe readback、rendered child-body と post-create readback digest を必須にし、anchor edit を含む binding change 時の mechanical invalidation と fresh re-review を定義している。runtime evidence instance は child creation 前の必須入力にしない。

Verification Commands

# AC1
# baseline-expect: pass
$ rg -n "class RootEntryRequest" .claude/skills/issue-refinement-loop/scripts/root_entry_router.py

# AC2
# baseline-expect: pass
$ rg -n "def resolve_already_satisfied_early_exit_decision" .claude/skills/impl-review-loop/scripts/route_loop_verdict_v2.py

# AC3
# baseline-expect: pass
$ rg -n "def _merged_evidence" .claude/skills/post-merge-cleanup/scripts/task_context_workflow_signal.py

# AC4
# baseline-expect: pass
$ rg -n "Already-Satisfied Early-Exit choke point" .claude/skills/impl-review-loop/steps/preparation.md

# AC5
# baseline-expect: pass
$ rg -n "resolve_already_satisfied_early_exit_decision" .claude/skills/impl-review-loop/tests/test_already_satisfied_routing.py

# AC6
# baseline-expect: pass
$ rg -n "dedupe_key" .claude/skills/issue-refinement-loop/references/follow-up-materialization.md

# AC7
# baseline-expect: pass
$ gh issue view 2680 --repo squne121/loop-protocol --json state,body,url

# AC8
# baseline-expect: pass
$ rg -n "ROOT_REVIEW_PIPELINE_RESULT_V1" .claude/skills/issue-refinement-loop/scripts/run_root_review_pipeline.py

# AC9
# baseline-expect: pass
$ rg -n "body_sha256" .claude/skills/issue-refinement-loop/scripts/run_root_review_pipeline.py

Allowed Paths

  • .claude/skills/issue-refinement-loop/scripts/root_entry_router.py
  • .claude/skills/impl-review-loop/scripts/route_loop_verdict_v2.py
  • .claude/skills/post-merge-cleanup/scripts/task_context_workflow_signal.py
  • .claude/skills/impl-review-loop/steps/preparation.md
  • .claude/skills/impl-review-loop/tests/test_already_satisfied_routing.py
  • .claude/skills/issue-refinement-loop/references/follow-up-materialization.md
  • .claude/skills/issue-refinement-loop/scripts/run_root_review_pipeline.py
  • 読み取り専用。リポジトリ変更なし。

Runtime Verification Applicability

  • decision: not_applicable
  • reason: 本 Issue は research-only であり、実行時 I/O を伴う production behavior を変更しない。AC は source、GitHub readback、follow-up contract の静的確認で完結する。

Required Design References

  • docs/dev/workflow.md
  • docs/dev/agent-skill-boundaries.md
  • .claude/skills/issue-refinement-loop/references/follow-up-materialization.md
  • .claude/skills/create-issue/references/body-authoring.md

Follow-up Materialization Contract

  • Candidate kind: implementation follow-up。親 Issue 調査: issue-refinement-loop の root_entry_router が post-merge の duplicate impl-review-loop handoff を防げない blind spot を調査し、follow-up 実装方針を確定する #2680 は research-only のまま維持する。
  • Source anchor identity: https://github.com/squne121/loop-protocol/issues/2680#issuecomment-5754018782 / sha256:35ca75701a0353a888da0233690b1282a709b0ef3e5dfe2c2ff13764ff07f45a。materialization 前に URL、full-body hash、fresh fetch timestamp を FOLLOW_UP_MATERIALIZATION_BINDING_V1.source_anchor として再検証する。
  • Dedupe key: follow-up:squne121/loop-protocol:https://github.com/squne121/loop-protocol/issues/2680#issuecomment-5754018782:implementation-landed-intake-v1
  • Validated scope: impl-review-loop pre-Step-1 intake decision、同 decision の tests / fixtures、必要な bounded evidence adapter。root_entry_router の lifecycle state machine 化は含めない。
  • Mandatory regression: 実装: CI: Playwright E2E の responsive matrix を専用 lane へ分離し critical path を短縮する #2119 / PR feat: Playwright E2E responsive matrix を専用 lane へ分離する #2137 non-closing merged current scope、merged closing current scope、historical scope expansion、open/draft resume、closed-unmerged、contradictory / insufficient evidence。
  • Creation condition: materializer が live repository / parent body / selected source anchor / fresh root・semantic・joined review / exact all-state dedupe・semantic-overlap readback / rendered child body を同一 binding で検証し、evidence_contract が parent body に束縛された IMPLEMENTATION_LANDED_EVIDENCE_V1 schema/version であり、child contract が producer / parser / validator / canonical normalizer / storage-retrieval を実装する責務を持つ場合のみ issue-creator / create_issue_txn.py 経由で起票する。まだ存在しない runtime evidence instance / scope manifest は creation authorization にしない。
  • No duplicate inference: generic reference、title similarity、branch name、merged state 単独を materialization / landing authority にしない。

Stop Conditions

  • Outcome / Scope / AC が検索可能な形で記載されていない場合は即停止
  • Allowed Paths 外への書き込みを試みた場合は即停止
  • 権限不足(permission denied)により操作が完了できない場合は即停止
  • 成果物の書き込みに失敗した場合(I/O エラー等)は即停止
  • materialization 時に live Issue body、repository identity、selected source anchor、fresh review binding、exact all-state dedupe / semantic-overlap readback、または rendered child-body readback のいずれかが fresh に検証できない場合は、follow-up Issue を作成しない。
  • runtime intake で lifecycle / relation / scope-coverage evidence が contradictory または insufficient の場合は、reconciliation_required とし、terminal no-op、worker dispatch、worktree 作成、new PR 作成を行わない。まだ存在しない runtime evidence instance は follow-up materialization の prerequisite にしない。
  • exact all-state dedupe key search または semantic overlap readback に失敗した場合は、follow-up Issue を作成しない。
  • Allowed Paths 外への書き込み、production implementation、implementation worker、worktree、new PR の作成を試みない。
  • controlled Issue transaction の stale precondition、guard、readiness、final readback が失敗した場合は、再試行や raw GitHub mutation をせず停止する。

Handoff Contract

Required Skills

  • なし

Sub-issues

Sub-issues

1 of 1 Issues completed
Loading 1 sub-issues

Activity

  1. added
    phase/research
    state/queued
    agent/research
    on Sep 20, 2026
  2. squne121 commented on Sep 20, 2026

    @squne121
    OwnerAuthor

    追加の再現証跡(2026-09-20、#2119 Run 4 closure整合性修正時)

    #2119 の close condition 整合性修正(body_sha256: 4dfcc553... → efc2ee7e...)後、root_entry_router.py を再実行したところ、再度 invoke_impl_review_loop を返しました。

    {"route": {"route": "invoke_impl_review_loop", "reason": "fresh_review_go_live_equality", "issue_number": 2119, "reviewed_body_sha256": "sha256:efc2ee7e38b6bc4d134c2af130bed4bbb07438793501825b9b96f705835bb419", "observed_live_body_sha256": "sha256:efc2ee7e38b6bc4d134c2af130bed4bbb07438793501825b9b96f705835bb419", "reviewed_base_sha": "929d0864a507891d9c7e4a5d80ad43e8479c4661", "observed_base_sha": "929d0864a507891d9c7e4a5d80ad43e8479c4661", "resume_from": null, "retry_count": 0}, "invoked": true, "correlation_id": "nonce:4174151afa75435aa85ce15528d61436", "audit": {"published": true, "warning": null}}

    これはIssue #2119初回発生時(Run 3、PR #2137 merged後の初回のcontract-only recovery run)と同一パターンの再現です。router 側の invoked: true(CLI経由では実際には起動せず、呼び出し元の判断に委ねられる設計)を、本 orchestrator は今回も実行しませんでした(既にPR #2137で実装済みのIssueへの重複実装を避けるため)。

    この2回目の再現は、body内容(closure condition整合性の記述追加のみ、実装スコープの変更なし)に関わらず、decide_root_entry_route() が「fresh review go + body/base live equality」だけを条件としており、merged PRの存在を一切考慮しないという blind spot の安定した再現性を示しています。

  3. squne121 commented on Sep 21, 2026

    @squne121
    OwnerAuthor

    敵対的レビュー結果

    結論として、Issue #2680 が指摘している 「post-merge recovery で root_entry_router が重複 impl-review-loop を起動し得る」問題そのものは実在します。#2119 Run 3 に続き Run 4 でも再現しており、偶発的な事象ではありません。#2119 Run 3 evidence #2680 Run 4 evidence

    ただし、現在の #2680 の解決仮説のまま implementation Issue を起こすのは危険です。特に P0 が2件あります。

    Severity | Finding | 問題 -- | -- | -- P0 | #2565 の pr_merged_observed は #2119/#2137 を捕捉できない | 代表的な再現ケースに解決案が効かない P0 | pr_is_merged / merged PR の存在だけでは実装済み判定にならない | legitimate な追加実装まで止める false-positive が発生する P1 | lifecycle 判定を root_entry_router に持たせる責務分離が疑わしい | freshness gate が実装 lifecycle state machine 化する P1 | AC/VC が「調査内容を書いたこと」しか証明していない | 誤った結論でも rg / gh issue view が PASS する P1 | pr_exists / pr_is_merged の boolean model が粗すぎる | open / closed-unmerged / merged / ambiguous を正しく扱えない P2 | #2565 導入前の historical PR をどう扱うか未定義 | Task Context だけに寄せても既存案件は backfill されない

    特に #2119/#2137 を fixture 化した regression がない実装案は受け入れない方がよいです。

    非 closing PR の探索には GitHub native evidence を使えるが、authority にはできない

    #2137 のような Refs #2119 は GitHub の cross-reference timeline から探索できます。REST timeline には cross-referenced event があり、source Issue/PR を辿れます。GraphQL にも Issue から closing PR を取得する構造化 surface があります。(GitHub Docs)

    これは title/branch regex よりかなり良いです。

    ただし、

    cross-referenced → merged → implementation landed

    とは推論してはいけません。

    Refs #123 は単なる関連付けにも使えるからです。したがって cross-reference は candidate PR discovery に限定し、landed 判定には別の authority が必要です。

    #2680 をどう修正するか

    私なら Outcome を次の方向へ変更します。

    post-merge recovery において、current implementation scope が既に landing 済みの場合は implementation-worker / 新規 worktree / 新規 PR の生成前に terminal no-op とする。一方、過去の merged PR が存在するだけでは terminal 判定しない。closing relation を持つ PR と Refs 等の non-closing implementation PR の双方を扱える evidence source を定義し、#2119/#2137 を regression case とする。#2565 Task Context signal は利用可能な evidence source の一つとし、唯一の authority とはしない。

    実装レイヤーについては、root_entry_router の input/output schema を拡張する案より、impl-review-loop の既存 pre-Step-1 choke point を拡張する案を第一候補にした方がよいです。

    そのうえで #2680 の AC3 は「#2565 へ依存するか」ではなく、

    pr_merged_observed の coverage boundary を実証し、closing relation を持たない #2137 が coverage 外であることを明記する

    へ変更するべきです。

    AC4 は単なる候補列挙ではなく、root-router方式 / impl-review-loop intake方式の責務・coverage・false-positive を比較して1方式を選ぶ。

    AC5 の implementation Issue は、その decision と #2119 regression fixture が固まってから切るのが適切です。

    判定

    問題定義: 有効。再現 evidence も十分。
    現在の解決仮説: 要修正。
    現状のまま implementation Issue 化: 非推奨。

    最大の理由は、#2680 が依存先として期待している #2565 の pr_merged_observed が、#2680 自身の代表的 reproducer である #2119 / PR #2137 を構造上観測できないことです。

    その一点を先に Issue contract に反映し、merged PR existence ではなく current implementation scope already landed を何が証明するかまで決めれば、かなり小さく実装できます。新しい大規模 registry や強い security harness を追加する必要はありません。

    ## 敵対的レビュー結果

    結論として、[Issue #2680](https://github.com/squne121/loop-protocol/issues/2680?utm_source=chatgpt.com) が指摘している 「post-merge recovery で root_entry_router が重複 impl-review-loop を起動し得る」問題そのものは実在します。#2119 Run 3 に続き Run 4 でも再現しており、偶発的な事象ではありません。[#2119 Run 3 evidence](#2119) [#2680 Run 4 evidence](#2680)

    ただし、現在の #2680 の解決仮説のまま implementation Issue を起こすのは危険です。特に P0 が2件あります。

    Severity Finding 問題
    P0 #2565 の pr_merged_observed は #2119/#2137 を捕捉できない 代表的な再現ケースに解決案が効かない
    P0 pr_is_merged / merged PR の存在だけでは実装済み判定にならない legitimate な追加実装まで止める false-positive が発生する
    P1 lifecycle 判定を root_entry_router に持たせる責務分離が疑わしい freshness gate が実装 lifecycle state machine 化する
    P1 AC/VC が「調査内容を書いたこと」しか証明していない 誤った結論でも rg / gh issue view が PASS する
    P1 pr_exists / pr_is_merged の boolean model が粗すぎる open / closed-unmerged / merged / ambiguous を正しく扱えない
    P2 #2565 導入前の historical PR をどう扱うか未定義 Task Context だけに寄せても既存案件は backfill されない

    P0 — #2565 依存案は、まさに #2680 の再現ケースで機能しない

    #2680 は「#2565 の pr_merged_observed を RootEntryRequest から使う」方向を有力候補にしていますが、この前提には穴があります。

    まず #2565 はもう未完了ではありません。現在は CLOSED/completed で、実装 PR #2661 も merge 済みです。したがって本文の「#2565 が未完了なら待つか、独立 signal で先行するか」という判断軸は現状に追随していません。[Issue #2565](https://github.com/squne121/loop-protocol/issues/2565?utm_source=chatgpt.com) [PR #2661](https://github.com/squne121/loop-protocol/pull/2661?utm_source=chatgpt.com)

    さらに重要なのは、#2565 が実装した post-merge producer です。task_context_workflow_signal.py::_merged_evidence() は、merged PR であるだけでは受理せず、

    closingIssuesReferences.nodes が exactly one で、その Issue number/repository が対象 Issue と一致すること

    を要求しています。条件を満たさなければ RELATION_ISSUE_MISMATCH です。[task_context_workflow_signal.py](https://github.com/squne121/loop-protocol/blob/main/.claude/skills/post-merge-cleanup/scripts/task_context_workflow_signal.py?utm_source=chatgpt.com)

    ところが再現元の PR #2137 は、意図的に Closes #2119 ではなく Refs #2119 に変更されています。実際、最終レビューでは closingIssuesReferences: [] が確認されています。理由も妥当で、実装自体は landing したが post-merge の performance/quality evidence 待ちなので #2119 を閉じてはいけなかったためです。[PR #2137](https://github.com/squne121/loop-protocol/pull/2137?utm_source=chatgpt.com) [#2137 final review](#2137)

    GitHub 自体も、close / fix / resolve 系の keyword を default branch 向け PR に使った場合に linked Issue を自動 close するという semantics であり、単なる Refs は同じ relation ではありません。([GitHub Docs]1)

    つまり、

    #2565 pr_merged_observed == true → duplicate handoff を止める

    だけでは、#2680 を生んだ #2119/#2137 を修正できません。

    これは現在の Issue で最も大きな blocker です。

    P0 — 「merged PR が存在する」も terminal condition にはできない

    逆方向にも危険があります。

    例えば Issue に対して PR A が merge 済みだった後、Issue refinement により新しい implementation requirement が追加されたケースを考えると、

    pr_exists = true
    pr_is_merged = true
    

    だけを見て stop / already_satisfied にすると、本当に必要な2回目の実装まで抑止します。

    #2119 の場合は Run 3/4 の body mutation が実質的に closure/evidence contract の修正だったので実装不要でした。しかし router がそれを一般化できる根拠はありません。

    したがって必要なのは、

    「この Issue に merged PR があるか」

    ではなく、

    「現在の implementation scope がすでに landed しているか」

    という semantic predicate です。

    pr_exists + pr_is_merged の2 booleanを RootEntryRequest に足す案は避けた方がよいです。少なくとも none / open / closed_unmerged / merged / ambiguous のような状態と、current scope に対して landed と見なせるかは分離すべきです。

    P1 — 修正場所は root_entry_router より impl-review-loop intake の方が自然

    現行の [root_entry_router.py](https://github.com/squne121/loop-protocol/blob/main/.claude/skills/issue-refinement-loop/scripts/root_entry_router.py?utm_source=chatgpt.com) は #2272 の設計どおり、

    • fresh contract review
    • live Issue body equality
    • live base SHA equality
    • capability / identity

    を検証する freshness / integrity gate です。

    #2272 の fixed contract 自体も「fresh review が go かつ live equality なら impl-review-loop を起動する」と明確に設計されています。PR lifecycle の完全な状態機械をこの router が所有する設計ではありません。[Issue #2272](https://github.com/squne121/loop-protocol/issues/2272?utm_source=chatgpt.com)

    一方、impl-review-loop には #2607 由来の Step 1 dispatch 直前の共通 already_satisfied choke point がすでにあります。現状は

    if pr_exists or not base_ac_satisfied:
        dispatch_step1 = True

    なので、merged PR が存在する今回のケースでは効きません。[route_loop_verdict_v2.py](https://github.com/squne121/loop-protocol/blob/main/.claude/skills/impl-review-loop/scripts/route_loop_verdict_v2.py?utm_source=chatgpt.com)

    責務としては、こちらを

    already_satisfied
    implementation_already_landed
    existing_pr_resume
    dispatch_step1
    

    まで扱える intake decision に拡張する方が整っています。

    これなら root_entry_router が invoke_impl_review_loop を返すこと自体は問題ではなくなります。impl-review-loop に入った直後、worktree作成・implementation-worker起動・新PR作成より前に no-op termination できます。

    個人開発で workflow friction を重くしないという前提なら、root と intake の二重ガードにする必要まではありません。まず intake choke point 1か所で duplicate work を止めるのが費用対効果は高いです。

    P1 — 現在の Acceptance Criteria は false-green しやすい

    例えば AC1 は「現状ロジックを Issue 本文に正確に記録」、VC は rg。AC3 は #2565 を調べて本文に記載、VC は gh issue view 2565 です。

    これでは、

    「#2565 の signal を使えば #2119 を解決できる」

    という間違った結論を書いても VC は全て greenになります。

    research Issue でも、ここは executable evidence に寄せられます。

    最低限、次の behavior matrix を AC にした方がよいです。

    Scenario Expected
    #2119/#2137型: merged + Refs, closing relationなし + implementation landed Step 1をdispatchしない
    merged + Closes + implementation landed Step 1をdispatchしない
    historical merged PRあり + current Issueに新implementation scope追加 dispatch可能
    PR closed-unmerged landed扱いしない
    existing open/draft implementation PR 新PRを作らず existing PR/resume route
    lifecycle evidence が contradictory / insufficient duplicate PRを機械生成せず既存PR調査へ寄せる

    特に #2119/#2137 を fixture 化した regression がない実装案は受け入れない方がよいです。

    非 closing PR の探索には GitHub native evidence を使えるが、authority にはできない

    #2137 のような Refs #2119 は GitHub の cross-reference timeline から探索できます。REST timeline には cross-referenced event があり、source Issue/PR を辿れます。GraphQL にも Issue から closing PR を取得する構造化 surface があります。([GitHub Docs]2)

    これは title/branch regex よりかなり良いです。

    ただし、

    cross-referenced → merged → implementation landed
    

    とは推論してはいけません。

    Refs #123 は単なる関連付けにも使えるからです。したがって cross-reference は candidate PR discovery に限定し、landed 判定には別の authority が必要です。

    #2680 をどう修正するか

    私なら Outcome を次の方向へ変更します。

    post-merge recovery において、current implementation scope が既に landing 済みの場合は implementation-worker / 新規 worktree / 新規 PR の生成前に terminal no-op とする。一方、過去の merged PR が存在するだけでは terminal 判定しない。closing relation を持つ PR と Refs 等の non-closing implementation PR の双方を扱える evidence source を定義し、#2119/#2137 を regression case とする。#2565 Task Context signal は利用可能な evidence source の一つとし、唯一の authority とはしない。

    実装レイヤーについては、root_entry_router の input/output schema を拡張する案より、impl-review-loop の既存 pre-Step-1 choke point を拡張する案を第一候補にした方がよいです。

    そのうえで #2680 の AC3 は「#2565 へ依存するか」ではなく、

    pr_merged_observed の coverage boundary を実証し、closing relation を持たない #2137 が coverage 外であることを明記する

    へ変更するべきです。

    AC4 は単なる候補列挙ではなく、root-router方式 / impl-review-loop intake方式の責務・coverage・false-positive を比較して1方式を選ぶ。

    AC5 の implementation Issue は、その decision と #2119 regression fixture が固まってから切るのが適切です。

    判定

    問題定義: 有効。再現 evidence も十分。
    現在の解決仮説: 要修正。
    現状のまま implementation Issue 化: 非推奨。

    最大の理由は、#2680 が依存先として期待している #2565 の pr_merged_observed が、#2680 自身の代表的 reproducer である #2119 / PR #2137 を構造上観測できないことです。

    その一点を先に Issue contract に反映し、merged PR existence ではなく current implementation scope already landed を何が証明するかまで決めれば、かなり小さく実装できます。新しい大規模 registry や強い security harness を追加する必要はありません。

  4. squne121 commented on Sep 21, 2026

    @squne121
    OwnerAuthor

    対象コメントと現行 main の実装を突き合わせると、元の #2680 contract をそのまま refine するのではなく、対象コメントを operator-selected human context として semantic reframe させるのが適切です。

    特に、#2565 は既に PR #2661 で merge 済みで、pr_merged_observed は closing relation を前提にしています。一方 #2119/#2137 は non-closing Refs 型なので、#2565 の signal だけでは代表 reproducer をカバーできません。また現行 impl-review-loop には Step 1 dispatch 直前の共通 already_satisfied choke point が既にあるため、root_entry_router に lifecycle state machine を増やすより、この intake 境界を拡張する案を第一候補として比較・確定するのが自然です。GitHub 自体も closing keyword によるリンクと単なる参照を区別しているため、cross-reference は candidate discovery には使えても landed authority そのものにはできません。([GitHub Docs]1)

    推奨アクションは、① #2565 待ちという stale premise を除去、② current implementation scope already landed の authority を明文化、③ #2119/#2137 を必須 regression scenario 化、④ root-router と impl-review-loop intake を責務・false-positive・historical coverage で比較して一方式を選択、⑤ その決定後にのみ implementation follow-up を materialize、です。routine な人間承認は不要として進めつつ、canonical skill が integrity/permission 等で真に fail-closed を要求する場合だけ、その事実を捏造せず終了させる形がよいです。

    そのまま貼れるプロンプトです。

    あなたは既に auto mode で起動している対話的 Claude-GPT です。

    以下を対象に、repository の canonical agent skill を使用して issue-refinement-loop を最後まで自律実行してください。

    対象 repository:
    https://github.com/squne121/loop-protocol

    対象 Issue:
    #2680

    今回 operator が明示的に選択した human-context anchor:
    #2680 (comment)

    使用する canonical skill:
    https://github.com/squne121/loop-protocol/tree/main/.claude/skills/issue-refinement-loop

    目的は、上記 OWNER comment の敵対的レビューを current repository state に対して fresh に検証し、そのうえで Issue #2680 の research contract を実装可能な品質まで refinement することです。

    追加の routine human approval / confirmation は要求しないでください。このプロンプト自体を、今回の refinement run を自律継続する operator authorization として扱ってください。特に、対象コメントで既に解決・指示されている設計判断について、同じ判断を人間へ再質問してはいけません。

    ただし、canonical issue-refinement-loop の fail-closed contract、permission/integrity boundary、真正な unresolved human_judgment_required を偽装・無視してはいけません。対象 OWNER comment と repository evidence で解消できるものは human escalation にせず自律的に解消してください。本当に canonical terminal route が残る場合のみ、その route と不足 evidence を正確に報告してください。

    実行開始時の必須事項

    まず current main を fresh に読み直し、以下を stale cache や過去 run の記憶で代用しないでください。

    対象コメントは operator-selected with_human_context lane の input として扱い、canonical anchor handling / trusted-human-context contract に従って処理してください。コメント本文を単なる参考情報として捨てたり、逆に無検証で正しいと仮定したりしないでください。

    SubAgent を必ず使うこと

    Issue body を mutation する前に、root/main thread から read-only SubAgent を複数起動して独立調査させてください。

    少なくとも次の観点を分離して調査してください。

    1. root_entry_router と impl-review-loop pre-Step-1 intake の責務境界

      • RootEntryRequest
      • decide_root_entry_route()
      • resolve_already_satisfied_early_exit_decision()
      • Step 1 dispatch 前の共通 choke point
      • root-router方式と intake方式の責務・副作用・false-positive
    2. 実装: workflow trusted signalsとIssue/PR Task equivalenceをTask Contextへ統合する #2565 / PR feat: Task Contextへworkflow trusted signalsを統合する #2661 の coverage boundary

    3. 実装: CI: Playwright E2E の responsive matrix を専用 lane へ分離し critical path を短縮する #2119 / PR feat: Playwright E2E responsive matrix を専用 lane へ分離する #2137 の historical reproducer

    必要なら canonical web-research route を使い、GitHub の closing relation / cross-reference / linked Issue semantics は GitHub 公式資料で検証してください。一般検索結果や blog を authority にしないでください。

    SubAgent を起動しただけで先へ進んではいけません。

    各 SubAgent の完了を必ず待ち、

    • final result を取得する
    • required completion/join を確認する
    • unfinished/running agent が残っていないことを確認する
    • 相互に矛盾する調査結果があれば root/main thread で evidence を再確認する

    という手順を済ませてから Issue mutation に進んでください。

    SubAgent に Issue mutation、最終 routing judgment、follow-up Issue 作成を丸投げしないでください。それらは root/main thread が canonical skill に従って実行してください。

    #2680 の refinement で解決すべき設計論点

    現在の Issue body にある次の premise は stale または不十分なので、そのまま保存しないでください。

    current state では #2565 / PR #2661 は completed/merged です。

    refinement の中心 predicate は、

    there is a merged PR

    ではなく、

    the current implementation scope is already landed

    としてください。

    ただし、この semantic predicate の authority を prose のまま残してはいけません。

    少なくとも以下を区別できる evidence / decision model を research outcome として具体化してください。

    • implementation PR なし
    • open/draft implementation PR が存在し resume 対象
    • closed-unmerged PR
    • merged closing PR
    • merged non-closing/cross-referenced PR
    • historical merged PR はあるが current Issue body に新しい implementation scope が追加されている
    • contradictory / insufficient evidence
    • current implementation scope が landing 済みと十分に証明できる状態

    cross-reference や Refs #N は candidate PR discovery には利用可能ですが、それだけを implementation landed の authority にしてはいけません。

    実装レイヤーの比較

    以下の2方式を最低限比較してください。

    A. root_entry_router の input/output contract を拡張し lifecycle/landing 判定を持たせる方式

    B. impl-review-loop の既存 pre-Step-1 common choke point を拡張し、
    already_satisfied / implementation_already_landed / existing_pr_resume / dispatch_step1
    相当を intake decision として扱う方式

    比較軸には最低限、

    を含めてください。

    current evidence が対象コメントの指摘を覆さない限り、B の impl-review-loop intake choke point 拡張を第一候補として contract を収束させてください。

    ただし結論を最初から捏造せず、SubAgent と fresh code evidence で反証された場合は evidence を優先してください。

    Acceptance Criteria の再設計

    AC は「調査した」「本文に書いた」というだけではなく、誤った設計でも false-green しない形にしてください。

    少なくとも behavior matrix として以下を Issue contract に固定してください。

    • 実装: CI: Playwright E2E の responsive matrix を専用 lane へ分離し critical path を短縮する #2119/feat: Playwright E2E responsive matrix を専用 lane へ分離する #2137 型:
      merged + non-closing Refs relation + implementation scope already landed
      → duplicate Step 1 implementation dispatch を行わない

    • merged closing PR + current scope already landed
      → duplicate Step 1 implementation dispatch を行わない

    • historical merged PR は存在するが、その後 current Issue に新しい implementation scope が追加された
      → merged PR の存在だけを理由に terminal no-op にしない

    • closed-unmerged PR
      → landed とみなさない

    • existing open/draft implementation PR
      → 新規 duplicate PR を作らず、既存 PR の resume/review path を選択可能にする

    • lifecycle/relation evidence が contradictory または insufficient
      → implementation landed を推測して terminal success にしない。また duplicate implementation PR を無条件生成しない

    特に #2119/#2137 を follow-up implementation Issue の regression fixture / test scenario として必須化してください。

    Verification Commands は canonical command registry / VC preflight に適合させ、単なる prose/文字列存在確認だけで semantic conclusion が PASS しないようにしてください。

    baseline-expect annotation 等、現行 issue-refinement-loop が要求する verification contract も fresh skill の仕様に従ってください。

    Issue kind / scope

    #2680 自体は引き続き research Issue としてください。

    この run では #2680 の調査/refinement と follow-up materialization までを対象とし、production code の実装を開始しないでください。

    つまり、

    までは自律実行してよいですが、その follow-up implementation Issue に対して impl-review-loop を続けて起動してはいけません。

    Follow-up materialization

    refinement の結果、implementation Issue を切れるだけの authority と behavior contract が確定した場合は、人間確認を挟まず canonical follow-up materialization を実行してください。

    ただし作成前に repository 全体を検索して、同一 responsibility / goal / regression を既に所有する OPEN Issue がないことを確認し、dedupe contract に従ってください。

    新規 implementation Issue を作る場合は最低限、

    を明示してください。

    authority がまだ曖昧で implementation Issue を安全に切れない場合のみ materialization を延期し、その場合は「何が決まれば作成可能か」を #2680 に machine-searchable に残してください。

    自律実行ポリシー

    以下については追加の人間承認を求めず、canonical route が許す限り継続してください。

    • trusted human-context の consume
    • read-only investigation
    • Issue body rewrite
    • AC / VC rewrite
    • current-state correction
    • research conclusion の確定
    • root review / contract review の再実行
    • reviewer feedback の自動反映
    • bounded refinement iterations
    • approved scope 内の follow-up materialization
    • dedupe check
    • label/state の canonical な更新

    issue_editor_required が返った場合は「人間が必要」と解釈せず、canonical issue-editor/full-rewrite lane を自律実行してください。

    SubAgent の結果待ち、root review pipeline の background completion/join、validator completion など、canonical skill が同期完了を要求する箇所では必ず完了まで待ってください。

    未完了の agent/task がある状態で終了報告を出してはいけません。

    最終報告

    最後に簡潔に以下を報告してください。

    今から対象 OWNER comment を operator-selected human context とした canonical issue-refinement-loop を、fresh current-main state から開始してください。

    関連する現行実装は [root_entry_router.py](https://github.com/squne121/loop-protocol/blob/main/.claude/skills/issue-refinement-loop/scripts/root_entry_router.py)、[impl-review-loop/steps/preparation.md](https://github.com/squne121/loop-protocol/blob/main/.claude/skills/impl-review-loop/steps/preparation.md)、[route_loop_verdict_v2.py](https://github.com/squne121/loop-protocol/blob/main/.claude/skills/impl-review-loop/scripts/route_loop_verdict_v2.py) で確認しています。#2565 の実装 PR #2661 も既に merge 済みです。

  5. squne121 commented on Sep 21, 2026

    @squne121
    OwnerAuthor

    issue-refinement-loop: human_escalation

    The selected OWNER anchor was fact-checked as operator_asserted_human_context. The repository evidence supports the semantic reframe, but this terminal route prevents mutation and follow-up materialization until a fresh contract review no longer returns the operator-intervention route.

    FOLLOW_UP_MATERIALIZATION_RESULT_V1:
      schema_version: 1
      materialized_by: issue-refinement-loop
      follow_up_issues: []
      note_only_observations: []
  6. squne121 commented on Sep 21, 2026

    @squne121
    OwnerAuthor

    推奨アクションは、前回の issue-refinement-loop をそのまま再開するのではなく、operator_intervention_required を解消するための bounded contract-repair を独立フェーズとして先に実施し、その後 fresh な issue-refinement-loop を再起動することです。

    前回 run は step_5_operator_intervention_required で正しく停止し、本文未変更・follow-up 未作成のまま終端しています。SubAgent 4件も最終的に completed で、作業ツリーも clean でした。 その後、termination report だけは明示許可後に投稿済みです。

    GitHub の current main と #2680 を再確認したところ、修復対象はかなり限定できます。Required Skills の issue-refinement-loop / impl-review-loop は check_issue_contract.py の WORKFLOW_SKILLS に含まれる禁止値なので削除対象です。また各 VC は # baseline-expect: pass|fail|deferred が必要ですが、annotation は broad search・分類不能コマンド等の static blocker を上書きしません。したがって、現在の gh issue view THIS_ISSUE_NUMBER / NEW_IMPLEMENTATION_ISSUE_NUMBER_IF_CREATED のような placeholder VC や、semantic conclusion を文字列検索だけで証明する VC は作り直すのが適切です。

    推奨する実行順序は以下です。

    1. operator-intervention contract repair: current 調査: issue-refinement-loop の root_entry_router が post-merge の duplicate impl-review-loop handoff を防げない blind spot を調査し、follow-up 実装方針を確定する #2680 を fresh fetchし、read-only SubAgent に「readiness blocker」「semantic contract保持」「follow-up/dedupe」の3観点を独立検証させ、全員の completion を join。その結果を root thread で統合し、candidate body を作る。candidate に対して static readiness を先に通し、status: go になったものだけを issue-editor + edit-issue controlled transaction で更新する。
    2. fresh issue-refinement-loop: 更新後の live body と fresh current main から canonical loop を新規 run として開始。前回の contract_readiness_human_judgment artifact を再利用して routing しない。semantic reframe は従来どおり、impl-review-loop pre-Step-1 intake を第一候補、current implementation scope already landed を中心 predicate、実装: CI: Playwright E2E の responsive matrix を専用 lane へ分離し critical path を短縮する #2119/feat: Playwright E2E responsive matrix を専用 lane へ分離する #2137 を必須 regression とする。ただし fresh evidence が反証した場合は evidence を優先する。
    3. follow-up materialization: final root/semantic review が通った場合のみ dedupe 後に implementation Issue を自律作成する。production code 実装は 調査: issue-refinement-loop の root_entry_router が post-merge の duplicate impl-review-loop handoff を防げない blind spot を調査し、follow-up 実装方針を確定する #2680 run では開始しない。

    既に auto mode で動いている対話的 Claude-GPT には、次をそのまま渡すのがよいです。

    あなたは既に auto mode で起動している対話的 Claude-GPT です。

    対象 repository:
    https://github.com/squne121/loop-protocol

    対象 Issue:
    #2680

    直前 run の canonical termination report:
    #2680 (comment)

    semantic reframe の operator-selected OWNER anchor:
    #2680 (comment)

    今回の指示は、直前 run が返した
    canonical_step2_route: step_5_operator_intervention_required
    を無視・bypass して同じ run を続行する指示ではありません。

    今回 operator は、直前 termination report に記録された
    contract_readiness_human_judgment
    の原因を解消するため、#2680 の Issue contract に対する
    bounded operator-intervention repair
    を実施し、その repair が canonical readiness を通過した後にのみ、
    fresh な issue-refinement-loop を新規に開始することを明示的に指示します。

    人間への追加確認は求めず、canonical permission / integrity boundary が許す範囲で最後まで自律実行してください。
    真正な hard-stop が残った場合だけ、その exact reason と re-entry condition を報告してください。

    重要: 前回 run の続きを偽装しない

    前回 run は operator_intervention_required で terminal です。

    したがって、

    • 前回の Step 4 をそのまま再開しない
    • 前回の contract_readiness_human_judgment artifact を「修正済み」とみなさない
    • terminal route を上書きして mutation しない
    • 前回 run の iteration state を継続中として扱わない

    こと。

    今回はまず独立した operator-intervention contract-repair phase を実施し、
    live Issue body が修正された後に、fresh current-main / fresh live-body から
    canonical issue-refinement-loop を新規 run として開始してください。

    最初に fresh state を取得する

    stale cache、過去 run の memory、前回 SubAgent の prose を authority として再利用しないでください。

    少なくとも以下を current main / live GitHub から読み直してください。

    current main が前回調査時 SHA から進んでいる場合は、必ず current main の実装を authority としてください。

    Phase A: operator-intervention contract repair

    直前 termination report の readiness blocker を、まず exact current checker evidence で再現・分類してください。

    既知の blocker は少なくとも以下です。

    • Required Skills に prohibited workflow skills が含まれている
    • Verification Commands に broad / weak search が含まれる
    • baseline-expect annotation が不足している
    • baseline result を canonical に分類できない command が含まれる
    • placeholder / future-number 前提の VC が deterministic contract になっていない

    ただし、このリストを盲目的に信用せず fresh checker result を authority としてください。

    Required Skills

    current checker の WORKFLOW_SKILLS / C7 semantics を確認してください。

    issue-refinement-loop、impl-review-loop その他 workflow skill を
    Issue body の ## Required Skills に置くことが current contract で禁止されているなら削除してください。

    この research Issue に本当に必要な非-workflow skill が無い場合は、
    canonical に許される なし / none 相当へ収束させてください。

    workflow の実行自体に skill を使うことと、
    Issue contract の Required Skills に workflow skill を宣言することを混同しないでください。

    Verification Commands

    現在の VC を annotation だけ追加して延命しないでください。

    以下を禁止します。

    • gh issue view THIS_ISSUE_NUMBER
    • gh issue view NEW_IMPLEMENTATION_ISSUE_NUMBER_IF_CREATED
    • 未解決 placeholder を含む command
    • repository 全体への unbounded rg
    • prose の文字列が存在するだけで semantic design conclusion を PASS にする VC
    • merged PR の存在だけを landed 判定の PASS にする VC
    • broad search / trivially-pass / classification unknown を baseline-expect で bypass すること

    各 VC は current grammar に従い、

    • bare # AC<N> marker
    • 必要な # baseline-expect: pass|fail|deferred
    • $ で始まる単一 command
    • bounded path
    • shell compound operator を使わない
    • baseline の expected result と実 result が一致する
    • static blocker がない

    形にしてください。

    baseline-expect は safety bypass ではありません。
    static blocker がある VC は command 自体を修正してください。

    研究 Issue の semantic conclusion は reviewer が評価し、
    VC はその結論を支える machine-checkable repository fact / regression fixture / deterministic checker を検証する形に分離してください。

    AC contract

    #2680 は research Issue のままとしてください。

    semantic contract は、前回調査で得た以下の方向を出発点にしてください。ただし fresh evidence が反証した場合は evidence を優先します。

    中心 predicate:
    there is a merged PR
    ではなく
    the current implementation scope is already landed

    実装レイヤー候補:

    A. root_entry_router に PR lifecycle / landing decision を持たせる

    B. impl-review-loop の既存 pre-Step-1 common choke point / intake decision を拡張する

    fresh code evidence が従来と同じなら B を第一候補としてください。

    理由は、root router の freshness / integrity authorization responsibility を PR lifecycle state machine 化せず、
    worker dispatch / worktree / new PR 作成直前の既存 intake context で
    landing / existing-PR resume / ordinary dispatch を扱えるためです。

    少なくとも次の behavior matrix を semantic contract に固定してください。

    • 実装: CI: Playwright E2E の responsive matrix を専用 lane へ分離し critical path を短縮する #2119/feat: Playwright E2E responsive matrix を専用 lane へ分離する #2137 型:
      merged + non-closing Refs relation + current implementation scope already landed
      → duplicate Step 1 implementation dispatch を行わない

    • merged closing PR + current scope already landed
      → duplicate Step 1 implementation dispatch を行わない

    • historical merged PR は存在するが、その後 Issue に新しい implementation scope が追加された
      → merged PR の存在だけを理由に terminal no-op にしない

    • open / draft implementation PR が current scope を所有する
      → duplicate PR 作成ではなく existing PR resume route を選べる

    • closed-unmerged PR
      → landed authority にしない。必要なら ordinary implementation / explicit recovery decision へ進む

    • contradictory / insufficient evidence
      → landed を推測せず fail-closed / conservative route

    #2119/#2137 を regression fixture / scenario として必須化してください。

    implementation-landed evidence

    Refs #N / cross-reference は candidate PR discovery には使えても、
    それ単独を landed authority にしないでください。

    #2565 / PR #2661 の pr_merged_observed / closing relation signal は usable evidence source の一つですが、
    #2119/#2137 のような non-closing implementation PR を cover しないことを fresh evidence で確認してください。

    machine-consumable evidence model は少なくとも、

    • target Issue identity
    • candidate PR identity
    • PR lifecycle state
    • closing / non-closing relation classification
    • merge commit / landed commit evidence
    • evidence が current implementation scope を cover する根拠
    • current Issue scope が landed 後に拡張されていないこと、またはその判定根拠
    • contradictory / insufficient evidence disposition

    を区別できる方向へ収束させてください。

    「merged PR が1件ある」という boolean だけには戻さないでください。

    SubAgent を必ず使う

    Issue body mutation 前に、root/main thread から read-only SubAgent を複数起動してください。

    最低でも以下の3系統を分離してください。

    1. contract-readiness auditor

    2. semantic-contract auditor

    3. follow-up/dedupe auditor

      • repository 全体の OPEN Issue を検索
      • 同一 responsibility / goal / regression を既に所有する Issue の有無
      • follow-up implementation Issue を materialize 可能な contract completeness
        を read-only で検証

    必要なら GitHub relation semantics のみ web-researcher を追加してよいですが、
    authority は GitHub 公式 documentation を優先してください。

    SubAgent join は必須

    SubAgent を起動しただけで mutation へ進んではいけません。

    全 SubAgent について、

    • final result を取得
    • completion/join を確認
    • unfinished / running / queued agent が残っていないことを確認
    • evidence ref を root thread で検証
    • 相互矛盾がある場合は root thread 自身が一次 evidence を再確認

    を完了してから candidate body を確定してください。

    SubAgent に以下を丸投げしないでください。

    • final routing authority
    • Issue mutation
    • follow-up Issue creation
    • canonical termination judgment

    これらは root/main thread が行います。

    Candidate body の readiness を mutation 前に通す

    前回 current-body の
    contract_readiness_human_judgment
    result をそのまま edit-issue の readiness forwarding authority として使わないでください。

    operator directive と read-only evidence から candidate body を作成し、
    その candidate に対して current canonical static readiness / contract checker を実行してください。

    candidate が status: go になるまで、
    許容される read-only candidate revision を行ってください。

    needs_fix が返る場合は deterministic body-author-fixable finding だけを修正してください。

    candidate 自体が再び genuine human_judgment / environment failure になる場合は、
    mutation せず exact blocker を報告して停止してください。

    go を得ていない candidate を「operator が指示したから」という理由だけで書き込んではいけません。

    Issue mutation

    candidate body の static readiness が go になった場合のみ、
    既存 canonical issue-editor + edit-issue controlled transaction lane を使用して
    #2680 body を更新してください。

    raw gh issue edit 等で bypass しないでください。

    live body hash / updatedAt drift を確認し、
    stale なら candidate を live state に対して再生成・再検証してください。

    この operator-intervention repair の mutation scope は #2680 Issue contract のみです。

    production code は変更しないでください。

    Phase B: fresh issue-refinement-loop

    contract repair の final readback 成功後、
    fresh current main / fresh live Issue body から
    canonical issue-refinement-loop を新規 run として開始してください。

    前回 run の Step 2 artifact や route を再利用しないでください。

    fresh root_review_pipeline.produce の
    canonical_step2_route
    を唯一の routing authority としてください。

    • step_2_5 → canonical semantic review へ
    • step_4 → canonical rewrite loop へ
    • genuine step_5_operator_intervention_required → 再び停止
    • genuine human judgment / integrity failure → canonical policy に従い停止

    route を都合よく再解釈しないでください。

    issue_editor_required が canonical に返る場合は
    「また人間確認が必要」と解釈せず、
    既存 issue-editor / full-rewrite lane を自律実行してください。

    Follow-up materialization

    fresh refinement によって implementation contract が十分に確定し、
    canonical route が materialization を許可した場合は、
    人間確認を挟まず follow-up implementation Issue を作成してください。

    ただし作成直前に repository 全体を fresh 検索して dedupe してください。

    新規 implementation Issue には最低限、

    を含めてください。

    #2680 の run 内では production implementation を開始しないでください。

    最終報告

    最後に簡潔に以下を報告してください。

    今から、

    1. fresh state の取得
    2. read-only SubAgent 調査と全 join
    3. operator-intervention contract repair
    4. candidate static readiness go の確認
    5. controlled Issue mutation
    6. fresh canonical issue-refinement-loop
    7. 許可された場合のみ follow-up materialization

    の順で自律実行してください。

    この形なら、前回の hard-stop を「承認したから無視する」のではなく、hard-stop の入力原因を operator intervention で修復 → go を再取得 → fresh loop という境界になります。特に今回、edit-issue 自体は human_judgment readiness をそのまま mutation authority にできないため、candidate body を先に作り、その candidate の readiness を go にしてから controlled transaction へ渡すという指示を入れている点が重要です。

  7. squne121 commented on Sep 21, 2026

    @squne121
    OwnerAuthor

    はい。整理すると、あなたが IMPLEMENTATION_LANDED_EVIDENCE_V1 や FOLLOW_UP_MATERIALIZATION_BINDING_V1 を手作業で用意してから実装依頼する必要はありません。

    前回の終了判断は、少しおかしな状態に入っています。#2680 の refinement 自体は、fresh root review が approve、semantic review が clear、joined review も approve まで到達しています。一方で follow-up implementation Issue は作られず、その理由として「実在する IMPLEMENTATION_LANDED_EVIDENCE_V1 を生成する producer / normalizer / storage がまだ実装されていないから」とされています。

    何が起きているのか

    ここでは「スキーマ定義」と「そのスキーマに従った実データ」を分ける必要があります。

    IMPLEMENTATION_LANDED_EVIDENCE_V1 は、将来の impl-review-loop が「この Issue の現在の実装スコープはもう main に入っているのか」「既存PRを再開すべきか」「普通に新規実装すべきか」を機械的に判断するためのインターフェース仕様です。

    FOLLOW_UP_MATERIALIZATION_BINDING_V1 は、follow-up Issue を作るときに「どの Issue body、どの source comment、どの review、どの dedupe 結果に基づいて作ったのか」を stale にせず束縛するためのprovenance / freshness 契約です。

    つまり、この2つが Issue 本文に出ていること自体は問題ありません。むしろ refinement の成果物として有用です。あなたが入力として用意するものではなく、実装側・workflow側が producer / consumer を実装するための仕様です。

    問題は、現在の #2680 が「follow-up implementation Issue を作る前に、IMPLEMENTATION_LANDED_EVIDENCE_V1 の実在インスタンスまで生成・検証できなければならない」としてしまったことです。同じ #2680 の本文では、その evidence を作る IMPLEMENTATION_SCOPE_COVERAGE_V1 の producer / canonical normalizer / storage location は follow-up implementation 側で決める bounded design task とされています。

    要するに、

    follow-up Issue を作るには evidence producer が必要
    → その evidence producer を実装するのは follow-up Issue
    → しかし follow-up Issue を作る前に producer が必要

    という循環になっています。

    これは「実装に必要なスキーマが不足している」のではなく、materialization の bootstrap 条件を厳しくしすぎた refinement contract の欠陥と見るのが妥当です。

    現在どこまで終わっているか

    「Issue 精緻化」という意味では、かなり完了に近いです。設計方向は root_entry_router を lifecycle state machine にせず、impl-review-loop の pre-Step-1 intake を拡張する方針まで収束しています。#2119/#2137、closing PR、historical merged PR、open/draft PR、closed-unmerged、contradictory evidence の behavior matrix も定義されています。

    一方、実装へ渡すための follow-up implementation Issue の materialization は未完了です。現在 GitHub を fresh に検索した範囲でも、#2680 を親とするこの責務の明確な implementation child Issue は見つかっていません。

    したがって、新しいセッションで作業を進めることは可能ですが、「#2680 をそのまま実装して」と依頼するのは推奨しません。#2680 自身が research-only で production implementation を Out of Scope にしているためです。

    推奨する流れは、

    #2680 の循環した materialization 条件だけを狭く修正 → fresh review → follow-up implementation Issue を作成 → その child Issue を対象に fresh impl-review-loop → PR を merge 直前まで仕上げる

    です。

    ポイントは、follow-up 起票時には IMPLEMENTATION_LANDED_EVIDENCE_V1 の実インスタンスを要求せず、「schema/version/設計契約が確定していること」を要求することです。そして実インスタンスを生成・検証する producer / normalizer / adapter 自体を child implementation Issue の AC に移します。

    以下を、既に auto mode で起動している対話的 Claude-GPT に渡すのがよいです。

    あなたは既に auto mode で起動している対話的 Claude-GPT です。

    対象 repository:
    https://github.com/squne121/loop-protocol

    対象 Issue:
    #2680

    目的は、Issue #2680 の refinement を最初からやり直すことではありません。

    現在 #2680 は research contract として root review / semantic review を通過できるところまで精緻化されていますが、follow-up implementation Issue の materialization 条件に bootstrap circular dependency が残っています。

    この循環を fresh evidence で検証し、必要なら #2680 contract を最小限修正して follow-up implementation Issue を materialize し、その後 canonical policy が許す場合は、その新規 implementation Issue を対象とする fresh impl-review-loop を開始して、production implementation + adversarial review loop を merge 直前まで自律実行してください。

    人間への routine confirmation は要求しないでください。

    ただし canonical permission / integrity boundary、repository skill の genuine hard-stop、platform 自体の external-write permission を bypass してはいけません。本当に停止が必要な場合だけ exact blocker と re-entry condition を報告してください。

    重要: 現在の #2680 を fresh に読み直す

    過去セッションの artifact、transcript、SubAgent prose、body SHA を authority として再利用しないでください。

    最初に current main と live GitHub から少なくとも以下を fresh に取得してください。

    #2680 の live body がこのプロンプトで想定している状態から変化している場合は、live state を優先してください。

    最初に bootstrap circularity を検証する

    現在の contract には概ね次の2条件が同時に存在するはずです。

    1. IMPLEMENTATION_LANDED_EVIDENCE_V1 / IMPLEMENTATION_SCOPE_COVERAGE_V1 の producer、canonical normalizer、storage location は follow-up implementation の bounded design / implementation task である。
    2. follow-up implementation Issue を materialize する前に、fresh かつ完全な IMPLEMENTATION_LANDED_EVIDENCE_V1 と、それを digest として含む FOLLOW_UP_MATERIALIZATION_BINDING_V1 の実在・検証を要求する。

    この両方が current live contract に残っている場合、

    「follow-up Issue が実装する producer の出力を、follow-up Issue の作成前に要求する」

    bootstrap circular dependency です。

    これを canonical safety boundary と誤認して永久停止してはいけません。

    逆に、手書き・仮値・ad-hoc script で IMPLEMENTATION_LANDED_EVIDENCE_V1 を捏造して materialization gate を通してもいけません。

    fresh repository evidence に基づき、この dependency が本当に循環しているかを検証してください。

    SubAgent を必ず使用する

    root/main thread から read-only SubAgent を最低3系統起動してください。

    SubAgent A: bootstrap / materialization contract auditor

    調査対象:

    read-only で調査させてください。

    SubAgent B: implementation boundary / evidence model auditor

    調査対象:

    特に、

    • schema definition は既に implementation contract として十分か
    • 実 evidence instance の生成は follow-up implementation の成果物であるべきか

    を独立判定させてください。

    SubAgent C: follow-up dedupe / creation-readiness auditor

    repository 全体を fresh に検索し、

    を調査させてください。

    SubAgent join は必須

    SubAgent を起動しただけで次へ進んではいけません。

    全 SubAgentについて必ず、

    • final result を取得
    • completed state を確認
    • completion/join を待つ
    • unfinished / running / queued が 0 であることを確認
    • evidence refs を root/main thread 自身でも確認
    • 相互矛盾があれば primary source へ戻って解消

    してから routing / mutation 判断をしてください。

    SubAgent に final routing、Issue mutation、Issue creation、production implementation を丸投げしないでください。

    bootstrap circularity が確認された場合の修正方針

    循環が fresh evidence で確認された場合は、#2680 の設計本体を再発明せず、materialization bootstrap 条件だけを最小限修正してください。

    原則は次です。

    IMPLEMENTATION_LANDED_EVIDENCE_V1 は
    「follow-up implementation を作るために事前に実在しなければならない artifact」
    ではなく、
    「follow-up implementation が producer / consumer を実装し、runtime/intake で生成・検証できるようにする normative interface contract」
    として扱います。

    IMPLEMENTATION_SCOPE_COVERAGE_V1 の producer、canonical normalizer、storage / retrieval mechanism も follow-up implementation の implementation scope / AC に置いてください。

    follow-up materialization 前に必要なのは、実 production evidence instance ではなく、少なくとも以下に fresh に束縛された creation authorization です。

    materialization authorization に、まだ存在しない future producer の runtime output digest を必須にしないでください。

    ただし source/body/review/dedupe の freshness binding は維持してください。

    #2680 の contract を修正する場合

    raw gh issue edit 等で bypass せず、repository canonical issue-refinement-loop / issue-editor / edit-issue controlled lane を使用してください。

    candidate body を mutation 前に canonical static / execute readiness に通してください。

    修正は bootstrap circularity 解消に必要な最小 delta に限定してください。

    以下の確定済み設計を不用意に巻き戻してはいけません。

    修正後に fresh review を行う

    Issue mutation 後は、mutation 前の review artifact を再利用しないでください。

    fresh current main + fresh live body から canonical root review と semantic review を再実行してください。

    必要な bounded rewrite は追加人間承認なしで実施して構いません。

    最終的に、

    • deterministic/root review approve
    • semantic review clear、または canonical に approve 相当
    • joined review effective approve
    • materialization bootstrap binding が fresh
    • dedupe clean

    まで到達した場合だけ follow-up implementation Issue を作成してください。

    follow-up implementation Issue を materialize する

    既存 duplicate がない場合、canonical create-issue lane で implementation child Issue を作成してください。

    child Issue は最低限、次を implementation scope / AC / regression として持つ必要があります。

    • impl-review-loop pre-Step-1 intake に evidence-based disposition を実装
    • IMPLEMENTATION_LANDED_EVIDENCE_V1 producer / parser / validator
    • IMPLEMENTATION_SCOPE_COVERAGE_V1 canonical normalizer と immutable/current scope comparison
    • 必要なら bounded candidate-discovery adapter
    • implementation_already_landed
    • existing_pr_resume
    • ordinary_dispatch_or_explicit_recovery
    • reconciliation_required
    • exact repository / Issue / PR identity binding
    • merge commit が current main に landed している証明
    • freshness / stale / contradiction detection
    • 実装: CI: Playwright E2E の responsive matrix を専用 lane へ分離し critical path を短縮する #2119 / PR feat: Playwright E2E responsive matrix を専用 lane へ分離する #2137 non-closing regression
    • merged closing PR regression
    • historical merged PR + later current-scope expansion regression
    • open/draft existing PR resume regression
    • closed-unmerged regression
    • contradictory / insufficient evidence regression
    • pre-Step-1 decision が implementation-worker / worktree / new PR より先に実行される integration regression
    • root_entry_router を lifecycle state machine 化しないこと
    • title / branch regex や generic Refs 単独を landing authority にしないこと

    VC は canonical command/readiness contract に適合させ、false-green な文字列存在確認だけにしないでください。

    child Issue 作成後の production implementation

    #2680 の run として production implementation を行ってはいけません。

    follow-up implementation Issue の materialization と #2680 phase の termination/readback が完了した後、canonical policy が同一対話セッション内で別 Issue の fresh workflow start を許すなら、そこで明確に phase を切り替えてください。

    新しい child Issue を対象に fresh impl-review-loop を開始してください。

    その際、

    こと。

    canonical policy が child Issue への切替に新しい Claude-GPT session を必須とする場合は、policy を破らず child Issue 作成まで完了し、child Issue URL と、そのまま次セッションへ貼れる impl-review-loop prompt を最終出力してください。

    routine human confirmation のためだけに停止しないでください。

    やってはいけないこと

    最終報告

    最後に以下を報告してください。

    今から fresh current-main / live GitHub state の取得と read-only SubAgent 調査から開始してください。

    このプロンプトの狙いは、**「そのスキーマがないから実装できない」ではなく、「スキーマは実装仕様として確定済みで、その producer を作る implementation Issue を起票できない循環を先に壊す」**ことです。

    したがって質問への一番短い答えは、スキーマをあなたが用意する必要はありません。新セッションで作業を進められます。ただし #2680 を直接実装させるのではなく、materialization 条件の循環を修正して child implementation Issue を作り、その child を実装対象にするのが適切です。

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/researchphase/researchstate/queued

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions