Repository navigation
実装: AGY PreToolUse hook eventsをdelegation_result/v1へ配線し、grounded_research不発を再調査する - #1756
Merged
Merged
Conversation
…space内grounded_research不発を再調査する _normalize_agy_result() の全3 return分岐に agy_provenance_hook_events / agy_provenance_hook_load_error を追加し、_run_agy() がisolated workspace 削除前にメモリ上へ読み込んだ hook events を delegation_result/v1 経由で 呼び出し元へ配線できるようにする。isolated workspace内でgrounded_research のtool呼び出しが発生しない原因を静的解析で再調査し、有力候補(isolated workspaceが実際のAGY設定ファイルパスを露出していない)を references/grounded-research-isolated-workspace-investigation.md へ記録した。 Closes #1752 Co-Authored-By: Claude Sonnet 5 <[email protected]>
CI の PR Body Japanese Check がファイル全体の各 prose block を検査するため、 英語のみの見出し `## Findings` / `## Next Action` が不合格になっていた。 見出しに日本語を併記して解消する。 Co-Authored-By: Claude Sonnet 5 <[email protected]>
Contributor
Preview URLPreview removed (PR #1756 closed). |
squne121
marked this pull request as ready for review
July 25, 2026 14:14
squne121
commented
Jul 25, 2026
squne121
left a comment
Owner
Author
There was a problem hiding this comment.
PR Review(自己評価。impl-review-loop control-plane が pr-reviewer 役割を兼務して実施)
Linked Issue #1752 の contract(Outcome / Acceptance Criteria / Allowed Paths / Verification Commands)と本 PR diff を照合した。
- Closes #1752 が PR 本文に含まれる。Issue #1752 は OPEN。
- Allowed Paths 遵守: 変更 4 ファイルはすべて Issue #1752 の Allowed Paths と完全一致(
git diff --name-only origin/main...HEADで確認)。 - AC1-AC6: すべて PR 本文の VC どおり実行し PASS を独立確認済み(
uv run --locked pytest .claude/skills/gemini-cli-headless-delegation/tests/test_agy_hook_events_propagation.py6 件 PASS、test -f references/grounded-research-isolated-workspace-investigation.mdexit 0)。 - 既存回帰:
.claude/skills/gemini-cli-headless-delegation/tests/全体 963 passed、pnpm typecheck/pnpm lint/pnpm test(1801 passed)/pnpm buildすべて pass。 - Safety Claim Matrix / Schema Consumer Inventory / Schema Change Applicability: PR 本文に記載済み、
additive_field/backward_compatibleで妥当。 - Overlap Preflight:
check_implementation_overlap.pyはroute: human_review_required(C3, parent_child_collision, 候補 #1692)を返したが、PR 本文の該当セクションで独立検証済みの非衝突理由を記載(Issue #1752 本文の Scope Collision Preflight と同一の判断根拠、#1692 は別関数build_request.pyを対象とし triage-required で未着手)。
LOOP_VERDICT_V2:
verdict: APPROVE
reviewed_head_sha: "ea7bd40b3b617f0906c0f7c457418ebfdc96975e"
merge_ready: true
mergeability:
mergeable: "MERGEABLE"
merge_state_status: "CLEAN"
blockers: []
required_auto_actions: []
auto_fix_applied: []
follow_up_issue_requests: []
This was referenced Jul 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
_normalize_agy_result()(run_gemini_headless.py)の 3 つの return 分岐(exit_code != 0 / stdout 空 / 成功)すべてにagy_provenance_hook_events/agy_provenance_hook_load_errorを追加し、_run_agy()が isolated workspace 削除前にメモリへ読み込んだ PreToolUse hook events をdelegation_result/v1経由で呼び出し元へ配線できるようにした。search_web/read_url_contenttool 呼び出しが発生しない原因を静的解析で再調査した。有力候補として、agy_permission_policy.materialize_isolated_agy_workspace()が isolatedHOME配下に実際の AGY 設定ファイル(~/.gemini/antigravity-cli/settings.json)を一切露出していないこと(.antigravity/settings.jsonという自作スキーマのみを書き込んでいる)を特定した。この修正はagy_permission_policy.pyへの変更を要するため本 Issue の Allowed Paths 外であり、references/grounded-research-isolated-workspace-investigation.mdに Findings / Next Action として記録した。.claude/skills/gemini-cli-headless-delegation/tests/全体(963 passed)で既存テストの回帰がないことを確認した。Checks
すべての必須検証コマンドを実行し、全て成功したことを確認した。
pnpm typecheck(型検査) (tsc --noEmit) → passpnpm lint(静的解析) (eslint .) → passpnpm test(フロントエンドテスト) (vitest run) → 100 files / 1801 tests passedpnpm build(ビルド確認) (tsc && vite build) → passuv run --locked pytest .claude/skills/gemini-cli-headless-delegation/tests/ -q(Python テスト) → 963 passeduv run ruff check(Python 静的解析、変更ファイル) → All checks passed受け入れ条件の達成状況
_normalize_agy_result()の成功分岐(exit_code=0, stdout 非空)がagy_provenance_hook_eventsを含む。test_normalize_agy_result_success_propagates_hook_eventsPASS。)agy_provenance_hook_events/agy_provenance_hook_load_errorを追加。test_normalize_agy_result_nonzero_exit_propagates_hook_events/test_normalize_agy_result_nonzero_exit_propagates_hook_load_errorPASS。)test_normalize_agy_result_empty_stdout_propagates_hook_eventsPASS。)getattr(completed, "agy_provenance_hook_events", [])で安全にアクセスし、属性欠落時も例外を送出せず[]/Noneを返す。test_normalize_agy_result_missing_attribute_defaults_to_empty_listPASS(3 分岐すべてで検証)。)references/grounded-research-isolated-workspace-investigation.md(新規)に## Findings(4件)と## Next Action(4項目)を含めて記録。静的解析で有力候補(AGY 実設定ファイルパス未露出)を特定したが、修正は本 Issue の Allowed Paths 外(agy_permission_policy.py)のため follow-up Issue 化を推奨する形で記録。)toolCall.argsに相当する情報がハッシュのみで保存される既存スキーマを維持したまま_normalize_agy_result()を通しても credential-like な生値が漏出しないことを検証。test_hook_events_redaction_no_credential_leakPASS。)検証コマンド結果
Allowed Paths 遵守
変更ファイルは Issue #1752 の Allowed Paths 4 件のみで、逸脱なし。
.claude/skills/gemini-cli-headless-delegation/scripts/run_gemini_headless.py(+21 行、_normalize_agy_result()の 3 分岐へのキー追加のみ).claude/skills/gemini-cli-headless-delegation/tests/test_agy_hook_events_propagation.py(新規、+250 行程度、hermetic テスト 6 件).claude/skills/gemini-cli-headless-delegation/references/grounded-research-isolated-workspace-investigation.md(新規、静的再調査結果).claude/skills/gemini-cli-headless-delegation/references/usage-contract.md(Result Contract セクションへprovider=agy関連フィールドの追記のみ)Overlap Preflight 自動判定結果の補足説明(
check_implementation_overlap.pyの route が human_review_required だった件について)自動 overlap preflight(
check_implementation_overlap.py)はroute: human_review_required/policy_class: C3/reason_code: parent_child_collisionを返した。原因は候補 Issue #1692(OPEN,build_request.pyを provider-aware にする実装、同じ親 Issue #1265 を共有しrun_gemini_headless.py/usage-contract.mdを Allowed Paths に含む)との parent/child 関係による自動検出であり、これは Issue #1752 本文の## Scope Collision (C1) Preflightセクションで既に明示的に非衝突と判定済みの関係と同一である(「#1692(provider-aware build_request #1692)...関心事...run_gemini_headless.py 内の異なる関数・異なる関心事...を扱っており、本 Issue が対象とする_run_agy()/_normalize_agy_result()の hook events 伝播とは非衝突」)。本 PR の変更は
_normalize_agy_result()の 3 return 分岐へのキー追加のみで、build_request.pyおよび_normalize_agy_result()以外の関数には一切触れていない。#1692 はtriage-requiredラベル付きで未着手(PR 未起票)のため、実際のコード衝突は発生していない。上記の理由により、この overlap preflight 結果は Issue 本文の既存分析と整合する false-positive-adjacent な human review 要求と判断し、control-plane(本 PR 起票主体)が独立して非衝突を確認した上で PR を起票した。Schema Change Applicability
not_schema_changedelegation_result/v1は既存の additive フィールド(agy_provenance_hook_events/agy_provenance_hook_load_error)を追加するのみであり、既存フィールドの型・意味論・キー名は変更していない。producer(_normalize_agy_result())は追加フィールドのみを積み増し、既存 consumer(test_agy_provider.py等の直接/モック呼び出しを含む)は新フィールドを無視でき、後方互換である。Schema Consumer Inventory
.claude/skills/gemini-cli-headless-delegation/scripts/run_gemini_headless.py(_normalize_agy_result()呼び出し元_run_delegation_core())delegation_result/v1dict をそのまま返すのみ).claude/skills/gemini-cli-headless-delegation/tests/test_agy_provider.py(既存_normalize_agy_result()呼び出しテスト)agy_provenance_hook_events/agy_provenance_hook_load_error属性欠落時も[]/Noneを返す後方互換設計(AC4)のため影響なし。963 passed で回帰確認済み.claude/skills/gemini-cli-headless-delegation/scripts/build_fanout_evidence_bundle.py(--hook-events-file消費者、将来の potential consumer)delegation_result/v1へフィールドを追加するのみで、build_fanout_evidence_bundle.py側の新フィールド消費ロジック追加は Out of Scope(Issue #1752 本文)Compatibility Decision(互換性判定)
互換性判定の詳細は以下の通り。すべて後方互換な追加的変更である。
additive_fieldbackward_compatiblenoN/ASafety Claim Matrix
_normalize_agy_result()の 3 return 分岐すべてでagy_provenance_hook_events/agy_provenance_hook_load_errorが正しく伝播し、属性欠落時も例外を送出しないtest_normalize_agy_result_success_propagates_hook_events/test_normalize_agy_result_nonzero_exit_propagates_hook_events/test_normalize_agy_result_nonzero_exit_propagates_hook_load_error/test_normalize_agy_result_empty_stdout_propagates_hook_events/test_normalize_agy_result_missing_attribute_defaults_to_empty_list(5 件とも PASS)sk-/ya29.パターン)がdelegation_result/v1へ漏出しないtest_hook_events_redaction_no_credential_leakPASS(既存の args_sha256-only スキーマを維持したまま検証).claude/skills/gemini-cli-headless-delegation/tests/全体の既存テストが回帰していないuv run --locked pytest .claude/skills/gemini-cli-headless-delegation/tests/ -q→ 963 passedagy_permission_policy.pyへの変更を要し本 Issue の Allowed Paths 外references/grounded-research-isolated-workspace-investigation.mdの Findings 1-4 / Next Action 1-4agy_permission_policy.pyへの実設定ファイル read-only 露出 follow-up Issue 起票、および isolated workspace 内 live 再現検証は #1494 側で扱う)記載ルール遵守:
Not controlledが非空(1 件)のため、Follow-up に具体的な follow-up 方針を記載済み。PR title / summary で無限定のsafe/completeは使用していない。Notes
gemini-cli-headless-delegationskill のprovider=agy経路のdelegation_result/v1フィールド拡張のみに影響し、既存の他 provider・他 tool_profile の挙動は変更していない。agyCLI の実行・追加課金は発生していない(Issue 実装: AGY PreToolUse hook eventsをisolated workspace削除前にdelegation_result/v1へ配線し、grounded_researchのtool呼び出し不発を再調査する #1752 の Stop Conditions「isolated workspace 内 tool 呼び出し不発の原因調査に実 agy CLI の live 実行が必須と判明した場合」に該当しないため、静的解析の範囲で完結させた)。docs/dev/current-focus.md/docs/product/requirements.mdの恒久仕様への影響なし(hermetic bugfix + 調査文書のみ)。本 PR のマージにより Issue #1752 を解決する(Closes #1752)。