Skip to content

実装: impl-review-loop の cross-reference false candidate で不要な reconciliation 停止を防ぐ #2750

Closed

Description

@squne121

Machine-Readable Contract

contract_schema_version: v1
issue_kind: implementation
parent_issue: "none"
goal_ref: "impl-review-loop pre-Step-1 intake が、対象 Issue 本文内の precedent/reference によって生じた他 Issue 向け PR の timeline cross-reference を current implementation の landing candidate と誤認し、qualified_candidate_conflict で不要停止する false reconciliation を防ぐ"
change_kind: workflow
source_issue: 2727
dedupe_key: "incident:issue-2727:impl-review-loop-cross-reference-false-candidate"

Parent Issue

なし(standalone workflow correction)

Parent Goal Ref

standalone Issue のため parent 自体は存在しない(none)。テンプレート要求を満たすための bounded な Goal / Desired Destination を以下に示す。

  • Goal: impl-review-loop の pre-Step-1 landing candidate 判定が、Issue 本文の precedent/reference によって生じた timeline cross-reference と、実際の closing linkage(closingIssuesReferences)・durable scope marker(IMPLEMENTATION_SCOPE_COVERAGE_V1)を混同しないようにする。
  • Desired Destination: implementation_landed_evidence.py の candidate qualification が、closing authority(GitHub 構造化 closingIssuesReferences)と candidate-local durable marker identity を区別し、well-formed marker が別 Issue を指す verified non-closing cross-reference だけを、conflict counting から bounded に除外できる状態。合わせて .claude/skills/impl-review-loop/SKILL.md / steps/preparation.md の既存 fail-closed 契約に、この bounded carve-out が明文化されている状態。

Current Validated Scope

Issue #2727 の impl-review-loop 起動時、.claude/skills/impl-review-loop/scripts/implementation_landed_evidence.py が GitHub timeline の cross-reference から PR #2735 / #2746 を verified_cross_reference candidate として収集した。

しかし live GitHub readback では:

#2727 本文が precedent として #2726 / PR #2746 等を参照したことで timeline cross-reference が生成され、その参照だけを根拠に merged PR が複数「qualified」とされ、derive_landing_disposition() が reconciliation_required / qualified_candidate_conflict を返した。

なお 2026-09-25 に PR #2751 が Issue #2727 を実際に closingIssuesReferences で close して merge 済みであり、現在の #2727 timeline は本 Issue 起票時点の exact incident shape とは異なる(genuine closing candidate が追加されている)。このため exact incident の再現は deterministic fixture / integration regression の責務とし、live runtime verification は read-only sanity check に限定する(詳細は Runtime Verification Applicability を参照)。

Remaining Parent Gaps

なし(standalone Issue であり、本 Issue のスコープ内に parent gap は存在しない)

Root Cause

現行 derive_landing_disposition() は、validation 済み candidates について lifecycle が merged|open|draft|closed_unmerged であればまず qualified set に入れ、closing relation が存在する場合だけ closing candidates に絞る。

closing relation が無い場合、複数の verified_cross_reference は、それぞれの target-bound scope coverage が current Issue identity と一致するかを candidate qualification 前に利用せず、そのまま multi-candidate conflict になり得る。

特に「PR 自身が持つ durable scope marker が別 Issue を明示している」ケースは、current Issue との landing authority の ambiguity ではなく、current Issue に対する irrelevant cross-reference として除外できる強い負の証拠である。

一方、closing relation が current Issue を明示しているのに durable marker identity が不一致である場合は、本当に contradictory evidence なので fail-closed reconciliation_required を維持する。

GitHub の意味論としても、timeline の cross-referenced イベントは「別 Issue/PR から参照(mention)された」ことだけを示すイベントであり、参照元が PR かどうかは source.issue.pull_request の有無で判別するに過ぎない。一方 closingIssuesReferences は PR がマージされた際にどの Issue を close するかを表す構造化リンクであり、cross-referenced とは別概念である。GitHub Issue 間の blocked_by / blocking(dependency)機能もさらに別の API 概念であり、この 3 つは GitHub 公式ドキュメント上も統合されていない独立した機構である。本 Issue はこの 3 つを別 authority として扱う前提に立つ。

Outcome

impl-review-loop の pre-Step-1 candidate resolution が relation authority と target-bound scope evidence を区別し、単なる precedent/reference による cross-reference を implementation landing candidate と誤認しない。

具体的には:

  1. verified_cross_reference candidate が current target Issue と異なる IMPLEMENTATION_SCOPE_COVERAGE_V1.issue_number を持ち、かつ candidate-local scope_coverage の marker parse error が scope_coverage_issue_identity_mismatch の1件だけ(他の schema/digest/manifest 等の error と複合していない)場合に限り、その candidate は current Issue の qualified landing candidate から除外する。
  2. 上記除外は advisory/debug evidence として保持してよいが、複数件存在しても qualified_candidate_conflict を生成しない。
  3. current Issue を明示する closing_relation candidate(GitHub 構造化 closingIssuesReferences が current target Issue を含む candidate)の marker identity mismatch は従来どおり contradiction として reconciliation_required にする。identity mismatch と他の marker error が同時に存在する non-closing candidate も、除外せず従来どおり fail-closed のまま扱う。
  4. markerless non-closing candidate の legacy compatibility、および Issue 実装: CI: Playwright E2E の responsive matrix を専用 lane へ分離し critical path を短縮する #2119 / PR feat: Playwright E2E responsive matrix を専用 lane へ分離する #2137 の regression behavior は維持する(markerless candidate は本 carve-out の対象外であり、sibling marker mismatch と同一理由では除外しない)。
  5. candidate がすべて irrelevant cross-reference として除外された場合は no_qualified_candidate 相当として既存 already_satisfied precedence を通し、それでも未充足なら ordinary_dispatch_or_explicit_recovery へ進める。
  6. GitHub native issue dependency(構造化 blockedBy)、PR closing linkage(構造化 closingIssuesReferences)、および timeline cross-reference は互いに別の authority のまま維持し、本文 precedent/reference や prose keyword(Closes/Fixes/Resolves 等)から dependency や closing authority を推測しない。closing_relation の authority は「current target Issue が GitHub 構造化 closingIssuesReferences に含まれること」であり、prose keyword は補助的な説明に留める。
  7. .claude/skills/impl-review-loop/SKILL.md と .claude/skills/impl-review-loop/steps/preparation.md の既存 fail-closed 契約(「identity mismatch / malformed durable marker は lifecycle に関係なく常に最優先で reconciliation_required」)に対し、上記 1 の bounded carve-out を明文化する。これは既存契約を弱めるものではなく、carve-out が適用される exact な条件(non-closing candidate かつ marker error が identity mismatch 単独)を additive に記述する。

Runtime Verification Applicability

decision: immediate
reason: >
  Allowed Paths が .claude/skills/impl-review-loop/scripts/**, SKILL.md,
  steps/preparation.md を含むため docs/dev/extension-surface-runtime-policy.yaml の
  skill-invocation-procedure-or-contract-change risk-trigger(default_decision:
  immediate, verification_profile: skill-invocation-runtime-smoke)に該当する。
  一方 incident は live GitHub timeline cross-reference / closingIssuesReferences
  semantics に起因するが、2026-09-25 に PR #2751 が Issue #2727 を実際に close して
  merge済みのため、現在の #2727 timeline は本 Issue が対象とする exact candidate set
  (PR #2735/#2746 の qualified_candidate_conflict)をもはや再現しない。したがって
  AC1-AC9 の中核ロジックは deterministic fixture / production-shaped integration
  regression(mock gh pattern)で検証し、live runtime verification は #2735 / #2746 が
  cross-reference として観測可能であること・それぞれの durable marker が sibling Issue
  identity を指すこと・#2727 の GitHub native dependency と cross-reference が別概念
  であることの external fact transport sanity check のみに限定する。「live #2727 が
  original qualified_candidate_conflict を再現すること」を PASS 条件にはしない。
applicable_acs:
  - AC1
  - AC2
  - AC3
  - AC4
  - AC5
  - AC6
  - AC7
  - AC8
  - AC9
execution_environment:
  cli_tools:
    - python3
    - uv
    - rg
  auth_required: false
  network_required: false
skip_conditions:
  - "AC1-AC9 の pytest / rg regression は実行環境に依存せず常に実行できるため SKIP 対象ではない。read-only sanity check(verify_implementation_landed_intake_runtime.py)は native GitHub API 到達性が無い環境では既存の SKIP(exit 77) 契約に従う"
fallback_policy:
  fallback_success_is_pass: false
  notes: "fallback 経由の成功を PASS に変換しない。read-only sanity check の到達不能は SKIP として扱い、original #2727 qualified_candidate_conflict の再現を PASS 条件にしない"
artifact_requirements:
  - "pytest 実行結果(-q 出力)"
  - "rg による SKILL.md / preparation.md carve-out 明文化の grep 結果"

In Scope

  • .claude/skills/impl-review-loop/scripts/implementation_landed_evidence.py
    • verified non-closing cross-reference の candidate qualification / filtering
    • current target Issue と durable scope marker identity の関係を qualification 前に扱う bounded logic(candidate-local candidate["scope_coverage"] を authority とし、_coverage_for() のような evidence-level fallback を qualification 判定の authority にしない)
  • .claude/skills/impl-review-loop/tests/test_implementation_landed_evidence.py
  • .claude/skills/impl-review-loop/tests/test_implementation_landed_intake_integration.py
    • collect_candidate_inputs() から production-shaped path(timeline candidate collection → PR body marker parse → qualification → disposition composition)を通す integration regression
    • 既存 mock gh pattern を再利用し、新しい巨大な harness は作らない
  • .claude/skills/impl-review-loop/SKILL.md
    • Evidence-Based Landing Disposition の既存 fail-closed 契約に対する bounded carve-out の明文化(required change surface)
  • .claude/skills/impl-review-loop/steps/preparation.md
    • 「0-a-0. Evidence-Based Landing Disposition」節の既存契約に対する同上の bounded carve-out の明文化(required change surface)

Out of Scope

Acceptance Criteria

  • AC1: merged verified_cross_reference candidate が current target Issue とは異なる IMPLEMENTATION_SCOPE_COVERAGE_V1.issue_number を持ち、かつ candidate-local marker error が scope_coverage_issue_identity_mismatch の1件だけの場合、その candidate は qualified landing candidate から除外され、current target の reconciliation conflict を生成しない
  • AC2: 実装: persist_retrospective_run.py の secret redaction パターンを新形式 ghs_ App installation token に対応させる #2727 incident shape の reproducer(PR fix: summarize_agent_transcript.py の GitHub token redaction を新形式 ghs_ App installation token に対応させる #2735/fix: compact_author_result.pyのghs_パターンを新形式GitHubトークンに対応させる #2746 相当の well-formed sibling marker candidate 2件、両方 current target には irrelevant)で qualified_candidate_conflict は発生せず、no_qualified_candidate 相当 → 既存 already-satisfied precedence → canonical route(already_satisfied または ordinary_dispatch_or_explicit_recovery)になる
  • AC3: current target Issue を実際に closing_relation(構造化 closingIssuesReferences)で close する candidate が durable marker identity mismatch を持つ fixture は、従来どおり reconciliation_required を返す
  • AC4: current Issue 用の valid non-closing candidate が1件、sibling marker candidate(irrelevant)が複数存在する fixture では、sibling candidate は conflict counting から除外され valid candidate のみが評価される。また non-closing candidate の marker error が scope_coverage_issue_identity_mismatch に加え別の marker error(schema/digest/manifest 等)を同時に持つ fixture では、irrelevant 扱いにせず従来どおり reconciliation_required を維持する(fail-closed)
  • AC5: Issue 実装: CI: Playwright E2E の responsive matrix を専用 lane へ分離し critical path を短縮する #2119 / PR feat: Playwright E2E responsive matrix を専用 lane へ分離する #2137 相当の markerless PR fixture で、sibling marker mismatch と同じ理由では除外されず、Issue 実装: impl-review-loop intakeにevidence-based landing dispositionを実装する #2699 の legacy compatibility 契約が維持される
  • AC6: verified_cross_reference / closing_relation の provenance schema や既存 disposition enum を増やさず、既存 implementation_already_landed | existing_pr_resume | already_satisfied | ordinary_dispatch_or_explicit_recovery | reconciliation_required の範囲で解決する
  • AC7: GitHub native blocked_by と timeline cross-reference を混同する新しい dependency inference を追加しない
  • AC8: .claude/skills/impl-review-loop/SKILL.md と steps/preparation.md が、既存の「identity mismatch / malformed durable marker は lifecycle に関係なく常に最優先で reconciliation_required」契約に対する bounded carve-out(non-closing candidate かつ marker error が identity mismatch 単独の場合のみ)を明文化している
  • AC9: AC1-AC5 の regression が、手組み candidate dict の unit test だけでなく、少なくとも1件は collect_candidate_inputs() を通す production-shaped integration path(既存 test_implementation_landed_intake_integration.py の mock gh pattern を再利用)でも検証される

Verification Commands

# AC1
$ uv run --locked pytest .claude/skills/impl-review-loop/tests/test_implementation_landed_evidence.py -q

# AC2
$ uv run --locked pytest .claude/skills/impl-review-loop/tests/test_implementation_landed_intake_integration.py -q

# AC3
$ uv run --locked pytest .claude/skills/impl-review-loop/tests/test_implementation_landed_evidence.py -q

# AC4
$ uv run --locked pytest .claude/skills/impl-review-loop/tests/test_implementation_landed_evidence.py -q

# AC5
$ uv run --locked pytest .claude/skills/impl-review-loop/tests/test_implementation_landed_evidence.py -q

# AC6
$ uv run --locked pytest .claude/skills/impl-review-loop/tests/test_implementation_landed_evidence.py -q

# AC7
$ uv run --locked pytest .claude/skills/impl-review-loop/tests/test_implementation_landed_evidence.py -q

# AC8
$ rg -n "scope_coverage_issue_identity_mismatch" .claude/skills/impl-review-loop/SKILL.md .claude/skills/impl-review-loop/steps/preparation.md

# AC9
$ uv run --locked pytest .claude/skills/impl-review-loop/tests/test_implementation_landed_intake_integration.py -q

読み取り専用 sanity check(.claude/skills/impl-review-loop/scripts/verify_implementation_landed_intake_runtime.py)は、Runtime Verification Applicability に記載の通り native GitHub API 到達性に依存するため、正式な Verification Command としては列挙せず、native GitHub API 到達性が無い環境では既存 SKIP 契約に従う任意の補助チェックとして扱う。

Allowed Paths

  • .claude/skills/impl-review-loop/scripts/implementation_landed_evidence.py
  • .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/SKILL.md
  • .claude/skills/impl-review-loop/steps/preparation.md

Stop Conditions

  • Allowed Paths 外の変更が必要と判明した場合
  • In Scope の固定契約(キー集合・スキーマ・型定義)の変更が必要になった場合
  • 新規 Issue の起票が必要と判断した場合(スコープ分割が発生する場合)
  • 後続 Phase / 別スコープへの波及が判明した場合
  • nested SubAgent delegation が必要になった場合
  • 外部サービス利用・権限昇格・既存テスト大規模改変が必要になった場合
  • closing relation と non-closing cross-reference の authority 境界を変更するために新しい provenance schema が必要と判明した場合
  • 実装: CI: Playwright E2E の responsive matrix を専用 lane へ分離し critical path を短縮する #2119/feat: Playwright E2E responsive matrix を専用 lane へ分離する #2137 legacy compatibility を壊さずに bounded fix ができない場合
  • GitHub native dependency materialization の再設計が必要と判明した場合
  • remote mutation を伴う runtime test が必要になった場合

Required Skills

なし

Required Design References

Source

Activity

  1. added
    enhancement
    phase/implementation
    agent/implementer
    triage-required
    on Sep 25, 2026
  2. squne121 commented on Sep 25, 2026

    @squne121
    OwnerAuthor

    判定: REQUEST_CHANGES

    Issue #2750 の技術的な方向性は妥当です。実際、現行 derive_landing_disposition() は candidate の scope marker を見る前に candidate 数で qualified_candidate_conflict を確定しており、#2727 で PR #2735 / #2746 が false candidate になった説明はコードと一致しています。GitHub 側の意味論も、cross-referenced は単に「別Issue/PRから参照された」イベントであり、PRであることは source.issue.pull_request で識別するだけです。一方 closingIssuesReferences は PR と Issue の構造化された closing linkage で、Issue dependency の blocked by / blocking はさらに別機能です。したがって、この3つを別 authority として扱う方針は正しいです。GitHub Docs

    ただし、このまま実装に渡すべきではありません。特に最初の2件は、今回直そうとしている「不要停止」そのものを別の形で再発させます。

    優先度 | Finding | 問題 | 修正方針 -- | -- | -- | -- P0 | Issue #2750 自体が implementation contract として構造不正 | change_kind: workflow-routing は implementation template の許容値 docs\|code\|mixed\|workflow\|data にない。さらに必須の ## Current Validated Scope が ## Incident / Current Validated Scope に改名され、## Remaining Parent Gaps、## Allowed Paths、## Required Skills が欠落。Stop Conditions は存在しない Allowed Paths を参照している。テンプレート自身が「見出しを機械判定する」と明記しているため、implementation 前の preflight 停止要因になる | change_kind: workflow にする。必須見出しを canonical 名で追加。Remaining Parent Gaps: なし、Required Skills: なし でよい。Allowed Paths を明示する P0 | #2699 / SKILL.md の既存契約と #2750 が衝突している | 現行契約は「identity mismatch / malformed durable marker は lifecycle に関係なく最優先で reconciliation_required」と明記。一方 #2750 は non-closing cross-reference の identity mismatch を「irrelevant evidence」として除外しようとしている。コードだけ変更すると skill SSOT と実装が不一致になる | .claude/skills/impl-review-loop/SKILL.md と steps/preparation.md を 必須変更対象 にし、「relation qualification 前の clean cross-reference identity mismatch は negative qualification evidence」という carve-out を明記する P1 | scope_coverage_issue_identity_mismatch を含むだけで除外すると fail-open になる | _parse_marker() は identity mismatch 以外にも schema/digest/manifest error をまとめて返し、marker 自体を破棄する。そのため errors に identity mismatch が含まれる、というだけで除外すると「別Issue番号 + 壊れたmarker」まで irrelevant として無視できてしまう | identity mismatch が唯一の marker error の場合だけ irrelevant とする。複合 error は従来通り reconciliation に残す P1 | Runtime Verification が既に事件を再現できない | 2026-09-25 16:44 JST に PR #2751 が #2727 を実際に close して merge 済み。現在の #2727 timeline には #2735/#2746 に加えて genuine closing candidate #2751 があるため、live #2727 を再実行しても original qualified_candidate_conflict shape にはならない | exact incident の証明は deterministic fixture / integration test に移す。live verifier を残すなら「timeline transport と marker identity の観測」だけに限定し、fix の runtime PASS とは呼ばない P1 | AC2 は unit-level derive_landing_disposition() だけでは不十分 | 今回事象は timeline collection → PR body marker parse → qualification → already_satisfied composition という複数段の接続不良。手組み candidate だけの test では parser/filter wiring を間違えても green になる | collect_candidate_inputs() から production path を通す integration regression を必須にする。新 harness は不要で、既存 mock gh pattern を再利用すれば十分 P2 | Issue のタイトル/Outcome が実際の修正範囲より広い | marker-bearing sibling PR は除外できても、markerless false cross-reference は引き続き ambiguous candidate になる。また irrelevant candidate の materialization/ancestry validation failure は現在 validation が qualification より先なので停止し得る | 今回は bounded fix と明記し、「well-formed durable marker が別Issueを指す verified non-closing candidate」に対象を限定する。残りを無理に直して scope creep しない P2 | closing_relation の説明を keyword に寄せすぎない方がよい | GitHub の closingIssuesReferences は structured linkage であり、デフォルトでは manually linked Issue も含み得る。Closes/Fixes/Resolves だけを同義扱いすると external semantics とずれる | 実装契約では「current target が closingIssuesReferences に存在する」を authority にする。本文 keyword は説明用に留める GitHub Docs

    参照した repository 契約はこちらです。Issue #2750 implementation.yml implementation_landed_evidence.py impl-review-loop SKILL.md

    最小の実装設計

    新 schema や新 provenance type は不要です。既存 candidate-local scope_coverage を使い、closing authority の選択と false-cross-reference 除外を conflict counting より前に行うだけで十分です。

    def _is_irrelevant_nonclosing_cross_reference(candidate):    if candidate["provenance"]["kind"] != "verified_cross_reference":        return False    coverage = candidate.get("scope_coverage")    return (        isinstance(coverage, Mapping)        and coverage.get("status") == "invalid"        and coverage.get("errors")            == ["scope_coverage_issue_identity_mismatch"]    )qualified = lifecycle_qualified_candidatesclosing = [    c for c in qualified    if c["provenance"]["kind"] == "closing_relation"]if closing:    # closing mismatch は後段で従来どおり contradiction として扱う    qualified = closingelse:    qualified = [        c for c in qualified        if not _is_irrelevant_nonclosing_cross_reference(c)    ]# この後で len(qualified) > 1 を判定

    重要なのは、判定に candidate-local candidate["scope_coverage"] を使うことです。_coverage_for() は evidence-level fallback を持つため、candidate qualification の identity 判定に使うと別 candidate の coverage を誤適用できる余地があります。

    Issue本文に入れるべき regression boundary

    最低限、AC/VC では次の5ケースを直接固定すべきです。

    1. 実装: persist_retrospective_run.py の secret redaction パターンを新形式 ghs_ App installation token に対応させる #2727 incident shape: fix: summarize_agent_transcript.py の GitHub token redaction を新形式 ghs_ App installation token に対応させる #2735/fix: compact_author_result.pyのghs_パターンを新形式GitHubトークンに対応させる #2746 相当の well-formed sibling marker 2件 → 両方 irrelevant → no_qualified_candidate、qualified_candidate_conflict なし。
    2. current Issue 用の valid non-closing candidate 1件 + sibling 2件 → sibling は除外され、valid candidate だけを評価。
    3. closing relation + current Issue identity mismatch → 従来どおり reconciliation_required。
    4. non-closing + scope_coverage_issue_identity_mismatch と別の marker error が同時にある → irrelevant 扱いせず fail-closed。
    5. markerless PR feat: Playwright E2E responsive matrix を専用 lane へ分離する #2137 相当 → sibling marker mismatch と同じ理由では除外せず、既存 legacy policy をそのまま通す。

    このうち1と2は、できれば coverage_from_pr_body() に完成済み marker text を実際に通してください。手製の {"status": "invalid"} fixture だけだと、今回の根本にある parser → qualification 接続を検証できません。

    Runtime Verification は軽くするべき

    この点はユーザー方針とも一致します。現在の live #2727 は PR #2751 が正規の closing candidate になっているため、事件当時の状態そのものは失われました。PR #2751

    したがって新しい巨大な runtime harness や disposable Issue mutation を作る価値は低いです。deterministic collector/integration regression を正本にして、live verification は必要なら「#2735/#2746 が timeline cross-reference に存在し、それぞれ marker が #2725/#2726 を指し、#2727 の native blocked_by が空」という external fact の read-only sanity check に留めるのが適切です。GitHub の dependency は cross-reference とは独立した機能なので、この separation 自体は公式仕様とも整合しています。GitHub Docs

    修正後の Issue #2750 のスコープ

    最小修正で進めるなら、Allowed Paths は以下で十分です。

    • .claude/skills/impl-review-loop/scripts/implementation_landed_evidence.py
    • .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/SKILL.md
    • .claude/skills/impl-review-loop/steps/preparation.md

    verify_implementation_landed_intake_runtime.py は、上記の通り live incident reproduction をやめるなら変更不要でもよいです。

    総括すると、アルゴリズムの狙いは正しいものの、Issue contract 自体が現在 implementation-ready ではありません。特に「必須見出し/enumの修正」と「#2699 の fail-closed 契約に対する明示的 carve-out」の2点を先に直すべきです。その後は新規 framework を増やさず、candidate qualification の数十行程度の bounded fix + 既存テスト基盤で十分に閉じられます。

    ## 判定: `REQUEST_CHANGES`

    Issue #2750 の技術的な方向性は妥当です。実際、現行 derive_landing_disposition() は candidate の scope marker を見る前に candidate 数で qualified_candidate_conflict を確定しており、#2727 で PR #2735 / #2746 が false candidate になった説明はコードと一致しています。GitHub 側の意味論も、cross-referenced は単に「別Issue/PRから参照された」イベントであり、PRであることは source.issue.pull_request で識別するだけです。一方 closingIssuesReferences は PR と Issue の構造化された closing linkage で、Issue dependency の blocked by / blocking はさらに別機能です。したがって、この3つを別 authority として扱う方針は正しいです。:chatgpt-content-reference{index="0"}

    ただし、このまま実装に渡すべきではありません。特に最初の2件は、今回直そうとしている「不要停止」そのものを別の形で再発させます。

    優先度 Finding 問題 修正方針
    P0 Issue #2750 自体が implementation contract として構造不正 change_kind: workflow-routing は implementation template の許容値 docs|code|mixed|workflow|data にない。さらに必須の ## Current Validated Scope が ## Incident / Current Validated Scope に改名され、## Remaining Parent Gaps、## Allowed Paths、## Required Skills が欠落。Stop Conditions は存在しない Allowed Paths を参照している。テンプレート自身が「見出しを機械判定する」と明記しているため、implementation 前の preflight 停止要因になる change_kind: workflow にする。必須見出しを canonical 名で追加。Remaining Parent Gaps: なし、Required Skills: なし でよい。Allowed Paths を明示する
    P0 #2699 / SKILL.md の既存契約と #2750 が衝突している 現行契約は「identity mismatch / malformed durable marker は lifecycle に関係なく最優先で reconciliation_required」と明記。一方 #2750 は non-closing cross-reference の identity mismatch を「irrelevant evidence」として除外しようとしている。コードだけ変更すると skill SSOT と実装が不一致になる .claude/skills/impl-review-loop/SKILL.md と steps/preparation.md を 必須変更対象 にし、「relation qualification 前の clean cross-reference identity mismatch は negative qualification evidence」という carve-out を明記する
    P1 scope_coverage_issue_identity_mismatch を含むだけで除外すると fail-open になる _parse_marker() は identity mismatch 以外にも schema/digest/manifest error をまとめて返し、marker 自体を破棄する。そのため errors に identity mismatch が含まれる、というだけで除外すると「別Issue番号 + 壊れたmarker」まで irrelevant として無視できてしまう identity mismatch が唯一の marker error の場合だけ irrelevant とする。複合 error は従来通り reconciliation に残す
    P1 Runtime Verification が既に事件を再現できない 2026-09-25 16:44 JST に PR #2751 が #2727 を実際に close して merge 済み。現在の #2727 timeline には #2735/#2746 に加えて genuine closing candidate #2751 があるため、live #2727 を再実行しても original qualified_candidate_conflict shape にはならない exact incident の証明は deterministic fixture / integration test に移す。live verifier を残すなら「timeline transport と marker identity の観測」だけに限定し、fix の runtime PASS とは呼ばない
    P1 AC2 は unit-level derive_landing_disposition() だけでは不十分 今回事象は timeline collection → PR body marker parse → qualification → already_satisfied composition という複数段の接続不良。手組み candidate だけの test では parser/filter wiring を間違えても green になる collect_candidate_inputs() から production path を通す integration regression を必須にする。新 harness は不要で、既存 mock gh pattern を再利用すれば十分
    P2 Issue のタイトル/Outcome が実際の修正範囲より広い marker-bearing sibling PR は除外できても、markerless false cross-reference は引き続き ambiguous candidate になる。また irrelevant candidate の materialization/ancestry validation failure は現在 validation が qualification より先なので停止し得る 今回は bounded fix と明記し、「well-formed durable marker が別Issueを指す verified non-closing candidate」に対象を限定する。残りを無理に直して scope creep しない
    P2 closing_relation の説明を keyword に寄せすぎない方がよい GitHub の closingIssuesReferences は structured linkage であり、デフォルトでは manually linked Issue も含み得る。Closes/Fixes/Resolves だけを同義扱いすると external semantics とずれる 実装契約では「current target が closingIssuesReferences に存在する」を authority にする。本文 keyword は説明用に留める :chatgpt-content-reference{index="1"}

    参照した repository 契約はこちらです。[Issue #2750](https://github.com/squne121/loop-protocol/issues/2750?utm_source=chatgpt.com) [implementation.yml](https://github.com/squne121/loop-protocol/blob/main/.github/ISSUE_TEMPLATE/implementation.yml?utm_source=chatgpt.com) [implementation_landed_evidence.py](https://github.com/squne121/loop-protocol/blob/main/.claude/skills/impl-review-loop/scripts/implementation_landed_evidence.py?utm_source=chatgpt.com) [impl-review-loop SKILL.md](https://github.com/squne121/loop-protocol/blob/main/.claude/skills/impl-review-loop/SKILL.md?utm_source=chatgpt.com)

    最小の実装設計

    新 schema や新 provenance type は不要です。既存 candidate-local scope_coverage を使い、closing authority の選択と false-cross-reference 除外を conflict counting より前に行うだけで十分です。

    def _is_irrelevant_nonclosing_cross_reference(candidate):
        if candidate["provenance"]["kind"] != "verified_cross_reference":
            return False
    
        coverage = candidate.get("scope_coverage")
        return (
            isinstance(coverage, Mapping)
            and coverage.get("status") == "invalid"
            and coverage.get("errors")
                == ["scope_coverage_issue_identity_mismatch"]
        )
    
    qualified = lifecycle_qualified_candidates
    
    closing = [
        c for c in qualified
        if c["provenance"]["kind"] == "closing_relation"
    ]
    
    if closing:
        # closing mismatch は後段で従来どおり contradiction として扱う
        qualified = closing
    else:
        qualified = [
            c for c in qualified
            if not _is_irrelevant_nonclosing_cross_reference(c)
        ]
    
    # この後で len(qualified) > 1 を判定

    重要なのは、判定に candidate-local candidate["scope_coverage"] を使うことです。_coverage_for() は evidence-level fallback を持つため、candidate qualification の identity 判定に使うと別 candidate の coverage を誤適用できる余地があります。

    Issue本文に入れるべき regression boundary

    最低限、AC/VC では次の5ケースを直接固定すべきです。

    1. 実装: persist_retrospective_run.py の secret redaction パターンを新形式 ghs_ App installation token に対応させる #2727 incident shape: fix: summarize_agent_transcript.py の GitHub token redaction を新形式 ghs_ App installation token に対応させる #2735/fix: compact_author_result.pyのghs_パターンを新形式GitHubトークンに対応させる #2746 相当の well-formed sibling marker 2件 → 両方 irrelevant → no_qualified_candidate、qualified_candidate_conflict なし。
    2. current Issue 用の valid non-closing candidate 1件 + sibling 2件 → sibling は除外され、valid candidate だけを評価。
    3. closing relation + current Issue identity mismatch → 従来どおり reconciliation_required。
    4. non-closing + scope_coverage_issue_identity_mismatch と別の marker error が同時にある → irrelevant 扱いせず fail-closed。
    5. markerless PR feat: Playwright E2E responsive matrix を専用 lane へ分離する #2137 相当 → sibling marker mismatch と同じ理由では除外せず、既存 legacy policy をそのまま通す。

    このうち1と2は、できれば coverage_from_pr_body() に完成済み marker text を実際に通してください。手製の {"status": "invalid"} fixture だけだと、今回の根本にある parser → qualification 接続を検証できません。

    Runtime Verification は軽くするべき

    この点はユーザー方針とも一致します。現在の live #2727 は PR #2751 が正規の closing candidate になっているため、事件当時の状態そのものは失われました。PR #2751

    したがって新しい巨大な runtime harness や disposable Issue mutation を作る価値は低いです。deterministic collector/integration regression を正本にして、live verification は必要なら「#2735/#2746 が timeline cross-reference に存在し、それぞれ marker が #2725/#2726 を指し、#2727 の native blocked_by が空」という external fact の read-only sanity check に留めるのが適切です。GitHub の dependency は cross-reference とは独立した機能なので、この separation 自体は公式仕様とも整合しています。:chatgpt-content-reference{index="7"}

    修正後の Issue #2750 のスコープ

    最小修正で進めるなら、Allowed Paths は以下で十分です。

    • .claude/skills/impl-review-loop/scripts/implementation_landed_evidence.py
    • .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/SKILL.md
    • .claude/skills/impl-review-loop/steps/preparation.md

    verify_implementation_landed_intake_runtime.py は、上記の通り live incident reproduction をやめるなら変更不要でもよいです。

    総括すると、アルゴリズムの狙いは正しいものの、Issue contract 自体が現在 implementation-ready ではありません。特に「必須見出し/enumの修正」と「#2699 の fail-closed 契約に対する明示的 carve-out」の2点を先に直すべきです。その後は新規 framework を増やさず、candidate qualification の数十行程度の bounded fix + 既存テスト基盤で十分に閉じられます。

  3. squne121 commented on Sep 25, 2026

    @squne121
    OwnerAuthor

    確認した限り、今回の最優先は #2750 自体を implementation-ready な契約へ修復してから承認まで refinement-loop を回すことです。レビューコメントのP0/P1は妥当で、さらに現行 implementation.yml と照合すると Parent Goal Ref も必須なのに欠けています。

    特に重要なのは、対象コメントを単なる参考コメントではなく、今回ユーザーが明示指定した direct human context として扱うことです。issue-refinement-loop の現行契約では通常の iteration 承認は不要で、SubAgent は必要時に使い、結果を必ず join してから次段へ進む設計になっています。Step 2 の root review も background 起動後の完了 join が必須です。

    現時点では別の再発防止Issueは起票していません。#2750 が主要な false-candidate 問題を包含しており、markerless legacy candidate は #2699 の互換性境界として意図的に残されているためです。refinement 中に「#2750とは独立した、repo-owned かつ再現可能な再発原因」が確認された場合だけ、重複検索後に follow-up Issue を起票させるのが適切です。

    そのまま現在の auto mode Claude Code に投入するプロンプトです。

    squne121/loop-protocol の Issue #2750 に対して、.claude/skills/issue-refinement-loop を実行してください。

    対象:

    このコメントURLは、今回ユーザーが明示的に選択した direct human context です。
    GitHub の author_association から human origin を推定するのではなく、operator-selected human context として canonical with_human_context lane を使用してください。

    実行方針

    • 現在 Claude Code は auto mode で起動済みです。
    • 通常の refinement iteration ごとに人間承認を求めないでください。
    • issue-refinement-loop の loop_iteration_approval_gate.default_required: false に従い、needs-fix なら max_iterations の範囲で自動継続してください。
    • Claude Code の permission mode 自体は変更しないでください。
    • canonical main root / default branch から root-owned preflight / mutation / review を実行してください。
    • raw gh issue edit 等で governance を迂回せず、repository の canonical executor / controlled mutation route を使ってください。
    • refinement 完了後に impl-review-loop、implementation worker、worktree implementation、commit、PR 作成へ進んではいけません。この依頼は Issue refinement の完了までです。

    max_iterations は既定値 3 を使用してください。
    通常の needs-fix では停止せず自動修正・再レビューしてください。
    canonical hard stop、environment/integrity failure、真に人間判断が必要な semantic ambiguity の場合のみ停止してください。

    Step 0 / human-context preflight

    対象コメントを anchor として snapshot 固定し、Issue #2750 への binding を確認してください。

    human-context 用 canonical preflight / contract update route を使用し、レビューコメントが要求する Issue contract 修正を反映してください。

    コメントの列挙項目だけを機械的に転記するのではなく、current main の以下を SSOT として fresh に確認してください。

    レビューコメントと current repository contract が食い違う場合は current main の machine-enforced contract を優先し、その差分を最終報告してください。

    Issue #2750 で最低限修正すべき contract hygiene

    まず現在の implementation contract の構造不正を解消してください。

    最低限:

    1. Machine-Readable Contract

      • change_kind: workflow-routing
        → change_kind: workflow
      • 既存の incident/source/dedupe metadata を保持して問題なければ additive metadata として維持してよい。
    2. canonical heading を current implementation template に合わせる。
      特に現在不足しているものを補ってください。

      • ## Parent Goal Ref
      • ## Current Validated Scope
        • 現在の ## Incident / Current Validated Scope を canonical heading に正規化する。
      • ## Remaining Parent Gaps
      • ## Allowed Paths
      • ## Required Skills

      template/checker が他にも必須と判定する section があれば同時に修正すること。

    3. Parent Goal Ref
      standalone Issue なので parent 自体は none ですが、テンプレート要求を満たす bounded な:

      • Goal
      • Desired Destination
        を記載してください。
    4. Remaining Parent Gaps

      • 今回の bounded implementation scope 内に parent gap がないなら なし と明記。
    5. Required Skills

      • domain-specific skill が不要なら なし。
    6. Allowed Paths
      reviewer feedback に基づく最小集合を原則とする:

      • .claude/skills/impl-review-loop/scripts/implementation_landed_evidence.py
      • .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/SKILL.md
      • .claude/skills/impl-review-loop/steps/preparation.md

      verify_implementation_landed_intake_runtime.py は「historical incident を live 再現する変更」が不要なら Allowed Paths に追加しないでください。
      investigation の結果 genuine に変更が必要なら、scope delta を明示して refinement 内で判断してください。

    7. Stop Conditions

      • Allowed Paths が存在しない状態を前提にした記述を解消する。
      • current implementation template の canonical stop-condition requirements を fresh に確認し、必要な標準条件を維持する。
      • incident 固有条件は必要に応じて追加する。

    #2699 / impl-review-loop SSOT との衝突解消

    これは必須です。

    Issue #2750 の修正を production code だけに限定せず、

    • .claude/skills/impl-review-loop/SKILL.md
    • .claude/skills/impl-review-loop/steps/preparation.md

    を required change surface として明記してください。

    既存の
    「identity mismatch / malformed durable marker は reconciliation_required」
    という fail-closed 契約に対して、今回の bounded carve-out を明文化してください。

    意図する境界は:

    • current target を close していない verified_cross_reference
    • candidate-local の durable scope_coverage
    • well-formed marker
    • marker error が exactly
      scope_coverage_issue_identity_mismatch
      の1件だけ

    である場合に限り、current target に対する negative qualification evidence として扱い、qualified candidate conflict counting から除外可能。

    一方で以下は従来どおり fail-closed:

    • closing_relation が current target Issue を指すのに marker identity mismatch
    • identity mismatch と schema/digest/manifest 等の別 error が同時に存在する
    • malformed marker
    • contradictory evidence
    • insufficient evidence

    candidate qualification の identity 判定には candidate-local
    candidate["scope_coverage"]
    を使用してください。

    evidence-level fallback を持つ _coverage_for() 等で別 candidate の coverage が混入し得る設計を、この qualification 判定の authority にしてはいけません。

    bounded fix の範囲

    Issue のタイトル・Outcome・In Scope・AC を、実際に修正可能な範囲へ狭めてください。

    今回保証するのは原則:

    「well-formed durable marker が別 Issue identity を指す verified non-closing cross-reference」

    の false candidate 除外です。

    以下を #2750 の実装で無理に一般解決しないでください。

    • markerless legacy false cross-reference 全般
    • generic cross-reference の全面無効化
    • 新しい provenance schema
    • 新しい lifecycle registry / ledger / attestation
    • GitHub native dependency materialization の再設計
    • title / branch / free-form body を landing authority にすること

    closing_relation の authority は prose keyword ではなく、
    current target Issue が GitHub structured closingIssuesReferences
    に存在することとして記述してください。

    Regression / Acceptance Criteria

    最低限、以下を Issue body の AC/VC に固定してください。

    1. 実装: persist_retrospective_run.py の secret redaction パターンを新形式 ghs_ App installation token に対応させる #2727 incident shape

    2. current Issue 用 valid non-closing candidate 1件 + sibling marker candidate 複数

      • sibling は conflict counting から除外
      • valid candidate のみ評価
    3. closing_relation + current Issue identity mismatch

      • 従来どおり reconciliation_required
    4. non-closing candidate に

      • scope_coverage_issue_identity_mismatch
      • +別 marker error
        が同時にある
      • irrelevant 扱いしない
      • fail-closed
    5. markerless PR feat: Playwright E2E responsive matrix を専用 lane へ分離する #2137 相当

    単なる手組み済み candidate dict の unit test だけで終了しないでください。

    少なくとも incident-shape regression では可能な範囲で:

    • actual marker text
    • coverage_from_pr_body()
    • timeline candidate collection
    • collect_candidate_inputs()
    • qualification
    • disposition composition

    という production-shaped path を通してください。

    既存 test_implementation_landed_intake_integration.py と既存 mock gh pattern を再利用し、新しい巨大な harness を作らないでください。

    Runtime Verification

    historical live #2727 は現在 PR #2751 が genuine closing candidate として merge 済みなので、事件当時の exact candidate set ではありません。

    したがって:

    • exact incident reproduction の正本:
      deterministic fixture / integration regression
    • live runtime verification:
      必要なら read-only sanity check のみに限定

    としてください。

    live check を行う場合も、

    等の external fact transport sanity に留め、

    「live #2727 が original qualified_candidate_conflict を再現した」
    ことを PASS 条件にしてはいけません。

    新規 disposable Issue、remote mutation runtime harness、過剰な runtime framework は追加しないでください。

    SubAgent の使用

    planner の REFINEMENT_LOOP_PLAN_V1 を authority としてください。

    Investigation

    investigation_policy.required == true の場合:

    • codebase-investigator SubAgent を使用する。
    • read-only investigation に限定する。
    • SubAgent 完了を必ず待つ。
    • 結果を join してから review に進む。
    • SubAgent に final mutation / final routing authority を渡さない。

    Web research

    web_research_policy.required == true の場合:

    • web-researcher SubAgent を使用する。
    • GitHub cross-reference / closingIssuesReferences 等の external claim は一次資料を優先する。
    • codebase-investigator と並列実行可能なら並列でよい。
    • 両方の SubAgent が完了するまで必ず待つこと。
    • 一方だけ完了した状態で Step 2 review を開始しない。

    SubAgent が返した内容は advisory/evidence とし、main/root thread が最終 classification と mutation を所有してください。

    Step 2 review の mandatory join

    canonical Step 2 は current repository contract に従って root-owned
    run_root_review_pipeline.py produce
    を使用してください。

    Claude Code Bash tool からは repository contract の要求どおり background execution を明示し、
    background task の完了 notification / 完了 JSON を必ず join してください。

    background launch しただけで Step 2 完了扱いにしてはいけません。

    完了後の canonical_step2_route のみを routing authority とし、
    status / verdict / next_action から独自に route を再計算しないでください。

    自動 refinement loop

    review が needs-fix / request_changes なら、人間へ確認せず次 iteration に進んでください。

    • safe deterministic repair → canonical repair consumer
    • structural repair → canonical structural repair consumer
    • trusted human-context full rewrite が必要 →
      NEXT_ACTION: issue_editor_required に従い、
      existing issue-editor / edit-issue controlled transaction で full rewrite

    を使ってください。

    full rewrite 後は必ず:

    • body/title fresh readback
    • fresh preflight
    • fresh Step 2 review
    • fresh readiness

    を再実行してください。

    同一 no-progress mutation を盲目的に retry しないでください。

    再発防止 follow-up Issue

    refinement / investigation 完了時に、今回とは別の「再発し得る repository-owned defect」が concrete evidence 付きで確認されたか評価してください。

    新規 Issue を起票する条件:

    1. 実装: impl-review-loop の cross-reference false candidate で不要な reconciliation 停止を防ぐ #2750 の bounded implementation scope では解決しない
    2. 実際の repository asset / workflow 上に再現可能な原因がある
    3. 同じ failure が将来再発し得る
    4. 既存 Issue 実装: impl-review-loop の cross-reference false candidate で不要な reconciliation 停止を防ぐ #2750 / 実装: impl-review-loop intakeにevidence-based landing dispositionを実装する #2699 / 調査: issue-refinement-loop の root_entry_router が post-merge の duplicate impl-review-loop handoff を防げない blind spot を調査し、follow-up 実装方針を確定する #2680 その他の open Issue に既に包含されていない
    5. speculative hardening ではなく、具体的な reproducer または invariant violation がある

    候補例:

    • markerless false cross-reference により実際に再度 false reconciliation が発生する concrete reproducer が見つかった
    • repo-owned の Issue 作成経路が canonical create_issue_txn.py / validate_issue_body.py を迂回し、不正な implementation contract を恒常的に生成できることが確認された

    ただし:

    については speculative Issue を作らないでください。

    follow-up が必要なら:

    • まず GitHub Issue を検索して dedupe
      -既存 Issue があれば新規起票しない
    • 無ければ repository の canonical create-issue transaction を使用
    • implementation/research の適切な kind を選ぶ
    • 作成前に current template / validator を通す
    • Machine-Readable Contract、canonical headings、Allowed Paths、AC/VC、Runtime Verification Applicability 等を最初から valid にする
    • 実装: impl-review-loop の cross-reference false candidate で不要な reconciliation 停止を防ぐ #2750 と hard dependency が本当に存在する場合のみ GitHub native dependency を設定する
      -単なる関連性を blocked_by にしない

    ユーザーはこの条件を満たす再発防止 Issue の起票を事前承認しています。追加確認は不要です。

    終了条件

    Issue #2750 が fresh review で approved / proceed になり、implementation-ready contract として validation/readiness を満たしたら refinement-loop を正常終了してください。

    その際:

    • canonical termination report / handoff marker が適用対象なら publish
    • impl-review-loop を自動起動しない
    • production implementation を開始しない
    • branch/worktree/PR を実装目的で作らない

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

    1. Issue 実装: impl-review-loop の cross-reference false candidate で不要な reconciliation 停止を防ぐ #2750 の最終 review verdict
    2. Issue body の主要修正点
    3. current template/readiness で追加検出した reviewer comment 外の修正点
    4. 実行した SubAgent と、それぞれを完了 join したこと
    5. regression boundary / runtime verification 方針
    6. refinement iterations 数
    7. 再発防止 follow-up Issue を起票した場合は Issue 番号・理由
    8. 起票しなかった場合は「独立した再発原因が確認されなかった / 既存 Issue に包含済み」等の理由
    9. implementation handoff が可能な状態か
    10. 未解決 blocker があればその exact reason

    このプロンプトでは、通常の修正ループだけでなく SubAgent完了待ち、Step 2 background review の join、full rewrite 後のfresh validation まで明示しています。今回のような「レビューコメントは正しいがIssue契約自体がpreflightで止まる」ケースでも、実装開始前に収束させる構成です。

  4. squne121 commented on Sep 25, 2026

    @squne121
    OwnerAuthor

    issue-refinement-loop 終了報告

    Verdict: approved(deterministic review: VERDICT: approve / BLOCKERS: 0。semantic design review: assessment: findings(medium 1件・low 1件、いずれも blocker/high ではないため effective_verdict: approve を維持))

    Iterations: 2(Step 4 rewrite 2回)

    実施した本文修正(reviewer コメント #2750 (comment) 反映 + template/checker 準拠)

    1. change_kind: workflow-routing → workflow(.github/ISSUE_TEMPLATE/implementation.yml の許容値外だったため)
    2. ## Incident / Current Validated Scope → ## Current Validated Scope(canonical heading、内容は保持)
    3. 不足していた ## Parent Goal Ref / ## Remaining Parent Gaps / ## Allowed Paths / ## Required Skills を追加
    4. .claude/skills/impl-review-loop/SKILL.md / steps/preparation.md を In Scope / Allowed Paths に追加し、既存 fail-closed 契約(identity mismatch は lifecycle に関係なく常に reconciliation_required)への bounded carve-out 明文化を要求する AC8 を追加
    5. Outcome / Acceptance Criteria(9件)/ Stop Conditions / Runtime Verification Applicability を、reviewer 指摘(P0×2, P1×3, P2×2)に沿って全面改訂。特に「identity mismatch が唯一の marker error の場合のみ」除外可、複合エラーは fail-closed 維持、production-shaped integration regression 必須化(AC9)、live runtime verification は sanity check に限定
    6. closing_relation の authority を GitHub 構造化 closingIssuesReferences と明記(prose keyword は補助説明に留める)

    fresh review で追加検出した contract hygiene 問題(reviewer コメント外)

    • Stop Conditions の定型6文言のうち2件が非標準の言い回しだったため、guard-issue-body.py --kind implementation(LP017)が実際の mutation gate で fail することを検出・修正(contract_readiness_check.py --mode preflight-static の go 判定はこの kind 別チェックを捕捉しない非対称性があるため、事前確認だけでは不十分だった)
    • decision: immediate の Runtime Verification Applicability に applicable_acs / execution_environment / skip_conditions / fallback_policy / artifact_requirements の必須フィールドが欠落していたため追加(RVA001)
    • AC に対応する <!-- runtime-verification: true --> タグの欠落(C11_decision_tag_consistency)を修正
    • Verification Commands 内の uv run python3 <script> 形式コマンドが VC preflight allowlist 外だったため(VCP_COMMAND_NOT_ALLOWED)、read-only sanity check を正式な VC ブロックから外し、Runtime Verification Applicability の参照として記述する形に変更

    Semantic Design Review(Step 2.5)所見

    • medium(owner 確認推奨): AC1 が carve-out の適用範囲を lifecycle == merged の candidate に限定しているのに対し、Root Cause / Outcome bullet 1 は lifecycle を限定せず一般的に記述しており、実装者によって適用範囲の解釈が割れ得る(derive_landing_disposition() の len(qualified) > 1 チェック自体は lifecycle 分岐より前に走るため、open/draft candidate 同士の false conflict は AC1 の文言では明示的にカバーされない)。実装着手時に、この carve-out を merged-only に限定するのか、qualified な lifecycle 全般に広げるのかを明確にし、選んだ範囲を SKILL.md/preparation.md の契約文言(AC8)にも正確に反映することを推奨する。blocking ではないため本 Issue は approve 対象のまま。
    • low: implementation_landed_evidence.py 内の既存コード近傍コメント(実装: impl-review-loop intakeにevidence-based landing dispositionを実装する #2699 P1-1 由来、「lifecycle に関わらず reconciliation_required」を説明する既存コメント)も、実装時に bounded exception を反映するよう更新することを推奨(non-blocking)。

    再発防止 follow-up Issue

    起票しませんでした。contract_readiness_check.py --mode preflight-static が implementation kind 向けの LP017 相当チェックを実行しない非対称性は、closed Issue #1844(contract_readiness_check.py の run_validate_issue_body が issue_kind を validate_issue_body.py へ転送せず...)が implementation kind を意図的に "legacy-compatible profile" として扱う設計判断の範囲内であり、かつ今回も下流の guard-issue-body.py(mutation 直前の実 gate)が正しく fail-closed して不正な mutation は一切発生しなかった(mutation_started: false で停止)。既知の設計トレードオフであり、新規の再現可能な defect ではないため、speculative Issue は起票していない。

    SubAgent 実行・完了 join

    Regression / Runtime Verification 方針

    Implementation Handoff

    issue_kind: implementation の standalone Issue。本 refinement-loop は approved で正常終了する。impl-review-loop の起動・implementation worker の起動・worktree 作成・production code の実装・commit/push/PR 作成のいずれも行っていない(本依頼のスコープ外)。実装着手は、ユーザーが別途明示的に依頼した時点で impl-review-loop 自身のエントリゲートを通じて行われる。

    未解決 blocker

    なし。

    LOOP_HANDOFF_RESULT_V1:
      status: refinement_approved
      routing_action: none
      contract_review:
        status: go
        gate_result: fresh_go
        latest_comment_url: "N/A (deterministic Step 2 review via run_root_review_pipeline.py produce; no GitHub comment posted, comment_mode: skip)"
        generated_at: "2026-09-25T09:03:45Z"
        body_sha256: "56de66fdaa7649620c2f7983365677afd355f79b111cbbf98108edf360cfee3e"
      metadata:
        title_prefix_ready: true
      label_sync_observation:
        kind: presentation_sync
        result: noop
        detail: "label sync not attempted in this cycle"
      auto_fixes:
        result: auto_fixed
        required:
          - kind: template_hygiene
            executor: implementation-worker
            result: applied
            evidence:
              before: "sha256:be09cae30de1260248917af960323200c293b330e60c59006d84623508beec40"
              after: "sha256:65139ef85243bd7d21ad5dbb7a9ee0c8390b4b26f620ed02bbff4d3893ceab3d"
              comment_url: "N/A"
          - kind: template_hygiene
            executor: implementation-worker
            result: applied
            evidence:
              before: "sha256:65139ef85243bd7d21ad5dbb7a9ee0c8390b4b26f620ed02bbff4d3893ceab3d"
              after: "sha256:56de66fdaa7649620c2f7983365677afd355f79b111cbbf98108edf360cfee3e"
              comment_url: "N/A"
        skipped: []
      blockers: []
      permissions:
        unavailable: []
      generated_at: "2026-09-25T09:10:00Z"
      checked_body_sha256: "56de66fdaa7649620c2f7983365677afd355f79b111cbbf98108edf360cfee3e"
      checker_exit_code: 0
      missing_sections: []
      missing_contract_keys: []
  5. squne121 commented on Sep 25, 2026

    @squne121
    OwnerAuthor

    Issue #2750 は refinement 済みで approved、未解決 blocker なしです。現時点で #2750 用の既存PR・2750 ブランチも見つからないため、そのまま impl-review-loop に渡して実装開始が適切です。

    実装解釈は1点だけ明示的に固定した方がよいです。現行 derive_landing_disposition() は merged/open/draft/closed_unmerged をまとめて qualified にした後、lifecycle 別評価より前に qualified_candidate_conflict を判定します。そのため carve-out を AC1 の文面どおり merged だけに限定すると、open/draft の sibling cross-reference で同型の false reconciliation が残ります。Issue 本文の Outcome / In Scope と整合させ、non-closing verified_cross_reference の全 lifecycle に bounded carve-out を適用する方針をプロンプトに固定しました。ただし closing relation は従来どおり fail-closed です。

    再発防止Issueについては、今回は新規起票していません。上記 lifecycle 問題は #2750 自体で解消可能であり、markerless false cross-reference は #2699 の明示的な legacy compatibility 範囲です。refinement 実行時にも独立した新規 defect は確認されていません。新しい out-of-scope の再現可能 defect が実装中に見つかった場合だけ、下記プロンプトで dedupe 後に自動起票させます。

    そのまま、既に auto mode で起動中の Claude Code に貼り付けてください。

    Issue #2750 を対象に、repository の canonical skill .claude/skills/impl-review-loop/SKILL.md を SSOT として impl-review-loop を実行してください。

    対象:
    #2750

    目的:
    Issue #2750 の実装・検証・PRレビューを、人間の途中承認を要求せず自律的に反復し、マージ直前の merge-ready / draft_pr_ready 状態まで到達させてください。

    PR の merge 自体は実行しないでください。

    開始前の authority

    必ず live GitHub から Issue #2750 本文とコメントを fresh read してください。

    特に refinement-loop の終了報告:
    #2750 (comment)

    を確認してください。

    このコメントでは refinement が approved、未解決 blocker なしで終了しています。ただし過去の snapshot/comment/artifact 自体を Step 1 authorization とみなしてはいけません。

    impl-review-loop が要求する Root-Owned Synchronous Entry Transition を、今回の同一 continuous invocation 内で fresh に実行してください。

    すなわち、repository の現行契約に従って:

    1. capability preflight
    2. live Issue fetch
    3. current-run issue-contract-review
    4. live Issue fresh readback
    5. root entry routing
    6. route が implementation continuation を許可した場合、その同じ invocation の中で Step 1 を直接開始

    までを分断せず実行してください。

    古い invocation token / authorization packet 相当の artifact を再利用して Step 1 を開始しないでください。

    自律実行ポリシー

    Claude Code は既に auto mode で起動しています。permission mode を変更したり、別の permission mechanism を導入したりしないでください。

    通常の implementation → verification → PR review → fix loop について人間承認を求めないでください。

    impl-review-loop の canonical routing に従って、REQUEST_CHANGES の場合は fix_delta を Step 1 に返し、自動的に次 iteration を継続してください。

    SubAgent の単なる:

    human_review_required: true

    自己申告だけでは停止しないでください。現行 skill の #1860 Owner Decision に従い warning として扱い、iteration の余裕があれば継続してください。

    同様に contract snapshot / product-spec の advisory な human_judgment、missing_go、stale、refresh_contract_snapshot 等を独自判断で hard stop に昇格させないでください。

    ただし live Issue/PR コメント上の明示的 human veto、actual Git conflict、max_iterations、Issue #2750 または canonical skill に定義された真正の hard stop は尊重してください。

    SubAgent delegation — 必須

    root/main thread は control-plane と routing に専念し、data-plane 作業を対応する SubAgent に委譲してください。

    少なくとも以下を canonical skill に従って使用してください。

    Step 1

    implementation-worker SubAgent

    Issue #2750 の実装を委譲してください。

    Step 2

    test-runner SubAgent

    current PR head に対する verification を独立実行してください。

    Step 4

    pr-reviewer SubAgent

    pr-review-judge skill に基づく current-head PR review を実行してください。

    必要に応じて canonical update-branch worker / fix iteration も使用してください。

    Mandatory join

    各 SubAgent の完了を必ず待ってください。

    • implementation-worker の完了前に verification を開始しない
    • test-runner の完了および current-head verification/adjudication の確定前に PR review を開始しない
    • pr-reviewer の完了前に Step 5 routing を行わない
    • background task として起動した場合、launch 成功だけを完了扱いにせず completion notification / final structured result を必ず join する
    • 複数 SubAgent を安全に並列化できる read-only investigation があっても、routing に進む前に全 required result を join する

    SubAgent 出力の散文を root thread が独自に再解釈して canonical structured verdict を上書きしないでください。

    Issue #2750 の実装方針

    実装は bounded fix に限定してください。

    主変更対象:

    • .claude/skills/impl-review-loop/scripts/implementation_landed_evidence.py
    • .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/SKILL.md
    • .claude/skills/impl-review-loop/steps/preparation.md

    Issue の Allowed Paths を authoritative boundary としてください。

    Candidate qualification の基本設計

    現行 derive_landing_disposition() では、lifecycle candidate を集めた後に closing relation を優先し、その後 len(qualified) > 1 で qualified_candidate_conflict を返します。

    今回の false candidate 除外は、この conflict counting より前に行ってください。

    概念的には:

    1. lifecycle 上の candidate を取得
    2. structured closing_relation candidate を抽出
    3. closing candidate が存在するなら、それを authority level として従来どおり評価
    4. closing candidate が存在しない場合のみ、irrelevant な verified_cross_reference を conflict counting から除外
    5. その後 len(qualified) を評価

    としてください。

    新しい provenance schema / disposition enum は追加しないでください。

    Irrelevant cross-reference の exact 条件

    candidate を current Issue に対する irrelevant cross-reference として除外できるのは、以下をすべて満たす場合だけです。

    • provenance kind が verified_cross_reference
    • current target を structured closingIssuesReferences で close する closing_relation ではない
    • candidate-local candidate["scope_coverage"] が存在する
    • scope_coverage.status == "invalid"
    • scope_coverage.errors が exactly:
      ["scope_coverage_issue_identity_mismatch"]
    • schema/digest/manifest 等の別 error が一切ない

    判定には必ず candidate-local:

    candidate["scope_coverage"]

    を使用してください。

    evidence-level fallback を持つ _coverage_for(candidate, evidence) を、この candidate qualification の identity authority に使用しないでください。

    別 candidate の coverage が誤適用される可能性を残さないでください。

    Lifecycle の解釈

    Refinement の semantic review では AC1 の merged 文言と Outcome / Root Cause の一般記述との間に曖昧性が指摘されています。

    この実装では、carve-out を merged-only に限定しない 方針を採用してください。

    理由:

    • qualified_candidate_conflict は lifecycle-specific disposition 処理より前に発生する
    • well-formed marker が別 Issue identity を指しているという negative qualification evidence は、candidate が merged/open/draft のどれかによって意味が変わらない
    • Outcome / In Scope は verified non-closing cross-reference 一般を対象としている

    したがって、上記 exact 条件を満たす verified_cross_reference については、qualified lifecycle 全般で conflict counting から除外してください。

    ただし:

    • closing_relation
    • identity mismatch + 別 marker error
    • malformed marker
    • markerless candidate

    にはこの carve-out を適用しないでください。

    closed_unmerged の既存 canonical disposition semantics 自体も変更しないでください。

    この lifecycle 解釈を SKILL.md と steps/preparation.md の bounded carve-out 文言にも明示し、production code と SSOT を一致させてください。

    既存コードの #2699 由来コメントで「identity mismatch / malformed marker は lifecycle に関係なく reconciliation」と説明している箇所も、今回の bounded exception が読み手に分かるよう必要最小限更新してください。

    必須 regression

    少なくとも以下を固定してください。

    1. 実装: persist_retrospective_run.py の secret redaction パターンを新形式 ghs_ App installation token に対応させる #2727 incident shape

    2. current Issue 用 valid non-closing candidate 1件 + sibling marker candidate 複数

      • sibling を除外
      • valid candidate のみ評価
    3. current target を structured closing_relation で closeする candidate + marker identity mismatch

      • 従来どおり reconciliation_required
    4. non-closing candidate で:

      • scope_coverage_issue_identity_mismatch
      • + schema/digest/manifest 等の別 error
        が同時発生
      • irrelevant 扱いしない
      • fail-closed を維持
    5. markerless PR feat: Playwright E2E responsive matrix を専用 lane へ分離する #2137 相当

    6. lifecycle semantics の regression

      • open または draft の verified_cross_reference
      • candidate-local marker が well-formed sibling identity を指し、error が identity mismatch 単独
      • sibling candidate が qualified_candidate_conflict の原因にならないこと
      • closing relation / malformed marker との境界を変えないこと

    6 は今回の semantic ambiguity を将来再発させないための最小 regression としてください。巨大な新 harness は作らないでください。

    Production-shaped integration

    手組み candidate dict の unit test だけで完了扱いにしないでください。

    既存 test_implementation_landed_intake_integration.py の mock gh pattern を再利用し、少なくとも1つは:

    timeline candidate collection
    → PR body取得
    → actual IMPLEMENTATION_SCOPE_COVERAGE_V1 marker text
    → coverage_from_pr_body()
    → collect_candidate_inputs()
    → candidate qualification
    → disposition composition

    の production-shaped path を通してください。

    新規大規模 harness / ledger / registry / attestation subsystem は作らないでください。

    Runtime verification

    2026-09-25 に PR #2751 が #2727 を真正に close して merge 済みなので、live #2727 は incident 当時の candidate set を再現しません。

    したがって exact incident reproduction の authority は deterministic fixture / integration regression としてください。

    live runtime verification を行う場合は read-only sanity check に限定してください。

    確認してよいもの:

    禁止:

    native GitHub API が利用不能なら既存 exit-77 SKIP 契約を維持し、SKIP を PASS に変換しないでください。

    Verification Commands

    Issue #2750 の live body に記載された Verification Commands を authoritative として実行してください。

    最低限:

    uv run --locked pytest .claude/skills/impl-review-loop/tests/test_implementation_landed_evidence.py -q

    uv run --locked pytest .claude/skills/impl-review-loop/tests/test_implementation_landed_intake_integration.py -q

    rg -n "scope_coverage_issue_identity_mismatch" .claude/skills/impl-review-loop/SKILL.md .claude/skills/impl-review-loop/steps/preparation.md

    を current PR head で確認してください。

    test-runner が issue/contract から要求する additional verification があればそれも実行してください。

    PR review loop

    実装後に PR を作成し、current head を対象に verification → PR review を実行してください。

    pr-reviewer が REQUEST_CHANGES を返した場合、人間に確認せず fix_delta を implementation-worker に渡して修正してください。

    修正後は必ず:

    • fresh HEAD
    • verification
    • current-head adjudication
    • fresh PR review
    • live mergeability

    を取り直してください。

    古い head に対する APPROVE を流用しないでください。

    BEHIND の場合は canonical route_to_update_branch に従い branch を更新してから verification/review をやり直してください。

    stale review head の場合は canonical route_stale_head_rereview に従ってください。

    再発防止 follow-up Issue

    実装・検証・レビュー中に、#2750 の bounded scope では解決できない別の repository-owned recurrence defectを concrete evidence 付きで発見した場合は、人間への追加確認なしで follow-up GitHub Issue を起票して構いません。

    ただし起票条件はすべて満たしてください。

    起票前に必ず GitHub Issue を検索して dedupe してください。

    既存 Issue があれば新規起票しないでください。

    新規起票が必要なら repository の canonical create-issue transaction / current validator/template を使用し、最初から valid contract としてください。

    単に今回の lifecycle ambiguityを別Issue化しないでください。これは #2750 内で解消します。

    また #2699 が意図的に保持する markerless legacy compatibility 自体を defect とみなして起票しないでください。実際の新しい reproducer が必要です。

    禁止事項

    • PR を merge しない
    • auto-merge を enable にしない
    • Allowed Paths 外を勝手に変更しない
    • generic cross-reference を全面無効化しない
    • markerless legacy behavior を今回ついでに再設計しない
    • closingIssuesReferences authority を PR body keyword/title/branch 推測に置き換えない
    • GitHub native dependency を prose から推測しない
    • 新 provenance schema / lifecycle registry / ledger / attestation subsystem を追加しない
    • root thread 自身が SubAgent の代わりに全 data-plane 作業を抱え込まない
    • SubAgent を起動しただけで完了扱いにしない

    正常終了条件

    canonical route_loop_verdict_v2() が approved を返し、

    • reviewer verdict: APPROVE
    • blockers: []
    • reviewed head == current PR head
    • required verification/current-head gate PASS
    • live mergeability が canonical approved 条件を満たす

    状態になったら終了してください。

    PR の merge は人間に残してください。

    最終報告には以下を含めてください。

    1. Issue #2750 の実装結果
    2. PR URL / PR number
    3. current PR head SHA
    4. 変更ファイル一覧
    5. lifecycle-independent carve-out の実装位置と exact 条件
    6. closing relation fail-closed が維持されている証拠
    7. mismatch + additional marker error が fail-closed のままである証拠
    8. markerless 実装: CI: Playwright E2E の responsive matrix を専用 lane へ分離し critical path を短縮する #2119/feat: Playwright E2E responsive matrix を専用 lane へ分離する #2137 compatibility regression 結果
    9. production-shaped integration regression 結果
    10. Verification Commands の結果
    11. SubAgent 一覧と、各 SubAgent の completion を join したこと
    12. review loop iteration 数
    13. 最終 reviewer verdict / live mergeability
    14. 再発防止 follow-up Issue を作った場合は番号・理由
    15. 作らなかった場合はその理由
    16. IMPL_REVIEW_LOOP_RESULT_V1 / canonical termination result
    17. 人間が次に行うべき操作が「PR の最終確認・merge」であること

    マージ直前まで自律的に進めてください。

    参照した主な現行資産は Issue #2750、[refinement終了報告](https://github.com/squne121/loop-protocol/issues/2750#issuecomment-5829916522)、[`[implementation_landed_evidence.py](https://github.com/squne121/loop-protocol/blob/main/.claude/skills/impl-review-loop/scripts/implementation_landed_evidence.py)`](https://github.com/squne121/loop-protocol/blob/main/.claude/skills/impl-review-loop/scripts/implementation_landed_evidence.py)、[`[impl-review-loop/SKILL.md](https://github.com/squne121/loop-protocol/blob/main/.claude/skills/impl-review-loop/SKILL.md)`](https://github.com/squne121/loop-protocol/blob/main/.claude/skills/impl-review-loop/SKILL.md) です。

  6. squne121 commented on Sep 25, 2026

    @squne121
    OwnerAuthor

    root-owned entry router audit

    route: invoke_impl_review_loop
    reason: fresh_review_go_live_equality

  7. squne121 commented on Sep 25, 2026

    @squne121
    OwnerAuthor

    implement-issue: 実装完了 (2026-09-25)

  8. added a commit that references this issue on Sep 25, 2026
  9. added 2 commits that reference this issue on Oct 3, 2026
    d2e5956
    0ab0946
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent/implementerenhancementphase/implementationtriage-required

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions