Repository navigation
Description
Machine-Readable Contract
contract_schema_version: v1
issue_kind: implementation
parent_issue: "#2680"
goal_ref: "current implementation scope already landed を evidence-based に判定し、duplicate impl-review-loop dispatch を pre-Step-1 intake で防ぐ"
change_kind: workflow
dedupe_key: "follow-up:squne121/loop-protocol:https://github.com/squne121/loop-protocol/issues/2680#issuecomment-5754018782:implementation-landed-intake-v1"
parent_contract_body_sha256: "sha256:83de3dfdb529d670ed734bc1073a8d2683713b009ce301713612ec6528c51756"Parent Issue
Parent Goal Ref
- Goal: post-merge recovery で current implementation scope が既に landed している場合に duplicate impl-review-loop dispatch を防ぐ。
- Desired Destination: root_entry_router の freshness / integrity 境界を維持しつつ、impl-review-loop pre-Step-1 intake が evidence-based disposition を実行できる状態。
Current Validated Scope
impl-review-looppre-Step-1 intake 用のIMPLEMENTATION_LANDED_EVIDENCE_V1producer / parser / validator を実装する。IMPLEMENTATION_SCOPE_COVERAGE_V1の canonical normalizer、immutable merged snapshot と live current scope の comparison、freshness / identity / contradiction 検出を実装する。IMPLEMENTATION_SCOPE_COVERAGE_V1を production で実際に生成・永続化する durable snapshot producer をopen-prskill の PR 作成経路に追加する(読み取り側だけの実装にしない)。- closing relation と verified cross-reference を候補 discovery input として扱い、root_entry_router を lifecycle state machine 化せずに intake disposition を dispatch 前に適用する。
- 既存 実装: impl-review-loop に already_satisfied terminal route を追加する #2607
already_satisfiedearly-exit を壊さない形で新 disposition と合成する。 - unit / integration / runtime verification で 実装: CI: Playwright E2E の responsive matrix を専用 lane へ分離し critical path を短縮する #2119 / PR feat: Playwright E2E responsive matrix を専用 lane へ分離する #2137 と全 required lifecycle disposition を回帰保護する。
Remaining Parent Gaps
- 調査: issue-refinement-loop の root_entry_router が post-merge の duplicate impl-review-loop handoff を防げない blind spot を調査し、follow-up 実装方針を確定する #2680 は research-only の設計・materialization provenance contract を維持する。
- merge 後の follow-up cleanup は本 Issue の Out of Scope とする。
Outcome
impl-review-loop が worker dispatch、worktree 作成、new PR 作成より前に、identity・candidate provenance・lifecycle・main ancestry・scope coverage・freshness から導出した landing disposition を適用し、current scope が landed 済みの duplicate work を開始しない。IMPLEMENTATION_SCOPE_COVERAGE_V1 は PR 作成時点で production 上に durable に記録され、intake 側はそれを read-only で参照するだけであり、producer 不在のまま retrieval だけを実装しない。
Scope Collision Note
- Fresh overlap preflight は親 調査: issue-refinement-loop の root_entry_router が post-merge の duplicate impl-review-loop handoff を防げない blind spot を調査し、follow-up 実装方針を確定する #2680 だけを related parent collision として返した。親は research-only で production implementation、worktree、implementation worker、new PR を開始しないため、本 Issue が producer / parser / validator / canonical normalizer / storage retrieval の唯一の実装 owner になる。
- 重複する Allowed Paths は parent の調査・契約更新対象であり、親の未着手 research scope を実装として再開するものではない。child creation 後は 調査: issue-refinement-loop の root_entry_router が post-merge の duplicate impl-review-loop handoff を防げない blind spot を調査し、follow-up 実装方針を確定する #2680 ではなく本 Issue の fresh
impl-review-loopが実装を所有する。 - 本 Issue の Allowed Paths は、read-only investigation(squne121/loop-protocol commit
a6b9fd6409aa8969e89c91a471e1380200862961時点の.claude/skills/open-pr/scripts/open_pr.pyのcreate_pr()/main()が PR body 組み立てと生成の唯一の canonical publication point であることを確認済み)に基づき、.claude/skills/open-pr/scripts/open_pr.py、.claude/skills/open-pr/tests/test_implementation_scope_snapshot_producer.py、.claude/skills/impl-review-loop/SKILL.mdを追加する。この拡張は OWNER の direct human-context directive(anchor comment 実装: impl-review-loop intakeにevidence-based landing dispositionを実装する #2699 (comment) 、および本 refinement を実行した interactive prompt)を、read-only investigation が導出した exact repository-relative path で具体化したものであり、新しい lifecycle registry・署名・attestation framework は追加しない。
敵対的レビュー由来の設計修正(OWNER anchor comment 反映)
以下は OWNER の敵対的レビュー(issue-refinement-loop による fresh re-investigation で妥当性を再検証済み)を反映した設計修正であり、旧版 Issue 本文にあった未解決の P0/P1/P2 findings を解消する。
Durable Scope Snapshot: Producer / Consumer 責務分離(P0-1 対応)
- Producer(新規、
open-prskill 所有):.claude/skills/open-pr/scripts/open_pr.pyの PR 作成経路(main()/create_pr()の呼び出し前)で、対象 Issue の現在の body を fetch し、下記「Canonical Implementation Scope Normalizer」で定義する manifest を構築し、schema_version固定の canonical serialization で digest を計算し、以下のIMPLEMENTATION_SCOPE_COVERAGE_V1block を PR body に埋め込んでから PR を作成する。新しい registry・署名・attestation framework は追加しない。IMPLEMENTATION_SCOPE_COVERAGE_V1: schema_version: IMPLEMENTATION_SCOPE_COVERAGE_V1 issue_number: <int> issue_body_sha256: <sha256> # PR 作成時点の live issue body の sha256 normalized_scope_manifest_sha256: <sha256> # scope_manifest の canonical bytes の sha256 pr_head_sha: <sha> # PR 作成時点のブランチ HEAD。audit-only metadata(下記「pr_head_sha の用途」参照)。disposition 判定のいずれの分岐にも consume されない scope_manifest: <object> # 下記 normalizer が生成する manifest そのもの(inline 埋め込み。historical body の再取得を不要にする)
pr_head_shaの用途: 監査証跡(audit trail)専用のフィールドであり、disposition 導出ロジック(Disposition Precedence / Legacy Compatibility Policy / Freshness rebind のいずれも)はこの値を read しない。Freshness rebind(下記)が参照する候補 PR の head sha は、常に決定直前の live fetch 値であり、この埋め込み値ではない。AC1 はこのフィールドの埋め込み自体(audit trail としての存在)のみを要求し、それを消費する disposition ロジックの存在は要求しない。 - Consumer(既存 Allowed Paths、
impl-review-loop所有):implementation_landed_evidence.pyが qualified candidate PR の body/comment からIMPLEMENTATION_SCOPE_COVERAGE_V1block を parse する。block が存在しない場合(legacy PR、下記「Legacy Compatibility Policy」参照)は current body から merge-time scope を推測せず、covered_exactlyを導出不能として扱う。block が存在する場合、normalized_scope_manifest_sha256を再計算してscope_manifestの改竄有無を検証し、現在の live Issue body に対して同じ normalizer を再適用した manifest とscope_manifest(PR 作成時点の immutable snapshot)を比較する。
Legacy Compatibility Policy(P0-1 派生、markerless open/draft candidate の扱いを含む)
- merged candidate:
IMPLEMENTATION_SCOPE_COVERAGE_V1block を持たない merged 候補 PR(例: 現行 feat: Playwright E2E responsive matrix を専用 lane へ分離する #2137)は、current body から merge-time scope を推測しない。implementation_already_landedを導出せず、下記「Disposition Precedence」に従いalready_satisfiedearly-exit(現在の main が独立に AC を満たす場合)またはordinary_dispatch_or_explicit_recovery/reconciliation_requiredにフォールバックする。 - open/draft candidate(marker 付き):
IMPLEMENTATION_SCOPE_COVERAGE_V1marker が存在する場合、merged candidate と同じ digest 比較(covered_exactlyか否か)で current-scope ownership を判定する。covered_exactlyならexisting_pr_resume、そうでなければ(marker 記録後に Issue 側でスコープが拡張された等)reconciliation_requiredとする。 - open/draft candidate(markerless、rollout 初期を含む): merged candidate とは異なり、marker が無くても
existing_pr_resumeへ到達できる。open/draft candidate は「immutable な過去の PR 作成時点」ではなく「現在も変更可能な進行中の branch」であるため、marker が存在しない場合に限り、決定時点で以下の Allowed Paths ファイルカバレッジ check を current-scope ownership の代替判定として行う(marker が存在する候補には本 check を適用しない): 候補 PR の変更ファイル一覧(gh pr view <n> --json filesのpath集合、各要素をPとする)を取得し、現在の Issue## Allowed Pathsの各エントリEについて、P == EまたはPがE + "/"から始まる(path-segment 境界を尊重した prefix 一致。単純な文字列 prefix 一致は使わず、.claude/skills/impl-review-loopが.claude/skills/impl-review-loopX/foo.pyに誤マッチしないようにする)変更ファイルが 1 件以上存在するかを確認する。すべての Allowed Paths エントリがこの条件を満たせば current-scope ownership ありと判定しexisting_pr_resumeとする。1 件でも満たさない Allowed Paths エントリがあれば(= PR 作成以降に Issue 側でスコープが拡張され、PR がまだそれに追従していない可能性がある)、existing_pr_resumeとはせずreconciliation_requiredとする(duplicate work を避けるため、盲目的にordinary_dispatch_or_explicit_recoveryへは倒さない)。 - この compatibility policy(merged/open/draft 双方)は AC9(下記、narrowed runtime verification)で live 実装: CI: Playwright E2E の responsive matrix を専用 lane へ分離し critical path を短縮する #2119/feat: Playwright E2E responsive matrix を専用 lane へ分離する #2137 に対して直接検証する。
Disposition Precedence(P0-2 対応、既存 #2607 との合成)
新しい enum を追加せず、既存 route_loop_verdict_v2.py::resolve_already_satisfied_early_exit_decision()(#2607 / PR #2626)をそのまま再利用し、以下の優先順位で choke point を構成する(impl-review-loop/steps/preparation.md の pre-Step-1 choke point を更新)。
- evidence invalid / contradictory / stale / identity mismatch →
reconciliation_required(marker が存在するが malformed、schema/identity/digest が invalid、または decision-time freshness が証明できない場合を含み、candidate lifecycle が open/draft/merged のいずれであってもこの判定を優先する) - qualified candidate が landing authority を提供できない場合(discovery 自体が候補ゼロの no-qualified-candidate、または全候補が identity/relation qualification 基準で非該当、または closed-unmerged のように qualified ではあるが本質的に landing authority を持ち得ない候補しか存在しない場合のいずれか)AND 既存
resolve_already_satisfied_early_exit_decision()がbase_ac_satisfied=trueを返す → 既存already_satisfiedearly-exit をそのまま適用する(新 disposition が上書きしない。closed-unmerged 候補の存在は already_satisfied フォールバックを妨げない) - merged qualified candidate AND
merge_commit_oidの current-main ancestry 検証済み ANDIMPLEMENTATION_SCOPE_COVERAGE_V1durable marker による exact coverage(covered_exactly) →implementation_already_landed - verified open/draft qualified candidate AND current-scope ownership(marker 付きなら
covered_exactly、markerless なら上記「Legacy Compatibility Policy」の Allowed Paths カバレッジ check で判定) →existing_pr_resume
4b. markerless open/draft qualified candidate だが Allowed Paths カバレッジ不足(current-scope ownership なし) →reconciliation_required(ordinary_dispatch_or_explicit_recoveryではない。上記「Legacy Compatibility Policy」参照)
4c. marker 付き open/draft qualified candidate だがcovered_exactlyでない場合(marker 記録後に Issue 側でスコープが拡張された等) →reconciliation_required(ordinary_dispatch_or_explicit_recoveryではない。上記「Legacy Compatibility Policy」の open/draft candidate(marker 付き)節、およびderive_landing_disposition()の open/draft branch 末尾 fallback(reason_codes:open_draft_scope_ownership_not_exact)と一致させる) - 上記のいずれにも該当しない(closed-unmerged かつ base 未充足、no-candidate かつ base 未充足、later scope expansion、merged qualified candidate で marker 自体は valid だが PR merge 後の Issue スコープ拡張により
covered_exactlyでない場合(legacy_or_later_scope_expansion)、merged legacy marker 欠落など) →ordinary_dispatch_or_explicit_recovery
no-qualified-candidate → ordinary_dispatch_or_explicit_recovery を無条件の既定にせず、必ず手順 2 の already_satisfied early-exit 判定を先に評価することで、#2607 の duplicate suppression を保持する。
Canonical Implementation Scope Normalizer(P1 対応)
manifest に含めるフィールド(semantic fields、implementation scope を構成するもの):
goal_ref/change_kind(Machine-Readable Contract より)- implementation-owned
## In Scopeの箇条書き項目(テキストのみ、チェックボックス状態は除外) ## Acceptance Criteriaの項目テキスト(チェックボックスの[ ]/[x]状態は除外し、AC 文言のみを対象にする)## Allowed Pathsの項目一覧
manifest から除外するフィールド(operational prose、進捗状態):
## Remaining Parent Gapsの現在値、進捗を示す prose- checkbox の checked/unchecked 状態そのもの
- runtime evidence、closure-only quality gate の status(例:
Quality Decision Record.Status) - delegated follow-up の進捗記述
各 semantic field のリスト要素(## In Scope / ## Acceptance Criteria / ## Allowed Paths の各箇条書き)は、記載順序を意味論的に非依存として扱う。canonical serialization の前段で各リストを要素テキストの昇順(Python の sorted() の既定 lexicographic order)にソートしてから manifest に格納する。これにより、内容を変えずに箇条書きの記載順序だけを入れ替える編集では digest が変化しない。
canonical serialization: 上記ソート済みリストを含む schema_version 付き dict を json.dumps(manifest, sort_keys=True, separators=(",", ":"), ensure_ascii=False) で UTF-8 encode し sha256 を取る。RFC 8785/JCS のような外部依存は追加しない。producer(open-pr)と consumer(impl-review-loop)は同一の normalizer 実装を参照する(implementation_landed_evidence.py に定義し、open_pr.py から sys.path 経由で import する。既存の finalize_no_diff_issue.py 等が使う cross-skill import pattern を踏襲し、新しい共有パッケージは作らない)。
Multi-Candidate Resolution(P1 対応)
candidate discovery は以下の順序で行う。
- bounded discovery:
gh pr list --state all --json number,closingIssuesReferencesに加えて、対象 Issue の GitHub timeline からcross-referencedイベントを収集する(下記「Cross-Reference Parsing Semantics」参照)。 - dedupe:
(repo, pr_number)の組で重複除去する。 - classify: 各候補を
relation(closing / verified_non_closing)、lifecycle(merged / open / draft / closed_unmerged)、identity(source.issue.pull_requestの有無で PR であることを確認済みか)で分類する。 - qualified candidate resolution: 分類後の候補のうち disposition 導出に使える候補(closing relation を優先し、無ければ verified non-closing)が 1 件なら評価に進む。2 件以上が競合し一意に解決できない場合は
reconciliation_requiredとする。
Cross-Reference Parsing Semantics(P2 対応)
- GitHub timeline
cross-referencedイベントのsource.typeは PR でも常に"issue"である。PR かどうかはsource.issue.pull_requestフィールドの存在で判別する。 - closing relation は
gh pr view <n> --json closingIssuesReferences(対象 Issue 番号を含むか)で判定する。Closes/Fixes/Resolves系キーワードのみが GitHub 公式の auto-close linkage であり、Refsはこれに含めない。 - generic
Refs文言、title 文字列一致、branch 名の正規表現一致、単なるmergedstate のみでは landing authority としない(#2565 pr_merged_observed単独も同様)。
Freshness / Decision-Time Rebind(P1 対応)
- disposition 確定の直前に、
issue body sha256/ 候補 PR のhead sha(open/draft の場合)またはmerge_commit_oid(merged の場合)/ current mainHEAD shaを再取得する。 - collection 開始時に記録した値と不一致な場合、bounded に 1 回だけ discovery + evaluation をやり直す。再試行後も不一致なら
reconciliation_required(reason: freshness_rebind_failed)とする。 - 単純な
observed_atTTL のみを authority にしない。
Runtime Verification Applicability
decision: immediate
reason: pre-Step-1 intake は GitHub read transport と live Issue / PR evidence を消費するため、fixture-only test で代替できない read-only runtime verification が本 Issue 内で成立する。AC12 は discovery / identity / relation / main ancestry / legacy compatibility policy(durable marker 欠落時の non-landed 判定)という live で検証可能な transport claim に限定し、covered_exactly を伴う production E2E(producer が生成した durable marker を消費する scope coverage → disposition の判定)は、durable manifest producer を実際に通した fixture / test path(AC10)で証明する。AC12 単独で「scope coverage 判定が live で正しく動く」ことまでは主張しない。
applicable_acs: [AC12]
execution_environment: authenticated `gh` CLI で public `squne121/loop-protocol` の read-only Issue / PR metadata を取得できる worktree。
skip_conditions: 認証、ネットワーク、または GitHub read transport が利用不能な場合、runtime verifier は `SKIP:` を先頭に出力して exit 77 とし、Stop Condition を発火する。
fallback_policy: fixture / cached result / title・branch regex のみで成功した結果、または fallback を含む結果は PASS としない。
artifact_requirements: `artifacts/runtime-verification-AC12-<timestamp>.log` に source URL、body / commit digest、command、output、PASS / FAIL / SKIP を保存する。In Scope
.claude/skills/impl-review-loop/scripts/implementation_landed_evidence.pyを追加し、IMPLEMENTATION_LANDED_EVIDENCE_V1の strict parser / validator、IMPLEMENTATION_SCOPE_COVERAGE_V1の canonical normalizer(producer/consumer 共有)、disposition derivation を実装する。.claude/skills/open-pr/scripts/open_pr.pyに、PR 作成時にIMPLEMENTATION_SCOPE_COVERAGE_V1durable marker を PR body へ埋め込む producer 呼び出しを追加する(implementation_landed_evidence.pyの normalizer を import して使う)。.claude/skills/impl-review-loop/scripts/build_intake_capsule.pyに、closing relation または verified cross-reference から得た candidate inputs と live identity / freshness を bounded に収集し、intake evidence を渡す接続を追加する。.claude/skills/impl-review-loop/scripts/route_loop_verdict_v2.pyとsteps/preparation.mdを更新し、pre-Step-1 common choke point が「Disposition Precedence」節の順序でalready_satisfied(既存 route 再利用)、implementation_already_landed、existing_pr_resume、ordinary_dispatch_or_explicit_recovery、reconciliation_requiredを evidence から導出してから data-plane に進むようにする。.claude/skills/impl-review-loop/SKILL.mdを更新し、新しい pre-Step-1 disposition と既存already_satisfieddurable contract の記述を整合させる。- 実装: CI: Playwright E2E の responsive matrix を専用 lane へ分離し critical path を短縮する #2119 / PR feat: Playwright E2E responsive matrix を専用 lane へ分離する #2137 non-closing candidate(legacy marker 欠落)、durable marker 付き merged closing candidate、scope expansion、open / draft resume、closed-unmerged、no candidate、stale / contradictory / insufficient evidence、多候補競合を fixture と regression test で実装する。
- runtime verifier を追加し、read-only live 実装: CI: Playwright E2E の responsive matrix を専用 lane へ分離し critical path を短縮する #2119 / PR feat: Playwright E2E responsive matrix を専用 lane へ分離する #2137 metadata で provenance / main ancestry / legacy compatibility policy / fallback rejection を記録する。
Out of Scope
.claude/skills/issue-refinement-loop/scripts/root_entry_router.pyの lifecycle state machine 化または input schema への lifecycle field 追加。- generic
Refs、title、branch name、cross-reference、merged state、または#2565 pr_merged_observed単独を landing authority にすること。 #2565の strict closing-relation producer の重複実装。#2119、#2137、#2565、#2661の Issue / PR mutation。- new lifecycle registry、write-capable GitHub API、Issue / PR 自動 close、merge。
- RFC 8785 / JCS 等の外部 canonicalization 依存の追加。
open-prskill の PR body validator(validate_pr_body.py等)の日本語比率・hygiene チェック仕様の変更。producer は既存 validator を通る body を生成するだけで、validator 自体は変更しない。
Acceptance Criteria
- AC1:
open_pr.pyの PR 作成経路が、PR 作成時点の live Issue body から canonical normalizer でscope_manifestを構築し、IMPLEMENTATION_SCOPE_COVERAGE_V1(issue_number/issue_body_sha256/normalized_scope_manifest_sha256/pr_head_sha/scope_manifest)を PR body に埋め込んでから PR を作成する。 - AC2: canonical normalizer が「Canonical Implementation Scope Normalizer」節の semantic fields のみを manifest に含め、operational prose / checkbox 状態 / runtime evidence / delegated follow-up 進捗を除外し、それらのみが変化しても digest が不変であること、および各リストの記載順序だけを入れ替えても digest が不変であること(順序非依存のソート正規化)を検証する。
- AC3:
IMPLEMENTATION_LANDED_EVIDENCE_V1producer / parser / validator が target repository / Issue / body、candidate provenance / relation / lifecycle、merge OID / current-main ancestry、state-specific coverage、freshness を検証し、不足・型不正・identity mismatch・stale を landed に補完推論しない。 - AC4: disposition が「Disposition Precedence」節の順序(reconciliation → 既存 already_satisfied 再利用 → implementation_already_landed → existing_pr_resume → 4b reconciliation → ordinary_dispatch_or_explicit_recovery)で導出され、no-qualified-candidate かつ既存
base_ac_satisfied=trueのケース、および closed-unmerged candidate のみが存在しbase_ac_satisfied=trueであるケースの両方で 実装: impl-review-loop に already_satisfied terminal route を追加する #2607 の early-exit が維持されることを確認する。 - AC5:
IMPLEMENTATION_SCOPE_COVERAGE_V1durable marker を持たない legacy merged 候補 PR(マーカー欠落)がimplementation_already_landedを導出せず、現在の body から merge-time scope を推測しないことを確認する。 - AC6: markerless open/draft candidate に対して、候補 PR の変更ファイル一覧が現在の
## Allowed Paths全エントリをカバーする場合にexisting_pr_resumeになり、1 件でもカバーしない Allowed Paths エントリがある場合にreconciliation_required(ordinary_dispatch_or_explicit_recoveryではない)になることを確認する。 - AC7: candidate discovery が bounded discovery →
(repo, pr_number)dedupe → relation/lifecycle/identity classification → qualified candidate resolution を実装し、2 件以上の qualified candidate が競合する場合にreconciliation_requiredになることを確認する。 - AC8: candidate discovery が exact closing relation(
closingIssuesReferences)またはsource.issue.pull_requestで判別した verified cross-reference の provenance を記録し、genericRefs、title / branch regex、merged state、#2565 pr_merged_observedのいずれも単独では landing authority にしないことを確認する。 - AC9: disposition 確定直前に issue body sha256 / candidate head-or-merge-oid / current main sha を再取得し、collection 開始時の値と不一致な場合に bounded 1 回の再評価を行い、再試行後も不一致なら
reconciliation_required(reason: freshness_rebind_failed)になることを確認する。 - AC10: 実装: CI: Playwright E2E の responsive matrix を専用 lane へ分離し critical path を短縮する #2119 / PR feat: Playwright E2E responsive matrix を専用 lane へ分離する #2137 の legacy(marker 欠落)候補が
implementation_already_landedにならないこと、同値の durable marker 付き merged closing fixture はimplementation_already_landedになること、scope expansion / open / draft(marker 付き・markerless 双方)/ closed-unmerged / no candidate / contradictory / insufficient evidence の各 fixture が対応する disposition を固定することを回帰保護する。 - AC11: integration regression が disposition を worker dispatch、worktree creation、new PR creation より先に適用し、
implementation_already_landedとreconciliation_requiredと既存already_satisfiedでは三つの data-plane operation を開始せず、existing_pr_resumeでは duplicate PR を開始しないことを確認する。root_entry_routerの lifecycle-free boundary も回帰保護する。 - AC12: read-only runtime verifier が live 実装: CI: Playwright E2E の responsive matrix を専用 lane へ分離し critical path を短縮する #2119 / PR feat: Playwright E2E responsive matrix を専用 lane へ分離する #2137 に対して source identity、non-closing relation、merge commit の current-main ancestry、および legacy compatibility policy(durable marker 欠落時に
implementation_already_landedを導出しないこと)を取得し、fixture / fallback を PASS に縮退せず runtime verification artifact を出力する。 - AC13: targeted regression、
pnpm typecheck、pnpm lint、pnpm test、pnpm build、model-routing test が PASS し、Allowed Paths 外を変更しない。
Verification Commands
# AC1
# baseline-expect: fail
$ uv run --locked pytest .claude/skills/open-pr/tests/test_implementation_scope_snapshot_producer.py::test_open_pr_embeds_implementation_scope_coverage_marker -q
# AC2
# baseline-expect: fail
$ uv run --locked pytest .claude/skills/impl-review-loop/tests/test_implementation_landed_evidence.py::test_scope_normalizer_excludes_operational_prose_and_progress_state -q
# AC3
# baseline-expect: fail
$ uv run --locked pytest .claude/skills/impl-review-loop/tests/test_implementation_landed_evidence.py::test_validator_rejects_missing_stale_and_identity_mismatched_evidence -q
# AC4
# baseline-expect: fail
$ uv run --locked pytest .claude/skills/impl-review-loop/tests/test_implementation_landed_evidence.py::test_disposition_precedence_reuses_already_satisfied_before_landed_evidence -q
# AC5
# baseline-expect: fail
$ uv run --locked pytest .claude/skills/impl-review-loop/tests/test_implementation_landed_evidence.py::test_legacy_merged_candidate_without_durable_marker_never_yields_implementation_already_landed -q
# AC6
# baseline-expect: fail
$ uv run --locked pytest .claude/skills/impl-review-loop/tests/test_implementation_landed_evidence.py::test_markerless_open_draft_candidate_allowed_paths_coverage_determines_resume_or_reconciliation -q
# AC7
# baseline-expect: fail
$ uv run --locked pytest .claude/skills/impl-review-loop/tests/test_implementation_landed_evidence.py::test_candidate_discovery_dedupes_and_reconciles_conflicting_qualified_candidates -q
# AC8
# baseline-expect: fail
$ uv run --locked pytest .claude/skills/impl-review-loop/tests/test_implementation_landed_evidence.py::test_candidate_discovery_is_not_landing_authority -q
# AC9
# baseline-expect: fail
$ uv run --locked pytest .claude/skills/impl-review-loop/tests/test_implementation_landed_evidence.py::test_decision_time_freshness_rebind_and_bounded_retry -q
# AC10
# baseline-expect: fail
$ uv run --locked pytest .claude/skills/impl-review-loop/tests/test_implementation_landed_evidence.py::test_2119_2137_legacy_and_durable_marker_fixture_regressions -q
# AC11
# baseline-expect: fail
$ uv run --locked pytest .claude/skills/impl-review-loop/tests/test_implementation_landed_intake_integration.py::test_disposition_precedes_worker_worktree_and_new_pr -q
# AC12
# baseline-expect: fail
$ uv run --locked pytest .claude/skills/impl-review-loop/tests/test_implementation_landed_intake_integration.py::test_live_runtime_verifier_records_2119_2137_legacy_compatibility_without_fixture_fallback -q
# AC13
# baseline-expect: pass
$ pnpm typecheck
$ pnpm lint
$ pnpm test
$ pnpm build
$ uv run --locked pytest .claude/skills/gemini-cli-headless-delegation/tests/test_model_routing.py -qAllowed Paths
.claude/skills/impl-review-loop/scripts/implementation_landed_evidence.py.claude/skills/impl-review-loop/scripts/build_intake_capsule.py.claude/skills/impl-review-loop/scripts/route_loop_verdict_v2.py.claude/skills/impl-review-loop/scripts/verify_implementation_landed_intake_runtime.py.claude/skills/impl-review-loop/steps/preparation.md.claude/skills/impl-review-loop/SKILL.md.claude/skills/impl-review-loop/tests/test_implementation_landed_evidence.py.claude/skills/impl-review-loop/tests/test_implementation_landed_intake_integration.py.claude/skills/impl-review-loop/tests/test_already_satisfied_routing.py.claude/skills/impl-review-loop/tests/test_already_satisfied_early_exit_e2e_runtime_only.py.claude/skills/impl-review-loop/tests/test_build_intake_capsule.py.claude/skills/impl-review-loop/tests/test_preparation_entry_policy.py.claude/skills/open-pr/scripts/open_pr.py.claude/skills/open-pr/tests/test_implementation_scope_snapshot_producer.py.claude/skills/open-pr/scripts/tests/test_open_pr_validation_hook.py.claude/skills/open-pr/scripts/tests/test_open_pr_canonical_repo_regression.py.claude/skills/open-pr/scripts/tests/test_open_pr_overlap_removal.py
上記3件(test_open_pr_validation_hook.py / test_open_pr_canonical_repo_regression.py / test_open_pr_overlap_removal.py)は、open_pr.py の IMPLEMENTATION_SCOPE_COVERAGE_V1 marker 埋め込み変更(AC1)が要求する、既存テストへの mock-only 追加(get_linked_issue_body / resolve_head_sha)のための Scope Delta 拡張である。AC・VC の追加は行わない。
Stop Conditions
- Allowed Paths 外の変更が必要と判明した場合
- In Scope の固定契約(キー集合・スキーマ・型定義)の変更が必要になった場合
- 新規 Issue の起票が必要と判断した場合(スコープ分割が発生する場合)
- 後続 Phase / 別スコープへの波及が判明した場合
- nested SubAgent delegation が必要になった場合
- 外部サービス利用・権限昇格・既存テスト大規模改変が必要になった場合
- 動作検証 AC の VC が SKIP(exit 77)を返した場合(実行環境不可のためエスカレーション)
- fallback 経由でのみ「成功」する場合(FAIL として扱い、実行環境を確認)
open_pr.pyの producer 追加が既存 PR body validator(日本語比率・Safety Claim Matrix 等)を破壊すると判明した場合
Required Skills
- なし
Required Design References
docs/dev/workflow.mddocs/dev/runtime-verification-policy.md.claude/skills/impl-review-loop/SKILL.md.claude/skills/impl-review-loop/steps/preparation.md.claude/skills/issue-refinement-loop/scripts/root_entry_router.py.claude/skills/open-pr/SKILL.md.claude/skills/open-pr/scripts/open_pr.py.claude/skills/post-merge-cleanup/scripts/task_context_workflow_signal.pyhttps://github.com/squne121/loop-protocol/issues/2680https://github.com/squne121/loop-protocol/issues/2699#issuecomment-5755952589https://github.com/squne121/loop-protocol/issues/2607https://github.com/squne121/loop-protocol/pull/2626https://github.com/squne121/loop-protocol/issues/2119https://github.com/squne121/loop-protocol/pull/2137
Source
- origin_skill: issue-refinement-loop
- source_url: 調査: issue-refinement-loop の root_entry_router が post-merge の duplicate impl-review-loop handoff を防げない blind spot を調査し、follow-up 実装方針を確定する #2680 (comment)
- source_note_id: implementation-landed-intake-v1
- dedupe_key: follow-up:squne121/loop-protocol:調査: issue-refinement-loop の root_entry_router が post-merge の duplicate impl-review-loop handoff を防げない blind spot を調査し、follow-up 実装方針を確定する #2680 (comment)
- parent_body_sha256: sha256:83de3dfdb529d670ed734bc1073a8d2683713b009ce301713612ec6528c51756
Delivery Rule
1 Issue = 1 PR。canonical worktree を使用し、Draft PR を既定とする。merge は行わない。
Activity
squne121 commentedon Sep 21, 2026
結論
#2699 の問題設定と実装場所は妥当です。特に、
root_entry_routerを lifecycle state machine にせず、impl-review-loopの pre-Step-1 choke point で duplicate work を止める方針は、#2680 の調査結果と既存 #2607 の設計に整合しています。一方、現在の Issue contract のまま実装に入るのは要修正です。中心となる
IMPLEMENTATION_SCOPE_COVERAGE_V1の「merged 時点 snapshot」が production で生成できないことと、既存 #2607 のalready_satisfiedroute を AC4 が壊し得ることが大きいです。#2699 には現時点でコメントはなく、参照する実装 PR も確認できていないため、コード着手前に直す余地があります。敵対的レビュー findings
Severity | Finding | 影響 -- | -- | -- P0 | immutable merged snapshot の producer / 永続化地点が存在しない | AC2/AC3/AC6 が fixture だけ green になり、production では covered_exactly を導出不能 P0 | AC4 の no-qualified-candidate → ordinary_dispatch が #2607 の既存 early-exit と衝突 | 既に main が要求を満たす no-PR Issue で duplicate implementation を復活させる P1 | 「current implementation scope」の canonical normalizer が未定義 | prose/status 更新を scope expansion と誤認、または本物の追加実装を見逃す P1 | candidate が単数だが discovery は本質的に複数候補を返し得る | merged/open/closed PR 混在時に first-hit 依存・誤抑止 P1 | AC9 が core claim の scope coverage / disposition を live 検証しない | 最難関ロジックが壊れたまま runtime verification PASS が可能 P1 | freshness が observed_at 中心で decision-time 再束縛が弱い | Issue/PR/main が途中で変化した TOCTOU evidence を消費し得る P1 | impl-review-loop/SKILL.md が Allowed Paths 外 | production routing と durable skill contract が乖離する P2 | cross-reference の concrete parsing rule が不足 | GitHub timeline の source.type を誤解しやすい P2 | content-addressed manifest の canonical serialization が未固定 | 同じ意味の JSON が別 digest になり得るP0-1 — 「merged snapshot」は intake 時点では作れない
#2699 AC2 は、
することを要求しています。しかし現在の Allowed Paths は
impl-review-loopの intake/read 側だけです。PR が merge された後に初めて intake が走っても、当時の Issue implementation scope は既に失われている可能性があります。既存の
scripts/agent-guards/materialize_issue_scope_snapshot.pyも代替にはなりません。このファイル自身がISSUE_SCOPE_SNAPSHOT_V1の disk artifact を audit trail only と定義し、authorization source は同一 transaction 内の in-memory snapshot だけ、と明記しています。つまり historical landing evidence の durable authority ではありません。これは #2119/#2137 で現実に問題になります。#2137 merge 後、#2119 本文は何度も refinement されています。現在の本文だけから「#2137 merge 時点の implementation scope」を逆算することはできません。
最小修正は、新しい registry や attestation framework を作ることではありません。既存の PR publication 経路で、implementation 開始時または PR 作成時に小さな
IMPLEMENTATION_SCOPE_COVERAGE_V1block を PR body/comment に残し、程度を固定するのが費用対効果が高いです。merge 後はその marker と
merge_commit_oidを read-only で照合するだけにできます。そのためには #2699 の Allowed Paths を、少なくともその producer を実際に接続する Step 1 / open-PR 側まで広げる必要があります。producer のない「storage retrieval」だけを実装しないことが重要です。
historical #2137 のように marker が存在しない legacy case は、別途明示的な compatibility policy が必要です。「現在の body から merge-time snapshot を推定する」は避けるべきです。
P0-2 — #2607 の duplicate suppression を逆に壊す
現在 production の
route_loop_verdict_v2.py::resolve_already_satisfied_early_exit_decision()は、を実装済みです。これは #2607 / PR #2626 で入った重要な no-op suppression です。
ところが #2699 AC4 は、
と固定しています。
この AC を字面どおり新しい canonical disposition にすると、
という、まさに #2607 が止めているケースを再び Step 1 に流します。
新旧ロジックの合成順序を AC に固定すべきです。例えば:
新しい enum を増やす必要すらなく、no-candidate + main-satisfied は既存
already_satisfiedをそのまま維持するのが小さい変更です。P1 —
current implementation scopeの意味がまだ曖昧全文 Issue body hash は coverage manifest に使えません。#2119 がよい実例です。
現在の #2119 本文にはまだ「#2679 / Draft PR #2681 が merge 待ち」と残っていますが、fresh GitHub state では PR #2681 は 2026-09-20 に merge 済み、#2679 は CLOSED/COMPLETED です。一方 #2155 は現在も OPEN で、
Quality Decision Record.Status: measurement-readyの verification-only gate です。つまり operational prose や
Remaining Parent Gapsの現在値まで manifest に入れると、implementation code が全く変わっていないのに digest が変わります。逆に単に
In Scopeだけ取ると、AC/Allowed Paths に追加された本物の implementation requirement を見逃す可能性があります。最低限、normalizer が対象にする semantic fields と除外する fields を contract に固定すべきです。たとえば
goal_ref/change_kind、implementation-ownedIn Scope、implementation AC、Allowed Paths は対象、checkbox 状態、runtime evidence、closure-only quality gate、delegated follow-up の進捗 prose は対象外、といった境界です。特に #2119/#2137 fixture は「現在の全文 Issue と #2137 が exact」と書くのではなく、
であることを fixture の oracle にした方が実態に合います。
P1 — candidate を1件に潰す前のルールがない
IMPLEMENTATION_LANDED_EVIDENCE_V1.candidateは単数ですが、GitHub timeline には複数の cross-reference が普通に存在し得ます。closing PR とRefsPR、closed-unmerged PR、後続 PR が混在するケースもあります。GitHub の timeline
cross-referencedevent は candidate discovery に適しています。ただし API 上source.typeは PR でも常に"issue"で、PR かどうかはsource.issue.pull_requestの存在で判別する仕様です。(GitHub Docs)実装は、
程度で十分です。複雑な scorer は不要です。
なお
Refs #2119を closing relation と同一視しない現在方針は正しいです。GitHub が issue auto-close linkage として定義しているのはCloses/Fixes/Resolves系です。(GitHub Docs)P1 — AC9 は一番重要なものを runtime で証明していない
AC9 が live #2119/#2137 で確認するのは、
source identity
non-closing relation
merge commit が current main に到達していること
fixture fallback を使っていないこと
までです。
しかし #2699 の本質は、
です。AC9 はここを確認しないので、coverage normalizer が production では常に
insufficientを返していても runtime test が PASS できます。これは P0-1 と表裏です。durable historical snapshot がまだ存在しない以上、現在の #2119/#2137 だけで「live exact coverage」まで証明するのは困難です。
したがって AC9 は過大主張せず、
に限定し、coverage disposition の production E2E は durable manifest producer を導入した新しい実 PR fixtureで証明する方が正確です。
実装上の細部
merge commit の main 到達確認には
git merge-base --is-ancestor MERGE_OID CURRENT_MAINが適切です。Git は「ancestor なら 0、そうでなければ 1、その他の non-zero は error」と明確に区別しているため、1 = not_landedと transport/object failure を混同しないようにします。(Git)freshness は
observed_atの TTL を security gate にするより、判定直前にissue body SHA / PR head or merge OID / current main SHAをもう一度取得し、collection 開始時と一致しなければ bounded retry する方が実用的です。趣味開発ではこの2-read程度で十分で、ledger は不要です。また content-addressed manifest を導入するなら、hash 対象 bytes を固定してください。RFC 8785/JCS はこの問題への標準的な解ですが、このリポジトリだけで Python producer/consumer が閉じるなら、依存を増やさず
schema_version+ deterministic key ordering + fixed separators + UTF-8 を明文化する程度でも十分です。重要なのは producer/consumer が同じ canonical bytes を得ることです。(RFC Editor)最後に、新しい disposition は
impl-review-loopの公開動作を変えるため、現在 Allowed Paths 外の.claude/skills/impl-review-loop/SKILL.mdも更新対象に含めるべきです。現状の SKILL は #2607 のalready_satisfiedを durable contract として記述しており、コードだけ新しい lifecycle semantics にすると SSOT が即座に stale になります。推奨する #2699 の修正方針
大規模な lifecycle registry、署名、attestation、新しい権限ハーネスは不要です。**「scope snapshot をいつ durable に残すか」「#2607 とどう合成するか」「scope manifest が何を意味するか」**の3点だけ先に固定すれば、かなり小さい実装にできます。
その3点を反映してから
## 結論issue-refinement-loop→impl-review-loopに渡すのが適切です。特に P0-1 の producer 不在を解決せずimplementation_landed_evidence.pyから作り始めると、fixture は高品質なのに production では historical coverage を一度も証明できない実装になる可能性が高いです。#2699 の問題設定と実装場所は妥当です。特に、
root_entry_routerを lifecycle state machine にせず、impl-review-loopの pre-Step-1 choke point で duplicate work を止める方針は、#2680 の調査結果と既存 #2607 の設計に整合しています。一方、現在の Issue contract のまま実装に入るのは要修正です。中心となる
IMPLEMENTATION_SCOPE_COVERAGE_V1の「merged 時点 snapshot」が production で生成できないことと、既存 #2607 のalready_satisfiedroute を AC4 が壊し得ることが大きいです。#2699 には現時点でコメントはなく、参照する実装 PR も確認できていないため、コード着手前に直す余地があります。敵対的レビュー findings
immutable merged snapshotの producer / 永続化地点が存在しないcovered_exactlyを導出不能no-qualified-candidate → ordinary_dispatchが #2607 の既存 early-exit と衝突candidateが単数だが discovery は本質的に複数候補を返し得るobserved_at中心で decision-time 再束縛が弱いimpl-review-loop/SKILL.mdが Allowed Paths 外source.typeを誤解しやすいP0-1 — 「merged snapshot」は intake 時点では作れない
#2699 AC2 は、
することを要求しています。しかし現在の Allowed Paths は
impl-review-loopの intake/read 側だけです。PR が merge された後に初めて intake が走っても、当時の Issue implementation scope は既に失われている可能性があります。既存の
scripts/agent-guards/materialize_issue_scope_snapshot.pyも代替にはなりません。このファイル自身がISSUE_SCOPE_SNAPSHOT_V1の disk artifact を audit trail only と定義し、authorization source は同一 transaction 内の in-memory snapshot だけ、と明記しています。つまり historical landing evidence の durable authority ではありません。これは #2119/#2137 で現実に問題になります。#2137 merge 後、#2119 本文は何度も refinement されています。現在の本文だけから「#2137 merge 時点の implementation scope」を逆算することはできません。
最小修正は、新しい registry や attestation framework を作ることではありません。既存の PR publication 経路で、implementation 開始時または PR 作成時に小さな
IMPLEMENTATION_SCOPE_COVERAGE_V1block を PR body/comment に残し、程度を固定するのが費用対効果が高いです。merge 後はその marker と
merge_commit_oidを read-only で照合するだけにできます。そのためには #2699 の Allowed Paths を、少なくともその producer を実際に接続する Step 1 / open-PR 側まで広げる必要があります。producer のない「storage retrieval」だけを実装しないことが重要です。
historical #2137 のように marker が存在しない legacy case は、別途明示的な compatibility policy が必要です。「現在の body から merge-time snapshot を推定する」は避けるべきです。
P0-2 — #2607 の duplicate suppression を逆に壊す
現在 production の
route_loop_verdict_v2.py::resolve_already_satisfied_early_exit_decision()は、を実装済みです。これは #2607 / PR #2626 で入った重要な no-op suppression です。
ところが #2699 AC4 は、
と固定しています。
この AC を字面どおり新しい canonical disposition にすると、
という、まさに #2607 が止めているケースを再び Step 1 に流します。
新旧ロジックの合成順序を AC に固定すべきです。例えば:
新しい enum を増やす必要すらなく、no-candidate + main-satisfied は既存
already_satisfiedをそのまま維持するのが小さい変更です。P1 —
current implementation scopeの意味がまだ曖昧全文 Issue body hash は coverage manifest に使えません。#2119 がよい実例です。
現在の #2119 本文にはまだ「#2679 / Draft PR #2681 が merge 待ち」と残っていますが、fresh GitHub state では PR #2681 は 2026-09-20 に merge 済み、#2679 は CLOSED/COMPLETED です。一方 #2155 は現在も OPEN で、
Quality Decision Record.Status: measurement-readyの verification-only gate です。つまり operational prose や
Remaining Parent Gapsの現在値まで manifest に入れると、implementation code が全く変わっていないのに digest が変わります。逆に単に
In Scopeだけ取ると、AC/Allowed Paths に追加された本物の implementation requirement を見逃す可能性があります。最低限、normalizer が対象にする semantic fields と除外する fields を contract に固定すべきです。たとえば
goal_ref/change_kind、implementation-ownedIn Scope、implementation AC、Allowed Paths は対象、checkbox 状態、runtime evidence、closure-only quality gate、delegated follow-up の進捗 prose は対象外、といった境界です。特に #2119/#2137 fixture は「現在の全文 Issue と #2137 が exact」と書くのではなく、
であることを fixture の oracle にした方が実態に合います。
P1 — candidate を1件に潰す前のルールがない
IMPLEMENTATION_LANDED_EVIDENCE_V1.candidateは単数ですが、GitHub timeline には複数の cross-reference が普通に存在し得ます。closing PR とRefsPR、closed-unmerged PR、後続 PR が混在するケースもあります。GitHub の timeline
cross-referencedevent は candidate discovery に適しています。ただし API 上source.typeは PR でも常に"issue"で、PR かどうかはsource.issue.pull_requestの存在で判別する仕様です。([GitHub Docs]1)実装は、
程度で十分です。複雑な scorer は不要です。
なお
Refs #2119を closing relation と同一視しない現在方針は正しいです。GitHub が issue auto-close linkage として定義しているのはCloses/Fixes/Resolves系です。([GitHub Docs]2)P1 — AC9 は一番重要なものを runtime で証明していない
AC9 が live #2119/#2137 で確認するのは、
までです。
しかし #2699 の本質は、
です。AC9 はここを確認しないので、coverage normalizer が production では常に
insufficientを返していても runtime test が PASS できます。これは P0-1 と表裏です。durable historical snapshot がまだ存在しない以上、現在の #2119/#2137 だけで「live exact coverage」まで証明するのは困難です。
したがって AC9 は過大主張せず、
に限定し、coverage disposition の production E2E は durable manifest producer を導入した新しい実 PR fixtureで証明する方が正確です。
実装上の細部
merge commit の main 到達確認には
git merge-base --is-ancestor MERGE_OID CURRENT_MAINが適切です。Git は「ancestor なら 0、そうでなければ 1、その他の non-zero は error」と明確に区別しているため、1 = not_landedと transport/object failure を混同しないようにします。([Git]3)freshness は
observed_atの TTL を security gate にするより、判定直前にissue body SHA / PR head or merge OID / current main SHAをもう一度取得し、collection 開始時と一致しなければ bounded retry する方が実用的です。趣味開発ではこの2-read程度で十分で、ledger は不要です。また content-addressed manifest を導入するなら、hash 対象 bytes を固定してください。RFC 8785/JCS はこの問題への標準的な解ですが、このリポジトリだけで Python producer/consumer が閉じるなら、依存を増やさず
schema_version+ deterministic key ordering + fixed separators + UTF-8 を明文化する程度でも十分です。重要なのは producer/consumer が同じ canonical bytes を得ることです。([RFC Editor]4)最後に、新しい disposition は
impl-review-loopの公開動作を変えるため、現在 Allowed Paths 外の.claude/skills/impl-review-loop/SKILL.mdも更新対象に含めるべきです。現状の SKILL は #2607 のalready_satisfiedを durable contract として記述しており、コードだけ新しい lifecycle semantics にすると SSOT が即座に stale になります。推奨する #2699 の修正方針
大規模な lifecycle registry、署名、attestation、新しい権限ハーネスは不要です。**「scope snapshot をいつ durable に残すか」「#2607 とどう合成するか」「scope manifest が何を意味するか」**の3点だけ先に固定すれば、かなり小さい実装にできます。
その3点を反映してから
issue-refinement-loop→impl-review-loopに渡すのが適切です。特に P0-1 の producer 不在を解決せずimplementation_landed_evidence.pyから作り始めると、fixture は高品質なのに production では historical coverage を一度も証明できない実装になる可能性が高いです。squne121 commentedon Sep 21, 2026
確認した範囲では、#2699 は実装開始ではなく Issue contract の再精緻化を先に行うべき状態です。特に P0 の2点――durable scope snapshot producer 不在と #2607
already_satisfiedとの precedence 衝突――を解消してから implementation handoff に戻すのが妥当です。また現行
issue-refinement-loopでは canonical Step 2 はissue-reviewerSubAgent を起動しません。一方、semantic review のissue-design-reviewerには明示的な completion join barrier があり、完了待ちが必要です。本文 mutation はissue-editorに委譲する構成が現行契約に合っています。これを踏まえた貼り付け用プロンプトです。既に auto mode で起動しているこの Claude Code セッションで、以下を人間の中間承認なしで最後まで実行してください。
対象:
squne121/loop-protocol#2699https://github.com/squne121/loop-protocol/issues/2699#issuecomment-5755952589.claude/skills/issue-refinement-loop/SKILL.md目的は、anchor comment の findings を単純転記することではなく、fresh repository state と関連 Issue / PR / repository assets を再調査した上で
issue-refinement-loopの canonical procedure に従い #2699 を implementation-ready な contract まで精緻化することです。実行ポリシー
human_judgment_required/operator_intervention_requiredを勝手に成功扱いへ変換しない。impl-review-loop、implementation worker、実装 worktree、実装 PR 作成へは進まない。最初に読むもの
最低限、以下を fresh read してから routing を開始すること。
.claude/skills/issue-refinement-loop/SKILL.md.claude/skills/issue-refinement-loop/references/semantic-design-review.md.claude/skills/issue-refinement-loop/references/termination-policy.md.claude/skills/issue-refinement-loop/references/anchor-comment-handling.md.claude/skills/issue-refinement-loop/references/ac-vc-reflection.mdIssue 実装: impl-review-loop intakeにevidence-based landing dispositionを実装する #2699 の現在の本文・全コメント
anchor comment
5755952589parent Issue 調査: issue-refinement-loop の root_entry_router が post-merge の duplicate impl-review-loop handoff を防げない blind spot を調査し、follow-up 実装方針を確定する #2680
Issue 実装: impl-review-loop に already_satisfied terminal route を追加する #2607 と実装 PR feat: impl-review-loop に already_satisfied terminal route を追加する #2626
Issue 実装: CI: Playwright E2E の responsive matrix を専用 lane へ分離し critical path を短縮する #2119 と PR feat: Playwright E2E responsive matrix を専用 lane へ分離する #2137
.claude/skills/impl-review-loop/SKILL.md.claude/skills/impl-review-loop/steps/preparation.md.claude/skills/impl-review-loop/scripts/route_loop_verdict_v2.pyPR publication / implementation開始時に durable scope marker を生成できる既存経路
.claude/skills/open-pr/.claude/skills/implement-issue/anchor comment の記述を authoritative truth とみなさず、現在の main / Issue / PR state とコードを SSOT として再検証すること。
SubAgent orchestration
SubAgent を使用すること。また、各 SubAgent の完了を待ってから、その結果を必要とする次工程へ進むこと。
1. read-only investigation
必要に応じて
codebase-investigator等の read-only sibling SubAgent を main/root session から起動し、少なくとも以下を独立調査させる。already_satisfiedearly-exit の現在の実装と 実装: impl-review-loop intakeにevidence-based landing dispositionを実装する #2699 の新 disposition の合成位置current implementation scopenormalizer が参照すべき semantic fieldsimpl-review-loop/SKILL.mdを更新対象に含める必要性SubAgent を投げっぱなしにしない。
必ず completion を待ち、結果を main thread で検証・統合してから root review へ進むこと。
2. canonical Step 2
現行 skill 契約に従うこと。
canonical Step 2 では
issue-reviewerSubAgent を新たに起動しない。run_root_review_pipeline.pyの canonical root-owned pipeline と、その stdout のトップレベルcanonical_step2_routeを routing authority とする。status、prose、旧compact_result.next_action等から独自に route を再計算しない。3. semantic review
deterministic review が approve し、
semantic_review_trigger.pyが applicable と判定した場合は、canonical Step 2.5 を実行する。issue-design-reviewerSubAgent を sibling として起動し、completion join barrier を厳守して完了を待つこと。完了前に
record-result、join_review_results.py、Step 4 rewrite へ進まない。join_review_results.pyが返す:approveneeds-fixretryhuman_judgment_requiredを canonical contract のまま扱う。
retryは Step 2.5 内の bounded retry として処理する。semantic finding 由来の
needs-fixではSEMANTIC_REWRITE_CONSTRAINTS_V1を再構築・改変せず、そのまま rewrite lane に渡す。4. rewrite
本文 mutation が必要な場合は
issue-editorSubAgent / canonicaledit-issueroute に委譲する。issue-editorの完了を待ち、GitHub の fresh readback で更新後本文を確認してから次 iteration を開始する。SubAgent から別 SubAgent を nested delegation させない。
必要な chain は main/root session が sibling SubAgent を sequential に orchestration すること。
anchor comment から必ず再評価する論点
以下は「そのまま採用」ではなく fresh review で妥当性を検証し、妥当なら Issue contract に検索可能・テスト可能な形で反映する。
P0: durable historical scope producer
現在の
IMPLEMENTATION_SCOPE_COVERAGE_V1が intake/read side の consumer だけを定義し、merge-time implementation scope を production で生成・永続化する producer がない問題を解消する。producer のない retrieval/parser だけを実装対象にしない。
最小変更を優先する。新しい lifecycle registry、署名、attestation framework 等は導入しない。
fresh investigation で canonical な PR publication / implementation開始経路を確定し、必要なら #2699 の In Scope / Allowed Paths / AC / VC を拡張する。
候補として
open-pr/implement-issue経路を調査するが、ファイル名を事前に決め打ちしない。legacy PR に durable marker が存在しない場合は、現在本文から merge-time scope を推測しない compatibility policy を明文化する。
P0: #2607 already_satisfied との合成
no-qualified-candidate -> ordinary_dispatch_or_explicit_recoveryを無条件に適用して、既存 #2607 の duplicate suppression を壊さないこと。少なくとも以下の precedence を fresh implementation contract と整合させる。
→ reconciliation
→ existing
already_satisfiedearly-exit を維持→ implementation already landed
→ existing PR resume
→ ordinary dispatch / explicit recovery
既存 route 名を不必要に増やさず、既存 behavior と合成できるならそれを優先する。
current implementation scope normalizer
全文 body hash を semantic coverage と同一視しない。
どの field が implementation scope に含まれ、どの operational prose / progress state / checkbox / delegated remainder が除外されるかを contract に固定する。
Goal、implementation-owned In Scope、implementation AC、Allowed Paths 等をどう扱うか fresh review で確定し、同値な scope が deterministic canonical bytes / digest を得るようにする。
canonical serialization も明示すること。
不要な新規依存は避け、Python 内で閉じられるなら deterministic key ordering / separators / UTF-8 / schema_version 等の簡潔な規則を優先する。
multiple candidates
candidate discovery を first-hit 単数前提にしない。
bounded discovery
→ repo/pr_number dedupe
→ relation/lifecycle/identity classification
→ qualified candidate resolution
を contract 化する。
複数の qualified candidate が競合して一意に disposition を導けない場合は reconciliation へ送る。
cross-reference semantics
GitHub timeline の
cross-referencedevent の具体的形状を調査し、PR 判別、closing relation、non-closing verified cross-reference を混同しない parser rule を AC/VC に反映する。generic
Refs, title, branch-name regex, merged state 単独を landing authority にしない。freshness / TOCTOU
単純な
observed_atTTL だけを authority にしない。decision 直前に最低限:
を再束縛し、collection 開始時と不一致なら bounded retry / reconciliation とする設計を検討する。
runtime verification
AC9 が実際に live 環境で証明できる claim を過大化しない。
historical #2119/#2137 に durable scope marker が存在しないなら、それだけで live exact coverage を証明したことにしない。
live runtime verification は discovery / identity / relation / main ancestry / fallback rejection 等の transport claim に限定し、exact coverage → disposition → Step 1 suppression の production E2E は、durable manifest producer を通った現実的な fixture / test path で証明する contract に分離すること。
durable skill contract
新しい pre-Step-1 disposition が
impl-review-loopの公開 semantics を変えるなら、.claude/skills/impl-review-loop/SKILL.mdが Allowed Paths から漏れたままにしない。コードと durable skill SSOT を一致させる。
Issue contract の完成条件
最終 #2699 は少なくとも以下を曖昧さなく持つこと。
already_satisfiedとの precedenceAC と VC は 1:1 で検証意図が追跡できるようにする。
既存テストで既に pass する behavior は
# baseline-expect: pass、新規 behavior は原則# baseline-expect: failとし、baseline contract を偽装しない。自律ループ
rewrite 後は必ず fresh body に対して canonical review を再実行する。
semantic review が再度必要なら再実行する。
SEMANTIC_REWRITE_CONSTRAINTS_V1.max_rewrite_attempts等の bounded limit は遵守する。no-progress、hash 不変、finding 非減少等は prose で独自判定せず canonical router に従う。
途中で一度 review が approve しても、rewrite 後の stale artifact を再利用しない。
終了
以下になるまで自律的に進める。
この状態になったら #2699 の refinement を終了する。
impl-review-loopは起動しない。canonical skill が最終的に
human_judgment_requiredまたはoperator_intervention_requiredを返した場合のみ、その route を捏造せず停止し、以下だけを簡潔に報告する。それ以外の途中承認は求めない。
特に重要なのは、canonical Step 2 で旧
issue-reviewerを起動せず、semantic Step 2.5 のissue-design-reviewerだけは明示的に completion join する点です。これで現行スキル契約に沿いつつ、要求された「SubAgent を使い、完了を待つ」挙動になります。squne121 commentedon Sep 21, 2026
issue-refinement-loop: human_escalation
SEMANTIC_REWRITE_CONSTRAINTS_V1.max_rewrite_attempts: 2を超過)VERDICT: approve(body_sha256: sha256:38f41142e700250db145051c68cfc42150d369dee9812b9134e0431f6e0c05b8)これまでの経緯(4 iteration の要約)
open-pr/scripts/open_pr.pyへの embedding)、既存 実装: impl-review-loop に already_satisfied terminal route を追加する #2607already_satisfiedとの precedence 合成、canonical scope normalizer、multi-candidate resolution、cross-reference parsing semantics、freshness/TOCTOU rebind policy、AC9(→AC12)の narrowed runtime verification claim を追加。Allowed Paths 拡張(open-pr/scripts/open_pr.py等 3 件)は read-only investigation が導出した exact path literal をauthority_transport.produce経由で bind した正規の scope 拡張。pr_head_shaの用途不明確)を検出 → 修正。reconciliation_required規定と矛盾)、MEDIUM(closed-unmerged candidate とalready_satisfiedフォールバックの関係が曖昧)を検出 → 修正(step4b 新設等)。covered_exactlyでない場合」と「merged qualified candidate で marker は存在するがcovered_exactlyでない場合(PR merge 後に Issue 側でスコープが拡張されたケース)」の 2 つの分岐を明示的にカバーしておらず、catch-all の step5(ordinary_dispatch_or_explicit_recovery)に暗黙的に落ちてしまう。これは Legacy Compatibility Policy の marker 付き open/draft 節が明記するreconciliation_requiredと矛盾する。AC5/AC6/AC10 のいずれもこの 2 ケースを検証対象として明示していない。Blockers
covered_exactlyでない場合(marker 記録後に Issue 側でスコープが拡張された)の disposition を、Legacy Compatibility Policy の明文どおりreconciliation_requiredとして Disposition Precedence に明示的な step(例: step4c)を追加するか。covered_exactlyでない場合(PR merge 後に Issue 側でスコープが拡張された)をどう扱うか。reconciliation_requiredとするか、別の disposition を新設するか、あるいは既存 step5 の例示に明示的に含めるか。scope expansionが open/draft 限定か merged も含むかの明記)へ反映が必要。現在の Issue body 状態
sha256:38f41142e700250db145051c68cfc42150d369dee9812b9134e0431f6e0c05b8次に人間が決める必要がある一点
marker 付き open/draft candidate の scope drift ケースと、merged + marker 付きだが非 exact coverage のケースを、Disposition Precedence 上でどう扱うか(
reconciliation_requiredに統一するか、別 disposition を設けるか)を決定し、決定内容を Issue #2699 本文(Disposition Precedence / Legacy Compatibility Policy / 該当 AC)へ反映してから、issue-refinement-loop を再実行する。fix: PR #2700 adversarial review P0/P1 blockers (#2699)
fix: PR #2700 test-runner blockers (#2699 AC2 coverage, ruff E501)
fix: mock live Issue body/HEAD sha in open_pr.py create-path tests (#…
feat: add evidence-based landing intake (#2700)