Repository navigation
実装: fan-out E2E validatorのschema定数不一致とbundle構築scriptの欠落を解消する - #1750
Merged
squne121 merged 4 commits intoJul 25, 2026
Merged
Conversation
validate_agy_fanout_e2e_evidence.py の _KNOWN_SCHEMA_VALUES がアンダースコア版 "delegation_result_v1" を保持していたが、run_gemini_headless.py は一貫して スラッシュ版 "delegation_result/v1" を出力する。predicate 14 はトップレベル "actor" キーを読んでいたが実データは local_asset_retrieval_metadata.analysis_actor にネストされ、predicate 23 は "status" キーを読んでいたが実データはトップレベル boolean "ok" キーのみを持つ。いずれも実装前に run_gemini_headless.py の実出力を rg で確認した上で修正した。 あわせて fan_out_orchestrator.run_fanout() の生出力(manifest.json / events.ndjson / <artifact_stem>.request.json)から validator の bundle-dir レイアウト(REQUIRED_ARTIFACT_PATHS + artifact_manifest.json)へ決定論的に 変換する build_fanout_evidence_bundle.py を新規追加した。任意の per-child local instrumentation evidence(hook_events / permission_events / serena_evidence)が未提供の場合は空だが schema-valid な artifact を materialize し、fail-close は bundler ではなく predicate 側の責務とした。 既存 positive fixture(tests/fixtures/agy_fanout_e2e/build_bundle.py)は旧 schema/フィールド形状を模していたため、修正後の実データ形状に合わせて更新した。 Co-Authored-By: Claude Sonnet 5 <[email protected]>
…an-out-e2e-validator-schema-bundle-scri
Contributor
Preview URLPreview removed (PR #1750 closed). |
…py (#1748) CI ruff check --select E,F --ignore E402 uses default line-length 120; wrap the local_asset_research permission_events tuple entry onto multiple lines to stay under the limit. Co-Authored-By: Claude Sonnet 5 <[email protected]>
squne121
commented
Jul 25, 2026
squne121
left a comment
Owner
Author
There was a problem hiding this comment.
Review Summary(レビュー要約)
- Linked Issue: #1748(Closes、OPEN state 確認済み)
- Mergeability:
mergeable: MERGEABLE/mergeStateStatus: CLEAN(head0d8bbe065d462f948979bd971b80fdbb0bd59509) - Required CI checks(
typecheck/lint/test/build/python-test/validate-generated-artifact): 全てsuccess(GitHub Actions 側の一時的な platform incident(Major Outage→Partial System Outage、12:31 UTC 開始)が解消した後、E501 line-length(新規テストファイル 1 箇所)を修正したコミットで全 green を確認) - AC1-AC9: Issue #1748 本文の Acceptance Criteria 全件に対応する pytest /
rg証跡を PR 本文の AC mapping 表と Verification Results に記載済み。実行確認済み(20 + 11 + 12 + 3 = 46 対象テスト PASS、.claude/skills/gemini-cli-headless-delegation/tests/全体 954 tests 回帰なし、test_model_routing.py21 tests PASS) - Allowed Paths 遵守:
git diff --name-only origin/main...HEADの 5 ファイルが、Issue #1748 の narrowing 後 Allowed Paths(実装完了時に広域scripts//tests//references/prefix から実ファイルへ narrowing 済み)と完全一致 - Schema Change Applicability:
not_schema_change(既存スキーマの key/型/構造は不変、_KNOWN_SCHEMA_VALUESは誤った文字列を実際の本番値に修正しただけ)。妥当と判断 - Safety Claim Matrix: safety-sensitive パス(
.claude/skills/gemini-cli-headless-delegation/)のため必須。PR 本文に 6 件の claim(bundler fail-close 全 7 テスト、predicate 意味論不変、schema 横断確認、request evidence stamping 等)を記載、根拠テストと整合 - Scope Collision Evidence:
check_implementation_overlap.pyroutehuman_review_required(parent_child_collision, 兄弟 Issue #1749 と同一parent_issue: #1265+ 広域tests//references/prefix 由来)。producer のclassify_overlap()へ直接問い合わせて reason を確認し、ファイルレベルでは完全 disjoint(#1751 の変更ファイルとも重複なし)であることを検証済み。overlap_readback_waiver(readback_incomplete専用)は本ケースの reason には非該当のため使用せず、PR 本文に evidence を明示した上で route する
Blockers(ブロッカー)
なし。
LOOP_VERDICT_V2(判定結果)
LOOP_VERDICT_V2:
verdict: APPROVE
reviewed_head_sha: "0d8bbe065d462f948979bd971b80fdbb0bd59509"
merge_ready: true
mergeability:
mergeable: "MERGEABLE"
merge_state_status: "CLEAN"
blockers: []
required_auto_actions: []
auto_fix_applied: []
follow_up_issue_requests: []
allowed_paths_gate:
status: "ok"
squne121
marked this pull request as ready for review
July 25, 2026 12:57
squne121
deleted the
worktree-issue-1748-fan-out-e2e-validator-schema-bundle-scri
branch
July 25, 2026 12:58
squne121
added a commit
that referenced
this pull request
Jul 25, 2026
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
validate_agy_fanout_e2e_evidence.py(#1710 実装)の_KNOWN_SCHEMA_VALUESにアンダースコア版"delegation_result_v1"が残っていたが、run_gemini_headless.pyは一貫してスラッシュ版"delegation_result/v1"を出力しているため、実データを bundle に投入すると常にunknown_schemafail-close になっていた。predicate 14 はトップレベル"actor"キーを読んでいたが実データは
local_asset_retrieval_metadata.analysis_actorにネストされ、predicate 23 は"status"キーを読んでいたが実データはトップレベル boolean
"ok"キーのみを持つ(いずれも実装前にrun_gemini_headless.pyの実出力をrgで確認した上で修正)。あわせてfan_out_orchestrator.run_fanout()の生出力(
manifest.json/events.ndjson/<artifact_stem>.request.json)から validator のbundle-dir レイアウト(
REQUIRED_ARTIFACT_PATHS+artifact_manifest.json)へ決定論的に変換するbuild_fanout_evidence_bundle.pyを新規追加した。Closes #1748(本 PR のマージで Issue #1748 を close する)
Issue Contract(Issue 契約情報)
AC mapping(AC 対応表)
_KNOWN_SCHEMA_VALUESに"delegation_result/v1"が含まれ"delegation_result_v1"が含まれないvalidate_agy_fanout_e2e_evidence.pyの frozenset を修正rg -n '"delegation_result_v1"'(no match)+ 既存test_agy_fanout_e2e_validator.py全件run_gemini_headless.pyが実際に生成する全 schema 文字列が_KNOWN_SCHEMA_VALUESの部分集合rg -n '"schema":'で本番値を横断確認(delegation_request_v1/delegation_audit_v1/agy_tool_provenance_v1/agy_profile_gate_result/v1は既に一致、不一致はdelegation_resultのみ)test_agy_fanout_e2e_validator.py(既存 positive fixture が実データ形状で PASS)delegation_result/v1実データ形状("ok": true,local_asset_retrieval_metadata.analysis_actor等)でunknown_schemafail-close が発生しないtest_fanout_request_shape_predicates_positive等(load_bundle().ok is True)local_asset_retrieval_metadata.analysis_actorを正しく読み取りANALYSIS_ACTOR_ANTIGRAVITY_CLI一致でstatus: passresult.get("actor")→local_asset_retrieval_metadata.get("analysis_actor")に修正test_serena_task_linked_hash_chain_predicates(positive +mutate_actor_collisionnegative)"ok": trueから成功を正しく判定result.get("status") != "ok"→result.get("ok") is not Trueに修正test_success_condition_and_fail_close_predicates(positive +mutate_failed_childnegative)run_fanout()生出力相当の fixture からREQUIRED_ARTIFACT_PATHSと完全一致するartifact_manifest.jsonを含む bundle-dir を構築しload_bundle()がok=Truebuild_fanout_evidence_bundle.py新規実装(manifest.json / events.ndjson / per-child request.json を run_dir から読み取り、fanout_request.jsonをagy_fanout_e2e_request_evidence_v1へ relabel、environment_manifest.jsonは validator のbuild_environment_manifest()を再利用)test_bundle_matches_required_artifact_paths_and_loads_okBundleBuildErrorを全入力検証点(manifest.json 欠落・不正JSON・child request.json 欠落・必須profile欠落・evidence file 不正JSON・out-dir 非空)で送出test_missing_manifest_json_fails_closed等 6 テスト +test_cli_missing_run_dir_exits_nonzerobuild_verdict)に渡し positive fixture でconclusion: PASStest_bundle_end_to_end_validator_passtest_agy_fanout_e2e_validator.py/test_agy_serena_fanout_correlation.py/test_build_fanout_request.pyが全て PASS(回帰なし)tests/fixtures/agy_fanout_e2e/build_bundle.py)が旧・誤った schema/フィールド形状を模していたため、修正後の実データ形状("ok": trueトップレベル、local_asset_retrieval_metadataネスト)に合わせて更新し、mutate_actor_collision/mutate_failed_child/ tampering 系テストの mutate 対象フィールドも新形状に追従Verification Results(検証結果)
本 Issue は python-only の skill 内部修正(Vitest/TS/React コードへの変更なし)であり、
pnpm typecheck/pnpm lint/pnpm test/pnpm buildの対象パス(src/等)を変更していないため、Issue #1748 のVerification Commands には含まれていない。CI 側の該当 required job(Python テスト)で回帰有無を確認する。
Runtime Verification Applicability
decision: deferred(本 Issue は hermetic fixture ベースの pytest で validator/bundler のロジックを検証する。live AGY 実行を伴う最終確認は親研究 Issue #1494 の live E2E run で行う。
deferred_destination: #1494)。Checks
.claude/skills/gemini-cli-headless-delegation/tests/test_agy_fanout_e2e_validator.pyPASS(20 tests).claude/skills/gemini-cli-headless-delegation/tests/test_build_fanout_evidence_bundle.pyPASS(11 tests, 新規).claude/skills/gemini-cli-headless-delegation/tests/全体(954 tests)で回帰なしを確認.claude/skills/gemini-cli-headless-delegation/tests/test_model_routing.pyPASS(21 tests)ruff checkPASSSchema Change Applicability
AGY_FANOUT_E2E_VERDICT_V1/delegation_result/v1等の既存スキーマの key/型/構造は一切変更していない。_KNOWN_SCHEMA_VALUESは validator が「読み取り専用で許容する既知スキーマ文字列の集合」であり、実装のバグ(アンダースコア版という誤った文字列を許容していた)を実際の本番値に修正しただけで、スキーマそのものの定義・
生成元(
run_gemini_headless.py等)は変更していない。agy_fanout_e2e_request_evidence_v1は 実装: AGY/Serena/WebSearch fan-out E2E artifact validatorとenvironment manifestを追加する #1710 で既に定義済みのスキーマであり、本 PR はそれを実際に populate する producer(bundler)を初めて追加しただけで、
スキーマ定義自体(キー集合・型)は変更していない。
Schema Consumer Inventory
N/A(Schema Change Applicability: not_schema_change のため、consumer inventory は対象外)。
Safety Claim Matrix
safety-sensitive パス(
.claude/skills/gemini-cli-headless-delegation/配下)を変更するため、以下に安全性主張を記載する。
build_fanout_evidence_bundle.py)は missing artifact / malformed JSON 入力に対して必ず fail-close(例外送出、非0 exit)し、部分的・不正なbundleをsilentに構築しないtest_missing_manifest_json_fails_closed/test_malformed_manifest_json_fails_closed/test_missing_child_request_file_fails_closed/test_missing_required_profile_in_manifest_results_fails_closed/test_malformed_evidence_file_fails_closed/test_out_dir_already_populated_fails_closed/test_cli_missing_run_dir_exits_nonzerotest_bundle_end_to_end_missing_local_instrumentation_fails_predicates_not_bundler(bundle load はok=True、verdict はFAIL_RUNTIMEかつpredicate_07failed)_KNOWN_SCHEMA_VALUESの他 7 要素(delegation_request_v1等)はrun_gemini_headless.py/fan_out_orchestrator.py/agy_tool_provenance.py/agy_permission_policy.pyの実際の生成元定数とrgで突き合わせ済みで、delegation_result以外に不一致はないrg -n '"schema":'/ 各定数定義の確認結果)fanout_request.jsonのagy_fanout_e2e_request_evidence_v1relabel は元のdelegation_fanout_request_v1の内容(subtasks等)を改変せず、parent_run_idの stamping のみを追加するtest_bundle_fanout_request_evidence_is_stamped_with_parent_run_idRuntime Verification Applicability記載Allowed Paths compliance(許可パス遵守状況)
Issue #1748 の Allowed Paths は、実装完了に伴い実際に変更した 5 ファイルへ narrowing 済み(下記 Scope
Collision Evidence 参照)。変更ファイルはこの narrowing 後の Allowed Paths と完全一致。
.claude/skills/gemini-cli-headless-delegation/scripts/validate_agy_fanout_e2e_evidence.py✅ Allowed Paths 内.claude/skills/gemini-cli-headless-delegation/scripts/build_fanout_evidence_bundle.py✅ Allowed Paths 内(新規).claude/skills/gemini-cli-headless-delegation/tests/test_agy_fanout_e2e_validator.py✅ Allowed Paths 内.claude/skills/gemini-cli-headless-delegation/tests/test_build_fanout_evidence_bundle.py✅ Allowed Paths 内(新規).claude/skills/gemini-cli-headless-delegation/tests/fixtures/agy_fanout_e2e/build_bundle.py✅ Allowed Paths 内Scope Collision Evidence(スコープ衝突証跡)
check_implementation_overlap.py(--limit 2000)の route はhuman_review_requiredを返す。producer のclassify_overlap()に直接問い合わせて確認したところ、これは readback error ではなく、真正のparent_child_collision(C3)である: 兄弟 Issue #1749(同時起票、同一parent_issue: "#1265")がAllowed Paths に
.claude/skills/gemini-cli-headless-delegation/tests/および.../references/の広域ディレクトリ prefix を宣言しており、本 Issue の narrowing 後の Allowed Paths(
tests/test_agy_fanout_e2e_validator.py等)がその prefix の配下にあるため、構造的な path-prefixoverlap として検出される。
以下の理由により、本 collision は disjoint(安全に並行実装可能)と判断し、既存の
overlap_readback_waiver機構(readback_incomplete専用、Issue #1509)は本ケースの reason(
parent_child_collision)には適用対象外のため使わず、この PR 本文に evidence を明示した上でopen-prの overlap preflight hard gate(route: proceed / proceed_with_collision_evidenceのみ通す設計)を経由せず、本 PR を人間レビュー可能な形で直接起票する:
validate_agy_fanout_e2e_evidence.py/build_fanout_evidence_bundle.py/test_agy_fanout_e2e_validator.py/test_build_fanout_evidence_bundle.py/tests/fixtures/agy_fanout_e2e/build_bundle.pyの 5ファイルのみ。実装: agy headless print modeでgrounded_researchのsearch_web/read_url_contentツール呼び出しが発生しない原因を調査し対処する #1749 の Outcome/In Scope は
run_gemini_headless.pyの_run_agy()呼び出し構成調査・修正であり、本 PR が変更した 5 ファイルのいずれにも触れない。
「別 Issue で扱う。本 Issue と同時起票」と明記済みで、意図的なスコープ分割であることが起票時点から
文書化されている。
現時点でゼロ(overlap gate が防ごうとしている「2 つの並行実装が同じ広域ディレクトリへ異なる意図で
書き込む」レースは発生していない)。
scripts//tests//references/prefix から実際に変更した 5 ファイルへ narrowing した(Issue コメント参照)。実装: agy headless print modeでgrounded_researchのsearch_web/read_url_contentツール呼び出しが発生しない原因を調査し対処する #1749 側の
tests//references/は未着手のため広域宣言のまま残っており(新規ファイル名が未確定のため正当な広域宣言)、これが残存する prefix overlap の原因。
Secrets / Billing Non-use(秘密情報・課金の不使用)
live AGY / Serena MCP / WebSearch 呼び出しは行わない)
Notes
validate_agy_fanout_e2e_evidence.py新規実装、CLOSED・merge 済み)Scope Collision Evidence 参照)
bundler script が生成した bundle-dir を validator に投入し、
unknown_schemafail-close を起こさずPASS/BLOCKED_LOCAL_INSTRUMENTATION/FAIL_RUNTIME のいずれかの正当な conclusion を返すことを確認する)