Repository navigation
feat: add controller-owned AGY advisory fallback - #2459
Conversation
Route local advisory investigations through a controller-owned canonical builder and actual wrapper invocation, with producer-owned AGY failure correlation and a single deferred runtime smoke. Co-Authored-By: Claude Code <[email protected]>
Co-Authored-By: Claude Code <[email protected]>
Preview URLPreview removed (PR #2459 closed). |
Run the test-only controller driver within the real investigator process, harden malformed requirement handling, and satisfy focused CI formatting and Japanese-content checks. Co-Authored-By: Claude Code <[email protected]>
Keep the private controller invocation in the test harness and require the real investigator to consume its captured decision through Read-only tools. Co-Authored-By: Claude Code <[email protected]>
Co-Authored-By: Claude Code <[email protected]>
Co-Authored-By: Claude Code <[email protected]>
Retain Graphify only as optional prefilter and preserve controller-owned AGY/Serena confirmation. Co-Authored-By: Claude Code <[email protected]>
Reject legacy CLI modes at the exact V1 boundary while retaining the named pre-controller mapping helper. Co-Authored-By: Claude Code <[email protected]>
Co-Authored-By: Claude Code <[email protected]>
Co-Authored-By: Claude Code <[email protected]>
Co-Authored-By: Claude Code <[email protected]>
Co-Authored-By: Claude Code <[email protected]>
Co-Authored-By: Claude Code <[email protected]>
Co-Authored-By: Claude Code <[email protected]>
Co-Authored-By: Claude Code <[email protected]>
Co-Authored-By: Claude Code <[email protected]>
Co-Authored-By: Claude Code <[email protected]>
Co-Authored-By: Claude Code <[email protected]>
Co-Authored-By: Claude Code <[email protected]>
Co-Authored-By: Claude Code <[email protected]>
Co-Authored-By: Claude Code <[email protected]>
Record only a validated current HEAD and explicit PASS completion state; fail closed before writing evidence when HEAD resolution fails. Co-Authored-By: Claude Code <[email protected]>
Clean-room security-boundary reviewCLEAN_ROOM_SECURITY_REVIEW_V1:
role: security-boundary
verdict: APPROVE
reviewed_head_sha: f8607c6bb3960e162a341c2b5c3d85b4e8a20807
blockers: []
warnings: []実装者 transcript は参照せず、live Issue/PR、current diff、current CI、test result manifest、および公開可能な証跡ハッシュだけを確認しました。
raw prompt、transcript、credential、provider raw output は記録・参照していません。 |
Clean-room experimental-validity reviewCLEAN_ROOM_EXPERIMENT_REVIEW_V1:
role: experimental-validity
verdict: APPROVE
reviewed_head_sha: f8607c6bb3960e162a341c2b5c3d85b4e8a20807
blockers: []
warnings: []実装者 transcript は参照せず、live Issue/PR、current diff、current CI、test result manifest、および公開可能な証跡ハッシュだけを確認しました。
actual-wrapper smoke の causal ordering、head binding、test-only fake seam、nonmutation、SKIP fail-close を確認しました。raw prompt、transcript、credential、provider raw output は記録・参照していません。 |
結論REQUEST_CHANGES。現状の controller-owned AGY fallback という設計方向自体は良いです。特に caller が ただし敵対的に見ると、この PR は FindingsSeverity | Finding | 判定 -- | -- | -- P0 / Blocker | codebase-investigator の global contract を local-asset 専用に変更した結果、既存の github_research route と agent-retrospective 契約が壊れる | 修正必須 P1 / Needs-fix | current head と clean-room APPROVE / live evidence の SHA が一致していない。通常 CI は live smoke の代替にならない | current head で再検証 P1 / Needs-fix | 「既存の 1MiB/4MiB を維持」と書いているが、実際には producer 全体を 200KB/600KB → 1MiB/4MiB に拡張している | 意図明確化または revert P2 | controller/producer の分離そのもの | 採用推奨 P2 | AGY 権限まわりをさらに巨大な harness で囲う案 | 不要P0: 共有 |
| Severity | Finding | 判定 |
|---|---|---|
| P0 / Blocker | codebase-investigator の global contract を local-asset 専用に変更した結果、既存の github_research route と agent-retrospective 契約が壊れる |
修正必須 |
| P1 / Needs-fix | current head と clean-room APPROVE / live evidence の SHA が一致していない。通常 CI は live smoke の代替にならない | current head で再検証 |
| P1 / Needs-fix | 「既存の 1MiB/4MiB を維持」と書いているが、実際には producer 全体を 200KB/600KB → 1MiB/4MiB に拡張している | 意図明確化または revert |
| P2 | controller/producer の分離そのもの | 採用推奨 |
| P2 | AGY 権限まわりをさらに巨大な harness で囲う案 | 不要 |
P0: 共有 codebase-investigator の後方互換性を壊している
PR 後の .claude/agents/codebase-investigator.md は、入力を target_paths / context_paths / purpose / agy_investigation_requirement に限定し、controller mode も codebase_local_asset のみです。target_symbol、directory、従来の GitHub research 入力などは controller input にしない、と明記されています。
ところが現在のリポジトリには、明確な既存 consumer があります。scripts/agent-ops/run_agent_provider_route_smoke.py は REQUIRED_ROUTES として、
codebase-investigator / local_asset_research
と
codebase-investigator / github_research
を両方要求しています。しかも local route 側も旧 target_path 契約を前提にしています。
つまり、#2459 の Schema Consumer Inventory が codebase-investigator、controller、producer、CODEBASE_INVESTIGATION_RESULT_V1 だけを挙げているのは不十分です。
さらに重要なのが agent-retrospective です。Issue #2374 / PR #2387 は、まさに substantive な codebase-investigator 呼び出しに
agy_advisory_native_fallback_allowed: true
と
authoritative_base_sha=ctx.base_sha
を渡し、fallback evidence を固定 base SHA に束縛するために導入されています。
そして current head でも run_retrospective.py はまだこの旧入力を生成しています。
{"agy_advisory_native_fallback_allowed": True, "authoritative_base_sha": base_sha}
しかも retrospective の調査内容は CALLER_TASK_DATA.task という自由記述 task です。必ず target_paths が与えられる契約ではありません。
capability matrix も依然として authoritative_base_sha を必須 semantics として扱っています。
したがってこれは「古い documentation が残った」程度ではなく、
共有 agent の interface を破壊的変更したのに、既存 production-shaped caller を migration していない
という blocker です。
個人開発で workflow 優先なら、大規模 migration は不要です。今回の controller を issue-refinement-loop の local-asset route に限定し、global codebase-investigator の github_research / target_symbol / retrospective compatibility は残すのが最小変更です。共有 agent 自体を V1 専用にするなら、#2387 と route smoke を同一 PR で新契約へ完全移行する必要があり、今回の目的に対して重すぎます。
P1: APPROVE と runtime evidence が current head に束縛されていない
現在の PR head は 619089ffd67cfad8263a1b776759a87d6fb3ea56 です。
しかし clean-room security review と experimental-validity review は両方とも、
reviewed_head_sha: f8607c6bb3960e162a341c2b5c3d85b4e8a20807
で APPROVE しています。
current head の通常 CI 自体は success です。
ただしこの repository の python-test-plan.json は claude_live / github_live を runtime-verification-only として通常 pytest から外しており、専用 CI lane も存在しないと明記しています。
したがって「CI green だから current head の actual-wrapper / cross-agent runtime contract も検証済み」とは言えません。
ここで新しい harness は不要です。既存 smoke を current head で再実行するだけで十分です。特に今回 P0 に直結するため、既存の agent-provider route smoke と #2374 の retrospective live smoke を1回ずつ走らせる価値があります。
P1: context limit は「維持」ではなく約5〜7倍への global expansion
PR body は「既存の 32 件、各 1 MiB、合計 4 MiB の上限を維持」としています。
しかし base 594a506... では実際には、
LOCAL_ASSET_MAX_CONTEXT_BYTES = 200_000
LOCAL_ASSET_MAX_CONTEXT_TOTAL_BYTES = 600_000
でした。
current PR head では、
1 MiB
4 MiB
に変更されています。
これは controller 固有の cap ではなく、run_gemini_headless.py の global local_asset_research producer behavior の変更です。
大きくすること自体を否定する必要はありません。個人用途では、大きな source file をそのまま扱える方が便利なケースもあります。ただ、「既存値を維持」として紛れ込ませるのはよくありません。Antigravity CLI では最近も JSON-heavy な大きい prompt が exit 0 / SUCCESS / empty response になる報告があり、80KB 前後から不安定化した実例まであります。([GitHub]1)
推奨は、今回の PR では producer を従来の 200_000 / 600_000 に戻すことです。1MiB/4MiB が実際に必要なら、別途「large-context を許容する理由」を明示して変更した方が切り分けやすいです。
AGY/Claude 側の設計判断
この PR については、セキュリティ harness をさらに増やす方向には反対です。
Antigravity CLI の headless agy -p は、2026年7〜8月時点でも permission 周りにかなり不安定さがあります。per-executable の scoped allow が難しい問題、permissions.allow が headless で機能しない報告、path-specific deny の bypass などが残っています。([GitHub]2)
また --output-format json では、tool permission が soft-deny されたのに exit 0 / status: SUCCESS / empty response になる実例もあります。([GitHub]3)
そのため今回の、
wrapper/Serena が repository evidence を取得 → AGY は分析 → controller が nonempty result と failure correlation を検証
という方向は合理的です。
Claude Code 側も permissionMode: dontAsk は公式に「permission prompt を auto-deny し、明示 allow 済み tool は動く」という意味です。tools / disallowedTools と合わせる現在の薄い構成で足ります。([Claude]4)
つまり P0 を直すために permission sandbox や credential harness をさらに積む必要はありません。
推奨修正
codebase-investigatorの既存 global interface を復元する。 新 controller は issue-refinement-loop のlocal_asset_researchにだけ additive に配線する。github_research、target_symbol、authoritative_base_shaを今回消さない。- producer の 1MiB/4MiB 化を今回から外すか、少なくとも意図的な global behavior change として Issue/PR body・テストを修正する。
- 修正後の current head で、既存の actual-wrapper smoke、
agent_provider_route_smokeの local/GitHub 2 route、実装: agent-retrospective の codebase observer を role-specific contract で接続し、AGY operational failure 時の native fallback 結果を base_sha-bound な OBSERVER_RESULT_V1 へ正規化する #2374 retrospective live smoke を再実行する。新規 harness は作らない。 - その current SHA を clean-room review の新しい
reviewed_head_shaと runtime evidence に固定してから merge-ready にする。
この3点、特に P0 の global consumer regression が解消されれば、controller-owned architecture 自体は merge する価値があります。 #2360/#2365 で導入した「AGY failure 時でも調査ワークフローを止めすぎない」という方向を保ちつつ、#2374/#2387 で既に解決済みの retrospective compatibility を壊さない形が最も実用的です。
PR の head が更新された場合、この P0/P1 が解消されたか再チェックする運用もできます。
|
確認した時点で、PR #2459 は open / draft / mergeable, HEAD は 推奨方針は、指定コメントの最小変更案を基本にします。ただし 200KB/600KB への単純 revert はそのまま指示しません。現在の Issue #2434 自体が AC と Outcome で
以下を Claude-GPT にそのまま渡せます。 対象 implementation Issue: 既存 PR: 今回の human review / fix_delta の起点: この対象について 実際の merge はしないでください。 起動方法
主入力は Issue #2434 とし、上記 PR コメント URL を 可能なら:
相当で開始してください。 PR #2459 は既存 PR として再利用し、新しい PR・新しい Issue・別 branch を重複作成しないでください。開始時に live PR / Issue / comment / current branch / current HEAD / mergeability / CI を再取得し、ここに書かれた SHA を固定値として信用しないでください。 指定コメント中の ただし、この anchor comment より後に新しい明示的な owner stop instruction が投稿されている場合は、それを live state として再評価してください。 今回の優先 fix_deltaまず指定コメントを全文取得し、P0/P1/P2 を漏れなく machine-actionable な fix_delta にしてください。 P0 —
|
|
今の状態では、いきなり また 対象 Issue: 対象 PR: 過去の adversarial review anchor: 現在の task state は概ね以下です。 ただし、現時点では 前回 run は、current-head compatibility verification で次の3件が失敗し、
について、
として しかしこの判定には重要な不足があります。 「PR #2459 によって新たに壊れた regression」なのか、「base/main でも既に壊れている stale smoke / caller defect」なのかを比較していません。 したがって、最初にこの compatibility blocker adjudication を実施し、その結果に基づいて 最終目標PR #2459 を、
まで、人間の途中承認なしで進めてください。 実際の merge は行わないでください。
Phase 0: live state を再取得最初に必ず現在値を再取得してください。 少なくとも:
を確認してください。 過去ログに書かれた SHA を current state として信用しないでください。 現在の live Issue #2434 本文を semantic SSOT としてください。 過去の:
は historical evidence としてのみ扱ってください。 Phase 1: compatibility blocker adjudicationここが今回の最優先作業です。 1A. base-vs-PR comparison を行う以下3経路について、同一条件で base/main と PR head を比較してください。 A. provider route smoke / local_asset_research対象: B. provider route smoke / github_research対象: C. agent-retrospective compatibilityIssue #2374 / PR #2387 由来の production-shaped consumer / live smoke。 特に: の契約を調査してください。 比較ルール各失敗について必ず次の分類をしてください。 CASE 1: base PASS / PR FAILこれは PR #2459 regression です。 この場合は #2459 の blocker として扱い、まず Issue #2434 Allowed Paths 内で修正できるか検討してください。 Allowed Paths 内で直せるなら自動修正してください。 修正: まで行ってください。 CASE 2: base FAIL / PR FAIL with same root causeこれは原則 pre-existing defect / stale harness / stale caller contract です。 単にその smoke が FAIL するという理由だけで #2459 を blocker にしないでください。 次を調査してください。
#2459 由来でないと証明できたら、その finding を として #2459 routing から除外してください。 CASE 3: base FAIL / PR FAIL but failure mode differs差分原因を調査し、#2459 が追加 regression を持つならその部分だけ blocker としてください。 CASE 4: base PASS / PR PASSresolved としてください。 Phase 2: 3件の既知 failure を個別に検証2A. local_asset provider smoke前回報告では、 という artifact polling ordering 問題が疑われています。 これを事実確認してください。 もし base/main でも同様なら、 側の pre-existing harness defect と分類してください。 #2459 の codebase-investigator implementation を smoke harness に合わせて歪めないでください。 逆に base では成功するなら、PR 差分のどこが materialization timing / destination semantics を壊したのか特定して修正してください。 2B. github_research provider smoke前回報告では synthetic smoke が を与えず、reply-only / synthetic prompt だけを渡している可能性があります。 base/main の contract と照合してください。 base でも同じ入力で失敗するなら stale synthetic probe と分類してください。 PR #2459 の global 2C. retrospective
|
Pass the producer-owned attempted-state callback only at the direct github_research AGY subprocess boundary. Co-Authored-By: Claude Code <[email protected]>
Co-Authored-By: Claude Code <[email protected]>
Assert the fixed hermetic AGY argv at the direct subprocess boundary while allowing an optional bwrap prefix. Co-Authored-By: Claude Code <[email protected]>
Keep bwrap wrapper failures outside the actual-AGY attempted boundary while preserving direct execution correlation. Co-Authored-By: Claude Code <[email protected]>,
Use bwrap's bounded status stream to distinguish its setup failures from a started AGY child, including nonzero child exits. Co-Authored-By: Claude Code <[email protected]>
Drain the bounded bwrap status stream before re-raising timeouts so a proven child start reaches advisory fallback routing. Co-Authored-By: Claude Code <[email protected]>
Keep the allowlist fixture aligned with the terminal separator required before production status-FD insertion. Co-Authored-By: Claude Code <[email protected]>
Require a valid bwrap child-pid proof before exposing an AGY success, and cover direct minimal-environment timing.\n\nCo-Authored-By: Claude Code <[email protected]>
CLEAN_ROOM_SECURITY_REVIEW_V1
Read-only clean-room review verified the bounded |
CLEAN_ROOM_EXPERIMENTAL_VALIDITY_REVIEW_V1
Read-only clean-room review verified controlled evidence for direct isolated/minimal and GitHub AGY timing, exact argv, success/nonzero correlation, and bwrap normal/nonzero/timeout cases with valid versus absent/malformed/oversized child-start status. |
Only a bounded strict bwrap child-pid record now establishes a GitHub AGY attempt or authorizes its zero-exit stdout. Co-Authored-By: Claude Code <[email protected]>
|
確認した現状では、新規セッションで実装を最初からやり直すより、live state を再構成して current HEAD の再検証・再レビューから PR #2459 は現在 open / draft / mergeable、base は さらに、その APPROVE 後に
推奨アクションは次の順です。
以下を新しい Claude Code セッションにそのまま投入する構成を推奨します。 対象 repository: 対象 implementation Issue: 既存 PR: この対象について、新規セッションから repository canonical の 目的は、PR #2459 を 実際には merge せず、canonical workflow が許す範囲で merge 直前まで、人間への途中承認要求なしで自律的に進めることです。 過去 Claude Code セッションの transcript、task list、途中状態、記憶は authority として使用しないでください。 最重要方針最初に必ず live な
およびそこから参照される canonical steps / scripts / workflow safety boundary をロードしてください。 このプロンプト内の記述と live skill が食い違う場合は、repository の current canonical skill / contract を優先してください。 独自の簡略版 implementation-review loop を作らないでください。 主入力は:
相当としてください。 PR #2459 は既存 PR として再利用してください。 新規セッションでの resume 方針これは「最初から同じ実装を作り直す」依頼ではありません。 開始時に少なくとも次を live 取得してください。
過去コメント内の SHA や、このプロンプトに書かれている SHA を固定 authority にしないでください。 参考として、このプロンプト作成時には current PR HEAD は 既存の clean-room APPROVE が current HEAD より古い SHA に束縛されている場合、その APPROVE は current-head approval として再利用しないでください。
初動の推奨 routeまず current HEAD と最新 review 済み HEAD の差分を確認してください。 current HEAD にすでに必要な fix が入っているなら、無意味なコード変更を作らず、 current-head verification を優先してください。 ただし canonical その場合 implementation-worker には「current implementation を再調査し、未解消 blocker / contract violation が存在する場合だけ最小修正する。修正不要なら no-op result を返す」という扱いをさせ、変更を捏造しないでください。 Issue #2434 contractIssue #2434 の live contract を正本としてください。 特に context limit について、live Issue が引き続き
を要求している場合は、古い adversarial review に 200KB / 600KB revert 案が存在することだけを理由に contract 違反の revert をしないでください。 現在の実装が 200,000 / 600,000 から 1 MiB / 4 MiB への intentional global Issue contract 自体が live state で変更されている場合のみ、その current contract に従ってください。 current-head verificationfinal candidate HEAD に対し、canonical repository commands を特定して必要な verification を実行してください。 名前から推測して新しい test harness や smoke framework を作らないでください。 最低限、Issue #2434 の scope に対応する以下を current HEAD へ束縛してください。
既存 actual-wrapper smoke が canonical のままなら、例えば
相当の live smoke を final HEAD で実行してください。 ただし invocation は live repository で確認してから使用してください。 SKIP を PASS として扱わないでください。 runtime / auth / environment の外部条件で実 provider verification が不可能な場合、その failure を production regression と混同せず base/main comparison と repository contract に従って adjudicateしてください。 新規 credential workaround、permission broker、巨大な security harness を追加して隠さないでください。 SubAgent delegation — 必須
少なくとも canonical な位置で:
を使用してください。 さらに final candidate では、既存 mechanism を使って独立した:
を使用してください。 SubAgent 完了待機の絶対条件SubAgent を launch しただけで次の step へ進まないでください。 以下は「完了」ではありません。
SubAgent を起動したら、その SubAgent が terminal completion になるまで root/main thread が必ず待ってください。 利用可能なら blocking wait / join / task-output wait の canonical mechanism を使用してください。 background 実行の完了通知が不確実な場合は、必要な SubAgent を synchronous に起動するか、canonical status/readback mechanism で terminal state を明示確認してください。 required SubAgent が running のまま main session の turn を終了してはいけません。 各 SubAgent の final structured result を取得し、
が current candidate と一致していることを確認してから次工程へ進んでください。 複数の独立 clean-room reviewer は並列実行して構いません。 ただし canonical PR review / final judgment に進む前に、全 reviewer の terminal completion を待ち、全 final result を回収してください。 途中で SubAgent が単なる repository canonical policy が定義する正式な
等と区別してください。 clean-room re-reviewfinal candidate HEAD で clean-room review を再実行してください。 過去の implementer transcript を clean-room reviewer に渡さないでください。 reviewer が参照してよい evidence は原則として:
です。 security-boundary reviewer と experimental/runtime-validity reviewer の両方が終了するまで待ってください。 両者について:
を取得し、 stale HEAD の APPROVE は current candidate の証拠として使用しないでください。 blocker が出た場合は canonical PR reviewclean-room review だけで merge readiness を自己判定しないでください。 最終判定には repository canonical の:
を使用してください。 pr-reviewer SubAgent の terminal completion を待ってから Step 5 に進んでください。
という loop を、人間の途中承認なしで継続してください。
branch が BEHIND の場合は canonical controlled update_branch 後は HEAD が変わるため verification / current-head review を必ず再実行してください。 force push や履歴 rewrite で代替しないでください。 PR body hygiene現在の PR body に final candidate より古い HEAD / base / test count / runtime artifact / review evidence が残っている場合は更新してください。 ただし PR body を先に「merge ready」と作文してから証拠を合わせるのは禁止します。 順番は: final code を基本としてください。 少なくとも final PR body では:
が実際の final state と一致している必要があります。 stale SHA を current evidence として残さないでください。 許可する操作この作業を merge 直前まで進めるために必要な通常の非破壊操作について、都度人間へ承認を求める必要はありません。 以下を必要に応じて実行して構いません。
合理的な選択肢が複数ある場合は、 最小変更 / current Issue contract 優先 / backward compatibility 優先 / 新規 harness を増やさない 案を自律的に選択してください。 Draft / Ready statePR #2459 が GitHub Draft の場合、live 現在の repository policy が、Draft → Ready transition を人間自身の操作として予約しているなら、それを独自に迂回してはいけません。 一方、live canonical policy が、この direct human instruction を authorization として delegated Ready transition を許しているなら、その canonical path に従って Ready にして構いません。 live skill が許可していないのに 最終的に実装・verification・current-head review・CI・mergeability がすべて成立し、GitHub Draft フラグだけが canonical に人間操作として残る場合は、それを 唯一の remaining human boundary として明示して停止してください。 Draft フラグを理由に、それ以前の実装・検証・レビュー作業を途中で止めて人間へ確認しないでください。 禁止 / hard stop以下は実行しないでください。
通常の canonical loop で解消可能なら自動で解消してください。 完了条件次を満たすまで、genuine hard blocker がない限り自律的に継続してください。
canonical policy 上 Draft → Ready が human-only なら、上記すべてを完了させた上で Draft transition だけを remaining boundary としてください。 それ以外で canonical 最終報告終了時に必ず以下を報告してください。
途中で「SubAgent を起動しました。完了を待ちます」という状態のままセッションを終了しないでください。 必要な SubAgent が存在する場合は その作業完了を実際に待ち、final result を回収してから次工程または最終報告へ進んでください。 人間への途中承認依頼ではなく、merge直前の canonical end state または genuine hard stop まで自律的に進めてください。 この版では、以前の再開プロンプトよりも |
…ate (#2434) The AC6/AC10 unproven-bwrap-success fail-close added in deec05e/2303d853 routes ANY isolated-workspace AGY invocation through the bwrap child-pid-proof branch whenever the host has both a real bwrap binary and a real AGY OAuth token file (e.g. a developer workstation with a prior authenticated agy session). Existing pre-#2434 grounded_research/model- routing tests fully patch subprocess.run() without emulating a real bwrap child-start status record, so on such a host they were silently converted to unproven-bwrap fail-close, breaking assertions unrelated to bwrap proof at all. Patch _bwrap_available() to False in these tests so they exercise the same non-bwrap path they always have (matching the CI/no-OAuth-token environment they were written against), leaving the AC6/AC10 bwrap-proof behavior itself and its dedicated tests unchanged. Co-Authored-By: Claude Code <[email protected]>
Clean-room experimental-validity reviewIndependent verification performed live in the worktree (no prior session context used):
CLEAN_ROOM_EXPERIMENTAL_VALIDITY_REVIEW_V1:
role: experimental-validity
verdict: APPROVE
reviewed_head_sha: 8993c5fcf841dc5d98d15f0df6ad5ce62a223ae8
base_sha: c411545147c179cd0fe2ea7caa06376c4e2c827c
blockers: []
warnings:
- "AC8 claude_live-marked pytest (test_actual_wrapper_fallback_reaches_real_native_sentinel) could not be freshly re-executed to completion in this reviewing session's sandbox: the nested `claude -p --agent codebase-investigator` subprocess's own Bash tool blocks the required shell-redirect command with an output-redirection sandbox error, unrelated to this PR's implementation. Corroborated instead via (a) verified PASS log at ancestor 1fd152c9 for the identical test, (b) diff --stat confirming the files AC8 exercises are unchanged between that ancestor and current HEAD, and (c) direct invocation of the private driver producing the correct AGY_ADVISORY_FALLBACK_ROUTE_DECISION_V1 decision for a simulated AGY failure. Recommend a fresh claude_live run in an unrestricted environment before merge if not already captured at current HEAD, but this does not block on experimental-validity grounds."
- "test_ac7_agy_github_research_dispatches_to_e2e_route fails at current HEAD and identically at base c411545147c179cd0fe2ea7caa06376c4e2c827c (verified via scratch worktree) due to no live agy CLI/GH_TOKEN in this sandbox -- confirmed pre-existing, not a regression, but still an environment-dependent red test in the suite worth tracking separately." |
Clean-room security-boundary reviewCLEAN_ROOM_SECURITY_REVIEW_V1:
role: security-boundary
verdict: APPROVE
reviewed_head_sha: 8993c5fcf841dc5d98d15f0df6ad5ce62a223ae8
base_sha: c411545147c179cd0fe2ea7caa06376c4e2c827c
blockers: []
warnings:
- "run_agy_github_research_e2e.py's _bwrap_status_reports_child_started() parses the --json-status-fd stream via str.splitlines(), assuming each bwrap status object is newline-terminated. This matches the existing (pre-existing, unmodified-by-this-PR) sibling implementation in run_gemini_headless.py and is covered by unit tests with synthetic multi-record streams, but was not verified against a real bwrap binary's byte-exact --json-status-fd framing in this review. If a future bwrap version ever emits back-to-back JSON objects without a newline separator, json.loads() would raise and the whole stream would be (safely, fail-closed) treated as unproven -- i.e. the failure mode is fail-closed/available-degraded, not a security bypass, so this is advisory only."
- "run_codebase_investigator_agy_advisory.py's controller and run_agy_github_research_e2e.py both trust 'bwrap' and 'agy' as resolved via PATH (subprocess argv[0], not an absolute/verified path) when AGY_BIN is absent. This is pre-existing, unchanged trust-boundary behavior (identical pattern already present in run_gemini_headless.py before this PR) and out of this PR's diff scope, but noted for completeness since the review scope named AGY_BIN handling."uv run pytest .claude/skills/issue-refinement-loop/scripts/tests/test_run_codebase_investigator_agy_advisory.py |
Clean-room security-boundary reviewCLEAN_ROOM_SECURITY_REVIEW_V1:
role: security-boundary
verdict: APPROVE
reviewed_head_sha: e057ecba1d136269f385b20b3bbf4cb6d0dfea1d
base_sha: 54e37bff7e454e9487344b278512f27cabdd1eca
blockers: []
warnings: []再レビュー結果(8993c5fc → e057ecb の update_branch merge-only sync後):
結論: 本 sync は PR ソースコード変更を含まない mechanical merge-only update であり、Allowed-Paths 内の全ファイルが 8993c5f 時点と byte-identical。8993c5fc での APPROVE(blockers: [])判定はそのまま e057ecb にも妥当する。 |
Clean-room experimental-validity reviewCLEAN_ROOM_EXPERIMENTAL_VALIDITY_REVIEW_V1:
role: experimental-validity
verdict: APPROVE
reviewed_head_sha: e057ecba1d136269f385b20b3bbf4cb6d0dfea1d
base_sha: 54e37bff7e454e9487344b278512f27cabdd1eca
blockers: []
warnings:
- "AC8 claude_live pytest not freshly re-executed in this re-review (nested `claude -p` subprocess still hits Bash-tool sandbox output-redirection restriction on this host); relying on prior 8993c5fc PASS artifact + confirmed zero-diff on exercised files, consistent with the prior clean-room review's finding."
- "test_agy_provider.py::test_ac7_agy_github_research_dispatches_to_e2e_route fails identically (exit_code 1, expected in (0, 77)) at both e057ecba (PR head) and 54e37bff (base, verified in a throwaway worktree) — pre-existing real bwrap+OAuth environment limitation on this dev host, not a regression." |
Summary
Closes #2434。関連 Issue をクローズします。
Issue #2434 の実装は、助言的 native fallback の判断を controller 所有の actual wrapper invocation 境界に置きます。canonical builder →
run_gemini_headless.py→ exact output readback → minimal projection → shared decision core の順で接続し、public request、caller-supplied result、ambientAGY_BIN、taxonomy mirror を trust input にしません。実行はshell=Falseであり、raw provider output、transcript、credential 内容を記録・公開しません。この本文は current candidate の証跡だけを記録します。対象 head は
e057ecba1d136269f385b20b3bbf4cb6d0dfea1d、base は54e37bff7e454e9487344b278512f27cabdd1ecaです。merge、review outcome、または merge-ready の主張は行いません。AGY invocation-attempt の境界
agy -psubprocess の直前にだけ置きます。成功と nonzero の双方で、subprocess 内から観測した transition と exact argv を focused test で対応付けます。--json-status-fdの strict JSON status にある正のchild-pidだけをagy_invocation_attempted:trueの proof とします。exit status、response、または stderr regex から attempted を推論しません。agy_exit_nonzero) に変換し、native fallback の対象にしません。.claude/skills/gemini-cli-headless-delegation/tests/test_agy_invocation_argv_allowlist.pyには terminal--を 1 件だけ追加し、bwrap wrapper argv の境界を固定します。コンテキスト上限
local_asset_researchの context limits は、base の 200,000 bytes / 600,000 bytes aggregate から、live Issue が要求する 32 files / 1 MiB per file / 4 MiB aggregate へ変更しています。これは既存 limits の維持ではなく、意図的な globallocal_asset_researchproducer contract expansion です。Checks
current head (
e057ecba...) に対する実行・記録済み evidence は次のとおりです。test_run_codebase_investigator_agy_advisory.py+test_route_agy_advisory_fallback.py74 passedtest_agy_invocation_argv_allowlist.py+test_agy_github_research_e2e.py48 passedtest_agy_provider.py81 passed、既知の pre-existing 1 件失敗(test_ac7_agy_github_research_dispatches_to_e2e_route。basec411545...でも隔離した scratch worktree で同一失敗を再現確認済みであり、本 PR による regression ではありません)pnpm typecheck、pnpm lint、pnpm test、pnpm buildは required CI ですべてPASS20 件 PASS/0 件 FAILe057ecba...に対しverdict: APPROVE、blockers: []。ただし advisory な non-blockingwarningsを含みます(fail-closed な既存 trust boundary への注記、AC8 の evidence gap への言及など)。この本文は review outcome の最終判断や merge-ready を主張しませんAC8 は actual-wrapper output を評価対象とし、fallback 経路を PASS として扱いません。bwrap proof 不足で response を捨てる経路も、successful invocation や runtime evidence には数えません。
受け入れ基準のカバレッジ
claude_liveactual-wrapper smoke の自動再実行は、このレビューセッションのネストされたclaude -p --agent codebase-investigatorsubprocess に対する Bash tool の output-redirection sandbox 制限により、この PR のコードとは独立に再現的にブロックされました。PASS を主張する代わりに、(a) 直前の祖先 commit1fd152c9(AC8 が実際に参照するrun_codebase_investigator_agy_advisory.py/run_gemini_headless.pyは current head と byte-identical であることをgit diff --statで確認済み)での実測 PASS artifactartifacts/runtime-verification-AC8-20260902T121656Z.log、(b) そのgit diff --stat 1fd152c9..8993c5fcによるコード不変の確認、(c) nested subprocess を経由しない_run_fixed_proposal_only_actual_wrapper_smoke()の直接呼び出しによる決定ロジック検証、の3点により non-regression として corroborate されています。この評価は control-plane orchestrator、security-boundary clean-room reviewer、experimental-validity clean-room reviewer の3者が独立に確認済みです。current head での完全自動 artifact は known evidence gap として記録し、PASS の虚偽主張はしません。互換性の判定
以下は current-head の PASS や最終 PR compatibility proof に転用しない、透明な adjudication です。
local_asset_research: base/head はともに FAIL だが mode が異なるため ambiguous。production PR regression は立証されず nonblocking です。github_research: prior comparison で確認された actual attempt-state regression は、direct callback と bwrap child-status proof で修復済みです。current live provider availability/auth precondition failure は PASS に転用しません。test_ac7_agy_github_research_dispatches_to_e2e_route: current head と basec411545...の双方で同一失敗(agyCLI /GH_TOKEN不在によるサンドボックス環境依存)を確認済みであり、本 PR による regression ではありません。Schema Change Applicability
delegation_result/v1に producer-owned additive fields を追加し、既存値を置換しません。AGY_ADVISORY_INVOCATION_REQUEST_V1、AGY_ADVISORY_FALLBACK_ROUTE_DECISION_V1、AGY_ADVISORY_SUCCESS_RESULT_V1です。CODEBASE_INVESTIGATION_RESULT_V1の contract は変更しません。Schema Consumer Inventory
上の before/after inventory は schema consumer の機械可読な比較用であり、詳細な安全上の意味と検証根拠は前節と後続の表で日本語として説明します。
.claude/agents/codebase-investigator.md.claude/skills/gemini-cli-headless-delegation/scripts/run_gemini_headless.py.claude/skills/gemini-cli-headless-delegation/tests/test_agy_provider.py.claude/skills/gemini-cli-headless-delegation/tests/test_agy_invocation_argv_allowlist.py--の fixture を 1 件だけ追加CODEBASE_INVESTIGATION_RESULT_V1consumersSafety Claim Matrix
AGY_BIN、taxonomy mirror を trust しないagy -p直前、bwrap は valid positive child-pid proof の後にだけ true になるNotes
e057ecba1d136269f385b20b3bbf4cb6d0dfea1dと base54e37bff7e454e9487344b278512f27cabdd1ecaの証跡を参照します。e057ecba...は main の最新 tip へのupdate_branchmechanical merge-only sync(新しい base54e37bff...)であり、直前にレビュー済みだった head8993c5fc...との間で本 PR が触れる Allowed-Paths 13 ファイルはすべて byte-identical であることを確認済みです。canonical pr-reviewer、security-boundary clean-room reviewer、experimental-validity clean-room reviewer の3者がこの新 head で再確認し、いずれもverdict: APPROVE、blockers: []を返しています。この一文は merge-readiness や review outcome の最終判断を主張するものではなく、事実の記録のみです。