Skip to content

実装: Claude-GPT issue-refinement preflight の stale credentialless transport 選択を #2299 の native GitHub auth 契約へ整合する #2872

Closed

Description

@squne121

Machine-Readable Contract

contract_schema_version: v1
issue_kind: implementation
parent_issue: "none"
goal_ref: "Claude-GPT isolated session の issue-refinement-loop preflight が、#2299 以降利用可能な native-equivalent GitHub auth を (a) transport selector の HOME 差分判定と (b) canonical executor の GH_CONFIG_DIR 除去の二箇所で無視し、anonymous credentialless transport の 60 req/hour rate limit で canonical workflow を停止する stale divergence を解消する"
change_kind: code
dedupe_key: "claude-gpt:issue-refinement-preflight:stale-credentialless-transport-selection:v1"

Parent Issue

none

Parent Goal Ref

  • Goal: Claude-GPT interactive session で repository-owned canonical issue-refinement workflow が、承認済みの native GitHub access を使って rate limit に依存せず Step 1 まで到達できる状態を保つ。
  • Desired Destination: 実装: Claude-GPT の GitHub access を compatibility-first に切り替え既存 workflow を安定化する #2299 の launcher contract(GitHub auth のみ native 同等に共有)と preflight の read-transport 選択・executor の環境受け渡しが矛盾しない状態(本 Issue は parent を持たず、この destination 全体を単独で完結させる)。

Current Validated Scope

Remaining Parent Gaps

なし

Background

2026-10-02 current main で Issue #2845 の repeated environment_failure / rate_limited / credentialless_transport / read_issue を調査し、launcher・executor・preflight の契約不整合を確認した。当初調査は main be5c8ad3cdc24306e2e2e61e0b4db888d63e39f5 基準で、本 refinement は current main 2edd52de22230650642c583a4074f06e14193fad 上で再検証済み(下記 Evidence の file:line は current HEAD 基準)。

  • scripts/claude-gpt/launch.sh は 実装: Claude-GPT の GitHub access を compatibility-first に切り替え既存 workflow を安定化する #2299 以降、Claude-GPT child に GitHub auth のみを native 同等に共有する。isolation 前の ambient GH_CONFIG_DIR を固定して child に export し、GH_TOKEN / GITHUB_TOKEN / GH_HOST / GH_REPO も scrub しない。host HOME 全体、SSH agent、GPG 等の無関係な secret は isolate のまま。
  • run_refinement_preflight.py::_is_isolated_claude_gpt_profile()(現 L3829)は HOME != passwd home だけを isolated signal とし、docstring は「launcher は host GitHub credential を child へ渡さない」という 実装: Claude-GPT isolated session の minimum control-plane capability を保証する(uv toolchain resolution + credentialless GitHub read) #2241 時代の前提を保持している。_select_read_transport()(現 L4014)はその差分だけで _CredentiallessPreflightTransport を無条件選択する。
  • executor 境界(anchor review P1-1): skill_runtime_exec.py::_sanitize_env()(現 L1184-1203)の gh_config_dir_carrier_command_ids は preflight.run / contract_update.run.with_* / repair_action.apply / structural_repair_action.apply / owner_reaction.decide のみで、preflight.run.with_anchor / with_human_context / with_agent_report を含まない。GH_TOKEN / GITHUB_TOKEN は通常 allowlist で通るため、token env だけで検証すると通り、通常の gh auth login(保存済み設定、GH_CONFIG_DIR 経由)では child に設定先が届かず再び止まる。.claude/skills/issue-refinement-loop/scripts/tests/test_skill_runtime_exec_env_allowlist.py(L57-63)はこの 3 ID を明示的に「GH_CONFIG_DIR 除去対象(_GH_CONFIG_DIR_NON_CARRIER_COMMAND_IDS)」として固定している。
  • single-authority(anchor review P1-3): run_preflight() は transport を一度選択して thread するが、_fetch_issue() / _fetch_issue_comments() / _fetch_single_comment() は transport=None のとき _select_read_transport() を再評価する(現 L4055 / L4072 / L4244)。呼び出し側にも transport を渡さない箇所が残る(例: 現 L1865 / L2721 / L7238 の _fetch_issue(repo, issue_number)、L2445 / L7242 の _fetch_single_comment(...))。固定的な HOME 判定を可変な認証状態判定へ置き換えると、取得途中の authenticated/anonymous split を生み得る。_reset_read_transport_cache() は no-op。
  • テスト・docs の stale: .claude/skills/issue-refinement-loop/tests/test_run_refinement_preflight_credentialless_transport.py(実在パス。Issue 初版が記載した scripts/agent-guards/tests/ 配下には存在しない)は isolated profile で gh を呼んではならないという旧前提を固定。scripts/agent-guards/tests/test_isolated_anchor_single_authority.py は empty GH_CONFIG_DIR fixture を保持。docs/dev/workflow.md(L440 付近)は「isolated session は credentialless transport のみで解決し gh へフォールバックしない」と記述。
  • scripts/agent-guards/github_credentialless_read.py 自身が anonymous REST の 60 req/hour per source IP を意図的に受け入れ、「通常 workload に不足すると実証された時点で follow-up Issue で authenticated path を設計する」と明記している。調査: credentialless GitHub read の live AC を shared-runner API rate limit から分離して deterministic にする #2313 / 実装: credentialless GitHub read live test の github_live marker適合と例外処理是正 #2361 は shared runner で枯渇を実証し live test を required CI から分離済み。

Related: #2241(credentialless read 原契約)/ #2257・PR #2260(single read authority)/ #2299・PR #2303(native auth 共有)/ #2403(bare preflight.run の GH_CONFIG_DIR 伝播)/ #2313・#2361(60 req/hour と live test 分離)/ #2845(実害の観測元)/ #2843(Auto mode hard deny、本 Issue と分離)。

Outcome

current Claude-GPT launcher が提供する GitHub auth capability と、issue-refinement-loop の production preflight(canonical executor の環境受け渡し + read-transport selection)が一致し、isolated HOME であることだけを理由に anonymous credentialless transport を強制しない。token env 経由と通常の gh auth login(保存済み GH_CONFIG_DIR)経由の双方で、preflight.run.with_human_context が Issue / comments / anchor を認証済み native gh で一貫して読み、#2845 のような canonical preflight が anonymous 60 req/hour budget で停止しない。

Runtime Verification Applicability

decision: immediate
reason: >-
  `.claude/skills/**/scripts/**` の実行ロジック(production preflight の transport selection と executor の環境受け渡し)を変更するため、
  unit test だけでは「実 Claude-GPT session の child process に保存済み GitHub 認証が届き、実 GitHub readback と anchor 解決が成立する」ことを証明できない。
applicable_acs: [AC9]
execution_environment: >-
  候補 revision(PR HEAD)の linked worktree から、repository-owned Claude-GPT launcher/profile の fresh session(既存の `worktree-agent-runtime-smoke` の claude-gpt adapter 経路)、または同等の isolated HOME 条件で実行する。`gh` 認証が有効(token env 経由または通常の gh auth login による保存済み設定経由)。canonical main root 限定の production 制約は AC9 のために弱めない。main の旧コードの実行結果を候補の証拠にしない。
  実 GitHub への read のみ。mutation は行わない。
skip_conditions: >-
  GitHub API / Claude-GPT runtime / `gh` 認証が利用不能。SKIP(exit 77)/ UNAVAILABLE は PASS に昇格しない。external GitHub outage を成功証拠にしない。
fallback_policy: >-
  anonymous credentialless transport、別 profile、host HOME 全体共有、手動 approval の言い直しを成功証拠に使わない。
artifact_requirements: >-
  実行した code の commit SHA(期待 PR HEAD との一致と worktree clean の確認を含む)、実行 runtime / profile の区別、isolated 条件、`gh` のバージョン、認証形態の category(`token_env` / `stored_config_dir` のいずれか。値・credential file 内容は記録しない)、
  Issue / comments / anchor の取得結果、downstream Step 1 到達可否を、sanitized な `runtime-verification-AC9-<UTC>.log` として保存する。
  raw transcript・credential・HOME absolute path は残さない。

AC9 の live 検証は、default の python-test から deselect される opt-in marker(github_live)付き pytest として表現し、shared runner の network/quota に依存する新しい required CI gate にはしない(#2361 の分離方針を維持)。#2845 の contract refinement 完了は AC9 の完了条件に含めない。

In Scope

  • .claude/skills/issue-refinement-loop/scripts/run_refinement_preflight.py
    • HOME != passwd home を「GitHub auth 不在」の代理指標として扱わない。通常の production 経路は native gh を使い、認証解決(env token / 保存済み config / keyring)は gh に委ねる。
    • 1 回の production preflight invocation で選択した read transport を、Issue・comments・anchor、およびその invocation 内の再取得・既存の _fetch_* default fetcher を含む全 call site へ一貫して渡す。認証エラー・rate limit・接続失敗を理由に取得途中で anonymous transport へ切り替えない。
    • 認証の有無を判定する新機構は作らない(GH_TOKEN の有無・hosts.yml の oauth_token・GH_CONFIG_DIR の存在・gh auth status の終了コードを必須ゲートにする独自判定は採用しない。native gh は env・設定ファイル・keyring を総合して token を解決するため、これらは false failure を生む)。
    • 真正な authless の isolated ケースは、現行 contract が許す範囲(credentialless GET-only path の維持、または構造化 environment_failure)で扱う。
  • scripts/agent-guards/skill_runtime_exec.py
    • _sanitize_env() の gh_config_dir_carrier_command_ids に、実際に GitHub CLI を使う production preflight の preflight.run.with_anchor / preflight.run.with_human_context / preflight.run.with_agent_report を追加する。GH_CONFIG_DIR が未設定・空の場合は値を推定せず、設定内容を読まず、prefix や全 mutation command・全 human-context profile へ広げない。fixture lane(preflight.run.fixture.*)は carrier に含めない。
    • 相対 GH_CONFIG_DIR の絶対化は既存の dedicated-worktree dispatch(_normalize_and_validate_runtime_env() 周辺)を再利用し、別の設定探索・コピー機構を追加しない。
  • .claude/skills/issue-refinement-loop/scripts/tests/test_skill_runtime_exec_env_allowlist.py: 上記 3 ID を carrier 側へ移す旧期待値更新と、fixture lane が non-carrier のままであることの固定。
  • .claude/skills/issue-refinement-loop/tests/test_run_refinement_preflight_credentialless_transport.py、scripts/agent-guards/tests/test_isolated_anchor_single_authority.py および関連 focused tests: pre-実装: Claude-GPT の GitHub access を compatibility-first に切り替え既存 workflow を安定化する #2299 の empty-GH-config fixture と current launcher の native-equivalent auth fixture を区別し、HOME isolation・GitHub auth availability・transport selection を独立軸にする。必要な場合に限り .claude/skills/issue-refinement-loop/tests/test_refinement_preflight.py / scripts/agent-guards/tests/test_credentialless_github_read.py の旧前提を最小更新する。実在しない旧パスに同名テストを新設しない。
  • scripts/agent-guards/tests/test_skill_runtime_exec_anchor.py: test_contract_update_phase_reaches_fake_transaction_and_fresh_handoff が固定している pre-実装: Claude-GPT の GitHub access を compatibility-first に切り替え既存 workflow を安定化する #2299 の stale 期待(isolated HOME の preflight は credentialless で読むため fake gh には controlled mutation の 5 操作しか届かない、および config_states の期待)を、native-gh preflight 契約へ最小更新する。production mutation の assertion(controlled mutation 操作列・readback 等)は弱めない。
  • scripts/agent-guards/tests/test_isolated_anchor_single_authority.py: 削除せず、旧前提・signature drift を修復して残す(regression coverage を保つ)。AC9 の live test は代替ではなく追加の検証とする。
  • scripts/agent-guards/github_credentialless_read.py: transport 本体の GET-only / repository-bound / closed-enum contract は維持し、stale comment/doc の修正が必要な場合のみ更新する。
  • docs/dev/workflow.md: transport 選択に関する stale 説明(isolated なら credentialless のみで gh へフォールバックしない、等)を 実装: Claude-GPT の GitHub access を compatibility-first に切り替え既存 workflow を安定化する #2299 contract に更新する。
  • scripts/claude-gpt/launch.sh / lib.sh と 実装: Claude-GPT の GitHub access を compatibility-first に切り替え既存 workflow を安定化する #2299 は read-only authority として参照する(変更しない)。scripts/claude-gpt/tests/ は launcher contract の regression 確認(VC)のみで変更しない。旧前提を固定した case が見つかった場合は Stop Condition として別 Issue に分離する。

Out of Scope

Acceptance Criteria

Verification Commands

実装時に current test inventory を fresh に確認して exact nodeid を固定すること。標準品質ゲート(プロジェクト憲法「必須検証」の pnpm typecheck / pnpm lint / pnpm test / pnpm build、uv run pytest .claude/skills/gemini-cli-headless-delegation/tests/test_model_routing.py)は PR 前に別途実行する。AC9 の live 検証は opt-in marker 付きの単独選択であり、required CI gate ではない(exit 77 は SKIP|UNAVAILABLE として保持し、pytest.skip による PASS 化はしない)。

# AC1
# baseline-expect: fail
$ uv run --locked pytest .claude/skills/issue-refinement-loop/tests/test_run_refinement_preflight_credentialless_transport.py::test_isolated_with_token_env_selects_native_gh_transport -q

# AC2
# baseline-expect: fail
$ uv run --locked pytest .claude/skills/issue-refinement-loop/scripts/tests/test_skill_runtime_exec_env_allowlist.py::test_production_preflight_profiles_carry_gh_config_dir .claude/skills/issue-refinement-loop/scripts/tests/test_skill_runtime_exec_env_allowlist.py::test_preflight_fixture_profile_does_not_carry_gh_config_dir -q

# AC3
# baseline-expect: fail
$ uv run --locked pytest .claude/skills/issue-refinement-loop/tests/test_run_refinement_preflight_credentialless_transport.py::test_single_transport_threaded_through_all_read_call_sites -q

# AC4
# baseline-expect: fail
$ uv run --locked pytest .claude/skills/issue-refinement-loop/tests/test_run_refinement_preflight_credentialless_transport.py::test_isolated_authless_keeps_contract_without_secret_probing -q

# AC5
# baseline-expect: fail
$ uv run --locked pytest .claude/skills/issue-refinement-loop/tests/test_run_refinement_preflight_credentialless_transport.py::test_isolated_with_stored_gh_config_dir_selects_native_gh_transport .claude/skills/issue-refinement-loop/tests/test_run_refinement_preflight_credentialless_transport.py::test_normal_profile_selects_native_gh_transport .claude/skills/issue-refinement-loop/tests/test_run_refinement_preflight_credentialless_transport.py::test_mid_read_failure_does_not_switch_transport .claude/skills/issue-refinement-loop/tests/test_run_refinement_preflight_credentialless_transport.py::test_multipage_comments_anchor_resolution_single_transport -q

# AC10
# baseline-expect: pass
$ uv run --locked pytest scripts/agent-guards/tests/test_skill_runtime_exec_anchor.py::test_contract_update_phase_reaches_fake_transaction_and_fresh_handoff -q

# AC6
# baseline-expect: pass
$ uv run --locked pytest scripts/agent-guards/tests/test_credentialless_github_read.py scripts/agent-guards/tests/test_isolated_anchor_single_authority.py -q

# AC7
# baseline-expect: fail
$ ! rg -n -e "never forwards the host's real" -e "credentialless transport のみで解決し" .claude/skills/issue-refinement-loop/scripts/run_refinement_preflight.py docs/dev/workflow.md

# AC8
# baseline-expect: pass
$ uv run --locked pytest scripts/claude-gpt/tests/ -q

# AC11
# baseline-expect: fail
$ uv run --locked pytest .claude/skills/issue-refinement-loop/tests/test_run_refinement_preflight_credentialless_transport.py::test_ac9_predicate_classification -q

# AC9
# baseline-expect: fail
$ uv run --locked pytest -o addopts= --import-mode=importlib -m github_live .claude/skills/issue-refinement-loop/tests/test_run_refinement_preflight_credentialless_transport.py::test_ac9_isolated_preflight_reaches_step1_with_native_gh_auth_runtime -q

Allowed Paths

  • .claude/skills/issue-refinement-loop/scripts/run_refinement_preflight.py
  • scripts/agent-guards/skill_runtime_exec.py
  • scripts/agent-guards/github_credentialless_read.py
  • .claude/skills/issue-refinement-loop/scripts/tests/test_skill_runtime_exec_env_allowlist.py
  • .claude/skills/issue-refinement-loop/tests/test_run_refinement_preflight_credentialless_transport.py
  • .claude/skills/issue-refinement-loop/tests/test_refinement_preflight.py
  • scripts/agent-guards/tests/test_isolated_anchor_single_authority.py
  • scripts/agent-guards/tests/test_credentialless_github_read.py
  • scripts/agent-guards/tests/test_skill_runtime_exec_anchor.py
  • docs/dev/workflow.md

Stop Conditions

Required Skills

なし

Required Design References

Scope Delta(任意)

anchor https://github.com/squne121/loop-protocol/issues/2872#issuecomment-5950471698(operator-selected human context、REQUEST_CHANGES)に基づく Allowed Paths / In Scope の拡張。current main 2edd52de22230650642c583a4074f06e14193fad 上で再検証済み。

追加・訂正 理由
scripts/agent-guards/skill_runtime_exec.py _sanitize_env() が production preflight の with_* 3 ID で GH_CONFIG_DIR を除去し、保存済み認証が child に届かない(selector 修正だけでは AC1 と deferred 実機確認を満たせない)
.claude/skills/issue-refinement-loop/scripts/tests/test_skill_runtime_exec_env_allowlist.py 上記 3 ID を non-carrier に固定している旧期待値の更新
.claude/skills/issue-refinement-loop/tests/test_run_refinement_preflight_credentialless_transport.py(訂正) 初版記載の scripts/agent-guards/tests/test_run_refinement_preflight_credentialless_transport.py は実在しない。実在パスへ訂正
.claude/skills/issue-refinement-loop/tests/test_refinement_preflight.py / scripts/agent-guards/tests/test_credentialless_github_read.py selector / transport 名を参照する既存 test の旧前提を最小更新(必要な場合のみ)
docs/dev/workflow.md isolated なら credentialless のみとする stale 説明の更新(AC7)

Scope Delta 2(operator 承認、2026-10-02)

anchor https://github.com/squne121/loop-protocol/issues/2872#issuecomment-5951821709(trusted OWNER、ANCHOR_SCOPE_REFRAME_V1、承認元 https://github.com/squne121/loop-protocol/issues/2872#issuecomment-5951803901)に基づく Allowed Paths / In Scope / VC の拡張。current main 3f7b0addbe09b21c03872755b1fd3092cd807044 上。前回 impl-review-loop Step 1 が scripts/agent-guards/tests/test_skill_runtime_exec_anchor.py の stale 期待により blocked で停止した事実に基づく。

追加 理由
scripts/agent-guards/tests/test_skill_runtime_exec_anchor.py test_contract_update_phase_reaches_fake_transaction_and_fresh_handoff が pre-#2299 の credentialless 前提(fake gh に 5 操作のみ)を固定しており、native-gh preflight 実装後に fail する。直接 regression surface のため #2872 内で最小更新する
test_isolated_anchor_single_authority.py の扱い 既存 Allowed Path。live command-graph test は削除でなく修復して残す

追加 VC は AC10 の 1 行で固定する。AC3 の既存文言は変更しない。

Scope Delta 3(operator 承認、2026-10-03)

anchor https://github.com/squne121/loop-protocol/pull/2876#issuecomment-5961180009(trusted OWNER、PR #2876 の REQUEST_CHANGES / adversarial review)と、https://github.com/squne121/loop-protocol/pull/2876#issuecomment-5961210003(trusted OWNER、workflow 指示)に基づく、AC9 検証欠陥の最小修正。Allowed Paths は変更しない。

変更 理由
AC9 の success predicate を肯定的 evidence(Issue #2845、anchor 5942301496 の解決、STATUS 非空、候補 revision 束縛)へ明確化 旧 test は anchor 取得失敗・read_issue_comment の environment_failure・空 STATUS: を PASS にしていた(P1)
native gh の failure 分類(gh_timeout / gh_auth_required / gh_exit_error)と UNAVAILABLE 判定の整合 transport を native に変えたが UNAVAILABLE 判定は credentialless 側の理由集合のままだった(P2)。blanket SKIP と認証 propagation regression の隠蔽は禁止
候補 revision / runtime / sanitized evidence の束縛、証跡書き込み失敗の握り潰し禁止 旧 test は main 限定で PR 候補を検証できず、except OSError: pass で証跡欠落でも PASS になりえた(P2)
AC11 と対応する VC 1 行(test_ac9_predicate_classification) 上記の反例を network 非依存の通常 regression として固定する

維持するもの: process-wide 定数の native gh selector、GH_CONFIG_DIR の 3 production command ID carrier、fixture lane の non-carrier、transport=None の残存、復元済みの hermetic command-graph test、credentialless transport 本体の GET-only contract、#2299 launcher contract。AC3 の既存文言は変更しない。新しい broker / 恒常 approval layer / generic wrapper / secret 探索 / required live-CI gate は追加しない。

Activity

  1. squne121 commented on Oct 2, 2026

    @squne121
    OwnerAuthor

    結論

    判定は REQUEST_CHANGES です。ただし、修正の方向性は正しく、認証基盤の再設計ではなく、既存経路の不整合を小さく直すべき Issue です。

    最も重要な見落としは、transport の選択だけを直しても、指定された canonical executor が保存済み GitHub 認証の設定を子プロセスへ渡さないケースが残ることです。GH_TOKEN を設定した環境だけで検証すると通り、通常の gh auth login による保存済み認証では再び止まる、という修正になり得ます。

    調査基準は、取得時点の main be5c8ad3cdc24306e2e2e61e0b4db888d63e39f5 です。#2872 本文・コメント欄、#2299 と関連 PR #2303、single-authority を導入した PR #2260、#2361、#2845 の対象レビューと停止報告、現行 launcher・executor・preflight・関連テストを確認しました。外部資料は GitHub CLI の公式ドキュメントと実装を照合しています。以下はコードと記録に基づくレビューで、実際の Claude-GPT セッションやリポジトリのテスト一式を実行した結果ではありません。

    重要な指摘

    1. P1:指定した実行経路が GH_CONFIG_DIR を落とすため、selector の修正だけでは AC1・AC5 を満たせない

    #2872 の runtime verification は、次の command ID を指定しています。

    preflight.run.with_human_context

    ところが、現行の scripts/agent-guards/skill_runtime_exec.py::_sanitize_env() が GH_CONFIG_DIR を保持する command ID には、preflight.run はありますが、次の三つはありません。

    preflight.run.with_anchor
    preflight.run.with_human_context
    preflight.run.with_agent_report

    一方、GH_TOKEN と GITHUB_TOKEN は通常の allowlist に含まれています。さらに、実際の dispatch も _sanitize_env(project_root, args.command_id) の結果から子プロセス環境を作っています。これは未使用の helper の問題ではなく、production の受け渡し経路の問題です。

    反例となる環境は、特殊なものではありません。

    親セッション:
      HOME は isolated
      GH_CONFIG_DIR は launcher が引き継いだ保存済み認証の設定先
      GH_TOKEN / GITHUB_TOKEN は未設定
    

    canonical executor:
    --command-id preflight.run.with_human_context
    ↓
    GH_CONFIG_DIR が除去される
    ↓
    子 preflight:
    isolated HOME / XDG は残る
    保存済み認証の設定先は届かない

    GitHub CLI は GH_CONFIG_DIR が指定されなければ XDG/HOME 側の設定場所を使います。したがって、親で認証できることと、この子プロセスで認証できることは同じではありません。GitHub CLI

    しかも、既存の次のテストは、上記三つを明示的に 「GH_CONFIG_DIR を除去すべき command ID」 に分類しています。

    .claude/skills/issue-refinement-loop/scripts/tests/
    test_skill_runtime_exec_env_allowlist.py

    つまり、古い前提を固定しているテストが、Issue に挙がっている二つの transport テスト以外にもあります。

    修正案

    skill_runtime_exec.py と当該 allowlist テストを In Scope/Allowed Paths に追加してください。実際に GitHub CLI を使う production preflight の command ID に限定して、既存の GH_CONFIG_DIR の受け渡しを揃えるのが最小です。

    これは launcher の認証契約変更でも、HOME 全体の共有でもありません。既に共有されている GitHub 設定を、必要な子プロセスまで途切れずに届ける修正です。既存の dedicated-worktree dispatch には相対 GH_CONFIG_DIR を invocation 側で絶対化する処理もあるので、別の設定探索やコピー機構を追加する必要はありません。


    2. P1:Verification Commands と Allowed Paths が実際の修正対象と一致していない

    Issue が指定する次のパスは、テストの実体と一致しません。

    scripts/agent-guards/tests/
    test_run_refinement_preflight_credentialless_transport.py

    実体はこちらです。

    .claude/skills/issue-refinement-loop/tests/
    test_run_refinement_preflight_credentialless_transport.py

    この実ファイルには、isolated profile では gh を呼んではならない、という旧前提のテストが存在します。したがって、コマンドの誤記だけを直すのでは不十分で、Allowed Paths も同時に修正する必要があります。

    また、AC7 は関連 test/doc の stale claim 更新を要求していますが、Allowed Paths にドキュメントがありません。docs/dev/workflow.md には、isolated なら credentialless を選ぶという説明が残っています。

    このままだと、実装エージェントは正しい修正対象を発見した時点でスコープ外になり、不要な再精緻化や承認待ちを起こします。

    少なくとも、次を契約へ反映すべきです。

    対象 必要な修正
    test_run_refinement_preflight_credentialless_transport.py Verification Commands と Allowed Paths を実在パスへ訂正する
    scripts/agent-guards/skill_runtime_exec.py 認証設定の受け渡し修正に限って追加する
    …/scripts/tests/test_skill_runtime_exec_env_allowlist.py production preflight の旧期待値修正に限って追加する
    docs/dev/workflow.md transport 選択に関する該当説明の更新に限って追加する

    後者が今回、特に重要です。既存 _sanitize_env() は token env と GH_CONFIG_DIR を別扱いしているためです。

    これに、normal profile、真正 authless、途中の read failure、comments の複数ページと anchor 解決を加えれば、主要な退行を検出できます。大量の組合せテストを新設するより、実際の受け渡し境界と、今回変える分岐に集中する方が有効です。

    #2845 の実機確認は残す。ただし通信復旧と Issue 審査を混ぜない

    #2845 の最新の停止報告では、Issue read の時点で止まり、downstream investigation、rewrite、review は開始されていません。今回の修正で確認すべきなのは、まずこの入口が復旧することです。

    実機証拠には、実行したコードの commit、gh のバージョン、認証の形態が token env か保存済み設定か、対象 Issue/anchor の取得結果、Step 1 へ進める状態になったかを残すのがよいです。token 値や credential file の内容は不要です。

    AC5 の Step 1 到達要求は維持してよい一方、#2845 の本文修正や最終承認まで #2872 の完了条件へ広げるべきではありません。 通信が復旧した後に別の契約上の問題で止まった場合は、transport 修正の検証結果と、その後続 blocker を分けて報告する形にしてください。

    また、Issue の Verification Commands の Expected は、「特定の rate-limit エラーにならない」という否定条件だけでなく、AC5 と揃えて 実 readback と anchor 解決の成功を明示した方がよいです。

    live GitHub を新しい恒常的 CI ゲートにしない

    #2361 は、credentialless の live positive control を opt-in に分離し、required pytest を共有 runner の quota やネットワーク状態から独立させる方針を既に定めています。今回もこの分離を維持すべきです。

    匿名 REST の制限が送信元 IP ごとの毎時60リクエストであることは、GitHub の公式仕様とも一致します。認証済み経路の復旧を、再び匿名 live test の都合で止めるのは本末転倒です。GitHub Docs

    通常の回帰テストはネットワークに依存しない形で実施し、fresh interactive の確認は別枠の実機証拠にする。外部障害は成功へ昇格させず、同時に、全開発を止める新しい恒常的ゲートにも変えない、という分離が適切です。

    推奨する修正範囲

    selector の修正 + executor の認証設定受け渡し + 既存テスト/説明の更新 に限定することを勧めます。

    #2299 を実装した PR #2303 は既にマージされ、GitHub auth のみを native 同等に共有する方針へ変更されています。この方針を今回もう一度設計し直す必要はありません。

    Issue の契約修正として優先すべきなのは、次の四点です。

    1. skill_runtime_exec.py と実在する env allowlist テストをスコープに追加する。
    2. 誤ったテストパスを直し、必要なドキュメント更新を許可する。
    3. single-authority を実呼び出し経路で保証し、途中の匿名経路への切替を禁止する。
    4. token env と保存済み認証を別々の positive case として検証する。

    新しい authenticated broker、credential のコピー、HOME 全体の共有、追加の人間承認レイヤーは、この調査で確認した問題を解決するためには必要ありません。

    この Issue の価値は「隔離をさらに厳しくすること」ではなく、「既に承認済みの native GitHub access を、既存の workflow が正しく使える状態へ戻すこと」です。 現状のまま着手すると、その修正に必要なファイルがスコープ外になり、また workflow が止まります。そこを先に小さく是正するのが、品質と個人開発の実用性を両立する進め方です。

    ## 結論

    判定は REQUEST_CHANGES です。ただし、修正の方向性は正しく、認証基盤の再設計ではなく、既存経路の不整合を小さく直すべき Issue です。

    最も重要な見落としは、transport の選択だけを直しても、指定された canonical executor が保存済み GitHub 認証の設定を子プロセスへ渡さないケースが残ることです。GH_TOKEN を設定した環境だけで検証すると通り、通常の gh auth login による保存済み認証では再び止まる、という修正になり得ます。

    調査基準は、取得時点の main be5c8ad3cdc24306e2e2e61e0b4db888d63e39f5 です。#2872 本文・コメント欄、#2299 と関連 PR #2303、single-authority を導入した PR #2260、#2361、#2845 の対象レビューと停止報告、現行 launcher・executor・preflight・関連テストを確認しました。外部資料は GitHub CLI の公式ドキュメントと実装を照合しています。以下はコードと記録に基づくレビューで、実際の Claude-GPT セッションやリポジトリのテスト一式を実行した結果ではありません。

    重要な指摘

    1. P1:指定した実行経路が GH_CONFIG_DIR を落とすため、selector の修正だけでは AC1・AC5 を満たせない

    #2872 の runtime verification は、次の command ID を指定しています。

    preflight.run.with_human_context
    

    ところが、現行の scripts/agent-guards/skill_runtime_exec.py::_sanitize_env() が GH_CONFIG_DIR を保持する command ID には、preflight.run はありますが、次の三つはありません。

    preflight.run.with_anchor
    preflight.run.with_human_context
    preflight.run.with_agent_report
    

    一方、GH_TOKEN と GITHUB_TOKEN は通常の allowlist に含まれています。さらに、実際の dispatch も _sanitize_env(project_root, args.command_id) の結果から子プロセス環境を作っています。これは未使用の helper の問題ではなく、production の受け渡し経路の問題です。

    反例となる環境は、特殊なものではありません。

    親セッション:
      HOME は isolated
      GH_CONFIG_DIR は launcher が引き継いだ保存済み認証の設定先
      GH_TOKEN / GITHUB_TOKEN は未設定
    
    canonical executor:
      --command-id preflight.run.with_human_context
          ↓
      GH_CONFIG_DIR が除去される
          ↓
    子 preflight:
      isolated HOME / XDG は残る
      保存済み認証の設定先は届かない
    

    GitHub CLI は GH_CONFIG_DIR が指定されなければ XDG/HOME 側の設定場所を使います。したがって、親で認証できることと、この子プロセスで認証できることは同じではありません。GitHub CLI

    しかも、既存の次のテストは、上記三つを明示的に 「GH_CONFIG_DIR を除去すべき command ID」 に分類しています。

    .claude/skills/issue-refinement-loop/scripts/tests/
      test_skill_runtime_exec_env_allowlist.py
    

    つまり、古い前提を固定しているテストが、Issue に挙がっている二つの transport テスト以外にもあります。

    修正案

    skill_runtime_exec.py と当該 allowlist テストを In Scope/Allowed Paths に追加してください。実際に GitHub CLI を使う production preflight の command ID に限定して、既存の GH_CONFIG_DIR の受け渡しを揃えるのが最小です。

    これは launcher の認証契約変更でも、HOME 全体の共有でもありません。既に共有されている GitHub 設定を、必要な子プロセスまで途切れずに届ける修正です。既存の dedicated-worktree dispatch には相対 GH_CONFIG_DIR を invocation 側で絶対化する処理もあるので、別の設定探索やコピー機構を追加する必要はありません。


    2. P1:Verification Commands と Allowed Paths が実際の修正対象と一致していない

    Issue が指定する次のパスは、テストの実体と一致しません。

    scripts/agent-guards/tests/
      test_run_refinement_preflight_credentialless_transport.py
    

    実体はこちらです。

    .claude/skills/issue-refinement-loop/tests/
      test_run_refinement_preflight_credentialless_transport.py
    

    この実ファイルには、isolated profile では gh を呼んではならない、という旧前提のテストが存在します。したがって、コマンドの誤記だけを直すのでは不十分で、Allowed Paths も同時に修正する必要があります。

    また、AC7 は関連 test/doc の stale claim 更新を要求していますが、Allowed Paths にドキュメントがありません。docs/dev/workflow.md には、isolated なら credentialless を選ぶという説明が残っています。

    このままだと、実装エージェントは正しい修正対象を発見した時点でスコープ外になり、不要な再精緻化や承認待ちを起こします。

    少なくとも、次を契約へ反映すべきです。

    対象 必要な修正
    test_run_refinement_preflight_credentialless_transport.py Verification Commands と Allowed Paths を実在パスへ訂正する
    scripts/agent-guards/skill_runtime_exec.py 認証設定の受け渡し修正に限って追加する
    …/scripts/tests/test_skill_runtime_exec_env_allowlist.py production preflight の旧期待値修正に限って追加する
    docs/dev/workflow.md transport 選択に関する該当説明の更新に限って追加する

    存在しない旧パスに同名テストを新設して帳尻を合わせるのは避けてください。 既存の本物の回帰テストを直す方が、保守負担も小さくなります。


    3. P1:single-authority は「選択関数を変えれば維持される」とは限らない

    現行コードには、run_preflight() で transport を選択した後、Issue 取得で次のように transport を渡さず _fetch_issue() を呼ぶ経路があります。EvidenceIndex 経由の取得にも同じ形があります。

    transport = _select_read_transport()
    
    # 後続の Issue 取得
    _fetch_issue(repo, issue_number)

    そして _fetch_issue() は、transport が渡されていなければ _select_read_transport() を再実行します。_reset_read_transport_cache() も実キャッシュを制御するものではなく、互換性のために残った no-op です。

    PR #2260 の説明も、この再選択を「同一プロセス内では HOME 判定が決定的なので authority は変わらない」という前提で正当化しています。同じ transport オブジェクトを全経路へ渡すことと、同じ結果になるはずの判定を繰り返すことは、別です。

    ここへ、例えば「gh auth status がその時点で成功するか」という可変の判定を入れると、次の問題が生じ得ます。

    最初の選択:認証確認成功 → gh
    Issue 取得時の再選択:一時的な確認失敗 → credentialless
    anchor 検証:最初に選んだ gh
    

    現行コードで既にこの混線が発生したと断定しているわけではありません。 今回、固定的な HOME 判定を認証状態の判定に置き換える際に、既存の前提が崩れるという指摘です。

    修正案

    AC2 を、次の程度まで具体化するとよいです。

    production preflight の一回の invocation で選択した read transport を、Issue、comments、anchor、およびその invocation 内の再取得へ一貫して使用する。認証エラー・rate limit・接続失敗によって、取得途中に anonymous transport へ切り替えない。

    既存の transport 引数を使い、実際の呼び出し箇所で渡す方針が自然です。プロセス全体の永続キャッシュや、新しい authority 管理基盤を作る必要はありません。

    テストも「selector が gh を返した」だけではなく、実際の Issue/comments/anchor 取得が同じ選択結果を使うことを確認すべきです。


    4. P2:「認証利用可能」の判定を自作すると、別の false failure を作りやすい

    #2872 は判定方法を実装時調査に委ねています。それ自体は不合理ではありませんが、避けるべき近道を先に明記した方が、今回の目的に合います。

    まず、次の判定は native GitHub CLI と同等ではありません。

    GH_TOKEN がない → 認証なし
    hosts.yml に oauth_token がない → 認証なし
    GH_CONFIG_DIR が存在する → 認証有効
    

    GitHub CLI の実装は、環境変数・設定ファイルに加えて keyring も使って active token を解決します。gh auth login も、通常はシステムの credential store への保存を試みます。環境変数や平文ファイルだけを調べる独自判定では、正規の認証形態を取りこぼします。GitHub

    また、gh auth status の終了コードをそのまま必須ゲートにする案にも注意が必要です。

    判定方法 問題
    引数なしの gh auth status が非ゼロなら停止 対象と無関係な host/account の認証問題でも非ゼロになり得る
    gh auth status --json hosts がゼロなら認証成功 JSON モードは認証問題があっても、致命的エラー以外はゼロで終了する

    これは公式マニュアルだけでなく、pkg/cmd/auth/status/status.go の実装でも確認できます。[GitHub CLI](https://cli.github.com/manual/gh_auth_status)

    さらに、SOURCE: gh_cli は利用した adapter の識別であって、それだけで HTTP リクエストが認証された証明にはなりません。 GitHub CLI の HTTP 実装も、token を解決できた場合に Authorization header を付与する構造です。したがって、「credentialless という文字列が消えた」だけを成功証拠にしてはいけません。[GitHub](https://raw.githubusercontent.com/cli/cli/trunk/api/http_client.go)

    推奨する最小方針

    通常の production 経路は既存 native gh を使用し、認証解決は gh に委ねる。本来必要な Issue/comments/anchor の read を実行し、その結果を既存の構造化エラーへ反映する、という形です。

    真正な authless ケースは、明示されたテスト用 transport で credentialless の動作を残すか、AC3 が既に許容する structured environment failure として扱えば足ります。今回のために「認証の有無を完全に判定する機構」を新設する必要はありません。

    検証契約は、次のように絞ると強くなる

    認証済みの positive case を二つに分ける

    AC4 の isolated + authenticated 一ケースだけでは、指摘1の不具合を隠せます。最低限、次の二つを別々にしてください。

    ケース 重要な確認
    isolated HOME + GH_TOKEN または GITHUB_TOKEN canonical 子プロセスが native read を使う
    isolated HOME +保存済み認証用 GH_CONFIG_DIR、token env は未設定 設定先が canonical 子プロセスまで届き、同じ native read を使う

    後者が今回、特に重要です。既存 _sanitize_env() は token env と GH_CONFIG_DIR を別扱いしているためです。

    これに、normal profile、真正 authless、途中の read failure、comments の複数ページと anchor 解決を加えれば、主要な退行を検出できます。大量の組合せテストを新設するより、実際の受け渡し境界と、今回変える分岐に集中する方が有効です。

    #2845 の実機確認は残す。ただし通信復旧と Issue 審査を混ぜない

    #2845 の最新の停止報告では、Issue read の時点で止まり、downstream investigation、rewrite、review は開始されていません。今回の修正で確認すべきなのは、まずこの入口が復旧することです。

    実機証拠には、実行したコードの commit、gh のバージョン、認証の形態が token env か保存済み設定か、対象 Issue/anchor の取得結果、Step 1 へ進める状態になったかを残すのがよいです。token 値や credential file の内容は不要です。

    AC5 の Step 1 到達要求は維持してよい一方、#2845 の本文修正や最終承認まで #2872 の完了条件へ広げるべきではありません。 通信が復旧した後に別の契約上の問題で止まった場合は、transport 修正の検証結果と、その後続 blocker を分けて報告する形にしてください。

    また、Issue の Verification Commands の Expected は、「特定の rate-limit エラーにならない」という否定条件だけでなく、AC5 と揃えて 実 readback と anchor 解決の成功を明示した方がよいです。

    live GitHub を新しい恒常的 CI ゲートにしない

    #2361 は、credentialless の live positive control を opt-in に分離し、required pytest を共有 runner の quota やネットワーク状態から独立させる方針を既に定めています。今回もこの分離を維持すべきです。

    匿名 REST の制限が送信元 IP ごとの毎時60リクエストであることは、GitHub の公式仕様とも一致します。認証済み経路の復旧を、再び匿名 live test の都合で止めるのは本末転倒です。[GitHub Docs](https://docs.github.com/en/rest/using-the-rest-api/rate-limits-for-the-rest-api)

    通常の回帰テストはネットワークに依存しない形で実施し、fresh interactive の確認は別枠の実機証拠にする。外部障害は成功へ昇格させず、同時に、全開発を止める新しい恒常的ゲートにも変えない、という分離が適切です。

    推奨する修正範囲

    selector の修正 + executor の認証設定受け渡し + 既存テスト/説明の更新 に限定することを勧めます。

    #2299 を実装した PR #2303 は既にマージされ、GitHub auth のみを native 同等に共有する方針へ変更されています。この方針を今回もう一度設計し直す必要はありません。

    Issue の契約修正として優先すべきなのは、次の四点です。

    1. skill_runtime_exec.py と実在する env allowlist テストをスコープに追加する。
    2. 誤ったテストパスを直し、必要なドキュメント更新を許可する。
    3. single-authority を実呼び出し経路で保証し、途中の匿名経路への切替を禁止する。
    4. token env と保存済み認証を別々の positive case として検証する。

    新しい authenticated broker、credential のコピー、HOME 全体の共有、追加の人間承認レイヤーは、この調査で確認した問題を解決するためには必要ありません。

    この Issue の価値は「隔離をさらに厳しくすること」ではなく、「既に承認済みの native GitHub access を、既存の workflow が正しく使える状態へ戻すこと」です。 現状のまま着手すると、その修正に必要なファイルがスコープ外になり、また workflow が止まります。そこを先に小さく是正するのが、品質と個人開発の実用性を両立する進め方です。

  2. squne121 commented on Oct 2, 2026

    @squne121
    OwnerAuthor

    確認した current main は 2edd52de22230650642c583a4074f06e14193fad で、レビュー時の基準 be5c8ad... から進んでいます。ただし current main でも、skill_runtime_exec.py は preflight.run.with_human_context 等に GH_CONFIG_DIR を渡さず、preflight 側も isolated HOME だけで credentialless transport を選択する旧契約を保持しています。#2872 を参照する既存 PR は現時点で見つかりませんでした。

    推奨アクションは、指定 OWNER コメントを operator-selected human context として current issue-refinement-loop に投入し、まず Issue contract 自体を修正することです。特に skill_runtime_exec.py、env allowlist test、実在する transport test パス、docs/dev/workflow.md を scope に含める必要があります。GitHub CLI 公式仕様でも GH_CONFIG_DIR が設定されなければ XDG/HOME 側へ設定探索が移るため、この受け渡し欠落は実質的です。匿名 REST の一次制限が 60 requests/hour なのも公式仕様と一致します。[GitHub CLI](https://cli.github.com/manual/gh_help_environment?utm_source=chatgpt.com)

    以下を、既に auto mode で起動中の対話的 Claude Code にそのまま貼れます。

    repo squne121/loop-protocol の Issue #2872 を、指定された trusted anchor comment

    #2872 (comment)

    を対象として、current repository の .claude/skills/issue-refinement-loop/SKILL.md に従って Issue refinement を最後まで実行してください。

    このセッションは既に interactive Claude Code の auto mode で起動済みです。今回の依頼では、repository-native issue-refinement-loop が要求する通常の read、調査、SubAgent dispatch、Issue contract の controlled mutation、レビュー反復、テスト・checker 実行、終了コメント投稿、および必要条件を満たす follow-up Issue 起票を、人間の iteration ごとの追加承認なしで進めることを明示的に承認します。ただし、これは Claude Code の permission mode を変更する指示ではありません。bypassPermissions、--dangerously-skip-permissions、permission/hook の迂回は行わないでください。

    1. 最初に current state を fresh に固定してください。現在の main HEAD、Issue 実装: Claude-GPT issue-refinement preflight の stale credentialless transport 選択を #2299 の native GitHub auth 契約へ整合する #2872 本文と全コメント、指定 comment 5950471698、関連 Issue/PR、現在の issue-refinement-loop Skill と必要な references/scripts、CLAUDE.md、関連 SSOT を読み直してください。指定レビューが調査した時点の main は be5c8ad3cdc24306e2e2e61e0b4db888d63e39f5 ですが、これを current authority と仮定しないでください。こちらで事前確認した current main は 2edd52de22230650642c583a4074f06e14193fad でしたが、実行開始時に必ず再取得してください。既存 PR/branch が存在すれば重複作成せず current state を利用してください。Issue refinement 自体では production implementation、実装 PR 作成、merge は行わないでください。

    2. この invocation では、ユーザーが指定した comment を operator-selected human context として扱ってください。GitHub author_association だけから human origin を推定するのではなく、current Skill の Accepted Trust Model に従い、canonical privileged profile preflight.run.with_human_context を使ってください。preflight.run.with_agent_report や unlabeled preflight.run.with_anchor へ置き換えないでください。URL・repo・Issue binding を検証し、current command registry / executor を使い、run_refinement_preflight.py を production path から直接迂回呼び出ししないでください。

    3. Step 1 の repository investigation では current codebase-investigator SubAgent を適切に使用してください。特にレビューコメントが指摘している production path を current HEAD 上で再検証してください。少なくとも scripts/agent-guards/skill_runtime_exec.py::_sanitize_env()、.claude/skills/issue-refinement-loop/scripts/run_refinement_preflight.py の transport selection、.claude/skills/issue-refinement-loop/scripts/tests/test_skill_runtime_exec_env_allowlist.py、.claude/skills/issue-refinement-loop/tests/test_run_refinement_preflight_credentialless_transport.py、scripts/agent-guards/tests/test_isolated_anchor_single_authority.py、scripts/claude-gpt/launch.sh / lib.sh、docs/dev/workflow.md、実装: Claude-GPT の GitHub access を compatibility-first に切り替え既存 workflow を安定化する #2299 と関連実装、実装: Claude-GPT issue-refinement preflight の anchor comment 取得を credentialless transport へ統一する #2257/fix: issue-refinement preflight の anchor comment 取得を credentialless transport へ統一する (#2257) #2260、実装: credentialless GitHub read live test の github_live marker適合と例外処理是正 #2361、実装: contract snapshot の vc_preflight_classifications transport 上限(16,000 文字)と readiness の VC 上限(40 件)の不整合を解消し、VC が 14 件以上の Issue でも snapshot を materialize できるようにする #2845 を確認してください。SubAgent を launch しただけで完了扱いせず、terminal completion と final structured result を必ず回収してから次工程へ進んでください。SubAgent が failed / inconclusive を返した場合は current agent contract の fallback/fail-close 規則に従い、成功を捏造しないでください。

    4. external claim が current refinement decision に影響する場合は current Skill の Step 1b routing に従って web-researcher SubAgent を使用してください。GitHub CLI の GH_CONFIG_DIR / stored credential resolution、GitHub REST rate limit 等は公式 GitHub CLI manual、GitHub Docs、必要なら upstream source を一次資料として確認してください。Web SubAgent も final result を取得するまで待ってください。既に repository evidence だけで disposition が決定できる external claim を、不要な恒常 gate に拡張しないでください。

    5. 指定 REQUEST_CHANGES の意味を弱めず Issue contract に反映してください。current evidence が依然支持する場合、最低限「selector の修正だけでなく canonical executor が保存済み GitHub auth の GH_CONFIG_DIR を production preflight child へ渡す境界も対象にする」「scripts/agent-guards/skill_runtime_exec.py を In Scope / Allowed Paths に追加する」「.claude/skills/issue-refinement-loop/scripts/tests/test_skill_runtime_exec_env_allowlist.py を production preflight profile の期待値更新対象として追加する」「誤記されている scripts/agent-guards/tests/test_run_refinement_preflight_credentialless_transport.py を実在する .claude/skills/issue-refinement-loop/tests/test_run_refinement_preflight_credentialless_transport.py へ訂正する」「docs/dev/workflow.md の stale transport explanation を更新可能にする」「token env と通常の gh auth login / stored config (GH_CONFIG_DIR) を別々の positive regression case とする」「isolated+authenticated / isolated+genuinely-authless / normal profile を独立軸として検証する」「Issue/comments/anchor の single-authority transport を実 production call path 全体で維持し mid-read の anonymous/authenticated split を許さない」「runtime verification は readback + anchor resolution + downstream Step 1 へ進めることを証拠にし、実装: contract snapshot の vc_preflight_classifications transport 上限(16,000 文字)と readiness の VC 上限(40 件)の不整合を解消し、VC が 14 件以上の Issue でも snapshot を materialize できるようにする #2845 の contract refinement 完了までは 実装: Claude-GPT issue-refinement preflight の stale credentialless transport 選択を #2299 の native GitHub auth 契約へ整合する #2872 の AC に広げない」「live GitHub verification は fresh interactive runtime evidence とし、shared-runner network/quota に依存する新しい required CI gate にしない」を contract に反映してください。current evidence により一部が既に解消済みなら、その部分は機械的に追加せず fresh evidence に従ってください。

    6. contract mutation は current Skill の canonical route に従ってください。preflight.run.with_human_context が contract_update_required を返す場合は contract_update.run.with_human_context を使用してください。section-bound patch で表現不能で NEXT_ACTION: issue_editor_required が返った場合は、同じ anchor URL を reviewer feedback URL として current issue-editor / edit-issue controlled transaction route へ handoff し、完全な body rewrite を実施してください。同じ mutation command の no-progress 再試行や raw gh issue edit への迂回は禁止です。SubAgent/handoff が発生した場合も final result と readback が完了するまで待ってください。mutation 後は fresh Issue body readback、fresh preflight、fresh Step 2 review、fresh readiness を実行してください。

    7. review/fix loop は current issue-refinement-loop の deterministic routing をそのまま consume してください。planner/reviewer 判定を prose で再実装しないでください。current default max_iterations が 3 のままであれば、その bounded loop 内では needs-fix を人間承認なしで自動修正・再レビューしてください。上限を勝手に引き上げないでください。human_judgment_required、max iterations 到達、integrity failure、irreconcilable scope conflict 等の canonical stop condition が成立した場合だけ、その structured termination に従って停止してください。通常の checker failure、修正可能な contract defect、stale evidence は停止理由ではなく loop 内で修復・再取得してください。

    8. 再発防止については、今回の defect を単に 実装: Claude-GPT issue-refinement preflight の stale credentialless transport 選択を #2299 の native GitHub auth 契約へ整合する #2872 から切り離して別 Issue にしないでください。実装: Claude-GPT issue-refinement preflight の stale credentialless transport 選択を #2299 の native GitHub auth 契約へ整合する #2872 の Outcome を満たすために必要な executor/selector/test/doc 修正は 実装: Claude-GPT issue-refinement preflight の stale credentialless transport 選択を #2299 の native GitHub auth 契約へ整合する #2872 の contract に取り込むのが優先です。そのうえで調査中に、実装: Claude-GPT issue-refinement preflight の stale credentialless transport 選択を #2299 の native GitHub auth 契約へ整合する #2872 の scope とは独立した concrete recurrent failure class、duplicate mechanism、別 consumer の同種 credential-carrier drift、恒常的に stale contract を再生成する別 SSOT 等を発見した場合だけ、既存 OPEN/CLOSED Issue を dedupe_key・意味で検索してください。未起票で独立対応が必要なら current repository-native follow-up materialization / create-issue 手順で再発防止 Issue を GitHub に起票してください。単なる一般 security hardening、新 broker/schema/wrapper/approval layer は起票理由にしないでください。起票した場合は 実装: Claude-GPT issue-refinement preflight の stale credentialless transport 選択を #2299 の native GitHub auth 契約へ整合する #2872 との関係、concrete evidence、Outcome、In/Out of Scope、AC、Allowed Paths、verification を明記してください。

    9. 最後は current Skill の termination policy に従って終了してください。approved の場合は required な fresh review/readiness と dependency gate を満たし、canonical termination publisher / handoff marker が適用されるならそれを使用してください。ただし issue-refinement-loop から impl-review-loop を起動したり、production code を実装したり、worktree/branch/PR を作成したりしないでください。最終報告には final main HEAD、target anchor、Issue body がどう更新されたか、主要 finding の disposition、実行した SubAgent とその completion 状態、web research の有無、review iteration 数、fresh verification/readback、最終 verdict/termination cause、残 blocker、作成した follow-up Issue があれば番号と理由を簡潔に記載してください。

    明示的な停止境界は、secret/credential 値や credential file 内容を表示・コピーする必要が生じる場合、host HOME/SSH/GPG 等の unrelated isolation を弱める必要がある場合、新 generic authenticated broker または恒常 approval layer が不可避な場合、permission bypass が必要な場合、破壊的 Git/GitHub 操作や履歴破壊が必要な場合、current Skill が human_judgment_required を確定した場合です。それ以外の通常の refinement、controlled Issue mutation、SubAgent 調査、review/fix iteration、follow-up Issue materialization は今回の依頼で承認済みとして進めてください。

    この prompt は Issue contract の refinement までを意図的な終点にしています。#2872 が approved になった後は、別 invocation で impl-review-loop に渡すのが current Skill の責務分離に合います。

  3. squne121 commented on Oct 2, 2026

    @squne121
    OwnerAuthor

    Contract Review Result

    CONTRACT_REVIEW_RESULT_V1:
      status: go
      generated_at: "2026-10-02T11:00:12Z"
      generated_by: issue-contract-review
      issue_url: https://github.com/squne121/loop-protocol/issues/2872
      body_sha256: "sha256:780eef0d1de026da4025466e4f86ac1e02f3c92211ba1e902a8147df53cbdc63"
      checks:
        readiness: go
        blockers: pass
        product_spec: pass
        product_spec_check: {"schema":"product_spec_check/v1","applicability":"applicable","decision":"pass","triggers":{"docs_product_allowed_paths":false,"tasks_md_mentioned":false,"specify_artifact_mentioned":false,"generated_task_mentioned":false,"product_spec_context_present":false,"machine_readable_contract_present":true},"conditions":{"docs_product_requires_spec_evidence":{"status":"pass","evidence":[]},"tasks_md_not_direct_source":{"status":"pass","evidence":[]},"specify_not_canonical":{"status":"pass","evidence":[]},"diff_first_rationale_present":{"status":"pass","evidence":[]},"generated_task_trace_present":{"status":"pass","evidence":[]},"task_dependencies_materialized":{"status":"pass","evidence":[]}},"blocked_reasons":[],"body_sha256":"sha256:780eef0d1de026da4025466e4f86ac1e02f3c92211ba1e902a8147df53cbdc63","source_provenance":{"source_type":"body_file","body_file":"/tmp/contract_review_once_body_ugqd_dl5.md"}}
        vc_preflight:
          decision: pass
          classifications: '[{"ac":"AC1","line":3,"raw_command":"uv run --locked pytest .claude/skills/issue-refinement-loop/tests/test_run_refinement_preflight_credentialless_transport.py::test_isolated_with_token_env_selects_native_gh_transport -q","command_hash":"sha256:216581fed49e3b01ecee754faf13101d115a21fbf794b88d3e17ebf48283b04c","execution_key_hash":"sha256:c6edc2858b0ea8846b533c78d3b7adc11e6784dbb8dd86b88f07a01892e94dcc","runner":"exec","exit_code":4,"classification":"expected_fail","category":"existing_file_missing_node_id_declared_fail","decision":"go","scope_class":"baseline_fail_expected","confidence":"low","stdout_head":["no tests ran in 0.09s"],"stdout_truncated":false,"stdout_original_line_count":3,"stderr_head":["ERROR: not found: /home/squne/projects/LOOP_PROTOCOL/.claude/skills/issue-refinement-loop/tests/test_run_refinement_preflight_credentialless_transport.py::test_isolated_with_token_env_selects_native_gh_transport","(no match in any of [<Module test_run_refinement_preflight_credentialless_transport.py>])"],"stderr_truncated":false,"stderr_original_line_count":4,"runner_env_delta":{},"duration_ms":274,"fix_hint":null,"certified_target_paths":null,"annotations":{"baseline_expect":"fail","vc_role":null,"missing_baseline_expect":false},"annotation_source":{"line":2,"raw":"# baseline-expect: fail"},"strict":null,"repair":null,"timeout_provenance":{"timeout_seconds":150,"cleanup_tail_seconds":15,"source":"static_fallback","estimator_version":"v2","estimator_input_digest":"sha256:8b75e777940ad564df69bdbd8ccdc2bdce65895b5eaee1799c7dfe9192631d21"}},{"ac":"AC2","line":7,"raw_command":"uv run --locked pytest .claude/skills/issue-refinement-loop/scripts/tests/test_skill_runtime_exec_env_allowlist.py::test_production_preflight_profiles_carry_gh_config_dir .claude/skills/issue-refinement-loop/scripts/tests/test_skill_runtime_exec_env_allowlist.py::test_preflight_fixture_profile_does_not_carry_gh_config_dir -q","command_hash":"sha256:bf62b5e0a5b93ef7d940234bae77759e13fbd337d11daf6478cbb9e090d8782c","execution_key_hash":"sha256:7a54b9fa97946e36802773a4792e8c241f1222188dada7d1855b7f849f92852f","runner":"exec","exit_code":4,"classification":"expected_fail","category":"existing_file_missing_node_id_declared_fail","decision":"go","scope_class":"baseline_fail_expected","confidence":"low","stdout_head":["no tests ran in 0.03s"],"stdout_truncated":false,"stdout_original_line_count":3,"stderr_head":["ERROR: not found: /home/squne/projects/LOOP_PROTOCOL/.claude/skills/issue-refinement-loop/scripts/tests/test_skill_runtime_exec_env_allowlist.py::test_production_preflight_profiles_carry_gh_config_dir","(no match in any of [<Module test_skill_runtime_exec_env_allowlist.py>])","ERROR: not found: /home/squne/projects/LOOP_PROTOCOL/.claude/skills/issue-refinement-loop/scripts/tests/test_skill_runtime_exec_env_allowlist.py::test_preflight_fixture_profile_does_not_carry_gh_config_dir","(no match in any of [<Module test_skill_runtime_exec_env_allowlist.py>])"],"stderr_truncated":false,"stderr_original_line_count":7,"runner_env_delta":{},"duration_ms":193,"fix_hint":null,"certified_target_paths":null,"annotations":{"baseline_expect":"fail","vc_role":null,"missing_baseline_expect":false},"annotation_source":{"line":6,"raw":"# baseline-expect: fail"},"strict":null,"repair":null,"timeout_provenance":{"timeout_seconds":150,"cleanup_tail_seconds":15,"source":"static_fallback","estimator_version":"v2","estimator_input_digest":"sha256:88edfc2b50e992123219f4ee743b76e550f9e72084945eb27695d02237852e2d"}},{"ac":"AC3","line":11,"raw_command":"uv run --locked pytest .claude/skills/issue-refinement-loop/tests/test_run_refinement_preflight_credentialless_transport.py::test_single_transport_threaded_through_all_read_call_sites -q","command_hash":"sha256:56cf63b37d58316e8d31433d9969ef08f6fb8d08783995bde17d33f7766e320a","execution_key_hash":"sha256:cb57c6ec0639bb3c39636ca6b09a7b4f09a017246fc1790198b376d3ed6f9226","runner":"exec","exit_code":4,"classification":"expected_fail","category":"existing_file_missing_node_id_declared_fail","decision":"go","scope_class":"baseline_fail_expected","confidence":"low","stdout_head":["no tests ran in 0.10s"],"stdout_truncated":false,"stdout_original_line_count":3,"stderr_head":["ERROR: not found: /home/squne/projects/LOOP_PROTOCOL/.claude/skills/issue-refinement-loop/tests/test_run_refinement_preflight_credentialless_transport.py::test_single_transport_threaded_through_all_read_call_sites","(no match in any of [<Module test_run_refinement_preflight_credentialless_transport.py>])"],"stderr_truncated":false,"stderr_original_line_count":4,"runner_env_delta":{},"duration_ms":283,"fix_hint":null,"certified_target_paths":null,"annotations":{"baseline_expect":"fail","vc_role":null,"missing_baseline_expect":false},"annotation_source":{"line":10,"raw":"# baseline-expect: fail"},"strict":null,"repair":null,"timeout_provenance":{"timeout_seconds":150,"cleanup_tail_seconds":15,"source":"static_fallback","estimator_version":"v2","estimator_input_digest":"sha256:538d555b0b113cdcf362c515180aa51fae296a939b9139128ac60c84c1e9a336"}},{"ac":"AC4","line":15,"raw_command":"uv run --locked pytest .claude/skills/issue-refinement-loop/tests/test_run_refinement_preflight_credentialless_transport.py::test_isolated_authless_keeps_contract_without_secret_probing -q","command_hash":"sha256:695f02ea14031bb6c8a55b0eeacd997784bef9101d60f106d40edc38da8e1c2e","execution_key_hash":"sha256:eb45d7c6be09eeeb6483d48bac316b4debe9728152351890c2545b4f3c5670a3","runner":"exec","exit_code":4,"classification":"expected_fail","category":"existing_file_missing_node_id_declared_fail","decision":"go","scope_class":"baseline_fail_expected","confidence":"low","stdout_head":["no tests ran in 0.10s"],"stdout_truncated":false,"stdout_original_line_count":3,"stderr_head":["ERROR: not found: /home/squne/projects/LOOP_PROTOCOL/.claude/skills/issue-refinement-loop/tests/test_run_refinement_preflight_credentialless_transport.py::test_isolated_authless_keeps_contract_without_secret_probing","(no match in any of [<Module test_run_refinement_preflight_credentialless_transport.py>])"],"stderr_truncated":false,"stderr_original_line_count":4,"runner_env_delta":{},"duration_ms":290,"fix_hint":null,"certified_target_paths":null,"annotations":{"baseline_expect":"fail","vc_role":null,"missing_baseline_expect":false},"annotation_source":{"line":14,"raw":"# baseline-expect: fail"},"strict":null,"repair":null,"timeout_provenance":{"timeout_seconds":150,"cleanup_tail_seconds":15,"source":"static_fallback","estimator_version":"v2","estimator_input_digest":"sha256:f8d799738e518e88125d2cf3c521a02eae2ea559c7d6ec6286f4907f6ea6fcff"}},{"ac":"AC5","line":19,"raw_command":"uv run --locked pytest .claude/skills/issue-refinement-loop/tests/test_run_refinement_preflight_credentialless_transport.py::test_isolated_with_stored_gh_config_dir_selects_native_gh_transport .claude/skills/issue-refinement-loop/tests/test_run_refinement_preflight_credentialless_transport.py::test_normal_profile_selects_native_gh_transport .claude/skills/issue-refinement-loop/tests/test_run_refinement_preflight_credentialless_transport.py::test_mid_read_failure_does_not_switch_transport .claude/skills/issue-refinement-loop/tests/test_run_refinement_preflight_credentialless_transport.py::test_multipage_comments_anchor_resolution_single_transport -q","command_hash":"sha256:cc66a8c642a108845781bf6587487afd0c4c8c39614c609b099f6ae3323cd45d","execution_key_hash":"sha256:e7615944c8fb9dc2df9bb28ab1d9247333ce7238908ab915cf9e1d18ffa926b4","runner":"exec","exit_code":4,"classification":"expected_fail","category":"existing_file_missing_node_id_declared_fail","decision":"go","scope_class":"baseline_fail_expected","confidence":"low","stdout_head":["no tests ran in 0.09s"],"stdout_truncated":false,"stdout_original_line_count":3,"stderr_head":["ERROR: not found: /home/squne/projects/LOOP_PROTOCOL/.claude/skills/issue-refinement-loop/tests/test_run_refinement_preflight_credentialless_transport.py::test_isolated_with_stored_gh_config_dir_selects_native_gh_transport","(no match in any of [<Module test_run_refinement_preflight_credentialless_transport.py>])","ERROR: not found: /home/squne/projects/LOOP_PROTOCOL/.claude/skills/issue-refinement-loop/tests/test_run_refinement_preflight_credentialless_transport.py::test_normal_profile_selects_native_gh_transport","(no match in any of [<Module test_run_refinement_preflight_credentialless_transport.py>])","ERROR: not found: /home/squne/projects/LOOP_PROTOCOL/.claude/skills/issue-refinement-loop/tests/test_run_refinement_preflight_credentialless_transport.py::test_mid_read_failure_does_not_switch_transport","(no match in any of [<Module test_run_refinement_preflight_credentialless_transport.py>])","ERROR: not found: /home/squne/projects/LOOP_PROTOCOL/.claude/skills/issue-refinement-loop/tests/test_run_refinement_preflight_credentialless_transport.py::test_multipage_comments_anchor_resolution_single_transport","(no match in any of [<Module test_run_refinement_preflight_credentialless_transport.py>])"],"stderr_truncated":false,"stderr_original_line_count":13,"runner_env_delta":{},"duration_ms":304,"fix_hint":null,"certified_target_paths":null,"annotations":{"baseline_expect":"fail","vc_role":null,"missing_baseline_expect":false},"annotation_source":{"line":18,"raw":"# baseline-expect: fail"},"strict":null,"repair":null,"timeout_provenance":{"timeout_seconds":150,"cleanup_tail_seconds":15,"source":"static_fallback","estimator_version":"v2","estimator_input_digest":"sha256:e7be03e6d085660d14134114b611af79af8076284d89803befe9f6c185200d8c"}},{"ac":"AC6","line":23,"raw_command":"uv run --locked pytest scripts/agent-guards/tests/test_credentialless_github_read.py scripts/agent-guards/tests/test_isolated_anchor_single_authority.py -q","command_hash":"sha256:e551c4a35e00f93159439c5348b2346374f591a772498c1423d9f4156ac86255","execution_key_hash":"sha256:9cf0507bb2ae9e1ea8d6113850ff4ed866dd90ff60dc9c8d7d94426cecafa5f5","runner":"exec","exit_code":0,"classification":"expected_pass","category":"baseline_expect_pass","decision":"go","scope_class":"regression_gate","confidence":"low","stdout_head":[".....................................................                    [100%]","53 passed, 3 deselected in 0.07s"],"stdout_truncated":false,"stdout_original_line_count":3,"stderr_head":[],"stderr_truncated":false,"stderr_original_line_count":1,"runner_env_delta":{},"duration_ms":258,"fix_hint":null,"certified_target_paths":null,"annotations":{"baseline_expect":"pass","vc_role":null,"missing_baseline_expect":false},"annotation_source":{"line":22,"raw":"# baseline-expect: pass"},"strict":null,"repair":null,"timeout_provenance":{"timeout_seconds":150,"cleanup_tail_seconds":15,"source":"static_fallback","estimator_version":"v2","estimator_input_digest":"sha256:7a9119fd714219b44372820be0971f8e4853b519bd508340dc573d43796ce272"}},{"ac":"AC7","line":27,"raw_command":"! rg -n -e \"never forwards the host''s real\" -e \"credentialless transport のみで解決し\" .claude/skills/issue-refinement-loop/scripts/run_refinement_preflight.py docs/dev/workflow.md","command_hash":"sha256:5519d30bd3ff3831d8aa0b56bff44a9310fcf6943e7ad77661762de675e8b02f","execution_key_hash":null,"runner":"exec","exit_code":null,"classification":"expected_fail","category":"expected_baseline_fail","decision":"go","scope_class":"baseline_fail_expected","confidence":"high","stdout_head":[],"stdout_truncated":false,"stdout_original_line_count":1,"stderr_head":[],"stderr_truncated":false,"stderr_original_line_count":1,"runner_env_delta":{},"duration_ms":0,"fix_hint":null,"certified_target_paths":null,"annotations":{"baseline_expect":"fail","vc_role":null,"missing_baseline_expect":false},"annotation_source":{"line":26,"raw":"# baseline-expect: fail"},"strict":null,"repair":null,"timeout_provenance":{"timeout_seconds":150,"cleanup_tail_seconds":15,"source":"static_fallback","estimator_version":"v2","estimator_input_digest":"sha256:733e5724976a033cedd3368c1c0490b1be959669147f77d7b091701a09abc7a2"}},{"ac":"AC8","line":31,"raw_command":"uv run --locked pytest scripts/claude-gpt/tests/ -q","command_hash":"sha256:3585f9a0f7e70a0551066986480124d2b4c8f932b0a2fef59fe219e1f2ae60a3","execution_key_hash":"sha256:6666e98497ef607a607d521ee6bac7cff8ffa86632b79c1e0596d7ca7c6e2569","runner":"exec","exit_code":0,"classification":"expected_pass","category":"baseline_expect_pass","decision":"go","scope_class":"regression_gate","confidence":"low","stdout_head":["....................................................s................... [ 12%]",".............ssssssssssssssssssssss..................................... [ 25%]",".......................................sssssssssssssssssssssssssssssssss [ 38%]","sssssssssssssss......................................................... [ 50%]","........................................................................ [ 63%]","..........sssss......................................................... [ 76%]","........................................................................ [ 88%]","................................................................         [100%]","492 passed, 76 skipped, 10 deselected in 121.46s (0:02:01)"],"stdout_truncated":false,"stdout_original_line_count":10,"stderr_head":[],"stderr_truncated":false,"stderr_original_line_count":1,"runner_env_delta":{},"duration_ms":121719,"fix_hint":null,"certified_target_paths":null,"annotations":{"baseline_expect":"pass","vc_role":null,"missing_baseline_expect":false},"annotation_source":{"line":30,"raw":"# baseline-expect: pass"},"strict":null,"repair":null,"timeout_provenance":{"timeout_seconds":192,"cleanup_tail_seconds":15,"source":"history_estimate","estimator_version":"v2","estimator_input_digest":"sha256:6378f77a4ba0dd6742b11e229514de3366162286ce0a8cbc279109c7afe498c2"}},{"ac":"AC9","line":35,"raw_command":"uv run --locked pytest -o addopts= --import-mode=importlib -m github_live .claude/skills/issue-refinement-loop/tests/test_run_refinement_preflight_credentialless_transport.py::test_ac9_isolated_preflight_reaches_step1_with_native_gh_auth_runtime -q","command_hash":"sha256:c4b11bcf4898a6919b429664820ef5d459825520b2e4fdf9b62b1600004efc82","execution_key_hash":"sha256:2088b5fcb039e3267cbe79ebedf247c5e9510a41943a19e8c49069df40452365","runner":"exec","exit_code":4,"classification":"expected_fail","category":"existing_file_missing_node_id_declared_fail","decision":"go","scope_class":"baseline_fail_expected","confidence":"low","stdout_head":["no tests ran in 0.09s"],"stdout_truncated":false,"stdout_original_line_count":3,"stderr_head":["ERROR: not found: /home/squne/projects/LOOP_PROTOCOL/.claude/skills/issue-refinement-loop/tests/test_run_refinement_preflight_credentialless_transport.py::test_ac9_isolated_preflight_reaches_step1_with_native_gh_auth_runtime","(no match in any of [<Module test_run_refinement_preflight_credentialless_transport.py>])"],"stderr_truncated":false,"stderr_original_line_count":4,"runner_env_delta":{},"duration_ms":265,"fix_hint":null,"certified_target_paths":null,"annotations":{"baseline_expect":"fail","vc_role":null,"missing_baseline_expect":false},"annotation_source":{"line":34,"raw":"# baseline-expect: fail"},"strict":null,"repair":null,"timeout_provenance":{"timeout_seconds":150,"cleanup_tail_seconds":15,"source":"static_fallback","estimator_version":"v2","estimator_input_digest":"sha256:4c6de9087f5c31b029f5c0815058a5fca27f7c7c36ab374ef397eb74a9d84b1d"}}]'
          classifications_transport: {"schema":"vc_preflight_classifications_transport/v1","classification_count":9,"original_payload_sha256":"sha256:9b0fbbc06d015771e5225a91a5831f3c7c8c1194ea45efbf2875dd95a7afbea1","compact":false,"truncated":false}
        declared_path_overlap: '{"schema":"declared_path_overlap/v1","advisory":true,"blocking":false,"decision":"advisory_only","disjoint":true,"overlapping_prs":[],"inventory":{"schema":"OPEN_PR_INVENTORY_V1","repo":"squne121/loop-protocol","state":"open","base_ref":"main","base_sha":"2edd52de22230650642c583a4074f06e14193fad","draft_policy":"include_drafts","prs":[{"number":2831,"title":"実装: Claude-GPT model/proxy runtime migration の3分類ルーティングを追加する","base_ref_name":"main","head_ref_name":"worktree-issue-2810-runtime-migration-classifier","head_ref_oid":"c37b306ba5db0152913904ebd6a3ffb9d485ac7a","is_draft":false,"is_cross_repository":false,"head_repository_owner":"squne121","head_repository_name":"loop-protocol","url":"https://github.com/squne121/loop-protocol/pull/2831","changed_files_count_graphql":20},{"number":2861,"title":"fix: trusted human-context contract-update の安全性と producer 到達性を修正","base_ref_name":"main","head_ref_name":"worktree-issue-2842-trusted-human-context-contract-update-mu","head_ref_oid":"21419f29403765765c90d152856bd70ee99769ec","is_draft":true,"is_cross_repository":false,"head_repository_owner":"squne121","head_repository_name":"loop-protocol","url":"https://github.com/squne121/loop-protocol/pull/2861","changed_files_count_graphql":15},{"number":2869,"title":"fix: Task Context 分類器の marker 列挙の二乗計算量除去と URL/path 内 #N の誤昇格を是正する","base_ref_name":"main","head_ref_name":"worktree-issue-2864-task-context-marker-owner-repo","head_ref_oid":"c5eb5e3323e64da16bb22c3848af90b508c0c87d","is_draft":true,"is_cross_repository":false,"head_repository_owner":"squne121","head_repository_name":"loop-protocol","url":"https://github.com/squne121/loop-protocol/pull/2869","changed_files_count_graphql":2},{"number":2873,"title":"feat: マージ済み PR に Task Context の claim を遡及付与する復旧経路を追加する (#2817)","base_ref_name":"main","head_ref_name":"worktree-issue-2817-pr-task-context-claim","head_ref_oid":"1f31003cb7b83166391fa32074f9a856adcd56d1","is_draft":true,"is_cross_repository":false,"head_repository_owner":"squne121","head_repository_name":"loop-protocol","url":"https://github.com/squne121/loop-protocol/pull/2873","changed_files_count_graphql":10}],"fetched_count":4,"totalCount":4,"has_next_page":false,"complete":true,"saturated":false,"limit":200,"page_count":1,"inventory_digest":"sha256:65d2ab432dd7682ab6867a15cb3c062d765d8ad565df7be9bcc801c6a8b52f59","errors":[]},"inventory_digest_extended":"sha256:97c2bc24bdbed8b4f78e000c19696767b4b81cba7c41fa4bad8a0d428ba8cf04","errors":[],"note":"changed-file 名の単純な重なりのみを証明する advisory check。3-way merge・hunk 競合・rename/delete 競合は評価しない(実 Git merge 競合の判定は Issue #1792 の PAIRWISE_MERGE_OBSERVATION_V1 producer の責務)。単独では blocking にしない。disjoint は tri-state(true/false/null)— 観測が不完全な場合は null。"}'
      source: ensure_contract_snapshot_auto
      expected_contract_fingerprint: '{"issue_number":2872,"contract_source_kind":"issue_comment","contract_source_id":"5950909121","contract_body_sha256":"sha256:780eef0d1de026da4025466e4f86ac1e02f3c92211ba1e902a8147df53cbdc63","allowed_paths_normalized_sha256":"5d9ab2327c974459b5f8e45f6cddd89708af4901b69ea0d8a0f1a55cc599dbe8","base_ref":"main","base_sha_at_snapshot":"2edd52de22230650642c583a4074f06e14193fad"}'
  4. squne121 commented on Oct 2, 2026

    @squne121
    OwnerAuthor

    issue-refinement-loop: approved で終了(Issue #2872)

    終了理由は approved です。この invocation は refinement だけを行い、impl-review-loop の起動、implementation worker、production code の変更、実装 branch や PR の作成、merge は行っていません。approved は実装開始の代替承認ではありません。

    • 基準 main: 2edd52de22230650642c583a4074f06e14193fad(実行開始時に再取得。指摘コメントの調査基準 be5c8ad3 とは異なる)
    • anchor: https://github.com/squne121/loop-protocol/issues/2872#issuecomment-5950471698(operator-selected human context、preflight.run.with_human_context lane、REQUEST_CHANGES)
    • 分類: Issue 本文を in-place で全面 rewrite。preflight は template 必須セクションの欠落で blocked を返し、section-bound patch の入力がなかったため、承認済みの issue-editor / edit-issue controlled transaction で full body rewrite を行った。
    • 最終本文: body_sha256: sha256:780eef0d1de026da4025466e4f86ac1e02f3c92211ba1e902a8147df53cbdc63(readback で candidate と一致を確認)

    主要 finding の disposition

    • P1-1(executor が GH_CONFIG_DIR を落とす): current HEAD で confirmed。skill_runtime_exec.py の carrier 一覧(L1184-1203)に preflight.run.with_* の 3 ID がなく、env allowlist test が non-carrier として固定している。In Scope / Allowed Paths に skill_runtime_exec.py と test を追加し、AC2 とした。
    • P1-2(Allowed Paths と VC のテストパス誤記): confirmed。実在パス .claude/skills/issue-refinement-loop/tests/test_run_refinement_preflight_credentialless_transport.py へ訂正した。docs/dev/workflow.md も更新対象に追加した。関連 test(test_refinement_preflight.py、test_credentialless_github_read.py)も必要時のみ最小更新として許可した。
    • P1-3(single-authority は selector 変更だけでは保てない): confirmed。_fetch_issue 等が transport 未指定で再選択する call site が複数残る。AC3 として、実 call path での一貫性と、取得途中の anonymous 切替禁止を追加した。
    • P2(認証判定の自作を避ける): GH_TOKEN 有無、hosts.yml、gh auth status の終了コードを必須ゲートにしない方針を In Scope と AC4 / AC8 に明記した。
    • token env と保存済み GH_CONFIG_DIR を別々の positive case とすること、isolated+authenticated / isolated+authless / normal profile を独立軸とすること: AC5 に反映した。
    • live GitHub を新しい required CI gate にしない: AC9 は opt-in の github_live marker 付き単独選択の VC とし、exit 77 を PASS に昇格させない。実装: contract snapshot の vc_preflight_classifications transport 上限(16,000 文字)と readiness の VC 上限(40 件)の不整合を解消し、VC が 14 件以上の Issue でも snapshot を materialize できるようにする #2845 の contract refinement 完了は完了条件に含めない。
    • Runtime Verification Applicability: 当初 deferred を検討したが、.claude/skills/**/scripts/** の変更が extension-surface policy の既定で immediate になるため immediate とした。scripts/claude-gpt/** は Allowed Paths から外し、launcher テストは read-only regression の VC に留めた(claude-gpt lifecycle の runtime profile 要求を避けるため)。

    実行した SubAgent と調査

    • codebase-investigator(local-asset advisory route): terminal completion と final structured result(status: ok)を回収した。報告の主要 claim は control-plane が rg と直接 Read で独立に再検証した。
    • issue-editor: terminal completion を回収し、live body の SHA を自力で readback して一致を確認した。
    • web-researcher: 起動していない。repository evidence だけで disposition が決定でき、本文は認証の有無を判定する新機構を作らず native gh に委ねる設計としたため、外部 claim が dispositive にならなかった。
    • semantic design review(Step 2.5): semantic_review_applicable: false(明示シグナルなし)のためスキップした。

    検証結果

    注記

    • follow-up Issue は起票していない。調査で別 consumer の drift を確認したが(scope_rollup.run)、実装: scope_rollup.run のGitHub認証carrierをchild ghへcommand-scopedに維持する #2611 が既に解決済みで、script 側で GH_CONFIG_DIR を扱っている。
    • hard dependency は今回のサイクルで確定していないため、dependency materialization gate は適用対象外。
    • 残 blocker: なし。AC9 の live 実機証跡は実装 PR の責務であり、今回は実行していない。
    LOOP_HANDOFF_RESULT_V1:
      status: refinement_approved
      routing_action: none
      contract_review:
        status: go
        gate_result: fresh_go
        latest_comment_url: "https://github.com/squne121/loop-protocol/issues/2872#issuecomment-5950909121"
        generated_at: "2026-10-02T11:00:45Z"
        body_sha256: "sha256:780eef0d1de026da4025466e4f86ac1e02f3c92211ba1e902a8147df53cbdc63"
      metadata:
        title_prefix_ready: true
      label_sync_observation:
        kind: presentation_sync
        result: noop
        detail: "presentation-only metadata。この終了では label を変更していない"
      auto_fixes:
        result: auto_fixed
        required: []
        skipped: []
      blockers: []
      permissions:
        unavailable: []
      generated_at: "2026-10-02T11:00:45Z"
      checked_body_sha256: "sha256:780eef0d1de026da4025466e4f86ac1e02f3c92211ba1e902a8147df53cbdc63"
      checker_exit_code: 0
      missing_sections: []
      missing_contract_keys: []
  5. squne121 commented on Oct 2, 2026

    @squne121
    OwnerAuthor

    live GitHub と current repository 契約を確認しました。現時点では Issue #2872 の refinement は approved、Final Gate は go、残 blocker なし、#2872 を参照する既存 PR は未検出です。contract snapshot は comment 5950909121、refinement 終了報告は 5950916600、確認時 main は 2edd52de22230650642c583a4074f06e14193fad です。ただし Claude Code 側では開始時に必ず fresh 再取得させます。

    推奨は、既定 max_iterations=3 を変えず current impl-review-loop を正規経路で完走させることです。特に #2872 は Runtime Verification Applicability: immediate なので、AC9 を root の通常 Claude Code セッションで代用せず、Issue contract が指定する fresh repository-owned Claude-GPT runtime で実証させます。SKIP/UNAVAILABLE を PASS に昇格させず、通常テスト・review finding・修正可能な CI failure は自律修復対象にします。

    そのまま貼り付ける prompt です。

    repo squne121/loop-protocol の Issue #2872

    #2872

    を対象に、current repository HEAD に存在する
    .claude/skills/impl-review-loop/SKILL.md
    およびその current references / steps / scripts / custom SubAgents に従って、実装 → 検証 → PR review → fix/re-review loop を実行し、人間が merge 判断できる直前の draft_pr_ready 相当まで進めてください。

    この interactive Claude Code session はすでに auto mode で起動済みです。この依頼は current Issue #2872 に対する canonical impl-review-loop の実行を明示的に承認するものです。

    0. 最初に fresh state を固定する

    過去の会話・古い HEAD・以下の事前確認値を authority にせず、最初に live state を再取得してください。

    必ず確認するもの:

    事前確認時点では以下だったが、stale なら必ず live 値を優先すること:

    既存 PR / branch / worktree が見つかり、current Skill の landing disposition / existing PR resume 規則上再利用可能なら、新規 PR を重複作成せず再利用してください。

    1. ユーザー承認の範囲

    current Issue #2872 の完遂に必要な、canonical workflow 内の以下の通常作業を、人間の iteration ごとの追加承認なしで進めることを明示的に承認します。

    • repository / GitHub の read-only investigation
    • current Skill / Agent / SSOT の読み込み
    • canonical SubAgent の起動
    • Issue 実装: Claude-GPT issue-refinement preflight の stale credentialless transport 選択を #2299 の native GitHub auth 契約へ整合する #2872 の Allowed Paths 内の実装・テスト・docs 修正
    • dedicated worktree / branch の作成または既存の再利用
    • local commit 作成
    • non-force push
    • PR の新規作成または既存 PR の更新
    • PR body の canonical 更新
    • Issue / PR への canonical workflow が要求するコメント投稿
    • Verification Commands の実行
    • project constitution が要求する通常品質ゲートの実行
    • CI 状態確認、failed log 調査
    • 修正可能な test / lint / build / CI failure の修正と再実行
    • REQUEST_CHANGES blocker の修正
    • stale-head の再レビュー
    • canonical route が要求する通常の update-branch 処理
    • runtime verification
    • review/fix iteration
    • current Skill が要求する evidence / artifact の生成・更新
    • recurrent defect に対する follow-up Issue の調査・dedupe・起票
    • merge 判断直前までの通常の GitHub mutation

    ただし以下は承認しません。必要になった場合は停止して具体的理由を報告してください。

    • 実 merge
    • auto-merge の有効化
    • git push --force / --force-with-lease
    • default branch への direct push
    • remote branch/ref の削除
    • foreign worktree / branch / 他タスクの dirty work の変更・削除
    • secret / credential の値・credential file 内容の取得、表示、artifact 保存
    • repository settings / IAM / branch protection の変更
    • bypassPermissions
    • --dangerously-skip-permissions
    • hook / permission / security policy の迂回
    • Issue contract の Out of Scope を勝手に実装へ取り込むこと

    auto mode の利用は、Claude Code の permission system を無効化する指示ではありません。

    2. Root-Owned Synchronous Entry Transition を正規に実行する

    current impl-review-loop が要求する pre-Step-1 entry transition をそのまま使用してください。

    root/main thread が一続きの current invocation で:

    1. capability preflight
    2. live Issue fetch
    3. current-run issue-contract-review
    4. 直後の live re-fetch
    5. routing decision
    6. 許可された場合のみ Step 1 dispatch

    まで行ってください。

    過去の Contract Snapshot comment や body SHA を単独の authorization packet として使用しないでください。

    current-run review が go でなくなっている場合は、契約を無視して実装を開始せず current canonical routing に従ってください。

    3. SubAgent を必ず使用し、完了を待つ

    root thread は control-plane に徹し、data-plane 作業を current custom SubAgents へ委譲してください。

    少なくとも canonical loop に従い:

    • Step 1: implementation-worker
    • Step 2: test-runner
    • Step 4: pr-reviewer

    を使用してください。

    必要なら:

    • codebase investigation 用の current appropriate SubAgent
    • recurrent defect の follow-up Issue 起票用 issue-creator

    も使用してください。

    SubAgent completion の必須条件

    SubAgent を dispatch しただけで完了扱いしないこと。

    各 dispatch で current Common Completion Protocol に従い:

    1. canonical task name を保存
    2. wait_agent 等は途中待機にのみ使う
    3. child の final structured result を取得
    4. 同じ canonical task が terminal completed であることを確認
    5. final result と terminal completion の両方が成立した後にのみ downstream routing

    としてください。

    timeout、mailbox update、steer response、起動成功だけを completion とみなさないでください。

    errored / interrupted / shutdown / lifecycle 上の not_found は成功に捏造しないでください。

    agent discovery failure の場合は current Skill に記載された bounded recovery route(Stage A/B/C 等)が applicable なら自律的に使用し、回復できるのに即人間へ停止しないでください。fresh runtime recovery を行う場合も、現在の runtime/adapter contract を維持し、別 runtime へ黙って fallback しないでください。

    4. Issue #2872 の実装上の重点

    Issue body の current contract を authority とし、以下の意図を弱めないでください。

    主な修正対象は、認証基盤の再設計ではなく既存経路間の stale divergence の除去です。

    少なくとも current evidence を再検証した上で:

    • run_refinement_preflight.py

      • isolated HOME であることだけを「GitHub auth 不在」の proxy にしない
      • normal production path は native gh の credential resolution に委ねる
      • 1 preflight invocation 内で選択した read transport を Issue / comments / anchor / refetch / default fetcher を含む全 read call path に一貫して thread する
      • read failure の途中で anonymous credentialless transport へ切り替えない
      • GH_TOKEN / hosts.yml / gh auth status 等を使う新しい独自 auth detection gate を作らない
    • scripts/agent-guards/skill_runtime_exec.py

      • Issue contract が指定する production preflight command IDs へ、親に既に存在する GH_CONFIG_DIR を正規に伝播する
      • unset/empty なら値を捏造しない
      • fixture lane や無関係 command ID へ scope を広げない
      • 既存の relative-path normalization mechanism を再利用し、credential copy / discovery mechanism を新設しない
    • focused regression tests

      • isolated + token env
      • isolated + stored GH_CONFIG_DIR / token env なし
      • genuinely authless isolated
      • normal profile
      • mid-read failure
      • multipage comments + anchor resolution
      • production command env propagation
      • fixture non-carrier
      • credential/token 非漏洩
    • stale docs

    scripts/claude-gpt/launch.sh / lib.sh と #2299 は Issue contract が read-only authority としている限り変更しないでください。

    不要な authenticated broker、wrapper、schema、approval layer、credential copy、host HOME 全体共有を追加しないでください。

    5. 実装 → 検証 → review → fix を止めずに回す

    current Skill の既定 max_iterations=3 を尊重し、独断で上限を引き上げないでください。

    通常フロー:

    inspect → implement → focused tests → full required verification → runtime verification → PR update/create → current-head verification → PR review → route verdict → fix → re-test → re-review

    を完遂してください。

    通常の以下は停止理由ではありません:

    • focused test failure
    • lint/typecheck/build failure
      -修正可能な CI failure
    • reviewer の REQUEST_CHANGES
    • stale reviewed HEAD
    • base branch が先行した BEHIND
    • recovery 可能な agent discovery failure

    REQUEST_CHANGES の blockers は fix_delta として次の Step 1 に渡して自動修正し、修正後の fresh PR HEAD に対して Step 2 と Step 4 を再実行してください。

    古い review / old HEAD / old CI を current success evidence に流用しないでください。

    6. Verification Commands と品質ゲート

    Issue body に記載されている Verification Commands は current contract の規則どおり扱ってください。

    current test inventory を fresh に確認し、Issue contract が要求する baseline-fail / regression expectations と current implementation後の結果を区別してください。

    プロジェクト憲法の通常必須検証も、current contract が除外しない限り実行してください。少なくとも current constitution を再確認した上で、該当する:

    • pnpm typecheck
    • pnpm lint
    • pnpm test
    • pnpm build
    • uv run pytest .claude/skills/gemini-cli-headless-delegation/tests/test_model_routing.py

    を実行してください。

    失敗を握りつぶさず、今回差分起因か baseline issue かを evidence に基づいて分類してください。

    7. AC9 Runtime Verification は必須

    Issue #2872 は Runtime Verification Applicability: immediate です。

    AC9 は unit test / mock / root Claude Code session の成功だけで代用しないでください。

    Issue contract が指定する repository-owned Claude-GPT launcher/profile の fresh interactive session を使い、gh 認証が有効な状態で #2845 の target anchor 5942301496 に対する production preflight.run.with_human_context 相当の canonical path を検証してください。

    検証対象:

    • Issue readback 成功
    • comments readback 成功
    • target anchor resolution 成功
    • rate_limited / credentialless_transport / read_issue の environment_failure にならない
    • downstream Step 1 へ進める状態になる
    • 実行 code commit SHA
    • gh version
    • credential 形態だけ(token env または stored config)
    • sanitized runtime evidence

    credential/token 値、credential file 内容、raw transcript、HOME の absolute path を保存・表示しないでください。

    Issue contract が要求する runtime-verification-AC9-<UTC>.log 等の sanitized artifact requirements を満たしてください。

    AC9 の重要ルール

    runtime が一時的に利用不能なだけなら current Skill が許す recoverable action を試してください。それでも genuinely unavailable なら証拠を残して merge-ready と偽らず停止してください。

    8. CI / mergeability / review

    Step 4 の前に current Skill の current-head gate と required CI waiting route を使用してください。

    test-runner の結果、Issue VC adjudication、current head、Issue body SHA、literal command hashes の binding を current canonical scripts で確認してください。

    pr-reviewer の自己申告だけから mergeability を決めず、root/control-plane が current GitHub state を直接確認し、current route_loop_verdict_v2() に渡してください。

    APPROVE だけで完了扱いしないでください。

    終了条件は current Skill の approved route、すなわち current contract が要求する:

    • current-head review が APPROVE
    • blockers が空
    • live mergeability が許容状態
    • required checks / verification が current-head で満たされる
    • runtime verification applicable AC が満たされる

    ことです。

    BEHIND は actual conflict と同一視せず、current route が route_to_update_branch を返すなら canonical worker へ委譲して update → reverify → rereview してください。

    reviewed_head_sha stale なら fresh head で re-review してください。

    9. 再発防止 Issue

    実装・verification・review 中に、今回だけの局所 defect ではなく再発可能な root cause、別 consumer の同種 drift、false-green test、producer/consumer semantic divergence、workflow hole などを発見した場合は、まず既存 OPEN/CLOSED Issue を検索して重複を確認してください。

    既存 Issue が current problem を十分に所有していれば reuse / reference し、新規起票しないでください。

    既存 Issue で未カバーで、独立 follow-up とする価値がある場合は current repository contract に従い、main/root thread から issue-creator SubAgent を使って create-issue の canonical route で GitHub Issue を起票してください。

    起票時は:

    • concrete root cause
    • reproduction / evidence
    • impact
    • bounded scope
    • Acceptance Criteria
    • Verification Commands
    • dedupe key / source Issue・PR linkage
    • triage-required 等 current contract が要求する metadata

    を含めてください。

    SubAgent は dispatch だけで済ませず、final result + terminal completion を待ち、実際に作成された Issue URL を readback してください。

    単なる一般的 security hardening や、今回の具体的 failure class を解決しない新 wrapper / gate / schema は再発防止策として起票しないでください。

    10. 停止条件

    人間へ停止するのは current canonical contract が要求する genuine blocker の場合に限定してください。例:

    • current loop の max_iterations 到達
    • genuine HUMAN_REVIEW_REQUIRED
    • irreconcilable contract / scope ambiguity
    • current Issue contract の human_judgment_required
    • runtime/evidence integrity を維持できない
    • recover不能な SubAgent/runtime failure
    • Allowed Paths 外の変更が不可避
    • destructive operation が必要
    • secret / credential 操作が必要
    • force push が必要
    • policy / permission bypass が必要
    • ユーザーが明示した停止条件

    SubAgent が単に human_review_required: true を自己申告しただけの場合は、それ自体を即停止 authority にせず、current impl-review-loop の #1860 routing rules に従ってください。

    11. 最終到達点

    merge は実行しないでください。auto-merge も設定しないでください。

    current Skill の approved route に到達したら、人間が merge 判断できる直前で停止してください。

    最終報告には最低限:

    • Issue 実装: Claude-GPT issue-refinement preflight の stale credentialless transport 選択を #2299 の native GitHub auth 契約へ整合する #2872 の final contract body SHA
    • 使用した current main SHA
    • branch / worktree
    • PR URL / number
    • final PR HEAD SHA
    • implementation summary
    • AC1〜AC9 の結果
    • focused test 結果
    • project-wide required verification 結果
    • AC9 runtime verification の sanitized summary と artifact path
    • CI required checks の状態
    • final pr-reviewer verdict と reviewed HEAD
    • live mergeability / mergeStateStatus
    • IMPL_REVIEW_LOOP_RESULT_V1 の status / termination_reason / merge_ready
    • 実行した iteration 数
    • unresolved blocker の有無
    • 作成または再利用した follow-up Issue URL 一覧
    • merge 未実行・auto-merge 未設定であること

    を示してください。

    成功条件は「コードを書いた」「PR を作った」ではなく、current HEAD に対する implementation・verification・runtime evidence・CI・PR review が揃い、canonical impl-review-loop が merge 判断直前の状態に到達したことです。

    特に今回の prompt では、Issue #2872 固有の AC9 を「通常テストが通ったから省略」にさせない点と、implementation-worker / test-runner / pr-reviewer の final result + terminal completion を必須にした点が重要です。

  6. squne121 commented on Oct 2, 2026

    @squne121
    OwnerAuthor

    推奨アクションは #2872 を別 Issue に分けず、Scope Delta を current Issue に取り込み、既存 branch/worktree を再利用して impl-review-loop を再開です。前回停止理由は明確に「既存 regression test が Allowed Paths 外」で、Claude Code 自身も Scope Delta 追加を次の一手として挙げています。貼り付けたテキスト(1)

    live 確認では、現在 main=3f7b0addbe09b21c03872755b1fd3092cd807044、既存 branch HEAD=7ae45349fddb2f7c5e55679e098f75e42dc59ea5、両者は共通 base 2edd52de… から各1 commit ずつ diverge、#2872 の PR はまだありません。したがって branch を捨てず、current main を非破壊的に取り込む前提にしています。

    repo squne121/loop-protocol の Issue #2872

    #2872

    について、前回 impl-review-loop Step 1 が IMPLEMENT_RESULT_V1.status: blocked で停止した地点から作業を再開してください。

    この interactive Claude Code session はすでに auto mode で起動済みです。

    今回のユーザー指示は、前回 blocker を解消して Issue #2872 を canonical workflow で完遂するために必要な bounded Scope Delta / Issue contract mutation を明示的に承認するものです。iteration ごとの追加人間承認は不要です。

    ただし auto mode は permission bypass の承認ではありません。bypassPermissions、--dangerously-skip-permissions、hook/security policy の迂回、force push、default branch への direct push は行わないでください。

    0. Fresh state を取り直す

    過去 transcript や以下の値を authority にせず、最初に live state を再取得してください。

    最低限確認するもの:

    この prompt 作成直前の観測値は:

    ただし開始時の live state が異なれば live state を優先してください。

    既存 branch/worktree が健全なら 必ず再利用し、新しい branch/worktree や重複 PR を作らないでください。

    remote branch は既に push 済みなので、main drift 解消のために history rewrite / force push を必要とする rebase を既定にしないでください。current Skill の canonical non-destructive update route、または通常 merge が適切ならそれを使ってください。

    1. 今回明示的に承認する contract recovery

    前回 Step 1 blocker は、

    scripts/agent-guards/tests/test_skill_runtime_exec_anchor.py::test_contract_update_phase_reaches_fake_transaction_and_fresh_handoff

    が #2872 実装後に failure となり、同ファイルが current Allowed Paths 外だったことです。

    これは別 follow-up Issue に追い出さず、#2872 の直接的な regression surface として Scope Delta に取り込むことを承認します。

    current repository-native issue-refinement-loop の正規経路を使い、必要な Issue body mutation と contract re-review を実施してください。

    最低限、fresh evidence が引き続き支持するなら:

    ことを承認します。

    この test は今回の実装で production behavior が変わる結果として壊れているため、別 Issue に分離して #2872 を既知 regression のまま進めないでください。

    AC3 の追加 Scope Delta も bounded に承認する

    前回 implementation-worker は、AC3 の明示的 transport threading を行うと固定 arity mock/test が壊れるため、_select_read_transport() が同一 singleton を返す実装で代替したと報告しています。

    ここは実装都合で contract を弱めないでください。

    Issue #2872 の current AC3 / In Scope の文言を fresh に読み、pr-reviewer が要求する semantics を満たすかを判定してください。

    AC3 を文字どおり満たすために、transport=None の default fetcher を含む call sites へ explicit transport threading が必要であり、それに伴って既存テストの call expectation だけを更新する必要が確認された場合は、次の既存 regression tests を 必要なものだけ Scope Delta / Allowed Paths に追加することを今回明示的に承認します。

    • .claude/skills/issue-refinement-loop/tests/test_main_drift_evidence_epoch.py
    • scripts/agent-ops/tests/test_evidence_index_preflight_integration.py
    • .claude/skills/issue-refinement-loop/tests/test_structural_repair_action_apply_consumer.py

    ディレクトリ全体の追加や無関係な test rewrite は承認しません。

    fresh investigation で実際には変更不要と判明したファイルは追加しないでください。

    2. Contract mutation 後は必ず re-review

    Allowed Paths / In Scope / VC を更新したら:

    1. live Issue body を readback
    2. body SHA256 を再計算
    3. current issue-contract-review を fresh 実行
    4. status: go と current body/base の一致を確認
    5. current canonical Root-Owned Synchronous Entry Transition を再実行

    してください。

    古い Contract Snapshot 5950909121 や refinement completion 5950916600 を authorization packet として再利用しないでください。

    contract body が変わる以上、fresh review が必須です。

    Issue contract mutation は current issue-refinement-loop の controlled route を使用し、raw gh issue edit 等で canonical workflow を迂回しないでください。

    今回の direct interactive user instructionは「上記 bounded Scope Delta を承認する」という human authority です。current Skill が direct interactive human authority の materialization を要求する場合は、その current canonical routeを使用してください。

    3. 既存実装を捨てずに再開

    contract recovery 後は既存 branch/worktree:

    worktree-issue-2872-refinement-preflight-native-gh-transport

    および existing commit:

    7ae45349fddb2f7c5e55679e098f75e42dc59ea5

    を fresh に検証し、再利用してください。

    既存 commit を無条件に正しいとは扱わず:

    • current Issue contract
    • current main
    • changed files
    • focused tests
    • related production consumers

    に対して再評価してください。

    main drift は current canonical non-force route で取り込みます。

    foreign branch/worktree や別タスクの dirty work は変更・削除しないでください。

    4. Step 1 は implementation-worker へ再委譲

    fresh contract review が go となり Root-Owned Synchronous Entry Transition が Step 1 を許可したら、current implementation-worker を再度使用してください。

    SubAgent message には暗黙 context に依存せず、少なくとも:

    を具体値で渡してください。

    SubAgent completion は dispatch だけで済ませない

    すべての SubAgent について:

    1. canonical task name を保持
    2. dispatch
    3. final structured result を取得
    4. terminal completion を確認
    5. final result と completion の両方を取得後にのみ downstream routing

    としてください。

    wait_agent timeout、launch success、途中 mailbox message だけを completion とみなさないでください。

    errored / interrupted / shutdown / inconclusive を success に変換しないでください。

    5. AC3 は特に adversarial に確認する

    前回実装の

    「selector を process-wide constant singleton にして、transport 未指定 call site でも同じ instance に解決する」

    という設計を、そのまま採用済み扱いしないでください。

    current Issue contract の要求が:

    • 1 invocation で transport を一度選ぶ
    • Issue / comments / anchor
    • refetch
    • EvidenceIndex
    • repair/apply path
    • default fetcher

    を含む全 read call path で単一 authority を維持すること

    である点を確認してください。

    pr-reviewer には明示的に、

    「constant selector による再解決で AC3 を満たすのか、それとも selected transport の explicit threading が必要か」

    を review target として渡してください。

    contract に照らして explicit threading が必要なら実装修正し、上記 bounded Scope Delta の test expectations も最小修正してください。

    implementation convenience を理由に AC3 の意味を変更しないでください。

    6. 削除された regression test を確認する

    前回 worker は

    scripts/agent-guards/tests/test_isolated_anchor_single_authority.py

    内の live command-graph test を削除し、AC9 test で代替したと報告しています。

    この削除を既定で正当化しないでください。

    pr-reviewer / test-runner で:

    • 削除された test が固定していた failure class
    • AC9 replacement が同等以上の regression coverage を持つか
    • network/live test と hermetic test の責務が異ならないか
    • signature drift だけなら test を修復して残す方が適切でないか

    を確認してください。

    必要なら current Allowed Paths 内で削除ではなく修正・拡張してください。

    7. Step 2 は test-runner で独立検証

    implementation-worker 完了後は必ず current test-runner を使用し、worker の自己申告を verification authority にしないでください。

    最低限:

    を実行してください。

    前回 broad pytest では 15 failures、うち blocker 1件以外は main でも再現すると worker が報告していますが、その自己申告を authority にしないでください。

    current main と PR/branch HEAD の双方で必要な最小 reproduction を行い、

    • branch-introduced regression
    • current-main baseline failure
    • environment/toolchain failure

    を独立に分類してください。

    branch 起因 failure は可能な限り修正して再検証してください。

    8. AC9 runtime verification

    Issue #2872 の AC9 は Runtime Verification Applicability: immediate です。

    現在の通常 Claude Code session の成功だけを AC9 の代替証拠にしないでください。

    current repository-owned Claude-GPT launcher/profile の fresh interactive runtime を current repository contract に従って使用し、#2845 target anchor 5942301496 について実証してください。

    必須性質:

    SKIP / UNAVAILABLE / external outage を PASS に昇格させないでください。

    anonymous credentialless fallback、host HOME 全共有、別 profile、manual workaround を成功証拠にしないでください。

    credential 値や credential file 内容は読まない・表示しない・artifact に残さないでください。

    contract が要求する sanitized runtime artifact を生成し、commit SHA / gh version / auth form の種別 / readback result / Step 1 reachability を残してください。

    9. PR 作成後は Step 4 review/fix loop まで完走

    実装・verification が成立したら current canonical route で Draft PR を作成してください。

    既存 PR が live state 上で発見された場合は重複作成せず再利用してください。

    その後:

    • current pr-reviewer
    • current HEAD に対する review
    • REQUEST_CHANGES の fix_delta
    • implementation-worker repair
    • re-test
    • fresh-head re-review
    • required CI
    • mergeability readback

    を current impl-review-loop の max_iterations 内で反復してください。

    REQUEST_CHANGES、通常 test failure、修復可能 CI failure、stale review HEAD は人間停止理由にしないでください。

    reviewed_head_sha と current PR HEAD がずれたら必ず fresh head で再レビューしてください。

    10. 再発防止 Issue

    今回判明した

    test_skill_runtime_exec_anchor.py の stale expectation

    自体は #2872 の直接 scope として修正するため、これだけを理由に別 follow-up Issue を作らないでください。

    一方、作業中に以下のようなより一般的な root cause が確認された場合:

    まず OPEN/CLOSED Issue を検索し dedupe してください。

    既存 Issue が所有していれば reuse/reference し、新規起票しないでください。

    未カバーで、今回の局所 test 修正とは独立した concrete root cause が確認できた場合だけ、root/main thread から current issue-creator SubAgent を使い、repository-native canonical create-issue route で follow-up Issue を起票してください。

    Issue には最低限:

    を含めてください。

    ここでも dispatch だけで終了せず、issue-creator の final result + terminal completion を取得し、実際の Issue URL を readback してください。

    一般論的な security hardening、新 wrapper、approval layer、schema、恒常 gate は、今回の failure class を直接解決しない限り起票しないでください。

    11. 今回追加で承認する通常作業

    #2872 を merge 判断直前まで完遂するため、以下を追加承認します。

    • 実装: Claude-GPT issue-refinement preflight の stale credentialless transport 選択を #2299 の native GitHub auth 契約へ整合する #2872 Issue body の上記 bounded Scope Delta mutation
    • fresh contract re-review
    • existing branch/worktree の再利用
    • current main の non-destructive integration
    • stale regression test expectation の更新
    • AC3 を満たすため必要な上記 bounded test expectation 更新
    • local commits
    • non-force push
    • Draft PR 作成/更新
    • canonical Issue/PR comments
    • focused/full verification
    • AC9 runtime verification
    • CI investigation と修復
    • REQUEST_CHANGES 修正
    • stale-head re-review
    • current Skill が要求する evidence/artifacts
    • concrete recurrent root cause が確認された場合の dedupe 後 follow-up Issue 起票

    iteration ごとの追加承認は求めず、canonical loop を継続してください。

    12. 承認しない操作 / genuine stop

    以下は今回も承認しません。

    今回承認した Scope Delta よりさらに外側の production change が不可避になった場合、irreconcilable contract conflict、canonical max_iterations 到達、runtime evidence integrity 維持不能、destructive operation 必須等の genuine blocker の場合のみ停止してください。

    13. 最終到達点

    merge は実行しない。auto-merge も設定しない。

    current impl-review-loop が人間の merge 判断直前の approved / draft_pr_ready 相当へ到達するまで進めてください。

    最終報告には最低限:

    • final Issue body SHA
    • final Contract Snapshot / review result
    • current main/base SHA
    • reused branch/worktree
    • PR URL / number
    • final PR HEAD SHA
    • main drift の取り込み方法
    • implementation summary
    • Scope Delta の実際の変更内容
    • AC1〜AC9 の結果
    • AC3 の最終実装方式と reviewer 判定
    • test_isolated_anchor_single_authority.py test deletion/restoration の disposition
    • focused test 結果
    • project-wide verification
    • current-main baseline failure と branch regression の切り分け
    • AC9 sanitized runtime evidence / artifact path
    • required CI checks
    • final pr-reviewer verdict / reviewed HEAD
    • live mergeability / mergeStateStatus
    • IMPL_REVIEW_LOOP_RESULT_V1 status / termination_reason / merge_ready
    • iteration 数
    • unresolved blocker
    • follow-up Issue の作成/再利用 URL
    • merge 未実行
    • auto-merge 未設定

    を示してください。

    成功条件は PR を作ることではなく、current contract・current HEAD に対する implementation、独立 verification、AC9 runtime evidence、required CI、fresh PR review が揃い、人間が merge 判断できる直前まで canonical loop が到達していることです。

    再発防止 Issue は現時点では先に新規起票しない方針にしています。今回見つかった out-of-scope test は #2872 の修正そのものに直結しており、まず Scope Delta で閉じるべきです。より一般的な「refinement が関連 regression surface を系統的に取りこぼす」ことまで実証された場合だけ、上の prompt が dedupe 後に issue-creator で起票します。

  7. squne121 commented on Oct 2, 2026

    @squne121
    OwnerAuthor

    Scope Delta 承認(Issue #2872、operator 明示承認に基づく trusted anchor)

    前回の impl-review-loop Step 1 は、scripts/agent-guards/tests/test_skill_runtime_exec_anchor.py::test_contract_update_phase_reaches_fake_transaction_and_fresh_handoff が #2872 実装後の native-gh preflight 契約で fail し、同ファイルが Allowed Paths 外だったため blocked で停止した。operator が interactive session で、この直接 regression surface を #2872 の Scope Delta として取り込むことを明示承認した(承認元: https://github.com/squne121/loop-protocol/issues/2872#issuecomment-5951803901)。

    あわせて AC3 の「選択した transport を全 _fetch_* call site へ一貫して渡す」を文字どおり満たすため、transport=None の default fetcher を含む call site へ explicit threading を行うと、固定 arity の double で patch している既存 3 テストの call expectation が変わる。operator はこの 3 ファイルのみの追加も承認済みである。各テストの期待値更新は production の mutation assertion を弱めない最小変更に限る。

    schema_version: ANCHOR_SCOPE_REFRAME_V1
    target:
      repo: squne121/loop-protocol
      issue_number: 2872
    decision: approve_scope_delta
    allowed_path_deltas:
      - "scripts/agent-guards/tests/test_skill_runtime_exec_anchor.py"
      - ".claude/skills/issue-refinement-loop/tests/test_main_drift_evidence_epoch.py"
      - "scripts/agent-ops/tests/test_evidence_index_preflight_integration.py"
      - ".claude/skills/issue-refinement-loop/tests/test_structural_repair_action_apply_consumer.py"
    rationale: "#2872 の実装で production behavior が変わった結果として壊れる既存 regression test の stale expectation(pre-#2299 の credentialless 前提の fake-gh operation sequence と GH_CONFIG_DIR state、および固定 arity の fetch double)を、production assertion を弱めずに最小更新するため。別 Issue へ分離すると #2872 が既知 regression のまま残る。"
    required_rerun:
      - contract_review
      - refinement_preflight
      - allowed_paths_gate
  8. squne121 commented on Oct 2, 2026

    @squne121
    OwnerAuthor

    root-owned entry router audit

    route: invoke_impl_review_loop
    reason: fresh_review_go_live_equality

  9. added a commit that references this issue on Oct 2, 2026
  10. squne121 commented on Oct 2, 2026

    @squne121
    OwnerAuthor

    root-owned entry router audit

    route: invoke_impl_review_loop
    reason: fresh_review_go_live_equality

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