Skip to content

fix: claude_gpt_probe_live_catalog の curl が ambient proxy / default .curlrc を継承しないようにする - #2964

Merged
squne121 merged 4 commits into
mainfrom
worktree-issue-2948-claude-gpt-probe-live-catalog-curl-ambie
Oct 6, 2026
Merged

squne121 merged 4 commits into
mainfrom
worktree-issue-2948-claude-gpt-probe-live-catalog-curl-ambie

Conversation

@squne121

@squne121 squne121 commented Oct 6, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • claude_gpt_probe_live_catalog(repair_proxy.sh の再検証 probe)の readiness curl と catalog curl を、どちらも curl -q --noproxy '*' --fail --show-error -s ... に変更しました。http_proxy / ALL_PROXY / all_proxy / default .curlrc の proxy・connect-to を継承せず、使い捨て loopback proxy へ直接到達します。
  • scripts/claude-gpt/tests/test_probe_live_catalog_ambient_proxy.py を新規追加しました。実 sh -c(production consumer の repair_proxy.sh と同じ shell)が実 lib.sh を source し、実 curl と fake-bin(test 内生成の実行ファイル)を使う process-I/O の regression test です。
  • 同一 failure class は fix: Claude-GPT launcher の loopback 判定を厳密化し、runner help の旧 hook 記述を現在の挙動へ合わせる #2945 の claude_gpt_probe_models で修正済みです。本 PR はその Allowed Paths 外だった 2 箇所だけを同じ方式で揃えます。他の意味的変更はありません。

受け入れ条件の達成状況

  • AC1: 達成。http_proxy / ALL_PROXY / all_proxy の各 case で、素の curl が fake proxy へ流れる control を先に通した上で、target が /v1/models を 2 回以上受信、ambient proxy の受信 0、戻り値は target の catalog であることを確認しました(3 case PASS)。
  • AC2: 達成。$HOME/.curlrc の lane と $XDG_CONFIG_HOME/curlrc(dot なし)の lane を独立した 2 case(parametrize home / xdg)にしました。各 case は自 lane の config だけを materialize し(もう一方の lane の config は存在しないことを assert、CURL_HOME 未設定)、素の curl がその config の proxy へ流れ target に直接届かない control の後に AC1 と同じ結果を確認しました(2 case PASS)。実測注記: 手元の curl 8.5.0 は man page 記載の dot なし $XDG_CONFIG_HOME/curlrc を実際には読まず $XDG_CONFIG_HOME/.curlrc を読むため(doc と実装の乖離)、XDG lane は XDG_CONFIG_HOME 配下に両 filename を書きます。どちらも $HOME/.curlrc とは独立です。
  • AC3: 達成。ambient 設定なしの hermetic env で target の catalog JSON を返し、target が 2 回以上受信することを確認しました。
  • AC4: 達成。curl --fail --show-error で始まる旧形は 0 件で、readiness / catalog の 2 箇所とも curl -q --noproxy '*' で始まります。
  • AC5: 達成。test_repair_proxy.py(10 passed)と test_proxy_model_compatibility.py(13 passed)が PASS しました。
  • AC6: 達成。.curlrc の connect-to(target port から decoy port)で、plain curl と curl --noproxy '*' 単独がいずれも decoy へ流れ target に届かない control を通した上で、実 invocation は target に到達(2 回以上受信)し、decoy 受信 0・ambient proxy 受信 0 でした。

検証コマンド結果

baseline(lib.sh 変更前・test 追加後)と変更後の結果です。

$ uv run pytest scripts/claude-gpt/tests/test_probe_live_catalog_ambient_proxy.py::test_ambient_env_proxy_not_used
baseline: 3 failed(ambient proxy の catalog を返却) / 変更後: 3 passed
$ uv run pytest ...::test_default_curlrc_proxy_not_used
baseline: failed / 変更後: 2 passed([home] / [xdg])
$ uv run pytest ...::test_default_curlrc_connect_to_not_used
baseline: failed(readiness が decoy へ流れ target 受信 0) / 変更後: passed
$ uv run pytest ...::test_no_ambient_proxy_returns_catalog
baseline: passed(通常環境の非退行 guard。baseline-expect: fail は test file 自体が未作成の状態を指す) / 変更後: passed
$ rg --files-without-match --fixed-strings -- "curl --fail --show-error" scripts/claude-gpt/lib.sh
scripts/claude-gpt/lib.sh (exit 0)
$ rg -q "curl -q --noproxy '\*' --fail --show-error -s -o /dev/null -m 1" scripts/claude-gpt/lib.sh
exit 0
$ rg -q "curl -q --noproxy '\*' --fail --show-error -s -m 3" scripts/claude-gpt/lib.sh
exit 0
$ uv run pytest scripts/claude-gpt/tests/test_repair_proxy.py        -> 10 passed
$ uv run pytest scripts/claude-gpt/tests/test_proxy_model_compatibility.py -> 13 passed
$ uv run ruff check / ruff format --check(新規 test file) -> clean

mutation 検証(ローカルで一時変更し、確認後に復元済み):

XDG lane が dot なし `curlrc` のみを書く -> [xdg] FAIL(control 失敗。curl 8.5.0 が読まないため)
XDG lane が何も書かない -> [xdg] FAIL
HOME lane の path を `HOME/curlrc` に変更 -> [home] と connect_to が FAIL([xdg] は green のまま = 相互に mask しない)
readiness curl から -q を削除   -> test_default_curlrc_connect_to_not_used のみ FAIL
catalog curl から -q を削除     -> test_default_curlrc_connect_to_not_used のみ FAIL
catalog curl から --noproxy を削除 -> ambient env proxy 3 case と connect_to が FAIL
readiness curl から --noproxy を削除 -> 4 test FAIL

Allowed Paths 遵守

  • 変更ファイル: scripts/claude-gpt/lib.sh、scripts/claude-gpt/tests/test_probe_live_catalog_ambient_proxy.py
  • Allowed Paths 逸脱: なし

Checks

  • Runtime Verification Applicability は immediate。curl が無い環境では exit 77(environment-unavailable。PASS ではない)で停止し、SKIP を PASS に昇格しません。
  • TypeScript の pnpm typecheck / pnpm lint / pnpm test / pnpm build は本変更(shell と Python test のみ)の対象外で、Issue の Verification Commands にも含まれません。

Schema Change Applicability

  • decision: not_schema_change
  • reason: machine-readable schema の変更はなく、shell 関数内の curl option の追加と regression test の追加のみです。

Schema Consumer Inventory

N/A
reason: schema 変更がないため consumer の更新対象はありません。

Safety Claim Matrix

Claim Implemented? Not controlled Evidence Follow-up
claude_gpt_probe_live_catalog の 2 箇所の curl は ambient proxy / default curlrc を継承せず loopback target へ直接到達する(repair_proxy.sh の installer 取得 curl は外部 URL 向けで本 claim の対象外) yes N/A test_probe_live_catalog_ambient_proxy.py の 7 case(control assertion 付き。AC2 は HOME / XDG の独立 2 case)と mutation 検証 N/A

Notes

IMPLEMENTATION_SCOPE_COVERAGE_V1:
  schema_version: "IMPLEMENTATION_SCOPE_COVERAGE_V1"
  issue_number: 2948
  issue_body_sha256: "sha256:34bffa891fbc636e82113be835c480704ec5e87720486191c8b6bfb1aceed7f4"
  normalized_scope_manifest_sha256: "sha256:8fb1e9968f51571c0e64edc0b26bdb3236aa1b65c00c4b38d67d4e44867bf6e8"
  pr_head_sha: "246592de8beeca8e21e97bdcd96efbf74a43e146"
  scope_manifest: {"acceptance_criteria": [".curlrc の connect-to(target port → decoy port)下で、control として plain curl と curl --noproxy '*' 単独がいずれも decoy へ流れ target には到達しないことを示したうえで、claude_gpt_probe_live_catalog の実 invocation は target に到達し(/v1/models を 2 回以上受信)、decoy の受信は 0、ambient proxy の受信も 0 である。readiness curl と catalog curl のどちらか一方でも -q を欠くとこの test は FAIL する。", "HOME / XDG_CONFIG_HOME の .curlrc に fake proxy を設定しても、AC1 と同じ結果になる(事前に plain curl が .curlrc proxy へ流れる control assertion を通す)。", "ambient proxy 設定がない通常環境でも、claude_gpt_probe_live_catalog は従来どおり target の catalog JSON を返す。", "http_proxy / ALL_PROXY / all_proxy のいずれかに fake loopback proxy を設定しても、claude_gpt_probe_live_catalog の readiness と catalog 取得 request は使い捨て target(fake-bin)が受信する(/v1/models を 2 回以上受信)。ambient fake proxy の受信は 0 で、戻り値は target の catalog である。事前に plain curl が ambient proxy へ流れる control assertion を同 test 内で通す。", "scripts/claude-gpt/lib.sh の claude_gpt_probe_live_catalog の readiness curl(-o /dev/null -m 1)と catalog curl(-m 3)の 2 箇所が、いずれも curl -q --noproxy '*' で始まり、curl --fail --show-error で始まる旧形が残っていない。", "既存の test_repair_proxy.py と test_proxy_model_compatibility.py が PASS し、回帰がない。"], "allowed_paths": ["scripts/claude-gpt/lib.sh", "scripts/claude-gpt/tests/test_probe_live_catalog_ambient_proxy.py"], "change_kind": "code", "goal_ref": "repair_proxy.sh の再検証 probe が ambient な proxy 設定や default .curlrc に影響されず、使い捨て loopback proxy へ直接到達する状態にする", "in_scope": [".curlrc の connect-to(target port → decoy port)case の focused regression test を追加する。control として、同じ hermetic env で plain curl と curl --noproxy '*' 単独がいずれも decoy へ流れることを test 内で先に示す。親 env は PATH / HOME / XDG_CONFIG_HOME のみから作り直し、host の NO_PROXY / CURL_HOME 等で偶然 green にならないようにする。", "HOME / XDG_CONFIG_HOME 配下の .curlrc に proxy = ... を書いた状況の focused regression test を追加する。", "claude_gpt_probe_live_catalog の 2 箇所の curl を curl -q --noproxy '*' ... にする(-q は最初の option)。", "fake target + fake proxy で http_proxy / ALL_PROXY / all_proxy 下の挙動を固定する focused regression test を追加する。", "readiness curl と catalog curl の両方について、curl -q --noproxy '*' で始まることを static VC でも positive に確認する(補助 evidence。primary evidence は behavioral regression)。", "scripts/claude-gpt/repair_proxy.sh は consumer として挙動が変わらないことを既存 test で確認する(原則変更しない)。"], "schema_version": "IMPLEMENTATION_SCOPE_MANIFEST_V1"}

…curlrc を継承しないようにする (#2948)

readiness loop と catalog 取得の 2 箇所の curl を `curl -q --noproxy '*'` にし、http_proxy / ALL_PROXY /
all_proxy / default .curlrc の proxy・connect-to に関わらず 127.0.0.1 の使い捨て proxy へ直接到達させる。
実 curl・実 bash・fake-bin による focused regression test を追加した。

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@github-actions

github-actions Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Preview URL

Preview removed (PR #2964 closed).

@squne121

squne121 commented Oct 6, 2026

Copy link
Copy Markdown
Owner Author

判定

REQUEST_CHANGES を推奨します。
ただし、lib.sh の実装方針そのものは妥当です。blocker は主に regression test が XDG の実際の curl config path を検証できておらず、AC2 を false-green にしていることです。

レビュー時点の PR #2964 は Draft / open、current HEAD は 3a3f8d5943c72580471fdfe727cf8b39f03a15e7、変更は lib.sh と新規 test の2ファイルだけです。current-head CI は ci を含む5 workflow が success、python-test-core も 18205 passed, 94 skipped, 1 xfailed です。review thread / submitted review はまだありません。

Findings

1. [P1 / blocker] XDG の .curlrc regression が実際には XDG config を読ませておらず、AC2 が false-green です。

問題: 新規 test_probe_live_catalog_ambient_proxy.py::_write_curlrc() は、HOME と XDG_CONFIG_HOME の両方に .curlrc を書いています。しかし curl の公式 manpage での default config search order は、

$CURL_HOME/.curlrc → $XDG_CONFIG_HOME/curlrc → $HOME/.curlrc

です。XDG 側だけファイル名にドットがありません。この仕様は curl 7.73.0 からなので、PR が検証に使った curl 8.5.0 にも該当します。[Curl](https://curl.se/docs/manpage.html)

現在の test は $XDG_CONFIG_HOME/.curlrc を curl に読ませていません。それでも control が成立するのは、同時に作った正しい $HOME/.curlrc が読まれるためです。したがって PR body の「HOME / XDG_CONFIG_HOME の .curlrc を検証した」という AC2 証跡は過大です。

Impact: product code の -q は正しいため、現状の機能修正自体が壊れているわけではありません。しかし XDG lane の regression coverage はゼロなのに AC2 PASS と判定できるため、この PR がまさに避けようとしている false-green を新 test 自身が持っています。さらに merged PR #2945 の predecessor regression にも同じ XDG .curlrc 誤認が残っています。

最小修正: 新 test だけで、HOME と XDG を独立 case にしてください。例えば helper が location を受け取り、

  • HOME case: $HOME/.curlrc
  • XDG case: $XDG_CONFIG_HOME/curlrc

の片方だけを materialize し、それぞれ plain curl control → production invocation を確認する形が最小です。単に2箇所へ同じ config を同時に書くと、検索優先順位の高い方だけで green になり、もう片方を証明できません。

Issue #2948 本文自体も $XDG_CONFIG_HOME/.curlrc と記述しているので、upstream 仕様に合わせて contract wording も訂正すべきです。新しい gate や harness は不要です。

なお production 変更の curl -q --noproxy '*' 自体は正しいです。公式仕様上、-q は最初の parameter に置くと default config を読まず、--noproxy '*' は全 host を match して proxy を実質無効化します。[Curl](https://curl.se/docs/manpage.html)


2. [P2 / runtime-evidence mismatch] process-I/O test が production contract の sh ではなく bash で lib.sh を評価しています。

lib.sh は #!/bin/sh かつ repository 上で「POSIX sh 準拠」と明記され、production consumer の repair_proxy.sh も #!/bin/sh です。Issue #2948 の runtime execution environment も sh -c '. lib.sh; ...' を要求しています。

一方、新 test の _run_probe() は bash -c で source しています。今回追加された curl options 自体には bash dependency はないので、現在の product bug ではありません。ただし今後この関数に bashism が紛れた場合、runtime verification は green のまま production sh が壊れる余地があります。

最小修正: _run_probe() を sh -c に変更してください。新しい shell matrix は不要です。current Issue contract と実 consumer の1経路に合わせるだけで十分です。


3. [P2 / workflow friction] curl availability preflight と実行時 PATH が別 authority なので、一部 dev 環境で false-red になります。

fixture は shutil.which("curl") で 現在の host PATH を使って curl の存在を確認しますが、その後 _hermetic_env() は PATH を固定の /usr/local/bin:/usr/bin:/bin に置換します。

そのため Nix/dev-shell 等で curl が別 path にある場合、

  1. shutil.which("curl") は成功
  2. exit 77 の environment-unavailable route には入らない
  3. subprocess では curl が見つからず test failure

となり得ます。これは security 上の問題ではなく、ユーザーが重視している 正規 workflow を無駄に止める test harness friction です。既存 _launcher_harness.py::base_env() は os.environ.get("PATH", "/usr/bin:/bin") を使っており、新 test の hard-coded PATH は repository precedent からも逸脱しています。

最小修正: host PATH を保持し、proxy / NO_PROXY / CURL_HOME 等の今回 isolation したい変数だけ落とす既存方針に揃えるのが適切です。追加の環境抽象化は不要です。

問題なしと判断した点

lib.sh の readiness / catalog 両方を curl -q --noproxy '*' にする本体変更は scope に合致しています。特に AC6 の connect-to test の設計は妥当です。curl の --connect-to は論理 URL を変えず TCP 接続先だけを別 host/port に置換するので、--noproxy '*' だけでは default curlrc の connect-to を無効化できません。このため「-q を片方だけ外す mutation を落とす」という test は意味があります。[Curl](https://curl.se/docs/manpage.html)

また、fake binary が模倣している upstream interface も stale ではありません。現在の claude-code-proxy は serve [--port <PORT>] [--no-monitor] を正式にサポートし、GET /v1/models も current HTTP API です。したがって live ChatGPT を使わず local fake process で lifecycle/routing を検証する選択は妥当です。[claude-code-proxy](https://claude-code-proxy.raine.dev/reference/command-reference/?utm_source=chatgpt.com)

最初に気になった PR body の IMPLEMENTATION_SCOPE_COVERAGE_V1.pr_head_sha = 246592de… と current HEAD 3a3f8d59… の差も、finding にはしません。current open-pr 実装ではこの marker は明示的に immutable な publication-time snapshot とされ、PR 作成後の main merge で HEAD が進んでも書き換えない設計です。freshness は current-head CI/review 側で担保する契約で、今回その current-head CI は成功しています。

推奨修正順

まず Finding 1 を直し、HOME/XDG の2 lane を独立 control 付きで再実行してください。同じ commit で Finding 2 の bash → sh と Finding 3 の PATH 修正も小さく入れるのが合理的です。その後 current HEAD で focused tests、既存 test_repair_proxy.py / test_proxy_model_compatibility.py、current-head CI、fresh review を再実行すれば十分です。新規 schema、wrapper、恒久 gate、security layer は不要です。

#2945 にも同じ XDG filename 誤認があるため、#2964 の Allowed Paths 外を無理に広げず、#2964 修正後に既存 Issue を dedupeし、なければ predecessor regression の XDG lane 修正を小さい follow-up Issue にするのが適切です。これは #2964 の product fixを広げる理由にはしません。

@squne121

squne121 commented Oct 6, 2026

Copy link
Copy Markdown
Owner Author

推奨は PR #2964 をそのまま再利用して修正です。Target comment の P1 は妥当で、curl の現行公式仕様では default config の探索順が $CURL_HOME/.curlrc → $XDG_CONFIG_HOME/curlrc → $HOME/.curlrc であり、XDG 側は .curlrc ではありません。また -q は先頭 parameter の場合に default config 読み込みを無効化し、--noproxy '*' は proxy を実質無効化します。[Curl](https://curl.se/docs/manpage.html)

Issue #2948 自体にも同じ XDG path 誤記があるため、小さい contract correction → fresh contract review → 既存 #2964 を impl-review-loop で resume の順が最も整合的です。前回ログでも #2964 は terminal approval まで到達した一方、Draft のまま merge/auto-merge は実施していません。貼り付けたテキスト(1)

そのまま fresh interactive Claude Code に貼る prompt です。

repo = squne121/loop-protocol

対象:

  • PR: #2964
  • linked Issue: #2948
  • human-context / fix directive:
    https://github.com/squne121/loop-protocol/pull/2964#issuecomment-6016466765
  • primary repository-native Agent Skill:
    .claude/skills/impl-review-loop/SKILL.md

あなたは既に auto mode で起動済みの fresh interactive Claude Code session にいる。この session をそのまま継続すること。Claude Code 自体を再起動せず、permission mode も変更しないこと。

目的

PR #2964 に対する OWNER comment #issuecomment-6016466765 の REQUEST_CHANGES findings を修正し、current repository の正規 workflow に従って、

contract correction / fresh contract review → existing PR resume → fix_delta implementation → current-head verification → required CI → fresh PR review → fix/re-review iteration → terminal gate

まで自律的に進め、current impl-review-loop が定義する merge 判断直前の terminal state(通常 IMPL_REVIEW_LOOP_RESULT_V1.status: draft_pr_ready, termination_reason: approved)へ到達させる。

新しい PR / branch / worktree を重複作成しない。既存 PR #2964 とその canonical worktree / branch を原則再利用すること。

実 merge、auto-merge、force push、history rewrite、不可逆 cleanup は実行しない。


この invocation における human-context の扱い

target comment:

https://github.com/squne121/loop-protocol/pull/2964#issuecomment-6016466765

は、この invocation で私が明示的に選択した human-context / requested fix directive である。

current impl-review-loop / build_intake_capsule.py が PR top-level conversation comment を --human-context-comment-url として受理する current contract なら、その正規 provenance lane へ明示的に渡すこと。

このコメント内の REQUEST_CHANGES は「ここで作業を止めろ」という現在の指示ではなく、列挙された findings を修正して再 review せよという今回の修正指示として扱う。この prompt が、その修正・再検証・再reviewを継続する最新の人間指示である。

ただし、開始後に別の current OWNER comment で明示停止が追加された場合や、canonical planner/checker が genuine hard stop を返した場合は無視しない。


最初に fresh 取得すること

過去 transcript、この prompt に記載した SHA、過去の terminal result を authority にしない。

開始時に最低限 fresh に確認する:

Skill / Agent の procedure や schema は名前だけから推測せず、current HEAD を読むこと。


この prompt による明示的承認

今回の invocation では、以下の非破壊的作業を iteration ごとの人間承認なしで実行することを明示的に承認する。

これは Claude Code の permission bypass の承認ではない。

以下は変更・要求しない:

  • bypassPermissions
  • --dangerously-skip-permissions
  • permission mode の変更
  • hooks による permission bypass

Phase A — Issue #2948 の contract correction

target comment の Finding 1 により、current Issue #2948 自身も curl upstream semantics と不一致である。

stale contract のまま Step 2 / Step 4 の body binding を作らないこと。

まず current repository-native procedure に従い、Issue #2948 を必要最小限だけ訂正し、fresh contract review/readiness が成立してから PR 修正へ進む。

可能なら current issue-refinement-loop の canonical workflow を使う。target PR comment を Issue refinement の anchor として current tooling が直接受理しない場合、origin を偽装したり agent-generated comment を human-context と誤表示したりしないこと。

その場合でも、以下の upstream fact は fresh web research + repository evidence で独立確認し、current Issue contract の factual error として canonical refinement で修正すること。

contract correction の必須内容

curl official documentation を fresh 確認すること。

default config search path は少なくとも Unix 系で:

  • $CURL_HOME/.curlrc
  • $XDG_CONFIG_HOME/curlrc
  • $HOME/.curlrc

であり、XDG の filename は curlrc(dot なし)。

Issue #2948 の次の趣旨を修正する:

  1. In Scope / AC2:

    • HOME lane: $HOME/.curlrc
    • XDG lane: $XDG_CONFIG_HOME/curlrc
    • 2 lane を独立して materialize / control すること。
    • 同時に両方へ config を書いて一方の成功でもう一方を証明したことにしない。
  2. Runtime Verification execution environment:

    • production consumer と一致する sh -c '. lib.sh; ...' を authority とする。
    • PATH は current host PATH / existing repository harness precedent を保持する。
    • HOME / XDG_CONFIG_HOME は test temp に束縛する。
    • CURL_HOME, NO_PROXY, no_proxy, proxy vars 等、今回 isolation 対象の ambient variables は継承しない。
    • hard-coded /usr/local/bin:/usr/bin:/bin と host-side curl preflight の authority split を作らない。
  3. Verification Commands:

    • 不要に command 名を増やさない。
    • test_default_curlrc_proxy_not_used を HOME/XDG の parameterized independent cases にできるなら existing VC を維持してよい。
    • command 自体を変える必要がある場合だけ Issue VC を訂正し、その後 fresh body SHA / command hashes を使用する。
  4. Allowed Paths:

    • repository file の Allowed Paths は原則そのまま:
      • scripts/claude-gpt/lib.sh
      • scripts/claude-gpt/tests/test_probe_live_catalog_ambient_proxy.py
    • predecessor regression の修正をこの PR に混ぜない。

これは scope expansion や新 schema/harness の導入ではなく、upstream fact と runtime contract の factual correction である。

contract mutation 後は、current root-owned entry / current-run contract review を fresh に行い、new Issue body SHA に対する current go / readiness を確認してから Phase B へ進むこと。

過去の body SHA や contract snapshot を再利用しない。


Phase B — PR #2964 の fix_delta

existing PR #2964 を resume する。

current implementation-worker.md に V2 repair contract が存在する場合は、canonical apply_pr_review_fix_delta lane を使用する。古い名前や手組み repair path を使わない。

target comment の review artifact URL と fresh current head を race guard に束縛すること。

修正対象は原則:

scripts/claude-gpt/tests/test_probe_live_catalog_ambient_proxy.py

production lib.sh の curl -q --noproxy '*' 実装自体は、fresh inspection で別 defect が見つからない限り変更しない。

Finding 1 — XDG false-green を修正

current _write_curlrc() のように HOME と XDG の両方へ同じ filename/config を同時 materialize しない。

最低限:

HOME lane

  • $HOME/.curlrc のみ作る
  • $XDG_CONFIG_HOME/curlrc は存在させない
  • CURL_HOME を設定しない
  • plain curl control が fake proxy へ diversion され target へ直接到達しないことを確認
  • production probe は target に直接到達し ambient proxy hit 0

XDG lane

  • $XDG_CONFIG_HOME/curlrc のみ作る
  • $HOME/.curlrc は存在させない
  • CURL_HOME を設定しない
  • plain curl control が XDG config を実際に読んで fake proxy へ diversion されることを確認
  • production probe は target に直接到達し ambient proxy hit 0

HOME/XDG のどちらか一方が壊れた場合に、もう一方の config によって test が green にならないこと。

AC2 test を parameterize して 2 independent cases にするのは可。

.curlrc connect-to / AC6 の primary -q regression は維持する。不要な matrix 拡張はしない。


Finding 2 — production shell と runtime verification を一致

_run_probe() は bash -c ではなく production contract / repair_proxy.sh と同じ sh -c で real lib.sh を source する。

shell matrix は追加しない。

現在の curl option 修正が POSIX sh 上で成立することを直接検証する。


Finding 3 — PATH authority split を解消

curl availability preflight と実 subprocess が同じ PATH authority を使うこと。

current repository precedent(例: launcher harness)が現在も同じ方針なら、それに合わせ:

  • PATH = os.environ.get("PATH", "/usr/bin:/bin") 相当で host/current PATH を保持
  • HOME / XDG_CONFIG_HOME は temp
  • proxy-related env / NO_PROXY / no_proxy / CURL_HOME 等は scrub

とする。

新しい environment abstraction / wrapper / sandbox layer は作らない。

Nix/dev-shell 等で shutil.which("curl") は成功するのに test subprocess だけ curl が見えない false-red を除去する。


target comment で blocker ではないとされた事項

次は不要に修正しないこと。

  • lib.sh の curl -q --noproxy '*' 本体方針
  • AC6 の connect-to による -q mutation detection
  • local fake process / fake proxy / decoy による runtime verification
  • IMPLEMENTATION_SCOPE_COVERAGE_V1.pr_head_sha が publication-time snapshot であること

特に IMPLEMENTATION_SCOPE_COVERAGE_V1.pr_head_sha を current head に追随させるためだけの PR body rewrite はしない。current open-pr contract が immutable publication-time snapshot としているなら、その contract を維持する。


PR body の更新

実装後、PR body の人間可読 evidence を current state に合わせる。

最低限:

PR body 更新には current repository の open-pr / wrapper / evaluator がある場合それを使う。


SubAgent 利用と completion protocol

必要な SubAgent を積極的に使う。

少なくとも primary implementation loop では:

  1. implementation-worker

    • target comment findings の fix_delta
    • existing worktree / branch / PR を使用
    • Allowed Paths 内だけを編集
  2. test-runner

    • new Issue body / new PR head に束縛
    • live Verification Commands の (ac, raw_command, command_hash) を canonical extractor から逐語で渡す
    • TEST_VERDICT_MACHINE/v2 の current contract に従う
  3. pr-reviewer

    • fresh current head
    • corrected Issue contract
    • full PR diff
    • Verification evidence
    • required CI
      を渡して fresh review

contract correction が current repository workflow 上 SubAgent を要求する場合:

  • codebase-investigator
  • web-researcher
  • issue-editor
    等も current Skill の指示に従って使う。

SubAgent は dispatch だけで完了扱いにしない。

各 dispatch について:

  • final result を取得
  • canonical task state が terminal completed であることを確認
  • result と completed の両方を確認

してから downstream step へ進む。

errored / interrupted / shutdown / not_found を success 扱いしない。


Verification

Issue #2948 の mutation 後の current body から Verification Commands を再抽出する。

旧 body SHA / old command hashes は使用禁止。

最低限、fresh head で:

  • AC1 env proxy cases
  • AC2 HOME / XDG independent default-config cases
  • AC3 normal environment
  • AC4 static curl shape checks
  • AC5:
    • test_repair_proxy.py
    • test_proxy_model_compatibility.py
  • AC6 connect-to case

を実行する。

追加で focused test file 全体を実行し、

  • HOME case の control が本当に HOME config を読んでいる
  • XDG case の control が本当に $XDG_CONFIG_HOME/curlrc を読んでいる
  • HOME config が XDG case を mask していない
  • XDG config が HOME case を mask していない
  • sh -c で production invocation が成功する
  • runtime PATH 上で curl が見える
  • target hit >= contract requirement
  • ambient proxy / decoy hit = 0

を確認する。

可能なら targeted mutation check も行い、XDG config path を誤って .curlrc に戻した場合に XDG test が red になることを確認する。

mutation を permanent commit に残さず、復元を確認する。


CI / review / feedback loop

修正 commit を push した後は old HEAD の証拠を使わない。

current head で:

  1. Step 2 independent verification
  2. canonical VC adjudication
  3. required CI
  4. Step 4 fresh PR review
  5. Step 5 terminal gate

の順で進める。

REQUEST_CHANGES は通常の loop continuation として扱い、自動修正可能なら human approval を求めず次 iteration へ進む。

以下は通常の停止理由ではない:

  • REQUEST_CHANGES
  • deterministic/mechanical fix
  • test failure
  • 本 PR に起因し修正可能な CI failure
  • stale head
  • BEHIND
  • PR body hygiene
  • fresh re-review の必要
  • advisory artifact の stale/missing

main が進み BEHIND になった場合は current canonical update_branch action を implementation-worker に委譲し、head が変わったら verification と PR review を必ず再実行する。

CI failure が PR diff と無関係な known/flaky failure と具体的に確認できる場合は、証拠を取得した上で bounded rerun を行ってよい。繰り返し failure や causal ambiguity は success に偽装しない。


fresh reviewer の重点確認

pr-reviewer には target comment の以下を明示的な review focus として渡す:

  • $XDG_CONFIG_HOME/curlrc の実 config path が本当に検証されているか
  • HOME / XDG が independent で、一方が他方を mask していないか
  • control assertion が non-vacuous か
  • runtime invocation が sh -c か
  • curl preflight と subprocess PATH が一致しているか
  • CURL_HOME, proxy env, NO_PROXY 等による accidental green がないか
  • AC1–AC6 / runtime contract / PR body の claims と evidence が一致するか
  • Allowed Paths を超えていないか
  • predecessor regression を fix: claude_gpt_probe_live_catalog の curl が ambient proxy / default .curlrc を継承しないようにする #2964 に混ぜていないか

APPROVE 単独では終了せず、current step5-terminal-gate の terminal approval を authority とする。


再発防止 / predecessor regression

target comment は merged PR #2945 の predecessor regression
scripts/claude-gpt/tests/test_connected_proxy_diagnostics.py
にも同じ XDG filename 誤認が残っていると指摘している。

これは #2964 の Allowed Paths 外なので この PR に混ぜない。

primary #2964 loop を merge直前 terminal state まで先に完了させる。

その後、別作業として open/closed Issue を fresh dedupe する。

検索対象例:

  • XDG_CONFIG_HOME curlrc
  • XDG .curlrc
  • test_connected_proxy_diagnostics curlrc
  • #2945 XDG
  • curl config search path

同じ defect を所有する既存 Issue があれば新規作成せず、その URL を final report に記載する。

既存 Issue がなければ、current repository の issue creation workflow / issue-creator が利用可能ならそれを使い、小さい follow-up Issue を起票する。

follow-up の scope は概ね:

ただし current Issue #2948 / current canonical workflow が「新規 Issue 起票判断そのもの」を genuine human_judgment_required hard stop として primary loop 中に返す場合は、その authority を prose で迂回しない。

その場合:

  • primary loop を可能な範囲で current canonical terminal まで進める
  • follow-up creation を post-terminal separate action として扱えるか current workflow を確認
  • hard stop がなお成立するなら exact reason code / evidence を報告する

停止境界

以下の場合のみ停止 / escalate する:

  • destructive operation
  • secret / credential の取得・変更・公開
  • force push / history rewrite
  • actual Git conflict / mergeable == CONFLICTING / merge state DIRTY
  • current canonical workflow の genuine human_judgment_required
  • current OWNER による、この invocation 開始後の新しい明示停止指示
  • Allowed Paths 外の product/repository file 変更が不可避
  • irreconcilable Issue contract conflict
  • policy bypass が必要
  • evidence integrity を維持できない
  • canonical max_iterations 到達
  • foreign worktree / branch / dirty work を変更する必要がある

他 task の dirty work / foreign worktree / branch は変更・削除しない。


完了条件

終了前に fresh に確認する:

Preferred terminal:

IMPL_REVIEW_LOOP_RESULT_V1.status: draft_pr_ready
termination_reason: approved

merge / auto-merge はしない。

current Skill が Draft terminal を要求するなら Draft のまま維持する。


最終報告

最後に簡潔に以下を報告する:

  1. final IMPL_REVIEW_LOOP_RESULT_V1 status / termination reason
  2. Issue 実装: claude_gpt_probe_live_catalog の curl が ambient proxy / default .curlrc を継承せず loopback へ直接到達するようにする #2948 contract correction の内容と fresh body SHA
  3. target comment Finding 1–3 への修正対応
  4. 実装した file changes
  5. AC1–AC6 / runtime verification 結果
  6. HOME / XDG independent lane の evidence
  7. sh / PATH 修正の evidence
  8. 使用した SubAgents と、各 task について final result + terminal completed の両方を取得したこと
  9. PR fix: claude_gpt_probe_live_catalog の curl が ambient proxy / default .curlrc を継承しないようにする #2964 URL / branch / current head SHA
  10. required CI / fresh PR review / mergeability / terminal gate
  11. review iteration 中の REQUEST_CHANGES / CI failure と修正内容
  12. recurrence dedupe 結果
  13. follow-up Issue URL、または起票しなかった理由
  14. 残 blocker
  15. merge / auto-merge / force push を実行していないこと

調査・計画・SubAgent dispatch だけで終了しない。
current canonical workflow が許す範囲で、修正 → 検証 → fresh review → terminal gate まで完遂すること。

この版は、対象 comment の修正だけでなく、Issue contract 自体の false-green を先に解消してから同じ PR を再検証する構成です。#2945 側の同型 regression は #2964 に混ぜず、terminal 後の dedupe付き follow-up としています。

squne121 and others added 2 commits October 6, 2026 21:58
…TH を production に合わせる

- AC2 の test_default_curlrc_proxy_not_used を home / xdg の parametrize にし、各 lane で片方の config のみ materialize(もう一方の不在を assert、CURL_HOME 未設定)
- AC6 は HOME lane 単独の config に変更
- _run_probe を bash から sh(production と同じ)へ変更
- _hermetic_env の PATH を親 env の PATH 由来に変更(preflight と authority を一致)
- docstring の XDG 記述を訂正

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@squne121
squne121 marked this pull request as ready for review October 6, 2026 13:28
@squne121
squne121 merged commit fffa71d into main Oct 6, 2026
61 of 68 checks passed
@squne121
squne121 deleted the worktree-issue-2948-claude-gpt-probe-live-catalog-curl-ambie branch October 6, 2026 13:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

実装: claude_gpt_probe_live_catalog の curl が ambient proxy / default .curlrc を継承せず loopback へ直接到達するようにする

1 participant