Repository navigation
Description
Machine-Readable Contract
contract_schema_version: v1
issue_kind: implementation
parent_issue: "none"
goal_ref: "Claude-GPT isolated session から canonical control-plane preflight が uv toolchain 解決と GitHub read の両方で bootstrap/authentication 理由により停止しない状態を作る"
change_kind: mixedParent Issue
none
Parent Goal Ref
- Goal: なし(単独改善。Issue 実装: baseline_vc_preflight/v1 に重複 non-pure VC コマンド検出の diagnostics フィールドを追加する #2232 の comment 5316900237 で報告された incident への対応)
- Desired Destination: なし(単独 Issue)
Current Validated Scope
scripts/agent-guards/skill_runtime_exec.pyの trusted toolchain resolution ロジックを isolatedHOMEから分離する- Claude-GPT isolated session から credential なしで public GitHub Issue read を成立させる経路を追加する
docs/dev/workflow.mdに Availability Invariant を追加する
Remaining Parent Gaps
- なし(単独 Issue のため親 Issue に残る gap はない)
Outcome
scripts/agent-guards/skill_runtime_exec.py の trusted executable resolver が isolated HOME と結合しない generic な trust root 解決に変更され、Claude-GPT isolated session からの credentialless public GitHub Issue read 経路が追加され、docs/dev/workflow.md に Availability Invariant が追加された状態で、fresh Claude-GPT isolated session から HOME override や manual cache delete なしに preflight.run.with_human_context 相当の control-plane command が bootstrap/authentication 理由では停止せず完走し、その実行ログが証跡として記録されている状態。
Runtime Verification Applicability
decision: immediate
reason: "isolated HOME 下での uv toolchain 解決と credentialless GitHub read の成立は静的検証だけでは確認できず、fresh isolated Claude-GPT session からの実地実行によって証明する必要があるため"
applicable_acs:
- AC5
execution_environment:
cli_tools:
- claude
- uv
- python3
auth_required: false
network_required: true
skip_conditions:
- "claude-gpt launcher / herdr capability が実行環境に存在しない場合は SKIP(exit 77) とし PASS へ昇格しない"
fallback_policy:
fallback_success_is_pass: false
notes: "HOME override や manual cache delete を用いた fallback 経由の成功は FAIL として扱い PASS に変換しない"
artifact_requirements:
- "artifacts/runtime-smoke/claude-structured/summary.md"isolated HOME 下での uv toolchain 解決と credentialless GitHub read の成立は、静的検証だけでは確認できず、fresh isolated Claude-GPT session からの実地実行(worktree-agent-runtime-smoke 経由)によって証明する必要があるため decision: immediate とする。
In Scope
scripts/agent-guards/skill_runtime_exec.pyの_safe_path_entries()/_trusted_uv_toolcache_dirs()/_resolve_trusted_executable()を変更し、trust root を isolatedHOME(Path.home())から独立した経路(例:pwd.getpwuid(os.getuid()).pw_dirベースの OS アカウント home、または launcher が明示的に渡す固定パス)で解決するようにする_trusted_uv_toolcache_dirs()をuv専用ハードコードから generic な_trusted_toolchain_dirs(executable_name)相当へ一般化する- symlink/copy を採用する場合、realpath 解決・regular-file type 検証・trust root 配下の commonpath 検証・version 照合・ownership(uid) 検証を実装する
- Claude-GPT isolated session から、host
GH_TOKEN/GITHUB_TOKEN/GH_CONFIG_DIRを child 環境へ一切露出せずに、public GitHub Issue(squne121/loop-protocol)の canonical read を成立させる credentialless public REST GET 経路を追加する(認証ヘッダを一切付与しない) docs/dev/workflow.mdに Availability Invariant(security/isolation 強化変更は同一 delivery で最低1つの canonical positive workflow を fresh isolated session から実証しなければならない旨)を追加する.claude/rules/project-constitution.mdの「必須検証」節から上記 Availability Invariant への一行リンクを追加する- 上記変更に対応する pytest テスト(positive/negative 両方)を追加する
worktree-agent-runtime-smokeskill 等を用いた fresh isolated Claude-GPT session からの end-to-end positive control 実行ログを取得し、PR に証跡として添付する.claude/skills/issue-refinement-loop/scripts/run_refinement_preflight.pyの_fetch_issue()/_fetch_issue_comments()を、isolated profile では新規 credentialless transport(github_credentialless_read.pyのlist_issue_comments()等)経由に接続し、ghCLI へフォールバックしないようにする。ghexecutable を marker executable に差し替えても一度も起動されないことを behavioral test で証明する
Out of Scope
- Issue 実装: baseline_vc_preflight/v1 に重複 non-pure VC コマンド検出の diagnostics フィールドを追加する #2232 本体(
baseline_vc_preflight/v1の重複 non-pure VC コマンド検出 diagnostics フィールド追加) - Issue 決定: GitHub mutation を minimal harness に縮退し server-side protection と live readback を正本にする #2223(raw gh/git push の deterministic deny + production broker 本体実装)
- Issue 実装: runtime guard が peer pytest nodeids を child write と誤帰属しないようにする #1526(
.pytest_cache/v/cache/nodeidstyped exact-file policy)のコード変更。本 Issue の実装過程で観測された副次症状だが、別 Issue の依存関係更新として扱う(本 Issue の primary availability PR が merge-ready になった後に別途対応) - GET-only・repository-bound な authenticated read broker の新規実装(無認証 rate limit が通常 workload に実証的に不足すると判明するまでは着手しない)
- raw
ghCLI や rawgit pushの broad enable
Acceptance Criteria
- AC1: isolated
HOME(claude-gpt launcher が設定する isolated HOME のまま、HOMEoverride なし)で_resolve_trusted_executable("uv", ...)がuvの解決に成功する - AC2: host credential(
GH_TOKEN/GITHUB_TOKEN/hostGH_CONFIG_DIRの実値)が Claude-GPT child のプロセス環境変数・stdout・artifact のいずれにも一切出現しない - AC3: public GitHub Issue(squne121/loop-protocol 上の実在 Issue)の canonical read が、認証ヘッダなしで成立する
- AC4: cross-repository(squne121/loop-protocol 以外)への read/write が発生せず、GET 以外の HTTP method(POST/PATCH/DELETE)を発行する経路がコード上に存在しない
- AC5:
HOMEoverride や manual cache delete を一切使わずに、fresh Claude-GPT isolated session からの起動でpreflight.run.with_human_context相当の control-plane command が bootstrap/authentication 理由では停止せず完走する - AC6: 既存の fail-closed adversarial test(trust-path 外 symlink 差し替え等を block する既存/新規 harness)が引き続き block を維持する回帰確認が PASS する
- AC7:
docs/dev/workflow.mdに Availability Invariant セクションが追加されている - AC8: isolated profile で
run_refinement_preflight.pyの Issue/comments 取得が credentialless transport 経由になり、ghexecutable を marker executable に差し替えても一度も起動されないことが behavioral test で証明される
Verification Commands
# AC1
$ uv run --locked pytest scripts/agent-guards/tests/test_trusted_toolchain_isolated_home.py::test_resolve_trusted_executable_uv_succeeds_under_isolated_home -v# AC2
$ uv run --locked pytest scripts/agent-guards/tests/test_credentialless_github_read.py::test_sanitized_env_excludes_host_github_credentials -v# AC3
$ uv run --locked pytest scripts/agent-guards/tests/test_credentialless_github_read.py::test_credentialless_public_issue_read_succeeds -v# AC4
$ uv run --locked pytest scripts/agent-guards/tests/test_credentialless_github_read.py::test_credentialless_read_rejects_cross_repository_and_mutation_methods -v# AC5
# preflight-scope: runtime_only
$ uv run --locked python3 scripts/agent-ops/run_worktree_agent_runtime_smoke.py --runtime claude --mode structured --worktree "$WORKTREE" --prompt-file tmp/runtime-smoke/claude-gpt-preflight.md --output-dir artifacts/runtime-smoke/claude-structured --timeout-seconds 180 --require-clean-postcondition# AC6
$ uv run --locked pytest scripts/agent-guards/tests/test_skill_runtime_control_plane_exec.py -k test_sanitized_git_subprocess_env_path_is_trusted_allowlist_not_inherited -v# AC7
$ rg -n "Availability Invariant" docs/dev/workflow.md# AC8
$ uv run --locked pytest .claude/skills/issue-refinement-loop/tests/test_run_refinement_preflight_credentialless_transport.py::test_isolated_profile_never_invokes_gh_marker_executable -vNotes for Reviewer
Scope Collision (C1) preflight(check_issue_overlap.py)で scripts/agent-guards/skill_runtime_exec.py / docs/dev/workflow.md / scripts/claude-gpt/launch.sh / scripts/claude-gpt/lib.sh 等が以下の既存 OPEN Issue と Allowed Paths 文字列レベルで重複ヒットした(#1860 Owner Decision により advisory・起票停止理由にしない):
non_conflict_reason: 実装: fix: bind issue-refinement control-plane preflight to a dedicated linked worktree #2190(issue-refinement control-plane preflight の worktree 束縛)はskill_runtime_exec.py内の worktree binding 関連関数を対象とし、本 Issue は_safe_path_entries()/_trusted_uv_toolcache_dirs()/_resolve_trusted_executable()という trust-path 解決ロジックのみを対象とする。同一ファイル内の異なる関数領域であり、実装順序次第では軽微なマージコンフリクトの可能性があるため、実装時にgit rebaseで解消する前提とする。non_conflict_reason: 実装:scope_rollup.runをskill_runtime_execのsiblingexactprofileへ統合する #1601(scope_rollup.run の sibling exact profile 統合)、実装: 契約実行ラッパーに Linux-only optional strict trace attribution mode を追加する #1363(strict trace attribution mode)も同ファイルへの追記だが、対象関数が完全に分離しており contract 上の衝突はない。non_conflict_reason: 実装: runtime guard が peer pytest nodeids を child write と誤帰属しないようにする #1526(pytest nodeids 誤帰属修正)は本 Issue の Out of Scope に明記済み。本 Issue の実装で.pytest_cache関連の副次症状が再発した場合は 実装: runtime guard が peer pytest nodeids を child write と誤帰属しないようにする #1526 側の stale dependency 更新(本 Issue の primary availability PR merge-ready 後、実装: runtime guard が peer pytest nodeids を child write と誤帰属しないようにする #1526 のリベース)で対応する。混在実装はしない。non_conflict_reason: 実装: 通常 claude-gpt 対話中、明示 @ 指示時だけ GPT-5.3-Codex-Spark SubAgent を起動する #2186(launch.sh/lib.sh への Spark SubAgent 起動追加)は launcher 内の別セクション(child spawn 条件分岐)を対象とし、本 Issue は isolated HOME/trust root 解決のみを対象とする。docs/dev/workflow.md/.claude/rules/project-constitution.mdへの追記は複数 Issue で共通発生するが、Markdown の追記型変更のためコンフリクトは低リスク。
Allowed Paths
- scripts/agent-guards/skill_runtime_exec.py
- scripts/agent-guards/github_credentialless_read.py
- scripts/agent-guards/tests/test_skill_runtime_preflight_bytecode_cache.py
- scripts/agent-guards/tests/test_skill_runtime_control_plane_exec.py
- scripts/agent-guards/tests/test_trusted_toolchain_isolated_home.py
- scripts/agent-guards/tests/test_credentialless_github_read.py
- scripts/claude-gpt/launch.sh
- scripts/claude-gpt/lib.sh
- docs/dev/workflow.md
- .claude/rules/project-constitution.md
- .claude/skills/issue-refinement-loop/tests/test_operator_selected_scope_reframe.py
- .claude/skills/issue-refinement-loop/tests/test_fixture_human_context_subprocess.py
- .claude/skills/issue-refinement-loop/scripts/run_refinement_preflight.py
- .claude/skills/issue-refinement-loop/tests/test_run_refinement_preflight_credentialless_transport.py
Stop Conditions
- Allowed Paths 外の変更が必要と判明した場合
- In Scope の固定契約(キー集合・スキーマ・型定義)の変更が必要になった場合
- 新規 Issue の起票が必要と判断した場合(スコープ分割が発生する場合)
- 後続 Phase / 別スコープへの波及が判明した場合
- nested SubAgent delegation が必要になった場合
- 外部サービス利用・権限昇格・既存テスト大規模改変が必要になった場合。特に、認証済み GitHub read broker の新規実装が必要と判明した場合は本 Issue のスコープを超えるため停止し、follow-up Issue 化を提案する
Required Skills
なし
Required Design References
- docs/dev/secret-policy.md
- docs/dev/hook-boundaries.md
- docs/dev/agent-runtime-ops.md
- .claude/rules/project-constitution.md
Scope Delta(該当時のみ記載)
PR #2247 レビューで、scripts/agent-guards/skill_runtime_exec.py の trust root 変更(Path.home() → pwd.getpwuid(os.getuid()).pw_dir ベース)が、Allowed Paths 外の以下2ファイルの既存テストを real regression として壊すことが判明した(HOME monkeypatch で trust root を間接検証していたテストが、HOME非依存の新仕様と整合しなくなったため)。これらのテストを新仕様に合わせて更新するため Allowed Paths を拡張する。
追加する Allowed Paths:
.claude/skills/issue-refinement-loop/tests/test_operator_selected_scope_reframe.py.claude/skills/issue-refinement-loop/tests/test_fixture_human_context_subprocess.py
変更内容: test_fixture_human_context_real_subprocess_reaches_contract_update_required_ac3 等が、trust root を HOME monkeypatch 経由で間接検証していた箇所を、pwd.getpwuid mock またはそれに相当する新仕様準拠の検証方法へ更新する(アサーション対象パスの意味を新しい trust root 定義に合わせるのみで、テストの検証意図・カバレッジは変えない)。
2回目の Scope Delta(PR #2247 への OWNER (squne121) の adversarial review、#2247 (comment) 、P1-1 blocker への対応):
OWNER レビューで、新規 github_credentialless_read.py が canonical production preflight(run_refinement_preflight.py の _fetch_issue()/_fetch_issue_comments())に未接続であり、gh api/gh issue view 経由の既存 fetch がそのまま残っているため、GitHub authentication failure という incident 後半が実質未解決である、という P1 blocker が指摘された。この修正には Allowed Paths 外の .claude/skills/issue-refinement-loop/scripts/run_refinement_preflight.py の編集が必須のため Allowed Paths を拡張する。
追加する Allowed Paths:
.claude/skills/issue-refinement-loop/scripts/run_refinement_preflight.py.claude/skills/issue-refinement-loop/tests/test_run_refinement_preflight_credentialless_transport.py(新規)
変更内容: isolated profile 実行時に _fetch_issue()/_fetch_issue_comments() が github_credentialless_read.py の transport(GitHubReadTransport protocol、list_issue_comments() によるpagination追従を含む)を使用し gh へフォールバックしないよう transport selector を追加する。gh を marker executable に差し替えても一度も起動されないことを behavioral test(AC8)で証明する。
Activity
squne121 commentedon Aug 17, 2026
create-issue transaction partial-failure
Issue: #2241
Failure stage: dedupe-race-detection
Message: dedupe-search failed
Requested:
Completed steps: create
Failure context: command=gh issue list --repo squne121/loop-protocol --state open --search in:title "実装: Claude-GPT isolated session の minimum control-plane capability を保証する(uv toolchain resolution + credentialless GitHub read)" --limit 200 --json number,title,url
output=HTTP 503: No server is currently available to service your request. Sorry about that. Please try resubmitting your request and contact us if the problem persists. (https://api.github.com/graphql)
matching_issue_numbers=[]
issue_number=2241
Recovery hint: dedupe-race-detection — automatic recovery is not possible.
Manual action required: inspect open issues with the same title and decide which to close.
gh issue list --repo squne121/loop-protocol --state open --search '<title>'
idempotent re-run: no (requires manual deduplication first)
Please recover deterministically before re-running the create issue transaction.
squne121 commentedon Aug 17, 2026
implement-issue: 実装完了
.claude/worktrees/issue-2241-uv-toolchain-github-readworktree-issue-2241-uv-toolchain-github-readworktree-agent-runtime-smoke経由で検証)fix: trust root generalization に合わせ isolated HOME 依存 env_probe テストを i…
squne121 commentedon Aug 17, 2026
implement-issue: fix_delta 対応完了(PR #2247 REQUEST_CHANGES 解消)
pr-review-judge から受けた REQUEST_CHANGES の 2 blocker を解消しました。
Blocker 1: CI 回帰(既存テスト2件が新 trust root と不整合)
.claude/skills/issue-refinement-loop/tests/test_operator_selected_scope_reframe.py::test_fixture_human_context_real_subprocess_reaches_contract_update_required_ac3(およびtest_fixture_human_context_subprocess.pyの importlib ラッパー)の env_probe 部分を、pwd.getpwuidをunittest.mock.patch.objectで isolated home に差し替えた in-process 呼び出しに変更し、検証意図(trust root が isolated HOME に汚染されない/host env sanitize が機能する)を維持したまま新仕様に整合させました。2件とも PASS を確認済みです。Blocker 2: AC5 runtime verification 証跡が PR 本文に無い
artifacts/runtime-smoke/claude-gpt-structured/summary.mdの observed フィールド(raw prompt / 絶対 HOME パス / proxy sidechannel の host-local パスは redact)をdocs/dev/runtime-verification-policy.md§7 テンプレに従って PR #2247 本文へ## Runtime Verification Evidenceセクションとして追記しました。検証結果
.claude/skills/issue-refinement-loop/tests/full suite: 1556 passedscripts/agent-guards/tests/full suite: 1413 passed, 1 skipped, 1 deselectedpnpm typecheck/pnpm lint/pnpm build: PASSpnpm test: 112 files / 1872 tests passedPR fix: Claude-GPT isolated session の trusted uv toolchain 解決を HOME 分離から独立させる (#2241) #2247 head: e192d70(更新済み)、mergeable: MERGEABLE
PR: fix: Claude-GPT isolated session の trusted uv toolchain 解決を HOME 分離から独立させる (#2241) #2247
mergeは実施していません。後続レビューをお待ちしています。
squne121 commentedon Aug 17, 2026
impl-review-loop 完了: PR #2247 が merge-ready 状態です(本セッションではマージ操作を実行しません)。
--claude-adapter claude-gpt)からskill_runtime_exec.py --command-id preflight.run.with_human_context相当の実行を確認、exit_code 0、tested_head が PR head と一致人間のマージ判断後の推奨手順は以下の通りです(このセッションからの引き継ぎ事項、詳細は本 Issue を起票した親スレッドの最終報告を参照):
.pytest_cache/v/cache/nodeidstyped exact-file policy)の stale 実装: SubAgent 起動 ledger の更新を runtime guard の誤検知から除外する #1502 dependency を authoritative state(実装: SubAgent 起動 ledger の更新を runtime guard の誤検知から除外する #1502 は既に CLOSED 済み、readback 確認済み)に更新し、exact nodeids policy を実装HOMEoverride / credential 再露出 / cache delete なしで 実装: control-plane preflight の remote default-ref OID observe/fetch/pin/verify プロトコルを実装する #2197 の preflight を再実行fix: PR #2247 REQUEST_CHANGES対応(redirect拒否・same-UID trust hardening・H…
squne121 commentedon Aug 18, 2026
PR #2247 に対する OWNER の敵対的レビュー(REQUEST_CHANGES、comment 5327969977)へ fix_delta で対応した(head
46aabeff)。対応結果サマリ
urllib.request.HTTPRedirectHandlerを全面拒否するサブクラスを追加し、あらゆる redirect(301/302/303/307/308、任意 host/scheme)をCrossRepositoryReadRejectedにした。negative test 5 種を追加。~/.local/binsame-UID trust root): 部分対応。ancestor owner/writability 検証・symlink 解決先検証・version 照合を追加したが、同一 UID 攻撃モデル自体は構造的に未解決(Not Controlled として PR 本文・docs/dev/workflow.mdに明記)。_sanitize_envの実 subprocess black-box test・trust root 解決の実 subprocess black-box test を追加。github_credentialless_read.pyに transport 一式(list_issue_commentspagination・GitHubReadTransportProtocol・CredentiallessGitHubReadTransport)は追加したが、.claude/skills/issue-refinement-loop/scripts/run_refinement_preflight.pyの_fetch_issue()/_fetch_issue_comments()への配線は、このファイルが Issue 実装: Claude-GPT isolated session の minimum control-plane capability を保証する(uv toolchain resolution + credentialless GitHub read) #2241 の Allowed Paths に含まれていないため実施できなかった。Scope Delta(Allowed Paths へのrun_refinement_preflight.py追加)が必要。検証結果
scripts/agent-guards/tests/+.claude/skills/issue-refinement-loop/tests/: 2995 passed, 1 skipped, 1 deselectedpnpm typecheck/pnpm lint/pnpm test(1872 tests)/pnpm build: 全て PASSuv run pytest .claude/skills/gemini-cli-headless-delegation/tests/test_model_routing.py: 24 passed次のアクション
P1-1 の production preflight 配線を完了するには、Issue #2241 の Allowed Paths に
.claude/skills/issue-refinement-loop/scripts/run_refinement_preflight.pyを追加する Scope Delta が必要。control-plane(人間)側で判断・追記をお願いしたい。fix: run_refinement_preflight の isolated profile を credentialless tra…
squne121 commentedon Aug 18, 2026
PR #2247 の P1-1 blocker(OWNER adversarial review、#2247 (comment) )に対応し、head
ba94b448にて解消しました。対応内容
run_refinement_preflight.pyの_fetch_issue()/_fetch_issue_comments()に isolated Claude-GPT session profile 検出(_is_isolated_claude_gpt_profile()。Issue #2241 AC1 のHOME/ real OS account home 乖離シグナルを再利用)を追加し、isolated profile ではgithub_credentialless_read.pyのCredentiallessGitHubReadTransport(list_issue_comments()の pagination 追従込み)経由で Issue/comments を取得、ghCLI へのフォールバックは一切行わないようにしました。isolated profile 以外(既存の human/agent context)は従来のgh issue view --json/gh api --paginate --slurpを無変更で維持しています。AC8 検証
.claude/skills/issue-refinement-loop/tests/test_run_refinement_preflight_credentialless_transport.pyを新規追加し、Issue 記載の exact command で PASS を確認しました:PATH の先頭に「呼び出されたらマーカーファイルを書き込み exit 7 する」marker
gh実行ファイルを配置した状態で isolated profile 相当の条件を作り、_fetch_issue()/_fetch_issue_comments()が credentialless transport 経由で成功し、markerghが一度も起動されないことを behavioral に証明しています。加えて、credentialless データが既存gh issue view --json相当 shape へ正しく変換されること、pagination 追従、非 isolated profile では既存gh経路が変わらないことを検証するテストも追加しました(計4テスト、全て PASS)。回帰確認
.claude/skills/issue-refinement-loop/tests/full suite: 1561 passed(他 consumer への回帰なし)scripts/agent-guards/tests/test_credentialless_github_read.py+test_trusted_toolchain_isolated_home.py: 37 passedpnpm typecheck/pnpm lint/pnpm build: 全て PASSuv run pytest .claude/skills/gemini-cli-headless-delegation/tests/test_model_routing.py: 24 passedscripts/agent-guards/tests/full suite で2件(test_skill_runtime_exec_session_manifest.py)が failed しましたが、本 diff をgit stashした状態でも独立に再現する既知の repo-tree hygiene 汚染(stray__pycache__/.pytest_cache由来)が原因であり、本 fix_delta の変更とは無関係であることを確認済みです。詳細は PR #2247 本文の「P1-1 blocker 対応(head
ba94b448)」セクションを参照してください。マージは行っておらず、人間判断待ちです。squne121 commentedon Aug 18, 2026
OWNER の adversarial review(P1-1〜P1-4)に対する fix_delta が完了しました。
ba94b4489d3f7bd0d8929f3553f124f0e3ec0112run_refinement_preflight.pyの_fetch_issue()/_fetch_issue_comments()をisolated profileでcredentialless transport経由に接続、ghを marker executable化しても一度も起動されないことをbehavioral testで証明(AC8として Issue 本文に追加済み)~/.local/bin): ancestor owner/writability検証・symlink検証・version pattern照合を追加。同一UID脅威モデルの完全解決ではないことをPR本文とdocs/dev/workflow.mdに正直に "Not controlled" として明記control-plane独立確認(pr-reviewer再実行): verdict APPROVE、blockers なし。AC5 runtime verificationも最終headで再実行し証跡更新済み。
Issue本文は2回のScope Deltaで Allowed Paths を計14ファイルに拡張済み(run_refinement_preflight.py 等)。
OWNER (
squne121) の最終レビュー・マージ判断待ちです。本セッションではマージを実行しません。fix: Claude-GPT isolated session の trusted uv toolchain 解決を HOME 分離から…