Skip to content

調査: impl-review-loop の irrelevant sibling cross-reference が qualification 前の freshness 検証で current Issue を停止し得る残余リスクを解消する #2761

Closed
1 of 1 issue completed

Description

@squne121

Machine-Readable Contract

contract_schema_version: v1
issue_kind: research
parent_issue: "none"
goal_ref: "impl-review-loop で current target に irrelevant と判定可能な sibling cross-reference が、qualification 前の freshness/materialization 検証だけを理由に current Issue を reconciliation_required へ停止させる残余リスクを、fail-closed 境界を弱めずに解消する方針を確定する"
change_kind: research-only
source_pr: 2758
source_issue: 2750
dedupe_key: "impl-review-loop:irrelevant-sibling-prequalification-freshness-stop"

Background

PR #2758 のレビューで、Issue #2750 の bounded carve-out により derive_landing_disposition() の conflict counting から sibling cross-reference を除外できる一方、canonical production entry の resolve_landing_disposition_with_freshness_rebind() は qualification より前に全 candidate の PR identity freshness を再取得するため、current target には irrelevant な candidate でも head drift / detail read failure 等によって freshness_rebind_failed -> reconciliation_required を発生させ得ることを確認した。

Source review:
#2758 (comment)

これは PR #2758 の merge blocker にはしない。#2758 は Issue #2750 の bounded conflict-counting fix に限定して完了済み(マージ済み)。

例:

verified_cross_reference candidate
  -> durable marker は別 Issue identity を指す
  -> current target の landing authority としては irrelevant
  -> ただし qualification 前の freshness check には参加
  -> open/draft sibling head drift / PR detail transport failure
  -> freshness_rebind_failed
  -> current target が reconciliation_required で停止

current target と無関係な sibling candidate の変動が、current implementation workflow の可用性を落とす余地が残る。

repository investigation による裏付け(current main、implementation_landed_evidence.py)

  • resolve_landing_disposition_with_freshness_rebind()(同ファイル 751-811 行)は disposition 確定直前に _live_freshness_reference()(678-738 行)で issue_body_sha256 / 各 candidate の merge_oid-or-head_sha / main HEAD sha の3値のみを live 再取得し、drift があれば bounded 1 回の collect_candidate_inputs() re-discovery + re-evaluation を行う。candidate PR の body と closingIssuesReferences は decision-time に再取得していない。
  • sibling が current target と無関係と判定されるロジックは _is_irrelevant_cross_reference()(308 行〜)および derive_landing_disposition()(336 行〜)にあり、_live_freshness_reference() 自体はこの判定を行わない。
  • coverage_from_pr_body() / _parse_marker()(172-213 行)が scope_coverage_issue_identity_mismatch を生成する箇所を確認した。pr_head_sha は _valid_sha()(195-196 行)でフォーマット検証されるのみで、disposition/freshness の authority としては使われていない(Issue 実装: impl-review-loop intakeにevidence-based landing dispositionを実装する #2699 の audit-only 契約どおり)。
  • closingIssuesReferences は collect_candidate_inputs()(469-628 行)内で取得され、closing_relation candidate は verified_cross_reference candidate より優先される(348-350 行)。
  • transport failure(gh pr view 失敗等)は materialization_failures に記録され contradictory: true として collection 時点で fail-closed になる(560-629 行)。この collection-time の fail-closed 経路は、qualification 後に無視してよい failure と現状まだ区別されていない。
  • build_intake_capsule() -> resolve_landing_disposition_with_freshness_rebind() -> derive_landing_disposition() -> apply_already_satisfied_precedence() の呼び出しチェーンは test_implementation_landed_intake_integration.py(331-345 行、469-667 行、626-667 行)に実在する production-shaped mock-gh harness(実装: persist_retrospective_run.py の secret redaction パターンを新形式 ghs_ App installation token に対応させる #2727 incident reproduction)で再利用可能であることを確認した。新規 runtime harness は不要。
  • test_implementation_landed_evidence.py は lifecycle(open/draft/merged/closed-unmerged/no-candidate)と marker 種別(exact/missing/invalid)の主要パス、および 実装: impl-review-loop の cross-reference false candidate で不要な reconciliation 停止を防ぐ #2750 の sibling identity mismatch 5 ケース(854-1076 行)をすでにカバーしている。ただし「fresh negative qualification 成立後に target-specific freshness (head drift / merged ancestry compare failure 等) を無視する」ケースは未カバー。
  • markerless #2119 / PR #2137 はテストスイート内の fixture 識別子(test_implementation_landed_evidence.py 26 行、test_implementation_landed_intake_integration.py 31 行等)であり、実在の GitHub Issue 実装: CI: Playwright E2E の responsive matrix を専用 lane へ分離し critical path を短縮する #2119(Playwright E2E 分離)とは無関係。本 Issue の regression matrix で言及する際はこの fixture 規約の意味で用いる。

Parent Issue

none

Outcome

resolve_landing_disposition_with_freshness_rebind() の qualification-before-freshness-materialization という現行 ordering に起因する、irrelevant sibling cross-reference の freshness_rebind_failed / reconciliation_required 誤停止リスクについて、(1) decision-time の fresh negative qualification authority(live body + closingIssuesReferences に基づく再導出。head SHA 一致だけを authority にしない)と (2) qualification 成立後に無視してよい transport failure の境界を Issue contract に確定し、production implementation が必要と判断される場合は変更対象・Allowed Paths・regression fixture・verification commands を具体化した implementation follow-up Issue が起票可能な状態にする。

In Scope

  • resolve_landing_disposition_with_freshness_rebind() / _live_freshness_reference() / collect_candidate_inputs() の現行 ordering(candidate discovery → materialization → freshness check → qualification)の確認と、目標 ordering(materialization → fresh authority qualification → target-specific freshness → disposition)への差分整理。
  • fresh negative qualification の成立条件を、live 再取得した candidate PR body(coverage_from_pr_body() 相当で再解析した結果が scope_coverage_issue_identity_mismatch 単独であること)と live closingIssuesReferences(current target を含まないこと)に基づいて定義する。
  • body digest が collection 時と同一であることを要求しない(body 編集後も最新 body が sibling identity を証明できれば成立可能にする)設計の明記。
  • pr_head_sha を sibling negative qualification / freshness authority に昇格させないことの明記(Issue 実装: impl-review-loop intakeにevidence-based landing dispositionを実装する #2699 の audit-only 契約維持)。
  • fresh negative qualification 成立後に無視してよい transport failure(open/draft head drift、closed-unmerged head identity drift、merged sibling の compare/{merge_oid}...main transport failure、current-target-specific files/scope ownership validation)と、常に fail-closed を維持する transport failure(live body/detail 取得失敗、closingIssuesReferences 未確認、malformed marker、markerless candidate、identity mismatch + 複合 error、current target を含む closing relation)の区別。
  • 既存コード構造上、最小の変更で上記 invariant を達成できる設計(不要な新規 abstraction を追加しない)の優先確認。
  • regression matrix(open/draft/merged/closed-unmerged irrelevant sibling、merged ancestry compare transport failure、body/detail fetch failure、body 変更後も sibling marker 維持、closing relation への変化、markerless legacy 互換性、identity mismatch + 複合 error)の具体化。
  • 既存 production-shaped integration harness(test_implementation_landed_intake_integration.py)を再利用した regression 追加方針の確認。
  • Issue 実装: implementation_landed_evidence.py の gh api --paginate に --slurp を追加し timeline JSON parse 失敗を防ぐ #2739(timeline pagination)との責務分離の再確認。
  • 上記結論に基づく implementation follow-up Issue の要否判断と、必要な場合の起票(dedupe_key ベース、重複時は既存 Issue を再利用)。

Out of Scope

Acceptance Criteria

  • AC1: _live_freshness_reference() の現状仕様(candidate PR の body と closingIssuesReferences を decision-time に再取得していないこと)を明記し、「head SHA 一致だけでは fresh negative qualification を成立させない」という設計制約を確定する。
  • AC2: fresh negative qualification の成立条件を「decision-time に live 再取得した candidate PR の body を coverage_from_pr_body() 相当で再解析した結果が scope_coverage_issue_identity_mismatch 単独であり、かつ live closingIssuesReferences が current target を含まない」ことと定義する。body digest が collection 時と同一であることは要求しない。
  • AC3: IMPLEMENTATION_SCOPE_COVERAGE_V1.pr_head_sha を sibling negative qualification / freshness authority に昇格させないことを明記する(Issue 実装: impl-review-loop intakeにevidence-based landing dispositionを実装する #2699 の audit-only 契約を維持)。
  • AC4: candidate discovery → minimum live authority materialization(body / closingIssuesReferences / PR identity・lifecycle) → fresh authority qualification(definitely irrelevant sibling か relevant-or-unknown か) → relevant/unknown candidate のみ target-specific freshness(head/merge OID・main ancestry・files/scope ownership) → disposition、という ordering を、既存コード構造上最小の変更で達成できる設計(不要な新規 abstraction を追加しない)で確定する。この ordering fix の実際の対象コード箇所は resolve_landing_disposition_with_freshness_rebind() / _live_freshness_reference() だけではない。 collect_candidate_inputs() は qualification(_is_irrelevant_cross_reference())より前に、候補ごとの gh pr view 失敗を無条件に materialization_failures へ積み、merged candidate の compare/{merge_oid}...main ancestry compare も無条件に実行し、contradictory: bool(materialization_failures) を collection 時点で確定させる(_live_freshness_reference() 自体は ancestry compare も files/scope-ownership 検証も行わない)。AC6/AC7 が無視可能とする merged sibling の ancestry compare transport failure・files/scope ownership validation は、この collect_candidate_inputs() 内の pre-qualification 集約が実際の対象箇所である。さらに、AC6 が明示する「merged sibling の main ancestry compare(compare/{merge_oid}...main)transport failure」を current target 全体の reconciliation_required へ実際に波及させているのは、collect_candidate_inputs() 自体ではなく第三の箇所である validate_implementation_landed_evidence()(270-297 行)が呼ぶ _candidate_errors()(225-253 行)の merged_candidate_main_ancestry_unverified チェックである。このチェックは evidence['candidates'] 全件に対し、qualification(_is_irrelevant_cross_reference() によるフィルタ)より前、かつ derive_landing_disposition() 冒頭の if not validated['valid']: return reconciliation_required より前に無条件適用され、main_ancestry.verified is not True(ancestry compare の transport failure を含む)であれば evidence 全体を invalid にし即座に reconciliation_required を返す。collect_candidate_inputs() 内の ancestry compare 呼び出し自体は結果を materialization_failures/contradictory には反映しない(materialization_failures は gh pr view 失敗時のみ追記される)。したがって本 AC の設計確定には、collect_candidate_inputs() の materialization_failures/contradictory 計算に加え、_candidate_errors()/validate_implementation_landed_evidence() の merged_candidate_main_ancestry_unverified pre-qualification gate も対象箇所として明示的に含め、次のいずれの方針を採るかを記録することを含める: (a) qualification 状態が判明するまで ancestry-compare / files-ownership の live fetch と _candidate_errors() の当該チェックを候補ごとに遅延させる(skip-by-construction)、または (b) 現行の single-pass collection / validation を維持しつつ、confirmed-irrelevant candidate にのみ起因する contradictory/merged_candidate_main_ancestry_unverified 誘発 failure を derive_landing_disposition() に到達する前に reclassify/discard する(collect-then-reclassify)。両方針とも collect_candidate_inputs() と _candidate_errors()/validate_implementation_landed_evidence() の両方を対象にしない限り、AC6 の invariant は達成されない。
  • AC5: 以下の transport failure は fail-closed を維持することを明記する: live PR body/detail を取得できない、closingIssuesReferences を decision-time に確認できない、malformed marker、markerless candidate、identity mismatch + schema/digest/manifest 等の複合 error、current target を含む closing relation。
  • AC6: fresh negative qualification が成立済みの irrelevant sibling について、以下が current target の freshness_rebind_failed / reconciliation_required の原因にならない設計を確定する: open/draft sibling の head drift、closed-unmerged sibling の head identity drift、merged sibling の main ancestry compare(compare/{merge_oid}...main)transport failure、current-target-specific files/scope ownership validation。
  • AC7: 少なくとも以下を regression matrix として implementation follow-up の verification scope に明記する: open/draft/merged/closed-unmerged の irrelevant sibling、merged sibling + fresh live sibling qualification 成立 + ancestry compare transport failure(current target を止めない)、sibling candidate + live body/detail fetch failure(fail-closed 維持)、body が collection 後に変更されたが最新 body が依然 sibling marker(head/body byte equality を要求せず fresh negative qualification 可)、live body/closing relation が current target authority に変化(sibling exclusion を適用しない)、markerless legacy candidate 互換性(テスト fixture 規約としての 実装: CI: Playwright E2E の responsive matrix を専用 lane へ分離し critical path を短縮する #2119/PR feat: Playwright E2E responsive matrix を専用 lane へ分離する #2137。実 GitHub Issue 実装: CI: Playwright E2E の responsive matrix を専用 lane へ分離し critical path を短縮する #2119 とは無関係)維持、identity mismatch + 別 marker error(fail-closed 維持)。
  • AC8: production-shaped regression として build_intake_capsule -> resolve_landing_disposition_with_freshness_rebind -> derive_landing_disposition -> apply_already_satisfied_precedence の呼び出しチェーンを、既存 test_implementation_landed_intake_integration.py の mock gh harness を再利用して最低1本通す方針を明記し、新規の巨大 runtime harness / registry / attestation / schema subsystem を追加しないことを明記する。
  • AC9: 実装: impl-review-loop の cross-reference false candidate で不要な reconciliation 停止を防ぐ #2750/fix: impl-review-loop の cross-reference false candidate による不要な reconciliation 停止を防ぐ #2758 の bounded conflict-counting semantics(closing_relation 優先・verified_cross_reference 除外の既存挙動)と矛盾しないことを確認する。
  • AC10: Issue 実装: implementation_landed_evidence.py の gh api --paginate に --slurp を追加し timeline JSON parse 失敗を防ぐ #2739 の timeline pagination(gh api --paginate --slurp)問題とは責務を分離し、本 Issue の implementation scope へ吸収しないことを明記する。
  • AC11: 上記結論に基づき production implementation が必要と判断される場合、変更対象ファイル・Allowed Paths・regression fixture・verification commands を具体化した implementation follow-up Issue を dedupe_key ベースで起票し、本 Issue からリンクする(既存 Issue と重複する場合は新規作成しない)。

Verification Commands

# AC1
# baseline-expect: pass
$ rg -n "_live_freshness_reference" .claude/skills/impl-review-loop/scripts/implementation_landed_evidence.py

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

# AC3
# baseline-expect: pass
$ rg -n "_valid_sha" .claude/skills/impl-review-loop/scripts/implementation_landed_evidence.py

# AC4
# baseline-expect: pass
$ rg -n "resolve_landing_disposition_with_freshness_rebind" .claude/skills/impl-review-loop/scripts/implementation_landed_evidence.py

# AC5
# baseline-expect: pass
$ rg -n "materialization_failures" .claude/skills/impl-review-loop/scripts/implementation_landed_evidence.py

# AC6
# baseline-expect: pass
$ rg -n "collect_candidate_inputs" .claude/skills/impl-review-loop/scripts/implementation_landed_evidence.py

# AC7
# baseline-expect: pass
$ rg -n "def test_" .claude/skills/impl-review-loop/tests/test_implementation_landed_evidence.py

# AC8
# baseline-expect: pass
$ rg -n "build_intake_capsule" .claude/skills/impl-review-loop/tests/test_implementation_landed_intake_integration.py

# AC9
# baseline-expect: pass
$ rg -n "derive_landing_disposition" .claude/skills/impl-review-loop/scripts/implementation_landed_evidence.py

# AC10
# baseline-expect: pass
$ gh issue view 2739 --repo squne121/loop-protocol --json state

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

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

Stop Conditions

  • Outcome / Scope / AC が検索可能な形で記載されていない場合は即停止
  • Allowed Paths 外への書き込みを試みた場合は即停止
  • 権限不足(permission denied)により操作が完了できない場合は即停止
  • 成果物の書き込みに失敗した場合(I/O エラー等)は即停止

Handoff Contract

  • Current Objective: fresh negative qualification authority(live body + closingIssuesReferences)の定義と、materialization/qualification/target-specific-freshness の ordering を確定する。
  • Bounded Current Context: PR fix: impl-review-loop の cross-reference false candidate による不要な reconciliation 停止を防ぐ #2758(実装: impl-review-loop の cross-reference false candidate で不要な reconciliation 停止を防ぐ #2750 の bounded conflict-counting fix)はマージ済みだが、resolve_landing_disposition_with_freshness_rebind() の qualification 前 freshness materialization は依然 irrelevant sibling の transport failure で current target を止め得る。Issue 実装: impl-review-loop intakeにevidence-based landing dispositionを実装する #2699 の pr_head_sha audit-only 契約は変更しない。
  • Open Questions: production implementation の要否、および既存コード構造上の最小変更で ordering invariant を達成できる具体的な変更点(resolve_landing_disposition_with_freshness_rebind() / _live_freshness_reference() / collect_candidate_inputs() のどこに最小差分を入れるか)。
  • Next Action: 本 Issue の結論(AC1-AC10)に基づき、production implementation が必要な場合は AC11 に従って implementation follow-up Issue を起票する。
  • Artifact Refs: .claude/skills/impl-review-loop/scripts/implementation_landed_evidence.py(751-811 行 resolve_landing_disposition_with_freshness_rebind、678-738 行 _live_freshness_reference、469-628 行 collect_candidate_inputs、336 行〜 derive_landing_disposition、308 行〜 _is_irrelevant_cross_reference、270-297 行 validate_implementation_landed_evidence、225-253 行 _candidate_errors(merged_candidate_main_ancestry_unverified の pre-qualification gate)、172-213 行 _parse_marker/coverage_from_pr_body)、.claude/skills/impl-review-loop/tests/test_implementation_landed_intake_integration.py(331-345 行、469-667 行、626-667 行)、.claude/skills/impl-review-loop/tests/test_implementation_landed_evidence.py(203-295 行、854-1076 行)。

Related / Dedupe

本 Issue は「fresh negative qualification authority の定義」と「qualification/materialization ordering」に限定し、上記いずれとも重複しない。

Sub-issues

Sub-issues

1 of 1 Issues completed
Loading 1 sub-issues

Activity

  1. squne121 commented on Sep 25, 2026

    @squne121
    OwnerAuthor

    Issue #2761、source PR #2758 のレビュー履歴、#2750/#2699/#2739、現行 impl-review-loop の producer・freshness rebind・integration test、および GitHub / gh の現行仕様まで突き合わせました。

    結論

    問題設定は妥当ですが、現状の Issue contract のまま implementation follow-up を切るのはまだ早いです。
    主要 finding は P1 が2件、P2 が2件です。

    特に重要なのは、#2761 が言う「fresh negative qualification」を、単なる「head SHA を再確認した sibling」ではなく、

    decision-time に再取得した PR body + closingIssuesReferences から、その PR が current Issue の landing authority を持たないことを再導出する

    と明文化することです。

    [Issue #2761](https://github.com/squne121/loop-protocol/issues/2761?utm_source=chatgpt.com)
    [残余リスクを指摘した PR #2758 のレビューコメント](#2758)

    P1 — 「fresh negative qualification」の freshness 対象が不足している

    現行 _live_freshness_reference() が再取得しているのは、

    • current Issue body
    • current main SHA
    • 各候補の headRefOid または mergeCommit.oid

    だけです。candidate PR の body と closingIssuesReferences は decision-time に再取得していません。

    [implementation_landed_evidence.py — current freshness implementation](https://github.com/squne121/loop-protocol/blob/main/.claude/skills/impl-review-loop/scripts/implementation_landed_evidence.py?utm_source=chatgpt.com#L655-L811)

    これは #2761 にとって本質的です。PR body は head commit とは独立して編集可能です。gh pr edit --body で普通に変更できます。:chatgpt-content-reference{index="3"} さらに GitHub の closing linkage は PR description の closing keyword から生成でき、keyword linkage は description を編集して keyword を削除すれば unlink される仕様です。:chatgpt-content-reference{index="4"}

    つまり、

    collection:
      PR body marker -> issue #2725
      closingIssuesReferences -> []
      head -> AAA
          ↓
    PR bodyだけ編集
      marker -> issue #2761
      または Closes #2761 を追加
      head -> AAA のまま
          ↓
    decision-time:
      head AAA == AAA
      → 現行 freshness は fresh と判定可能
    

    です。

    したがって、「head が変わっていないから sibling qualification が fresh」という設計にはできません。

    GitHub CLI 自体は body, closingIssuesReferences, headRefOid, mergeCommit, updatedAt を同じ gh pr view --json で取得できます。新しい API subsystem は不要です。:chatgpt-content-reference{index="5"}

    AC に次を明記すべきです。

    irrelevant sibling の decision-time negative qualification は、decision-time に live 再取得した candidate PR の body と closingIssuesReferences を authority とし、closingIssuesReferences が current target を含まず、live body を coverage_from_pr_body() 相当で再解析した結果が scope_coverage_issue_identity_mismatch 単独の場合にのみ成立する。

    さらに重要なのは、body digest が collection 時と同じである必要はありません。 Body が変わっても、再解析した最新 body が引き続き sibling identity を証明できれば通してよいです。そうしないと、無関係な typo 修正だけでまた availability が落ちます。


    P1 — 「PR detail transport failure」の記述が fail-closed 契約と曖昧に衝突している

    #2761 の Context / Problem は、

    detail read failure 等によって freshness_rebind_failed

    を残余リスクとして挙げています。

    一方 Desired Destination / AC は、

    stale body / body fetch failure ... では fail-open しない

    としています。

    この2つは、transport failure の段階を分けないと実装者が解釈を誤ります。

    現行 collect_candidate_inputs() は候補を発見すると、まず full PR detail を materialize し、merged candidate ならその場で compare/{merge_oid}...main まで実行します。materialization failure は contradictory になり、qualification より先に fail-closed です。

    collect_candidate_inputs() の現在の ordering

    ここでは transport failure を2種類に分けるべきです。

    無視してはいけない failure

    live PR body / closingIssuesReferences を取得できない
    → sibling だと decision-time に証明できない
    → fail-closed
    

    irrelevant sibling なら不要になる failure

    live body + closingIssuesReferences で sibling と証明済み
    → head drift
    → merged main-ancestry compare failure
    → files/current_scope_ownership 等の target-specific validation
    

    後者まで current target を止める必要はありません。

    したがって ordering の目標は、

    candidate discovery
    ↓
    minimum materialization
      - body
      - closingIssuesReferences
      - lifecycle / PR identity
    ↓
    fresh negative qualification
    ├─ definitely irrelevant sibling
    │    → target-specific head/ancestry validation から除外
    └─ relevant / unknown
         → 従来の head freshness / ancestry / scope validation
    ↓
    derive disposition
    

    です。

    単に _live_freshness_reference() の candidate list から sibling を消すだけでは不十分です。collection 時の merged ancestry check も qualification より前に存在するためです。


    P2 — AC は merged sibling の ancestry failure を直接固定した方がよい

    現在の AC は head drift を明示していますが、元の source review では merged sibling の ancestry/materialization 系も残余リスクとして挙げられています。

    merged candidate は現在、

    gh api repos/{repo}/compare/{merge_oid}...main

    を qualification 前に実行します。

    そのため最低でも次の regression が必要です。

    merged verified_cross_reference
    + live body = well-formed sibling marker
    + live closingIssuesReferences excludes current target
    + compare/{merge_oid}...main transport failure
    → current target は reconciliation_required にならない
    

    逆に、

    same candidate
    + live body fetch failure
    → reconciliation_required
    

    も対になる fixture として固定すべきです。

    これで「何の transport failure を無視でき、何を無視できないか」が仕様になります。


    P2 — pr_head_sha を sibling freshness の authority に昇格させない

    ここは実装時にやりがちな修正なので、Issue に明記した方がよいです。

    #2699 の元契約では IMPLEMENTATION_SCOPE_COVERAGE_V1.pr_head_sha は明確に audit-only metadata であり、disposition / freshness の authority として consume しない設計です。

    [Issue #2699](https://github.com/squne121/loop-protocol/issues/2699?utm_source=chatgpt.com)

    したがって、

    marker.pr_head_sha == current headRefOid
    

    を negative qualification の条件に追加してはいけません。それをすると今回まさに解消したい「irrelevant sibling の head drift で current Issue が止まる」に戻ります。

    必要なのは live head consistency ではなく live landing-authority absence です。


    GitHub の外部 semantics との整合性

    #2750/#2758 が generic cross-reference と closing relation を分けた判断自体は維持してよいです。

    GitHub の cross-referenced timeline event は「別 Issue / PR から参照された」ことを表すイベントであり、それ自体は closing authority ではありません。:chatgpt-content-reference{index="8"} 一方で Issue と PR の closing linkage は manual linkage または supported closing keyword で形成される別の関係です。:chatgpt-content-reference{index="9"}

    GitHub native dependency もさらに別物で、現在は dependencies/blocked_by の専用 REST API が存在します。:chatgpt-content-reference{index="10"}

    したがって #2761 で新しい dependency inference や graph registry を作る必要はありません。


    #2739 との分離も正しい

    #2739 は、

    gh api --paginate
    → 複数 JSON document
    → json.loads() failure
    

    という timeline transport normalization の問題です。

    [Issue #2739](https://github.com/squne121/loop-protocol/issues/2739?utm_source=chatgpt.com)

    #2761 は 取得済み candidate の authority qualification と freshness dependency の ordering の問題なので、責務は明確に別です。ここは現行 Issue のままでよいです。


    推奨する Acceptance Criteria の追加・具体化

    既存 AC を捨てる必要はありません。次の境界を追加すれば implementation-ready にかなり近づきます。

    1. decision-time に body + closingIssuesReferences を live 再取得し、その live 値から irrelevant sibling を再導出する。body が変更されていても最新内容が同じ negative qualification を満たせば許容する。
    2. live negative qualification 成立後は、その sibling の open/draft head drift、merged ancestry fetch/compare failure、closed-unmerged の head identity 変動を current-target freshness failure の原因にしない。
    3. live body/detail fetch failure、current target の closing relation 化、markerless、malformed marker、identity mismatch + 別 error は従来どおり fail-closed。
    4. pr_head_sha marker field を freshness authority にしない。
    5. fixture は少なくとも open, draft, merged, closed_unmerged を通し、merged ancestry transport failure を明示ケースにする。
    6. fix: impl-review-loop の cross-reference false candidate による不要な reconciliation 停止を防ぐ #2758 で強化済みの production-shaped path、すなわち build_intake_capsule -> resolve_landing_disposition_with_freshness_rebind -> derive -> already_satisfied/data-plane まで1件は通す。現行 integration test はすでにこの harness を持っているので再利用でき、新規 runtime framework は不要です。
      [現在の #2727 production-shaped integration regression](https://github.com/squne121/loop-protocol/blob/main/.claude/skills/impl-review-loop/tests/test_implementation_landed_intake_integration.py?utm_source=chatgpt.com#L469-L666)

    実装方針

    個人趣味開発の前提なら、新 schema・registry・attestation・live mutation harness は不要です。

    最小設計は「freshness check の前に雑に candidate を削る」ではなく、freshness を authority-sensitive に2段階化することです。

    Stage A: fresh authority qualification
      body + closingIssuesReferences
      ↓
      irrelevant sibling / relevant-or-unknown
    
    Stage B: relevant candidate のみ target-specific freshness
      head/merge OID
      main ancestry
      files / ownership
      ↓
      disposition
    

    これなら #2699 の fail-closed 境界を維持しつつ、#2750/#2758 の carve-out を production freshness path まで一貫させられます。

    現状の #2761 は方向性は正しいものの、「fresh negative qualification が具体的に何を live 再取得して成立するか」と「どの transport failure なら除外後に無視可能か」の2点を contract に固定してから refinement を完了させるのが適切です。

  2. squne121 commented on Sep 25, 2026

    @squne121
    OwnerAuthor

    推奨は、対象コメントを単なる「agent report」ではなく、operator が明示選択した with_human_context anchor として issue-refinement-loop に投入することです。現行 skill ではこの lane なら、scope expansion 自体を理由に止めず、必要な exact path は codebase-investigator が導出でき、section-bound patch に落とせない substantive feedback も issue_editor_required → issue-editor へ自動 handoff できます。これは #2086 / #2620 で既に整備されています。

    今回の refinement で contract に固定すべき中心点は、① negative qualification の authority を decision-time の live body + closingIssuesReferences とする、②そこで sibling と確定した後だけ head/ancestry/files 等の target-specific freshness から除外する、③ live body/closing-linkage 自体を取得できない場合は fail-closed、④ pr_head_sha は audit-only のまま、⑤ open/draft/merged/closed-unmerged と merged ancestry failure を regression に含める、⑥ #2739 の pagination 問題とは分離する、です。これは対象コメントの指摘と #2699/#2750/#2758 の既存契約に整合します。

    また、canonical Step 2 を issue-reviewer SubAgent に置き換えない方がよいです。現行 SKILL.md は Step 2 を run_root_review_pipeline.py の root-owned path としており、SubAgent は Step 1 の codebase-investigator、必要なら Step 4 の issue-editor 等で使うのが正規経路です。各 SubAgent は起動だけで先に進まず、最終結果が返るまで待機する指示を明記しています。

    新規の再発防止Issueは起票していません。自動継続に関係する既知問題は [#2086](#2086) と [#2620](#2620) が完了済みで、readiness の body-fixable 誤分類は [#2760](#2760) が open、timeline pagination は [#2739](#2739) で既に独立追跡されています。ここで別Issueを作ると重複になります。

    既に auto mode で動いている Claude Code には、以下をそのまま渡すのが適切です。

    Issue #2761 を .claude/skills/issue-refinement-loop で refinement してください。

    Target Issue:
    #2761

    今回の operator-selected human-context anchor:
    #2761 (comment)

    この anchor は、今回の interactive operator が明示的に refinement 入力として選択したものです。
    with_agent_report や unlabeled anchor としてではなく、repository の Accepted Trust Model に従って with_human_context / operator_asserted_human_context lane として扱ってください。

    目的は Issue #2761 を、人間の追加承認を要求せず、現行 issue-refinement-loop の canonical route で implementation-ready な research conclusion まで refinement することです。

    実行原則

    • .claude/skills/issue-refinement-loop/SKILL.md とその references / scripts を current main から読み、現行 canonical workflow をそのまま使用すること。
    • 単に anchor comment の文章を転記せず、current repository、関連 Issue/PR、既存 tests、current implementation を再調査して fact-check すること。
    • 人間への確認・承認要求を通常の routing として挟まないこと。
    • operator-selected human-context による same-target contract expansion は、実装: operator-selected human context の scope reframe を自動継続し scope expansion stop を撤去する #2086 の契約どおり scope expansion だけを理由に human escalation しないこと。
    • safe section-bound patch が構成できない substantive contract feedback は、実装: trusted human contract feedback を controlled editor handoff に接続する #2620 の既存 issue_editor_required → controlled issue-editor handoff を利用すること。人間へ本文を書き直させないこと。
    • contract rewrite 後は必ず fresh Issue body readback → fresh preflight → fresh review → fresh readiness を再実行すること。
    • genuine semantic ambiguity、secret/credential、破壊的操作、permission escalation、外部有料サービス等の既存 hard boundary は勝手に緩和しないこと。

    SubAgent 要件

    SubAgent を実際に使用してください。

    1. Step 1 の repository investigation は codebase-investigator SubAgent に委譲すること。
    2. SubAgent を起動しただけで次工程へ進まず、SubAgent の最終結果が返るまで必ず待つこと。
    3. 結果を main/root thread が回収・検証してから planner/review input に使用すること。
    4. exact Allowed Paths の追加が必要で anchor 本文だけから安全な literal が得られない場合は、codebase-investigator の read-only investigation から exact repository-relative paths を導出し、既存 investigation_derived_path_literals lane を使用すること。
    5. Step 4 で body rewrite が必要なら canonical issue-editor SubAgent を使用し、同様に完了結果を待ってから fresh readback に進むこと。
    6. planner が external claim の検証を dispositive と判定した場合のみ canonical web-researcher を使い、その完了を待つこと。
    7. canonical Step 2 は現行仕様どおり run_root_review_pipeline.py の root-owned path を使用すること。legacy の issue-reviewer SubAgent へ置換しないこと。
    8. SubAgent 自身に不要な nested delegation を行わせないこと。

    #2761 で必ず再検証する論点

    anchor comment の以下の finding を current main に対して再検証し、妥当なら Issue contract に明文化してください。

    1. Fresh negative qualification の authority

    irrelevant sibling candidate の negative qualification は単なる head SHA consistency では成立させないこと。

    decision-time に live 再取得した candidate PR の少なくとも

    • body
    • closingIssuesReferences
    • candidate identity / lifecycle

    から current target Issue に対する landing authority absence を再導出する設計を検討してください。

    live closingIssuesReferences が current target を含まず、live PR body を canonical IMPLEMENTATION_SCOPE_COVERAGE_V1 parser / coverage_from_pr_body() 相当で再解析した結果が、current Issue に対する scope_coverage_issue_identity_mismatch 単独である場合を fresh negative qualification の中心条件として検討してください。

    collection 時と body digest が同一であること自体は要求しないでください。
    body が編集されていても、最新 live body が依然として well-formed sibling identity を証明するなら negative qualification を成立可能にしてください。

    2. pr_head_sha を authority にしない

    Issue #2699 の契約を維持し、

    IMPLEMENTATION_SCOPE_COVERAGE_V1.pr_head_sha

    は audit-only metadata のままとしてください。

    marker.pr_head_sha == current headRefOid

    を sibling negative qualification / freshness authority に昇格させないでください。

    3. Freshness / materialization ordering

    単に _live_freshness_reference() の candidate list から sibling を後で削除するだけではなく、qualification より前に存在する materialization / ancestry validation も調査してください。

    目標 ordering は概念的に次です。

    candidate discovery
    → minimum live authority materialization

    • body
    • closingIssuesReferences
    • PR identity / lifecycle
      → fresh authority qualification
    • definitely irrelevant sibling
    • relevant or unknown
      → relevant/unknown candidate のみ target-specific freshness
    • head / merge OID
    • main ancestry
    • files / current-scope ownership
      → disposition

    既存コード構造上もっと小さい変更で同じ invariant を達成できる場合は、不要な abstraction を追加せずそちらを優先してください。

    4. Transport failure を区別する

    以下は fail-closed を維持してください。

    • live PR body/detail を取得できない
    • closingIssuesReferences を decision-time に確認できない
    • malformed marker
    • markerless candidate
    • identity mismatch + schema/digest/manifest 等の複合 error
    • current target を含む closing relation

    一方、fresh negative qualification が既に成立した irrelevant sibling については、その後の以下が current target の freshness_rebind_failed / reconciliation stop の原因にならない設計を検討してください。

    • open/draft sibling の head drift
    • closed-unmerged sibling の head identity drift
    • merged sibling の main ancestry compare transport failure
    • current-target-specific files / scope ownership validation

    5. Regression matrix

    少なくとも以下を contract / implementation follow-up の verification scope として具体化してください。

    • open irrelevant sibling
    • draft irrelevant sibling
    • merged irrelevant sibling
    • closed-unmerged irrelevant sibling
    • merged sibling + fresh live sibling qualification + compare/{merge_oid}...main transport failure
      → current target を sibling の ancestry failure だけで止めない
    • sibling candidate + live body/detail fetch failure
      → negative qualification を証明できないため fail-closed
    • live body が collection 後に変更されたが、最新 body が依然 sibling marker
      → head/body byte equality を要求せず fresh negative qualification 可
    • live body / closing relation が current target authority に変化
      → sibling exclusion を適用しない
    • markerless 実装: CI: Playwright E2E の responsive matrix を専用 lane へ分離し critical path を短縮する #2119 / PR feat: Playwright E2E responsive matrix を専用 lane へ分離する #2137 compatibility
      → 従来挙動を維持
    • identity mismatch + another marker error
      → fail-closed 維持

    production-shaped regression は helper 単体で終わらせず、既存 harness を再利用して少なくとも1本、

    build_intake_capsule
    → resolve_landing_disposition_with_freshness_rebind
    → derive_landing_disposition
    → apply_already_satisfied_precedence
    → pre-Step-1 data-plane resolution

    相当の canonical composition まで通してください。

    新しい巨大 runtime harness、registry、attestation、schema subsystem は作らないでください。

    関連契約との整合

    最低限、以下を再確認してください。

    #2739 の timeline pagination / --paginate --slurp 問題は責務を混ぜず、#2761 の implementation scope へ吸収しないでください。

    Research Issue と follow-up materialization

    Issue #2761 は現状 issue_kind: research / change_kind: research-only です。

    repository investigation と review の結果、production implementation が必要という conclusion になった場合は、

    こと。

    follow-up の materialization は追加の人間承認待ちにしないでください。

    ただし issue-refinement-loop の approved termination 後に impl-review-loop を自動起動してはいけません。
    #2740 の境界どおり refinement の完了と implementation authorization は分離してください。

    再発防止 Issue

    実行中に、今回の refinement を不必要に人間停止させる machinery / taxonomy defect を新たに確認した場合は、まず既存 Issue を検索して dedupe してください。

    既知の例:

    これらと重複する Issue は作成しないでください。

    一方、既存 Issue で追跡されていない再発性の高い control-plane defect を concrete evidence 付きで確認した場合は、作業を止めて人間に起票可否を聞くのではなく、canonical create-issue/follow-up materialization route で再発防止 Issue を起票してください。

    新 Issue には最低限、

    • exact failure profile
    • root cause
    • current canonical route がどう誤停止するか
    • desired routing
    • focused regression
    • dedupe_key
    • source Issue/comment URL

    を含めてください。

    終了条件

    追加承認を求めず bounded refinement loop を継続し、

    になった時点で approved termination してください。

    単なる scope expansion、section-bound patch 不可、既知の body-fixable contract defectを理由に human escalation しないでください。

    実際の environment/tool failure、semantic ambiguity、権限・secret・破壊的操作等で canonical workflow 上どうしても継続不能な場合だけ fail-closed termination を許容し、exact blocker と既存/新規 follow-up Issue を終了報告に記載してください。

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

    この形なら、今回特に問題になりやすい「対象コメントを agent report として扱って authority を失う」「scope expansion で止まる」「full rewrite が必要なのに人間へ戻す」「SubAgent を起動しただけで結果を待たず進む」を明示的に避けられます。

  3. squne121 commented on Sep 25, 2026

    @squne121
    OwnerAuthor

    Refinement Loop 完了報告(approved)

    operator-selected human-context anchor(#issuecomment-5832421428)を with_human_context / operator_asserted_human_context lane として扱い、issue-refinement-loop の canonical route で refinement を完了しました。

    実施内容

    1. Step 1 investigation(codebase-investigator SubAgent、完了結果を待って回収): implementation_landed_evidence.py / test_implementation_landed_intake_integration.py を再調査し、anchor comment の技術的指摘(freshness rebind が候補 PR の body/closingIssuesReferences を再取得していないこと、pr_head_sha が audit-only であること、markerless #2119/PR #2137 が実 Issue ではなくテスト fixture 規約であること等)を fact-check・CONFIRMED。
    2. Step 4 full rewrite(issue-editor SubAgent): 本文が research テンプレート必須セクション(Outcome / In Scope / Verification Commands / Allowed Paths / Stop Conditions / Handoff Contract 等)を欠いていたため、anchor の指摘と investigation 結果を反映した完全な本文へ書き換え。
    3. Step 2 review(run_root_review_pipeline.py、root-owned)で3回の needs-fix → section-bound patch(Allowed Paths への具体パス追加、VC への # baseline-expect: pass 注記追加)を経て approve。
    4. Step 2.5 semantic design review(issue-design-reviewer SubAgent、3回、都度完了結果を待って回収): AC4 の技術的記述が実際の修正対象コード箇所を過不足なく指せていない high severity finding を2件検出(1回目: collect_candidate_inputs() の materialization_failures/contradictory 計算、2回目: _candidate_errors()/validate_implementation_landed_evidence() の merged_candidate_main_ancestry_unverified pre-qualification gate)。いずれも repository で CONFIRMED の上 AC4 に反映。3回目は medium/low findingのみで effective_verdict: approve。
    5. Step 4.5 follow-up materialization(issue-creator SubAgent): production implementation が必要と判断し、Implementation Issue 実装: impl-review-loop の irrelevant sibling cross-reference による qualification 前 freshness 誤停止を解消する #2767 を起票(dedupe_key: impl-review-loop:irrelevant-sibling-prequalification-freshness-fix、Parent Issue 調査: impl-review-loop の irrelevant sibling cross-reference が qualification 前の freshness 検証で current Issue を停止し得る残余リスクを解消する #2761 として GitHub native sub-issue 登録済み)。
    6. fresh readback → fresh preflight → fresh review: body 変更のたびに再実行し、最終 body(sha256:8ede67b2...)で STATUS: pass / canonical_step2_route: step_2_5 / verdict: approve を確認。

    重複のため起票しなかった既存 Issue

    未解決 blocker

    なし。

    implementation handoff

    Implementation follow-up Issue #2767 が起票され、実装可能な状態です。ただし本 issue-refinement-loop はここで終了し、impl-review-loop は起動しません(#2740 の境界どおり refinement 完了と implementation authorization を分離)。

  4. squne121 commented on Sep 25, 2026

    @squne121
    OwnerAuthor

    確認した限り、推奨アクションは明確です。#2761 を直接実装するのではなく、research parent として扱い、既に materialize 済みの implementation child #2767 を実装対象にするのが正しいです。

    現状は、#2761 が open のままですが refinement は approved で完了しており、最終コメントで implementation follow-up #2767 の起票まで完了しています。#2767 は open・コメント0・関連実装PRなしです。source PR #2758 はマージ済みで、現在の main はその merge commit d9c7869d49c6c070472cfcea8884364a498af239。しかも current main を再確認すると、_candidate_errors() の merged ancestry gate、collect_candidate_inputs() の pre-qualification materialization、_live_freshness_reference() の body / closingIssuesReferences 非再取得が残っているので、#2767 の実装は実際に必要です。

    CI面では main は protected で、現在の required checks は typecheck / lint / test / build / python-test / validate-generated-artifact の6つ。現 main と #2758 の最終headではこれら6つがすべて success です。一方、同じ main SHA には issue/workflow-run 起点の visual-impact-policy-trusted 等の失敗履歴もありますが、branch protection の required contexts ではありません。実装PRでは live な required checks と PR review を正本にするのが適切です。

    そのまま Claude Code に渡すなら以下です。

    squne121/loop-protocol について、research Issue #2761 の結論を実装まで完結させてください。

    今回の実装対象は #2761 自体ではなく、#2761 から materialize 済みの implementation child Issue #2767 です。

    Repository:
    https://github.com/squne121/loop-protocol

    Research parent:
    #2761

    Implementation target:
    #2767

    Source implementation / precedent:
    #2758

    残余リスクを特定した source review:
    #2758 (comment)

    #2761 の refinement 完了報告:
    #2761 (comment)

    観測時点の main:
    d9c7869d49c6c070472cfcea8884364a498af239

    ただし、この SHA は固定値として信用せず、作業開始時に必ず live origin/main / GitHub main を再取得してください。

    最終目的

    Issue #2767 の Acceptance Criteria を current main に対して実装し、

    実装
    → regression test
    → 独立検証
    → PR作成
    → Closes #2767
    → PR review
    → review finding 修正
    → CI再検証
    → current-head 再レビュー
    → merge-ready

    まで、人間の追加承認を要求せず自律的に進めてください。

    PR には Closes #2767 を含め、research parent は Refs #2761 としてください。

    実装PRで Closes #2761 は使用しないでください。
    #2761 は research-only Issue であり、#2767 とはクローズ理由が異なります。

    開始時の live state 再確認

    最初に current repository state を再取得してください。

    #2767 について、作業開始後に別の実装PRが作られていないか必ず確認してください。

    既存PRが存在する場合は重複PRを作らず、そのPR・branch・worktreeを resume してください。

    既存PRが存在しなければ、repository の canonical worktree / branch workflow に従って #2767 用 worktree / branch を作成してください。

    また current main ですでに別変更によって #2767 の全ACが満たされている場合は、noop implementation を作らないでください。その場合は実際の regression verification を実行し、already_satisfied の evidence を残し、#2767 のクローズ可否を current repository contract に従って処理してください。

    canonical impl-review-loop を使用する

    current main の以下を最初に読み直してください。

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

    過去の refinement comment や handoff comment を実装開始 authorization として再利用しないでください。

    current impl-review-loop が要求する Root-Owned Synchronous Entry Transition、

    capability preflight
    → live Issue fetch
    → current-run issue-contract-review
    → fresh live readback
    → routing
    → Step 1

    を同一 canonical invocation 内で実行してください。

    実装対象は issue_number=2767 としてください。

    必要なら max_iterations=8 程度の bounded loop とし、単なる review finding / CI failure / stale head / branch update を理由に人間承認へ戻さないでください。

    SubAgent は実際に使用すること

    impl-review-loop の canonical SubAgent 構成を使用してください。

    Step 1:
    implementation-worker / implement-issue

    Step 2:
    test-runner

    Step 4:
    pr-reviewer / pr-review-judge

    各 SubAgent は、起動しただけで次工程へ進まないこと。

    必ずその SubAgent の最終結果が返るまで待機し、root/main thread が結果を回収・検証してから次の Step へ進んでください。

    REQUEST_CHANGES が返った場合は、その current-head review の具体的な fix_delta を次の implementation-worker に渡し、

    implementation-worker 完了待ち
    → test-runner 完了待ち
    → pr-reviewer 完了待ち

    を再度行ってください。

    branch update が必要な場合も、worker の完了を待った後に fresh verification / fresh review を実行してください。

    SubAgent が pending のまま root thread が先行することは禁止します。

    #2767 の実装 invariant

    current main を再調査してから実装してください。

    観測時点では少なくとも以下の3箇所が問題の中心です。

    collect_candidate_inputs()

    _candidate_errors() / validate_implementation_landed_evidence()

    _live_freshness_reference() / resolve_landing_disposition_with_freshness_rebind()

    目標 ordering は、

    candidate discovery
    → minimum live authority materialization
    → fresh negative qualification
    → relevant / unknown candidate だけ target-specific freshness
    → disposition

    です。

    Fresh negative qualification

    irrelevant sibling cross-reference の除外 authority は、decision-time に live 取得した情報から再導出してください。

    最低限、

    • live PR body
    • live closingIssuesReferences
    • candidate identity / lifecycle

    を使用してください。

    live PR body を canonical parser / coverage_from_pr_body() 相当で再解析し、

    scope_coverage_issue_identity_mismatch

    が単独 error であり、かつ live closingIssuesReferences が current target #2767 を含まない場合にのみ definitely-irrelevant sibling と扱ってください。

    collection 時の body byte equality や body digest equalityは要求しないでください。

    body が collection 後に編集されていても、decision-time の最新 body が sibling identity を正しく証明するなら fresh negative qualification を許可してください。

    IMPLEMENTATION_SCOPE_COVERAGE_V1.pr_head_sha は audit-only の既存契約を維持し、negative qualification や freshness authority に昇格させないでください。

    qualification 後に不要になる validation

    fresh negative qualification 済みの irrelevant sibling は、current target 固有の以下の freshness / validation によって current target を止めないようにしてください。

    • open/draft sibling の head drift
    • closed-unmerged sibling の head identity drift
    • merged sibling の main ancestry compare
    • compare/{merge_oid}...main の transport failure
    • current-target-specific files / scope ownership validation

    可能なら「fetch してからエラーを捨てる」より、qualification 後に不要な target-specific validation を実行しない skip-by-construction を優先してください。

    ただし current code structure 上 collect-then-reclassify の方が小さく安全なら、ACを満たす最小変更を選んで構いません。

    新しい大規模 abstraction / registry / attestation / schema subsystem は追加しないでください。

    fail-closed を維持するケース

    以下は irrelevant sibling と証明できないため、従来どおり fail-closed を維持してください。

    • live PR body/detail を取得できない
    • live closingIssuesReferences を確認できない
    • current target を含む closing relation
    • malformed marker
    • markerless candidate
    • identity mismatch と schema/digest/manifest 等の複合 error
    • candidate identity / provenance 自体が不正
    • current target の landing authority が存在する、または不明なケース

    #2750 / #2758 の bounded conflict-counting semantics を壊さないでください。

    特に、

    closing_relation 優先

    verified_cross_reference の bounded irrelevant-sibling exclusion

    markerless legacy compatibility

    identity mismatch + other error の fail-closed

    を維持してください。

    Issue #2739 の timeline pagination 問題は別責務です。
    今回の implementation scope に吸収しないでください。

    Allowed Paths

    Issue #2767 の live contract を正本としてください。

    観測時点の 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

    原則としてこの3ファイルだけを変更してください。

    Allowed Paths 外の変更が「便利だから」必要という理由では scope を広げないでください。

    contract 自体の修正が本当に必要になった場合は、まず current Issue contract と実装要求を再照合し、既存 scope 内で解決可能かを優先してください。

    regression matrix

    少なくとも以下を直接テストしてください。

    1. open irrelevant sibling
    2. draft irrelevant sibling
    3. merged irrelevant sibling
    4. closed-unmerged irrelevant sibling
    5. merged irrelevant sibling + live sibling qualification 成立 + ancestry compare transport failure
      → current target を reconciliation_required にしない
    6. sibling candidate + live body/detail fetch failure
      → fail-closed
    7. collection 後に body が変更されたが、decision-time の最新 body も sibling marker
      → body byte equality を要求せず negative qualification 成立
    8. live body / closing relation が current target authority に変化
      → sibling exclusion を適用しない
    9. markerless legacy fixture
      →既存 compatibility 維持
    10. identity mismatch + 別 marker error
      → fail-closed 維持
    11. open/draft sibling head drift
      → current target の freshness failure にしない
    12. production-shaped integration

    production-shaped integration は既存
    test_implementation_landed_intake_integration.py
    の mock-gh harness を再利用してください。

    最低1本は、

    build_intake_capsule
    → resolve_landing_disposition_with_freshness_rebind
    → derive_landing_disposition
    → apply_already_satisfied_precedence

    まで同一 fixture で通してください。

    新規巨大 runtime harness は作らないでください。

    Verification

    Issue #2767 の Verification Commands をすべて実行してください。

    最低限、

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

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

    を fresh head で実行してください。

    変更した Python について relevant lint / static check が repository に存在するなら実行してください。

    その後、PR CI を正本として再確認してください。

    観測時点で main の branch protection required status checks は、

    • typecheck
    • lint
    • test
    • build
    • python-test
    • validate-generated-artifact

    です。

    ただし実行時には live branch protection / required checks を再取得し、そちらを正本にしてください。

    required check の failure は人間へ戻さず、原因を調査し、今回の変更が原因なら修正してください。

    flaky / unrelated failure の可能性がある場合も evidence を確認し、安全な rerun が可能なら rerun してください。

    non-required workflow の failure が存在するだけで機械的に停止しないでください。ただし今回の変更との因果がある場合は修正対象です。

    PR 作成

    既存 #2767 PR が無いことを live に確認してから新規PRを作成してください。

    PR body には最低限、

    を含めてください。

    PR title / branch / worktree / draft lifecycle は current repository workflow に従ってください。

    PR review loop

    PR作成後は pr-reviewer / pr-review-judge SubAgent を current head に対して実行し、最終結果が返るまで待ってください。

    REQUEST_CHANGES があれば、人間へ確認せず修正してください。

    各 fix_delta 後に、

    fresh tests
    → push
    → CI
    → current-head review

    を繰り返してください。

    古い head の APPROVE を使い回さないでください。

    review が current head に対して APPROVE であり、live mergeability が問題なく、required CI が全て成功している状態まで継続してください。

    merge / Issue closure

    current .claude/skills/impl-review-loop/SKILL.md の merge policy を live に確認してください。

    観測時点の skill では approved 後の actual merge judgment は human-reserved です。

    このプロンプトは実装・検証・レビュー途中で人間の追加承認を求めるものではありません。

    current repository policy が依然として human-reserved merge を要求する場合は、その境界を破らず、

    • current-head APPROVE
    • mergeable
    • required CI all green
    • PR body に Closes #2767

    まで到達した merge-ready 状態を #2767 のクローズ条件達成状態として扱ってください。

    その場合、actual merge だけを残して終了してください。

    一方、実行時の current repository policy に、明示的に許可された non-human / auto merge 経路が存在する場合は、その canonical 経路を使用して構いません。独自に merge policy を迂回しないでください。

    merge を実行した場合は、#2767 が Closes #2767 により実際に closed になったことまで readback してください。

    research parent #2761

    #2761 は research-only Issue です。

    現在の contract では、research conclusion の確定と implementation follow-up Issue の materialization が完了条件です。

    #2761 の live body と最終 refinement result を再確認し、AC1〜AC11 がすべて満たされ、#2767 が native child / follow-up として存在することが確認できるなら、#2761 は research Issue として完了扱いにしてください。

    repository の通常 Issue close procedure に従い、必要なら簡潔な completion comment を残して #2761 を close してください。

    #2767 のコードPRで Closes #2761 は使用しません。

    もし repository contract が parent を child completion まで open にしておく別の明示ルールを持つなら、その live rule を優先し、その理由を最終報告に明示してください。

    hard stop conditions

    人間承認を要求して停止してよい hard stop は、原則として次の2種類だけです。

    1. 破壊的操作が必要になる場合

    例:

    • git reset --hard
    • unrelated work を失う git clean
    • force push
    • branch history rewrite
    • 他作業者の変更を破棄
    • unrelated worktree / branch の削除
    • recover不能な形で既存成果物を上書き・破棄する操作

    このような操作が必要なら実行せず停止し、必要な操作と理由だけを報告してください。

    通常の commit、push、PR作成、PR body更新、test、CI rerun、non-destructive branch update、Issue comment、条件を満たした Issue close は破壊的操作とは扱いません。

    2. 秘密情報を扱う必要がある場合

    credential、token、private key、secret value 等を読み取り・表示・コピー・変更する必要が生じた場合は停止してください。

    秘密値をログや最終報告へ出力しないでください。

    hard stop にしないもの

    以下はそれ自体では人間承認の理由にしないでください。

    • test failure
    • CI failure
    • review REQUEST_CHANGES
    • stale head
    • ordinary merge conflict
    • advisory artifact 不足
    • scope-rollup / ledger / digest telemetry 不足
    • SubAgent の単なる human_review_required 自己申告
    • non-required check failure
      -既存コードの理解に追加調査が必要なこと

    安全な非破壊手段で原因を調査し、修正・再検証してください。

    ordinary merge conflict も、merge/update による非破壊解決が可能なら自律解決してください。履歴破壊や他作業の破棄が必要になった時点で初めて hard stop とします。

    権限や外部tool failure が発生した場合は、まず安全な代替経路・retry・current canonical tool を試してください。どうしても操作不能なら、それまでに到達できる最大限の安全な状態まで進め、exact blocker を最終報告してください。

    最終報告

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

    作業途中で人間の追加承認を求めず、current repository の canonical workflow と live evidence に基づいて完遂してください。

    特に重要なのは、#2761 をコード変更Issueとして再利用しないことと、PRでは Closes #2767 / Refs #2761 に分ける点です。これなら research と implementation の責務を維持したまま、自律ループを最後まで回せます。

  5. squne121 commented on Sep 25, 2026

    @squne121
    OwnerAuthor

    Research Issue #2761: 完了 (implementation follow-up 確認済み)

    refinement は approved で完了済み(https://github.com/squne121/loop-protocol/issues/2761#issuecomment-5833305264)。AC1〜AC11 のうち、AC11(implementation follow-up Issue の起票・リンク)を含め、research 結論は implementation child Issue #2767 として native sub-issue 登録済みで materialize されています。

    #2767 は本セッションで impl-review-loop(canonical loop)により実装完了し、PR #2768(Draft, merge-ready)が作成されました。verdict: APPROVE、live mergeability: MERGEABLE/CLEAN、required CI green。

    本 Issue(#2761)は research-only のため、Closes #2761 は実装PR側では使用していません(#2767 側で Closes #2767 / Refs #2761 を使用)。research 結論の確定と follow-up Issue の存在確認をもって本 Issue を completed としてクローズします。

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions