Repository navigation
Description
Machine-Readable Contract
contract_schema_version: v1
issue_kind: implementation
parent_issue: "none"
goal_ref: "scope_rollup.run の exact child gh boundary に、caller-selected GH_CONFIG_DIR と既存 token carrier を credential value を観測せず維持する"
change_kind: codeParent Issue
なし(単独改善)
Parent Goal Ref
- Goal: canonical scope rollup が launcher-selected GitHub authentication carrier を exact child
ghにだけ保持して、read-only inventory を実行できるようにする。 - Desired Destination: isolated
HOME/ XDG でも、config-only と token-only の双方を壊さず、GH_CONFIG_DIRの因果的回帰を hermetic に検証できる。
Current Validated Scope
- exact
scope_rollup.runの GitHub-consuming childghboundary に、caller-selectedGH_CONFIG_DIRと既存GH_TOKEN/GITHUB_TOKENsupport を維持する最小 production contract。 - production
_run_gh()を通る hermetic fake-ghactual-subprocess regression、config-only causal proof、token-only non-regression、python test-plan の exact-once 登録。
Scope Delta
- Owner-authorized minimal correction: production の
GH_TOKEN/GITHUB_TOKENexplicit unset 要件を撤回し、GH_CONFIG_DIRを既存 allowlist に追加するだけに是正する。config-only fixture/environment 内の両 token explicit unset は維持する。 - live canary は script を含め closing PR の最終差分から削除し、implementation completion、Acceptance Criteria、Verification Commands、runtime-only authority に入れない。これだけのための
baseline_vc_preflight実装: scope_rollup.run のGitHub認証carrierをchild ghへcommand-scopedに維持する #2611 exact-argv exception と専用 parser regression も最終差分から除去し、本 Issue の対象外とする。 .github/ci/python-test-plan.jsonにはtests/codex/test_scope_rollup_auth_capability.pyを scope-rollup targets 群へ exactly once 登録する。.github/workflows/ci.yml、scripts/ci/python_test_plan.py、test-plan test 自体は変更不要・対象外とする。
Remaining Parent Gaps
- launcher XDG portability gap は note-only follow-up candidate とし、本 Issue の In Scope に入れない。
- 実装:scope_rollup.runをskill_runtime_execのsiblingexactprofileへ統合する #1601 と 実装: scope_rollup.run の GraphQL inventory query を分割し partial-error 耐性を上げる #1659 は fresh readback collision guard のみに留める。実装:scope_rollup.runをskill_runtime_execのsiblingexactprofileへ統合する #1601 の outer sibling-profile integration と 実装: scope_rollup.run の GraphQL inventory query を分割し partial-error 耐性を上げる #1659 の GraphQL query split/pagination DTO redesign は本 Issue で変更しない。
Outcome
_sanitized_gh_env() と exact child gh は、caller-selected GH_CONFIG_DIR を値の推測・生成・探索なしに保持し、既存 GH_TOKEN と GITHUB_TOKEN support も保持する。GH_HOST=github.com pin、GH_REPO、debug、pager 等の ambient sanitation は維持し、production で token の explicit unset を要求しない。
implementation completion と acceptance authority は hermetic actual-subprocess regression である。config-only fixture/environment では isolated HOME / XDG、両 token の explicit unset、fake gh の actual subprocess、production _run_gh()、issue view と direct GraphQL の両 path、carrier-absence negative control を維持する。加えて exact child environment で GH_TOKEN only と GITHUB_TOKEN fallback only を確認し、token-only authentication の non-regression を保証する。
live canary、external network、live diagnostic は implementation completion、acceptance authority、Verification Commands、runtime-only authority のいずれにも入れない。最終設計は canary script と、そのためだけの baseline parser 例外・専用 parser regression を closing PR の最終差分に残さない。GraphQL failure-class redesign は #1659 の外部 ownership として変更しない。
Runtime Verification Applicability
- decision: not_applicable
- reason: 本 Issue の acceptance は hermetic actual-subprocess regression、token non-regression、python test-plan canonical selection/exact-once、fresh Issue readback で完結する。external network/live diagnostic は completion blocker にしない。
In Scope
scripts/agent-guards/run_scope_rollup_preflight.pyの_sanitized_gh_env()と production_run_gh()の exact childghboundary における、caller-selectedGH_CONFIG_DIRと既存GH_TOKEN/GITHUB_TOKENsupport の command-scoped 維持。GH_HOST=github.compin、GH_REPO/ debug / pager 等の ambient sanitation、non-GitHub child への非伝播を維持する最小 production contract。- isolated
HOME/ XDG、両 token explicit unset の config-only fixture/environment で、fakeghを production_run_gh()から起動し、issue-view、direct GraphQL、carrier-absence negative control を検証する hermetic actual-subprocess regression。 - exact child environment での
GH_TOKENonly およびGITHUB_TOKENfallback only の token non-regression。 .github/ci/python-test-plan.jsonへの focused test の exactly-once 登録。- 実装:scope_rollup.runをskill_runtime_execのsiblingexactprofileへ統合する #1601 / 実装: scope_rollup.run の GraphQL inventory query を分割し partial-error 耐性を上げる #1659 の fresh readback collision guard。
Out of Scope
- live canary、live runtime verification、runtime-only authority、external network/live diagnostic を completion blocker にすること。canary script、
baseline_vc_preflightの 実装: scope_rollup.run のGitHub認証carrierをchild ghへcommand-scopedに維持する #2611 exact-argv exception、専用 parser regression は closing PR の最終差分から削除し、最終実装の対象ファイルには含めない。 baseline_vc_preflightの 実装: scope_rollup.run のGitHub認証carrierをchild ghへcommand-scopedに維持する #2611 exact-argv exception、専用 parser regression、genericuv/ Python / rawghallowance、broad shell permission、generic command registry metadata。HOME/ XDG の共有・portability 修正、SSH/GPG/askpass/git credential helper、credential broker、daemon、secret manager、permission mechanism、ledger、schema。- 実装: scope_rollup.run の GraphQL inventory query を分割し partial-error 耐性を上げる #1659 の query split / pagination DTO redesign。
- 実装:scope_rollup.runをskill_runtime_execのsiblingexactprofileへ統合する #1601 の outer sibling-profile integration。
- launcher XDG portability gap の実装(note-only follow-up candidate)。
- GitHub mutation、および credential/token/config contents、raw
GH_CONFIG_DIR、absolute config/HOME path、raw stdout/stderr の保存・出力。
Acceptance Criteria
- AC1:
_sanitized_gh_env()と production_run_gh()の exact GitHub-consuming childghは caller-selectedGH_CONFIG_DIRを値の推測・生成・探索なしに保持し、既存GH_TOKEN/GITHUB_TOKENsupport を保持する。GH_HOSTはgithub.comに pin され、GH_REPO、debug、pager 等は scrub され、non-GitHub child は GitHub auth carrier を受け取らない。nonsecret diagnostic は carrier 値を出力せず、production で token explicit unset を要求しない。 - AC2: config-only causal regression は isolated
HOME/ XDG と fixture/environment 内のGH_TOKEN/GITHUB_TOKENexplicit unset で、production_run_gh()から fakeghactual subprocess を起動し、gh issue viewと directgh api graphqlの両 path を通す。carrier-absence negative control は exact child environment からGH_CONFIG_DIRを外して fixture authentication failure を観測し、empty inventory / success に変換しない。 - AC3: token-only non-regression は exact child environment に
GH_TOKENのみを渡す場合と、GH_TOKENを unset してGITHUB_TOKENのみを渡す fallback の場合をそれぞれ検証し、既存 token carrier を production contract から除去しない。 - AC4:
tests/codex/test_scope_rollup_auth_capability.pyの focused suite は、config-only causal actual-process proof、negative control、token-only non-regression、.github/ci/python-test-plan.jsonの scope-rollup targets 群への exactly-once 登録および canonical selection を検証する。 - AC5: 実装開始前、push 前、merge 前に 実装:scope_rollup.runをskill_runtime_execのsiblingexactprofileへ統合する #1601 と 実装: scope_rollup.run の GraphQL inventory query を分割し partial-error 耐性を上げる #1659 を fresh readback する。いずれかが open でなく canonical boundary/path が変化していれば Stop Condition とし、両方が open でも 実装:scope_rollup.runをskill_runtime_execのsiblingexactprofileへ統合する #1601 の outer sibling-profile integration と 実装: scope_rollup.run の GraphQL inventory query を分割し partial-error 耐性を上げる #1659 の query split/pagination DTO redesign を本 Issue に取り込まない。
Verification Commands
各 baseline-expect failure は current baseline で対象 test が未実装であることを表す。実装後は対応 command が PASS しなければならない。live canary、baseline parser 専用 test、external network diagnostic は Verification Command に含めない。
# AC1
# baseline-expect: fail
$ uv run pytest tests/codex/test_scope_rollup_auth_capability.py::test_given_gh_child_when_sanitized_then_selected_config_and_token_carriers_are_retained -q
# AC2
# baseline-expect: fail
$ uv run pytest tests/codex/test_scope_rollup_auth_capability.py::test_given_config_only_auth_when_production_gh_paths_run_then_both_receive_selected_config tests/codex/test_scope_rollup_auth_capability.py::test_given_config_only_auth_when_config_is_absent_then_both_paths_fail_authentication -q
# AC3
# baseline-expect: fail
$ uv run pytest tests/codex/test_scope_rollup_auth_capability.py::test_given_token_only_auth_when_production_gh_paths_run_then_token_fallback_is_retained -q
# AC4
# baseline-expect: fail
$ uv run pytest tests/codex/test_scope_rollup_auth_capability.py::test_given_python_test_plan_when_scope_rollup_suite_is_registered_then_it_is_exactly_once_and_collectable -q
# AC5
# baseline-expect: pass
$ gh issue view 1601 --repo squne121/loop-protocol
# baseline-expect: pass
$ gh issue view 1659 --repo squne121/loop-protocolAllowed Paths
- scripts/agent-guards/run_scope_rollup_preflight.py
- tests/codex/test_scope_rollup_auth_capability.py
- .github/ci/python-test-plan.json
Stop Conditions
- Allowed Paths 外の変更が必要と判明した場合。
- In Scope の固定契約(キー集合・スキーマ・型定義)の変更が必要になった場合、すなわち exact child
ghboundary を越える schema、permission、credential broker、または launcher-XDG 変更が必要な場合。 - 新規 Issue の起票が必要と判断した場合(スコープ分割が発生する場合)。本 Issue scope 外の分割が実際に必要になったときの future stop であり、現在は起票しない。
- 後続 Phase / 別スコープへの波及が判明した場合、特に 実装:scope_rollup.runをskill_runtime_execのsiblingexactprofileへ統合する #1601 outer sibling-profile integration または 実装: scope_rollup.run の GraphQL inventory query を分割し partial-error 耐性を上げる #1659 query/pagination redesign が必要な場合、または fresh readback で canonical boundary/path collision が確認された場合。
- nested SubAgent delegation が必要になった場合、または focused deterministic regression(config-only causal proof、token-only non-regression、python test-plan registration)が成立しない場合。
- 外部サービス利用・権限昇格・既存テスト大規模改変が必要になった場合、または credential/config 内容・raw path の露出を避けられない、もしくは secret Decision Gate が必要な場合。
Required Skills
なし
Required Design References
- docs/dev/secret-policy.md
- docs/dev/runtime-verification-policy.md
- docs/dev/agent-skill-boundaries.md
- docs/dev/hook-boundaries.md
- docs/dev/workflow.md
- Issue 実装:scope_rollup.runをskill_runtime_execのsiblingexactprofileへ統合する #1601
- Issue 実装: scope_rollup.run の GraphQL inventory query を分割し partial-error 耐性を上げる #1659
Background
Owner/operator authorized the correction direction at #2624 (comment). GH_CONFIG_DIR を追加する production 修正は既存 token-only authentication を撤去しない。tokens unset は config-only causal proof の fixture/environment に限定し、stored-config 利用者と token-only 利用者をともに守る。
parent authentication success は downstream child authentication の証明ではないが、live canary をこの Issue の authority にすると availability と runtime-only workflow semantics を completion に持ち込む。したがって production _run_gh() を通る hermetic actual-subprocess regression、token non-regression、python test-plan exact-once confirmation だけを implementation authority とする。
Source / Related
- Dedupe key:
auth-capability-parity:squne121/loop-protocol:scope_rollup.run:GH_CONFIG_DIR:exact-child-gh - Related: 実装:scope_rollup.runをskill_runtime_execのsiblingexactprofileへ統合する #1601, 実装: scope_rollup.run の GraphQL inventory query を分割し partial-error 耐性を上げる #1659, 調査: RECEIPT_PERFORMANCE_ONLY_EVIDENCE_ERROR_REASONS allowlist に missing_monolith_performance_phase を追加すべきか #2580 (closed; related confirmation only and not a runtime target)
Delivery Rule
- 1 Issue = 1 PR。実装開始前、push 前、merge 前に 実装:scope_rollup.runをskill_runtime_execのsiblingexactprofileへ統合する #1601 と 実装: scope_rollup.run の GraphQL inventory query を分割し partial-error 耐性を上げる #1659 を fresh readback する。
- hermetic config-only actual-subprocess regression、token-only non-regression、python test-plan exact-once confirmation の PASS が implementation completion / merge authority である。live canary は削除する設計であり、canonical completion blocker にしない。
- credential/config 内容、raw paths、raw stdout/stderr を Issue/PR artifact に転載しない。
Activity
squne121 commentedon Sep 10, 2026
総合判定
CONTRACT_REQUEST_CHANGES を推奨します。
#2611 の中核目的は妥当です。むしろ current
mainには明確な不整合があります。run_scope_rollup_preflight.pyはGH_TOKEN/GITHUB_TOKENを childghに残す一方、GH_CONFIG_DIRを明示的に scrub しており、_run_gh()経由のgh issue viewとgh api graphqlがその sanitized environment を使います。つまり、launcher が config-based authentication を成立させても、この direct worker 境界だけで credential carrier が失われます。これは既存方針とも食い違います。PR #2303 は isolated Claude-GPT に
GH_CONFIG_DIRを含む GitHub auth carrier を native-equivalent に共有する方向へ切り替え、PR #2407 はskill_runtime_exec.pyでも実際に GitHub CLI を使う exact command ID に限定してGH_CONFIG_DIRを伝播する方式を採用済みです。したがって、production fix は小さく入れるべきです。ただし現在の #2611 は、その小さな不具合修正に対して runtime harness を重くしすぎています。
敵対的レビュー
Severity | 指摘 | 判定 -- | -- | -- P0 | config-only 認証を証明するテストになっていないと false PASS が可能 | GitHub CLI は GH_TOKEN、次に GITHUB_TOKEN を stored credential より優先します。したがって runtime canary や regression test に token env が残っていると、GH_CONFIG_DIR が依然消えていても child gh が成功します。(GitHub CLI) P0 | live canary の exit 77 を Stop Condition にするのは過剰 | 外部 GitHub auth/network/Claude-GPT runtime availability が無いだけで、決定論的な env-propagation fix の実装を止めます。#2407 では live runtime diagnostic unavailable を merge blocker にしておらず、PR #2438 も actual runtime canary の SKIP/UNAVAILABLE を「PASSではないが focused tests が通れば merge blocker ではない」と扱っています。 P1 | auth 修正と GraphQL inventory 健全性が同じ canary に混ざっている | exact scope_rollup.run 全体を live 実行すると、auth carrier が正常でも rate/resource limit、pagination、#1659 側の問題で FAIL します。GitHub GraphQL は resource limit 時に partial result + error を返し得るため、これは現実的な別 fault domain です。(GitHub Docs) P1 | carrier path identity の artifact 化が不要に強い | config path の raw absolute value を記録する必要はありません。runtime 内で比較して carrier_path_match: true/false だけ残せば十分です。「HOME 絶対パスを保存しない」という契約とも素直に整合します。 P1 | baseline VC parser への専用例外は compatibility tax | ただし、これは単純削除すべきとは言えません。現行 baseline は runtime_only VC 自体は実行しないものの command identity/policy の対象として保持し、既に runtime smoke 用 exact argv allowlist もあります。#2611 では finite exact argv recognition のみに留め、実行ロジックや新しい汎用 harness を増やさないのが妥当です。 P2 | canary が Issue #2580 に固定されているのは不要な結合 | #2580 は今回の認証境界とは無関係な research Issue で、既に CLOSED + COMPLETED です。動作はしますが、将来的な意味がありません。VC なら #2611 自身を渡すか、--issue-number を必須入力のままにすべきです。 P2 | launcher 側に別の XDG portability gap がある | current launcher は GH_CONFIG_DIR 未指定時に ${HOME}/.config/gh を採りますが、GitHub CLI 本来の優先順位は $XDG_CONFIG_HOME/gh → Windows AppData → $HOME/.config/gh です。これは #2611 で直すべきではありませんが、別 follow-up 候補です。 (GitHub CLI)P0-1:テストは GH_CONFIG_DIR-only を必須ケースにするべき
ここが最重要です。
#2611 の主張したい性質は、
です。
なら positive regression の environment は、最低でも
GH_CONFIG_DIRは設定、GH_TOKEN/GITHUB_TOKENは明示 unset にする必要があります。そうしないと token authentication がバグを隠します。また
uv run --isolatedが隔離するのは Python project の virtual environment / dependencies です。OS process environment からGH_TOKEN等を自動的に scrub する機能ではありません。したがってテスト側で明示的に environment を構成する必要があります。(Astral Docs)このケースに加えて token-only を確認するなら有用ですが、核心は config-only です。secret 値の表示や credential file 内容の読み出しは不要です。
P0-2:live actual-process canary は「補助証跡」に落とす
現在の #2611 は AC2 について actual-process canary の exit 0 だけを PASS authority とし、exit 77 を Stop Condition にしています。
個人趣味開発の completion rate を優先するなら逆です。
merge authority は hermetic な production-boundary test に置くべきです。fake
ghを subprocess として実際の_run_gh()から起動し、config-only carrier が同じ child に到達したこと、gh issue viewと GraphQL path が実際にその境界を通ったことを確認すれば、今回の causal property は証明できます。live canary は、
parent GitHub read unavailable →
UNAVAILABLE/SKIP、非blockingparent read 成功 + child 成功 → supplemental PASS
parent read 成功 + child だけ authentication failure → 本物の regression として FAIL
child が GraphQL partial/pagination failure → auth fix の失敗とは分類せず、別 failure class として報告
くらいが適切です。
これは #1860 の「live state・実diff・実test・CI・独立reviewを authority にし、過剰な独自 control-plane を増やさない」という現在の project policy にも合います。
GraphQL failure semantics は変更しない
#2611 の AC5 が「GraphQL authentication / partial / pagination failure を empty inventory や success に変換しない」としている点は正しいです。GitHub 公式にも resource-limit 時に partial results と error が同時に返ることが明記されています。(GitHub Docs)
ただし、新しい GraphQL failure framework を #2611 で作る必要はありません。query 分割や pagination completeness は #1659 の ownership です。#2611 では「認証 env の変更後も既存 fail-closed semantics が壊れていない」という focused non-regression 一本程度で十分です。
#1601 についても outer
skill_runtime_execsibling-profile integration は別 ownership のままでよく、しかも現在の Owner Decision は fresh re-review 前の実装を許可していません。#2611 がそこへ踏み込まない設計は正しいです。推奨する #2611 の縮小形
私なら契約を次の4点に絞ります。
Production:
_sanitized_gh_env()で caller-providedGH_CONFIG_DIRをそのまま保持する。値がなければ推測・生成しない。GH_HOST=github.compin、GH_REPO/debug/pager scrub は維持する。Deterministic regression: isolated HOME/XDG +
GH_CONFIG_DIR-only + token unset の actual subprocess fixture で、production_run_gh()→ fakeghを通して carrier preservation を証明する。negative caseではGH_CONFIG_DIRを外すと fake provider が失敗するようにし、テスト自体が意味を持つことも証明する。Live canary:
verify_scope_rollup_auth_capability_runtime.pyは残してよいが optional runtime diagnostic にする。exit 77 は Stop Condition ではなく UNAVAILABLE。artifact はcarrier_source: gh_config_dir、carrier_path_match: true、execution_path: direct_graphql、fallback: false、exit/verdict 程度に限定する。Harness:
baseline_vc_preflight.pyの変更が現行 command policy 上必要なら、実装: scope_rollup.run のGitHub認証carrierをchild ghへcommand-scopedに維持する #2611 の exact argv 一形状を認識するだけに留める。generic Python/uvallowance、新 schema、新 broker、新 permission mechanism、新 ledger は作らない。production code の本質的な delta は、極端に言えば
GH_CONFIG_DIRを drop 対象から外し、allowlist に加えるだけです。既にGH_TOKEN/GITHUB_TOKEN、trusted host pin、subprocess sanitation、GraphQL fail-close は存在します。なお、
scope-rollup-runner自体も現在は automatic dispatch から外れた manual advisory diagnostic と定義されています。このレーンのために central control-plane をさらに重くする費用対効果は低いです。最終評価
修正対象のバグは実在し、#2611 は残す価値があります。しかし現行 Issue 契約のまま実装開始するより、runtime verification の authority を修正してから着手する方がよいです。
特に修正必須なのは 「config-only positive test」 と 「exit 77 ≠ implementation Stop Condition」 の2点です。それ以外は縮小・整理の範囲です。確認時点で #2611 はコメント 0 件で、対応する実装PRも確認できていないため、今ならコードを巻き戻すことなく Issue 契約から修正できます。
## 総合判定CONTRACT_REQUEST_CHANGES を推奨します。
#2611 の中核目的は妥当です。むしろ current
mainには明確な不整合があります。run_scope_rollup_preflight.pyはGH_TOKEN/GITHUB_TOKENを childghに残す一方、GH_CONFIG_DIRを明示的に scrub しており、_run_gh()経由のgh issue viewとgh api graphqlがその sanitized environment を使います。つまり、launcher が config-based authentication を成立させても、この direct worker 境界だけで credential carrier が失われます。これは既存方針とも食い違います。PR #2303 は isolated Claude-GPT に
GH_CONFIG_DIRを含む GitHub auth carrier を native-equivalent に共有する方向へ切り替え、PR #2407 はskill_runtime_exec.pyでも実際に GitHub CLI を使う exact command ID に限定してGH_CONFIG_DIRを伝播する方式を採用済みです。したがって、production fix は小さく入れるべきです。ただし現在の #2611 は、その小さな不具合修正に対して runtime harness を重くしすぎています。
敵対的レビュー
GH_TOKEN、次にGITHUB_TOKENを stored credential より優先します。したがって runtime canary や regression test に token env が残っていると、GH_CONFIG_DIRが依然消えていても childghが成功します。(GitHub CLI)scope_rollup.run全体を live 実行すると、auth carrier が正常でも rate/resource limit、pagination、#1659 側の問題で FAIL します。GitHub GraphQL は resource limit 時に partial result + error を返し得るため、これは現実的な別 fault domain です。([GitHub Docs]2)carrier path identityの artifact 化が不要に強いcarrier_path_match: true/falseだけ残せば十分です。「HOME 絶対パスを保存しない」という契約とも素直に整合します。runtime_onlyVC 自体は実行しないものの command identity/policy の対象として保持し、既に runtime smoke 用 exact argv allowlist もあります。#2611 では finite exact argv recognition のみに留め、実行ロジックや新しい汎用 harness を増やさないのが妥当です。CLOSED + COMPLETEDです。動作はしますが、将来的な意味がありません。VC なら #2611 自身を渡すか、--issue-numberを必須入力のままにすべきです。GH_CONFIG_DIR未指定時に${HOME}/.config/ghを採りますが、GitHub CLI 本来の優先順位は$XDG_CONFIG_HOME/gh→ Windows AppData →$HOME/.config/ghです。これは #2611 で直すべきではありませんが、別 follow-up 候補です。 (GitHub CLI)P0-1:テストは GH_CONFIG_DIR-only を必須ケースにするべき
ここが最重要です。
#2611 の主張したい性質は、
です。
なら positive regression の environment は、最低でも
GH_CONFIG_DIRは設定、GH_TOKEN/GITHUB_TOKENは明示 unset にする必要があります。そうしないと token authentication がバグを隠します。また
uv run --isolatedが隔離するのは Python project の virtual environment / dependencies です。OS process environment からGH_TOKEN等を自動的に scrub する機能ではありません。したがってテスト側で明示的に environment を構成する必要があります。([Astral Docs]3)このケースに加えて token-only を確認するなら有用ですが、核心は config-only です。secret 値の表示や credential file 内容の読み出しは不要です。
P0-2:live actual-process canary は「補助証跡」に落とす
現在の #2611 は AC2 について actual-process canary の exit 0 だけを PASS authority とし、exit 77 を Stop Condition にしています。
個人趣味開発の completion rate を優先するなら逆です。
merge authority は hermetic な production-boundary test に置くべきです。fake
ghを subprocess として実際の_run_gh()から起動し、config-only carrier が同じ child に到達したこと、gh issue viewと GraphQL path が実際にその境界を通ったことを確認すれば、今回の causal property は証明できます。live canary は、
UNAVAILABLE/SKIP、非blockingくらいが適切です。
これは #1860 の「live state・実diff・実test・CI・独立reviewを authority にし、過剰な独自 control-plane を増やさない」という現在の project policy にも合います。
GraphQL failure semantics は変更しない
#2611 の AC5 が「GraphQL authentication / partial / pagination failure を empty inventory や success に変換しない」としている点は正しいです。GitHub 公式にも resource-limit 時に partial results と error が同時に返ることが明記されています。([GitHub Docs]2)
ただし、新しい GraphQL failure framework を #2611 で作る必要はありません。query 分割や pagination completeness は #1659 の ownership です。#2611 では「認証 env の変更後も既存 fail-closed semantics が壊れていない」という focused non-regression 一本程度で十分です。
#1601 についても outer
skill_runtime_execsibling-profile integration は別 ownership のままでよく、しかも現在の Owner Decision は fresh re-review 前の実装を許可していません。#2611 がそこへ踏み込まない設計は正しいです。推奨する #2611 の縮小形
私なら契約を次の4点に絞ります。
_sanitized_gh_env()で caller-providedGH_CONFIG_DIRをそのまま保持する。値がなければ推測・生成しない。GH_HOST=github.compin、GH_REPO/debug/pager scrub は維持する。GH_CONFIG_DIR-only + token unset の actual subprocess fixture で、production_run_gh()→ fakeghを通して carrier preservation を証明する。negative caseではGH_CONFIG_DIRを外すと fake provider が失敗するようにし、テスト自体が意味を持つことも証明する。verify_scope_rollup_auth_capability_runtime.pyは残してよいが optional runtime diagnostic にする。exit 77 は Stop Condition ではなく UNAVAILABLE。artifact はcarrier_source: gh_config_dir、carrier_path_match: true、execution_path: direct_graphql、fallback: false、exit/verdict 程度に限定する。baseline_vc_preflight.pyの変更が現行 command policy 上必要なら、実装: scope_rollup.run のGitHub認証carrierをchild ghへcommand-scopedに維持する #2611 の exact argv 一形状を認識するだけに留める。generic Python/uvallowance、新 schema、新 broker、新 permission mechanism、新 ledger は作らない。production code の本質的な delta は、極端に言えば
GH_CONFIG_DIRを drop 対象から外し、allowlist に加えるだけです。既にGH_TOKEN/GITHUB_TOKEN、trusted host pin、subprocess sanitation、GraphQL fail-close は存在します。なお、
scope-rollup-runner自体も現在は automatic dispatch から外れた manual advisory diagnostic と定義されています。このレーンのために central control-plane をさらに重くする費用対効果は低いです。最終評価
修正対象のバグは実在し、#2611 は残す価値があります。しかし現行 Issue 契約のまま実装開始するより、runtime verification の authority を修正してから着手する方がよいです。
特に修正必須なのは 「config-only positive test」 と 「exit 77 ≠ implementation Stop Condition」 の2点です。それ以外は縮小・整理の範囲です。確認時点で #2611 はコメント 0 件で、対応する実装PRも確認できていないため、今ならコードを巻き戻すことなく Issue 契約から修正できます。
squne121 commentedon Sep 10, 2026
推奨アクションは #5615763656 を
operator_asserted_human_contextとして canonical human-context lane で消費し、#2611 の Issue 契約を in-place 修正したうえでissue-refinement-loopを完走させる です。対象コメントは #2611 所属・OWNER 投稿で、具体的な contract change を提示しています。なお origin authority 自体は author metadata から推測するのではなく、今回の operator 指示に基づきwith_human_contextlane を選ぶのが現行設計です。特に、現在の #2611 には live canary の exit 77 を Stop Condition とする契約や #2580 への固定結合がまだ残っています。一方、境界所有者の #1601 と #1659 は現在も open、#2580 は
closed/completedです。したがって、実装に進む前に target comment の指摘を Issue 本文へ反映する順序が適切です。外部仕様面でも、
GH_TOKEN/GITHUB_TOKENは stored credential より優先されるため config-only test では明示的な token unset が必要です。またuv run --isolatedは dependency environment の isolation なので、その点を代替しません。([GitHub CLI]1)そのまま Claude-GPT に投入するプロンプトです。
リポジトリ
squne121/loop-protocolの Issue #2611 を対象に、エージェントスキル.claude/skills/issue-refinement-loopを実行してください。対象:
#2611
今回の operator-selected human context / anchor:
#2611 (comment)
この対話プロンプトは direct operator instruction です。上記 anchor comment を agent report / unlabeled anchor として扱わず、canonical
with_human_contextlane のoperator_asserted_human_contextとして処理してください。既に auto mode で起動している対話的 Claude-GPT セッションです。通常の refinement iteration、deterministic repair、semantic rewrite、Issue 本文の controlled update、再レビューについて人間の承認確認を挟まないでください。Claude Code / Claude-GPT 自体の permission mode を変更したり、dangerously-skip-permissions 等を追加したりする意味ではありません。
以下の手順で自律的に完走してください。
最初に current
origin/main、Issue 実装: scope_rollup.run のGitHub認証carrierをchild ghへcommand-scopedに維持する #2611 本文、anchor comment #5615763656、および.claude/skills/issue-refinement-loop/SKILL.mdと必要なreferences/を再読してください。古い会話・artifact・過去の loop result を current authority として流用しないでください。anchor comment は
CONTRACT_REQUEST_CHANGESを要求する具体的な human review directive として扱ってください。barepreflight.run、with_agent_report、unlabeledwith_anchorに落とさず、command registry が定義する canonicalpreflight.run.with_human_contextprofile を利用してください。argv を手書きで再発明せず registry / canonical executor を SoT としてください。調査では必ず SubAgent を使用してください。少なくとも
codebase-investigatorと、外部仕様確認が必要なのでweb-researcherを適切に dispatch してください。独立して並列化可能な調査は並列化して構いません。重要: SubAgent を起動しただけで先へ進まないでください。すべての必須 SubAgent の completion を明示的に join / await し、結果を回収してから main orchestrator が判断してください。SubAgent に Issue mutation や最終 routing 判断を委譲しないでください。
codebase-investigatorには少なくとも current main の以下を fact-check させてください。scripts/agent-guards/run_scope_rollup_preflight.py_sanitized_gh_env()_run_gh()から childgh issue view/gh api graphqlへ至る subprocess boundaryGH_CONFIG_DIR,GH_TOKEN,GITHUB_TOKEN,GH_HOST,GH_REPOの現在の sanitation / propagationbaseline_vc_preflight.pyの runtime-only command recognition関連 Issue / PR / comment / repository asset は current state を取得してください。特に #1601 と #1659 の state は fresh readback し、それらの ownership を #2611 に取り込まないでください。#2580 が現在 closed/completed であることも確認し、runtime canary を無関係な #2580 に固定する必要性を再評価してください。
web-researcherには少なくとも authoritative primary source を使って次を確認させてください。GH_TOKEN/GITHUB_TOKENと stored credential /GH_CONFIG_DIRの precedenceGH_CONFIG_DIR未指定時の XDG / AppData / HOME fallbackuv run --isolatedが何を isolate し、OS process environment の token env scrub を保証するものではないことブログや二次情報より GitHub CLI / GitHub Docs / Astral uv の公式ドキュメントを優先してください。
期待する refinement の中心は以下です。
GH_CONFIG_DIRを exact GitHub-consuming child boundaryへ維持するが、値が無い場合に推測・生成・探索しない。GH_CONFIG_DIR-only、GH_TOKEN/GITHUB_TOKEN明示 unset を必須ケースにし、production_run_gh()から actual subprocess として fakeghを起動して carrier preservation を検証する。GH_CONFIG_DIRが届かなければ fixture が実際に失敗することを確認して false-positive test を防ぐ。carrier_path_match: true|false程度の非secret summary に縮小できるか検討する。baseline_vc_preflight.pyの変更が current policy 上必要なら、実装: scope_rollup.run のGitHub認証carrierをchild ghへcommand-scopedに維持する #2611 の exact finite argv recognition のみに限定する。genericuv/ Python / rawghallowance、新 permission mechanism、新 broker、新 ledger、新 schema を導入しない。preflight.run.with_human_contextが trusted contract patch plan を生成した場合、main control-plane / canonical main root からだけcontract_update.run.with_human_contextを実行してください。SubAgent や isolation worktree からこの mutation phase を実行しないでください。通常の Issue 本文 update は今回明示的に承認済みです。contract patch が deterministic に適用可能なら追加の人間承認を求めず適用し、readback してください。
.claude/skills/issue-refinement-loopの残りを継続してください。review がneeds-fixならmax_iterationsの範囲内で自動 rewrite → fresh review を繰り返してください。iteration ごとに「続けてよいですか」と確認しないでください。
今回の anchor が freeform であること、以前の Issue 契約と scope が違うこと、live canary が unavailable であること、それ自体を理由に安易に human approval へ戻さないでください。今回の operator instruction と
with_human_contextlane で解決可能な scope delta は canonical contract-update path で処理してください。一方で、canonical control-plane が destructive/non-idempotent operation、secret value の取得・露出、permission boundary / external-service boundary の変更、解消不能な issue split、または正規経路では修復不能な environment failure を genuine hard blocker と判定した場合は、guardrail を迂回せず停止し、reason code と evidence を報告してください。
max_iterations 到達時も勝手に上限を破って rewrite を追加しないでください。
impl-review-loopの開始までは進めないでください。終了条件は、fresh final review / contract-readiness が implementation handoff 可能な状態になり、#2611 本文が anchor comment の有効な指摘を反映し、関連 ownership と Verification/AC/Stop Conditions が相互矛盾していないことです。
最後に以下を簡潔に報告してください。
人間の中間承認は不要です。現在の repository-native control-plane、skill SSOT、current evidence を優先し、#2611 を implementation-ready な最小契約まで自律的に refinement してください。
このプロンプトでは、「承認不要」≠ permission/guardrail の迂回 と分離しつつ、今回のコメントで既に解決可能な判断を再び
human_judgment_requiredに落とさないようにしています。現時点では #2611 を参照する実装 PR も検索結果に出ていないため、先に contract を修正する運用で問題ありません。squne121 commentedon Sep 10, 2026
推奨アクション
#2611 は、以前の敵対的レビューで問題になった token による false PASS と live canary unavailable の過剰な停止を、現在の Issue 本文ですでに修正しています。現在は
GH_CONFIG_DIR-only の hermetic actual-subprocess regression が implementation/merge authority で、live canary は補助診断です。したがって、再度 issue-refinement-loop に戻さず、そのまま impl-review-loop に投入するのが適切です。実装も広げるべきではありません。
skill_runtime_exec.pyには既に「実際に GitHub CLI へ到達する有限の command ID だけGH_CONFIG_DIRを保持する」という先行パターンがあるため、それを設計参考にして、scope_rollup.runの exact childghboundary にだけ適用するのが妥当です。 また #1601 / #1659 は現在も open で、#2611 は両者を fresh-readback collision guard として扱う契約です。SubAgent については、root → implementation-worker / test-runner / pr-reviewer という
impl-review-loop本来の委譲を使います。一方、#2611 の「nested SubAgent delegation が必要なら Stop Condition」は、これらの子がさらに孫 SubAgent を必要とするケースとして扱うのが整合的です。各 SubAgent は final result を受け取るだけでは不十分で、list_agentsでも terminalcompletedを確認してから次へ進ませます。また「マージ直前」は現在の skill 契約と一致します。
APPROVE、live mergeability=CLEAN/HAS_HOOKS、blockersなしまで自動反復し、そこでdraft_pr_readyとして終了して実際の merge は行いません。そのまま、既に auto mode で動いている Claude-GPT に投入するプロンプトです。
リポジトリ
squne121/loop-protocolの Issue #2611 を対象に、.claude/skills/impl-review-loopを実行してください。対象:
#2611
これは既に auto mode で起動している対話的 Claude-GPT セッションへの direct operator instruction です。
目的は、Issue #2611 の current live contract に従って実装・検証・PR作成・CI確認・PRレビュー・指摘修正ループを自律実行し、実際の merge 操作だけを残した状態まで到達することです。
通常の実装判断、テスト、修正、commit、push、PR作成・更新、レビュー対応、stale-head 再レビュー、BEHIND 時の branch update、CI failure の修正・再検証について、人間への「進めてよいですか」「修正してよいですか」という承認確認を挟まないでください。
Claude-GPT / Claude Code の permission mode を変更したり、permission bypass、
dangerously-skip-permissions等を追加したりする指示ではありません。現在の runtime / adapter / repository policy を維持してください。最初に current
origin/mainと live Issue 実装: scope_rollup.run のGitHub認証carrierをchild ghへcommand-scopedに維持する #2611、Issue comments、.claude/skills/impl-review-loop/SKILL.mdおよび同 skill が現在参照する preparation / Step 1 / Step 2 / Step 4 / Step 5 / context guardrail を fresh に読み直してください。過去の会話、古い contract snapshot、古い loop result、古い PR review を current authority として流用しないでください。impl-review-loopの Root-Owned Synchronous Entry Transition を正規経路として使用し、Step 1 を手動で shortcut しないでください。current-run の issue-contract-review、live readback、routing が skill 上必要なら、その同じ continuous control flow 内で完了してから Step 1 へ進んでください。Issue 実装: scope_rollup.run のGitHub認証carrierをchild ghへcommand-scopedに維持する #2611 の現在の本文を authoritative implementation contract としてください。以前の review comment にあった古い契約ではなく current body を優先してください。特に、implementation completion / merge authority は isolated HOME/XDG、caller-selected
GH_CONFIG_DIR-only、GH_TOKEN/GITHUB_TOKENunset の hermetic actual-subprocess regression です。live runtime canary は supplemental diagnostic であり、parent capability または network unavailable のUNAVAILABLE/SKIPを PASS とも implementation Stop Condition ともしないでください。実装開始直前に Issue 実装:scope_rollup.runをskill_runtime_execのsiblingexactprofileへ統合する #1601 と 実装: scope_rollup.run の GraphQL inventory query を分割し partial-error 耐性を上げる #1659 を fresh readback してください。push の直前、および最終 merge-ready 判定の直前にも fresh readback してください。両方が open であれば 実装: scope_rollup.run のGitHub認証carrierをchild ghへcommand-scopedに維持する #2611 を継続できますが、実装:scope_rollup.runをskill_runtime_execのsiblingexactprofileへ統合する #1601 の outer sibling-profile integration や 実装: scope_rollup.run の GraphQL inventory query を分割し partial-error 耐性を上げる #1659 の GraphQL query split / pagination DTO redesign を 実装: scope_rollup.run のGitHub認証carrierをchild ghへcommand-scopedに維持する #2611 に取り込まないでください。いずれかが open ではなくなり、かつ canonical boundary/path が変化している場合だけ Issue 実装: scope_rollup.run のGitHub認証carrierをchild ghへcommand-scopedに維持する #2611 の Stop Condition としてください。
impl-review-loopの各作業 Step は必ず canonical SubAgent に委譲してください。Step 1 はimplementation-worker+implement-issue、Step 2 はtest-runner、Step 4 はpr-reviewer+pr-review-judgeを使用してください。REQUEST_CHANGES 後の修正やupdate_branchも skill の routing 契約どおり worker に委譲してください。root/main thread は orchestration、state tracking、routing、必要な mutation authorization に専念し、SubAgent の担当作業を勝手に肩代わりしないでください。Issue 実装: scope_rollup.run のGitHub認証carrierをchild ghへcommand-scopedに維持する #2611 の「nested SubAgent delegation が必要なら Stop Condition」は、これら root-level child SubAgent がさらに別 SubAgent を spawn する必要が生じた場合に適用してください。通常の impl-review-loop 自身による root → child の委譲を禁止するものとして解釈しないでください。すべての SubAgent dispatch について completion join を厳密に行ってください。
spawn_agent後は canonical task name を保持してください。wait_agentの timeout、steer、途中 mailbox update、部分的な返答を作業完了とみなしてはいけません。対象 SubAgent の final result を実際に取得・消費した後、list_agentsで同じ canonical task name が terminalcompletedであることを確認してください。final result と terminalcompletedの両方が成立するまで次の Step や最終 routing に進まないでください。errored/interrupted/shutdown/not_foundは成功扱いせず、currentimpl-review-loopの recovery / fail-closed rules に従ってください。agent discovery recovery で fresh runtime を使う場合も、現在の Claude-GPT runtime / adapter を継承し、ambient plainclaudeへ無断 fallback しないでください。production change は 実装: scope_rollup.run のGitHub認証carrierをchild ghへcommand-scopedに維持する #2611 の causal property に必要な最小差分にしてください。
scripts/agent-guards/run_scope_rollup_preflight.pyの GitHub-consuming exact childghboundary で、caller が選択済みのGH_CONFIG_DIRが存在するときだけその値をそのまま保持してください。値を推測・探索・生成しないでください。GH_HOST=github.compin、GH_REPO/ debug / pager scrub、GH_TOKEN/GITHUB_TOKENexplicit unset を維持し、non-GitHub child へ authentication carrier を伝播させないでください。generic env passthrough、新 credential broker、新 permission mechanism、新 ledger、新 schema、HOME/XDG shared portability 修正へ広げないでください。current main のskill_runtime_exec.pyにある finite command-scopedGH_CONFIG_DIRpreservation pattern は設計参考として再利用してください。ただし 実装:scope_rollup.runをskill_runtime_execのsiblingexactprofileへ統合する #1601 の ownership を実装し直してはいけません。deterministic regression は production
_run_gh()を本当に通る actual subprocess test にしてください。isolated HOME/XDG、GH_CONFIG_DIR-only、GH_TOKEN/GITHUB_TOKENunset の environment から fakeghsubprocess を起動し、gh issue viewpath とgh api graphqlpath の両方が carrier を受け取ることを確認してください。同じ fixture からGH_CONFIG_DIRを除去した negative control が fixture authentication failure になることも必須です。token env や ambient HOME credential による false PASS を許さないでください。GraphQL の authentication failure と partial error / resource error / pagination / inventory failure を混同しないでください。後者は distinct non-auth failure class として fail-closed に維持し、empty inventory、no-overlap、success へ変換しないでください。ただし 実装: scope_rollup.run の GraphQL inventory query を分割し partial-error 耐性を上げる #1659 が所有する query split / pagination redesign を 実装: scope_rollup.run のGitHub認証carrierをchild ghへcommand-scopedに維持する #2611 で実装しないでください。secret hygiene も Issue contract をそのまま守り、raw
GH_CONFIG_DIR、absolute config path、absolute HOME path、credential/token/config contents、raw stdout/stderr を artifact、Issue、PR、test diagnostic に転載しないでください。必要な証跡はcarrier_source: gh_config_dir、carrier_path_match: true|false、verdict、nonsecret failure class、exit status、repository/host 等に限定してください。baseline_vc_preflightは current policy 上 live canary の認識変更が本当に必要な場合だけ変更してください。その場合も Issue 実装: scope_rollup.run のGitHub認証carrierをchild ghへcommand-scopedに維持する #2611 に定義された exact finite argv 一形状だけを認識させ、unknown / duplicate / equals-form / extra argument / credential material を fail-closed deny のままにしてください。genericuv、generic Python、rawghallowance や新しい permission/harness frameworkを追加しないでください。現行 policy ですでに必要な command を扱えるなら baseline harness を変更しないでください。Issue 実装: scope_rollup.run のGitHub認証carrierをchild ghへcommand-scopedに維持する #2611 の Verification Commands を current body から fresh に取得し、contract に従って実行してください。
baseline-expect: failは implementation 前 baseline の期待値であり、実装後は該当する required regression が PASS しなければなりません。特に AC2 の hermetic actual-subprocess regression を implementation completion の authority としてください。live canary がUNAVAILABLE/SKIPでも、それだけでループを止めないでください。一方、parent GitHub capability が成功しているのに exact child だけ authentication failure になる場合は genuine auth regression として blocker にしてください。1 Issue = 1 PR を守ってください。既存の 実装: scope_rollup.run のGitHub認証carrierをchild ghへcommand-scopedに維持する #2611 用 PR が live search で存在すれば重複PRを作らず、その PR / branch を current state に基づいて再利用してください。存在しなければ canonical
implement-issue/open-prroute で PR を作成し、PR body にCloses #2611を含めてください。Allowed Paths 外の変更を混入させないでください。PR 作成後は current-head verification、required CI、pr-reviewerの independent review を実行してください。REQUEST_CHANGESなら blockers をfix_deltaとして worker に戻し、修正 → fresh verification → fresh current-head review を自動反復してください。BEHIND は canonicalupdate_branchroute で処理し、stale review は current head で再レビューしてください。各 iteration の間に人間の承認を求めないでください。終了目標は
.claude/skills/impl-review-loopの canonicalapprovedroute です。すなわち、current PR head に対する reviewer verdict がAPPROVE、blockers が空、live mergeability がCLEANまたはHAS_HOOKS、current-head verification / required CI が満たされている状態まで自律的に進めてください。そこへ到達したら実際のgh pr merge、auto-merge enable、その他 merge を成立させる操作は実行しないでください。人間が merge 判断を行える「マージ直前」の状態で停止してください。通常の warning、advisory artifact の欠落、live canary unavailable、recoverable CI failure、review REQUEST_CHANGES、stale head、BEHIND、recoverable SubAgent discovery failureについて人間を呼ばないでください。current skill が定義する自動 recovery と反復を使ってください。
一方、Issue #2611 / current impl-review-loop の genuine hard stop、たとえば Allowed Paths 外の変更が不可避、In Scope の固定契約変更が不可避、新規 Issue への scope split が不可避、別 ownership への波及が不可避、child からの nested SubAgent delegation が不可避、権限昇格や外部サービス追加が不可避、#1601/#1659 の fresh state change に伴う canonical boundary collision、AC2 hermetic regression を成立させられない、実 Git conflict、秘密情報を扱わなければ進めない、破壊的操作が必要、といった場合は bypass せず停止してください。
max_iterationsや skill 自身の normative human-escalation condition に到達した場合も、skill を改造・迂回して続行しないでください。ただし上限内の通常 iteration は全て自動継続してください。完了時は、Issue #2611、PR URL / PR number、current head SHA、変更概要、Allowed Paths compliance、AC1〜AC8 の達成状況、AC2 hermetic regression の結果、live canary の結果または
UNAVAILABLE/SKIP、required CI の状態、最終 reviewer verdict、live mergeability、#1601/#1659 の最終 fresh-readback、未解決 blocker の有無を簡潔に報告してください。成功時の最終状態は「実装・検証・レビュー完了、merge のみ未実行」でなければなりません。
この版は、承認不要を強く指定しつつ、
impl-review-loopの hard-stop semantics 自体は壊さない構成です。squne121 commentedon Sep 10, 2026
root-owned entry router audit
route: invoke_impl_review_loop
reason: fresh_review_go_live_equality
squne121 commentedon Sep 10, 2026
root-owned entry router audit
route: invoke_impl_review_loop
reason: fresh_review_go_live_equality
fix: classify scope-rollup canary unavailability (#2611)
squne121 commentedon Sep 10, 2026
root-owned entry router audit
route: invoke_impl_review_loop
reason: fresh_review_go_live_equality
fix: cover scope-rollup auth capability test (#2611)
fix: reuse runtime verification log for auth canary (#2611)
squne121 commentedon Sep 15, 2026
root-owned entry router audit
route: stop
reason: review_verdict_blocked
squne121 commentedon Sep 15, 2026
root-owned entry router audit
route: stop
reason: review_verdict_blocked
squne121 commentedon Sep 15, 2026
root-owned entry router audit
route: invoke_impl_review_loop
reason: fresh_review_go_live_equality
fix: preserve scope-rollup token carriers (#2611)
squne121 commentedon Sep 15, 2026
root-owned entry router audit
route: stop
reason: review_verdict_blocked
squne121 commentedon Sep 15, 2026
root-owned entry router audit
route: invoke_impl_review_loop
reason: fresh_review_go_live_equality
squne121 commentedon Sep 15, 2026
root-owned entry router audit
route: invoke_impl_review_loop
reason: fresh_review_go_live_equality
squne121 commentedon Sep 15, 2026
root-owned entry router audit
route: invoke_impl_review_loop
reason: fresh_review_go_live_equality
test: exercise canonical scope selection for AC4 (#2611)
squne121 commentedon Sep 15, 2026
root-owned entry router audit
route: invoke_impl_review_loop
reason: fresh_review_go_live_equality
fix: scope-rollup のgh config carrierを維持 (#2624)