Repository navigation
Description
Machine-Readable Contract
contract_schema_version: v1
issue_kind: implementation
parent_issue: "none"
goal_ref: "claude-gpt live causal-evidence test の可用性判定 helper を、#2925 / PR #2932 後の CLAUDE_GPT_LAUNCH_RESULT_V1 に合わせ、恒久 SKIP による coverage の silent 喪失を解消する"
change_kind: code
dedupe_key: "claude-gpt:live-causal-evidence-availability-launch-result-v1:v1"Parent Issue
なし
Parent Goal Ref
- Goal: 実装: Claude-GPT launcher を upstream minimal client contract へ縮退し、launcher-owned isolation/policy 層を撤去する #2925 で縮退した launcher の current 出力 contract(
CLAUDE_GPT_LAUNCH_RESULT_V1)に、live causal-evidence test の環境可用性判定を整合させる。 - Desired Destination: 単独改善のため parent はない。
Current Validated Scope
次は current main dfc2972 で rg / Read により確認済みの事実である(実装着手時に再確認する)。
scripts/agent-ops/tests/test_run_worktree_agent_runtime_smoke_claude_gpt_live_causal_evidence.pyの_claude_gpt_available()(75-101 行付近)はsh scripts/claude-gpt/preflight.shの stdout JSON にpayload.get("exit_code") != 0/payload.get("binary_available")/payload["proxy"]["absolute_path"]/payload["chatgpt_auth"]["available"]を要求する。- 実装: Claude-GPT launcher を upstream minimal client contract へ縮退し、launcher-owned isolation/policy 層を撤去する #2925 / PR refactor: Claude-GPT launcher を upstream minimal client contract へ縮退し、launcher-owned isolation/policy 層を撤去する #2932 後の
preflight.sh(引数なし)はlaunch.sh --check-onlyを exec し、CLAUDE_GPT_LAUNCH_RESULT_V1(schema/status: ok/mode: check_only/connected_server/local_proxy_binary_auxiliary/launch_env)を返す。exit_code/binary_available/proxy/chatgpt_authを持たない。接続先 server の診断失敗時は exit 7 と failure JSON(schema/status: failed/reason/cause)を返す。check-only の成功経路は claude binary を要求せず、接続先はANTHROPIC_BASE_URL(loopback)で決まる。 - fix: Claude-GPT launcher の loopback 判定を厳密化し、runner help の旧 hook 記述を現在の挙動へ合わせる #2945(
launch.shの loopback 判定厳密化)は merge 済みだがCLAUDE_GPT_LAUNCH_RESULT_V1の shape を変えていない。 - 結果として
_claude_gpt_available()は常に(False, ...)を返し、同 file のtest_ac1_claude_gpt_positive_hook_correlated(218 行付近のpytest.skip)は恒久的に SKIP される。false PASS ではなく coverage の silent 喪失である。 - 同 file の既存 test 関数は
test_ac1_からtest_ac5_である。新規 test は、既存 file に新規 test node-id を置く VC が baseline で canonical 外(existing_file_missing_node_id_noncanonical、実装: VC baseline-fail 用 pytest command を canonical form に正規化して contract-review 往復を削減する #1285 / feat: VC baseline-fail pytest command を canonical form に正規化する compiler を追加 #1305)と判定されるため、同 directory の新規 test filescripts/agent-ops/tests/test_claude_gpt_availability_launch_result_v1.pyにtest_availability_prefix で追加し、helper 本体の変更だけを既存 file に置く。新規 file は.github/ci/python-test-plan.jsonのscripts/agent-ops/tests/directory target に含まれる。 scripts/claude-gpt/tests/_launcher_harness.pyはFakeServer(models/models_status/raw_models_bodyを受け取る local loopback server)、closed_port()、base_env()を持ち、REQUIRED_MODELS = ("gpt-6-sol", "gpt-6-luna")の compatible catalog を返せる。read-only で再利用でき、変更は不要である。- write-capable に扱う範囲は、既存 test file 1 件(helper 本体)と新規 test file 1 件(
scripts/agent-ops/tests/test_claude_gpt_availability_launch_result_v1.py)のみ。 - dedupe: open + closed Issue を
preflight.sh/proxy.absolute_path/ 当該 test 名で検索し、所有 Issue は 実装: claude-gpt live causal-evidence test の可用性判定を current CLAUDE_GPT_LAUNCH_RESULT_V1 に合わせる #2950 のみ(実装: Claude-GPT launcher 縮退(#2925)で撤去された surface を参照している Allowed Paths 外の consumer と文書を更新する #2938 は別 surface)。
Remaining Parent Gaps
- なし。claude-gpt live causal-evidence test 自体(AC1 の live 実行)を実環境で PASS させる運用は本 Issue の範囲外で、可用な環境で既存 test が SKIP されず実行されることのみを担保する。
Background
発見元は #2938 の refinement で、#2925 / PR #2932 の取りこぼしである。#2938 #2943 #2843 #2949 #2939 は別 surface を所有し、本 Issue はそれらを再実装しない(参照のみ、dependency は作らない)。#2949 は auto_mode_canary の --auto-mode-check readback で別物。
scripts/agent-ops/tests/test_run_worktree_agent_runtime_smoke_claude_gpt_live_causal_evidence.py は #2231 の skip_conditions に基づく live-environment preflight helper を持つ。#2925 は launcher が proxy server の所有者の責務である ChatGPT 認証や proxy binary を判定しない設計に縮退したため、旧 shape 前提の本 helper だけが取り残された。local_proxy_binary_auxiliary は補助情報であり authority ではない。
upstream claude-code-proxy の公式仕様でも、client 側の Minimal client contract(ANTHROPIC_BASE_URL / dummy ANTHROPIC_AUTH_TOKEN / model 設定)は server 側設定と分離され、/healthz は provider credential や upstream availability を検証しない(liveness のみ)。/v1/models は model discovery であり ChatGPT inference の可用性証明ではない。したがって本 helper は connected-server readiness / model catalog の確認までを担い、chatgpt_auth probe や local proxy binary を authority に戻さない。end-to-end の実 capability 不足は既存 _run_smoke() が runner の EXIT_SKIP を pytest.skip() に変換する downstream 経路に残す。
Outcome
scripts/agent-ops/tests/test_run_worktree_agent_runtime_smoke_claude_gpt_live_causal_evidence.py の _claude_gpt_available() が、current CLAUDE_GPT_LAUNCH_RESULT_V1 に exact に bind した次の条件だけを可用判定の根拠とするよう更新されている。
- preflight の exit code が 0
- stdout の top-level JSON value が object で
schema == "CLAUDE_GPT_LAUNCH_RESULT_V1" status == "ok"かつmode == "check_only"connected_serverが object でconnected_server.reachable is Trueかつconnected_server.model_catalog_ok is True
さらに、新規 test file scripts/agent-ops/tests/test_claude_gpt_availability_launch_result_v1.py に、fixture receipt / poison fixture に対する focused pytest と、実 scripts/claude-gpt/preflight.sh を local loopback fake server に対して実行する正常系 / 異常系の runtime test が追加されている。完了条件は下記 AC の VC がすべて満たされることである。
Runtime Verification Applicability
docs/dev/extension-surface-runtime-policy.yaml の evaluator(evaluate_allowed_paths)を本 Issue の Allowed Paths で fresh 実行した結果、scripts/agent-ops/** が subagent-lifecycle-start-stop-delegation-fallback rule の hard selector に一致し、evaluator の最終判定が immediate となった。そのため immediate として記述する。docs/dev/runtime-verification-policy.md は immediate に対し正常系 1 件以上・異常系 1 件以上を要求するため、AC5 を正常系、AC6 を異常系の runtime AC とする。
decision: immediate
reason: "Allowed Paths の scripts/agent-ops/** が subagent-lifecycle rule の hard selector に一致し evaluator の final_decision が immediate。本 Issue が変更するのは test helper の可用性判定であり SubAgent の start/stop / delegation は変更しない。runtime-verification-policy の immediate 要件(正常系 1 件以上・異常系 1 件以上)を、real preflight.sh を local loopback fake server に対して実行する AC5(正常系)と AC6(異常系)で満たす。"
applicable_acs: [AC5, AC6]
runtime_assertion_bindings:
- profile: subagent-lifecycle-causal-evidence-smoke
assertion: subagent_start_stop_causal_evidence_correlated
disposition: not_applicable
reason: "SubAgent の start/stop や delegation 挙動は変更しない。変更するのは live test の環境可用性判定 helper のみである"
execution_environment: "Current developer machine。sh と scripts/claude-gpt/preflight.sh が実行でき、127.0.0.1 の loopback socket を bind できること。正常系は scripts/claude-gpt/tests/_launcher_harness.py の FakeServer(compatible な /v1/models catalog を返す local loopback server)を ANTHROPIC_BASE_URL に向けて real preflight.sh を実行する。実 proxy server・外部 ChatGPT inference・実認証は要求しない。"
skip_conditions: "sh が存在しない、または loopback socket を bind できず local fake server を起動できない場合のみ SKIP。SKIP は PASS ではなく、Stop Conditions の runtime SKIP escalation に従う。helper が OSError を (False, reason) に変換した結果を AC5 / AC6 の PASS 根拠にしない。"
fallback_policy: "preflight.sh の receipt を解釈できない場合(非 JSON、top-level が object でない、schema 不一致、connected_server が object でない等)は例外にせず False と理由を返す(可用扱いにしない)。旧 shape を可用扱いにする fallback は置かない。"
artifact_requirements: "tested HEAD、正常系・異常系それぞれの実 preflight.sh の exit code と receipt の status、helper の返り値(bool と reason)。secret / token は記録しない。"In Scope
_claude_gpt_available()から、receipt を解釈する pure な判定部を切り出し(例: preflight の exit code と stdout 文字列を受け取って(bool, reason)を返す関数)、subprocess 実行部と分離する。subprocess 実行部は、test が env(ANTHROPIC_BASE_URL等)を注入して realpreflight.shを実行できるようにする。- 判定を exit code 0 / top-level JSON object /
schema == "CLAUDE_GPT_LAUNCH_RESULT_V1"/status == "ok"/mode == "check_only"/connected_serverが object /connected_server.reachable is True/connected_server.model_catalog_ok is Trueに置き換える。失敗時は status / exit code / classification など public-safe な理由を返し、例外を送出しない。既存 schema に fail-closed で bind するだけで、新 schema は追加しない。 - 旧 shape の判定(
payload.get("exit_code")/payload.get("binary_available")/proxy.get("absolute_path")/chatgpt_auth.get("available"))を 4 つとも撤去し、supplemental fallback としても残さない。 - 新規 test file
scripts/agent-ops/tests/test_claude_gpt_availability_launch_result_v1.pyに、fixture receipt / poison fixture に対する focused pytest を追加する(既存 file の helper をimportlib.util.spec_from_file_locationで一意名を付けて読み込んで検証する)(可用 receipt、status: failedと exit 7、旧 shape、下記 poison fixture)。 - real
preflight.shを local loopback fake server に対して実行する runtime test を追加する。正常系: compatible catalog のFakeServer→ preflight exit 0 →CLAUDE_GPT_LAUNCH_RESULT_V1success receipt → helper True。異常系: closed port または incomplete catalog → preflight exit 7 /status: failed→ helper が理由付き False。scripts/claude-gpt/tests/_launcher_harness.pyは read-only で再利用し(bare import ではなくimportlib.util.spec_from_file_locationで一意名を付けて読み込む)、新しい恒久 harness は作らない。
poison fixture(判定関数は例外ではなく理由付き False を返す): wrong schema、missing schema、top-level []、top-level null、top-level scalar / string、connected_server が scalar / non-object、malformed / non-JSON、reachable が false、model_catalog_ok が false、wrong mode、status: ok だが exit code が 0 以外。
Out of Scope
- ChatGPT 認証・proxy binary の有無の判定(
local_proxy_binary_auxiliaryは非 authority)。 - 新 harness / 新 schema / 新 daemon / live ChatGPT 実行 / 実 proxy への依存の追加。
scripts/claude-gpt/**の変更、scripts/agent-ops/**のうち Allowed Paths 2 件以外の変更(_launcher_harness.pyの変更を含む)、docs の変更。- 他 file の
_claude_gpt_available類似 helper の変更(見つかった場合は follow-up Issue)。
Acceptance Criteria
- AC1:
schema: CLAUDE_GPT_LAUNCH_RESULT_V1/status: ok/mode: check_only/connected_server.reachable: true/connected_server.model_catalog_ok: trueの receipt(exit 0)に対し、判定関数が True を返す。 - AC2:
status: failedの receipt(exit 7)に対し、判定関数が False と status / exit code を含む理由を返す。 - AC3: 旧 shape の payload(
exit_code: 0/binary_available: true/proxy.absolute_path/chatgpt_auth.available: trueのみでschema/statusを持たない)に対し、判定関数が False を返す。 - AC4: 次の各入力に対し、判定関数が例外を送出せず False と理由を返す: wrong schema、missing schema、top-level
[]/null/ scalar / string、connected_serverが non-object、malformed / non-JSON、reachablefalse、model_catalog_okfalse、wrongmode、status: okかつ exit code 0 以外。 - AC5: 正常系: real
scripts/claude-gpt/preflight.shを compatible な/v1/modelscatalog を返す local loopbackFakeServerにANTHROPIC_BASE_URLを向けて実行すると、preflight が exit 0 かつCLAUDE_GPT_LAUNCH_RESULT_V1の success receipt(status: ok/mode: check_only)を返し、helper が True を返す。test は preflight の exit 0 と receipt を helper の返り値とは独立に assert する。 - AC6: 異常系: real
preflight.shを closed port、および incomplete model catalog のFakeServerに向けて実行すると、preflight が exit 7 かつstatus: failedの receipt を返し、helper が preflight の status / exit code を含む理由付き False を返す。helper が preflight の起動失敗(OSError / timeout)を False に変換しただけの結果は AC6 の成立に数えない。 - AC7: helper の本体から旧 shape の accessor 4 つ(
payload.get("exit_code")/payload.get("binary_available")/proxy.get("absolute_path")/chatgpt_auth.get("available"))がすべて除去されている。 - AC8: 既存 test file の既存 test が引き続き collect できる。lint(
ruff check)は VC preflight allowlist 外のため VC には含めず、CI の ruff_check lane で検証する。
Verification Commands
# AC1
$ uv run --locked pytest scripts/agent-ops/tests/test_claude_gpt_availability_launch_result_v1.py::test_availability_receipt_ok_returns_true
# AC2
$ uv run --locked pytest scripts/agent-ops/tests/test_claude_gpt_availability_launch_result_v1.py::test_availability_failed_exit7_returns_false_with_reason
# AC3
$ uv run --locked pytest scripts/agent-ops/tests/test_claude_gpt_availability_launch_result_v1.py::test_availability_legacy_shape_returns_false
# AC4
$ uv run --locked pytest scripts/agent-ops/tests/test_claude_gpt_availability_launch_result_v1.py::test_availability_invalid_receipt_shape_returns_false
# AC5
$ uv run --locked pytest scripts/agent-ops/tests/test_claude_gpt_availability_launch_result_v1.py::test_availability_real_preflight_loopback_success_returns_true
# AC6
$ uv run --locked pytest scripts/agent-ops/tests/test_claude_gpt_availability_launch_result_v1.py::test_availability_real_preflight_failure_returns_false
# AC7
$ rg --files-without-match --fixed-strings -e 'payload.get("exit_code")' scripts/agent-ops/tests/test_run_worktree_agent_runtime_smoke_claude_gpt_live_causal_evidence.py
# AC7
$ rg --files-without-match --fixed-strings -e 'payload.get("binary_available")' scripts/agent-ops/tests/test_run_worktree_agent_runtime_smoke_claude_gpt_live_causal_evidence.py
# AC7
$ rg --files-without-match --fixed-strings -e 'proxy.get("absolute_path")' scripts/agent-ops/tests/test_run_worktree_agent_runtime_smoke_claude_gpt_live_causal_evidence.py
# AC7
$ rg --files-without-match --fixed-strings -e 'chatgpt_auth.get("available")' scripts/agent-ops/tests/test_run_worktree_agent_runtime_smoke_claude_gpt_live_causal_evidence.py
# AC8
$ uv run --locked pytest --collect-only -q scripts/agent-ops/tests/test_run_worktree_agent_runtime_smoke_claude_gpt_live_causal_evidence.py未作成の test 名を参照する VC は baseline で exit 4(expected_fail)、実装後に exit 0 となる。AC5 / AC6 の runtime VC は SKIP(exit 5 相当を含む)を PASS として扱わない。negative assertion は rg --files-without-match --fixed-strings(1 command = 1 file)で書き、literal が残れば exit 1、除去済みなら exit 0 とする。
Allowed Paths
- scripts/agent-ops/tests/test_run_worktree_agent_runtime_smoke_claude_gpt_live_causal_evidence.py
- scripts/agent-ops/tests/test_claude_gpt_availability_launch_result_v1.py
Stop Conditions
- Allowed Paths 外の変更が必要と判明した場合(
scripts/claude-gpt/tests/_launcher_harness.pyの変更が必要な場合を含む) - In Scope の固定契約(キー集合・スキーマ・型定義)の変更が必要になった場合
- 新規 Issue の起票が必要と判断した場合(スコープ分割が発生する場合)
- 後続 Phase / 別スコープへの波及が判明した場合
- nested SubAgent delegation が必要になった場合
- 外部サービス利用・権限昇格・既存テスト大規模改変が必要になった場合
- current main の
preflight.shの receipt が上記 Current Validated Scope の shape から変わっていた場合 scripts/claude-gpt/**の変更が必要になった場合- AC5 / AC6 の runtime VC が SKIP した場合(
sh不在や loopback bind 不能を含む)。SKIP は PASS ではなく、runtime-verification-policy の SKIP 規約に従い stop_condition として human escalation する - compatible catalog の local fake server に対して real
preflight.shが exit 0 / success receipt を返さない場合(launcher 側の変更は本 Issue の範囲外のため stop する)
Required Skills
なし
Required Design References
- docs/dev/extension-surface-runtime-policy.yaml
- docs/dev/runtime-verification-policy.md
- scripts/claude-gpt/preflight.sh
- scripts/claude-gpt/tests/_launcher_harness.py
Delivery Rule
1 Issue = 1 PR、専用 worktree で実装し、Draft PR を既定とする。- 依存 Issue は作らない(実装: Claude-GPT launcher を upstream minimal client contract へ縮退し、launcher-owned isolation/policy 層を撤去する #2925 / 実装: Claude-GPT launcher 縮退(#2925)で撤去された surface を参照している Allowed Paths 外の consumer と文書を更新する #2938 は参照のみ)。
Activity
squne121 commentedon Oct 5, 2026
判定
REQUEST_CHANGES 相当です。 #2950 の問題設定とスコープ分離は妥当ですが、現状の contract には P1 1件、P2 2件あります。実装そのものは target test file 1件で完結でき、launcher や新しい恒久 harness を増やす必要はありません。
Findings
P1 — AC5 は current policy 上、runtime 正常系を証明できない
#2950 は
scripts/agent-ops/**の hard selector によりRuntime Verification Applicability: immediateとしています。この判定自体は currentextension-surface-runtime-policy.yamlと整合しています。しかし current
runtime-verification-policy.mdはimmediateに対して 正常系 ≥1 と異常系 ≥1 を要求しています。一方 #2950 の AC5 は、だけで、さらに
execution_environmentでは proxy server が起動していなくてもよい としています。したがって実装が例えば、
preflight.sh→ exit 7 /status: failed(False, reason)となっても AC5 を満たせます。これは runtime の異常系しか実行していません。
さらに
skip_conditionsではsh/preflight.sh実行不能を SKIP としていますが、Issue の Stop Conditions に current policy が要求する runtime VC SKIP → escalation がありません。実装次第では_claude_gpt_available()が OSError を(False, reason)に変換した結果、それすら「整合した False」として AC5 が通る余地があります。最小修正は外部 ChatGPT や live proxy を要求することではありません。既存
scripts/claude-gpt/tests/_launcher_harness.pyの localFakeServer相当を再利用し、target file 内から realpreflight.shを実行すれば十分です。AC5 を少なくとも「compatible local model catalog → real preflight exit 0 → current receipt → helper True」と「closed port または incomplete catalog → exit 7 → helper False」の2経路にしてください。
sh自体が無い等の場合だけ SKIP にし、その SKIP を Stop Condition に追加するのが repository-native です。P2 —
CLAUDE_GPT_LAUNCH_RESULT_V1を名乗ること自体を確認していないcurrent main の success receipt は明確に、
schema: CLAUDE_GPT_LAUNCH_RESULT_V1status: okmode: check_onlyconnected_server.reachable: trueconnected_server.model_catalog_ok: trueです。ところが #2950 の Outcome / AC1–AC4 は
schemaを判定条件に含めていません。そのため例えば別 schema でも
status=ok, mode=check_only, reachable=true, model_catalog_ok=trueなら True にできてしまいます。「current
CLAUDE_GPT_LAUNCH_RESULT_V1に合わせる」という Issue goal と一致しません。また AC4 は「非 JSON」は扱いますが、JSON として valid だが shape が不正なケースがありません。典型的な
.get()実装では[]、null、"foo"、あるいは"connected_server": "foo"で例外になります。これはfallback_policyの「receipt を解釈できなければ False と理由」に反します。既存 schema を増やす話ではなく、既存 schema に fail-closed で bind するだけです。wrong/missing schema、top-level non-object、
connected_servernon-object を AC4 fixture に加えるのが適切です。P2 — bug の原因だった旧
exit_codedependency が VC の盲点Current Validated Scope / In Scope は旧 shape として
exit_code/binary_available/proxy.absolute_path/chatgpt_auth.availableを明示し、それらによる判定を撤去するとしています。
ところが AC6 と Verification Commands が negative-check するのは後ろ3つだけで、
payload.get("exit_code")が抜けています。例えば新条件を追加しつつ、
のような stale dependency を残しても、AC1–AC5と現在のAC6 VCをすべて通せます。今回の Issue はまさに producer/consumer shape divergence が原因なので、ここは固定した方がよいです。
確認できた live state
レビュー終了時点の
mainはdfc297248e08e8e30ef30c5c718b9ae80bb57db7です。#2950 が Current Validated Scope に記載した9a0f24a…より1 commit進んでおり、PR #2945 / Issue #2939 の loopback/direct-routing 修正が merge 済みです。ただしこれは #2950 の Stop Condition を発火させる drift ではありません。current
preflight.shは引き続きlaunch.sh --check-onlyを exec し、success/failure のCLAUDE_GPT_LAUNCH_RESULT_V1shape は維持されています。PR #2945 自身も schema change なしとしています。したがって Issue の根本仮説は現在も有効です。また #2950 は現在 open、コメント0、#2950 を参照する implementation PR はまだありません。dedupe 検索でも
_claude_gpt_available/proxy.absolute_path周辺の ownership は #2938 と #2950 のみで、#2950 の独立 Issue 化は妥当です。upstream 調査
外部仕様側から見ても #2950 の方向性は正しいです。current
claude-code-proxyの公式 Minimal client contract はANTHROPIC_BASE_URL、dummyANTHROPIC_AUTH_TOKEN=unused、main/small model 等を Claude Code client 側に設定し、CCP_*等の server configuration と分離しています。したがって旧 helper がchatgpt_auth.availableや local proxy binary を availability authority にしていた設計へ戻すべきではありません。 claude-code-proxy公式 HTTP API でも
/healthzは provider credential/upstream availability を検証せず、/v1/modelsは Anthropic-shaped model discovery (data[].id) です。つまり current--check-onlyが証明するのは connected-server readiness/model catalog であって end-to-end ChatGPT inference availability ではありません。 claude-code-proxy.raine.devこれは #2950 の blocker ではありません。既存
_run_smoke()は runner のEXIT_SKIPをpytest.skip()に変換するため、実 runtime capability 不足の最終判定は downstream に残せます。この問題を理由にchatgpt_authprobe を helper へ再導入するのは逆方向です。upstream latest release は現在も v0.1.43 (2026-09-30) で、GPT-6 Sol/Luna support は v0.1.42 で導入済みです。今回の repository-side receipt consumer 修正を覆す新しい upstream change は確認できませんでした。 GitHub
推奨 disposition
#2950 は捨てたりスコープを広げたりせず、Issue contract を上記3点だけ修正してから
issue-refinement-loopを通し、実装へ進めるのがよいです。特に P1 は merge 前に直した方がよく、P2 2件も同じ target file 内の数個の fixture/negative assertion で解決できます。新 schema、新 daemon、新 approval layer、新 security gate は不要です。
## 判定REQUEST_CHANGES 相当です。 #2950 の問題設定とスコープ分離は妥当ですが、現状の contract には P1 1件、P2 2件あります。実装そのものは target test file 1件で完結でき、launcher や新しい恒久 harness を増やす必要はありません。
Findings
preflight.shの正常系」を必須化していないexit 7 → helper Falseだけでも AC5 が PASS でき、immediateruntime verification の正常系がゼロになり得るpreflight.sh+ local loopback fake server で exit 0 / current receipt → True を必須化。併せて closed port / incomplete catalog → Falseschemaと JSON object shape を検証対象にしていない[]/null/ scalarconnected_serverで例外化できるschema == CLAUDE_GPT_LAUNCH_RESULT_V1、connected_serverdict を必須化し poison fixture を追加exit_codeaccessor 撤去を要求するのに AC6/VC が検査していないpayload.get("exit_code")を残しても全 VC を通せるpayload.get("exit_code")の撤去確認を追加P1 — AC5 は current policy 上、runtime 正常系を証明できない
#2950 は
scripts/agent-ops/**の hard selector によりRuntime Verification Applicability: immediateとしています。この判定自体は currentextension-surface-runtime-policy.yamlと整合しています。しかし current
runtime-verification-policy.mdはimmediateに対して 正常系 ≥1 と異常系 ≥1 を要求しています。一方 #2950 の AC5 は、だけで、さらに
execution_environmentでは proxy server が起動していなくてもよい としています。したがって実装が例えば、
preflight.sh→ exit 7 /status: failed(False, reason)となっても AC5 を満たせます。これは runtime の異常系しか実行していません。
さらに
skip_conditionsではsh/preflight.sh実行不能を SKIP としていますが、Issue の Stop Conditions に current policy が要求する runtime VC SKIP → escalation がありません。実装次第では_claude_gpt_available()が OSError を(False, reason)に変換した結果、それすら「整合した False」として AC5 が通る余地があります。最小修正は外部 ChatGPT や live proxy を要求することではありません。既存
scripts/claude-gpt/tests/_launcher_harness.pyの localFakeServer相当を再利用し、target file 内から realpreflight.shを実行すれば十分です。AC5 を少なくとも「compatible local model catalog → real preflight exit 0 → current receipt → helper True」と「closed port または incomplete catalog → exit 7 → helper False」の2経路にしてください。
sh自体が無い等の場合だけ SKIP にし、その SKIP を Stop Condition に追加するのが repository-native です。P2 —
CLAUDE_GPT_LAUNCH_RESULT_V1を名乗ること自体を確認していないcurrent main の success receipt は明確に、
schema: CLAUDE_GPT_LAUNCH_RESULT_V1status: okmode: check_onlyconnected_server.reachable: trueconnected_server.model_catalog_ok: trueです。ところが #2950 の Outcome / AC1–AC4 は
schemaを判定条件に含めていません。そのため例えば別 schema でも
status=ok, mode=check_only, reachable=true, model_catalog_ok=trueなら True にできてしまいます。「current
CLAUDE_GPT_LAUNCH_RESULT_V1に合わせる」という Issue goal と一致しません。また AC4 は「非 JSON」は扱いますが、JSON として valid だが shape が不正なケースがありません。典型的な
.get()実装では[]、null、"foo"、あるいは"connected_server": "foo"で例外になります。これはfallback_policyの「receipt を解釈できなければ False と理由」に反します。既存 schema を増やす話ではなく、既存 schema に fail-closed で bind するだけです。wrong/missing schema、top-level non-object、
connected_servernon-object を AC4 fixture に加えるのが適切です。P2 — bug の原因だった旧
exit_codedependency が VC の盲点Current Validated Scope / In Scope は旧 shape として
exit_code/binary_available/proxy.absolute_path/chatgpt_auth.availableを明示し、それらによる判定を撤去するとしています。
ところが AC6 と Verification Commands が negative-check するのは後ろ3つだけで、
payload.get("exit_code")が抜けています。例えば新条件を追加しつつ、
のような stale dependency を残しても、AC1–AC5と現在のAC6 VCをすべて通せます。今回の Issue はまさに producer/consumer shape divergence が原因なので、ここは固定した方がよいです。
確認できた live state
レビュー終了時点の
mainはdfc297248e08e8e30ef30c5c718b9ae80bb57db7です。#2950 が Current Validated Scope に記載した9a0f24a…より1 commit進んでおり、PR #2945 / Issue #2939 の loopback/direct-routing 修正が merge 済みです。ただしこれは #2950 の Stop Condition を発火させる drift ではありません。current
preflight.shは引き続きlaunch.sh --check-onlyを exec し、success/failure のCLAUDE_GPT_LAUNCH_RESULT_V1shape は維持されています。PR #2945 自身も schema change なしとしています。したがって Issue の根本仮説は現在も有効です。また #2950 は現在 open、コメント0、#2950 を参照する implementation PR はまだありません。dedupe 検索でも
_claude_gpt_available/proxy.absolute_path周辺の ownership は #2938 と #2950 のみで、#2950 の独立 Issue 化は妥当です。upstream 調査
外部仕様側から見ても #2950 の方向性は正しいです。current
[claude-code-proxy](https://claude-code-proxy.raine.dev/using/configure-claude-code/)の公式 Minimal client contract はANTHROPIC_BASE_URL、dummyANTHROPIC_AUTH_TOKEN=unused、main/small model 等を Claude Code client 側に設定し、CCP_*等の server configuration と分離しています。したがって旧 helper がchatgpt_auth.availableや local proxy binary を availability authority にしていた設計へ戻すべきではありません。 claude-code-proxy公式 HTTP API でも
/healthzは provider credential/upstream availability を検証せず、/v1/modelsは Anthropic-shaped model discovery (data[].id) です。つまり current--check-onlyが証明するのは connected-server readiness/model catalog であって end-to-end ChatGPT inference availability ではありません。 claude-code-proxy.raine.devこれは #2950 の blocker ではありません。既存
_run_smoke()は runner のEXIT_SKIPをpytest.skip()に変換するため、実 runtime capability 不足の最終判定は downstream に残せます。この問題を理由にchatgpt_authprobe を helper へ再導入するのは逆方向です。upstream latest release は現在も v0.1.43 (2026-09-30) で、GPT-6 Sol/Luna support は v0.1.42 で導入済みです。今回の repository-side receipt consumer 修正を覆す新しい upstream change は確認できませんでした。 [GitHub](https://github.com/raine/claude-code-proxy/releases)
推奨 disposition
#2950 は捨てたりスコープを広げたりせず、Issue contract を上記3点だけ修正してから
issue-refinement-loopを通し、実装へ進めるのがよいです。特に P1 は merge 前に直した方がよく、P2 2件も同じ target file 内の数個の fixture/negative assertion で解決できます。新 schema、新 daemon、新 approval layer、新 security gate は不要です。
squne121 commentedon Oct 5, 2026
確認した live state では、#2950 は open、対象 OWNER コメントは
REQUEST_CHANGES相当、現時点で #2950 を実装する PR は見つかりませんでした。main は確認時点でdfc297248e08e8e30ef30c5c718b9ae80bb57db7ですが、実行時には必ず fresh に再取得させるのが適切です。推奨は、実装へ進まず #2950 の contract だけを3 findingに沿って修正 → current
issue-refinement-loopを最後まで再実行 → approved または canonical stop で終了です。Allowed Paths は target test file 1件のまま維持し、新 schema・launcher 改修・恒久 harness 追加へ広げないのが妥当です。再発防止 Issue は、この実行指示自体を human authorization として workflow に入力させつつ、dedupe 後に genuine な別責務がある場合だけ起票させます。deterministic authority がなおhuman_judgment_requiredを返す場合だけ停止させます。そのまま既存の interactive Claude Code / auto mode session に貼れます。
repo:
squne121/loop-protocol対象:
実装: claude-gpt live causal-evidence test の可用性判定を current CLAUDE_GPT_LAUNCH_RESULT_V1 に合わせる #2950 (comment)
.claude/skills/issue-refinement-loop/SKILL.mdあなたは既に interactive Claude Code の auto mode session 上で動作している。この session をそのまま継続し、Claude Code を再起動したり permission mode を変更したりしないこと。
Objective
上記 OWNER コメントを対象に、current HEAD の
.claude/skills/issue-refinement-loop/SKILL.mdを正本として Issue #2950 の refinement loop を自律実行する。今回の目的は実装ではない。
issue-refinement-loopを planner-first で最後まで実行するapprovedになるか、正規の termination condition に到達するまで進めるimpl-review-loop、implementation worker、実装 worktree、code change、commit、push、PR 作成へは進まないHuman authorization
このユーザープロンプトは、今回の refinement に必要な通常の非破壊操作を明示的に承認している。
追加の人間確認を求めず実行してよいもの:
ただしこの authorization は canonical deterministic authority を無視する許可ではない。
current repository workflowへこのユーザー指示を human authority input として正しく渡した後でも、
decide_next_loop_action.py等の canonical authority が最終的にhuman_judgment_requiredを返す場合は、それを捏造して approve にせず正規の
human_escalationとして停止すること。以下は承認していない:
bypassPermissions--dangerously-skip-permissionsStep 0 — fresh state を取得する
最初に stale な会話履歴を authority にせず、live state を再取得する。
最低限確認する:
5995725736mainHEAD.claude/skills/issue-refinement-loop/SKILL.mddocs/dev/runtime-verification-policy.mddocs/dev/extension-surface-runtime-policy.yamlscripts/claude-gpt/preflight.shscripts/claude-gpt/tests/_launcher_harness.pyscripts/agent-ops/tests/test_run_worktree_agent_runtime_smoke_claude_gpt_live_causal_evidence.py過去に確認された main SHA を固定値として信用しないこと。
実行開始時の current main を fresh に確定すること。
既存 PR が存在する場合も、この invocation は refinement 専用なので implementation PR の変更へ勝手に移行しないこと。
Step 1 — current Skill を読み、planner-first で実行する
issue-refinement-loopの procedure をプロンプトから推測して再実装しない。current HEAD の
SKILL.mdと、それが参照する canonical references/scripts を読み、planner が返す
REFINEMENT_LOOP_PLAN_V1等の current contract に従う。特に:
を main thread の独自判断で置き換えない。
max iterations もこの prompt に固定せず、current Skill / loop policy の値を使うこと。
OWNER review の必須反映事項
対象 OWNER comment は
REQUEST_CHANGES相当で、最低限次の3 findingを contract に反映する必要がある。Finding 1 — P1: AC5 runtime verification の正常系を必須化
現在の AC5 が
「real
preflight.shの receipt と helper が整合する」だけでは、proxy 不在の
preflight.shexit 7status: failed(False, reason)だけで PASS でき、
immediateruntime verification の正常系がゼロになる。current runtime policy と fresh repository evidence を再確認したうえで、Issue contract を少なくとも以下へ強化すること。
正常系:
scripts/claude-gpt/preflight.shを使う/v1/modelscatalog を返すCLAUDE_GPT_LAUNCH_RESULT_V1success receipt異常系:
外部 ChatGPT inference や real remote proxy は要求しない。
既存
scripts/claude-gpt/tests/_launcher_harness.pyの
FakeServer/ related utility を read/reuse できる設計を優先し、新しい恒久 harness を作らない。Runtime Verification Applicability、execution_environment、skip_conditions、artifact_requirements、AC/VC をこの要件と整合させること。runtime VC が SKIP した場合は PASS 扱いしない。
current policy が要求するなら SKIP → escalation を Stop Conditions に明示する。
Finding 2 — P2: parser を exact current schema / JSON object shape に fail-closed bind
availability parser / pure decision function は success 判定時に少なくとも:
schema == "CLAUDE_GPT_LAUNCH_RESULT_V1"status == "ok"mode == "check_only"connected_serverが object/dictconnected_server.reachable is Trueconnected_server.model_catalog_ok is Trueを要求する contract にする。
以下の poison/negative fixture を contract / AC / VC へ含める:
[]nullconnected_serverが scalar/non-objectこれらは exception crash ではなく、fallback policy と整合した理由付き False に倒れること。
新 schema を追加するのではなく、既存
CLAUDE_GPT_LAUNCH_RESULT_V1に bind するだけに留める。Finding 3 — P2: legacy
exit_codeaccessor の negative VC を追加Issue の In Scope が撤去対象としている旧 shape:
payload.get("exit_code")payload.get("binary_available")proxy.get("absolute_path")chatgpt_auth.get("available")について、AC と Verification Commands が 4つ全ての撤去を証明するよう修正する。
特に現 contract で抜けている
payload.get("exit_code")の negative assertion を追加すること。
producer/consumer shape divergence の再発を防ぐ目的なので、旧 field を supplemental fallback として残さない。
Scope constraints
OWNER review は「target test file 1件で完結できる」としている。
したがって原則として implementation Allowed Paths は引き続き:
scripts/agent-ops/tests/test_run_worktree_agent_runtime_smoke_claude_gpt_live_causal_evidence.pyのみとする。
以下へスコープ拡大しない:
scripts/claude-gpt/**の implementation change_claude_gpt_availablehelper の同時修正_launcher_harness.pyは必要なら read-only reference / reusable test support として扱う。変更が本当に必要なら、勝手に Allowed Paths を広げず current scope-delta authority に通すこと。
OWNER findings の3点を反映するだけで同じ機能領域・同じ Allowed Paths に収まるなら、単に「文面が増えた」ことを理由に人間確認へ戻さない。
ただし canonical scope-signal guard の最終判定は尊重する。
SubAgent execution requirements
current Skill / planner が SubAgent を要求または許可する局面では、適切な SubAgent を実際に使うこと。
特に planner が investigation required と判定した場合は current
codebase-investigatorcontract に従うこと。review / edit / research / follow-up creation についても current Skill が指定する Agent / Skill boundary を使う。
各 SubAgent には暗黙 context に依存させず最低限以下を明記する:
重要:
SubAgent を dispatch しただけで step 完了扱いしてはいけない。
各 dispatch 後は、その SubAgent の final result / handback / terminal completion を current Claude Code / repository contract に従って確認してから downstream step へ進むこと。
Agent tool の開始 acknowledgement、prompt echo、途中 report だけを completion とみなさない。
独立した read-only investigation は current workflow が許せば並列化してよい。
依存関係のある
investigate → review → edit → re-review
は順序を守ること。
nested SubAgent delegation が current contract で禁止・停止条件なら行わない。
Review/fix loop
OWNER finding を Issue body に反映したら、そこで終了しない。
current
issue-refinement-loopの review pipelineを fresh body に対して実行し、deterministic review / semantic review / scope guard 等の current canonical outputs を取得する。
needs-fix/ REQUEST_CHANGES 相当:通常の review finding、validation failure、stale body、修正可能な contract error は人間確認の理由にしない。
body mutation 後は必ず fresh remote readback を基準に次の review を行うこと。
mutation 前 snapshot の review 結果を使い回さない。
deterministic checker が authority の判断を prose で上書きしない。
再発防止 Issue
今回の refinement 中に、#2950 固有ではなく今後も再発しそうな別責務を具体的 evidence 付きで発見した場合、放置しない。
候補例:
ただし一般論だけで Issue を増やさない。
手順:
create-issue/issue-creator等の repository-native workflow を使用このユーザープロンプト自体が、上記条件を満たす再発防止 Issue の deduped creation を明示的に承認している。
したがって generic な「新規 Issue を作ってよいか?」という追加確認は不要。
ただし、この human authorization を current canonical workflow に入力した後でも deterministic authority が
human_judgment_requiredを返す場合は、それを迂回しない。再発防止 Issue が無ければ、無理に作成しない。
Web/upstream research
OWNER comment には upstream
claude-code-proxy調査結果もあるが、それを永久に fresh とみなさない。current planner が web research を不要と判定するなら重複調査を強制しない。
freshness 上必要、または finding の解決に外部仕様が material なら current official docs / upstream repository / release/spec を優先して調査する。
特に client-side helper に
chatgpt_authprobe や local proxy binary authority を再導入する方向には戻さない。current upstream / repository evidence が本当に変化している場合だけ再評価する。
Expected refined contract direction
最終的な #2950 は少なくとも次を満たす状態を目指す:
CLAUDE_GPT_LAUNCH_RESULT_V1consumer alignment のままpreflight.shを通した local loopback success runtime pathpreflight.shの failure runtime pathtest function 名等の細部は current file / repository conventions を fresh に確認して決めること。
古い Issue 本文の仮 test 名を盲目的に固定しない。
Termination
current Skill の canonical termination procedure に従う。
approved の場合
impl-review-loopを開始しないhuman_escalation の場合
decide_next_loop_action.py等の canonical output の termination cause を保持Final report
最後に短く、しかし検証可能な形で以下を報告する:
のいずれかと URL / number
approvedの場合は「implementation-ready だが implementation 未開始」と明記調査・提案だけで止まらず、current repository-native
issue-refinement-loopを実際に完遂すること。この prompt では、OWNER コメントで指摘された3点を明示しつつ、判定そのものは current planner/checker に委ねています。これにより「人間承認不要」を理由に scope guard を無効化することも、逆に通常の修正ごとに停止することも避けられます。
squne121 commentedon Oct 5, 2026
issue-refinement-loop: human_escalation
156b7fe8db3a011527e3e55bed47c9602c5906d813aad9862051b552d8c42810dfc297248e08e8e30ef30c5c718b9ae80bb57db7反映した内容
preflight.shと local loopbackFakeServerの正常系(exit 0 / success receipt / helper True)、AC6 を closed port・incomplete catalog の異常系(exit 7 / helper 理由付き False)に分離した。runtime SKIP を PASS 扱いせず、Stop Conditions に SKIP の human escalation を追加した。schema == "CLAUDE_GPT_LAUNCH_RESULT_V1"・status・mode・connected_serverの object 性とreachable/model_catalog_okに fail-closed で bind した。poison fixture を AC4 に列挙した。payload.get("exit_code")を含む)の撤去を AC7 と VC 4 本で固定した。needs-fix(新規 test node-id が既存 file 参照の VC は canonical 外、uv run ruffは VC allowlist 外)となり、修正後の iteration 1 でapprove。Step 2.5 はsemantic_review_applicable: false。停止理由と blockers
canonical review の VC 形状要件を満たすため、新規 test を同 directory の新規 file
scripts/agent-ops/tests/test_claude_gpt_availability_launch_result_v1.pyに置き、Allowed Paths を 2 件にした。この In Scope 追加を scope signal guard が新規領域として検知し、decide_next_loop_action.pyがhuman_escalationを返した。approve には倒していない。実装は開始していない。必要な人間判断
ANCHOR_SCOPE_REFRAME_V1を trusted anchor コメントとして投稿)。本文は既に反映済みで、承認後に再度 refinement を実行すれば approve に進める見込み。squne121 commentedon Oct 5, 2026
推奨は 単一 file 方針へ戻さず、新規 test file の Allowed Paths 追加を承認して refinement を再開です。前回は deterministic review 自体は修正後
approveで、停止理由は scope guard のnew_in_scope_areaだけでした。貼り付けたテキスト(1)ただし、停止コメントの「人間が手書き
ANCHOR_SCOPE_REFRAME_V1を投稿する必要がある」という案は current repository contract より強すぎます。livemain=dfc297248e08e8e30ef30c5c718b9ae80bb57db7の currentissue-refinement-loopは、operator-selectedwith_human_contextの freeform directive を扱い、構造化 anchor の手入力を人間に要求しない経路を既に持っています。したがって 今回のユーザー承認を Claude Code が #2950 上の controlled comment として materialize → その canonical comment URL をwith_human_contextとして使うのが repository-native です。再発防止については、現時点で類似 control-plane 問題を所有する open Issue #2842 が存在します。よって即座に重複 Issue を作らず、今回の正規経路でも同種停止が再現した場合はまず #2842 との同一性を判定し、別 root cause の場合だけ新規起票させるのが適切です。前回の実行では codebase-investigator / web-researcher / issue-editor の completion join まで実施済みです。貼り付けたテキスト(1)
以下を、既に auto mode で動いている interactive Claude Code にそのまま貼れます。
repo:
squne121/loop-protocol対象:
実装: claude-gpt live causal-evidence test の可用性判定を current CLAUDE_GPT_LAUNCH_RESULT_V1 に合わせる #2950 (comment)
実装: claude-gpt live causal-evidence test の可用性判定を current CLAUDE_GPT_LAUNCH_RESULT_V1 に合わせる #2950 (comment)
.claude/skills/issue-refinement-loop/SKILL.mdあなたは既に interactive Claude Code の auto mode session 上で動作している。この session を継続すること。Claude Code を再起動したり permission mode を変更したりしないこと。
Objective
Issue #2950 の前回
human_escalationを、今回の operator authorization を正式な human-context input として currentissue-refinement-loopに渡して解消し、refinement を canonicalapprovedまたは genuine な canonical stop まで自律継続する。今回は refinement の継続だけを行う。
impl-review-loopを開始しないExplicit operator authorization
今回、operator は #2950 について以下を明示的に承認する。
承認する scope delta
既存 Allowed Path:
scripts/agent-ops/tests/test_run_worktree_agent_runtime_smoke_claude_gpt_live_causal_evidence.pyに加えて、次の新規 test file を Allowed Paths に含めることを承認する。
scripts/agent-ops/tests/test_claude_gpt_availability_launch_result_v1.pyこの 2-file scope を #2950 の implementation contract として承認する。
理由:
existing_file_missing_node_id_noncanonicalとして canonical 外にする。scripts/claude-gpt/tests/_launcher_harness.pyは read-only reuse のままで、変更を承認していない。単一 file 方針へ戻し、checker を迂回または例外化することは承認しない。
Authorization materialization
このユーザープロンプト自体が operator authorization の source である。
current
issue-refinement-loopが scope authority を canonical GitHub issue-comment URL に bind する必要がある場合、人間へANCHOR_SCOPE_REFRAME_V1の手書き投稿を要求して停止してはならない。current HEAD の以下を fresh に読み、正規経路を選ぶこと。
.claude/skills/issue-refinement-loop/SKILL.md.claude/skills/issue-refinement-loop/references/anchor-comment-handling.md.claude/skills/issue-refinement-loop/references/scope-signal-guard.mdcurrent Skill に従い、この operator authorization を controlled GitHub comment mutation で #2950 に materialize してよい。
投稿する approval comment は少なくとも次を明確にすること:
scripts/agent-ops/tests/test_claude_gpt_availability_launch_result_v1.pyを明示的に承認する
current Skill が structured
ANCHOR_SCOPE_REFRAME_V1を生成する canonical route を選ぶなら、schema を current HEAD から読み、正しい payload を agent 側で生成してよい。一方、current Skill の operator-selected freeform
with_human_contextroute が正規経路なら、構造化 anchor を無理に生成せずその route を使う。人間にもう一度 YAML を手入力させることを completion condition にしてはならない。
materialize した comment の canonical URL を取得し、current Skill が要求する
preflight.run.with_human_context/ subsequent trusted contract-update lane の--anchor-comment-urlとして使用する。この provenance は
verified_humanと表現せず、current repository contract に従いoperator_asserted_human_contextとして扱う。Human authorization — 実行してよい操作
追加確認なしで、今回の refinement 完了に必要な次の通常・非破壊操作を実行してよい。
mainHEAD の fresh readpreflight.run.with_human_contextただし以下は承認していない。
bypassPermissions--dangerously-skip-permissionsimpl-review-loopの開始Step 0 — fresh state
stale transcript を authority にせず、最初に live state を取得する。
最低限確認する:
59960433595995725736mainHEAD.claude/skills/issue-refinement-loop/SKILL.mdreferences/anchor-comment-handling.mdreferences/scope-signal-guard.mdscripts/agent-ops/tests/test_run_worktree_agent_runtime_smoke_claude_gpt_live_causal_evidence.pyscripts/agent-ops/tests/test_claude_gpt_availability_launch_result_v1.pyの2件になっていること
を必要な範囲で確認する
過去の
dfc297...を無条件に固定せず、実行時の main HEAD を fresh に取得する。ただし main が同 SHA ならそれをそのまま記録すればよい。SubAgent requirement
SubAgent を使用すること。
少なくとも、refinement を再開する前に read-only
codebase-investigatorを使い、次を確認させる。task:
target:
issue-refinement-loopscripts/agent-ops/tests/test_claude_gpt_availability_launch_result_v1.pyauthority:
constraints:
expected output:
SubAgent を dispatch しただけで完了扱いしてはならない。
必ず terminal completion / final result を取得して join してから後続 phase へ進むこと。
current Skill がさらに
issue-editor、issue-design-reviewer、その他 SubAgent を要求する場合も同様に、dispatch → terminal completion join → result consume の順序を守る。independent な read-only investigation は必要なら並列化してよいが、contract mutation / fresh review / routing に dependency がある処理は順番を守る。
Resume procedure
current Skill を SSOT とし、手順をこの prompt から推測して再実装しない。
特に今回の scope authorization は current repository の:
issue_editor_requiredの current routing semantics に従うこと。
重要
前回の termination comment が
「
ANCHOR_SCOPE_REFRAME_V1を human が投稿する必要がある」と記載していても、それ自体を current Skill より上位の workflow contract として扱わない。
current Skill が、構造化 anchor の欠如だけを理由に
human_judgment_requiredへ落としてはならない current route を持つなら、その route を使用する。ただし今回の scope delta は前回 OWNER review の時点では明示承認されていなかったため、今回の operator authorization を GitHub comment として materialize してから human-context lane に入れること。
Refinement target state
#2950 body の現在の refinement 結果を維持する。
特に:
AC5:
real
preflight.sh+ compatible local loopbackFakeServer→ exit 0
→
CLAUDE_GPT_LAUNCH_RESULT_V1success receipt→ helper True
AC6:
closed port と incomplete catalog
→ exit 7
→ failed receipt
→ helper reason付き False
runtime SKIP:
PASS 扱いせず Stop Condition / escalation
parser:
exit code 0
schema == "CLAUDE_GPT_LAUNCH_RESULT_V1"status == "ok"mode == "check_only"connected_serverobjectreachable is Truemodel_catalog_ok is Truepoison fixtures:
fail-closed、例外を出さず reason付き False
AC7:
旧 accessor 4つの撤去:
payload.get("exit_code")payload.get("binary_available")proxy.get("absolute_path")chatgpt_auth.get("available")Allowed Paths:
2 files のみ
scripts/claude-gpt/tests/_launcher_harness.py:read-only reuse
これらを scope approval の名目で崩したり、元に戻したりしない。
Review loop
approval comment materialization と current canonical human-context route の消費後、current Skill に従って fresh refinement cycle を実行する。
通常の
needs-fix、deterministic repair、review finding は bounded loop 内で自動修正し、fresh body で再 review する。前回 review の
approveをそのまま再利用せず、current body/current main に対して fresh review を取得する。Recurrence / follow-up Issue policy
再発防止 Issue を無条件に新規作成しない。
まず open + closed Issues を dedupe する。
特に current open Issue #2842:
trusted human-context の contract_update mutation lane が、freeform directive から不正な patch operation を導出し、失敗理由を出さずに停止する欠陥を是正するとの ownership 重複を必ず確認する。
また #2086 / #2620 / #2678 / #2785 の既存 ownership も確認する。
reuse
今回の正規
with_human_contextcontinuation が失敗し、その root cause が #2842 の ownership(trusted human-context mutation lane / patch-operation derivation / reason-code observability 等)
と一致する場合:
create
次の場合だけ新規 follow-up Issue を起票する。
human_judgment_requiredに戻る、または別の再発性 control-plane defect が再現する起票時は:
を含める。
重複 Issue は作らない。
Stop boundary
以下は genuine stop として扱う。
human_judgment_requiredを返すただし通常の review finding、修正可能な checker failure、stale artifact、再実行可能な fresh-check failureだけで停止しない。
Completion
approved の場合
current Skill の approved termination/handoff contract を最後まで完了する。
その後 終了する。
impl-review-loopを開始しないhuman escalation の場合
canonical evidence を保持し、approve を捏造しない。
ただし、今回の operator scope approval が正しく current
with_human_contextroute に投入されたことを証明してから escalation とする。Final report
最後に簡潔に以下を報告する。
のいずれか
この prompt では、今回の承認を 「新規 test file の追加」まで具体化しつつ、current Skill の freeform human-context routeも使えるようにしています。これで再度「anchor を人間が手書きしてください」だけを理由に止まるのを避けつつ、canonical authority 自体は迂回しません。
squne121 commentedon Oct 5, 2026
operator scope 承認: #2950 の Allowed Paths への新規 test file 追加
operator(OWNER)は、#2950 の Allowed Paths に次の新規 test file 1 件を追加することを明示的に承認する。既存の Allowed Path と合わせて 2 file の scope を実装 contract として承認する。
scripts/agent-ops/tests/test_claude_gpt_availability_launch_result_v1.pyexisting_file_missing_node_id_noncanonicalとして canonical 外にする。新規 focused test を同 directory の新規 test file に置くことは、この checker contract を満たすための最小の scope delta である。scripts/claude-gpt/tests/_launcher_harness.pyは read-only 再利用のままで変更を承認しない。単一 file 方針へ戻すことや checker の迂回・例外化も承認しない。この提示は operator が current session で明示した指示を転記したもので、provenance は
operator_asserted_human_contextとして扱う。squne121 commentedon Oct 5, 2026
issue-refinement-loop 終了報告: approved
Issue #2950 の refinement が
approvedで終了しました。実装・worktree 作成・impl-review-loop起動・commit・push・PR 作成は行っていません。approvedは実装開始の承認ではありません(implementation-ready だが implementation 未開始)。156b7fe8db3a011527e3e55bed47c9602c5906d813aad9862051b552d8c42810dfc297248e08e8e30ef30c5c718b9ae80bb57db7ANCHOR_SCOPE_REFRAME_V1、preflight.run.with_human_contextで束縛。provenance はoperator_asserted_human_context)。承認した scope delta は新規 test filescripts/agent-ops/tests/test_claude_gpt_availability_launch_result_v1.pyの Allowed Paths 追加のみです。scripts/agent-ops/tests/test_run_worktree_agent_runtime_smoke_claude_gpt_live_causal_evidence.pyと上記新規 test file の 2 件。scripts/claude-gpt/tests/_launcher_harness.pyは read-only 再利用で変更を承認していません。approved_by_trusted_anchor(implementation_go: false)、scope_signal_guard はtriggered: false、deterministic review はapprove(blocker・finding なし)、Step 2.5 semantic review はsemantic_review_applicable: false、contract review はgo(baseline は expected_fail 10 件・expected_pass 1 件・unexpected_pass 0 件)、decide_next_loop_action.pyはproceed_to_step_4_5。follow-up の実体化
follow-up Issue は起票していません。planner 候補(他 file の
_claude_gpt_available類似 helper)は、git grepで対象 file 以外に該当 helper が存在しないことを確認しました。#2842 の ownership(freeform directive 由来の patch operation 導出欠陥)は、本 run が構造化 anchor の正規経路で成立したため再現せず、#2842 への追記も行っていません。squne121 commentedon Oct 5, 2026
確認結果として、#2950 は live GitHub 上で refinement
approvedまで到達済みで、実装はまだ開始されていません。現在のmainは14ae6126b56201cacae71fae2b622cf05b910077まで進んでいますが、refinement 時点のdfc2972…からの差分は create-issue の VC guidance 関係だけで、#2950 の Allowed Paths には触れていません。target helper は依然として旧exit_code/binary_available/proxy.absolute_path/chatgpt_auth.availableを参照し、新規 focused test file はまだ存在せず、#2950 の実装 PR も確認できませんでした。添付ログ側でも refinement approved、Allowed Paths 2件、remaining blockers なし、implementation/PR 未開始まで記録されています。貼り付けたテキスト(1)推奨は、過去の
LOOP_HANDOFF_RESULT_V1を実装許可として再利用せず、currentimpl-review-loopの Root-Owned Synchronous Entry Transition を fresh に通してから、implementation-worker → test-runner → pr-reviewer を completion join 付きで回し、terminal gate が approved になる直前まで進めることです。以下をそのまま fresh interactive Claude Code / auto mode に貼れます。repo:
squne121/loop-protocol対象 Issue:
#2950
current repository workflow:
.claude/skills/impl-review-loop/SKILL.md重要な既存 context:
実装: claude-gpt live causal-evidence test の可用性判定を current CLAUDE_GPT_LAUNCH_RESULT_V1 に合わせる #2950 (comment)
実装: claude-gpt live causal-evidence test の可用性判定を current CLAUDE_GPT_LAUNCH_RESULT_V1 に合わせる #2950 (comment)
実装: claude-gpt live causal-evidence test の可用性判定を current CLAUDE_GPT_LAUNCH_RESULT_V1 に合わせる #2950 (comment)
あなたは既に fresh interactive Claude Code の auto mode session 上で動作している。この session をそのまま使用すること。Claude Code を再起動したり permission mode を変更したりしないこと。
Objective
Issue #2950 を、current HEAD の
.claude/skills/impl-review-loop/SKILL.mdとその current references/scripts を正本として実装し、repository-native なinspect → root entry → implement → verify → PR review → fix → re-verify → re-reviewの bounded loop を完遂する。
到達点は 人間が merge 判断できる直前の current
impl-review-loopterminal success state とする。実 merge / auto-merge は行わない。
過去の refinement approved comment や
LOOP_HANDOFF_RESULT_V1は audit/context として参照してよいが、それ単独を Step 1 implementation authorization として扱ってはならない。currentimpl-review-loopが要求する Root-Owned Synchronous Entry Transition を、この invocation 内で fresh に成立させること。Explicit operator authorization
このプロンプトは、#2950 をマージ直前まで自律処理するための通常の非破壊操作を明示的に承認する。
追加の人間確認なしで実行してよい:
impl-review-loopが要求する capability preflightissue-contract-reviewimplementation-workerSubAgent の dispatchtest-runnerSubAgent による Verification Commands の独立実行pr-reviewerSubAgent による current-head PR reviewREQUEST_CHANGESfinding の自動修正iteration ごとの人間承認は不要。
ただし次は承認していない:
bypassPermissions--dangerously-skip-permissionsCurrent observed state — 必ず fresh 再確認すること
この prompt 作成時点では:
main:14ae6126b56201cacae71fae2b622cf05b910077dfc297248e08e8e30ef30c5c718b9ae80bb57db7payload.get("exit_code")payload.get("binary_available")proxy.get("absolute_path")chatgpt_auth.get("available")scripts/agent-ops/tests/test_claude_gpt_availability_launch_result_v1.pyはまだ main に存在しないただし、これらを固定値として信用しない。
実行開始時に live state を fresh に取り直し、current main / Issue body / comments / PR candidates / target files / worktree state を再確認すること。
Step 0 — current impl-review-loop contract を読む
最初に current HEAD の少なくとも以下を読む:
.claude/skills/impl-review-loop/SKILL.md.claude/skills/impl-review-loop/steps/preparation.md.claude/skills/impl-review-loop/steps/step-1-implementation.md.claude/skills/impl-review-loop/steps/step-2-verification.md.claude/skills/impl-review-loop/steps/step-4-pr-review.md.claude/skills/impl-review-loop/steps/step-5-feedback-and-termination.md.claude/skills/impl-review-loop/steps/step-5-mergeability-handling.md.claude/skills/impl-review-loop/steps/context-protocol-and-guardrails.md.claude/agents/implementation-worker.md.claude/agents/test-runner.md.claude/agents/pr-reviewer.mdprocedure をこの prompt の文章から推測して再実装しないこと。
Step 1 — Root-Owned Synchronous Entry Transition を成立させる
過去の refinement handoff comment を implementation authorization packet とみなさない。
current
impl-review-loop/preparation.mdが規定する root-owned synchronous entry を、同一の継続した invocation / control flow の中で実行する。current contract に従い概ね:
issue-contract-reviewへ進む。
review_verdict/ body SHA / base SHA を過去 comment から再利用して起動判定しない。main drift や body drift があれば、current root router の fresh-review / rebind 経路に従う。
root transition が canonical に implementation を許可しない場合は、結果を捏造せずその route に従う。
Step 2 — pre-Step-1 landing disposition
implementation-worker / new worktree / new PR を起動する前に、current
preparation.mdの Evidence-Based Landing Disposition を必ず実行する。producer が返す canonical disposition /
start_data_plane/ action をそのまま consume し、prose で再判定しない。特に:
implementation_already_landed→ duplicate implementation を開始しない
existing_pr_resume→ 既存 PR / branch / worktree を再利用し、duplicate PR を作らない
already_satisfied→ current canonical already-satisfied route に従う
ordinary_dispatch_or_explicit_recovery→ 通常 Step 1 へ進む
reconciliation_required→ reconciliation を実施し、勝手に新規 worker / PR を作らない
この prompt 作成時には exact #2950 PR は無かったが、実行時点では必ず fresh に判定すること。
単に PR body に
#2950の文字列があるだけで implementation candidate と認定しない。Canonical Issue contract
live #2950 body を正本とする。
現在承認済み Allowed Paths は次の 2 件のみ:
scripts/agent-ops/tests/test_run_worktree_agent_runtime_smoke_claude_gpt_live_causal_evidence.pyscripts/agent-ops/tests/test_claude_gpt_availability_launch_result_v1.pyscripts/claude-gpt/tests/_launcher_harness.pyは read-only reuse であり変更禁止。launcher / schema / daemon / docs /恒久 harness へ scope を広げない。
Issue body の current Outcome / AC1–AC8 / Verification Commands / Runtime Verification / Stop Conditions を逐語的 authority として扱う。
Implementation intent
実装の中心は、既存
_claude_gpt_available()の stale consumer contract を currentCLAUDE_GPT_LAUNCH_RESULT_V1に合わせることである。current Issue contract に従い:
schema == "CLAUDE_GPT_LAUNCH_RESULT_V1"を要求status == "ok"mode == "check_only"connected_serverが objectconnected_server.reachable is Trueconnected_server.model_catalog_ok is True旧 accessor:
payload.get("exit_code")payload.get("binary_available")proxy.get("absolute_path")chatgpt_auth.get("available")は helper 本体からすべて撤去する。
local_proxy_binary_auxiliaryを availability authority に昇格させない。chatgpt_authprobe を再導入しない。Focused tests
新規:
scripts/agent-ops/tests/test_claude_gpt_availability_launch_result_v1.pyに current Issue contract の focused test を置く。
既存 helper module と
_launcher_harness.pyを bare import で雑に import せず、Issue contract の指示どおりimportlib.util.spec_from_file_location等の一意 module name を用いる。fixture / poison coverage と real local runtime verification を分離して明確にテストする。
Runtime verification
AC5 / AC6 は runtime verification であり、単なる fixture-only test へ弱めない。
AC5 正常系:
scripts/claude-gpt/preflight.shFakeServer/v1/modelsANTHROPIC_BASE_URLを fake server へ向けるAC6 異常系:
preflight.shstatus: failedOSError / timeout を helper が
(False, reason)に変換しただけの結果を AC5 / AC6 PASS に数えない。外部 ChatGPT inference / 実 credential / 実 proxy daemon は要求しない。
SubAgent execution protocol — completion join 必須
各 SubAgent は dispatch しただけで完了扱いしない。
dispatch 後は 必ず terminal completion を取得し、structured final result を読んでから次 Step に進む。
background 実行になった場合も:
だけで downstream へ進まない。
必ず completion / final hand-back / structured result を join する。
少なくとも current workflow が要求する:
implementation-workertest-runnerpr-reviewerを正規の Step で利用する。
SubAgent に渡す task には、親 context を暗黙共有したと仮定せず以下を明示する:
nested delegation は current Agent/Skill contract が許す範囲だけにする。
Step 1 — implementation-worker
canonical landing disposition が ordinary dispatch を許した場合、current
.claude/agents/implementation-worker.mdの V1 route を使用する。root/main thread 自身が data-plane implementation worker の役割を肩代わりしない。
worker は current
.claude/skills/implement-issue/SKILL.mdに従い:まで進める。
Git push / PR creation は current repository-native skill / wrapper を使い、raw shortcut で workflow を迂回しない。
foreign branch / foreign worktree / user dirty work は変更しない。
worker completion の
IMPLEMENT_RESULT_V1または current equivalent を取得してから Step 2 へ進む。Step 2 — independent verification
current
test-runnerの contract に従い、Issue body の Verification Commands を independent に実行する。baseline / current-head binding、command hash、VC adjudication 等は current Step 2 producer を使用する。
test-runner の自己申告だけで PASS にしない。
特に AC5 / AC6 runtime VC が実際に実行されることを確認する。
Issue contract が明示する SKIP は PASS に昇格させない。
AC5 / AC6 が environment SKIP した場合は #2950 の current Stop Condition なので、勝手に fixture PASS へ置換せず canonical stop とする。
通常の修正可能な test failure は停止理由にせず、implementation loop の fix route へ戻す。
Step 4 — adversarial PR review
current
pr-reviewer/pr-review-judgeを使用する。reviewer は要約ではなく defect discovery を行う。
重点:
reviewer の terminal structured result:
verdictreviewed_head_shablockerswarningsを root が取得する。
reviewer 自身の mergeability 自己申告は authority にしない。
Step 5 — route/fix/re-review
current
route_loop_verdict_v2()/step5-terminal-gate等の canonical routing を使用する。REQUEST_CHANGESの場合:fix_deltaとして structured に保持implementation-workerの PR repair mode / current canonical repair routeへ委譲通常の REQUEST_CHANGES / CI failure / stale reviewed HEAD / branch behind は、iteration 余裕がある限り自動修復する。
BEHINDの場合は current router が合成するupdate_branchaction を使い、その後 verification と review を両方再実行する。reviewed_head_shaが live PR HEAD とずれた場合は古い review で終了しない。BLOCKED/UNSTABLE/DRAFTを Git conflict と混同しない。actual
CONFLICTING/DIRTYのみ current conflict runbook に従う。CI / final gate
PR HEAD に対する current required CI/checks を fresh に確認する。
prompt 作成時点の main branch protection は:
だが、実行時に branch protection / required checks を fresh に取得し、それを authority とする。
古い run / 別 head の green を利用しない。
terminal approval は current
step5-terminal-gateが要求する:等の current contractを満たした場合だけ成立させる。
verdict: APPROVE単独では完了扱いしない。External research policy
本 Issue は repository-internal consumer alignment が中心なので、current
impl-review-loopが外部調査不要と判定するなら web research はスキップしてよい。LOOP_STATE.external_research_skip_basis等の current contractに理由を記録する。ただし implementation 中に current upstream仕様が material に影響する genuine な疑問が発生した場合だけ、current Skill の external research routeを使い、公式 docs / upstream repository / release/spec を優先する。
外部調査を理由に scope を launcher/schema 変更へ拡大しない。
Recurrence prevention
作業中に「今回だけ修正しても同じ defect class が再発する」独立した systemic issue を発見した場合は、放置せず recurrence-prevention を検討する。
ただし新規 Issue を即作成せず、まず open + closed Issue を root cause / dedupe key / relevant symbols で検索する。
既存 ownership があれば再利用し、duplicate Issue を作らない。
特に stale Claude-GPT launcher consumer 問題なら #2938 等の既存 ownership と重複していないか確認する。
VC deletion/absence guidance の問題なら #2943 / #2947 の既存解決と同じ failure class でないか確認する。
別の root cause で、repository-native script/test/Skill の恒久是正が必要な場合だけ current
create-issueworkflow で follow-up Issue を起票する。follow-up Issue には最低限:
を含める。
再発防止 Issue が #2950 の implementation を成立させるための dependency / scope split になった場合は、#2950 の Stop Conditions に従って勝手に scope expansion せず canonical stop とする。
一方、#2950 本体は完遂可能で、follow-up が単なる独立 recurrence prevention なら、起票後も current impl-review-loop を継続する。
Genuine stop boundaries
次だけを genuine stop / escalation とする:
scripts/claude-gpt/**の変更が不可避_launcher_harness.pyの変更が不可避HUMAN_REVIEW_REQUIREDverdict単なる warning、advisory artifact stale、contract snapshot telemetry不足、修正可能な test/CI/review failure、stale reviewed HEAD は停止理由にしない。
Final target
current canonical loop が terminal approval に到達したら終了する。
merge / auto-merge は実行しない。
最終報告には少なくとも:
を明記する。
調査・提案・SubAgent dispatch だけで止まらないこと。
current repository-native
impl-review-loopを実際に最後まで実行し、人間が merge 判断できる直前まで到達すること。この形なら、#2950 の approved contract を維持しつつ、現在の
impl-review-loopで重要になっている root synchronous entry、landing disposition、current-head VC adjudication、SubAgent completion join、terminal gate を省略せず進められます。squne121 commentedon Oct 5, 2026
root-owned entry router audit
route: invoke_impl_review_loop
reason: fresh_review_go_live_equality
squne121 commentedon Oct 5, 2026
implement-issue: 実装完了
worktree-issue-2950-claude-gpt-availability-launch-resultsqune121 commentedon Oct 5, 2026
Contract Review Result
fix: runtime 環境不備を SKIP に戻し、malformed 入力の reason から入力値の転載をなくす (#2950)
test: claude-gpt live causal-evidence の可用性判定を CLAUDE_GPT_LAUNCH_RESUL…