Repository navigation
Closed
Labels
agent/implementerAI implementer agentenhancementNew feature or requestphase/implementationImplementation phasetriage-requiredNeeds owner triage for priority decision
Description
Machine-Readable Contract
contract_schema_version: v1
issue_kind: implementation
parent_issue: "#1265"
goal_ref: "GeminiCLI 委譲版 delegation platform を AntigravityCLI (agy) provider へ段階移行し、機能同等性を達成する"
change_kind: docsParent Issue
Parent: #1265
Parent Goal Ref
- Goal: GeminiCLI 依存を段階的に縮小しつつ、AGY provider が Gemini 版と同等の delegation platform として機能し、可観測性・テスト密度・認証堅牢性・クォータ制御を備えた状態にする。
- Desired Destination: 9 件の child issue が起票され close されることで、GeminiCLI 依存縮小と AGY provider 機能同等性拡張が段階的に達成される。
Current Validated Scope
.claude/skills/gemini-cli-headless-delegation/references/provider-mapping.md.claude/skills/gemini-cli-headless-delegation/references/runtime-portability.md.claude/skills/gemini-cli-headless-delegation/references/usage-contract.md.claude/skills/gemini-cli-headless-delegation/tests/test_agent_contracts.py
Remaining Parent Gaps
- 本 Issue は他の child issue(SerenaMCP 再導入・WEBGrounding 統合・クォータ管理・認証堅牢化・テスト密度引き上げ等)の実装完了後に内容を反映する follow-up 的性質を持つため、本 Issue 完了後も他 child の進捗に応じて docs が再度差分を持つ可能性がある。その場合は追加の follow-up issue で扱う。
Outcome
.claude/skills/gemini-cli-headless-delegation/references/provider-mapping.md, runtime-portability.md, usage-contract.md が AGY provider の current limitations(対応 profile、Serena/WEBGrounding 非対応、quota-aware retry 欠如等)・fallback policy・provider 差分・認証前提・cwd/env 制約・result normalization を一貫して説明する状態に更新され、tests/test_agent_contracts.py 等の静的契約検証が更新後の docs と整合していることが確認・拡張されている。
In Scope
provider-mapping.mdの AGY provider 対応表を現状(no_tools/proposal_only/grounded_research/local_asset_researchの4プロファイル対応、github_researchは未対応)に合わせて更新する。runtime-portability.mdの provider 別 cwd/env/isolated temp cwd 制約の記述を現状実装に合わせて更新する。usage-contract.mdの provider 差分・認証前提(OAuth vs 他方式)・result normalization(delegation_result/v1、アンダースコア表記delegation_result_v1の除去)・post_to_issue_url/gh_commands対応 profile の記述を現状に合わせて更新する。tests/test_agent_contracts.pyを確認し、更新後の docs 記述と静的契約検証の整合を確認する。齟齬があれば contract 側テストを拡張する。
Out of Scope
.claude/skills/gemini-cli-headless-delegation/のスキル本体(agents/,config/,scripts/)のコード実装変更。- SerenaMCP / WEBGrounding / クォータ管理 / 認証堅牢化などの機能実装そのもの(各々別 child issue の範囲)。
Acceptance Criteria
- AC1:
provider-mapping.mdに AGY provider がno_tools/proposal_only/grounded_research/local_asset_researchの4プロファイルに対応し、github_researchのみunsupported_provider_profileとして扱われる旨が明記されている。またgrounded_researchは AGY native WebSearch/WebGrounding(Gemini API のgoogle_searchではない)の evidence contract として、local_asset_researchは wrapper-side の Serena read-only evidence envelope のみ(AGY に repo root/MCP config/direct tool access を渡さない)として記述されていることを含む。 - AC2:
runtime-portability.mdに AGY provider の isolated temp cwd / minimal env /shell=Falseの制約が明記されている。また恒久対応の参照先が parent Issue GeminiCLI移譲スキルからAntigravity CLIへの段階的移行 #104 ではなく#1265/ current references である旨に更新されている(#104を恒久正本とする記述を残さない)。 - AC3:
usage-contract.mdに AGY provider の認証前提(OAuth 系)と、delegation_result/v1(アンダースコア表記のdelegation_result_v1を残さず統一)への正規化ルールが明記されている。またpost_to_issue_urlは GitHub Issue URL only(Issue/PR URL ではない)である旨、gh_commandsの AGY provider 対応がgithub_researchのみである旨が、他 profile の実装状況の記述と矛盾なく明記されている。 - AC4:
tests/test_agent_contracts.pyが更新後の docs 記述内容と矛盾しないことが確認され、必要な場合は同ファイルにテストが追加されている。
Verification Commands
# AC1
# baseline-expect: pass
$ rg -n "unsupported_provider_profile" .claude/skills/gemini-cli-headless-delegation/references/provider-mapping.md
# AC2
$ rg -n "shell=False" .claude/skills/gemini-cli-headless-delegation/references/runtime-portability.md
# AC3
# baseline-expect: pass
$ rg -n "delegation_result/v1" .claude/skills/gemini-cli-headless-delegation/references/usage-contract.md
$ ! rg -q "delegation_result_v1" .claude/skills/gemini-cli-headless-delegation/references/usage-contract.md
# AC4
$ uv run pytest .claude/skills/gemini-cli-headless-delegation/tests/test_agent_contracts.pyAllowed Paths
- .claude/skills/gemini-cli-headless-delegation/references/provider-mapping.md
- .claude/skills/gemini-cli-headless-delegation/references/runtime-portability.md
- .claude/skills/gemini-cli-headless-delegation/references/usage-contract.md
- .claude/skills/gemini-cli-headless-delegation/tests/test_agent_contracts.py
Runtime Verification Applicability
- decision: not_applicable
- reason: 本 Issue の AC はすべて
rgによるテキストファイル(docs)静的照合とuv run pytestによる静的契約テストで完結し、プロセス起動・外部通信・実行環境依存の I/O を要する動作検証 AC を含まないため。
Stop Conditions
- Allowed Paths 外の変更が必要と判明した場合
- In Scope の固定契約(キー集合・スキーマ・型定義)の変更が必要になった場合
- 新規 Issue の起票が必要と判断した場合(スコープ分割が発生する場合)
- 後続 Phase / 別スコープへの波及が判明した場合
- nested SubAgent delegation が必要になった場合
- 外部サービス利用・権限昇格・既存テスト大規模改変が必要になった場合
- 他の child issue(SerenaMCP 再導入・WEBGrounding 統合等)の実装が未完了で、docs 更新が推測ベースになる場合は、確認できた範囲のみ更新し推測箇所を明記する
Required Skills
なし
Scope Delta(任意)
N/A
Delivery Rule
1 Issue = 1 PRを原則とする。- worktree を切って作業し、Draft PR をデフォルトとする。
Notes for Reviewer
- 本 Issue は parent 導入: Gemini CLI → Antigravity CLI (agy) provider migration: 機能同等性評価と改善計画 #1265 の 9 child のうち「provider-mapping / runtime-portability / usage-contract を最新化する(P0/S)」に対応する。
- follow-up 的性質を持つため、他 child issue の実装完了状況に応じて段階的な追加更新が必要になる可能性がある。その場合は本 Issue のクローズ後に新規 follow-up issue を起票する。
- AC1/AC3 の一部 VC は baseline で既に pass する(
# baseline-expect: passを付与済み)。これは provider-mapping.md / usage-contract.md の該当箇所が既に正しく記述されていることを意味し、AC はその記述をさらに矛盾なく精緻化・拡張する性質を持つ。 - AC3 の
! rg -q "delegation_result_v1" ...VC は baseline ではdelegation_result_v1(アンダースコア表記)が複数箇所(L190, L206, L308, L1019 付近)に残存しているため baseline fail が期待される(delegation_result/v1への統一完了後に go となる)。 - AC2 の
#104→#1265/ current references への参照更新は OWNER anchor comment(2026-07-06T12:13:50Z, https://github.com/squne121/loop-protocol/issues/1268#issuecomment-4892642608)の指示に基づく。
Metadata
Metadata
Assignees
Labels
agent/implementerAI implementer agentenhancementNew feature or requestphase/implementationImplementation phasetriage-requiredNeeds owner triage for priority decision
Activity
squne121 commentedon Jul 6, 2026
判定: REQUEST_CHANGES
#1268 は「docs sync」として必要ですが、現時点の本文・ACが古く、今の実装・関連PRの状態と矛盾しています。特に致命的なのは、#1268 が AGY は
no_tools/proposal_onlyのみ対応、grounded_research/local_asset_researchは未対応 と書いている一方で、現行provider-mapping.md・usage-contract.md・runtime・tests はすでにgrounded_researchとlocal_asset_researchを AGY supported として扱っている 点です。#1268 本体は open / comments 0 で、本文の AC1 もこの古い前提に固定されています。最重要ブロッカー
1. #1268 の AC1 は現行実装を逆方向に壊す
#1268 は「AGY provider は
no_tools/proposal_onlyのみ対応、grounded_research/local_asset_research/github_researchはunsupported_provider_profile」を AC1 にしています。しかし現行 runtime の
AGY_SUPPORTED_PROFILESはno_tools,proposal_only,local_asset_research,grounded_researchの4つを含み、github_researchだけが外れています。provider-mapping.md側も AGY matrix でgrounded_researchを supported、local_asset_researchを supported、github_researchを unsupported_provider_profile と書いています。test_agy_provider.pyもgrounded_researchの成功・fail-closed 条件と、local_asset_researchの wrapper-side validation 成功をテストしています。このまま #1268 を実装させると、実装済みの #1266 / #1271 相当を docs から消す方向に動く危険があります。
2. 関連PRの実装後状態を #1268 が反映していない
関連PRを見る限り、#1268 は「古い parent snapshot を最後に反映するIssue」ではなく、「各 child PR 後の docs/code drift を吸収する gate」に変えるべきです。
関連PRとして、#1266 には PR #1306 があり、AGY grounded research で
delegation_result/v1に grounding evidence を含め、Gemini APIgoogle_searchを呼ばないこと、citation/tool-call なしを fail-closed にすることを掲げています。#1271 には PR #1290 があり、AGY に repo root / direct MCP / direct tool access を渡さず、wrapper 側で pinned SerenaMCP read-only retrieval を行い、JSON evidence envelope だけを AGY prompt に注入する方針です。
#1270 には PR #1331 があり、
provider_auto_policy_v1、provider_auto_dispatch()、selected_provider/provider_attempts[]/fallback_reason/fallback_policy_version/attempts_by_modelの result fields を追加する内容です。#1267 には PR #1316 があり、AGY auth diagnostics、keyring / TTY / WSL2 non-TTY silent stdout drop を machine-readable に扱う方向です。
#1274 には merged PR #1345 があり、AGY fixture schema、empty-stdout warning 回帰、AGY provider 固有分岐テスト密度を増やしています。
したがって #1268 は「初期AGY limitationsを書く」Issueではなく、「post-#1266/#1267/#1270/#1271/#1274 の実装済み事実に docs を合わせる」Issueへ更新すべきです。
3.
usage-contract.mdにまだ runtime と矛盾する記述が残るusage-contract.mdはprovider=agyvariant でgrounded_research/local_asset_researchを含む現行契約を書いており、この点は #1268 AC1 より新しい状態です。一方で、
gh_commandsはgithub_research・local_asset_research・proposal_onlyで完全実装済みと書いています。runtime は
gh_commandsをtool_profile == "github_research"以外で fail-close します。ここは #1265 の過去レビューでも docs/code 矛盾として指摘されており、まだ未解消です。
さらに
post_to_issue_urlは docs で「GitHub Issue/PR の URL」と書かれていますが、runtime regex は/issues/<number>のみ許可し、/pulls/<number>と非GitHub host を拒否します。加えて Result Contract は
delegation_result_v1固定と書いていますが、runtime の AGY result は"delegation_result/v1"を返します。これは schema 名の文字列差分なので、consumer が壊れるタイプの不整合です。
4.
provider-mapping.mdは同一文書内で古い記述と新しい記述が混在している上部では
modelは request で明示可能、既定はgemini-3-flash-preview、別 model への自動 fallback はしないと書いています。しかし runtime は
provider=autoをサポートし、runtime order は("gemini", "agy")、eligible profile はno_tools/proposal_only、retryable failure class を持っています。さらに
provider-mapping.mdの tool profile table はgithub_researchを欠いています。一方で runtime の
ALLOWED_TOOL_PROFILESにはgithub_researchが含まれます。この文書は「AGY matrixだけ更新済み、共通セクションがGemini-eraのまま」という状態です。
5.
runtime-portability.mdは特に古いruntime-portability.mdはprovider=agyprerequisites では Node/gemini/uvx/Serena/Gemini OAuth 不要と書いています。しかし同じ文書の Serena MCP setup では
uvx --from git+https://github.com/oraios/serena serena-mcp-server --help、.gemini/settings.jsonの unpinned Serena 設定、setup_check.pyによる自動生成を説明しています。現行 runtime は
.agents/mcp_config.jsonと.gemini/settings.jsonを checked-in manifest の pinned ref と照合し、includeTools/excludeToolsを検証します。runtime-portability.mdのテンプレはexcludeToolsを持たず、危険tool denylist の現在契約に足りません。また「恒久対応は parent Issue #104」と書いていますが、現行 tracking parent は #1265 です。
6.
test_agent_contracts.pyは #1268 の対象docsを検査していない#1268 の AC4 は
tests/test_agent_contracts.pyが docs 記述と矛盾しないことを確認・必要なら拡張、としています。しかし現行
test_agent_contracts.pyは agent/skill markdown の CLI flags、frontmatter、強すぎるAPI key表現などを検査する静的テストで、provider-mapping.md/runtime-portability.md/usage-contract.mdの整合性を直接見ていません。#1268 では最低限、以下のような static drift test を追加すべきです。
rg -n "delegation_result_v1|GitHub Issue/PR|#104|gh_commands.*local_asset_research.*proposal_only" \ .claude/skills/gemini-cli-headless-delegation/references加えて Python テストで
run_gemini_headless.AGY_SUPPORTED_PROFILES、PROVIDER_AUTO_ELIGIBLE_PROFILES、GITHUB_RESEARCH_PROFILEと docs matrix の文字列を突き合わせるべきです。外部実装調査からの品質要求
Google は 2026-05-19 の公式ブログで、Gemini CLI から Antigravity CLI への移行を案内しつつ、Antigravity CLI は初期状態で 1:1 feature parity ではないと明記しています。([Google Developers Blog][1])
そのため #1268 は「同等」と書くのではなく、profileごとに
implemented | unsupported_by_design | deferred | unsafeを機械可読に固定する必要があります。Google Search grounding は、
google_searchtool により検索 query 実行、検索結果処理、inlineurl_citationannotations、google_search_call/google_search_resultsteps を返す明確なAPI contractです。([Google AI for Developers]2)また Gemini 3 では検索query単位で課金されるため、grounded profile の docs は「URL文字列がある」ではなく、tool-call evidence・citation・billing/quota dimension まで区別すべきです。([Google AI for Developers]2)
Antigravity CLI のREADMEは、CLIが codebase理解、編集、コマンド実行を行えると説明し、AI coding agents のリスクとして autonomous code execution、data exfiltration、prompt injection、supply chain risks を警告しています。([GitHub]3)
Serena も semantic retrieval だけでなく editing/refactoring、
execute_shell_commandなどの能力を持つため、AGY に直接 repo root / MCP config / direct tool access を渡さず、wrapper-side read-only evidence envelope に閉じ込める現在方針は妥当です。([GitHub]4) ([GitHub]4)#1268 の修正方針
#1268 は本文を次の方向に差し替えるべきです。
AIエージェント投入用プロンプト
結論として、#1268 は「実装してよいが、本文更新が先」です。現状のままAI実装に流すと、古いACに引っ張られて docs を退行させるリスクが高いです。
[1]: https://developers.googleblog.com/en/an-important-update-transitioning-gemini-cli-to-antigravity-cli/ "
squne121 commentedon Jul 6, 2026
Refinement Loop: Approved
The issue has been approved and is ready for implementation.
approvedsqune121 commentedon Jul 6, 2026
Contract Review Result
squne121 commentedon Jul 6, 2026
実装完了報告
PR: #1362 (Draft, MERGEABLE, base
main, Closes #1268)変更内容
provider-mapping.md: agy 実行境界(AC2 節)にshell=False/_minimal_agy_env()allowlist の詳細を追記。runtime-portability.md: 恒久対応の参照先を#104から#1265/ current references へ更新し、shell=False(isolated temp cwd +subprocess.run(..., shell=False))の制約を明記。usage-contract.md:delegation_result_v1(アンダースコア表記)をdelegation_result/v1に統一、post_to_issue_urlを GitHub Issue URL only(/pulls/<number>不可)と明記、gh_commandsが runtime のtool_profile='github_research'のみ許可 fail-closed 挙動と一致するよう記述を修正(local_asset_research/proposal_onlyの「完全実装済み」という誤った記述・存在しない PR/Issue 番号の参照を削除)、provider=agyの OAuth 系(Google Sign-In)認証前提を追記。tests/test_agent_contracts.py:TestReferencesDocsRuntimeDriftを追加し、上記 3 ドキュメントとrun_gemini_headless.py(AGY_SUPPORTED_PROFILES等)の drift を静的に検出するテストを実装。VC 実行結果
rg -n "unsupported_provider_profile" provider-mapping.md→ passrg -n "shell=False" runtime-portability.md→ pass(baseline fail → go)rg -n "delegation_result/v1" usage-contract.md→ pass、! rg -q "delegation_result_v1" usage-contract.md→ pass(baseline fail → go)uv run pytest .claude/skills/gemini-cli-headless-delegation/tests/test_agent_contracts.py→ 147 passeduv run pytest .claude/skills/gemini-cli-headless-delegation/tests/→ 669 passed(既存 test_agy_provider.py 等含め回帰なし)pnpm typecheck/pnpm lint/pnpm test(1427 passed)/pnpm build→ すべて passAllowed Paths 外の変更なし(4 ファイルのみ:
references/provider-mapping.md,references/runtime-portability.md,references/usage-contract.md,tests/test_agent_contracts.py)。squne121 commentedon Jul 6, 2026
PR #1362 の CI
PR Body Japanese Checkfailure を修正しました。問題
.claude/skills/gemini-cli-headless-delegation/references/runtime-portability.md内、1 prose block(見出し## isolated temp cwd / minimal env / shell=False の制約およびその直後の段落)が日本語比率不足(jp=3, total=43, ratio=0.070 < threshold 0.1)でvalidate_japanese_content.pyの per-block チェックに fail していました。修正内容
該当見出しと段落の意味を変えずに日本語表現を厚くしました。
## isolated temp cwd / minimal env / shell=False の制約→## 隔離済み一時作業ディレクトリ・最小環境変数・shell=False の制約isolated temp cwd/shell injection/repo root等の英語表現に対応する日本語(隔離された一時作業ディレクトリ・コマンド注入・リポジトリのルートディレクトリ等)を併記し、意味は変更していません。commit:
48ba4b208943fe03764442001c901f6f819f1818(既存 PR #1362 ブランチworktree-agent-a38a02b130b3fe1ffへ追加 push、force-push なし)VC 再実行結果
uv run python3 .claude/skills/create-issue/scripts/validate_japanese_content.py --file .claude/skills/gemini-cli-headless-delegation/references/runtime-portability.md --verbose→failed_blocks: 0/PASS(aggregate_ratio: 0.538)pnpm typecheck→ passpnpm lint→ pass(ESLint: No issues found)pnpm test→ pass(92 test files / 1427 tests passed)pnpm build→ passuv run pytest .claude/skills/gemini-cli-headless-delegation/tests/test_model_routing.py .claude/skills/gemini-cli-headless-delegation/tests/test_agent_contracts.py→ pass(168 passed)CI(GitHub Actions)は新しい head(
48ba4b20)に対して再実行中です。fix: OWNER REQUEST_CHANGES対応 - Serena MCP/provider-auto docsをruntime実…
実装: provider-mapping / runtime-portability / usage-contract docs を AG…