Repository navigation
Description
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
.claude/skills/issue-refinement-loop/scripts/run_refinement_preflight.py: read-transport selection を 実装: Claude-GPT の GitHub access を compatibility-first に切り替え既存 workflow を安定化する #2299 contract へ整合し、1 invocation 内の全 read 経路で同一 transport を使う。scripts/agent-guards/skill_runtime_exec.py:_sanitize_env()が production preflight の command ID(preflight.run.with_anchor/preflight.run.with_human_context/preflight.run.with_agent_report)の child へ既存のGH_CONFIG_DIRを渡す(実装: preflight.run の GH_CONFIG_DIR を command-scoped に伝播する #2403 が barepreflight.runに対して行った伝播を sibling profile へ揃える)。- 既存 test の旧期待値更新と新規 case 追加(実在パスのみ)、
docs/dev/workflow.mdの stale 説明更新。 - 直接 regression surface の既存 test 1 件(Scope Delta 2、下記): 実装で production behavior が変わる結果として stale になる期待値を最小更新する。
scripts/claude-gpt/launch.sh/lib.shと 実装: Claude-GPT の GitHub access を compatibility-first に切り替え既存 workflow を安定化する #2299 は read-only authority として参照するだけで変更しない。
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 前の ambientGH_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は emptyGH_CONFIG_DIRfixture を保持。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.pyHOME != passwd homeを「GitHub auth 不在」の代理指標として扱わない。通常の production 経路は nativeghを使い、認証解決(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の終了コードを必須ゲートにする独自判定は採用しない。nativeghは 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
- host HOME 全体の共有、SSH/GPG/credential-helper isolation の解除
- GitHub credential の stdout/stderr/transcript/artifact への出力、credential のコピー
- generic GitHub mutation broker・新 wrapper・恒常 approval layer の新設
- launcher(実装: Claude-GPT の GitHub access を compatibility-first に切り替え既存 workflow を安定化する #2299)契約自体の変更
- Auto mode built-in hard deny の削除・置換、
bypassPermissions/--dangerously-skip-permissions、AGY Data Exfiltration hard-deny の迂回 - 認証状態を網羅判定する新機構の新設(上記 In Scope 参照)
- live GitHub 到達を前提とする新しい required CI gate の追加(実装: 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 自体の contract refinement / implementation(live 復旧確認は deferred 条件として 実装: contract snapshot の vc_preflight_classifications transport 上限(16,000 文字)と readiness の VC 上限(40 件)の不整合を解消し、VC が 14 件以上の Issue でも snapshot を materialize できるようにする #2845 側で行い、実装: contract snapshot の vc_preflight_classifications transport 上限(16,000 文字)と readiness の VC 上限(40 件)の不整合を解消し、VC が 14 件以上の Issue でも snapshot を materialize できるようにする #2845 の本文修正・最終承認は本 Issue の完了条件に含めない)
Acceptance Criteria
- AC1: current Claude-GPT launcher-equivalent environment(isolated HOME、GitHub auth capability 利用可能)で
preflight.run.with_human_contextが、HOME 差分だけを理由にSOURCE: credentialless_transportを選ばない。 - AC2:
skill_runtime_exec.py::_sanitize_env()がpreflight.run.with_anchor/preflight.run.with_human_context/preflight.run.with_agent_reportの child へ、親に設定されているGH_CONFIG_DIRを渡す。未設定・空の場合は値を作らず、preflight.run.fixture.*等の fixture lane・非対象 command ID は従来どおりGH_CONFIG_DIRを渡さない。実際の dispatch が_sanitize_env()の結果から child 環境を作る経路で検証する。 - AC3: production preflight の 1 invocation で選択した read transport が、Issue・comments・anchor、およびその invocation 内の全
_fetch_*call site(default fetcher を含む)へ一貫して渡される。認証エラー・rate limit・接続失敗によって取得途中に anonymous transport へ切り替わらない(実装: Claude-GPT issue-refinement preflight の anchor comment 取得を credentialless transport へ統一する #2257 の split-brain regression を再導入しない)。テストは selector の戻り値だけでなく、実 call path での transport 使用(call recording 等)を確認する。 - AC4: genuinely authless な isolated fixture では、credentialless GET-only path を維持する、または current contract が定める構造化
environment_failureを返す。secret 探索(hosts.yml読み取り・keyring 参照・gh auth statusゲート等)や ambient HOME fallback は行わない。 - AC5: HOME isolation・GitHub auth availability・transport selection を独立軸にした network 非依存の focused test が、少なくとも (a) isolated +
GH_TOKEN/GITHUB_TOKEN、(b) isolated + 保存済み認証用GH_CONFIG_DIR(token env 未設定)、(c) isolated + genuinely authless、(d) normal profile、(e) 取得途中の read failure、(f) comments 複数ページ + anchor 解決 を固定する。(a) と (b) は別々の positive case とする。 - AC6: token 値・credential file 内容を test/artifact/log へ出さない sentinel regression を維持する。
- AC7:
run_refinement_preflight.py・関連 test・docs/dev/workflow.mdの「Claude-GPT isolated session は GitHub credential を持たない / credentialless のみで解決する」という 実装: Claude-GPT isolated session の minimum control-plane capability を保証する(uv toolchain resolution + credentialless GitHub read) #2241 時代の stale claim を current 実装: Claude-GPT の GitHub access を compatibility-first に切り替え既存 workflow を安定化する #2299 contract に更新する。 - AC8: new authenticated broker / wrapper / approval layer / 認証状態判定機構を追加せずに解決する。追加が不可避なら Stop Condition として reframe/human review に送る。
- AC9: 実装: contract snapshot の vc_preflight_classifications transport 上限(16,000 文字)と readiness の VC 上限(40 件)の不整合を解消し、VC が 14 件以上の Issue でも snapshot を materialize できるようにする #2845 の target anchor
5942301496に対するpreflight.run.with_human_contextの production child(run_refinement_preflight.py)が、**この PR の候補 revision(検証時点の PR HEAD)**を、isolated HOME と carrier 化したGH_CONFIG_DIR(または token env)の下で、実 GitHub の read のみで実行され、次の 肯定的 success predicate をすべて満たす。(1) 実行 revision のgit rev-parse HEADが期待 PR HEAD と一致し、worktree が clean である。(2) 今回生成された canonicalraw_issue_snapshot.jsonが Issue 実装: contract snapshot の vc_preflight_classifications transport 上限(16,000 文字)と readiness の VC 上限(40 件)の不整合を解消し、VC が 14 件以上の Issue でも snapshot を materialize できるようにする #2845 の snapshot であり、comments が取得済みで、anchor_commentが anchor5942301496に一致して解決されている(stdout の否定条件だけで判定しない)。(3)STATUSが空・malformed でなく、SOURCEがcredentialless_transportでなく、OPERATIONがread_issue/list_issue_comments/read_issue_commentのenvironment_failureでない。(4) anchor 解決後に 実装: contract snapshot の vc_preflight_classifications transport 上限(16,000 文字)と readiness の VC 上限(40 件)の不整合を解消し、VC が 14 件以上の Issue でも snapshot を materialize できるようにする #2845 の contract 上の別 blocker で止まった場合は AC9 の失敗ではなく、transport 修正の検証結果と後続 blocker を分けて報告する(read / anchor failure とは混同しない)。external GitHub outage・到達不能(gh_timeout、rate_limited、upstream_environment_failure、transport_connectivity_failure、および実際の read 結果から確認できる接続障害)と、実環境に GitHub 認証そのものが無い場合は UNAVAILABLE(SKIP、exit 77)であり PASS に昇格しない。gh_exit_errorを一括で UNAVAILABLE にしない。親で利用可能な認証を child へ伝播し損ねた regression(gh_auth_required等)は SKIP でなく FAIL とする。sanitized な実行証跡を保存できなかった場合は PASS にせず「証跡未取得」として失敗扱いにする(コード失敗とは区別して報告する)。 - AC10: Scope Delta 2 の直接 regression surface(
scripts/agent-guards/tests/test_skill_runtime_exec_anchor.pyの当該 test)が、production mutation の assertion を弱めずに native-gh preflight 契約へ更新され pass する。test_isolated_anchor_single_authority.pyの既存 regression coverage は削除されず維持される。 - AC11: AC9 の success / UNAVAILABLE / FAIL 判定が、network 非依存の regression test で固定される。少なくとも次を網羅する: anchor not found、
OPERATION: read_issue_commentの transport/auth failure、空のSTATUS:、target Issue / anchor identity の不一致、gh_timeoutの UNAVAILABLE 分類、gh_exit_errorの非 blanket SKIP、anchor 解決成功後の downstream contract blocker が AC9 失敗にならないこと。success は今回生成された snapshot / result から Issue 実装: contract snapshot の vc_preflight_classifications transport 上限(16,000 文字)と readiness の VC 上限(40 件)の不整合を解消し、VC が 14 件以上の Issue でも snapshot を materialize できるようにする #2845 と anchor5942301496の肯定的解決を確認する(既存のraw_issue_snapshot.jsonのanchor_comment確認パターンを再利用し、新しい verification framework を作らない)。
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 -qAllowed 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
- Allowed Paths 外の変更が必要と判明した場合
- In Scope の固定契約(キー集合・スキーマ・型定義)の変更が必要になった場合
- 新規 Issue の起票が必要と判断した場合(スコープ分割が発生する場合)
- 後続 Phase / 別スコープへの波及が判明した場合
- nested SubAgent delegation が必要になった場合
- 外部サービス利用・権限昇格・既存テスト大規模改変が必要になった場合
- current 実装: Claude-GPT の GitHub access を compatibility-first に切り替え既存 workflow を安定化する #2299 launcher contract 自体の変更が必要になった場合
- host HOME / SSH / GPG / unrelated credential isolation を弱める必要がある場合
- 新しい generic GitHub broker・wrapper・恒常 approval layer・認証状態判定機構が不可避な場合
- credential 値・credential file 内容を child output / artifact / log に出す必要がある場合、または
GH_CONFIG_DIR伝播のために設定内容の読み取りが必要になった場合 _sanitize_env()の変更が production preflight 3 ID 以外(prefix・全 mutation command・全 human-context profile・fixture lane)へ広がる必要がある場合- Auto mode hard-deny の削除、または permission bypass が必要な場合
- unrelated な 実装: contract snapshot の vc_preflight_classifications transport 上限(16,000 文字)と readiness の VC 上限(40 件)の不整合を解消し、VC が 14 件以上の Issue でも snapshot を materialize できるようにする #2845 の contract 変更が必要な場合
Required Skills
なし
Required Design References
- docs/dev/workflow.md(Not Controlled / credentialless GitHub read の節)
- docs/dev/secret-policy.md
- docs/dev/runtime-verification-policy.md
- scripts/claude-gpt/launch.sh / scripts/claude-gpt/lib.sh(実装: Claude-GPT の GitHub access を compatibility-first に切り替え既存 workflow を安定化する #2299、read-only)
- scripts/agent-guards/github_credentialless_read.py(60 req/hour の設計前提)
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
squne121 commentedon Oct 2, 2026
結論
判定は
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 を指定しています。
ところが、現行の
scripts/agent-guards/skill_runtime_exec.py::_sanitize_env()がGH_CONFIG_DIRを保持する command ID には、preflight.runはありますが、次の三つはありません。一方、
GH_TOKENとGITHUB_TOKENは通常の allowlist に含まれています。さらに、実際の dispatch も_sanitize_env(project_root, args.command_id)の結果から子プロセス環境を作っています。これは未使用の helper の問題ではなく、production の受け渡し経路の問題です。反例となる環境は、特殊なものではありません。
GitHub CLI は
GH_CONFIG_DIRが指定されなければ XDG/HOME 側の設定場所を使います。したがって、親で認証できることと、この子プロセスで認証できることは同じではありません。GitHub CLIしかも、既存の次のテストは、上記三つを明示的に 「
GH_CONFIG_DIRを除去すべき command ID」 に分類しています。つまり、古い前提を固定しているテストが、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 が指定する次のパスは、テストの実体と一致しません。
実体はこちらです。
この実ファイルには、isolated profile では
ghを呼んではならない、という旧前提のテストが存在します。したがって、コマンドの誤記だけを直すのでは不十分で、Allowed Paths も同時に修正する必要があります。また、AC7 は関連 test/doc の stale claim 更新を要求していますが、Allowed Paths にドキュメントがありません。
docs/dev/workflow.mdには、isolated なら credentialless を選ぶという説明が残っています。このままだと、実装エージェントは正しい修正対象を発見した時点でスコープ外になり、不要な再精緻化や承認待ちを起こします。
少なくとも、次を契約へ反映すべきです。
後者が今回、特に重要です。既存
_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 の契約修正として優先すべきなのは、次の四点です。
skill_runtime_exec.pyと実在する env allowlist テストをスコープに追加する。新しい 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 を指定しています。
ところが、現行の
scripts/agent-guards/skill_runtime_exec.py::_sanitize_env()がGH_CONFIG_DIRを保持する command ID には、preflight.runはありますが、次の三つはありません。一方、
GH_TOKENとGITHUB_TOKENは通常の allowlist に含まれています。さらに、実際の dispatch も_sanitize_env(project_root, args.command_id)の結果から子プロセス環境を作っています。これは未使用の helper の問題ではなく、production の受け渡し経路の問題です。反例となる環境は、特殊なものではありません。
GitHub CLI は
GH_CONFIG_DIRが指定されなければ XDG/HOME 側の設定場所を使います。したがって、親で認証できることと、この子プロセスで認証できることは同じではありません。GitHub CLIしかも、既存の次のテストは、上記三つを明示的に 「
GH_CONFIG_DIRを除去すべき command ID」 に分類しています。つまり、古い前提を固定しているテストが、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 が指定する次のパスは、テストの実体と一致しません。
実体はこちらです。
この実ファイルには、isolated profile では
ghを呼んではならない、という旧前提のテストが存在します。したがって、コマンドの誤記だけを直すのでは不十分で、Allowed Paths も同時に修正する必要があります。また、AC7 は関連 test/doc の stale claim 更新を要求していますが、Allowed Paths にドキュメントがありません。
docs/dev/workflow.mdには、isolated なら credentialless を選ぶという説明が残っています。このままだと、実装エージェントは正しい修正対象を発見した時点でスコープ外になり、不要な再精緻化や承認待ちを起こします。
少なくとも、次を契約へ反映すべきです。
test_run_refinement_preflight_credentialless_transport.pyscripts/agent-guards/skill_runtime_exec.py…/scripts/tests/test_skill_runtime_exec_env_allowlist.pydocs/dev/workflow.md存在しない旧パスに同名テストを新設して帳尻を合わせるのは避けてください。 既存の本物の回帰テストを直す方が、保守負担も小さくなります。
3. P1:single-authority は「選択関数を変えれば維持される」とは限らない
現行コードには、
run_preflight()で transport を選択した後、Issue 取得で次のように transport を渡さず_fetch_issue()を呼ぶ経路があります。EvidenceIndex 経由の取得にも同じ形があります。そして
_fetch_issue()は、transport が渡されていなければ_select_read_transport()を再実行します。_reset_read_transport_cache()も実キャッシュを制御するものではなく、互換性のために残った no-op です。PR #2260 の説明も、この再選択を「同一プロセス内では HOME 判定が決定的なので authority は変わらない」という前提で正当化しています。同じ transport オブジェクトを全経路へ渡すことと、同じ結果になるはずの判定を繰り返すことは、別です。
ここへ、例えば「
gh auth statusがその時点で成功するか」という可変の判定を入れると、次の問題が生じ得ます。現行コードで既にこの混線が発生したと断定しているわけではありません。 今回、固定的な HOME 判定を認証状態の判定に置き換える際に、既存の前提が崩れるという指摘です。
修正案
AC2 を、次の程度まで具体化するとよいです。
既存の transport 引数を使い、実際の呼び出し箇所で渡す方針が自然です。プロセス全体の永続キャッシュや、新しい authority 管理基盤を作る必要はありません。
テストも「selector が
ghを返した」だけではなく、実際の Issue/comments/anchor 取得が同じ選択結果を使うことを確認すべきです。4. P2:「認証利用可能」の判定を自作すると、別の false failure を作りやすい
#2872 は判定方法を実装時調査に委ねています。それ自体は不合理ではありませんが、避けるべき近道を先に明記した方が、今回の目的に合います。
まず、次の判定は native GitHub CLI と同等ではありません。
GitHub CLI の実装は、環境変数・設定ファイルに加えて keyring も使って active token を解決します。
gh auth loginも、通常はシステムの credential store への保存を試みます。環境変数や平文ファイルだけを調べる独自判定では、正規の認証形態を取りこぼします。GitHubまた、
gh auth statusの終了コードをそのまま必須ゲートにする案にも注意が必要です。gh auth statusが非ゼロなら停止gh auth status --json hostsがゼロなら認証成功これは公式マニュアルだけでなく、
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の不具合を隠せます。最低限、次の二つを別々にしてください。GH_TOKENまたはGITHUB_TOKENGH_CONFIG_DIR、token env は未設定後者が今回、特に重要です。既存
_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 の契約修正として優先すべきなのは、次の四点です。
skill_runtime_exec.pyと実在する env allowlist テストをスコープに追加する。新しい authenticated broker、credential のコピー、HOME 全体の共有、追加の人間承認レイヤーは、この調査で確認した問題を解決するためには必要ありません。
この Issue の価値は「隔離をさらに厳しくすること」ではなく、「既に承認済みの native GitHub access を、既存の workflow が正しく使える状態へ戻すこと」です。 現状のまま着手すると、その修正に必要なファイルがスコープ外になり、また workflow が止まります。そこを先に小さく是正するのが、品質と個人開発の実用性を両立する進め方です。
squne121 commentedon Oct 2, 2026
確認した current main は
2edd52de22230650642c583a4074f06e14193fadで、レビュー時の基準be5c8ad...から進んでいます。ただし current main でも、skill_runtime_exec.pyはpreflight.run.with_human_context等にGH_CONFIG_DIRを渡さず、preflight 側も isolatedHOMEだけで 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 の迂回は行わないでください。最初に current state を fresh に固定してください。現在の
mainHEAD、Issue 実装: Claude-GPT issue-refinement preflight の stale credentialless transport 選択を #2299 の native GitHub auth 契約へ整合する #2872 本文と全コメント、指定 comment5950471698、関連 Issue/PR、現在のissue-refinement-loopSkill と必要な references/scripts、CLAUDE.md、関連 SSOT を読み直してください。指定レビューが調査した時点の main はbe5c8ad3cdc24306e2e2e61e0b4db888d63e39f5ですが、これを current authority と仮定しないでください。こちらで事前確認した current main は2edd52de22230650642c583a4074f06e14193fadでしたが、実行開始時に必ず再取得してください。既存 PR/branch が存在すれば重複作成せず current state を利用してください。Issue refinement 自体では production implementation、実装 PR 作成、merge は行わないでください。この invocation では、ユーザーが指定した comment を operator-selected human context として扱ってください。GitHub
author_associationだけから human origin を推定するのではなく、current Skill の Accepted Trust Model に従い、canonical privileged profilepreflight.run.with_human_contextを使ってください。preflight.run.with_agent_reportや unlabeledpreflight.run.with_anchorへ置き換えないでください。URL・repo・Issue binding を検証し、current command registry / executor を使い、run_refinement_preflight.pyを production path から直接迂回呼び出ししないでください。Step 1 の repository investigation では current
codebase-investigatorSubAgent を適切に使用してください。特にレビューコメントが指摘している 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 規則に従い、成功を捏造しないでください。external claim が current refinement decision に影響する場合は current Skill の Step 1b routing に従って
web-researcherSubAgent を使用してください。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 に拡張しないでください。指定 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 に従ってください。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 として currentissue-editor/edit-issuecontrolled transaction route へ handoff し、完全な body rewrite を実施してください。同じ mutation command の no-progress 再試行や rawgh issue editへの迂回は禁止です。SubAgent/handoff が発生した場合も final result と readback が完了するまで待ってください。mutation 後は fresh Issue body readback、fresh preflight、fresh Step 2 review、fresh readiness を実行してください。review/fix loop は current
issue-refinement-loopの deterministic routing をそのまま consume してください。planner/reviewer 判定を prose で再実装しないでください。current defaultmax_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 内で修復・再取得してください。再発防止については、今回の 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 を明記してください。最後は 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 の責務分離に合います。squne121 commentedon Oct 2, 2026
Contract Review Result
squne121 commentedon Oct 2, 2026
issue-refinement-loop: approved で終了(Issue #2872)
終了理由は
approvedです。この invocation は refinement だけを行い、impl-review-loopの起動、implementation worker、production code の変更、実装 branch や PR の作成、merge は行っていません。approvedは実装開始の代替承認ではありません。2edd52de22230650642c583a4074f06e14193fad(実行開始時に再取得。指摘コメントの調査基準be5c8ad3とは異なる)preflight.run.with_human_contextlane、REQUEST_CHANGES)blockedを返し、section-bound patch の入力がなかったため、承認済みのissue-editor/edit-issuecontrolled transaction で full body rewrite を行った。body_sha256: sha256:780eef0d1de026da4025466e4f86ac1e02f3c92211ba1e902a8147df53cbdc63(readback で candidate と一致を確認)主要 finding の disposition
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 とした。.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)も必要時のみ最小更新として許可した。_fetch_issue等が transport 未指定で再選択する call site が複数残る。AC3 として、実 call path での一貫性と、取得途中の anonymous 切替禁止を追加した。GH_TOKEN有無、hosts.yml、gh auth statusの終了コードを必須ゲートにしない方針を In Scope と AC4 / AC8 に明記した。GH_CONFIG_DIRを別々の positive case とすること、isolated+authenticated / isolated+authless / normal profile を独立軸とすること: AC5 に反映した。github_livemarker 付き単独選択の VC とし、exit 77 を PASS に昇格させない。実装: contract snapshot の vc_preflight_classifications transport 上限(16,000 文字)と readiness の VC 上限(40 件)の不整合を解消し、VC が 14 件以上の Issue でも snapshot を materialize できるようにする #2845 の contract refinement 完了は完了条件に含めない。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 が決定でき、本文は認証の有無を判定する新機構を作らず nativeghに委ねる設計としたため、外部 claim が dispositive にならなかった。semantic_review_applicable: false(明示シグナルなし)のためスキップした。検証結果
STATUS: pass/NEXT_ACTION: proceed。go。vc_preflight: pass、readiness: go、declared_path_overlapは OPEN PR と重複なし。$ cmdと bare な# ACn)と runtime 必須フィールドの違反を解消してから適用した。注記
scope_rollup.run)、実装: scope_rollup.run のGitHub認証carrierをchild ghへcommand-scopedに維持する #2611 が既に解決済みで、script 側でGH_CONFIG_DIRを扱っている。squne121 commentedon Oct 2, 2026
live GitHub と current repository 契約を確認しました。現時点では Issue #2872 の refinement は approved、Final Gate は
go、残 blocker なし、#2872 を参照する既存 PR は未検出です。contract snapshot は comment5950909121、refinement 終了報告は5950916600、確認時 main は2edd52de22230650642c583a4074f06e14193fadです。ただし Claude Code 側では開始時に必ず fresh 再取得させます。推奨は、既定
max_iterations=3を変えず currentimpl-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 を再取得してください。
必ず確認するもの:
mainHEADissue-contract-reviewresult.claude/skills/impl-review-loop/SKILL.mdsteps/preparation.mdsteps/step-1-implementation.mdsteps/step-2-verification.mdsteps/step-4-pr-review.mdsteps/step-5-feedback-and-termination.mdsteps/step-5-mergeability-handling.mdsteps/conflicting-pr-escalation-runbook.mdsteps/context-protocol-and-guardrails.md.claude/agents/implementation-worker.md.claude/agents/test-runner.md.claude/agents/pr-reviewer.md.claude/agents/issue-creator.mdCLAUDE.md.claude/rules/project-constitution.mddocs/dev/workflow.mddocs/dev/runtime-verification-policy.md事前確認時点では以下だったが、stale なら必ず live 値を優先すること:
2edd52de22230650642c583a4074f06e14193fadsha256:780eef0d1de026da4025466e4f86ac1e02f3c92211ba1e902a8147df53cbdc63実装: Claude-GPT issue-refinement preflight の stale credentialless transport 選択を #2299 の native GitHub auth 契約へ整合する #2872 (comment)
実装: Claude-GPT issue-refinement preflight の stale credentialless transport 選択を #2299 の native GitHub auth 契約へ整合する #2872 (comment)
既存 PR / branch / worktree が見つかり、current Skill の landing disposition / existing PR resume 規則上再利用可能なら、新規 PR を重複作成せず再利用してください。
1. ユーザー承認の範囲
current Issue #2872 の完遂に必要な、canonical workflow 内の以下の通常作業を、人間の iteration ごとの追加承認なしで進めることを明示的に承認します。
ただし以下は承認しません。必要になった場合は停止して具体的理由を報告してください。
git push --force/--force-with-leasebypassPermissions--dangerously-skip-permissionsauto 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 で:
issue-contract-reviewまで行ってください。
過去の 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 に従い:
implementation-workertest-runnerpr-reviewerを使用してください。
必要なら:
issue-creatorも使用してください。
SubAgent completion の必須条件
SubAgent を dispatch しただけで完了扱いしないこと。
各 dispatch で current Common Completion Protocol に従い:
wait_agent等は途中待機にのみ使うcompletedであることを確認としてください。
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.pyHOMEであることだけを「GitHub auth 不在」の proxy にしないghの credential resolution に委ねるGH_TOKEN/hosts.yml/gh auth status等を使う新しい独自 auth detection gate を作らないscripts/agent-guards/skill_runtime_exec.pyGH_CONFIG_DIRを正規に伝播するfocused regression tests
GH_CONFIG_DIR/ token env なし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を完遂してください。
通常の以下は停止理由ではありません:
-修正可能な CI failure
BEHINDREQUEST_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 typecheckpnpm lintpnpm testpnpm builduv 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 anchor5942301496に対する productionpreflight.run.with_human_context相当の canonical path を検証してください。検証対象:
rate_limited / credentialless_transport / read_issueの environment_failure にならないghversioncredential/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 を直接確認し、currentroute_loop_verdict_v2()に渡してください。APPROVEだけで完了扱いしないでください。終了条件は current Skill の
approvedroute、すなわち current contract が要求する:ことです。
BEHINDは actual conflict と同一視せず、current route がroute_to_update_branchを返すなら canonical worker へ委譲して update → reverify → rereview してください。reviewed_head_shastale なら 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-creatorSubAgent を使ってcreate-issueの canonical route で GitHub Issue を起票してください。起票時は:
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 の場合に限定してください。例:
max_iterations到達HUMAN_REVIEW_REQUIREDSubAgent が単に
human_review_required: trueを自己申告しただけの場合は、それ自体を即停止 authority にせず、currentimpl-review-loopの #1860 routing rules に従ってください。11. 最終到達点
merge は実行しないでください。auto-merge も設定しないでください。
current Skill の approved route に到達したら、人間が merge 判断できる直前で停止してください。
最終報告には最低限:
pr-reviewerverdict と reviewed HEADIMPL_REVIEW_LOOP_RESULT_V1の status / termination_reason / merge_readyを示してください。
成功条件は「コードを書いた」「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 を必須にした点が重要です。squne121 commentedon Oct 2, 2026
推奨アクションは #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、両者は共通 base2edd52de…から各1 commit ずつ diverge、#2872 の PR はまだありません。したがって branch を捨てず、current main を非破壊的に取り込む前提にしています。repo
squne121/loop-protocolの Issue #2872#2872
について、前回
impl-review-loopStep 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 を再取得してください。
最低限確認するもの:
mainHEAD.claude/skills/impl-review-loop/SKILL.mdと必要な steps/references/scripts.claude/skills/issue-refinement-loop/SKILL.mdと今回の contract-refinement recovery に必要な references/scripts.claude/agents/implementation-worker.md.claude/agents/test-runner.md.claude/agents/pr-reviewer.md.claude/agents/issue-creator.mdCLAUDE.md.claude/rules/project-constitution.mddocs/dev/workflow.mddocs/dev/runtime-verification-policy.mdこの prompt 作成直前の観測値は:
3f7b0addbe09b21c03872755b1fd3092cd807044worktree-issue-2872-refinement-preflight-native-gh-transport7ae45349fddb2f7c5e55679e098f75e42dc59ea5.claude/worktrees/issue-2872-refinement-preflight-native-gh-transport2edd52de22230650642c583a4074f06e14193fadから各 1 commit ずつ divergeただし開始時の 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 が引き続き支持するなら:
scripts/agent-guards/tests/test_skill_runtime_exec_anchor.pyを Allowed Paths に追加する
GH_CONFIG_DIRstate expectation を、production mutation assertions を弱めずに更新することを承認します。
この 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.pyscripts/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 を更新したら:
issue-contract-reviewを fresh 実行status: goと current body/base の一致を確認してください。
古い Contract Snapshot
5950909121や refinement completion5950916600を authorization packet として再利用しないでください。contract body が変わる以上、fresh review が必須です。
Issue contract mutation は current
issue-refinement-loopの controlled route を使用し、rawgh 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 を無条件に正しいとは扱わず:
に対して再評価してください。
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 を許可したら、currentimplementation-workerを再度使用してください。SubAgent message には暗黙 context に依存せず、少なくとも:
を具体値で渡してください。
SubAgent completion は dispatch だけで済ませない
すべての SubAgent について:
としてください。
wait_agenttimeout、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 の要求が:
を含む全 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 で:
を確認してください。
必要なら current Allowed Paths 内で削除ではなく修正・拡張してください。
7. Step 2 は test-runner で独立検証
implementation-worker 完了後は必ず current
test-runnerを使用し、worker の自己申告を verification authority にしないでください。最低限:
pnpm typecheckpnpm lintpnpm testpnpm builduv run pytest .claude/skills/gemini-cli-headless-delegation/tests/test_model_routing.pyを実行してください。
前回 broad pytest では 15 failures、うち blocker 1件以外は main でも再現すると worker が報告していますが、その自己申告を authority にしないでください。
current main と PR/branch HEAD の双方で必要な最小 reproduction を行い、
を独立に分類してください。
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について実証してください。必須性質:
rate_limited / credentialless_transport / read_issueで停止しない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 上で発見された場合は重複作成せず再利用してください。
その後:
pr-reviewerimplementation-workerrepairを 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-creatorSubAgent を使い、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 判断直前まで完遂するため、以下を追加承認します。
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 相当へ到達するまで進めてください。最終報告には最低限:
test_isolated_anchor_single_authority.pytest deletion/restoration の dispositionpr-reviewerverdict / reviewed HEADIMPL_REVIEW_LOOP_RESULT_V1status / termination_reason / merge_readyを示してください。
成功条件は 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で起票します。squne121 commentedon Oct 2, 2026
Scope Delta 承認(Issue #2872、operator 明示承認に基づく trusted anchor)
前回の
impl-review-loopStep 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 を弱めない最小変更に限る。squne121 commentedon Oct 2, 2026
root-owned entry router audit
route: invoke_impl_review_loop
reason: fresh_review_go_live_equality
test: #2872 anchor test の stale 期待を native-gh 契約へ更新し command-graph 回帰…
squne121 commentedon Oct 2, 2026
root-owned entry router audit
route: invoke_impl_review_loop
reason: fresh_review_go_live_equality
fix: AC9 live 検証の判定を肯定的 evidence 束縛へ修正し native gh の障害分類を整合する (#2872)
fix: Claude-GPT issue-refinement preflight の read transport を #2299 の…