Skip to content

実装: build_intake_capsule.py の human-context-comment-url 解決範囲を実装 PR コメントに拡張する #2606

Closed

Description

@squne121

Machine-Readable Contract

contract_schema_version: v1
issue_kind: implementation
parent_issue: "none"
goal_ref: "impl-review-loop の human-context-comment-url 解決範囲を、target Issue に紐づく実装 PR の conversation issue comment にも comment-ID direct lookup で拡張する"
change_kind: code

Parent Issue

none

Parent Goal Ref

  • Goal: impl-review-loop の build_intake_capsule.py が human-supplied context comment を fail-closed で誤って弾く運用摩擦を解消する
  • Desired Destination: 単独改善(親 Issue なし)

Current Validated Scope

  • .claude/skills/impl-review-loop/scripts/build_intake_capsule.py の _collect_issue_comments() / _resolve_context_comments() の comment 解決ロジックの拡張(comments_by_id map への PR comment 追加ではなく、map に無い場合の comment-ID direct lookup 追加)
  • 対応する既存テスト .claude/skills/impl-review-loop/tests/test_intake_capsule_provenance_e2e.py / .claude/skills/impl-review-loop/tests/test_build_intake_capsule.py への回帰テスト追加

Remaining Parent Gaps

なし

Outcome

.claude/skills/impl-review-loop/scripts/build_intake_capsule.py が、--human-context-comment-url / --agent-report-comment-url で渡された #issuecomment-<ID> を以下の優先順で解決できるようになり、対応する回帰テストが追加された状態で完了とする。

  1. target Issue の既存 comments_by_id map に ID が存在すれば、従来どおりその経路を使う。
  2. map に無い場合だけ、GitHub Issues API の comment-ID direct lookup 相当(repos/{repo}/issues/comments/{comment_id})を read-only で叩き、readback した html_url と入力 URL を exact binding する。
    • /issues/N#issuecomment-ID の場合は N が target Issue と一致することを要求する。
    • /pull/N#issuecomment-ID の場合は、そのPRが closingIssuesReferences(gh pr view --json closingIssuesReferences 相当)で target Issue を closing issue として参照していることを read-only で検証する。
    • 上記のどちらの binding も成立しない場合は解決失敗とし、既存の fail-closed 挙動(human_supplied_comment_not_found:<id> 相当を fatal_errors に積み exit code 1)に合流する。

--pr-number 引数の追加、および linked PR を列挙して全 comments を取得する discovery subsystem の追加は採用しない(comment-ID direct lookup + PR→target Issue linkage check の方が変更が小さく、誤仕様のリスクが低いため)。

Runtime Verification Applicability

  • decision: immediate
  • reason: comment 解決ロジックは GitHub CLI / REST API のフィールド名(closingIssuesReferences 等)と実際のレスポンス形状に依存するため、fixture ベースの pytest だけでは field 名の誤認や API 挙動の思い込みを false green にし得る。実装時に既知の実例を使った 1 回の read-only runtime canary を証跡として要求する。
  • if immediate: 対応 AC は下記 AC9(<!-- runtime-verification: true --> タグ付き)。既知の実例は Issue 実装: ci-verdict-summary が conditional close-evidence-publication check を excluded として分類する #2587 に紐づく PR fix: classify conditional close evidence publication #2597 の comment #5612029072(_resolve_context_comments() が実際に解決に失敗した実運用ケース)。恒久的な live GitHub CI や新しい service integration は追加しない。runtime canary は .claude/skills/impl-review-loop/tests/test_intake_capsule_provenance_e2e.py 内の専用 pytest テスト 1 件として実装し、実際の GitHub API へ read-only アクセスする(既存の fixture ベーステストとは別ケースとして追加し、fixture テストの mock を差し替えない)。
    applicable_acs: AC9
    execution_environment: gh CLI が認証済みで api.github.com への network access がある実行環境(CI/ローカルどちらでも可)
    skip_conditions: gh CLI が未導入・未認証、または api.github.com に到達できない場合は pytest.skip() で SKIP として扱う(PASS/FAILとは区別する)
    fallback_policy: fallback 経路は設けない。実際の GitHub API 応答が得られない場合は SKIP のみとし、mock/fixture への切替を PASS として扱わない
    artifact_requirements: 実行時の pytest stdout ログ(該当テストの出力全文)を PR 本文の Runtime Verification Evidence セクションに inline 引用する

In Scope

  • _resolve_context_comments()(または同等の解決ロジック)に、target Issue の comments_by_id map に ID が無い場合だけ発火する comment-ID direct lookup 経路を追加する
  • comment-ID direct lookup は GitHub Issues API の comment-ID endpoint 相当(repos/{repo}/issues/comments/{comment_id})を read-only で使う
  • lookup 結果の html_url(またはそれに相当する repo/issue-or-pull 番号)と入力 URL を exact binding する
    • /issues/N#issuecomment-ID: N が target Issue と一致することを要求
    • /pull/N#issuecomment-ID: そのPRが closingIssuesReferences で target Issue を closing issue として参照していることを read-only で検証
  • 同一 repo に存在するだけの無関係な PR comment は受理しない(binding 不成立で fail-closed)
  • 対象はトップレベルの PR conversation issue comment(#issuecomment-*)のみ。PR inline review comment / review thread / review body は対象外のまま拡張しない
  • provenance(human_supplied / agent_generated)は既存どおり呼び出し元の CLI flag(--human-context-comment-url / --agent-report-comment-url)で決定し、comment 解決元(Issue 側 / PR 側)には依存させない
  • 既存の fail-closed 挙動(該当 comment が本当に存在しない場合は fatal_errors に残し exit code 1)を維持する
  • .claude/skills/impl-review-loop/tests/test_intake_capsule_provenance_e2e.py / .claude/skills/impl-review-loop/tests/test_build_intake_capsule.py に、PR 側 comment URL を human-context-comment-url / agent-report-comment-url として渡した場合の解決成功・fail-closed 双方を検証する回帰テストを追加する
  • .claude/skills/impl-review-loop/tests/test_intake_capsule_provenance_e2e.py に、既知の実例(Issue 実装: ci-verdict-summary が conditional close-evidence-publication check を excluded として分類する #2587 / PR fix: classify conditional close evidence publication #2597 comment #5612029072)に対する read-only runtime canary pytest(gh 未認証・未導入時は pytest.skip())を1件追加する(AC9)

Out of Scope

  • --pr-number 引数の追加
  • linked PR を列挙して各 PR の全 comments を取得する discovery subsystem の追加
  • human_supplied / agent_generated の provenance 判定ルール自体の変更
  • Root-Owned Synchronous Entry Transition の契約変更
  • already_satisfied terminal route の追加(別 follow-up 候補)
  • PR inline review comments / review threads / review body への対象拡張

Acceptance Criteria

  • AC1: target Issue 自身の issue comment を human-context-comment-url / agent-report-comment-url として渡した場合、従来どおり解決に成功する(既存経路の回帰なし)
  • AC2: target Issue に紐づく実装 PR の conversation issue comment(#issuecomment-<ID>)を human-context-comment-url として渡した場合、comment-ID direct lookup 経由で解決に成功する
  • AC3: 同じ PR conversation issue comment を agent-report-comment-url として渡した場合も解決に成功し、既存の agent_generated provenance / schema 検証が維持される
  • AC4: target Issue と無関係な(closing issue として参照していない)PR の conversation comment を渡した場合、fail-closed になる
  • AC5: 存在しない comment ID を渡した場合、既存の not-found fatal error semantics(exit code 1、human_supplied_comment_not_found:<id> 相当)で失敗する
  • AC6: readback した comment の repo / issue-or-pull 番号 / URL binding が入力と一致しない場合は fail-closed になる
  • AC7: PR inline review comment 等、今回対象外の URL shape は受理されない
  • AC8: 追加した回帰テスト(test_intake_capsule_provenance_e2e.py / test_build_intake_capsule.py)が全件 PASS する
  • AC9: 既知の実例(Issue 実装: ci-verdict-summary が conditional close-evidence-publication check を excluded として分類する #2587 に紐づく PR fix: classify conditional close evidence publication #2597 の comment #5612029072)を用いた read-only runtime canary pytest で、human-context-comment-url 解決が実際の GitHub 環境上で成功することを 1 回確認する(gh 未認証・未導入環境では pytest.skip())

Verification Commands

  • 追加した PR コメント解決の回帰テスト(AC1-AC7)と AC9 runtime canary(gh 未認証・未導入環境では pytest.skip())を含め全件 PASS:
# AC1
# AC2
# AC3
# AC4
# AC5
# AC6
# AC7
# AC9
$ uv run pytest .claude/skills/impl-review-loop/tests/test_intake_capsule_provenance_e2e.py
  • 既存 comment 収集ロジックのテストが破壊されていない:
# AC8
$ uv run pytest .claude/skills/impl-review-loop/tests/test_build_intake_capsule.py

Allowed Paths

  • .claude/skills/impl-review-loop/scripts/build_intake_capsule.py
  • .claude/skills/impl-review-loop/tests/test_intake_capsule_provenance_e2e.py
  • .claude/skills/impl-review-loop/tests/test_build_intake_capsule.py

Stop Conditions

  • Allowed Paths 外の変更が必要と判明した場合
  • In Scope の固定契約(キー集合・スキーマ・型定義)の変更が必要になった場合
  • 新規 Issue の起票が必要と判断した場合(スコープ分割が発生する場合)
  • 後続 Phase / 別スコープへの波及が判明した場合
  • nested SubAgent delegation が必要になった場合
  • 外部サービス利用・権限昇格・既存テスト大規模改変が必要になった場合

Required Skills

なし

Required Design References

  • .claude/skills/impl-review-loop/SKILL.md
  • .claude/skills/impl-review-loop/scripts/build_intake_capsule.py(_resolve_context_comments() / _collect_issue_comments() の既存実装)

Scope Delta(任意)

N/A

Notes for Reviewer

Delivery Rule

  • 1 Issue = 1 PR を原則とする。
  • worktree を切って作業し、Draft PR を既定とする。

Source

Activity

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

    @squne121
    OwnerAuthor

    判定

    REQUEST_CHANGES。Issue #2606 の問題意識は正しいですが、現状の Issue contract のまま implementation に入るのは非推奨です。

    実障害は再現性があります。現在の build_intake_capsule.py は target Issue の /issues/{issue_number}/comments だけを全ページ取得し、#issuecomment-{id} をその集合から引くため、PR #2597 上の human context comment のような入力を解決できません。 実際、起点となった #2597 の comment #5612029072 は html_url が /pull/2597#issuecomment-... であるトップレベル PR conversation comment です。

    ただし、#2606 の解決案には implementation blocker が複数あります。#2606 自体には現時点でコメントはありません。

    1. [P0 / blocker] gh issue view --json closingIssuesReferences は成立しません。 実装: build_intake_capsule.py の human-context-comment-url 解決範囲を実装 PR コメントに拡張する #2606 は PR 自動検出案として gh issue view の closingIssuesReferences を挙げています。 しかし現在の GitHub CLI では、Issue 側のフィールド名は closedByPullRequestsReferences、closingIssuesReferences は PR 側の gh pr view に存在します。(GitHub CLI) これは単なる命名ミスではなく、選択肢の一方をそのまま実装すると production command が失敗します。しかも現在のテストは _run_command を fixture で置換するため、fixture を誤仕様に合わせれば false-green にできます。したがって Runtime Verification を not_applicable とする判断とも矛盾します。

    2. [P0 / blocker] Verification Commands と Allowed Paths のテストパスが current main と不一致です。 実装: build_intake_capsule.py の human-context-comment-url 解決範囲を実装 PR コメントに拡張する #2606 は .claude/skills/impl-review-loop/scripts/tests/test_intake_capsule_provenance_e2e.py と scripts/tests/test_build_intake_capsule.py を指定しています。 実ファイルはそれぞれ .claude/skills/impl-review-loop/tests/test_intake_capsule_provenance_e2e.py と .claude/skills/impl-review-loop/tests/test_build_intake_capsule.py です。 現在の厳密な Allowed Paths 運用では、正しい回帰テストを変更すると scope violation、契約通り実行すると file-not-found になります。これは実装前に直すべきです。

    3. [P1] --pr-number を追加する案は捨てた方がよいです。 current impl-review-loop の正式 input は issue_number と human/agent comment URL 群で、PR number はありません。 さらに preparation は build_capsule_argv() を canonical argv の single source of truth と明記しており、human/agent URL を additive flag として渡します。 build_intake_capsule.py にだけ --pr-number を追加すると、通常の orchestrator はその値を供給できません。SKILL/preparation まで変更すれば使えますが、今度は 実装: build_intake_capsule.py の human-context-comment-url 解決範囲を実装 PR コメントに拡張する #2606 の Allowed Paths 外です。しかも URL 自体が /pull/2597#issuecomment-... と PR number を保持しています。入力を二重化する価値がありません。

    4. [P1] PR の全コメントを収集する設計自体が過剰です。comment ID の direct lookup が最小解です。 GitHub REST API は GET /repos/{owner}/{repo}/issues/comments/{comment_id} で、Issue と PR のトップレベルコメントを comment ID 単体で取得できます。GitHub は PR も Issues API 上では issue として扱うと明記しています。(GitHub Docs) つまり明示的に #issuecomment-5612029072 を渡されているのに、「linked PR を列挙 → PR ごとの comments を全取得 → ID検索」とする必要がありません。個人開発で workflow friction を減らすという前提でも、direct lookup の方が API 呼び出し、pagination、multiple-PR ambiguity、fixture 複雑化をすべて減らします。

    5. [P1] 「PR コメント」の種類を contract で限定すべきです。 今回必要なのは fix: classify conditional close evidence publication #2597 のようなトップレベル conversation comment、つまり #issuecomment-* です。GitHub の inline review comment は別 API・別オブジェクトで、unified diff 上のコメントとして明確に区別されています。(GitHub Docs) current resolver の regex も #issuecomment-(\d+)$ 専用です。 「PR コメント全般」と書くと review body、inline review comment、review thread まで対応対象と誤読できます。本 Issue は “PR conversation issue comments (#issuecomment-*) only” と固定するのが妥当です。

    6. [P1] direct lookup にしても「target Issue と無関係な PR」を受理してはいけません。 実装: multi-turn anchor の owner turn を chronology metadata として扱い、reaction decision flow を issue-refinement-loop と impl-review-loop へ導入する #1950 で導入された元契約は repo/Issue/comment mismatch を fail-closed としています。 実装: build_intake_capsule.py の human-context-comment-url 解決範囲を実装 PR コメントに拡張する #2606 の goal も「紐づく実装 PR」です。したがって、同一 repository の任意 PR comment を comment ID が存在するだけで通すのは scope 拡大です。PR URLなら URL から PR number を取得し、その PR の closingIssuesReferences に target Issue があることを確認する、という1回の read-only relation check で十分です。ここは provenance のための重い security harness ではなく、別 Issue のコメントを誤投入しないための correctness binding と考えるべきです。

    7. [P1] Runtime Verification Applicability: not_applicable は immediate/read-only に変更すべきです。 実装: build_intake_capsule.py の human-context-comment-url 解決範囲を実装 PR コメントに拡張する #2606 自身が GitHub API/CLI の取得範囲を変更する Issue なのに、「外部 API を伴わないため not applicable」としています。 今回見つかった closingIssuesReferences の取り違えこそ mock-only test では検出しづらい failure です。ただし CI に live GitHub test を恒久追加する必要まではありません。実装 PR で既知の fix: classify conditional close evidence publication #2597/#5612029072 を使った read-only canary を1回実行して evidence として残す程度で十分です。

    8. [P2] agent-report-comment-url の PR 側回帰が Acceptance Criteria から抜けています。 Outcome は human と agent の両方を PR comments から解決すると読めますが、明示的 AC は human 側に偏っています。 origin は URL の所在ではなく、呼び出し元が human/agent のどちらの flag に渡したかだけで決める、という既存契約です。 したがって PR conversation comment の agent report も1ケースだけ固定すべきです。

    9. [P2] Scope Collision は hard stop にする必要はないものの、実装: issue-contract-review の human_judgment に対する人間 override を CONTRACT_REVIEW_HUMAN_OVERRIDE_V1 スキーマで記録・検出できるようにする #1348 は「変更箇所が違うから低リスク」と言い切れません。 実装: issue-contract-review の human_judgment に対する人間 override を CONTRACT_REVIEW_HUMAN_OVERRIDE_V1 スキーマで記録・検出できるようにする #1348 も build_intake_capsule.py の comment/snapshot consumer を直接変更する OPEN Issue です。 実装: #1939 Workstream 4 — retrospective candidate を issue-refinement-loop → impl-review-loop へ controlled handoffする #2602 はより handoff/interface 寄りで、こちらは直接衝突リスクが低そうです。 特に test_build_intake_capsule.py は _run_command の呼び出し順を配列 fixture で固定するテストが多いため、新しい GitHub call を1つ追加しただけでも同一テスト群への mechanical conflict が起き得ます。とはいえ個人開発では、これを preflight blocker にするより 実装直前に main refresh、PR が開いていれば rebase/直列化で十分です。

    推奨する実装設計

    #2606 はかなり単純化できます。--pr-number も linked PR 一括収集も追加しないことを推奨します。

    explicit human/agent context URL
            ↓
    canonical URL parse
      /issues/N#issuecomment-ID
      /pull/N#issuecomment-ID
            ↓
    target Issue comments の既存 map に ID があればそのまま使用
            ↓ missing
    GET /repos/{repo}/issues/comments/{ID}
            ↓
    html_url exact readback
            ↓
    issues/N の場合: N == target Issue
    pull/N の場合: PR N が target Issue を closingIssuesReferences に持つことを確認
            ↓
    既存 _resolve_context_comments() と同じ provenance / schema validation

    GitHub の comment-ID endpoint は comment_id を必須の unique identifier として定義しているため、このモデルと自然に一致します。(GitHub Docs) 起点の #2597 comment #5612029072 も実際にこの Issues API の comment resource として取得できています。

    これなら、「PRを探す」という新しい discovery subsystem を足さず、明示された1コメントだけを補完取得する設計になります。セキュリティ目的の余分な ledger/schema/harness は不要です。

    #2606 の contract を直すなら

    Allowed Paths は次の3つだけで十分です。

    種別 | 正しい path -- | -- production | .claude/skills/impl-review-loop/scripts/build_intake_capsule.py E2E | .claude/skills/impl-review-loop/tests/test_intake_capsule_provenance_e2e.py unit | .claude/skills/impl-review-loop/tests/test_build_intake_capsule.py

    Acceptance Criteria は Issue comment success / linked PR conversation human success / linked PR agent-report success / unlinked PR failure / nonexistent ID failure / html_url or repo mismatch failure / inline review URL out-of-scope の7ケース程度で十分です。

    また rg "def _collect_issue_comments" は品質証拠としてほぼ価値がありません。behavioral pytest と Ruff に置換した方が有用です。

    結論

    Issue #2606 は close ではなく rewrite → implementation が推奨です。 解消したい friction は実在しますが、「PR number を別入力にする」「linked PR の comments を丸ごと収集する」という現在の設計方向は必要以上に大きく、しかも GitHub CLI field 名と test path が間違っています。

    最も小さく堅牢なのは、明示された #issuecomment-ID を direct REST lookupし、PRだった場合だけ target Issue との linkage を検証する設計です。これなら既存 provenance semantics を変えず、今回の運用摩擦だけを低コストで除去できます。

    ## 判定

    REQUEST_CHANGES。Issue #2606 の問題意識は正しいですが、現状の Issue contract のまま implementation に入るのは非推奨です。

    実障害は再現性があります。現在の build_intake_capsule.py は target Issue の /issues/{issue_number}/comments だけを全ページ取得し、#issuecomment-{id} をその集合から引くため、PR #2597 上の human context comment のような入力を解決できません。 実際、起点となった #2597 の comment #5612029072 は html_url が /pull/2597#issuecomment-... であるトップレベル PR conversation comment です。

    ただし、#2606 の解決案には implementation blocker が複数あります。#2606 自体には現時点でコメントはありません。

    1. [P0 / blocker] gh issue view --json closingIssuesReferences は成立しません。 実装: build_intake_capsule.py の human-context-comment-url 解決範囲を実装 PR コメントに拡張する #2606 は PR 自動検出案として gh issue view の closingIssuesReferences を挙げています。 しかし現在の GitHub CLI では、Issue 側のフィールド名は closedByPullRequestsReferences、closingIssuesReferences は PR 側の gh pr view に存在します。([GitHub CLI]1) これは単なる命名ミスではなく、選択肢の一方をそのまま実装すると production command が失敗します。しかも現在のテストは _run_command を fixture で置換するため、fixture を誤仕様に合わせれば false-green にできます。したがって Runtime Verification を not_applicable とする判断とも矛盾します。

    2. [P0 / blocker] Verification Commands と Allowed Paths のテストパスが current main と不一致です。 実装: build_intake_capsule.py の human-context-comment-url 解決範囲を実装 PR コメントに拡張する #2606 は .claude/skills/impl-review-loop/scripts/tests/test_intake_capsule_provenance_e2e.py と scripts/tests/test_build_intake_capsule.py を指定しています。 実ファイルはそれぞれ .claude/skills/impl-review-loop/tests/test_intake_capsule_provenance_e2e.py と .claude/skills/impl-review-loop/tests/test_build_intake_capsule.py です。 現在の厳密な Allowed Paths 運用では、正しい回帰テストを変更すると scope violation、契約通り実行すると file-not-found になります。これは実装前に直すべきです。

    3. [P1] --pr-number を追加する案は捨てた方がよいです。 current impl-review-loop の正式 input は issue_number と human/agent comment URL 群で、PR number はありません。 さらに preparation は build_capsule_argv() を canonical argv の single source of truth と明記しており、human/agent URL を additive flag として渡します。 build_intake_capsule.py にだけ --pr-number を追加すると、通常の orchestrator はその値を供給できません。SKILL/preparation まで変更すれば使えますが、今度は 実装: build_intake_capsule.py の human-context-comment-url 解決範囲を実装 PR コメントに拡張する #2606 の Allowed Paths 外です。しかも URL 自体が /pull/2597#issuecomment-... と PR number を保持しています。入力を二重化する価値がありません。

    4. [P1] PR の全コメントを収集する設計自体が過剰です。comment ID の direct lookup が最小解です。 GitHub REST API は GET /repos/{owner}/{repo}/issues/comments/{comment_id} で、Issue と PR のトップレベルコメントを comment ID 単体で取得できます。GitHub は PR も Issues API 上では issue として扱うと明記しています。([GitHub Docs]2) つまり明示的に #issuecomment-5612029072 を渡されているのに、「linked PR を列挙 → PR ごとの comments を全取得 → ID検索」とする必要がありません。個人開発で workflow friction を減らすという前提でも、direct lookup の方が API 呼び出し、pagination、multiple-PR ambiguity、fixture 複雑化をすべて減らします。

    5. [P1] 「PR コメント」の種類を contract で限定すべきです。 今回必要なのは fix: classify conditional close evidence publication #2597 のようなトップレベル conversation comment、つまり #issuecomment-* です。GitHub の inline review comment は別 API・別オブジェクトで、unified diff 上のコメントとして明確に区別されています。([GitHub Docs]3) current resolver の regex も #issuecomment-(\d+)$ 専用です。 「PR コメント全般」と書くと review body、inline review comment、review thread まで対応対象と誤読できます。本 Issue は “PR conversation issue comments (#issuecomment-*) only” と固定するのが妥当です。

    6. [P1] direct lookup にしても「target Issue と無関係な PR」を受理してはいけません。 実装: multi-turn anchor の owner turn を chronology metadata として扱い、reaction decision flow を issue-refinement-loop と impl-review-loop へ導入する #1950 で導入された元契約は repo/Issue/comment mismatch を fail-closed としています。 実装: build_intake_capsule.py の human-context-comment-url 解決範囲を実装 PR コメントに拡張する #2606 の goal も「紐づく実装 PR」です。したがって、同一 repository の任意 PR comment を comment ID が存在するだけで通すのは scope 拡大です。PR URLなら URL から PR number を取得し、その PR の closingIssuesReferences に target Issue があることを確認する、という1回の read-only relation check で十分です。ここは provenance のための重い security harness ではなく、別 Issue のコメントを誤投入しないための correctness binding と考えるべきです。

    7. [P1] Runtime Verification Applicability: not_applicable は immediate/read-only に変更すべきです。 実装: build_intake_capsule.py の human-context-comment-url 解決範囲を実装 PR コメントに拡張する #2606 自身が GitHub API/CLI の取得範囲を変更する Issue なのに、「外部 API を伴わないため not applicable」としています。 今回見つかった closingIssuesReferences の取り違えこそ mock-only test では検出しづらい failure です。ただし CI に live GitHub test を恒久追加する必要まではありません。実装 PR で既知の fix: classify conditional close evidence publication #2597/#5612029072 を使った read-only canary を1回実行して evidence として残す程度で十分です。

    8. [P2] agent-report-comment-url の PR 側回帰が Acceptance Criteria から抜けています。 Outcome は human と agent の両方を PR comments から解決すると読めますが、明示的 AC は human 側に偏っています。 origin は URL の所在ではなく、呼び出し元が human/agent のどちらの flag に渡したかだけで決める、という既存契約です。 したがって PR conversation comment の agent report も1ケースだけ固定すべきです。

    9. [P2] Scope Collision は hard stop にする必要はないものの、実装: issue-contract-review の human_judgment に対する人間 override を CONTRACT_REVIEW_HUMAN_OVERRIDE_V1 スキーマで記録・検出できるようにする #1348 は「変更箇所が違うから低リスク」と言い切れません。 実装: issue-contract-review の human_judgment に対する人間 override を CONTRACT_REVIEW_HUMAN_OVERRIDE_V1 スキーマで記録・検出できるようにする #1348 も build_intake_capsule.py の comment/snapshot consumer を直接変更する OPEN Issue です。 実装: #1939 Workstream 4 — retrospective candidate を issue-refinement-loop → impl-review-loop へ controlled handoffする #2602 はより handoff/interface 寄りで、こちらは直接衝突リスクが低そうです。 特に test_build_intake_capsule.py は _run_command の呼び出し順を配列 fixture で固定するテストが多いため、新しい GitHub call を1つ追加しただけでも同一テスト群への mechanical conflict が起き得ます。とはいえ個人開発では、これを preflight blocker にするより 実装直前に main refresh、PR が開いていれば rebase/直列化で十分です。

    推奨する実装設計

    #2606 はかなり単純化できます。--pr-number も linked PR 一括収集も追加しないことを推奨します。

    explicit human/agent context URL
            ↓
    canonical URL parse
      /issues/N#issuecomment-ID
      /pull/N#issuecomment-ID
            ↓
    target Issue comments の既存 map に ID があればそのまま使用
            ↓ missing
    GET /repos/{repo}/issues/comments/{ID}
            ↓
    html_url exact readback
            ↓
    issues/N の場合: N == target Issue
    pull/N の場合: PR N が target Issue を closingIssuesReferences に持つことを確認
            ↓
    既存 _resolve_context_comments() と同じ provenance / schema validation
    

    GitHub の comment-ID endpoint は comment_id を必須の unique identifier として定義しているため、このモデルと自然に一致します。([GitHub Docs]2) 起点の #2597 comment #5612029072 も実際にこの Issues API の comment resource として取得できています。

    これなら、「PRを探す」という新しい discovery subsystem を足さず、明示された1コメントだけを補完取得する設計になります。セキュリティ目的の余分な ledger/schema/harness は不要です。

    #2606 の contract を直すなら

    Allowed Paths は次の3つだけで十分です。

    種別 正しい path
    production .claude/skills/impl-review-loop/scripts/build_intake_capsule.py
    E2E .claude/skills/impl-review-loop/tests/test_intake_capsule_provenance_e2e.py
    unit .claude/skills/impl-review-loop/tests/test_build_intake_capsule.py

    Acceptance Criteria は Issue comment success / linked PR conversation human success / linked PR agent-report success / unlinked PR failure / nonexistent ID failure / html_url or repo mismatch failure / inline review URL out-of-scope の7ケース程度で十分です。

    また rg "def _collect_issue_comments" は品質証拠としてほぼ価値がありません。behavioral pytest と Ruff に置換した方が有用です。

    結論

    Issue #2606 は close ではなく rewrite → implementation が推奨です。 解消したい friction は実在しますが、「PR number を別入力にする」「linked PR の comments を丸ごと収集する」という現在の設計方向は必要以上に大きく、しかも GitHub CLI field 名と test path が間違っています。

    最も小さく堅牢なのは、明示された #issuecomment-ID を direct REST lookupし、PRだった場合だけ target Issue との linkage を検証する設計です。これなら既存 provenance semantics を変えず、今回の運用摩擦だけを低コストで除去できます。

  3. squne121 commented on Sep 10, 2026

    @squne121
    OwnerAuthor

    推奨は #2606 をそのまま implementation に送らず、comment #5612650028 を human-context anchor として issue-refinement-loop で rewrite する です。レビューの P0 は確認できました。現在の build_intake_capsule.py は target Issue のコメント一覧だけを収集して ID 解決しており、指摘された制約が実在します。 また、テスト2本の正しい配置も scripts/tests/ ではなく impl-review-loop/tests/ です。

    技術方針もレビュー案を採用するのが妥当です。GitHub CLI の現行仕様では Issue 側は closedByPullRequestsReferences、PR 側が closingIssuesReferences です。さらに REST API は comment_id 単独で Issue/PR conversation comment を取得できます。したがって --pr-number や linked PR 全コメント収集を追加するより、comment-ID direct lookup + PR→target Issue linkage check が小さく、誤仕様も減ります。([GitHub CLI]1)

    今回の注意点は scope guard です。現行 issue-refinement-loop はループ継続自体の承認をデフォルト要求しませんが、Allowed Paths 等の新規 delta は別途 human_judgment_required になり得ます。 一方、現在の契約には interactive human instruction を root control-plane が materialize し、operator-selected human-context として controlled contract update に流す経路があります。 そのため、下のプロンプトでは今回許可する delta を具体的に先行承認しています。ガードを無視するのではなく、正規の authority 経路を使わせる形です。

    そのまま既存の auto mode Claude Code に投入するなら、以下を推奨します。

    リポジトリ squne121/loop-protocol の Issue #2606 を対象に、.claude/skills/issue-refinement-loop を実行してください。

    対象:

    このセッションは既に Claude Code の auto mode で起動済みです。
    Claude Code の permission mode を変更したり、/permission 等による追加承認を要求したりしないでください。
    repo の issue-refinement-loop が定義する loop iteration approval は不要として、自律的に最後まで進めてください。

    今回のオペレータ指示

    上記 comment #5612650028 を、私が明示的に選択した human context として扱ってください。

    私は、このコメントの REQUEST_CHANGES を Issue #2606 に反映して refinement を進めること、および以下に列挙する exact scope delta を事前に承認します。

    これは direct interactive human instruction です。
    scope-signal guard が以下の既承認 delta のみを理由に停止しようとする場合は、ガードを迂回・無効化・改変するのではなく、リポジトリで定義されている Accepted Trust Model / operator-selected human-context / interactive prompt materialization の正規経路を使用してください。
    必要なら root control-plane が OWNER_DIRECTIVE_MATERIALIZED_FROM_INTERACTIVE_PROMPT_V1 provenance marker を伴う形でこの指示を materialize し、canonical controlled contract-update route を通したうえで fresh preflight / review / allowed-path validation を再実行してください。

    この事前承認を、下記以外の新しい scope、破壊的操作、permission boundary の変更、secret 操作、外部有料サービス利用、Issue split の承認へ拡大解釈してはいけません。

    承認済み refinement 方針

    1. 解決方式

    Issue #2606 の設計は次の方向へ修正してください。

    • --pr-number は追加しない。
    • linked PR を列挙して各 PR の全 comments を取得する discovery subsystem は追加しない。
    • human / agent context URL に含まれる #issuecomment-<ID> を canonical に parse する。
    • target Issue comments の既存 map に ID が存在すれば既存経路を利用する。
    • map に無い場合だけ、GitHub Issues API の comment-ID endpoint相当:
      repos/{repo}/issues/comments/{comment_id}
      を read-only で direct lookup する。
    • readback した html_url と入力 URL を exact binding する。
    • /issues/N#issuecomment-ID の場合は N が target Issue と一致することを要求する。
    • /pull/N#issuecomment-ID の場合は、その PR が target Issue を closing issue として参照していることを read-only で検証する。
    • 同一 repo に存在するだけの無関係な PR comment は受理しない。
    • provenance は URL の所在から推定せず、既存どおり human-context / agent-report の入力 lane から決定する。
    • PR inline review comments / review threads / review body まで対象を拡張しない。
    • 対象はトップレベルの PR conversation issue comments (#issuecomment-*) に限定する。

    既存 fail-closed semantics は維持してください。

    2. Allowed Paths

    誤った scripts/tests/... path を修正し、Allowed Paths は原則以下の3ファイルだけにしてください。

    • .claude/skills/impl-review-loop/scripts/build_intake_capsule.py
    • .claude/skills/impl-review-loop/tests/test_intake_capsule_provenance_e2e.py
    • .claude/skills/impl-review-loop/tests/test_build_intake_capsule.py

    これは今回明示的に承認した exact Allowed Paths delta です。
    この訂正だけを new_allowed_path_layer 等として再度人間判断に戻さないでください。正規の trusted contract-update route で処理してください。

    新たな production file、schema、ledger、publisher、permission harness 等が必要になった場合は、この承認には含まれません。

    3. Acceptance Criteria

    少なくとも以下が機械的に検証可能になるよう Issue contract を修正してください。

    1. target Issue 自身の issue comment が従来どおり解決成功する。
    2. target Issue に紐づく PR の conversation comment を human-context URL として解決成功する。
    3. target Issue に紐づく PR の conversation comment を agent-report URL として解決成功し、既存 agent-report schema/provenance validation が維持される。
    4. target Issue と無関係な PR の conversation comment は fail-closed になる。
    5. 存在しない comment ID は既存の not-found fatal error semantics で失敗する。
    6. repo / html_url / URL binding mismatch は fail-closed になる。
    7. inline PR review comment 等、今回対象外の URL shape は受理しない。

    既存 semantics と重複する AC は、不必要に細分化せず読みやすくまとめても構いません。

    4. Runtime Verification Applicability

    not_applicable のままにせず、immediate/read-only 相当へ修正してください。

    mock/fixture の pytest だけでは GitHub CLI / API field 名の誤認を false-green にできるため、実装時の evidence として既知の実例を使った read-only canary を要求してください。

    既知の例:

    ただし、このためだけに恒久的な live GitHub CI、複雑な harness、新しい service integration を追加する必要はありません。
    1回の read-only runtime evidence で十分です。

    5. Verification Commands

    存在する正しい test path を使用してください。

    少なくとも:

    • .claude/skills/impl-review-loop/tests/test_intake_capsule_provenance_e2e.py
    • .claude/skills/impl-review-loop/tests/test_build_intake_capsule.py

    の behavioral pytest を含めてください。

    既存プロジェクトの標準に合う Ruff 等の静的検査も、Allowed Paths を拡張せず実行可能なら追加してください。

    単に
    rg -n "def _collect_issue_comments" ...
    で関数シグネチャの存在を確認するだけの verification は、主要な品質証拠としては採用しないでください。

    6. Scope Collision

    #1348 / #2602 および同一 production/test file を現在変更している Issue / PR がないか、実装前提を決めるため read-only で再確認してください。

    collision の可能性だけを理由に即 human escalation しないでください。
    個人開発リポジトリなので、実害がなければ note に留めてください。

    ただし current main の実変更と真正面から競合し、Issue contract を一意に決められない場合は evidence を残してください。

    SubAgent 実行要件

    issue-refinement-loop の現行 Skill / planner / command registry / references を正本として実行してください。手作業で旧フローを再実装しないでください。

    調査では SubAgent を使用してください。

    • repository/codebase の事実確認は codebase-investigator
    • GitHub CLI / GitHub REST API 等の外部仕様確認が必要なら web-researcher

    独立して実行できる調査は可能な範囲で並列化してください。

    重要:

    • SubAgent を起動したら、その結果を待たずに root review、Issue rewrite、termination 判定へ進んではいけません。
    • 起動した全 SubAgent の完了を必ず待ち、join してから次工程へ進んでください。
    • SubAgent の structured result を root/main thread が consume してください。
    • root-owned decision authority を SubAgent に移譲しないでください。
    • SubAgent に nested SubAgent delegation をさせないでください。
    • Issue rewrite に issue-editor 等の canonical worker が必要な場合も、完了と authoritative readback を待ってから fresh validation へ進んでください。

    自律実行ポリシー

    質問・確認を挟まず、issue-refinement-loop の許容範囲内で自律的に進めてください。

    needs-fix は max iteration 到達前なら自動継続してください。
    deterministic repair / structural repair / controlled contract update / issue-editor handoff が canonical NEXT_ACTION として返された場合は、その正規 consumer を使用して継続してください。

    今回明示した exact scope delta を理由にした human_judgment_required は、そのまま人間へ返さず、上記の interactive human instruction materialization / operator-selected human-context の正規経路で解決できるかを先に処理してください。

    ただし、以下は今回の事前承認対象外です。

    • 新しい Issue への scope split
    • 上記3ファイル以外への新規 Allowed Paths 拡張
    • destructive / non-idempotent な外部操作
    • secrets / credentials が必要な操作
    • permission boundary redesign
    • external paid service の追加
    • unrelated scope の追加
    • repository/environment failure で canonical recovery を行っても継続不能な場合

    これらが実際に必要と確定した場合だけ fail-closed の termination を許可します。
    単なる低 confidence、scope collision の可能性、追加レビューが必要というだけでは停止しないでください。

    完了条件

    この依頼のスコープは issue-refinement-loop による Issue #2606 の refinement までです。

    コード実装や impl-review-loop の実行は開始しないでください。

    以下を満たすまで継続してください。

    • target comment の actionable findings が Issue contract に反映されている
    • Issue body/title の authoritative readback が完了している
    • fresh refinement preflight が完了している
    • fresh root-owned review が APPROVE / proceed 相当になっている
    • Allowed Paths / AC / Verification / Runtime Verification が相互整合している
    • unresolved blocker がない
    • impl_ready 相当の handoff 状態まで到達している

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

    人間への途中承認要求は不要です。完了または上記の genuinely non-authorized hard-stop 条件まで一気に実行してください。

    この形なら、単に「承認不要」と書くより、今回の Allowed Paths 修正などを初期オペレータ指示として明示的に authority 化しているため、scope_signal_guard → human_judgment_required の再発をかなり避けやすいです。同時に、未知の scope まで勝手に承認する指示にはしていません。

  4. squne121 commented on Sep 10, 2026

    @squne121
    OwnerAuthor

    issue-refinement-loop: approved

    LOOP_HANDOFF_RESULT_V1:
      status: impl_ready
      routing_action: run_impl_review_loop
      contract_review:
        status: go
        gate_result: fresh_go
        latest_comment_url: null
        generated_at: "2026-09-10T04:17:57Z"
        body_sha256: "sha256:6e3070b9af37b4ef2c4f9d4e384f6ea1522c26aa0544344b04b120473dfc5726"
      metadata:
        title_prefix_ready: true
      label_sync_observation:
        kind: presentation_sync
        result: noop
        detail: "this cycle did not mutate labels; existing labels left as-is"
      auto_fixes:
        result: auto_fixed
        required: []
        skipped: []
      blockers: []
      permissions:
        unavailable: []
      generated_at: "2026-09-10T04:18:00Z"
      checked_body_sha256: "sha256:6e3070b9af37b4ef2c4f9d4e384f6ea1522c26aa0544344b04b120473dfc5726"
      checker_exit_code: 0
      missing_sections: []
      missing_contract_keys: []
    FOLLOW_UP_MATERIALIZATION_RESULT_V1:
      schema_version: 1
      materialized_by: issue-refinement-loop
      follow_up_issues: []
      note_only_observations: []

    Note: この loop 実行は operator の明示指示により issue-refinement-loop の refinement 完了までをスコープとし、impl-review-loop の起動(run_root_transition() 相当)は意図的に実行していません。routing_action: run_impl_review_loop は本 Issue が実装着手可能であることを示す telemetry であり、本セッションではこれを消費して自動起動していません。

  5. self-assigned this
    on Sep 10, 2026
  6. squne121 commented on Sep 10, 2026

    @squne121
    OwnerAuthor

    推奨アクションは、再 refinement せず、そのまま Issue #2606 を impl-review-loop に投入するです。最新の refinement 結果は status: impl_ready / routing_action: run_impl_review_loop / blockersなしで、fresh preflight と contract review も通過しています。

    また、この Issue では GitHub REST の GET /repos/{owner}/{repo}/issues/comments/{comment_id} が Issue/PR双方の conversation comment を取得でき、gh pr view --json closingIssuesReferences も現行CLIで利用可能なことを再確認できました。 ([GitHub Docs]1)

    実行上の重要点は Draft PR publication の事前承認を明示することです。現行 open-pr は publish: yes がなければ E_APPROVAL_MISSING で止まるため、今回のあなたの指示を「#2606 の bounded な branch publish / Draft PR 起票への明示的 operator approval」として渡します。ただし merge は承認対象外として止めます。

    そのまま既に auto mode で起動している Claude Code に投入するなら、以下を推奨します。

    リポジトリ squne121/loop-protocol の Issue #2606 を対象に、.claude/skills/impl-review-loop を実行してください。

    対象 Issue:
    #2606

    最新の refinement 完了報告:
    #2606 (comment)

    Issue #2606 は既に issue-refinement-loop で refinement 済みで、最新 handoff は status: impl_ready / routing_action: run_impl_review_loop / blockersなしです。
    再度 issue-refinement-loop を最初から行うのではなく、live Issue と current repository state を正本として impl-review-loop の Root-Owned Synchronous Entry Transition から開始してください。

    このセッションは既に Claude Code の auto mode で起動済みです。
    permission mode を変更したり、/permission を要求したり、通常の実装・テスト・branch publish・Draft PR作成・レビュー修正について途中で人間承認を求めたりしないでください。

    Operator authorization

    このメッセージを、Issue #2606 を impl-review-loop で実装し、レビュー・検証を反復してマージ直前の状態まで進めるための明示的な operator instruction として扱ってください。

    以下を事前に承認します。

    • Issue 実装: build_intake_capsule.py の human-context-comment-url 解決範囲を実装 PR コメントに拡張する #2606 の現在の Allowed Paths 内での実装
    • worktree / branch の作成
    • Allowed Paths 内のファイル編集
    • formatter / lint / pytest その他 Issue contract に定義された verification の実行
    • bounded な commit
    • canonical publish lane を用いた対象 branch の通常の push
    • open-pr による Draft PR 作成
    • open-pr の publish gate には、この指示を明示的 human/operator approval として使用し、publish: yes を渡すこと
    • PR body / Issue comment / PR comment のうち、impl-review-loop の正規フローで必要となる更新
    • reviewer の REQUEST_CHANGES に対する Allowed Paths 内での修正、再commit、再push
    • stale-head re-review、current-head verification、通常の update-branch 等、skill が機械的 recovery として定義している処理

    この承認は merge そのものを含みません。
    gh pr merge、auto-merge 有効化その他 PR を実際に merge する操作は行わないでください。

    最終目標は、impl-review-loop の canonical terminal condition である IMPL_REVIEW_LOOP_RESULT_V1.status: draft_pr_ready / termination_reason: approved に到達し、current head に対する検証・PR review・live mergeability を満たした状態で、PR を人間の最終 merge 判断だけが残る状態にすることです。

    Root control-plane

    .claude/skills/impl-review-loop/SKILL.md とその steps/、参照する canonical scripts / schemas を正本として実行してください。
    旧フローや独自の簡略版を手作業で再実装しないでください。

    root/main thread が control-plane として以下を保持してください。

    • live Issue / PR / repository state の取得
    • Root-Owned Synchronous Entry Transition
    • routing decision
    • LOOP_STATE
    • Allowed Paths enforcement
    • SubAgent dispatch と join
    • reviewer verdict と live mergeability の統合
    • iteration / fix_delta 管理
    • mutation authorization
    • terminal decision

    過去の LOOP_HANDOFF_RESULT_V1 は implementation readiness の参考 evidence ですが、それ自体を authorization token として扱わず、現行 skill が要求する live fetch / current-run contract review / routing を実行してください。

    実装方針

    Issue #2606 の現在の本文を authoritative contract としてください。

    特に設計を元の旧案へ戻さないでください。

    • --pr-number を追加しない
    • linked PR を列挙し全コメントを取得する discovery subsystem を追加しない
    • target Issue の既存 comments_by_id map に comment ID が存在する場合は既存経路を維持する
    • map miss の場合だけ repos/{repo}/issues/comments/{comment_id} 相当の read-only comment-ID direct lookup を行う
    • readback した html_url と入力URLを exact binding する
    • /issues/N#issuecomment-ID は N == target Issue を要求する
    • /pull/N#issuecomment-ID はその PR が target Issue を closingIssuesReferences で closing issue として参照していることを確認する
    • 同一repositoryに存在するだけの無関係なPR commentを受理しない
    • PR inline review comment / review thread / review body には対象を広げない
    • provenance は URL の置かれた場所ではなく、既存どおり --human-context-comment-url / --agent-report-comment-url の lane から決定する
    • agent-report schema validation の既存 semantics を弱めない
    • not-found / URL mismatch / linkage mismatch は既存の fail-closed semantics に合流させる

    変更は原則として Issue に記載された以下の Allowed Paths だけに限定してください。

    • .claude/skills/impl-review-loop/scripts/build_intake_capsule.py
    • .claude/skills/impl-review-loop/tests/test_intake_capsule_provenance_e2e.py
    • .claude/skills/impl-review-loop/tests/test_build_intake_capsule.py

    新しい schema、ledger、permission harness、CLI input、production subsystem を安易に追加しないでください。

    Pre-implementation check

    実装開始前に current main を fresh に確認してください。

    Issue #2606 の Notes に記録されている #1348 / #2602、および現在同じ production/test files を変更している open PR / branch があるかを read-only で確認してください。

    単なる潜在 collision や advisory overlap だけで人間へ戻さないでください。
    current main に既に同じ挙動が実装済みなら、無意味な差分を作らず actual repository state を根拠に判断してください。

    真正面からの actual conflict や、現行 contract の Allowed Paths では要求を実装不能であることが確定した場合だけ、canonical hard-stop routing に従ってください。

    SubAgent requirements

    必ず SubAgent を使用してください。

    impl-review-loop が定義する役割分離を維持し、

    • implementation → implementation-worker
    • verification → test-runner
    • PR review → pr-reviewer

    へ委譲してください。

    Issue #2606 は GitHub API / CLI の実際の field / response shape が重要なので、外部仕様の fresh 確認が必要なら root/main から web-researcher を使用してください。
    repository implementation の追加調査が必要なら root/main から codebase-investigator を使用して構いません。

    独立した調査は可能なら並列化して構いません。

    ただし最重要条件として、

    起動した SubAgent の作業完了を必ず待ってください。

    SubAgent を launch しただけで次工程へ進んではいけません。

    • 起動済み全 SubAgent が terminal result を返すまで待つ
    • 全結果を join する
    • structured result を root/main thread が consume する
    • その後にのみ次の implementation / verification / PR review / routing へ進む

    ことを徹底してください。

    SubAgent の完了前に root judgment、PR review、termination 判定を先行させないでください。

    root-owned decision authority を SubAgent に委譲しないでください。
    SubAgent に nested SubAgent delegation をさせないでください。

    Verification

    Issue #2606 の AC1-AC9 を current head に対して機械的に検証してください。

    少なくとも Issue contract の以下を実行してください。

    uv run pytest .claude/skills/impl-review-loop/tests/test_intake_capsule_provenance_e2e.py

    uv run pytest .claude/skills/impl-review-loop/tests/test_build_intake_capsule.py

    repository 標準の Ruff 等を Allowed Paths の変更なしで実行可能なら、関連変更範囲について実行してください。

    fixture/mock の false-green を避けるため AC9 の runtime canary を必ず扱ってください。

    既知実例:

    gh が利用可能・認証済み・GitHub API reachable な現在環境では、実際の read-only runtime canary を実行して結果を確認してください。
    SKIP の場合は PASS と偽装せず SKIP として記録してください。

    PR 本文の Runtime Verification Evidence には Issue contract が要求する実行証跡を残してください。

    Review loop

    implementation → verification → PR review → judgment を canonical impl-review-loop に従って反復してください。

    pr-reviewer が REQUEST_CHANGES を返した場合:

    1. blockers を具体的な fix_delta にする
    2. implementation-worker に委譲する
    3. worker の完了を待つ
    4. current head で verification を再実行する
    5. test-runner の完了を待つ
    6. current head で pr-reviewer を再実行する
    7. reviewer の完了を待つ
    8. live mergeability と合わせて root/main が再判定する

    という順序を守ってください。

    reviewed_head_sha が stale なら人間へ戻さず current head を再レビューしてください。
    BEHIND 等について canonical mechanical update route が存在するならそれを使用し、更新後の verification / review を完了させてください。

    Step 1-4 の SubAgent が単なる boolean field として human_review_required: true を返しても、それ自体を途中承認要求として扱わないでください。
    現行 impl-review-loop の #1860/#1869 policy に従い、停止権限のない advisory は warning として記録し、自動継続してください。

    一方、canonical route_loop_verdict_v2() が genuine route_human_escalation / actual Git conflict / secret gate 等の authoritative hard stop を返した場合は、ガードを無効化したり権限を捏造したりせず、その terminal result と evidence を報告してください。

    PR publication

    Issue の Delivery Rule に従い 1 Issue = 1 PR としてください。

    既存PRがある場合は重複作成せず canonical idempotency route で再利用してください。

    新規作成時は open-pr skill を使用してください。

    このメッセージを Issue #2606 の Draft PR publication に対する明示的 human/operator approval として扱い、

    publish: yes

    を指定してください。

    E_APPROVAL_MISSING を理由に再度人間へ publish 承認を求めないでください。

    PR 本文には最低限、

    を repository の canonical PR body generator / validator に従って含めてください。

    Autonomy / no-interruption policy

    通常の実装判断、テスト修正、reviewer blockerへの修正、branch publish、Draft PR作成、PR本文修正、再レビューについて質問・確認を挟まないでください。

    現在の auto mode のまま進め、permission mode を変更しないでください。
    追加の /permission や対話的 approval を要求しないでください。

    単なる advisory artifact の欠落、scope-rollup、snapshot telemetry、body SHA、launch ledger、semantic planning warning、overlap warning 等を理由に停止しないでください。
    live repository facts、Allowed Paths、実テスト、CI、PR review、live mergeability を優先してください。

    Hard boundaries

    今回の事前承認を以下には拡大解釈しないでください。

    これらが本当に不可避になった場合は canonical hard-stop result と具体的 evidence を出してください。

    Completion condition

    以下をすべて満たすまで終了しないでください。

    • Issue 実装: build_intake_capsule.py の human-context-comment-url 解決範囲を実装 PR コメントに拡張する #2606 の AC1-AC9 が current head で満たされている
    • Allowed Paths compliance が確認済み
    • required verification が current head で成功している、または contract が明示的に許容する SKIP が正確に記録されている
    • runtime canary evidence が contract に従って処理済み
    • Draft PR が作成または既存PRが正しく再利用されている
    • PR body が current implementation / test evidence と一致している
    • pr-reviewer の current-head verdict が APPROVE
    • blockers が空
    • stale-head review が残っていない
    • current skill が要求する live mergeability / CI evaluation が完了している
    • IMPL_REVIEW_LOOP_RESULT_V1.status: draft_pr_ready
    • termination_reason: approved

    ここまで到達したら停止し、merge は実行しないでください。

    最終報告では、最低限以下を簡潔に提示してください。

    • PR URL
    • branch / final head SHA
    • 最終 iteration
    • reviewer verdict
    • verification 結果
    • AC1-AC9 の結果
    • runtime canary の結果
    • live mergeability / merge_ready
    • unresolved blockers がないこと
    • IMPL_REVIEW_LOOP_RESULT_V1
    • 人間側に残された操作が「PRの最終確認とmerge」のみであること

    途中経過の承認を人間に要求せず、完了または genuine authoritative hard stop まで現在のターンで自律実行してください。

    この版では特に、open-pr の publish: yes を今回の指示で先行承認しているので、Draft PR 起票時の不要な approval stop を避けやすくしています。ループの終端 draft_pr_ready は「GitHubのDraftフラグ」そのものではなく、人間の最終merge判断を残す終端状態です。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

agent/implementerenhancementphase/implementationtriage-required

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions