Skip to content

実装: check_implementation_overlap.py の候補に native dependency を前段取得し successor 判定を live route まで反映する #1621

Closed

Description

@squne121

Machine-Readable Contract

contract_schema_version: v1
issue_kind: implementation
parent_issue: "none"
goal_ref: "check_implementation_overlap.py が current の native blocking から successor index を前段構築し、adapter evidence の policy_class 誤分類を解消する"
change_kind: code
blocked_by:
  - "#1615"

Parent Issue

なし(単独の follow-up。#1619 の Notes for Reviewer / Out of Scope で明示された「check_implementation_overlap.py の native dependency 取得ロジック自体」の follow-up)

Parent Goal Ref

  • Goal: なし(単独 Issue)
  • Desired Destination: なし

Current Validated Scope

  • .claude/skills/implement-issue/scripts/check_implementation_overlap.py の _classify() が、最初の classify_overlap() 呼び出し前に current の既取得 native blocking typed records から successor index を構築し、candidate の depends_on 相当情報へ注入する(candidate 単位の追加 API 呼び出しはゼロ)
  • 同ファイルの implementation adapter(candidate ごとの policy_class / reasons 構築、現行 origin + result.verdict のみに依存するロジック)を、CandidateEvidence.dependency_relation(check_issue_overlap.classify_overlap が既に candidate 単位で返している既存フィールド)を参照する形に変更し、successor candidate と通常 C1 candidate が同一 overlap_partial 集合に混在しても per-candidate で正しい policy_class / reason_code が evidence に記録されるようにする
  • .claude/skills/create-issue/scripts/check_issue_overlap.py(classify_overlap() 本体、overlap_partial_successor_dependency 集約 boolean を含む)は変更しない(下記 Background の調査結果を参照)

Remaining Parent Gaps

  • なし

Outcome

check_implementation_overlap.py が、最初の分類前に取得済みの current Issue の native blocking typed records を同一 repository の candidate scope へ successor relation の入力として接続する。これにより candidate ごとの追加 dependency API 呼び出しを行わず、shared-parent/path-overlap かつ candidate が current に対して native dependency 経由で依存している(successor)シナリオを parent_child_collision(AMBIGUOUS_REQUIRES_HUMAN/C3)ではなく proceed_with_collision_evidence route・candidate 単位の C2a successor_dependency_ordering として分類する。implementation adapter の evidence は check_issue_overlap.classify_overlap が candidate ごとに返す dependency_relation を保持し、origin と集約 result.verdict だけからの一律 C1 化をやめる。これにより PR #1615 が導入する human C1 decision が、successor C2a candidate を解除できない状態を維持する。通常 C1、predecessor C2b、duplicate、cross-repository、source degradation の既存 fail-closed semantics は変更しない。

Background

#1619 で .claude/skills/create-issue/scripts/check_issue_overlap.py の classify_overlap() に successor dependency 分岐(_dependency_relation() が cand.depends_on に current number を検出すると relation == "successor" を返し、overlap_partial 内で policy_class: C2a / reason_code: successor_dependency_ordering を割り当てる)が追加された(PR #1622、be430de1、2026-07-18 マージ済み)。この際、.claude/skills/implement-issue/tests/test_check_implementation_overlap_successor_dependency.py は pure classifier への consumer 整合テストとして追加されたが、docstring に明記されている通り「check_implementation_overlap.py の native dependency 取得ロジック自体は #1619 の Out of Scope」だった。

check_implementation_overlap.py の現行実装を確認したところ、以下が判明した。

  1. run() は online 経路で必ず fetch_all_native_dependencies() を呼び、current issue の blockedBy と blocking の両方向を全ページ取得している(check_implementation_overlap.py:1415-1421)。しかし current.blocking(= current issue が止めている successor 側)は dependency_resolution.native_blocking evidence として保存されるのみで(check_implementation_overlap.py:1181-1194、コード内コメントで明示的に「判定に一切使われず捨てられていた(dead data)」と記述されている)、_issue_scope_from_raw()(check_implementation_overlap.py:825-844)は候補の depends_on を常に blocked_by 方向のみで構築しており、current.blocking を参照しない。
  2. 第二段階の candidate native dependency 読み戻し(check_implementation_overlap.py:1459-1490)は、readback_targets(最初の classify_overlap() が OVERLAP_REQUIRES_COMMENT / DUPLICATE と判定した candidate、または blocked_by 経由の closed predecessor)に対してのみ実行される。shared parent_refs があり第一段階で successor 関係が確立できない candidate は最初の分類で parent_child_collision(AMBIGUOUS_REQUIRES_HUMAN)になり、readback_targets の対象外になるため、二段階目の native dependency 取得(= successor を明らかにできる唯一の経路)が永久に実行されない循環になっている。これが Issue 起票時に観測された「route: human_review_required のまま」の直接原因である。
  3. implementation adapter の candidate evidence 構築(check_implementation_overlap.py:1246-1250)は、origin("classify" / "dependency_c2a")と _classify() 内の集約 result.verdict のみから policy_class を導出しており、check_issue_overlap.classify_overlap() が candidate ごとに返す CandidateEvidence.dependency_relation(relation: "successor" 等)を一切参照していない。そのため、classify_overlap() が successor を正しく判定していても、origin == "classify" かつ result.verdict != DUPLICATE の candidate は一律 policy_class: "C1" として evidence 化される。build_evidence()(check_implementation_overlap.py:1030-1099)は OverlapResult の集約 policy_class / reason_code を一切参照しないため、この adapter 側ロジックのみが evidence 出力を決定する。
  4. check_issue_overlap.py 側では overlap_partial_successor_dependency が単一 boolean(check_issue_overlap.py:662)であり、1件でも successor candidate が overlap_partial に含まれると OverlapResult レベルの policy_class / reason_code が集合全体に対して C2a / successor_dependency_ordering になる(check_issue_overlap.py:765-787)。ただし上記 3 の通り、implementation adapter はこの集約フィールドを参照していないため、adapter 側で dependency_relation(candidate 単位)を正しく使えば、classify_overlap() 本体を変更せずに adapter evidence の誤分類は解消できる。

現在の関連 Issue/PR の状態(2026-07-19 時点、確認済み):

参照

In Scope

  • check_implementation_overlap.py::_classify()(または新規ヘルパー)が、current_raw["blocking"](既存の unconditional native dependency 取得結果)から {(repository, issue_number)} の successor index を構築し、最初の classify_overlap() 呼び出し前に同一 repository の candidate scope の depends_on へ current issue number を注入する
  • 上記注入により、candidate 単位の追加 REST/GraphQL 呼び出しを増やさずに、第一段階の classify_overlap() で successor 関係が確立されること(第二段階の readback 循環に依存しない)
  • implementation adapter の candidate evidence 構築ロジックを、origin + 集約 result.verdict のみに依存する現行方式から、CandidateEvidence.dependency_relation.relation("successor" / "predecessor" / "none")を per-candidate で参照する方式へ変更し、policy_class / reason_code を candidate ごとに正確に反映する
  • 上記変更が、通常 C1 candidate・predecessor C2b・duplicate・cross-repository・source degradation の既存 route/evidence を変えないことを regression test で確認する
  • PR feat: SHA固定のC1 overlap decisionを検証する (#1613) #1615 が導入する human C1 decision 機構(policy_class == "C1" を根拠とする override)が、successor C2a candidate を解除できないことを regression test で確認する(PR feat: SHA固定のC1 overlap decisionを検証する (#1613) #1615 マージ後の実 diff を前提に確認する)

Out of Scope

Acceptance Criteria

  • AC1: _classify() は最初の classify_overlap() 呼び出し前に、current_raw["blocking"](既存の unconditional 取得結果)から (repository, issue_number) の successor index を構築し、同一 repository の candidate の depends_on へ current issue number を注入する。candidate 単位の追加 API 呼び出し回数は本変更の前後で増加しない
  • AC2: candidate raw に blockedBy が存在しない状態でも、current の native blocking だけから check_issue_overlap._dependency_relation() が relation == "successor" を返す(第二段階の candidate native dependency 読み戻しに依存しない)
  • AC3: shared parent_refs を持つ successor candidate が、旧実装では第一段階で parent_child_collision(AMBIGUOUS_REQUIRES_HUMAN / reason_code: parent_child_collision)になっていたケースで、AC1 の注入により最初の classify_overlap() 呼び出し時点で verdict == OVERLAP_REQUIRES_COMMENT / reason_code == "successor_dependency_ordering" になる
  • AC4: check_implementation_overlap.py の最終 route が ROUTE_PROCEED_WITH_EVIDENCE("proceed_with_collision_evidence")になり、candidates_evidence 内の該当 candidate の policy_class == "C2a" / reasons に successor 関連の理由が記録される(origin == "classify" かつ result.verdict != DUPLICATE により一律 "C1" になる旧挙動が解消される)
  • AC5: 同一 overlap_partial 集合に通常 C1 candidate(successor でも predecessor でもない)と successor candidate が混在する場合、candidates_evidence 内で両者の policy_class が candidate ごとに区別される(CandidateEvidence.dependency_relation を per-candidate で参照する adapter 実装により、classify_overlap() の集約フィールドの精度に関わらず正しく分離される)
  • AC6: 通常 C1 candidate(successor でも predecessor でもない)・predecessor C2b・duplicate・cross-repository candidate の route/evidence は本変更の前後で変わらない(regression なし)
  • AC7: successor index は (repository, issue_number) タプルで比較し、cross-repository の同一 issue number を successor として誤結合しない
  • AC8: blockedBy と blocking の取得方向・意味論(current が依存される側 vs current が依存させる側)が実装内で逆転しない
  • AC9: current の native dependency API 取得(blockedBy / blocking)が失敗・ページ欠落・shape 不正の場合、既存の fail-closed semantics(fetch_native_dependencies の pagination cap 例外等)が本変更によって緩和されない
  • AC10: PR feat: SHA固定のC1 overlap decisionを検証する (#1613) #1615 がマージ済みの main 上で、PR feat: SHA固定のC1 overlap decisionを検証する (#1613) #1615 が導入する human C1 decision override が、AC4 で policy_class: "C2a" と記録される successor candidate を解除できないことを確認する regression test が pass する
  • AC11: .claude/skills/implement-issue/tests/ 配下の既存 check_implementation_overlap 関連テスト(PR feat: SHA固定のC1 overlap decisionを検証する (#1613) #1615 マージ後の状態を含む)が全て pass する

Runtime Verification Applicability

  • decision: not_applicable
  • reason: 全 AC は --dry-run / --current-file / --candidates-file(オフライン fixture 経路、ネットワーク/認証不要のローカル process 起動のみ)と pure classifier(check_issue_overlap.classify_overlap)への直接呼び出しによる unit test で決定論的に検証可能であり、GitHub API access・認証・外部 I/O を必須とする要素がない。起票時点で live fixture として想定されていた 実装: Issue scope snapshot と controlled executor で共通 staging/commit 境界を構築する #1611/実装: Codex 編集ガードから CODEX_ALLOWED_PATHS 系 env を廃止する #1612 は本 Issue の refinement 時点で既に CLOSED であり、classify_overlap() の候補プール条件(state == "OPEN")を満たさないため live 再現ができない。実装時に新たな live pair が存在する場合、read-only live smoke の追加は follow-up として許容するが、本 Issue の AC には含めない

Verification Commands

# AC1
$ uv run pytest .claude/skills/implement-issue/tests/test_check_implementation_overlap_native_dependencies.py -q
# AC2
$ uv run pytest .claude/skills/implement-issue/tests/test_check_implementation_overlap_successor_dependency.py -q
# AC3
$ uv run pytest .claude/skills/implement-issue/tests/test_check_implementation_overlap.py -q
# AC4
$ uv run pytest .claude/skills/implement-issue/tests/test_check_implementation_overlap.py -q
# AC5
$ uv run pytest .claude/skills/implement-issue/tests/test_check_implementation_overlap.py -q
# AC6
$ uv run pytest .claude/skills/implement-issue/tests/test_check_implementation_overlap.py -q
# AC7
$ uv run pytest .claude/skills/implement-issue/tests/test_check_implementation_overlap_repository_binding.py -q
# AC8
$ uv run pytest .claude/skills/implement-issue/tests/test_check_implementation_overlap_native_dependencies.py -q
# AC9
$ uv run pytest .claude/skills/implement-issue/tests/test_check_implementation_overlap_native_dependencies.py -q
# AC10
$ uv run pytest .claude/skills/implement-issue/tests/ -q
# AC11
$ uv run pytest .claude/skills/implement-issue/tests/ -q

Allowed Paths

  • .claude/skills/implement-issue/scripts/check_implementation_overlap.py
  • .claude/skills/implement-issue/tests/test_check_implementation_overlap.py
  • .claude/skills/implement-issue/tests/test_check_implementation_overlap_native_dependencies.py
  • .claude/skills/implement-issue/tests/test_check_implementation_overlap_successor_dependency.py
  • .claude/skills/implement-issue/tests/test_check_implementation_overlap_repository_binding.py

Stop Conditions

実装中にこれらの状況が発生したら直ちに作業を停止し、Issue comment に状況を記録して人間の判断を待つ。

  • Allowed Paths 外の変更が必要と判明した場合
  • In Scope の固定契約(キー集合・スキーマ・型定義)の変更が必要になった場合
  • 新規 Issue の起票が必要と判断した場合(スコープ分割が発生する場合)
  • 後続 Phase / 別スコープへの波及が判明した場合
  • nested SubAgent delegation が必要になった場合
  • 外部サービス利用・権限昇格・既存テスト大規模改変が必要になった場合
  • .claude/skills/create-issue/scripts/check_issue_overlap.py の変更が必要になった場合(Out of Scope 判断の見直しとして人間判断を要する)
  • successor index の入力源を current.blocking に限定する方針、adapter 非侵襲方針を変更する必要が生じた場合
  • 着手時点で PR feat: SHA固定のC1 overlap decisionを検証する (#1613) #1615 が main へマージされていない場合(先に PR feat: SHA固定のC1 overlap decisionを検証する (#1613) #1615 のマージを待つ)
  • 着手時点で Issue 実装: open-pr の overlap preflight hard gate に --limit 伝播を追加し repo 規模拡大による全面停止を解消する #1493 の実装が同一関数近傍(candidate 収集部)に着手済み・競合診断が必要な場合は、直列化順序を人間に確認する
  • 動作検証 AC の VC が想定外の fail-closed 経路(API 失敗等)を出力した場合

Schema Change Applicability

  • decision: not_applicable
  • reason: IMPLEMENT_SCOPE_COLLISION_PREFLIGHT_V1 の evidence schema(フィールド集合・型)自体は変更しない。既存フィールド(candidates[].policy_class / candidates[].reasons)の値の正確性を修正するのみで、schema 定義や consumer 契約は変更しない

Required Skills

  • Python 3
  • Bash
  • GitHub REST issue-dependencies API(blockedBy / blocking)

Required Design References

  • docs/dev/workflow.md#Contract-aware overlap preflight
  • .claude/skills/create-issue/scripts/check_issue_overlap.py(pure classifier、正本。本 Issue では変更しない)
  • .claude/skills/implement-issue/scripts/check_implementation_overlap.py

Delivery Rule(配信ルール)

Notes for Reviewer(レビュアー向け補足)

  • 本 Issue は 2026-07-19 の OWNER レビュー(REQUEST_CHANGES、Blocker 1-5、Major 1-3)を反映して全面的に書き直した。Blocker 1(successor index の入力源を candidate 側 API 追加取得ではなく current の既取得 blocking にする)と Blocker 4(Machine-Readable Contract 等の契約欠落)はレビュー指摘通りに反映した
  • Blocker 2/3 については、実コード調査(check_implementation_overlap.py:1246-1250 と build_evidence() が OverlapResult の集約フィールドを一切参照しない事実)に基づき、classify_overlap() 本体(check_issue_overlap.py)を変更せず、adapter 側で既存の CandidateEvidence.dependency_relation(candidate 単位)を使うことで実害を解消できると判断し、Out of Scope に明記した。レビューで別方針(check_issue_overlap.py 側の集約 boolean 自体の是正)を要求する場合は Stop Condition に従い人間判断を仰ぐ
  • Major 2(blockedBy/blocking 両方向取得の冗長性)は、AC1 の successor index 構築が現在の unconditional 取得結果を再利用するだけで新規 API 呼び出しを増やさない設計のため、本 Issue の変更範囲では悪化しない。第二段階の candidate 側 N+1 取得(check_implementation_overlap.py:1466-1490)自体の削減は本 Issue の Out of Scope とする(別 Issue 候補)
  • Major 3(GitHub CLI v2.94.0+ の blockedBy/blocking JSON field 対応)は現行の REST transport 実装方針を変更しないため対象外とした
  • 実装: Issue scope snapshot と controlled executor で共通 staging/commit 境界を構築する #1611/実装: Codex 編集ガードから CODEX_ALLOWED_PATHS 系 env を廃止する #1612 は refinement 時点で CLOSED 済みのため、起票時に想定されていた live fixture はそのままでは使えない。AC は既存の test_check_implementation_overlap_successor_dependency.py(実装: classify_overlap に successor dependency 分岐を追加し parent_collision 誤判定を解消する #1619 で追加済みの 実装: Issue scope snapshot と controlled executor で共通 staging/commit 境界を構築する #1611/実装: Codex 編集ガードから CODEX_ALLOWED_PATHS 系 env を廃止する #1612 相当 fixture)を踏襲しつつ、adapter 層(check_implementation_overlap.py の CLI --dry-run 経路)向けの同型 fixture を新規に追加する前提とする
  • labels: enhancement に加えて phase/implementation / agent/implementer の付与を推奨する(OWNER Blocker 4 指摘)

Activity

  1. added
    enhancement
    on Jul 18, 2026
  2. squne121 commented on Jul 19, 2026

    @squne121
    OwnerAuthor

    判定

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

    問題の特定自体は正確です。最初の classify_overlap() では candidate の native dependency が空で、parent_child_collision になった候補が二段階目の dependency 取得対象に入らない循環が発生しています。PR #1622 も live route が human_review_required のままと明記しており、#1621 はその follow-up です。

    ただし、Issue が想定する「候補の blockedBy / blocking を前段取得する」という解決策は、既存資産を活用せず、API 負荷と新しい誤分類を増やします。また、Issue 本文は背景・想定 Outcome・参照しかなく、実装契約として成立していません。現在コメントもなく、対応 PR も存在しません。

    Blocker 1: candidate API 取得は不要。既取得の current.blocking を使うべき

    online 経路は、最初の _classify() より前に current Issue の blockedBy と blocking を両方とも全ページ取得しています。にもかかわらず、blocking は evidence に保存するだけの dead data とコメントされ、分類には使われていません。

    GitHub の意味論では、current Issue の blocking に candidate が含まれることは、その candidate が current に依存する successor であることを直接意味します。REST API にも「この Issue が block している依存先」を列挙する専用 endpoint があり、既存コードは最大百件単位で全ページ取得済みです。([GitHub Docs]1)

    したがって最小かつ安全な修正は次です。

    1. current の blocking typed records から (repository, issue_number) の successor index を作る。
    2. candidate scope 構築時、同一 repository かつ candidate number が index に存在すれば、current number を candidate の depends_on 相当入力として渡す。
    3. provenance は current_native_blocking と明示し、candidate の blockedBy を取得したように raw data を偽装しない。
    4. その状態で最初の classify_overlap() を一度実行する。

    これなら candidate ごとの追加 API 呼び出しはゼロです。

    Blocker 2: C2a successor が adapter で C1 に誤変換される

    pure classifier は successor を policy_class: C2a、reason_code: successor_dependency_ordering として返します。

    一方、implementation adapter は readback candidate の policy_class を次のように構築しています。

    • closed predecessor のみ C2a
    • duplicate は duplicate
    • それ以外の origin == "classify" は一律 C1

    つまり successor C2a も evidence 上は C1 になります。

    これは表示上の軽微な問題ではありません。進行中の PR #1615 は、candidate evidence の policy_class == "C1" を条件として human C1 decision を受理します。#1621 が successor を live route に到達させると、本来 C2a である候補が C1 decision により解除可能になる危険があります。PR #1615 の契約である「C1 override は C2 を解除しない」に違反します。

    必須修正は、candidate 単位で次を保持することです。

    • dependency_relation
    • policy_class
    • reason_code
    • dependency provenance

    adapter 側で result.verdict だけから一括 C1 化してはいけません。

    Blocker 3: classifier の集約フラグが複数 candidate を誤分類する

    PR #1622 は overlap_partial_successor_dependency を単一 boolean として実装しています。

    そのため、例えば次の二候補が同時に存在するとします。

    • candidate A: 通常の C1 path overlap
    • candidate B: shared parent を持つ successor C2a

    B が一件あるだけで boolean が True になり、overlap_partial に含まれる A と B の全体が C2a の理由・comment template で返されます。

    #1621 によって successor が live データから見えるようになると、この潜在バグが顕在化します。次のいずれかが必要です。

    Blocker 4: Issue 契約が存在しない

    #1621 には以下がありません。

    • Machine-Readable Contract
    • Parent Issue / Goal Ref
    • Current Validated Scope
    • In Scope / Out of Scope
    • Acceptance Criteria
    • Runtime Verification Applicability
    • Verification Commands
    • Allowed Paths
    • Stop Conditions
    • Schema Change Applicability
    • 関連 Issue との dependency ordering

    対照的に、同じ script を変更する #1493 と #1613 は、収集契約・evidence schema・競合 Issue・検証境界まで定義しています。

    少なくともラベルも enhancement だけで、phase/implementation や agent/implementer は付いていません。

    現状は障害メモであって、実装 Issue ではありません。

    Blocker 5: 同一ファイルを触る進行中作業との順序が未定義

    PR #1615 は現在も open / draft で、次の三ファイルを変更しています。

    • check_implementation_overlap.py
    • test_check_implementation_overlap.py
    • test_check_implementation_overlap_native_dependencies.py

    最新レビューは approve ですが、branch update などの機械処理が残っています。

    さらに #1493 は candidate collection を現在の単発 gh issue list --limit から cursor pagination へ置換し、同じ script と evidence source contract を変更する予定です。

    推奨順序は次です。

    1. PR feat: SHA固定のC1 overlap decisionを検証する (#1613) #1615 を先に確定する。
    2. 実装: check_implementation_overlap.py の候補に native dependency を前段取得し successor 判定を live route まで反映する #1621 は PR feat: SHA固定のC1 overlap decisionを検証する (#1613) #1615 上へ rebase し、C2a/C1 境界を修正する。
    3. 実装: open-pr の overlap preflight hard gate に --limit 伝播を追加し repo 規模拡大による全面停止を解消する #1493 とは C2 collision として直列化する。
    4. 実装: check_implementation_overlap.py の候補に native dependency を前段取得し successor 判定を live route まで反映する #1621 が先なら、実装: open-pr の overlap preflight hard gate に --limit 伝播を追加し repo 規模拡大による全面停止を解消する #1493 に successor hydration の回帰 AC を追加する。
    5. 実装: open-pr の overlap preflight hard gate に --limit 伝播を追加し repo 規模拡大による全面停止を解消する #1493 が先なら、dependency fields を candidate collection に含め、実装: check_implementation_overlap.py の候補に native dependency を前段取得し successor 判定を live route まで反映する #1621 を吸収できるか再評価する。

    Major 1: selector 条件が曖昧かつ間違っている

    Issue は取得対象を「Allowed Paths が重複する候補、または shared parent_refs を持つ候補」としています。

    しかし classifier が dependency relation を評価するのは has_path の内側だけです。shared parent があっても path overlap がなければ successor 情報は verdict を変えません。

    逆に、shared parent がなくても、同一 path set の candidate が successor なら、dependency 情報によって duplicate から C1/C2a 系へ変化します。したがって candidate fetch fallback を残す場合の正しい対象は、

    schema validation 済みで、正規化後の Allowed Paths が current と実際に conflict する全 candidate

    です。「shared parent 候補」ではありません。

    Major 2: blockedBy と blocking の両取得は冗長

    _issue_scope_from_raw() が candidate の depends_on へ統合している native data は blockedBy だけです。candidate の blocking は successor 判定には使われません。

    candidate ごとに両方向を REST 取得すると、--limit 300 では最低でも最大六百リクエストになり、dependency が百件を超えればさらに増えます。GitHub Actions の GITHUB_TOKEN は通常、一 repository あたり毎時千リクエストで、secondary rate limit も存在します。([GitHub Docs]2)

    current blocking index を使わず candidate REST N+1 を採用する合理性はありません。

    Major 3: GitHub CLI の現行機能を契約に反映していない

    GitHub CLI v2.94.0 以降は、gh issue view と gh issue list の JSON fields として blockedBy / blocking を直接公開しています。現行 manual にも両フィールドが掲載されています。([GitHub CLI]3)

    したがって、将来的に #1493 の candidate collection を更新する際は次のどちらかを明示すべきです。

    • GitHub CLI v2.94.0 以上を minimum version として検証し、list/query 時点で dependency data も収集する。
    • 旧 CLI を許容する場合は、現在の REST transport を compatibility fallback として保持する。

    version check なしで新 JSON field に切り替えるのも、現行 REST N+1 を恒久化するのも不十分です。

    必須テスト

    最低限、次を Acceptance Criteria に入れる必要があります。

    1. candidate raw に blockedBy がなくても、current の blocking から 実装: Codex 編集ガードから CODEX_ALLOWED_PATHS 系 env を廃止する #1612 相当を successor と判定できる。
    2. dependency hydration が最初の classify_overlap() より前に完了する。
    3. 実装: Issue scope snapshot と controlled executor で共通 staging/commit 境界を構築する #1611/実装: Codex 編集ガードから CODEX_ALLOWED_PATHS 系 env を廃止する #1612 fixture で dependency_relation == successor、policy_class == C2a、reason_code == successor_dependency_ordering になる。
    4. exact live fixture では route == proceed_with_collision_evidence になる。
    5. 通常 C1 candidate と successor C2a candidate が混在しても policy class が汚染されない。
    6. PR feat: SHA固定のC1 overlap decisionを検証する (#1613) #1615 の human C1 decision が successor C2a を解除できない。
    7. current の blocking だけで candidate API 呼び出しが増えない。
    8. cross-repository の同一 issue number を successor として誤結合しない。
    9. blockedBy と blocking の向きを逆転しない。
    10. current dependency API の失敗・ページ欠落・shape 不正は従来どおり fail-closed。
    11. PR feat: SHA固定のC1 overlap decisionを検証する (#1613) #1615 と 実装: open-pr の overlap preflight hard gate に --limit 伝播を追加し repo 規模拡大による全面停止を解消する #1493 のテストスイートを含む全 regression が通る。
    12. read-only live verification で 実装: Issue scope snapshot と controlled executor で共通 staging/commit 境界を構築する #1611/実装: Codex 編集ガードから CODEX_ALLOWED_PATHS 系 env を廃止する #1612 の candidate evidence と route を bounded JSON artifact に保存する。

    推奨する Outcome

    check_implementation_overlap.py が、最初の分類前に取得済みの current Issue の native blocking typed records を同一 repository の candidate scope へ successor relation として接続する。これにより candidate ごとの追加 dependency API 呼び出しを行わず、#1611/#1612 相当の shared-parent/path-overlap シナリオを parent_child_collision ではなく candidate 単位の C2a successor_dependency_ordering として分類する。adapter evidence は classifier の candidate 単位 policy class を保持し、human C1 decision が C2a candidate を解除できない。通常 C1、predecessor C2b、duplicate、cross-repository、source degradation の既存 fail-closed semantics は変更しない。

    結論として、#1621 はそのまま実装せず、current blocking 再利用、C2a evidence 修正、PR #1615/Issue #1493 との直列化を契約へ追加してから着手すべきです。

  3. squne121 commented on Jul 19, 2026

    @squne121
    OwnerAuthor

    issue-refinement-loop 完了報告

    issue-refinement-loop を 1 iteration で完了した。

    実施内容

    直前の OWNER コメント(REQUEST_CHANGES、Blocker 1-5 / Major 1-3、契約セクション全欠落)を受け、Issue 本文を全面的に書き直した。

    • Machine-Readable Contract / Outcome / Background / In Scope / Out of Scope / Acceptance Criteria / Runtime Verification Applicability / Verification Commands / Allowed Paths / Stop Conditions / Schema Change Applicability / Required Skills / Required Design References / Delivery Rule / Notes for Reviewer を新規追加した。
    • Blocker 1(successor index の入力源)と Blocker 4(契約セクション欠落)は OWNER 指摘どおりに反映した。
    • Blocker 2/3 は、実コード調査(check_implementation_overlap.py の build_evidence() が check_issue_overlap.classify_overlap() の集約 policy_class/reason_code を一切参照しない事実を確認)に基づき、check_issue_overlap.py 本体は変更せず、adapter 側で既存の CandidateEvidence.dependency_relation(candidate 単位)を使う方針に落とし込み、Out of Scope として明記した。
    • 実装: Issue scope snapshot と controlled executor で共通 staging/commit 境界を構築する #1611/実装: Codex 編集ガードから CODEX_ALLOWED_PATHS 系 env を廃止する #1612 は refinement 時点で既に CLOSED であることを確認し、起票時点の live fixture 前提が崩れていたため、Runtime Verification Applicability を not_applicable に修正し、既存のオフライン --dry-run 経路と pure classifier 単体テストで全 AC を検証する設計にした。
    • PR feat: SHA固定のC1 overlap decisionを検証する (#1613) #1615(同一ファイルを変更中、レビュー時点で merge_ready: true だが未マージ)への blocked_by 依存を Machine-Readable Contract に明記した。

    レビュー結果

    review-issue skill(check_issue_contract.py 等の deterministic checker)による再レビューは以下の通り:

    STATUS: ok
    VERDICT: approve
    SUMMARY: contract ready
    BLOCKERS: 0
    NEXT_ACTION: proceed
    

    C1-C11 の deterministic check は全て pass、validate_issue_body / baseline_vc_preflight はいずれも exit 0。非 blocking の情報提供として、Current Validated Scope と In Scope の語彙 Jaccard 類似度が閾値をやや下回る旨の warning のみ検出されたが、承認を妨げるものではない。

    未実施事項(環境制約による)

    このセッションでは、issue-refinement-loop の正規 termination flow(validate_review_compact_output.py による machine envelope 検証、および publish_termination_report.py による LOOP_HANDOFF_RESULT_V1 marker の自動生成・投稿)を、ローカル hook(local_main_branch_guard / worktree_scope_guard)の制約により実行できなかった。両スクリプトは .claude/skills/issue-refinement-loop/scripts/ 配下で root 実行が禁止されており、かつ issue-bound worktree からの実行も worktree 側 hook で阻まれたため、正規の自動化経路を使い切れなかった。そのため本コメントは正規の LOOP_HANDOFF_RESULT_V1 machine marker ではなく、人間可読の手動報告としている。

    ラベル phase/implementation / agent/implementer の付与も、controlled executor に対応する command id が存在しないため未実施。人間による手動付与を推奨する。

    次のステップとして、issue-contract-review および impl-review-loop(または implement-issue)へ進める状態にあると判断する。

  4. squne121 commented on Jul 19, 2026

    @squne121
    OwnerAuthor

    Contract Snapshot(issue-contract-review, status: go)

    run_contract_review_once.py --mode static(readiness_check: go / blockers: pass / product_spec: pass / vc_preflight: pass、全 4 check pass)による preflight 結果。

    • body_sha256: sha256:8a812d9585e5a735f9354dde8ffa8ed26466a1d90d85768691e57708791090b4

    Outcome

    check_implementation_overlap.py が、最初の分類前に取得済みの current Issue の native blocking typed records を同一 repository の candidate scope へ successor relation の入力として接続する。これにより candidate ごとの追加 dependency API 呼び出しを行わず、shared-parent/path-overlap かつ candidate が current に対して native dependency 経由で依存している(successor)シナリオを parent_child_collision(AMBIGUOUS_REQUIRES_HUMAN/C3)ではなく proceed_with_collision_evidence route・candidate 単位の C2a successor_dependency_ordering として分類する。implementation adapter の evidence は check_issue_overlap.classify_overlap が candidate ごとに返す dependency_relation を保持し、origin と集約 result.verdict だけからの一律 C1 化をやめる。

    Acceptance Criteria(AC1-AC11)

    Issue 本文の ## Acceptance Criteria を正本とする(11件)。

    Verification Commands / VC preflight 集約

    全 11 AC の VC はいずれも classification: expected_pass / category: regression_gate / decision: go / exit_code: 0(実行済み、baseline で既存 test が pass することを確認。新規 successor index 注入・adapter policy_class 修正の実装自体は未着手のため、これらは既存回帰テストの baseline pass 確認)。

    summary: expected_fail=0, unexpected_pass=0, blocked=0, human_judgment=0, expected_pass=11, skipped=0, extraction_errors=0
    status: pass
    

    代表例:

    • AC1/AC8/AC9: uv run pytest .claude/skills/implement-issue/tests/test_check_implementation_overlap_native_dependencies.py -q → 43 passed
    • AC2: uv run pytest .claude/skills/implement-issue/tests/test_check_implementation_overlap_successor_dependency.py -q → 2 passed
    • AC3-AC6: uv run pytest .claude/skills/implement-issue/tests/test_check_implementation_overlap.py -q → 32 passed
    • AC7: uv run pytest .claude/skills/implement-issue/tests/test_check_implementation_overlap_repository_binding.py -q → 11 passed
    • AC10/AC11: uv run pytest .claude/skills/implement-issue/tests/ -q → 164 passed

    Allowed Paths

    • .claude/skills/implement-issue/scripts/check_implementation_overlap.py
    • .claude/skills/implement-issue/tests/test_check_implementation_overlap.py
    • .claude/skills/implement-issue/tests/test_check_implementation_overlap_native_dependencies.py
    • .claude/skills/implement-issue/tests/test_check_implementation_overlap_successor_dependency.py
    • .claude/skills/implement-issue/tests/test_check_implementation_overlap_repository_binding.py

    Worktree / Branch

    • worktree: .claude/worktrees/issue-1621-successor-index-adapter-fix
    • branch: issue-1621-successor-index-adapter-fix(命名衝突なし、git worktree list で確認)

    Stop Conditions / Dependency

    Status: go

    implement-issue へ handoff 可能。ただし Stop Conditions により、PR #1615 のマージ待ちが実装着手の前提条件。

    (注記: run_contract_review_once.py --mode execute はこのセッションの環境で内部 30 秒 timeout に達し runtime_error を返したため、--mode static の実行結果を正本として本 Contract Snapshot を手動投稿している。--mode execute の timeout 自体は Issue #1621 の内容とは無関係な既存スクリプトの制約であり、follow-up 検討対象。)

  5. added
    phase/implementation
    agent/implementer
    on Jul 19, 2026
  6. changed the title [-]check_implementation_overlap.py の候補に native dependency を前段取得し successor 判定を live route まで反映する[/-] [+]実装: check_implementation_overlap.py の候補に native dependency を前段取得し successor 判定を live route まで反映する[/+] on Jul 19, 2026
  7. squne121 commented on Jul 19, 2026

    @squne121
    OwnerAuthor

    Contract Review Result

    CONTRACT_REVIEW_RESULT_V1:
      status: go
      generated_at: "2026-07-19T07:28:07Z"
      generated_by: issue-contract-review
      issue_url: https://github.com/squne121/loop-protocol/issues/1621
      body_sha256: "sha256:8a812d9585e5a735f9354dde8ffa8ed26466a1d90d85768691e57708791090b4"
      checks:
        readiness: go
        blockers: pass
        product_spec: pass
        product_spec_check: {"schema":"product_spec_check/v1","applicability":"applicable","decision":"pass","triggers":{"docs_product_allowed_paths":false,"tasks_md_mentioned":false,"specify_artifact_mentioned":false,"generated_task_mentioned":false,"product_spec_context_present":false,"machine_readable_contract_present":true},"conditions":{"docs_product_requires_spec_evidence":{"status":"pass","evidence":[]},"tasks_md_not_direct_source":{"status":"pass","evidence":[]},"specify_not_canonical":{"status":"pass","evidence":[]},"diff_first_rationale_present":{"status":"pass","evidence":[]},"generated_task_trace_present":{"status":"pass","evidence":[]},"task_dependencies_materialized":{"status":"pass","evidence":[]}},"blocked_reasons":[],"body_sha256":"sha256:8a812d9585e5a735f9354dde8ffa8ed26466a1d90d85768691e57708791090b4","source_provenance":{"source_type":"github_api","body_file":null}}
        vc_preflight:
          decision: pass
          classifications: [{"ac":"AC1","line":2,"raw_command":"uv run pytest .claude/skills/implement-issue/tests/test_check_implementation_overlap_native_dependencies.py -q","command_hash":"sha256:717e2676915693631215320473a78264da6458d21864d656fc27253891400535","execution_key_hash":"sha256:81db2802f8bb54f0d8310c28d814e6e10b8122fe007fdf7aa997545af168eae2","runner":"exec","exit_code":0,"classification":"expected_pass","category":"regression_gate","decision":"go","scope_class":"regression_gate","confidence":"low","stdout_head":["...........................................                              [100%]","43 passed in 4.30s"],"stdout_truncated":false,"stdout_original_line_count":3,"stderr_head":[],"stderr_truncated":false,"stderr_original_line_count":1,"runner_env_delta":{},"duration_ms":4484,"fix_hint":null,"certified_target_paths":null,"annotations":{"baseline_expect":null,"vc_role":null,"missing_baseline_expect":false},"annotation_source":{"line":null,"raw":null},"strict":null,"repair":null},{"ac":"AC2","line":2,"raw_command":"uv run pytest .claude/skills/implement-issue/tests/test_check_implementation_overlap_successor_dependency.py -q","command_hash":"sha256:53a44abe1a47147a07e29739844d8bbbec53cb0408a1025546860e42bb556806","execution_key_hash":"sha256:1264bbbb2ebceb2ae47fb0b468ce370e91edfdc0a12242311dd67026a4d89ee5","runner":"exec","exit_code":0,"classification":"expected_pass","category":"regression_gate","decision":"go","scope_class":"regression_gate","confidence":"low","stdout_head":["..                                                                       [100%]","2 passed in 0.02s"],"stdout_truncated":false,"stdout_original_line_count":3,"stderr_head":[],"stderr_truncated":false,"stderr_original_line_count":1,"runner_env_delta":{},"duration_ms":297,"fix_hint":null,"certified_target_paths":null,"annotations":{"baseline_expect":null,"vc_role":null,"missing_baseline_expect":false},"annotation_source":{"line":null,"raw":null},"strict":null,"repair":null},{"ac":"AC3","line":2,"raw_command":"uv run pytest .claude/skills/implement-issue/tests/test_check_implementation_overlap.py -q","command_hash":"sha256:4f07735878062f767969897d19fc957580b9df1631da22ae10b8a2b76811a8a1","execution_key_hash":"sha256:27ae9e76ffa2efbe6c839ef13c9b4e9d2f21baad49f928b9e369cef24a5a9090","runner":"exec","exit_code":0,"classification":"expected_pass","category":"regression_gate","decision":"go","scope_class":"regression_gate","confidence":"low","stdout_head":[".............................................                            [100%]","45 passed in 3.55s"],"stdout_truncated":false,"stdout_original_line_count":3,"stderr_head":[],"stderr_truncated":false,"stderr_original_line_count":1,"runner_env_delta":{},"duration_ms":3791,"fix_hint":null,"certified_target_paths":null,"annotations":{"baseline_expect":null,"vc_role":null,"missing_baseline_expect":false},"annotation_source":{"line":null,"raw":null},"strict":null,"repair":null},{"ac":"AC4","line":2,"raw_command":"uv run pytest .claude/skills/implement-issue/tests/test_check_implementation_overlap.py -q","command_hash":"sha256:4f07735878062f767969897d19fc957580b9df1631da22ae10b8a2b76811a8a1","execution_key_hash":"sha256:ebc61a1d3d6599e970c49c860bfea472a383f87e4dfced1c273a4f0961842ae3","runner":"exec","exit_code":0,"classification":"expected_pass","category":"regression_gate","decision":"go","scope_class":"regression_gate","confidence":"low","stdout_head":[".............................................                            [100%]","45 passed in 3.45s"],"stdout_truncated":false,"stdout_original_line_count":3,"stderr_head":[],"stderr_truncated":false,"stderr_original_line_count":1,"runner_env_delta":{},"duration_ms":3706,"fix_hint":null,"certified_target_paths":null,"annotations":{"baseline_expect":null,"vc_role":null,"missing_baseline_expect":false},"annotation_source":{"line":null,"raw":null},"strict":null,"repair":null},{"ac":"AC5","line":2,"raw_command":"uv run pytest .claude/skills/implement-issue/tests/test_check_implementation_overlap.py -q","command_hash":"sha256:4f07735878062f767969897d19fc957580b9df1631da22ae10b8a2b76811a8a1","execution_key_hash":"sha256:e7579f9128b8e1dcd3be7d5536f3a76fe5ca350df34dd524d1b73d381cdd444c","runner":"exec","exit_code":0,"classification":"expected_pass","category":"regression_gate","decision":"go","scope_class":"regression_gate","confidence":"low","stdout_head":[".............................................                            [100%]","45 passed in 3.06s"],"stdout_truncated":false,"stdout_original_line_count":3,"stderr_head":[],"stderr_truncated":false,"stderr_original_line_count":1,"runner_env_delta":{},"duration_ms":3329,"fix_hint":null,"certified_target_paths":null,"annotations":{"baseline_expect":null,"vc_role":null,"missing_baseline_expect":false},"annotation_source":{"line":null,"raw":null},"strict":null,"repair":null},{"ac":"AC6","line":2,"raw_command":"uv run pytest .claude/skills/implement-issue/tests/test_check_implementation_overlap.py -q","command_hash":"sha256:4f07735878062f767969897d19fc957580b9df1631da22ae10b8a2b76811a8a1","execution_key_hash":"sha256:47151e42e16d5e2d42d196c6d011f9d0c5f699de344388867343ba9a3663786b","runner":"exec","exit_code":0,"classification":"expected_pass","category":"regression_gate","decision":"go","scope_class":"regression_gate","confidence":"low","stdout_head":[".............................................                            [100%]","45 passed in 3.35s"],"stdout_truncated":false,"stdout_original_line_count":3,"stderr_head":[],"stderr_truncated":false,"stderr_original_line_count":1,"runner_env_delta":{},"duration_ms":3561,"fix_hint":null,"certified_target_paths":null,"annotations":{"baseline_expect":null,"vc_role":null,"missing_baseline_expect":false},"annotation_source":{"line":null,"raw":null},"strict":null,"repair":null},{"ac":"AC7","line":2,"raw_command":"uv run pytest .claude/skills/implement-issue/tests/test_check_implementation_overlap_repository_binding.py -q","command_hash":"sha256:5c957a4ea049e8cb2eb41295f5e5dc033ff60a22b4b5dacad2e4d5488c24a0ef","execution_key_hash":"sha256:bfc2a6e60df7fe4d43912b9b40d7cd1d1417fa9d1e8158aa9336df5464770e4d","runner":"exec","exit_code":0,"classification":"expected_pass","category":"regression_gate","decision":"go","scope_class":"regression_gate","confidence":"low","stdout_head":["...........                                                              [100%]","11 passed in 0.59s"],"stdout_truncated":false,"stdout_original_line_count":3,"stderr_head":[],"stderr_truncated":false,"stderr_original_line_count":1,"runner_env_delta":{},"duration_ms":806,"fix_hint":null,"certified_target_paths":null,"annotations":{"baseline_expect":null,"vc_role":null,"missing_baseline_expect":false},"annotation_source":{"line":null,"raw":null},"strict":null,"repair":null},{"ac":"AC8","line":2,"raw_command":"uv run pytest .claude/skills/implement-issue/tests/test_check_implementation_overlap_native_dependencies.py -q","command_hash":"sha256:717e2676915693631215320473a78264da6458d21864d656fc27253891400535","execution_key_hash":"sha256:91c305dd78517f5c68e223f4a766adb8830b753b66b335949c24f7ba79837e08","runner":"exec","exit_code":0,"classification":"expected_pass","category":"regression_gate","decision":"go","scope_class":"regression_gate","confidence":"low","stdout_head":["...........................................                              [100%]","43 passed in 4.60s"],"stdout_truncated":false,"stdout_original_line_count":3,"stderr_head":[],"stderr_truncated":false,"stderr_original_line_count":1,"runner_env_delta":{},"duration_ms":4785,"fix_hint":null,"certified_target_paths":null,"annotations":{"baseline_expect":null,"vc_role":null,"missing_baseline_expect":false},"annotation_source":{"line":null,"raw":null},"strict":null,"repair":null},{"ac":"AC9","line":2,"raw_command":"uv run pytest .claude/skills/implement-issue/tests/test_check_implementation_overlap_native_dependencies.py -q","command_hash":"sha256:717e2676915693631215320473a78264da6458d21864d656fc27253891400535","execution_key_hash":"sha256:672cb56bcd885395ab45f882a52c2a13aff315374eb1f1b49d1a2320bfe2f9e9","runner":"exec","exit_code":0,"classification":"expected_pass","category":"regression_gate","decision":"go","scope_class":"regression_gate","confidence":"low","stdout_head":["...........................................                              [100%]","43 passed in 4.51s"],"stdout_truncated":false,"stdout_original_line_count":3,"stderr_head":[],"stderr_truncated":false,"stderr_original_line_count":1,"runner_env_delta":{},"duration_ms":7747,"fix_hint":null,"certified_target_paths":null,"annotations":{"baseline_expect":null,"vc_role":null,"missing_baseline_expect":false},"annotation_source":{"line":null,"raw":null},"strict":null,"repair":null},{"ac":"AC10","line":2,"raw_command":"uv run pytest .claude/skills/implement-issue/tests/ -q","command_hash":"sha256:5a96a49549465acfab49dd13afd976f81aaee1fd85e781fdd1844dc645159310","execution_key_hash":"sha256:5c7e5fbf3d75d4446b6d50d3e8028bf395ac9b5f5df63768674e0ece8c29747d","runner":"exec","exit_code":0,"classification":"expected_pass","category":"regression_gate","decision":"go","scope_class":"regression_gate","confidence":"low","stdout_head":["........................................................................ [ 40%]","........................................................................ [ 81%]",".................................                                        [100%]","177 passed in 9.00s"],"stdout_truncated":false,"stdout_original_line_count":5,"stderr_head":[],"stderr_truncated":false,"stderr_original_line_count":1,"runner_env_delta":{},"duration_ms":9207,"fix_hint":null,"certified_target_paths":null,"annotations":{"baseline_expect":null,"vc_role":null,"missing_baseline_expect":false},"annotation_source":{"line":null,"raw":null},"strict":null,"repair":null},{"ac":"AC11","line":2,"raw_command":"uv run pytest .claude/skills/implement-issue/tests/ -q","command_hash":"sha256:5a96a49549465acfab49dd13afd976f81aaee1fd85e781fdd1844dc645159310","execution_key_hash":"sha256:1d4ca6f3a0af34bedf29445ba905b296c2fdb2ae9b92b42a04f62857e70749c3","runner":"exec","exit_code":0,"classification":"expected_pass","category":"regression_gate","decision":"go","scope_class":"regression_gate","confidence":"low","stdout_head":["........................................................................ [ 40%]","........................................................................ [ 81%]",".................................                                        [100%]","177 passed in 8.56s"],"stdout_truncated":false,"stdout_original_line_count":5,"stderr_head":[],"stderr_truncated":false,"stderr_original_line_count":1,"runner_env_delta":{},"duration_ms":8828,"fix_hint":null,"certified_target_paths":null,"annotations":{"baseline_expect":null,"vc_role":null,"missing_baseline_expect":false},"annotation_source":{"line":null,"raw":null},"strict":null,"repair":null}]
      source: ensure_contract_snapshot_auto
      expected_contract_fingerprint: {"issue_number":1621,"contract_source_kind":"issue_comment","contract_source_id":"5014864289","contract_body_sha256":"sha256:8a812d9585e5a735f9354dde8ffa8ed26466a1d90d85768691e57708791090b4","allowed_paths_normalized_sha256":"a63c7d08b348b8c69b073889f4379f20d696b32f72b0014e74c5e92ef0ea205f","base_ref":"main","base_sha_at_snapshot":"4ab8ec2d9495638695ef774fb8737b509585f492"}
  8. squne121 commented on Jul 19, 2026

    @squne121
    OwnerAuthor

    Stop Condition: Issue #1493 の実装が同一関数近傍に着手済み

    実装着手前の preflight で確認したところ、以下の Stop Condition に該当する状況を確認しました。

    着手時点で Issue #1493 の実装が同一関数近傍(candidate 収集部)に着手済み・競合診断が必要な場合は、直列化順序を人間に確認する

    確認した事実

    判断

    本 Issue #1621 の Allowed Paths・In Scope は check_implementation_overlap.py の _classify() と implementation adapter の candidate evidence 構築ロジック(build_evidence() 周辺)に限定されており、これは PR #1626 が現在進行形で変更している範囲と直接重複します。このまま実装に着手すると、以下のいずれかのリスクがあります。

    1. PR fix: overlap preflight の候補収集を cursor pagination 化し limit 超過境界を修正する (#1493) #1626 が先にマージされた場合、本 Issue の実装が同関数の rebase コンフリクトを引き起こす、または fix: overlap preflight の候補収集を cursor pagination 化し limit 超過境界を修正する (#1493) #1626 の未 rebase 分の human C1 decision 機構の巻き戻しを誤って引き継ぐ
    2. 本 Issue の PR が先にマージされた場合、fix: overlap preflight の候補収集を cursor pagination 化し limit 超過境界を修正する (#1493) #1626 側で同様の rebase / コンフリクト対応が必要になる

    Issue 本文の Stop Conditions に明記された通り、直列化順序(#1626 のマージ待ちにするか、並行実装を許容するか)について人間判断を仰ぎたく、実装(worktree 作成・コード変更)は着手せず停止します。

  9. squne121 commented on Jul 19, 2026

    @squne121
    OwnerAuthor

    人間判断: 直列化順序の決定(Stop Condition 解消)

    前コメント(#1621 (comment) )で報告した Stop Condition「Issue #1493 の実装(PR #1626)が同一関数近傍(_classify() / build_evidence())に着手済み」について、人間判断により以下の方針が決定されました。

    この決定により、当該 Stop Condition は解消されたものとして扱い、実装作業を再開します。

  10. squne121 commented on Jul 19, 2026

    @squne121
    OwnerAuthor

    implement-issue: 実装完了

    実装中に発生した事象と対応

  11. squne121 commented on Jul 19, 2026

    @squne121
    OwnerAuthor

    PR #1637 CI 失敗の原因特定と修正完了

    原因

    cross-test pollution ではなく、私自身の push 手順ミスでした。

    実装完了直前に main(PR #1626 / #1493 マージ後)を worktree ブランチへ merge した際、fetch_implementation_candidates() の戻り値契約が (candidates, saturated: bool) から (candidates, source_metadata: dict) へ変わったことに気づき、新規追加した AC1 テスト(test_given_online_run_when_current_native_blocking_shared_parent_candidate_then_successor_c2a_without_extra_calls)の mock(fake_fetch_implementation_candidates)を dict 形へローカルで修正しました。ローカルでは修正後に 211 件全て PASS することを確認しましたが、その修正コミットを作成し忘れたまま git push してしまい、CI には旧 mock(return [...], False)のままの commit が渡っていました。

    そのため CI 上では run() 内の saturated = bool(source_collection_metadata["saturated"]) で source_collection_metadata が False(bool)のまま渡り、bool(False["saturated"]) が TypeError("'bool' object is not subscriptable") を起こし、application 側の except (ValueError, TypeError, KeyError, AssertionError) に捕捉されて route: runtime_error として evidence 化されていました。本体実装 check_implementation_overlap.py 側にバグはなく、私が追加したテストの mock 契約不整合のみが原因です。

    修正内容

    test_check_implementation_overlap_native_dependencies.py の fake_fetch_implementation_candidates mock を、collection_mode / page_size / page_count / fetched_count / has_next_page / complete / saturated を持つ source_metadata dict を返すよう修正しました(commit 1c18dd06)。Allowed Paths 外の変更は不要でした。

    検証

    • 対象テスト単独(-n 4 --dist loadscope): PASS
    • .claude/skills/implement-issue/tests/ 全 211 件: PASS
    • coordinator 提供の CI 相当 full scope(scripts/ci/python_test_plan.py --emit run-argv --mode parallel が生成する全ディレクトリ、-n 4 --dist loadscope)をローカルで再現実行: 8424 passed, 1 failed(対象外), 4 skipped, 2 xfailed。唯一の失敗 tests/context_mode/test_fetch_strict_artifact.py::...::test_artifact_head_sha_matches_git_head は skipif(CI == "true") で CI 上は必ず SKIP される local-only artifact staleness チェックであり、ローカルで新しい commit を作った直後に artifact 再生成をしていないことが原因(Allowed Paths 外、本 Issue と無関係)。対象の AC1 テストはこの full scope 実行で PASS しています。

    修正を push 済みです(branch head: 1c18dd06)。CI の再実行結果をご確認ください。

  12. squne121 commented on Jul 19, 2026

    @squne121
    OwnerAuthor

    PR #1637 OWNER REQUEST_CHANGES 対応完了

    OWNER レビュー(#1637 (comment) )で指摘された P1 Blocker / P2 Major / P2 Conditional / P3 Minor の4点すべてに対応し、push・PR本文更新済みです(head 79257096)。

    P1 Blocker(追加API呼び出しゼロ契約違反)

    第二段階 readback(run() の candidate 側 native dependency hydration)から、current_native_blocking により successor 関係が確定済みの candidate を除外しました。新規/更新テストは fetch_native_dependencies()(下位の blocked_by/blocking endpoint 単位)の呼び出し回数を厳密に固定して検証しています: current issue は blocked_by 1回・blocking 1回のみ、successor candidate は両方向とも 0回。テスト名の矛盾(..._without_extra_calls なのに追加呼び出しを許容する assertion になっていた点)も解消しました。

    P2 Major(dependency_relation / provenance 欠落)

    candidate evidence に dependency_relation("successor" | "predecessor" | "none")と dependency_provenance([{"source": ..., "repository": ..., "issue_number": ...}])を追加しました。_successor_dependency_provenance() / _predecessor_dependency_provenance() を新設し、current_native_blocking / candidate 自身の Machine-Readable Contract の blocked_by / legacy Depends on #N テキスト / candidate 自身の native blockedBy のいずれから証明されたかを列挙します(複数該当する場合は全て列挙)。両フィールドは decision_inputs_sha256 の計算対象(candidates_evidence の一部)に含まれます。additive schema change のため PR本文の Schema Change Applicability(schema_change へ変更)と Schema Consumer Inventory(open_pr.py が .get() ベースで未知フィールドを無視することをソース確認して記載)を更新しました。

    P2 Conditional(AC7の (repository, issue_number) タプル未実装)

    _current_native_successor_numbers()(frozenset[int])を _current_native_successor_index()(frozenset[tuple[str, int]])へ変更し、実際に (repository, issue_number) のタプルで比較するようにしました。number だけの frozenset に潰す旧実装を解消し、candidate identity の repository が異なる場合に誤結合しないことを検証する新規テストも追加しています。

    P3 Minor(コメント矛盾)

    dependency_resolution 構築部の「native_blocking は判定に使われない dead data」というコメントを、実際の挙動(evidence と successor index の双方に使う。candidate raw の blockedBy を取得したかのように偽装しない)に合わせて更新しました。

    検証

    • .claude/skills/implement-issue/tests/ 配下 213件全て PASS(AC1〜AC11 の個別 Verification Commands も全て PASS)
    • ruff check PASS
    • coordinator 提供の CI 相当 full scope(-n 4 --dist loadscope、約 8400 件)をローカルで再現実行し、対象の実装テストは全て PASS。4件の無関係な失敗(tmpディレクトリ競合・subprocess timeout・uv バージョン警告・ローカル専用 artifact 鮮度チェック、いずれも CI=="true" では発生しない/対象外)を確認済みですが、Allowed Paths 外・本 Issue と無関係です
    • git diff main...HEAD は Allowed Paths 5 ファイルと完全一致

    PR: https://github.com/squne121/loop-protocol/pull/1637(head 79257096)

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/implementation

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions