Skip to content

実装: scope_rollup.run のGitHub認証carrierをchild ghへcommand-scopedに維持する #2611

Closed

Description

@squne121

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: code

Parent 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 child gh boundary に、caller-selected GH_CONFIG_DIR と既存 GH_TOKEN / GITHUB_TOKEN support を維持する最小 production contract。
  • production _run_gh() を通る hermetic fake-gh actual-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_TOKEN explicit 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

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 child gh boundary における、caller-selected GH_CONFIG_DIR と既存 GH_TOKEN / GITHUB_TOKEN support の command-scoped 維持。
  • GH_HOST=github.com pin、GH_REPO / debug / pager 等の ambient sanitation、non-GitHub child への非伝播を維持する最小 production contract。
  • isolated HOME / XDG、両 token explicit unset の config-only fixture/environment で、fake gh を production _run_gh() から起動し、issue-view、direct GraphQL、carrier-absence negative control を検証する hermetic actual-subprocess regression。
  • exact child environment での GH_TOKEN only および GITHUB_TOKEN fallback 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

Acceptance Criteria

  • AC1: _sanitized_gh_env() と production _run_gh() の exact GitHub-consuming child gh は caller-selected GH_CONFIG_DIR を値の推測・生成・探索なしに保持し、既存 GH_TOKEN / GITHUB_TOKEN support を保持する。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_TOKEN explicit unset で、production _run_gh() から fake gh actual subprocess を起動し、gh issue view と direct gh 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-protocol

Allowed 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 gh boundary を越える 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

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

Delivery Rule

Activity

  1. added
    phase/implementation
    agent/implementer
    enhancement
    on Sep 10, 2026
  2. squne121 commented on Sep 10, 2026

    @squne121
    OwnerAuthor

    総合判定

    CONTRACT_REQUEST_CHANGES を推奨します。

    #2611 の中核目的は妥当です。むしろ current main には明確な不整合があります。run_scope_rollup_preflight.py は GH_TOKEN / GITHUB_TOKEN を child gh に残す一方、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 の主張したい性質は、

    launcher が選んだ config-based GitHub auth が child gh でも失われない

    です。

    なら 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、非blocking

    • parent 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_exec sibling-profile integration は別 ownership のままでよく、しかも現在の Owner Decision は fresh re-review 前の実装を許可していません。#2611 がそこへ踏み込まない設計は正しいです。

    推奨する #2611 の縮小形

    私なら契約を次の4点に絞ります。

    1. Production: _sanitized_gh_env() で caller-provided GH_CONFIG_DIR をそのまま保持する。値がなければ推測・生成しない。GH_HOST=github.com pin、GH_REPO/debug/pager scrub は維持する。

    2. Deterministic regression: isolated HOME/XDG + GH_CONFIG_DIR-only + token unset の actual subprocess fixture で、production _run_gh() → fake gh を通して carrier preservation を証明する。negative caseでは GH_CONFIG_DIR を外すと fake provider が失敗するようにし、テスト自体が意味を持つことも証明する。

    3. 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 程度に限定する。

    4. Harness: baseline_vc_preflight.py の変更が現行 command policy 上必要なら、実装: scope_rollup.run のGitHub認証carrierをchild ghへcommand-scopedに維持する #2611 の exact argv 一形状を認識するだけに留める。generic Python/uv allowance、新 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 を child gh に残す一方、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]2)
    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 の主張したい性質は、

    launcher が選んだ config-based GitHub auth が child gh でも失われない

    です。

    なら 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 は、

    • parent GitHub read unavailable → UNAVAILABLE/SKIP、非blocking
    • parent 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]2)

    ただし、新しい GraphQL failure framework を #2611 で作る必要はありません。query 分割や pagination completeness は #1659 の ownership です。#2611 では「認証 env の変更後も既存 fail-closed semantics が壊れていない」という focused non-regression 一本程度で十分です。

    #1601 についても outer skill_runtime_exec sibling-profile integration は別 ownership のままでよく、しかも現在の Owner Decision は fresh re-review 前の実装を許可していません。#2611 がそこへ踏み込まない設計は正しいです。

    推奨する #2611 の縮小形

    私なら契約を次の4点に絞ります。

    1. Production: _sanitized_gh_env() で caller-provided GH_CONFIG_DIR をそのまま保持する。値がなければ推測・生成しない。GH_HOST=github.com pin、GH_REPO/debug/pager scrub は維持する。
    2. Deterministic regression: isolated HOME/XDG + GH_CONFIG_DIR-only + token unset の actual subprocess fixture で、production _run_gh() → fake gh を通して carrier preservation を証明する。negative caseでは GH_CONFIG_DIR を外すと fake provider が失敗するようにし、テスト自体が意味を持つことも証明する。
    3. 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 程度に限定する。
    4. Harness: baseline_vc_preflight.py の変更が現行 command policy 上必要なら、実装: scope_rollup.run のGitHub認証carrierをchild ghへcommand-scopedに維持する #2611 の exact argv 一形状を認識するだけに留める。generic Python/uv allowance、新 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 契約から修正できます。

  3. squne121 commented on Sep 10, 2026

    @squne121
    OwnerAuthor

    推奨アクションは #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_context lane を選ぶのが現行設計です。

    特に、現在の #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_context lane の 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 等を追加したりする意味ではありません。

    以下の手順で自律的に完走してください。

    1. 最初に 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 として流用しないでください。

    2. anchor comment は CONTRACT_REQUEST_CHANGES を要求する具体的な human review directive として扱ってください。bare preflight.run、with_agent_report、unlabeled with_anchor に落とさず、command registry が定義する canonical preflight.run.with_human_context profile を利用してください。argv を手書きで再発明せず registry / canonical executor を SoT としてください。

    3. 調査では必ず SubAgent を使用してください。少なくとも codebase-investigator と、外部仕様確認が必要なので web-researcher を適切に dispatch してください。独立して並列化可能な調査は並列化して構いません。

    重要: SubAgent を起動しただけで先へ進まないでください。すべての必須 SubAgent の completion を明示的に join / await し、結果を回収してから main orchestrator が判断してください。SubAgent に Issue mutation や最終 routing 判断を委譲しないでください。

    1. codebase-investigator には少なくとも current main の以下を fact-check させてください。

    関連 Issue / PR / comment / repository asset は current state を取得してください。特に #1601 と #1659 の state は fresh readback し、それらの ownership を #2611 に取り込まないでください。#2580 が現在 closed/completed であることも確認し、runtime canary を無関係な #2580 に固定する必要性を再評価してください。

    1. web-researcher には少なくとも authoritative primary source を使って次を確認させてください。
    • GitHub CLI の GH_TOKEN / GITHUB_TOKEN と stored credential / GH_CONFIG_DIR の precedence
    • GH_CONFIG_DIR 未指定時の XDG / AppData / HOME fallback
    • uv run --isolated が何を isolate し、OS process environment の token env scrub を保証するものではないこと
    • GitHub GraphQL が resource-limit 等で partial result + errors を返し得ること

    ブログや二次情報より GitHub CLI / GitHub Docs / Astral uv の公式ドキュメントを優先してください。

    1. anchor comment の P0/P1/P2 を current evidence に対して adversarial に検証してください。コメントを無条件コピーするのではなく、正しい指摘だけを contract update に反映してください。ただし、現在の evidence で反証できない operator directive を勝手に弱化しないでください。

    期待する refinement の中心は以下です。

    1. 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 してください。

    1. Issue 本文更新後は、古い preflight/review 結果を再利用せず fresh evidence で .claude/skills/issue-refinement-loop の残りを継続してください。review が needs-fix なら max_iterations の範囲内で自動 rewrite → fresh review を繰り返してください。

    iteration ごとに「続けてよいですか」と確認しないでください。

    1. human escalation の扱いを厳密にしてください。

    今回の anchor が freeform であること、以前の Issue 契約と scope が違うこと、live canary が unavailable であること、それ自体を理由に安易に human approval へ戻さないでください。今回の operator instruction と with_human_context lane で解決可能な 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 を追加しないでください。

    1. このタスクでは Issue refinement の完走が目的です。実装コード変更、実装 branch/PR の作成、impl-review-loop の開始までは進めないでください。

    終了条件は、fresh final review / contract-readiness が implementation handoff 可能な状態になり、#2611 本文が anchor comment の有効な指摘を反映し、関連 ownership と Verification/AC/Stop Conditions が相互矛盾していないことです。

    最後に以下を簡潔に報告してください。

    • final status / verdict / next action
    • 実行した SubAgent と、全 completion を join したこと
    • anchor comment の各主要指摘の disposition
    • Issue 本文へ行った主要変更
    • final Issue URL
    • final body SHA または利用可能な canonical integrity identifier
    • final review / readiness 結果
    • 未解決 blocker があれば reason code と evidence
    • implementation handoff が可能かどうか

    人間の中間承認は不要です。現在の repository-native control-plane、skill SSOT、current evidence を優先し、#2611 を implementation-ready な最小契約まで自律的に refinement してください。

    このプロンプトでは、「承認不要」≠ permission/guardrail の迂回 と分離しつつ、今回のコメントで既に解決可能な判断を再び human_judgment_required に落とさないようにしています。現時点では #2611 を参照する実装 PR も検索結果に出ていないため、先に contract を修正する運用で問題ありません。

  4. squne121 commented on Sep 10, 2026

    @squne121
    OwnerAuthor

    推奨アクション

    #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 child gh boundary にだけ適用するのが妥当です。 また #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 でも terminal completed を確認してから次へ進ませます。

    また「マージ直前」は現在の 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 を維持してください。

    1. 最初に 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 へ進んでください。

    2. 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_TOKEN unset の hermetic actual-subprocess regression です。live runtime canary は supplemental diagnostic であり、parent capability または network unavailable の UNAVAILABLE/SKIP を PASS とも implementation Stop Condition ともしないでください。

    3. 実装開始直前に 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 としてください。

    4. 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 の委譲を禁止するものとして解釈しないでください。

    5. すべての SubAgent dispatch について completion join を厳密に行ってください。spawn_agent 後は canonical task name を保持してください。wait_agent の timeout、steer、途中 mailbox update、部分的な返答を作業完了とみなしてはいけません。対象 SubAgent の final result を実際に取得・消費した後、list_agents で同じ canonical task name が terminal completed であることを確認してください。final result と terminal completed の両方が成立するまで次の Step や最終 routing に進まないでください。errored / interrupted / shutdown / not_found は成功扱いせず、current impl-review-loop の recovery / fail-closed rules に従ってください。agent discovery recovery で fresh runtime を使う場合も、現在の Claude-GPT runtime / adapter を継承し、ambient plain claude へ無断 fallback しないでください。

    6. 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 child gh boundary で、caller が選択済みの GH_CONFIG_DIR が存在するときだけその値をそのまま保持してください。値を推測・探索・生成しないでください。GH_HOST=github.com pin、GH_REPO / debug / pager scrub、GH_TOKEN / GITHUB_TOKEN explicit 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-scoped GH_CONFIG_DIR preservation pattern は設計参考として再利用してください。ただし 実装:scope_rollup.runをskill_runtime_execのsiblingexactprofileへ統合する #1601 の ownership を実装し直してはいけません。

    7. deterministic regression は production _run_gh() を本当に通る actual subprocess test にしてください。isolated HOME/XDG、GH_CONFIG_DIR-only、GH_TOKEN / GITHUB_TOKEN unset の environment から fake gh subprocess を起動し、gh issue view path と gh api graphql path の両方が carrier を受け取ることを確認してください。同じ fixture から GH_CONFIG_DIR を除去した negative control が fixture authentication failure になることも必須です。token env や ambient HOME credential による false PASS を許さないでください。

    8. 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 等に限定してください。

    9. 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 のままにしてください。generic uv、generic Python、raw gh allowance や新しい permission/harness frameworkを追加しないでください。現行 policy ですでに必要な command を扱えるなら baseline harness を変更しないでください。

    10. 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 にしてください。

    11. 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-pr route で 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 は canonical update_branch route で処理し、stale review は current head で再レビューしてください。各 iteration の間に人間の承認を求めないでください。

    12. 終了目標は .claude/skills/impl-review-loop の canonical approved route です。すなわち、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 自体は壊さない構成です。

  5. squne121 commented on Sep 10, 2026

    @squne121
    OwnerAuthor

    root-owned entry router audit

    route: invoke_impl_review_loop
    reason: fresh_review_go_live_equality

  6. squne121 commented on Sep 10, 2026

    @squne121
    OwnerAuthor

    root-owned entry router audit

    route: invoke_impl_review_loop
    reason: fresh_review_go_live_equality

  7. squne121 commented on Sep 10, 2026

    @squne121
    OwnerAuthor

    root-owned entry router audit

    route: invoke_impl_review_loop
    reason: fresh_review_go_live_equality

  8. self-assigned this
    on Sep 10, 2026
  9. squne121 commented on Sep 15, 2026

    @squne121
    OwnerAuthor

    root-owned entry router audit

    route: stop
    reason: review_verdict_blocked

  10. squne121 commented on Sep 15, 2026

    @squne121
    OwnerAuthor

    root-owned entry router audit

    route: stop
    reason: review_verdict_blocked

  11. squne121 commented on Sep 15, 2026

    @squne121
    OwnerAuthor

    root-owned entry router audit

    route: invoke_impl_review_loop
    reason: fresh_review_go_live_equality

  12. squne121 commented on Sep 15, 2026

    @squne121
    OwnerAuthor

    root-owned entry router audit

    route: stop
    reason: review_verdict_blocked

  13. squne121 commented on Sep 15, 2026

    @squne121
    OwnerAuthor

    root-owned entry router audit

    route: invoke_impl_review_loop
    reason: fresh_review_go_live_equality

  14. squne121 commented on Sep 15, 2026

    @squne121
    OwnerAuthor

    root-owned entry router audit

    route: invoke_impl_review_loop
    reason: fresh_review_go_live_equality

  15. squne121 commented on Sep 15, 2026

    @squne121
    OwnerAuthor

    root-owned entry router audit

    route: invoke_impl_review_loop
    reason: fresh_review_go_live_equality

  16. squne121 commented on Sep 15, 2026

    @squne121
    OwnerAuthor

    root-owned entry router audit

    route: invoke_impl_review_loop
    reason: fresh_review_go_live_equality

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

agent/implementerenhancementphase/implementation

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions