Skip to content

実装: claude-gpt launcher の GitHub auth を native 同等に共有する (#2299) - #2303

Merged
squne121 merged 2 commits into
mainfrom
worktree-issue-2299-claude-gpt-native-gh-auth
Aug 22, 2026
Merged

squne121 merged 2 commits into
mainfrom
worktree-issue-2299-claude-gpt-native-gh-auth

Conversation

@squne121

@squne121 squne121 commented Aug 22, 2026 •

Copy link
Copy Markdown
Owner

概要

Closes #2299(本 PR は Issue #2299 の実装を完了する)

isolated Claude-GPT session が Claude Code 本体と同等の GitHub access で、既存の
issue-creator/create-issue workflow を安定して完走できるようにする。

変更内容

検証コマンド結果

コマンド 結果
bash scripts/claude-gpt/launch.sh --check-only 静的確認済み(--check-only は現行のプロキシ起動確認までのため、AC1 の GH auth passthrough 自体は credential sentinel test で実 launch.sh 起動により live 確認)
bash scripts/claude-gpt/runtime_smoke_test.sh --scenario issue_create PASS(3 回連続 live 実行、flakiness なし) — 1 回目のみ acme-test/fake-repo という trusted repo 外の名前を使っていたため autoMode second-gate classifier に拒否される flake を検出し、fake provider への repo 引数を CLAUDE_GPT_TRUSTED_REPO(squne121/loop-protocol)に固定して解消(fake_gh.py は network を一切叩かないため real GitHub には影響しない)
rg -n "CLAUDE_GPT_ISOLATION_PROFILE" .claude/skills/create-issue/scripts/create_issue_txn.py exit 1(該当なし、想定通り)
uv run --locked pytest .claude/skills/create-issue/tests/test_create_issue_txn.py -v 129 passed
uv run --locked pytest scripts/claude-gpt/tests/test_issue_create_bridge_credential_sentinel.py -v 3 passed
bash scripts/claude-gpt/live_issue_create_canary.sh(opt-in なし) SKIP(exit 77) を静的に確認(shellcheck + bash -n 構文確認、opt-in 経路自体は未 opt-in で live 実行せず)
pnpm typecheck PASS
pnpm lint PASS
pnpm test PASS(1872 tests)
pnpm build PASS
uv run --locked pytest scripts/claude-gpt/tests/ .claude/skills/create-issue/tests/ 450 passed, 1 skipped(既存 skip は本変更と無関係)
ruff check(変更 python ファイル) PASS
shellcheck(変更 shell ファイル、既存箇所の pre-existing warning のみ残存) 新規追加箇所は warning なし

受け入れ条件の達成状況

  • AC1: launch.sh/lib.sh が GitHub auth 関連 env var(GH_TOKEN/GITHUB_TOKEN/GH_CONFIG_DIR 等)のみ native 同等に子プロセスへ共有し、SSH_AUTH_SOCK 等の無関係な secret は引き続き isolate されていることを credential sentinel test(test_issue_create_bridge_credential_sentinel.py、実 launch.sh 起動)で live 確認した
  • AC2: runtime_smoke_test.sh --scenario issue_create が genuine issue-creator 経由で dedupe read を含む通常 procedure を認証エラーなく完走することを live 3 回連続実行で確認した
  • AC3: create_issue_txn.py に isolation profile 分岐が存在しないことを rg -n "CLAUDE_GPT_ISOLATION_PROFILE"(exit 1)で確認した
  • AC4: TransactionResult.node_id/body_sha256 フィールド、run_transaction_with_authoritative_readback()、gh subprocess timeout 処理改善を native path に取り込んだ(test_create_issue_txn.py 129 passed で回帰確認)
  • AC5: runtime_smoke_test.sh --scenario issue_create を fake provider に対して 3 回連続 live 実行し、authoritative readback が fake provider の state と一致することを確認、flakiness なし
  • AC6: 既存 native create_issue_txn.py の回帰テスト(129 passed)、pnpm typecheck/lint/test(1872 tests)/build すべて green を維持した
  • AC7: test_issue_create_bridge_credential_sentinel.py(3 passed)が GH auth sentinel の子プロセスへの到達と、stdout/stderr/artifact への非露出、SSH 系 sentinel の完全不在を live 確認した
  • AC8: live_issue_create_canary.sh が opt-in(env var + --confirm)なしでは常に SKIP(exit 77)で終了することを確認した

Safety Claim Matrix

本 PR は .claude/skills/create-issue/scripts/create_issue_txn.py と scripts/claude-gpt/launch.sh/lib.sh の credential 境界を変更する safety-sensitive な変更のため、境界の転換内容を明示する。

Claim Implemented Not controlled Evidence Follow-up
isolated Claude-GPT 子プロセスへの GitHub auth(GH_TOKEN/GITHUB_TOKEN/GH_ENTERPRISE_TOKEN/GITHUB_ENTERPRISE_TOKEN/GH_HOST/GH_REPO/GH_CONFIG_DIR)共有 旧 P0-6(PR #2214 由来)の unset/隔離方針を撤回し、owner 明示承認(Issue #2299 Background 参照)に基づき native 同等の ambient 値共有へ意図的に転換した 子プロセスは以後 host と同一の GitHub 権限(read/write)を持つ。この権限自体を isolated child に対して制限する技術的境界はもう存在しない test_gh_auth_sentinel_shared_native_but_never_printed(3 passed) credential isolation の再導入は Issue #2292(Research Results)を future hardening として参照。現時点では P0/P1(Claude-GPT の安定稼働・既存 workflow の完走)を優先し prerequisite にしない
GitHub auth 以外の secret(SSH/GPG/git-credential-helper)の隔離継続 HOME/XDG_CONFIG_HOME/XDG_CACHE_HOME は引き続き空の隔離ディレクトリに置換、SSH_AUTH_SOCK/GIT_ASKPASS/SSH_ASKPASS/GIT_CREDENTIAL_HELPER は引き続き unset 該当なし(本 PR の変更範囲外の secret は従来通り遮断) test_ssh_and_credential_helper_sentinels_remain_isolated_and_never_printed(3 passed) 変更なし
GitHub credential 値の stdout/stderr/artifact への非露出 sentinel 値の positive(子プロセスへ到達)・negative(出力に非露出)両軸を実 launch.sh 起動で検証 本 PR の変更範囲外の他コンポーネントでの credential 露出は保証しない test_issue_create_bridge_credential_sentinel.py 全3ケース PASS 変更なし
create_issue_txn.py の GitHub mutation correctness isolation profile 分岐を撤去し単一 native path に統一。mutation 前後の live readback は既存実装を維持 新規 generic mutation broker・新規 enforcing hook は導入しない(Issue #2223 Owner Decision に整合) test_create_issue_txn.py(129 passed)、GitHub server-side protection(branch protection/required CI/repository permission)に委譲 変更なし

Runtime Verification Applicability

decision: immediate(Issue #2299 本文)。AC2/AC5 は live 実行で確認済み
(3 回連続 PASS)。証跡は scripts/claude-gpt/.evidence/issue-create-scenario-*.json
に生成される(token/credential/raw env は含まない)。

Allowed Paths 準拠

以下の各パスへの変更が Issue #2299 の Allowed Paths 内に収まっている:

  • scripts/claude-gpt/launch.sh(credential scrub 方針変更)
  • scripts/claude-gpt/lib.sh(同上)
  • scripts/claude-gpt/runtime_smoke_test.sh(issue_create シナリオ追加)
  • scripts/claude-gpt/live_issue_create_canary.sh(新規、opt-in canary)
  • scripts/claude-gpt/tests/(fake provider・sentinel テスト新規)
  • .claude/skills/create-issue/scripts/create_issue_txn.py(salvage 取り込み)
  • docs/dev/secret-policy.md(方針変更の明文化)

docs/dev/workflow.md は Required Design Reference として参照したが、本 PR の
変更内容と直接関係する既存記述が無かったため変更していない。

isolated Claude-GPT session 内で genuine issue-creator SubAgent が
create-issue skill の通常 procedure(dedupe read を含む)を完走できるよう、
launch.sh/lib.sh の credential scrub 方針を変更した。GitHub auth
(GH_TOKEN/GITHUB_TOKEN/GH_ENTERPRISE_TOKEN/GITHUB_ENTERPRISE_TOKEN/GH_HOST/
GH_REPO/GH_CONFIG_DIR)のみ ambient 値を native 同等に子プロセスへ共有し、
SSH_AUTH_SOCK/GIT_ASKPASS/SSH_ASKPASS/GIT_CREDENTIAL_HELPER 等の無関係な
secret は引き続き isolate する。

create_issue_txn.py は isolation profile 分岐を持たない単一 native path の
まま、Issue #2259/PR #2286 由来の salvage 対象(TransactionResult への
node_id/body_sha256 フィールド、gh subprocess timeout 処理)を native path
へ取り込んだ。runtime_smoke_test.sh に outcome-oriented な
--scenario issue_create を追加し、genuine issue-creator SubAgent が fake gh
provider 経由で create-issue workflow を完走することを live で確認する
(real GitHub Issue は作成しない)。opt-in の live_issue_create_canary.sh、
credential sentinel test(scripts/claude-gpt/tests/)を追加した。

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

Copy link
Copy Markdown
Contributor

Preview URL

✅ verified live assets: https://squne121.github.io/loop-protocol/pr-2303/

The preview will be removed when this PR is closed.

@squne121
squne121 marked this pull request as ready for review August 22, 2026 12:05
@squne121
squne121 merged commit c3cbe6c into main Aug 22, 2026
92 of 102 checks passed
@squne121
squne121 deleted the worktree-issue-2299-claude-gpt-native-gh-auth branch August 22, 2026 12:22
squne121 added a commit that referenced this pull request Sep 19, 2026
…th 実装に一致させる (#2666)

* fix: claude-gpt auto mode narrow label を actor-specific な現行 GitHub auth 実装に一致させる (#2658)

`CLAUDE_GPT_AUTO_MODE_ENVIRONMENT_NARROW_LABEL` / `ALLOW_NARROW_LABEL` は
PR #2299/#2303 後の実装(Claude child は native-equivalent な GitHub CLI
auth、AGY delegation は github_research read-only broker 専有)と Owner
Decision #2223(native GitHub client + live readback を通常 route とする)
に一致していなかった。一括り記述(GitHub write credential は
launcher-owned transaction broker のみが保持、通常操作は generic broker
限定、authority は permissions.deny/hook/broker に一括帰属)を、
actor-specific / operation-specific な記述へ書き換え、stale な hard_deny
コメントも整理した。controlled Issue-edit transaction executor と AGY
read-only broker の narrow-use 記述、`$defaults` の hard_deny 制約自体は
変更していない。`test_auto_mode_policy.py` の narrow label semantic
regression test を revised semantics に合わせて更新した。

Co-Authored-By: Claude Sonnet 5 <[email protected]>

* fix: auto mode narrow label のGH_CONFIG_DIR記述とhard_denyコメントをOWNER指摘に沿って修正する

PR #2666 OWNER レビュー(issuecomment-5737868676)のP2/P3非ブロッキング指摘を反映する。
GH_CONFIG_DIR記述を実際のlaunch.sh resolver分岐(非空値保持/未指定時fallback)に一致させ、
hard_deny追加分コメントをOwner Decision #2223の内容(generic broker/新規enforcing hookを
追加しない)に整合させ、controlled Issue-edit transactionのraw gh除外がtransaction-local
restrictionであることを明示する。test_auto_mode_policy.pyへ対応するregression assertionを
追加する。

Co-Authored-By: Claude Sonnet 5 <[email protected]>

---------

Co-authored-by: Test <[email protected]>
Co-authored-by: Claude Sonnet 5 <[email protected]>
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 の GitHub access を compatibility-first に切り替え既存 workflow を安定化する

1 participant