Repository navigation
Description
Machine-Readable Contract
contract_schema_version: v1
issue_kind: implementation
parent_issue: none
goal_ref: "docs/dev/runtime-verification-policy.md#Runtime-Verification-Applicability"
change_kind: codeParent Issue
なし(単独改善)
Parent Goal Ref
- Goal: なし(親 Issue なし。単独の再発防止 Issue)
- Desired Destination: N/A
Current Validated Scope
docs/dev/runtime-verification-policy.mdへ、live runtime verification(先行Issue 実装: Claude-GPT の既定モデルを GPT-6 Sol/Astra/Luna に更新し、Auto mode classifier を Luna に戻す #2772 の実 ChatGPT subscription 検証相当)時の credential profile provenance に関する手順注意を追記する。scripts/claude-gpt/preflight.shの既存通常実行結果(CLAUDE_GPT_PREFLIGHT_RESULT_V1)へ、検査対象のCLAUDE_GPT_HOMEが canonical default か override かを sanitized に明示する additive フィールドを追加する。このフィールドはlaunch.sh --check-onlyが生成するCLAUDE_GPT_LAUNCH_RESULT_V1.preflightにも自動的に伝播する(launch.sh 側の追加実装は不要)。- 上記フィールド追加を実際の external process 起動経由(
launch.sh --check-only)で検証する hermetic regression test を追加する(詳細は AC6 / Runtime Verification Applicability を参照)。
Remaining Parent Gaps
なし。
Outcome
docs/dev/runtime-verification-policy.md に、live runtime verification(先行Issue #2772 の AC10 の実 ChatGPT subscription request 検証相当)は target launcher と同一の CLAUDE_GPT_HOME を使うこと、および ad-hoc な override による not_authenticated を account-auth failure と誤分類しないことを明記した手順注意セクションが追加され、rg で当該文言が検索できる状態になっている。加えて、docs/dev/runtime-verification-policy.md には credential/profile provenance(home_source: default | env_override)・stored-auth availability/status(既存 chatgpt_auth.available / chatgpt_auth.detail)・実 ChatGPT subscription request の受理という 3 種類の evidence が別々のものであり、いずれか単独を「runtime/entitlement PASS」と呼ばないことが明記されている。
scripts/claude-gpt/preflight.sh の既存通常実行結果に、検査対象 CLAUDE_GPT_HOME が canonical default か override かを示す sanitized な home_source フィールドが追加され、既存 pytest がこのフィールドを検証している。さらに、launch.sh --check-only を実際に external process として起動し、CLAUDE_GPT_HOME unset/default 時と explicit override 時の両方で home_source が意図通りに伝播すること(かつ override 自体をエラー扱いしないこと)を確認する hermetic regression test が新規に追加されている。
Runtime Verification Applicability
decision: immediate
reason: "静的なコード読解や既存pytestだけでは、preflight.shの新規provenance fieldが実際にlaunch.sh --check-only経由のexternal process呼び出しで意図通り伝播し、CLAUDE_GPT_HOME unset/default時とexplicit override時の両方でexit code/stdout挙動が正しいことを証明できない"
applicable_acs: [AC6]
runtime_assertion_bindings:
- profile: claude-gpt-process-io-smoke
assertion: external_process_exit_code_and_stdio_observed
ac: AC6
execution_environment: "current-head の scripts/claude-gpt/launch.sh --check-only を、既存 _latitude_check_only_helper.py 相当のhermetic test harnessでCLAUDE_GPT_HOMEをisolated tempに設定して実行する。実ChatGPT subscription requestや実認証は不要(process I/O観測のみ)"
skip_conditions: "launch.sh/preflight.shが存在しない、または既存hermetic test harnessが利用不能な場合のみenvironment_blockedとし、その場合はAC6 PASSを主張しない"
fallback_policy: "hermetic testをskipしてunit-level enumテストのみでAC6 PASSを主張しない"
artifact_requirements: "実行したpytestの exit code、home_source の観測値(default/env_override)、CLAUDE_GPT_HOME設定値(sanitized、実credentialの中身は含めない)"AC6 以外(AC1〜AC5)は既存どおり static verification(rg によるテキスト存在確認、既存 pytest 実行)で完結する。AC6 のみ、上記の hermetic regression test(external process 起動による I/O 観測)を要求する。実 ChatGPT subscription への実通信を伴う新規 runtime 検証は要求しない。
In Scope
docs/dev/runtime-verification-policy.mdに、先行Issue 実装: Claude-GPT の既定モデルを GPT-6 Sol/Astra/Luna に更新し、Auto mode classifier を Luna に戻す #2772 の AC10 相当の live runtime verification 手順における「canonicalCLAUDE_GPT_HOMEを用いること」「ad-hoc override 時のnot_authenticatedを external blocker と誤解釈しないこと」を明記するセクションを追記する。同セクションに、credential/profile provenance(home_source)・stored-auth availability/status(chatgpt_auth.available/chatgpt_auth.detail)・実 ChatGPT subscription request の受理(本 Issue のスコープでは新規に追加しない。既存の別 AC10 相当の仕組みに委ねる)が別々の evidence であることを明記する。scripts/claude-gpt/preflight.shの既存通常実行結果(CLAUDE_GPT_PREFLIGHT_RESULT_V1)に、検査対象CLAUDE_GPT_HOMEがscripts/claude-gpt/lib.shの canonical default(${HOME}/.claude-gpt)由来か、環境変数による override かを示す sanitized なフィールドhome_source: default | env_overrideを追加する。値には credential の中身(token / auth.json content)を一切含めない。新しいpreflight.sh --check-onlysubcommand は作らない。このフィールドはlaunch.sh --check-onlyが生成するCLAUDE_GPT_LAUNCH_RESULT_V1.preflightにも自動的に伝播する(launch.sh 側の追加実装は不要)。home_source: env_override自体は failure/異常ではない(target launcher と verification が同一の effectiveCLAUDE_GPT_HOMEを参照していることが正しい条件であり、意図的な override はそれ自体正当な運用でありうる)。- 上記フィールド追加に対応する pytest(
scripts/claude-gpt/tests/配下の既存 preflight テストファイルへの追記、または新規ファイル)を追加する。 launch.sh --check-onlyを実際に external process として起動し、home_sourceの伝播(default / env_override の両方)を確認する hermetic regression test を、既存 hermetic test seam(scripts/claude-gpt/tests/_latitude_check_only_helper.pyのrun_check_only()相当)を再利用して追加する。
Out of Scope
- Issue 実装: Claude-GPT launcher の model/proxy 互換性を事前検証し、互換 proxy の復旧経路を提供する #2801 が扱う compatible proxy の isolated install/update・catalog compatibility・repair path。
- Issue 実装: Claude-GPT self-launch で isolated HOME を runtime root に再基準化しない #2455 の self-launch(nested child launcher)時の isolated HOME 再基準化ロジック自体の再修正。
- 新しい permanent daemon、承認 framework、generic telemetry framework の追加。
- 新しい恒久的な CI required gate の追加(AC6 の hermetic test は既存 hermetic test seam を再利用した一回性の pytest であり、新規永続 CI required gate ではない)。
- hermetic test(pytest 等)が独立した temporary root を使うこと自体の変更。
- 実 ChatGPT subscription への実通信を伴う新規 runtime 検証(先行Issue 実装: Claude-GPT の既定モデルを GPT-6 Sol/Astra/Luna に更新し、Auto mode classifier を Luna に戻す #2772 の別 AC10 相当の仕組みに委ねる。本 Issue で新規追加しない)。
Acceptance Criteria
- AC1:
docs/dev/runtime-verification-policy.mdに、live runtime verification(先行Issue 実装: Claude-GPT の既定モデルを GPT-6 Sol/Astra/Luna に更新し、Auto mode classifier を Luna に戻す #2772 の実 ChatGPT subscription 検証相当)は target launcher と同一のCLAUDE_GPT_HOMEを使うべきという手順注意が追記されている。 - AC2: 同セクションに、ad-hoc な fresh temp
CLAUDE_GPT_HOMEoverride によるnot_authenticatedを account/entitlement failure と誤分類しない旨が明記されている。加えて、credential/profile provenance・stored-auth availability/status・実 ChatGPT subscription request の受理が別々の evidence であり、いずれか単独を「runtime/entitlement PASS」と呼ばないことが明記されている。 - AC3:
scripts/claude-gpt/preflight.shの既存通常実行結果(CLAUDE_GPT_PREFLIGHT_RESULT_V1)に、検査対象CLAUDE_GPT_HOMEが canonical default か override かを示す sanitized なフィールドhome_source: default | env_overrideが追加されている。新規--check-onlysubcommand は作らず、launch.sh --check-onlyのCLAUDE_GPT_LAUNCH_RESULT_V1.preflightにも自動的に伝播していることを確認する。 - AC4: AC3 のフィールドが credential の中身(token / auth.json content)を一切含まないことが、対応する pytest で検証されている。
- AC5: 追加した pytest(
scripts/claude-gpt/tests/test_preflight_home_source.py)が既存 test suite の実行経路(uv run pytest)で収集・PASS する。 - AC6: 既存 hermetic test seam(
scripts/claude-gpt/tests/_latitude_check_only_helper.pyのrun_check_only()相当)を再利用し、実際にlaunch.sh --check-onlyを external process として起動する新規 pytest を追加する。少なくとも次の2ケースを実 launcher boundary で確認する: (1)CLAUDE_GPT_HOMEunset/default(canonical default${HOME}/.claude-gptが使われ、nested.preflight.home_sourceがdefaultになる)、(2) explicit temp/stable override(CLAUDE_GPT_HOME=<isolated temp path>を明示指定し、nested.preflight.home_sourceがenv_overrideになる。このケース自体をerror/failure扱いにしないことも同一テストで確認する=negative control)。新しい harness・daemon・generic telemetry・永続CI required gateは追加しない。
Verification Commands
# AC1
$ rg -n "canonical.*CLAUDE_GPT_HOME|CLAUDE_GPT_HOME.*canonical" docs/dev/runtime-verification-policy.md
# AC2
$ rg -n "not_authenticated" docs/dev/runtime-verification-policy.md
# AC3
$ rg -n "home_source" scripts/claude-gpt/preflight.sh
# AC4
$ rg -n "home_source" scripts/claude-gpt/tests/
# AC5
$ uv run pytest scripts/claude-gpt/tests/test_preflight_home_source.py
# AC6
$ uv run pytest scripts/claude-gpt/tests/test_launch_check_only_home_source_smoke.pyAllowed Paths
docs/dev/runtime-verification-policy.mdscripts/claude-gpt/preflight.shscripts/claude-gpt/tests/
Stop Conditions
- Allowed Paths 外の変更が必要と判明した場合
- In Scope の固定契約(キー集合・スキーマ・型定義)の変更が必要になった場合
- 新規 Issue の起票が必要と判断した場合(スコープ分割が発生する場合)
- 後続 Phase / 別スコープへの波及が判明した場合
- nested SubAgent delegation が必要になった場合
- 外部サービス利用・権限昇格・既存テスト大規模改変が必要になった場合
preflight.shの既存 JSON 出力契約(既存 consumer が参照するキー)を壊す変更が必要になった場合、直ちに停止し設計変更の是非を人間に確認する- credential の中身(token / auth.json content)をログや Issue comment に出力しそうになった場合、直ちに停止し sanitize 方法を確認する
Required Skills
- なし
Required Design References
docs/dev/runtime-verification-policy.mdscripts/claude-gpt/lib.shscripts/claude-gpt/preflight.shscripts/claude-gpt/launch.shscripts/claude-gpt/tests/_latitude_check_only_helper.pydocs/dev/extension-surface-runtime-policy.yaml
Scope Delta(任意)
N/A
Notes for Reviewer
本 Issue は PR #2800(Issue #2772)の AC10 検証セッションで実際に発生した誤判定の再発防止として起票する。
- 発生した誤判定: 検証者が
CLAUDE_GPT_HOME=/tmp/claude-gpt-adoption-check(一度も認証したことのない ad-hoc な fresh temp directory)を明示指定してlaunch.sh --check-onlyを実行し、not_authenticatedを得て「AC10 は environment_blocked。人間による ChatGPT アカウント再認証が必要」と誤って報告した。 - 実際には canonical
CLAUDE_GPT_HOME(scripts/claude-gpt/lib.shの: "${CLAUDE_GPT_HOME:=${HOME}/.claude-gpt}"既定値)のproxy-config/codex/auth.jsonに有効期限内の認証が既に存在しており、override なしで再検証したところauthenticatedとなり、AC10 の 3 シナリオすべてが実際の ChatGPT subscription request で PASS した。 - dedupe 確認済み: Issue 実装: Claude-GPT self-launch で isolated HOME を runtime root に再基準化しない #2455(CLOSED、self-launch 時の isolated HOME 再基準化)と Issue 実装: Claude-GPT launcher の model/proxy 互換性を事前検証し、互換 proxy の復旧経路を提供する #2801(OPEN、proxy catalog/repair)はいずれも本件の failure class(verification harness が任意の temp
CLAUDE_GPT_HOMEを指定して canonical credential namespace を見失う誤判定)をカバーしていない。 preflight.shの JSON 出力フィールド追加の具体的な出力位置は実装者の裁量とする。既存 consumer との互換性を壊さない形で追加すること。フィールド名はhome_source: default | env_overrideに固定する(home_profile: canonical | overrideからの名称変更。理由:CLAUDE_GPT_HOMEの defaulting 箇所はlib.sh:26の1箇所のみで、defaulting 後の最終値だけでは呼び出し元が明示指定したかは判定不能なため、「呼び出し元が override したか」という強い主張を避け、observed source を示す名前にした)。- AC6 は 実装: Claude-GPT の既定モデルを GPT-6 Sol/Astra/Luna に更新し、Auto mode classifier を Luna に戻す #2772 AC10 のような実 ChatGPT subscription request(live network call)を要求しない。「scripts/claude-gpt/** を実際に外部プロセスとして起動し、exit code / stdout / stderr を観測する」ことのみを要求する(
docs/dev/extension-surface-runtime-policy.yamlのclaude-gpt-lifecycle-invocation-changeルール、default_decision: immediate、verification_profile: claude-gpt-process-io-smokeに基づく。exceptions であるclaude-gpt-proven-not-distributed/claude-gpt-production-consumer-inventory-emptyはいずれも本 Issue の対象スクリプトには適用不可)。
再発防止 follow-up の検討(本 Issue のスコープ外、Step 4.5 起票判断用メモ)
以下 2 点の checker gap が今回の investigation で実証された。本 Issue の body・Allowed Paths には含めず、別途 follow-up Issue の起票を検討する:
- (a)
check_issue_contract.pyの C5(AC(\d+)正規表現による AC 番号抽出)が、Acceptance Criteria 本文中の「他 Issue の番号への自然文言及」を自 Issue の必須 AC 番号と誤認識する(本 Issue で実際に発生した false blocker)。 - (b)
contract_schema_versionの numeric 値とchange_kind/ Allowed Paths の semantic mismatch が、readiness を silent に通過しうる(今回は EXTSURF001 と契約修正で早期発見されたが、別 Issue でも再発しうる)。
Scope Collision 事前チェック(policy_class: C1、advisory)
check_issue_overlap.py により scripts/claude-gpt/preflight.sh / scripts/claude-gpt/tests/(directory-level path)で以下と allowed_paths の broad overlap が検出された。いずれも directory-level の広い宣言との重複であり、file-level の実 conflict ではない(#1860 Owner Decision により advisory 起票継続)。
- 実装: Claude-GPT launcher の model/proxy 互換性を事前検証し、互換 proxy の復旧経路を提供する #2801(proxy の model/proxy 互換性検証・catalog/repair): 本 Issue の verification-profile provenance とは異なる関心事。file-level では未確定なため、実装時に
preflight.shの diff が競合しないか確認する。 - 実装: Claude-GPT の既定モデルを GPT-6 Sol/Astra/Luna に更新し、Auto mode classifier を Luna に戻す #2772(GPT-6 model policy 本体。本 Issue の起票元 PR feat: claude-gpt を GPT-6 Sol/Luna 既定へ更新し Astra を on-demand escalation にする #2800 の親): 本 Issue は 実装: Claude-GPT の既定モデルを GPT-6 Sol/Astra/Luna に更新し、Auto mode classifier を Luna に戻す #2772 のマージ後に着手する想定であり、順序上の衝突は発生しない。
- 実装: Claude-GPT 起動時・statusLine で upstream CLI・proxy・モデル更新を非ブロッキング通知する #2773(statusLine 非ブロッキング通知):
scripts/claude-gpt/tests/の directory-level overlap のみ。具体ファイルは重複しない(test_upstream_updates.py等 vs. 本 Issue が触れるhome_source用の新規/既存 preflight テストファイル)。
Delivery Rule
1 Issue = 1 PRとする。- 実装は専用 worktree で行い、Draft PR をデフォルトとする。
Activity
squne121 commentedon Sep 27, 2026
敵対的レビュー結果
判定は
REQUEST_CHANGES相当です。#2803 が狙っている failure class 自体は実在し、#2801・#2455 との切り分けも概ね妥当です。ただし、現在の Issue contract のまま実装すると、誤った出力surfaceを変更する・正しい明示overrideまで異常扱いする・実際に起きた false negative を回帰テストで固定できない可能性があります。
確認対象は current main
46cec468...、起票元 PR #2800 current HEADc37234f9...、関連 #2772 / #2801 / #2455 / #1860、PR #2800 の訂正コメント群、preflight.sh/launch.sh/lib.sh/ runtime verification policy / issue contract parser・path classification です。Issue #2803 自体には現時点でコメントはありません。failure class 自体は確認できる
この Issue の根本原因の説明は妥当です。upstream
claude-code-proxyはCCP_CONFIG_DIRが設定されると configuration root を置き換え、file-backed Codex credential もその配下になります。current upstream でも proxy-owned credential は native Codex credential と独立したものとして扱われています。したがって/tmp/claude-gpt-adoption-check/...と canonical Claude-GPT profile を同じ認証状態として扱うことはできません。 GitHubPR #2800 の訂正履歴とも整合しています。最初は temp
CLAUDE_GPT_HOMEでnot_authenticatedを観測して external blocker と報告しましたが、その後 target launcher と同じ profile で再実行して authenticated になり、live AC10 を完遂しています。これは #2803 を起票する根拠として十分です。関連 Issue との切り分け
#2455 は self-launch 時の runtime-root identity drift、#2801 は selected proxy/model catalog compatibility と repair path であり、今回の「verification invocation が target credential namespace と異なる root を使った」問題とは別 failure classです。新しい proxy repair mechanism を #2803 に持ち込む必要はありません。
#1860 の minimal-harness 方針とも、現在の「docs + 既存 preflight receiptへの小さな additive field + focused test」というサイズ感は整合しています。daemon、generic telemetry、permanent CI gate、新しい approval layer は不要です。
また
Runtime Verification Applicability: not_applicableも、この修正自体については維持してよいと考えます。今回必要なのは provenance wiring の hermetic regression test であり、#2803 を閉じるために再度 real ChatGPT subscription request を必須化する必要はありません。live request は「この変更の実装検証」ではなく、元 failure の背景 evidence として既に存在します。推奨する contract の到達形
核心は「canonical default を強制する」ではなく、verification がどの credential profile を見ているかを明示し、target launcher の profile と一致させることです。したがってタイトルも厳密には「canonical credential profile に束縛する」より「target launcher credential profile の provenance を明示する」に寄せた方が実装意味と一致します。
実装surfaceは増やさず、
preflight.shの既存CLAUDE_GPT_PREFLIGHT_RESULT_V1に例えばhome_source: "default" | "env_override"を additive に追加し、既存canonical_paths.proxy_config_dir/proxy_home_dirと組み合わせて読むのが最小です。launch.sh --check-onlyは既に preflight JSON をそのままネストするため、追加配線は原則不要です。Acceptance Criteria は少なくとも、default/unset と explicit override の両方を launcher boundary でテストし、正しい provenance が nested receipt まで届くことを要求すべきです。さらに explicit override は「異常」ではなく単なる provenance であることを negative control にしておけば、今回とは逆方向の誤判定も防げます。
upstream は 2026-09-23 の v0.1.42 でも GPT-6対応と並行して proxy-owned auth/config storage を維持しており、今回の修正のために upstream 側へ新機構を要求する必要はありません。 GitHub
結論として、#2803 は方向性とスコープサイズは良いものの、P1 3件を直してから implementation loop に渡すべきです。 特に「
preflight.sh --check-onlyの訂正」「canonical/override ではなく target-profile identity の問題として定義」「launcher-boundary regression test」の3点が重要です。squne121 commentedon Sep 27, 2026
確認した live state では、#2803 は open、指定コメント
5854962175は repository OWNERsqune121のコメントです。current main は46cec468bbfafd95dae2fd8e527c057dbb896815、起票元 PR #2800 は open / HEADc37234f9a65ebc6d47fe2422b3a84fe80378749f、#2801 と #2772 と #1860 は open、#2455 は completed です。Claude Code 側では開始時に必ず再取得させるべきです。推奨アクションは以下です。
preflight.run.with_human_contextから currentissue-refinement-loopを開始する。コメントは単なる参考情報ではなく contract rewrite の authority として扱う。preflight.sh --check-onlyを契約しない、canonical|overrideの善悪判定ではなく target launcher と verification の credential-profile identity/provenance を扱う、実launch.sh --check-onlyboundary の hermetic regression を AC/VC に入れる。contract_schema_version: v1、change_kind: codeへの修正も refinement 対象にする。home_source: default | env_overrideのように「入力 provenance」を明確化し、explicit override 自体を failure と定義しない。profile provenance、stored-auth availability、live request acceptance も別 evidence と明文化する。codebase-investigator/web-researcherは planner が required とした場合に起動し、両方必要なら並列化しても Step 2 前に両方 join。Step 2 は現在issue-reviewerSubAgent ではなく root-owned pipeline が正本です。Step 2.5 が applicable ならissue-design-reviewer、rewrite ではissue-editorを起動し、それぞれ完了結果を得るまで downstream に進ませない。change_kind/Allowed Paths の semantic mismatch が readiness をすり抜ける」という汎用 checker gap が実証された場合に、既存 Issue を dedupe 検索したうえで Step 4.5 の canonical follow-up materialization から起票させる。そのまま既存の対話的 Claude Code(Claude-GPT / auto mode)へ貼れる形です。
repo=
squne121/loop-protocol現在すでに auto mode で起動している対話的 Claude Code / repository-owned Claude-GPT セッションをそのまま継続してください。launcher/profile/backend を再起動・変更せず、現在の permission mode も変更しないでください。
bypassPermissions/--dangerously-skip-permissions等は追加しないこと。対象 Issue:
operator-selected direct human context / trusted OWNER anchor:
目的:
current repository の
.claude/skills/issue-refinement-loopを正本として Issue #2803 の contract refinement を実行し、上記 OWNER anchor の REQUEST_CHANGES を反映して、implementation に渡せるapproved状態まで bounded loop を人間承認なしで完遂すること。これは refinement の依頼であり implementation の依頼ではない。
issue-refinement-loopが approved になっても、この invocation ではimpl-review-loop、implementation-worker、production code 実装、実装 PR 作成を開始しないこと。current Skill の #2740 termination contract に従って refinement 完了時点で停止すること。0. 最初に fresh state を取得する
過去の transcript や以下の観測値を current authority とみなさず、開始時点で GitHub / repository から fresh に再取得すること。
参考として、このプロンプト作成時点では:
46cec468bbfafd95dae2fd8e527c057dbb896815c37234f9a65ebc6d47fe2422b3a84fe80378749f必ず fresh に確認する対象:
5854962175の current immutable snapshot / author / target bindingCLAUDE.md.claude/rules/**.claude/skills/issue-refinement-loop/SKILL.mdMUST_READ/ progressive disclosure で要求する referencesreferences/anchor-comment-handling.mdreferences/semantic-design-review.mdreferences/web-research-routing.mdreferences/follow-up-materialization.mdreferences/termination-policy.mdreferences/ac-vc-reflection.md.claude/agents/codebase-investigator.md.claude/agents/web-researcher.md.claude/agents/issue-design-reviewer.md.claude/agents/issue-editor.mddocs/dev/runtime-verification-policy.mdscripts/claude-gpt/lib.shscripts/claude-gpt/preflight.shscripts/claude-gpt/launch.shscripts/claude-gpt/tests/**1. anchor の扱い
anchor comment URL は direct human context として明示すること。
issue-refinement-loopの current contract に従い、canonical main root / default branch からpreflight.run.with_human_contextlane を使用すること。URLだけを渡す unlabeledpreflight.run.with_anchorへ落とさず、agent-report lane にも入れない。conceptually:
squne121/loop-protocolhttps://github.com/squne121/loop-protocol/issues/2803#issuecomment-5854962175current command registry / Skill に定義された exact executor/argv を使用し、古い transcript にある command をコピーしないこと。
anchor の issue/repo/author/trusted-principal binding を検証し、snapshot を固定すること。
2. anchor で要求された contract correction
canonical planner/reviewer/checker を authority とし、以下を prose で勝手に最終判定しないこと。ただし anchor の意味を弱めず、少なくとも次の問題が解消される contract を目標にする。
A. 存在しない
preflight.sh --check-onlyを契約しないcurrent
preflight.shに--check-onlymode が存在しないことを fresh code で確認する。Issue body の Outcome / In Scope / AC / VC が
preflight.sh --check-onlyを要求しているなら修正する。正しい boundary は概ね:
preflight.shの既存通常 result (CLAUDE_GPT_PREFLIGHT_RESULT_V1) に additive な provenance metadata を追加launch.sh --check-onlyがその preflight result を nested receipt として保持するpreflight.sh --check-onlysubcommand は作らないB.
canonical | overrideを success/failure 判定にしないfailure class の本質は「override が存在すること」ではなく、
verification invocation が target launcher invocation と異なる credential profile / effective root を見たこと
である。
正当な例:
CLAUDE_GPT_HOME=/stable/custom-profileを target launcher 自体が意図的に使っている場合、そのenv_overrideは正常な provenance であり異常ではない。したがって contract は例えば:
home_source: default | env_overrideのような provenance metadata を要求してよいが、
env_override == failureという意味にはしないこと。target launcher と verification が同じ effective credential root/profile を参照していることを正しい operational condition とする。
field 名を変更する場合も semantics は曖昧にしない。AC/VC が機械検証可能になる程度にはフィールド契約を明確化すること。
C. launcher boundary の regression test を必須にする
単なる
rgや preflight helper の enum unit test だけで完了させない。既存の hermetic
launch.sh --check-onlytest seam を調査・再利用し、少なくとも:CLAUDE_GPT_HOMEunset/defaultの両ケースで実 launcher boundary を通し、nested
.preflightに provenance field が期待通り到達することを固定する。explicit override ケースは negative control として、override 自体を error 扱いしないことも固定する。
新しい harness、daemon、generic telemetry、permanent required CI gate は作らない。
D. Machine-Readable Contract を current canonical form に直す
fresh canonical contract/parser/readiness rules を確認した上で、少なくとも anchor が指摘している:
contract_schema_version: v1change_kind: codeへの correction を検討し、current SSOT と一致させる。
.sh/.pyを変更する Issue をchange_kind: docsのまま approved にしない。E. evidence の意味を分離する
docs / AC では次の3つを別 evidence として明記する:
home_source=defaultやchatgpt_auth.available=trueだけを runtime/entitlement PASS と呼ばないこと。一方、この Issue 自体の
Runtime Verification Applicabilityは、current contract/reviewer が別判断をしない限りnot_applicableを維持する方向を優先する。今回の implementation verification は docs + receipt wiring + hermetic regression test で完結させ、#2803 を閉じるためだけに real subscription request を再必須化しない。F. provenance の測定点を明確にする
current
lib.shがCLAUDE_GPT_HOMEを defaulting する順序を確認する。「caller が env var を明示したか」という source provenance を測るなら、defaulting 前の入力状態を失わない設計が必要である。
一方「effective location classification」だけを測るなら、その semantics を AC で明記する。
source provenance と effective-path equality を混同しないこと。
3. SubAgent の利用と completion join
SubAgent の利用は必須だが、canonical Skill が
not requiredと判断した agent を形式的に起動して workflow contract を破ってはならない。current planner の decision に従う。
Step 1
REFINEMENT_LOOP_PLAN_V1.decisions.investigation_policy.required == trueの場合:codebase-investigatorを起動するStep 1b
web_research_policy.required == trueの場合:web-researcherを起動するStep 1 と Step 1b が両方 required なら独立作業として並列化してよいが、両者の final result を取得して join するまで Step 2 に進まないこと。
Step 2
canonical Step 2 では
issue-reviewerSubAgent を起動しない。current
run_root_review_pipeline.py produce/ root-owned pipeline を使用する。current Skill が要求する通り:
run_in_background: trueで開始canonical_step2_routeを consumestatus/verdict/next_actionから独自に route を再計算しないStep 2.5
semantic_review_applicable: trueの場合:issue-design-reviewerを current semantic-review transport 経由で起動Step 4
rewrite が必要なら current
issue-editorSubAgent を使う。review feedback/anchor raw body を勝手に再構築せず current opaque forwarding contract に従う。
issue-editor の compact result と authoritative readback を得るまで次へ進まない。
4. trusted contract update / deterministic repair
preflight.run.with_human_contextが trusted contract patch plan / contract update route を返した場合、current Skill の Step 0g をそのまま実行する。必要なら
contract_update.run.with_human_contextを canonical main/root thread から使用する。investigation evidence transport path が発行された場合は current Skill が定める同一 manifest reuse 契約に従い、再生成しない。
apply_deterministic_repair/apply_deterministic_structural_repairが canonical next action なら、人間確認を挟まず current registered consumer で適用し、fresh preflight → fresh review まで進める。NEXT_ACTION: issue_editor_requiredなら、同じ no-progress contract update を繰り返さず current Step 4 full-rewrite lane へ進む。通常の
needs-fix/ REQUEST_CHANGES は max_iterations 内で自動修正・再reviewする。5. title の扱い
anchor は title を
「canonical credential profile に束縛する」
より
「target launcher credential profile の provenance を明示する」
方向へ寄せることも提案している。
ただし body contract の correctness より title mutation を優先しないこと。
current controlled workflow が title update を安全に扱える場合のみ更新を検討する。
title-only mutation が current issue-editor contract 外であり refinement を不要に human escalation させる場合は、title は現状維持でもよい。semantic correctness を Issue body / Outcome / AC / VC で確実に固定し、title wording は non-blocking note として扱う。
6. 再発防止 follow-up
この #2803 自体が既に credential-profile false-negative の再発防止 Issue なので、同じ failure class の重複 Issue は作らない。
ただし investigation 中に、より汎用的な別 failure class、特に以下が current repository で実証された場合は再発防止 follow-up を検討する:
contract_schema_versionと異なる numeric value が readiness を silent に通過するchange_kind: docsなのに Allowed Paths / actual scope に.sh/.pycode/runtime change が含まれる semantic mismatch を canonical readiness が検出できない起票前に GitHub の open/closed Issues と関連 PR を検索し、既存 Issue が同じ failure class を所有していないか dedupe すること。
新規 follow-up が本当に必要なら、raw
gh issue createの独自経路を足さず、currentissue-refinement-loopStep 4.5 /references/follow-up-materialization.mdの canonical materialization route を使用すること。dedupe は title ではなく current contract のdedupe_keyに従う。follow-up は #2803 の implementation scope に混入させず、最小の再発防止 contract とする。
7. 自律実行と停止条件
iteration ごとの人間承認は不要。
通常の:
は自動継続すること。
ただし repository が canonical に要求する genuine:
human_judgment_requiredは成功に偽装せず current termination policy に従う。
また以下は即停止:
credential/token/auth.json の内容を Issue comment、artifact summary、ログへ出さない。
他 task の dirty work、foreign worktree/branch を変更・削除しない。
8. 終了条件
approved になるまで current bounded loop を完遂する。
approved 時は current
issue-refinement-loopの termination contract に従い:LOOP_HANDOFF_RESULT_V1まで完了させる。
ただしこの invocation では、その後の implementation は開始しない。
最後に以下だけを簡潔に報告する:
SubAgent を起動した場合は、それぞれについて dispatch だけでなく actual final result の取得まで完了したことも明示すること。
この prompt は、指定 anchor を単純な「参考コメント」ではなく current Skill の trusted human-context mutation lane に載せる点と、canonical Step 2 で誤って
issue-reviewerを追加起動しない点を特に固定しています。squne121 commentedon Sep 27, 2026
issue-refinement-loop 完了報告(Issue #2803)
結果:
approved(deterministic review:approve/ semantic review:approve(non-blocking finding 1件を warning として記録))反映した主な contract correction(OWNER anchor #2803 (comment) REQUEST_CHANGES 反映)
contract_schema_version: 1→v1、change_kind: docs→codepreflight.sh --check-onlyの契約を撤回し、preflight.sh通常実行結果への additive field 追加 +launch.sh --check-onlyのCLAUDE_GPT_LAUNCH_RESULT_V1.preflightへの自動伝播に修正home_profile: canonical|overrideからhome_source: default|env_overrideに変更し、env_override自体を failure と定義しないよう意味論を修正。credential provenance / stored-auth availability / live request acceptance を別 evidence として明記_latitude_check_only_helper.py)を再利用したlaunch.sh --check-onlyの実 launcher boundary regression test(unset/default・explicit override 両ケース、override を error 扱いしない negative control込み)docs/dev/extension-surface-runtime-policy.yamlのclaude-gpt-lifecycle-invocation-changeルール、EXTSURF001/RUNTIMEASSERT001)の指摘に従い、Runtime Verification Applicabilityをnot_applicable→immediateに修正し、runtime_assertion_bindings(profile: claude-gpt-process-io-smoke / assertion: external_process_exit_code_and_stdio_observed / ac: AC6)を追加。実 ChatGPT subscription request は要求しない(process I/O 観測のみ)ことを明記し、OWNER の「実通信を再必須化しない」という意図と両立させた## Acceptance Criteriaセクション内の「AC10」文字列(他 Issue 実装: Claude-GPT の既定モデルを GPT-6 Sol/Astra/Luna に更新し、Auto mode classifier を Luna に戻す #2772 の AC 番号への言及が正規表現誤マッチしていた)を除去し C5_ac_vc_number_alignment fail を解消SubAgent 実行(すべて final result 取得済み)
codebase-investigator: A〜F の技術事実を現行コードから検証(preflight.sh/launch.sh/lib.sh の実装、既存 hermetic test seam、path_classification.py の分類ルール等)。完了・結果取得済みweb-researcher: upstream claude-code-proxy の credential storage 独立性を一次資料で確認(confirmed)。完了・結果取得済みissue-editor(Step 4 rewrite): 本文書き換え・mutation 実行・readback 確認。完了・結果取得済み(STATUS: ok, BODY_HASH new=e73d3200...)issue-design-reviewer(Step 2.5 semantic review): 4つの重点確認事項すべて resolved/consistent。medium severity の non-blocking finding 1件(AC6 unset/default サブケースの test isolation 詳細)。完了・結果取得済みFollow-up dedupe(新規起票なし)
session 中に実証された checker gap 2件は、いずれも既存 open Issue で既にカバーされているため新規起票せず dedupe した:
C5_ac_vc_number_alignmentが説明文中の他Issue AC番号を誤検出)→ 既存 実装: check_issue_contract.py の C5_ac_vc_number_alignment が AC セクション全体への広域正規表現で説明文中の AC 番号を誤抽出し、かつ VC の余分な AC 参照を検出しない問題を修正する #1712(open)が同一 failure class を所有contract_schema_versionnumeric値の drift → 既存 調査: follow-up Issue の contract_schema_version: 1 反復生成経路を特定し v1 強制策を決定する #2787(open)が同一 failure class を調査中実装は未開始
本 invocation は refinement 専用であり、
impl-review-loop/ implementation-worker / production code 実装 / 実装 PR 作成のいずれも開始していない(#2740 termination contract に従う)。Issue: #2803
squne121 commentedon Sep 27, 2026
確認した current state では、#2803 は
issue-refinement-loop完了済みで、最新 handoff はapprovedです。さらに起票元の PR #2800 はすでに main にマージされ、current main は確認時点で6963eb3a4c4fac2ee240ce8cf71bec1578cadc1cでした。したがって #2803 は今すぐimpl-review-loopに渡してよい状態です。注意点は PR #2802 です。#2801 の実装 PR #2802 は現在 open / Draft で、
launch.sh/lib.sh/scripts/claude-gpt/tests/**を変更しています。ただし #2803 の主要変更対象preflight.sh、runtime verification policy、新規 home-source tests とは直接のファイル衝突は限定的です。待機するより現在 main から進め、#2802 が途中でマージされた場合は currentimpl-review-loopのroute_to_update_branch→ 再検証に任せるのが適切です。また、refinement 中に見つかった再発問題はすでに #1712(AC 番号誤抽出)と #2787(numeric
contract_schema_version)へ dedupe 済みです。現時点で新しい follow-up Issue を作る根拠はないため、重複起票はしていません。実装中に別の再発可能な failure class が実証された場合だけ、既存 Issue を検索してから別 Issue 化させます。そのまま既存 Claude Code / Claude-GPT auto-mode セッションへ貼るプロンプトです。
repo=
squne121/loop-protocol現在すでに auto mode で起動している対話的 Claude Code / repository-owned Claude-GPT セッションをそのまま継続してください。launcher/profile/backend を再起動・変更せず、現在の permission mode も変更しないでください。
bypassPermissions/--dangerously-skip-permissions等を追加しないこと。対象:
#2803
目的:
current repository の
.claude/skills/impl-review-loopを正本として Issue #2803 を実装し、inspect → implement → test → PR → independent verification → PR review → fix → re-test → re-reviewを bounded loop で自律的に実行し、人間が merge 判断できる直前まで完遂すること。
通常の implementation、test failure、CI failure、REQUEST_CHANGES、stale head、BEHIND は人間承認待ちにせず、current Skill の routing に従って可能な限り自動修復すること。
実 merge、auto-merge、force push、履歴破壊、不可逆 cleanup は行わない。
0. current state を必ず fresh に取得する
このプロンプト内の SHA/state は参考値にすぎない。開始時に GitHub と current checkout から再取得すること。
プロンプト作成時点の観測:
6963eb3a4c4fac2ee240ce8cf71bec1578cadc1c実装: Claude-GPT runtime verification の auth 判定を canonical credential profile に束縛する #2803 (comment)
approvede73d32006434f4c88c8b74072019c1c30ebdacce77074677e2e765a97ece4741contract_schema_versionrecurrence の既存 owner必ず再確認するもの:
CLAUDE.md.claude/rules/**docs/dev/workflow.md.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/skills/implement-issue/SKILL.md.claude/skills/pr-review-judge/SKILL.md.claude/skills/open-pr/SKILL.md古い transcript から command、schema、agent responsibility、routing rule をコピーせず、current HEAD を使用すること。
1. Root-Owned Synchronous Entry Transition を守る
current
impl-review-loopの root-owned synchronous entry contract に従う。root/main thread 自身が同一 continuous invocation 内で:
issue-contract-reviewまでを行うこと。
過去の refinement の
approvedcomment、contract snapshot、digest、artifact、invocation token 等を単独の implementation authorization として扱わない。ただし current Issue body が refinement 後の契約を保持していることを fresh に確認したうえで進める。
2. pre-Step-1 landing disposition を必ず評価する
worker/worktree/new PR を作る前に、current
implementation_landed_evidence.py/ Skill が定める Evidence-Based Landing Disposition を実行する。重要:
existing_pr_resumeやimplementation_already_landedと誤判定しない。3. 技術的な実装方針
Issue #2803 の current contract / Allowed Paths を authority にする。
主対象:
docs/dev/runtime-verification-policy.mdscripts/claude-gpt/preflight.shscripts/claude-gpt/tests/**launch.sh/lib.shは Required Design Reference として読むが、#2803 の Allowed Paths 外なら変更しない。3.1
home_sourceの provenance を defaulting 前に捕捉するcurrent
lib.shは source 時に:: "${CLAUDE_GPT_HOME:=${HOME}/.claude-gpt}"を実行するため、
lib.shsource 後にCLAUDE_GPT_HOMEの有無を確認しても caller input provenance は失われる。したがって
preflight.shではlib.shsource 前に必要な input state を snapshot し、home_source: default | env_overrideを決定できるようにすること。
意味:
default: effective root が launcher の defaulting に由来env_override: caller が有効なCLAUDE_GPT_HOMEoverride を与えたenv_override自体は error ではないdefaultに戻さない:=semantics と approved Issue contract を整合させ、勝手に新 enum を増やさないcredential path や credential content を
home_sourceに含めない。CLAUDE_GPT_PREFLIGHT_RESULT_V1の additive top-level field として保持する方向を優先する。そうすれば既存launch.sh --check-onlyの nested:CLAUDE_GPT_LAUNCH_RESULT_V1.preflight.home_sourceへ追加 wiring なしで伝播できる。
新しい
preflight.sh --check-onlysubcommand は作らない。3.2 credential evidence を混同しない
docs では次を別 evidence として明記する:
home_sourcechatgpt_auth.available/chatgpt_auth.detailhome_source=defaultやchatgpt_auth.available=true単独を runtime/entitlement PASS と呼ばない。target launcher invocation と verification invocation が同じ effective credential profile/root を見ることが operational condition であり、
env_overrideそのものを異常扱いしない。3.3 AC6 の hermetic external-process test に注意する
既存:
scripts/claude-gpt/tests/_latitude_check_only_helper.py::run_check_only()は現在
CLAUDE_GPT_HOMEを常に test-owned temp path に設定する。そのまま使うと unset/default ケースを検証できず、AC6 が false-green になりうる。AC6 default ケースでは:
HOMEを設定するCLAUDE_GPT_HOMEを明示的に除去する${HOME}/.claude-gptが test-owned temp 以下になるようにする~/.claude-gptは絶対に使用しないlaunch.sh --check-onlyを起動.preflight.home_source == "default"を確認すること。
override ケースでは:
HOMECLAUDE_GPT_HOME=<temp path>launch.sh --check-only.preflight.home_source == "env_override"env_overrideだからという理由で失敗していないことを確認する。
既存 helper を後方互換な optional parameter で拡張するか、helper の fake-proxy component / seam を再利用して最小 fixture を組むかは current code を見て選ぶ。既存 helper consumer を壊さないこと。
親 auto-mode Claude-GPT session が
CLAUDE_GPT_HOMEを export 済みである可能性があるため、default test ではenv.pop("CLAUDE_GPT_HOME", None)相当を明示的に行い、ambient inheritance を許さない。実 ChatGPT subscription request は #2803 の AC6 には不要。新しい live-network harness、daemon、telemetry、permanent required gate を追加しない。
4. PR #2802 との並行変更
PR #2802 は current では #2801 の Draft implementation PR で、少なくとも以下を変更している:
scripts/claude-gpt/launch.shscripts/claude-gpt/lib.shscripts/claude-gpt/repair_proxy.sh#2803 を #2802 の完了待ちにはしない。
current main から通常通り実装する。
ただしループ途中で #2802 が merge され、#2803 PR が
BEHINDになった場合:impl-review-loopのroute_to_update_branchを使用#2802 の修正を #2803 に取り込む目的で Allowed Paths を拡大しない。
5. Step 1 — implementation-worker
current Skill の static call shape を materialize して
implementation-workerSubAgent を起動する。SubAgent message には暗黙 context に依存せず、少なくとも:
を明示する。
worker は current
.claude/skills/implement-issueを使用して:Closes #2803まで進める。
foreign worktree / dirty work / 他 task の branch を変更・削除しない。
6. SubAgent completion は dispatch ではなく final completion まで待つ
すべての SubAgent で current Common Completion Protocol を厳守すること。
Step 1 implementation-worker、Step 2 test-runner、Step 4 pr-reviewer、および applicable な他の child task について:
spawn_agentが返す canonicaltask_nameを保持wait_agentは mailbox activity 待ちにしか使わないlist_agentsで同じ canonical task が terminalcompletedであることを確認errored/interrupted/shutdown/not_foundを成功扱いしない特に:
7. Step 2 — test-runner independent verification
implementation 完了後、current PR head SHA と current Issue body SHA を取得してから
test-runnerを起動する。Issue #2803 の literal Verification Commands を改変せず渡す。
現在の契約では少なくとも:
rgnot_authenticateddocsrgpreflight.shのhome_sourcehome_sourceuv run pytest scripts/claude-gpt/tests/test_preflight_home_source.pyuv run pytest scripts/claude-gpt/tests/test_launch_check_only_home_source_smoke.pyを current body の exact command として実行する。
test-runner report の:
を root が current live values と独立照合する。
Step 4 前に:
completedVC_ADJUDICATION_RESULT_V1をすべて確認する。
FAIL は通常修正可能 blocker として Step 1 fix loop に戻す。単なる test failure で人間承認待ちにしない。
8. Step 4 — CI + pr-reviewer
current Skill に従い required CI を exact PR head に束縛して待つ。
current main branch protection の required checks も fresh に取得すること。
CI failure:
current-head VC が成立してから
pr-reviewerSubAgent を起動し、current.claude/skills/pr-review-judgeで adversarial PR review を行わせる。pr-reviewerは:-関連 repository implementation
を検査する。
REQUEST_CHANGESの場合:を行う。
reviewed HEAD が変わった場合は stale verdict を採用せず current HEAD で再レビューする。
9. human approval 不要の routing
この invocation では通常の loop iteration ごとの人間承認を要求しない。
current Skill の契約どおり、SubAgent が返す単なる:
human_review_required: trueという自己申告 boolean だけでは停止しない。
以下は自動修復対象:
REQUEST_CHANGESBEHIND停止/escalation は以下に限定する:
実 merge / auto-merge は行わない。
10. 再発防止 Issue
実装・検証・レビュー中に、#2803 の修正そのものとは別の 再発可能な repository-wide failure class が実証された場合:
create-issue/ canonical follow-up materialization を使って Issue を起票既知の dedupe:
contract_schema_version: 1recurrence → 調査: follow-up Issue の contract_schema_version: 1 反復生成経路を特定し v1 強制策を決定する #2787これらと同じ failure class の Issue は重複起票しない。
また、
_latitude_check_only_helper.run_check_only()が現在CLAUDE_GPT_HOMEを常に設定することは #2803 AC6 内で直接修正・対処可能な test-seam concern であり、それだけを理由に別 Issue を作らない。11. 終了条件
current
route_loop_verdict_v2()の canonical result に従う。目標:
その時点で
IMPL_REVIEW_LOOP_RESULT_V1.status: draft_pr_ready相当まで到達し、人間が merge 判断できる状態で停止する。PR を merge しない。
auto-merge を有効化しない。
Issue #2803 を merge 前に手動 close しない。
12. 最終報告
最後に簡潔に以下を報告する:
SubAgent を起動しただけ、PR を作っただけ、test を1回通しただけでは完了扱いにしない。必ず current Skill の terminal completion と merge直前状態まで到達してから final report を返すこと。
特に重要なのは、default ケースの hermetic test で ambient
CLAUDE_GPT_HOMEを明示的に除去することと、PR #2802 が途中で main に入った場合に fresh HEAD で再検証することです。この2点を入れておけば、現在見えている競合・false-green リスクはかなり限定できます。squne121 commentedon Sep 27, 2026
root-owned entry router audit
route: invoke_impl_review_loop
reason: fresh_review_go_live_equality
squne121 commentedon Sep 27, 2026
implement-issue: 実装完了 (2026-09-27)
.claude/worktrees/issue-2803-claude-gpt-home-sourceworktree-issue-2803-claude-gpt-home-sourcehome_sourceの判定を「lib.sh source 前の env var 有無 snapshot」ではなく「source 後の effective 値と canonical default 式${HOME}/.claude-gptの比較」に変更した。launch.sh --check-only経由の nested 呼び出しでは launch.sh 自身の lib.sh source が CLAUDE_GPT_HOME を export 済みにするため、snapshot 方式では default 判定が到達不能になることを AC6 の hermetic 実行で発見したため。fix: PR #2804 レビュー指摘 F1 を反映する(見出し日本語比率)
squne121 commentedon Sep 27, 2026
impl-review-loop: 完了 (2026-09-27T13:30:00Z)
実装: claude-gpt preflight に home_source provenance field を追加する (#2804)