Repository navigation
Description
Machine-Readable Contract
contract_schema_version: v1
issue_kind: implementation
parent_issue: "none"
goal_ref: "isolated Claude-GPT session が Claude Code 本体と同等の GitHub access で、既存の issue-creator/create-issue workflow を安定して完走できるようにする"
change_kind: code
related_decisions:
- "#2223: GitHub mutation を minimal harness に縮退し server-side protection と live readback を正本にする Owner Decision(CLOSED, COMPLETED)"
- "#2259: credential-isolated bridge の実装(NOT_PLANNED, 本 Issue により置き換え)"
- "#2292: isolated issue-creator の execution boundary research(NOT_PLANNED、Candidate C/F は将来 hardening として保存)"Parent Issue
なし(単独改善)
Parent Goal Ref
- Goal: isolated Claude-GPT session が、Claude Code 本体で既に成立している GitHub read/write workflow(issue-creator 経由の Issue 起票等)を、専用 bridge・MCP・role split を前提とせず安定して実行できる状態にする。
- Desired Destination: Claude-GPT launcher が GitHub credential(
GH_TOKEN/GH_CONFIG_DIR等)のみを native 同等に共有し、それ以外の無関係な secret(SSH agent socket 等)は引き続き isolate したまま、既存のissue-creator/create-issueskill が無改修で動作する。
Current Validated Scope
scripts/claude-gpt/launch.shの isolated child プロセス起動処理(export HOME=.../export GH_CONFIG_DIR=.../unset GH_TOKEN GITHUB_TOKEN ...等の credential scrub 箇所)を、GitHub auth のみ native 相当を維持しつつ、SSH/git-credential-helper 等の無関係な secret は引き続き isolate する形に変更する。.claude/skills/create-issue/scripts/create_issue_txn.pyの isolation profile 分岐ロジックを削除し、単一の native path(run_transaction())に統一する。- PR 実装: isolated Claude-GPT の issue.create 要求を parent-mediated narrow bridge で処理する #2286 由来の salvage 候補(
TransactionResultへのnode_id/body_sha256フィールド追加、subprocess timeout 処理改善)を、bridge 実装と分離した上でこの Issue に取り込む。 scripts/claude-gpt/runtime_smoke_test.shのissue_createシナリオを、genuineissue-creatorSubAgent が native GitHub access(fake provider 経由)で workflow を完走することを確認する outcome-oriented な検証に書き直す。
Remaining Parent Gaps
なし。credential isolation・narrow MCP・agent role split は本 Issue の対象外(Out of Scope)とし、将来の hardening Issue(起票時は Issue #2292 の Research Results を参照)に委ねる。
Outcome
isolated Claude-GPT session 内で genuine issue-creator SubAgent が、通常の create-issue skill procedure(dedupe read → create_issue_txn.py 呼び出し → authoritative readback)を、host GitHub credential(token)のみを native 同等に共有された環境で、bridge や MCP を経由せず完走できる。
判定は「特定 transport(create_issue_txn.py → bridge → MCP)を必ず通ったか」ではなく、genuine issue-creator が通常の create-issue workflow を完走し、期待する GitHub state(もしくは fake provider の state)が authoritative readback と一致すること を正本とする。
このAcceptanceは、raw gh 呼び出しを技術的に禁止する新しい enforcement を導入しない。GitHub mutation の correctness は GitHub 側の server-side protection(branch protection・required CI・repository permission)と、mutation 前後の live readback によって担保する。
Background
- Issue 実装: isolated Claude-GPT の issue.create 要求を parent-mediated narrow bridge で処理する #2259(credential-isolated parent-mediated bridge の実装、PR 実装: isolated Claude-GPT の issue.create 要求を parent-mediated narrow bridge で処理する #2286)は、owner の明示的な方針転換(PR 実装: isolated Claude-GPT の issue.create 要求を parent-mediated narrow bridge で処理する #2286 コメント参照)により
NOT_PLANNEDで close された。 - owner の優先順位は
P0: Claude-GPT の安定稼働 > P1: 既存 workflow の完走 > P2: 最小限の correctness/readback > P3: credential isolation 等の hardeningであり、P3 を P0/P1 の前提条件にしない。 - 現状
scripts/claude-gpt/launch.shは isolated Claude-GPT 子プロセスのHOME/GH_CONFIG_DIR/XDG_CONFIG_HOME/XDG_CACHE_HOMEを空の隔離ディレクトリに置き換え、GH_TOKEN/GITHUB_TOKEN/GH_HOST/GH_REPO/SSH_AUTH_SOCK/GIT_ASKPASS/SSH_ASKPASS/GIT_CREDENTIAL_HELPERを unset している(1640行台、実装時にrgで再確認する)。この結果、create-issueskill Step 1.5/Step 3.6 の dedupe read(gh issue list)が isolated 環境で認証エラーになり、genuineissue-creatorの workflow が完走できない。 .claude/skills/create-issue/scripts/create_issue_txn.pyは isolation profile 検知時に bridge client 経由の分岐を持つ(PR 実装: isolated Claude-GPT の issue.create 要求を parent-mediated narrow bridge で処理する #2286 由来)。本 Issue ではこの分岐を削除し、単一の native path に統一する。- 4系統の並列 SubAgent 調査(Issue 調査: isolated issue-creator の GitHub read/mutation 経路を deterministic execution boundary に再設計する #2292)により、bridge 実装のうち
TransactionResultへのnode_id/body_sha256フィールド追加・timeout 処理改善は bridge と独立して価値があると判定された。 scripts/claude-gpt/live_issue_create_canary.shは現在の main には存在しないため、本 Issue で新規作成する(AC8 参照)。既存の opt-in canary パターン(scripts/claude-gpt/auto_mode_canary.sh、.claude/skills/create-issue/tests/live_canary_blocking_direction.sh)を参考にする。
絶対に避けるべき修正方向
- host HOME 全体(
~)をそのまま子プロセスへ共有する実装(SSH key・GPG key 等の無関係な secret まで渡ることになる) SSH_AUTH_SOCK/GIT_ASKPASS/GIT_CREDENTIAL_HELPERの isolation を解除する実装(GitHub auth とは無関係)- 新規 generic GitHub mutation broker の実装
- 新規 enforcing PreToolUse hook の実装
issue-creatorの role split(proposal-only 化等)- raw
gh実行を技術的に禁止する新しい仕組みの導入 - GitHub credential を stdout/stderr/transcript/test artifact/hook log に出力する実装
In Scope
scripts/claude-gpt/launch.sh/lib.shの isolated child credential scrub 処理を、GitHub auth(GH_TOKEN/GH_CONFIG_DIR系)のみ native 同等に共有し、それ以外(SSH_AUTH_SOCK等)は引き続き isolate する形に変更する.claude/skills/create-issue/scripts/create_issue_txn.pyの isolation profile 分岐削除、単一 native path への統一- salvage 対象(
node_id/body_sha256フィールド、timeout 処理改善)の取り込み scripts/claude-gpt/runtime_smoke_test.shのissue_createシナリオを outcome-oriented な検証に書き直す(genuineissue-creatorSubAgent 経由、fake provider 使用、real GitHub Issue は作成しない)- 既存 native(非 Claude-GPT)create-issue workflow の回帰テスト維持
scripts/claude-gpt/live_issue_create_canary.shを新規作成する。既存のscripts/claude-gpt/auto_mode_canary.shや.claude/skills/create-issue/tests/live_canary_blocking_direction.shの opt-in canary パターンを踏襲し、明示的な opt-in 環境変数/フラグが与えられない限り常に SKIP(exit 77)で終了する
Out of Scope
- credential isolation・narrow MCP・agent role split(将来 hardening、Issue 調査: isolated issue-creator の GitHub read/mutation 経路を deterministic execution boundary に再設計する #2292 参照)
- 新規 generic GitHub mutation broker
- 新規 enforcing PreToolUse hook
- PR/branch push/merge 経路への拡張
- opt-in live canary の対象 repository 拡大
Acceptance Criteria
- AC1: isolated Claude-GPT session 内で
gh auth status相当の GitHub authentication/read operation が成功する(credential scrub 対象から GitHub auth 関連 env var を除外し、SSH 等の無関係な secret は引き続き isolate されていることを確認する) - AC2: genuine
issue-creatorSubAgent がcreate-issueskill の通常 procedure(dedupe read を含む)を、認証エラーで停止せずに実行できる - AC3:
create_issue_txn.pyの isolation profile 分岐が削除され、単一の native path に統一されている(rgで bridge 関連 import/分岐が存在しないことを確認する) - AC4: salvage 対象(
TransactionResult.node_id/body_sha256フィールド、timeout 処理改善)が native path に取り込まれている - AC5:
scripts/claude-gpt/runtime_smoke_test.sh --scenario issue_createが fake provider に対して genuineissue-creator経由で Issue 作成 workflow を完走し、authoritative readback(fake provider の state 一致)で確認できる。この runtime system test を最低3回連続で実行し、run-to-run flakiness がないことを確認する - AC6: 既存 native(非 Claude-GPT)
create_issue_txn.pyの回帰テスト(dedupe・label・parent/sub-issue・blocked-by/blocking・readback・partial_failure・reconciliation)が全て green のまま維持される - AC7: GitHub credential が stdout/stderr/transcript/test artifact に一切出力されないことを sentinel credential テストで確認する
- AC8: 新規作成する opt-in live canary(
scripts/claude-gpt/live_issue_create_canary.sh)は、明示的な opt-in 環境変数/フラグが与えられない限り常に SKIP(exit 77)で終了する
Verification Commands
# AC1
# preflight-scope: runtime_only
$ bash scripts/claude-gpt/launch.sh --check-only
# AC2
# preflight-scope: runtime_only
$ bash scripts/claude-gpt/runtime_smoke_test.sh --scenario issue_create
# AC3
$ rg -n "CLAUDE_GPT_ISOLATION_PROFILE" .claude/skills/create-issue/scripts/create_issue_txn.py
# AC4
$ uv run --locked pytest .claude/skills/create-issue/tests/test_create_issue_txn.py -v
# AC5
# preflight-scope: runtime_only
$ bash scripts/claude-gpt/runtime_smoke_test.sh --scenario issue_create
# AC6
$ uv run --locked pytest .claude/skills/create-issue/tests/test_create_issue_txn.py -v
# AC7
$ uv run --locked pytest scripts/claude-gpt/tests/test_issue_create_bridge_credential_sentinel.py -v
# AC8
# preflight-scope: runtime_only
$ bash scripts/claude-gpt/live_issue_create_canary.sh
# AC6
$ pnpm typecheck
# AC6
$ pnpm lint
# AC6
$ pnpm test
# AC6
$ pnpm buildAllowed Paths
- scripts/claude-gpt/launch.sh
- scripts/claude-gpt/lib.sh
- scripts/claude-gpt/runtime_smoke_test.sh
- scripts/claude-gpt/live_issue_create_canary.sh
- scripts/claude-gpt/tests/
- .claude/skills/create-issue/scripts/create_issue_txn.py
- .claude/skills/create-issue/tests/
- docs/dev/secret-policy.md
- docs/dev/workflow.md
Stop Conditions
実装中にこれらの状況が発生したら直ちに作業を停止し、Issue comment に状況を記録して人間の判断を待つ。
- Allowed Paths 外の変更が必要と判明した場合
- In Scope の固定契約(キー集合・スキーマ・型定義)の変更が必要になった場合
- 新規 Issue の起票が必要と判断した場合(スコープ分割が発生する場合)
- 後続 Phase / 別スコープへの波及が判明した場合
- nested SubAgent delegation が必要になった場合
- 外部サービス利用・権限昇格・既存テスト大規模改変が必要になった場合
- host HOME 全体や SSH credential まで共有しないと workflow が完走しないと判明した場合
Runtime Verification Applicability
decision: immediate
reason: "実 launch.sh・実 Claude-GPT session・genuine issue-creator SubAgent を通す runtime system test(AC2/AC5)が必要なため。"
applicable_acs:
- AC2
- AC5
execution_environment: "scripts/claude-gpt/runtime_smoke_test.sh を拡張した launcher runtime。"
skip_conditions: "SKIP しない(通常の CI・開発環境で常時実行する)。"
fallback_policy: "runtime harness が実行不能な場合は SKIP ではなく FAIL とする。"
artifact_requirements: "main HEAD SHA、clean/dirty status、launcher digest、create_issue_txn.py digest、session_id、repository ID、issue number(fake provider)、開始/終了 timestamp を artifacts として保存する。token・credential path・raw environment は含めない。"Required Skills
- worktree-agent-runtime-smoke(AC5 の runtime system test の参考実装として)
Required Design References
- docs/dev/secret-policy.md
- docs/dev/workflow.md
- Issue 決定: GitHub mutation を minimal harness に縮退し server-side protection と live readback を正本にする #2223(Owner Decision)
- Issue 実装: isolated Claude-GPT の issue.create 要求を parent-mediated narrow bridge で処理する #2259(credential-isolated bridge 実装の参考、NOT_PLANNED)
- Issue 調査: isolated issue-creator の GitHub read/mutation 経路を deterministic execution boundary に再設計する #2292(Research Results、将来 hardening 再検討時の参照)
Delivery Rule
1 Issue = 1 PR。worktree で実装し、Draft PR を既定とする。
Activity
squne121 commentedon Aug 22, 2026
root-owned entry router audit
route: invoke_impl_review_loop
reason: fresh_review_go_live_equality
squne121 commentedon Aug 22, 2026
Issue Refinement Loop — 終了報告
STATUS: approved
ITERATION: 1
実施内容
run_refinement_preflight.py)scripts/claude-gpt/live_issue_create_canary.shが現在の main HEAD に存在しないことを検出(AC8/Allowed Paths に含まれるが In Scope に新規作成が未記載だった contract gap)check_issue_contract.pyを control-plane が独立実行し verdictapprove(全 deterministic check pass、C11 tag consistency含む)を確認live_issue_create_canary.sh新規作成を明記、AC8 の文言を新規作成前提に修正、Background に理由を追記verdict: approve、blocking_issues: []を確認最終判定
issue-refinement-loopは本 Issue を implementation-ready と判定する。impl-review-loopへ handoff する。squne121 commentedon Aug 22, 2026
implement-issue: 実装完了 (2026-08-22T10:55:36Z)
.claude/worktrees/issue-2299-claude-gpt-github-access-compatworktree-issue-2299-claude-gpt-github-access-compatbash scripts/claude-gpt/runtime_smoke_test.sh --scenario issue_createを3回連続実行しいずれも PASS(genuine issue-creator SubAgent が fake gh provider 経由で create-issue workflow を完走、authoritative readback で確認)。squne121 commentedon Aug 22, 2026
implement-issue: 実装完了 (2026-08-22)
.claude/worktrees/issue-2299-claude-gpt-native-gh-authworktree-issue-2299-claude-gpt-native-gh-authuv run pytest scripts/claude-gpt/tests/ .claude/skills/create-issue/tests/450 passed / 1 skippedruntime_smoke_test.sh --scenario issue_createを live で3回連続実行しPASS(flakiness なし)。1回目の調査中に、fake provider へ渡す repo 名がCLAUDE_GPT_TRUSTED_REPO外だと launcher の autoMode second-gate classifier に拒否される flake を発見し、repo 名をsqune121/loop-protocolに固定して解消(fake_gh.py は network を叩かないため real GitHub には影響しない)fix: --scenario issue_create の run-to-run flakiness を bounded retry で…
squne121 commentedon Aug 22, 2026
AC5 flakiness fix_delta 完了報告(2026-08-22)
PR #2302 の既存 worktree/branch(
worktree-issue-2299-claude-gpt-github-access-compat)上で、AC5「--scenario issue_createを最低3回連続実行して flakiness がないことを確認する」に関する fix_delta を実施した。根本原因
clean head(
8824871)で control-plane が独立に--scenario issue_createを5回連続実行したところ、1回 FAIL を再現した(readback_confirmed:falseだがlaunch_exit_code:0)。失敗時の stdout(通常は成功/失敗時とも即座に破棄される仕様だったため、調査用に一時的に保持するハーネスを別途用意して再現した)を確認したところ、genuineissue-creatorSubAgent 自身が「GitHub Issue 作成の外部書き込み権限が拒否されました」と報告していた。これは本スクリプト自体・fake
ghprovider fixture・create_issue_txn.pyのバグではなく、この launcher が常に使用する--permission-mode auto(非対話 headless 実行)下での Claude Code 本体の tool-permission 判定が稀に確認待ちとなり、人間不在のため自動的に拒否される non-determinism であると特定した。runtime_smoke_test.shの同ファイル内に既に存在する Bash/SubAgent marker canary(bash_attempt/subagent_attempt、2026-08-14/2026-08-16 に実機観測・文書化済み)と同種の backend 側 non-determinism である。適用した修正
scripts/claude-gpt/runtime_smoke_test.shの--scenario issue_createブロックに、同ファイルに既存の bounded retry パターン(marker/readback 未確認時のみ、最大3回、fallback や擬似成功判定への昇格は行わない)を適用した。attempts[]にすべて記録し、隠さないattempt_countフィールドで最終的に何回目の試行で成功したか(または全滅したか)を証跡へ残す検証結果(正直な全実行結果)
修正後、clean worktree で
--scenario issue_createを8回連続実行し、全8回とも以下の結果を確認した(すべてattempt_count=1/3、つまり1回目の試行のみで成功しリトライは1度も発動しなかった):regression 確認
bash scripts/claude-gpt/launch.sh --check-only->status:"ok"rg -n "CLAUDE_GPT_ISOLATION_PROFILE" .claude/skills/create-issue/scripts/create_issue_txn.py-> 0件(既存契約どおり)uv run --locked pytest .claude/skills/create-issue/tests/test_create_issue_txn.py -v-> 129 passeduv run --locked pytest scripts/claude-gpt/tests/test_issue_create_bridge_credential_sentinel.py -v-> 2 passedbash scripts/claude-gpt/live_issue_create_canary.sh-> opt-in 前提の live-write canary のため本 fix_delta では未実行(デフォルト SKIP 経路exit=77のみ確認、実 GitHub Issue は作成していない)pnpm typecheck/pnpm lint/pnpm test(112 files, 1872 tests)/pnpm build-> すべて greenuv run pytest .claude/skills/gemini-cli-headless-delegation/tests/test_model_routing.py-> 24 passed状態
修正を既存ブランチへ push し、PR #2302 の CI が再実行される(新規 worktree/PR は作成していない)。PR body にも本 fix_delta の内容を追記済み。マージは行っていない。
実装: claude-gpt launcher の GitHub auth を native 同等に共有する (#2299) (#2303)
fix: PR #2357 レビュー4点(credential parity方向・AGY fallback配線・permission-bo…
feat: actor-scoped capability handoff と controlled GitHub read/write …
fix: fake_gh.py の repo-view/refs-heads 分岐を exact-argv 契約へ厳格化する (#2330)
fix: fake_gh.py の gh repo view / gh api refs/heads 互換性ギャップを解消する (#2377)
fix: claude-gpt auto mode narrow label を actor-specific な現行 GitHub au…
fix: Claude-GPT issue-refinement preflight の read transport を #2299 の…