Skip to content

実装: web-researcher AGY→native fallback controlled live canary を追加する - #2169

Merged
squne121 merged 3 commits into
mainfrom
worktree-issue-2166-web-researcher-fallback-canary
Aug 14, 2026
Merged

squne121 merged 3 commits into
mainfrom
worktree-issue-2166-web-researcher-fallback-canary

Conversation

@squne121

@squne121 squne121 commented Aug 14, 2026 •

Copy link
Copy Markdown
Owner

Summary

Issue #2157 が結論した native-stream-level evidence(count_direct_web_tool_events)を primary independent evidence として再利用し、web-researcher の AGY→native Web fallback 分岐を非マージブロッキングな controlled live canary lane として証明可能にする。

  • scripts/agent-ops/run_web_researcher_fallback_canary_smoke.py(新規)
    • test-only・invocation-private な AGY forced-failure injection(tempdir に substitute agy バイナリを配置し PATH/AGY_BIN override でのみ到達可能。repo-global .agents/hooks.json やユーザーグローバル設定は一切変更しない。atexit + try/finally で cleanup を保証)。対象ツール名 search_web / read_url_content は .claude/skills/gemini-cli-headless-delegation/scripts/agy_permission_policy.py の AGY_DIRECT_TOOL_NAMES を実装時に確認して確定した。
    • PASS predicate: 11 個の evidence signal のコンジャンクション(verification_route == native_web の self-report 単独では不十分と明示)。
    • causal ordering: AGY attempt → forced AGY failure → native Web tool event → child completion → final result の実際の順序(co-presence のみは FAIL)を検証。
    • exit code 契約: 0=PASS / 1=FAIL / 77=SKIP。SKIP を PASS として報告・昇格しない。
    • nondeterminism/retry policy(調査: Claude Code custom SubAgent の spawn observability 非決定性を診断する #2013 methodology 再利用): trial count は実行前固定(デフォルト 15)、transient failure class のみ bounded single retry。
    • per-trial evidence は additive companion schema(web_researcher_fallback_canary_smoke_trial_evidence/v1)として設計し、既存 agent_provider_route_smoke/v1 等の closed schema は widening しない。
    • count_direct_web_tool_events / classify_claude_child_spawn_agent_id / classify_claude_child_completion 等は run_worktree_agent_runtime_smoke.py から import して再利用(再実装しない)。
  • scripts/agent-ops/tests/test_web_researcher_fallback_canary_smoke.py(新規)
    • AC1/AC2/AC3/AC4/AC5/AC8 を fixture ベースで検証(34 tests、すべて PASS)。
  • 既存 run_agent_provider_route_smoke.py / run_worktree_agent_runtime_smoke.py は変更なし(fallback-disabled 既定挙動を維持)。
  • 本 canary は CI の required status check に追加していない(scheduled/明示手動実行のみ、AC6)。

本 PR は Issue #2166 を解決する(Closes #2166)。

Checks

$ test -f scripts/agent-ops/run_web_researcher_fallback_canary_smoke.py   # AC1
PASS

$ git diff --stat origin/main -- .agents/hooks.json   # AC2
(0 件ヒット)

$ uv run pytest scripts/agent-ops/tests/test_web_researcher_fallback_canary_smoke.py -k pass_predicate_conjunction   # AC3
4 passed

$ uv run pytest scripts/agent-ops/tests/test_web_researcher_fallback_canary_smoke.py -k causal_ordering   # AC4
9 passed

$ uv run pytest scripts/agent-ops/tests/test_web_researcher_fallback_canary_smoke.py -k exit_code_contract   # AC5
7 passed

$ rg -c run_web_researcher_fallback_canary_smoke .github/workflows/   # AC6
(0 件ヒット)

$ uv run pytest scripts/agent-ops/tests/test_agent_provider_route_smoke.py   # AC7
94 passed

$ git diff --stat origin/main -- scripts/agent-ops/route_artifact.schema.json   # AC8
(0 件ヒット。新規 companion schema はコード内定数として定義し、既存 closed schema は未変更)
  • pnpm typecheck: PASS
  • pnpm lint: PASS
  • pnpm test: PASS(1872 tests、tests/retro-live-verification.test.ts の 1 テストが並列実行時にタイムアウトしたが、単体再実行では 148/148 PASS を確認済み。本 PR の変更(Python-only)とは無関係な既知の timing flake)
  • pnpm build: PASS
  • uv run pytest .claude/skills/gemini-cli-headless-delegation/tests/test_model_routing.py: 24 passed
  • ruff check: All checks passed

Runtime Verification Applicability

  • decision: deferred(Issue 本文と同一)
  • AC1〜AC8(static/wiring)はすべて immediate ゲートとして本 PR でマージブロッキング検証済み(上記)。
  • AC9(live trial): 本実装セッションのサンドボックス環境では agy バイナリ自体は疎通したが(setup_check.py --provider agy --json は ok: true)、実際の live multi-turn Claude Code 子セッション spawn を伴う E2E 実行は本セッションのリソース制約内で実施していない。デフォルトの main() エントリポイントは preflight を実行した上で honest SKIP (exit 77) を返す設計にしており、PASS を捏造しない。live 1 trial 実行と証跡記録は本 PR のマージ後、scheduled/明示手動実行レーンで別途行う。

Schema Change Applicability

  • decision: not_schema_change
  • reason: 本 PR は新規スクリプト内にのみ定義される、まだどこにも登録されていない brand-new なコード内定数スキーマ(web_researcher_fallback_canary_smoke/v1 / web_researcher_fallback_canary_smoke_trial_evidence/v1)を追加するのみで、既存の schemas/*.json や agent_provider_route_smoke/v1 等の既存 registered schema は一切変更・widening していない(git diff --stat origin/main -- scripts/agent-ops/route_artifact.schema.json は 0 件ヒット、AC8 参照)。

Schema Consumer Inventory

N/A
reason: not_schema_change のため対象なし。

Safety Claim Matrix

N/A
reason: 変更パスは scripts/agent-ops/run_web_researcher_fallback_canary_smoke.py と対応する新規テストのみで、transport / permission / sandbox / auth / mcp / .claude/skills/ / .github/workflows/ のいずれの safety-sensitive パスパターンにも該当しない。

Notes

…2166)

Issue #2157 が結論した native-stream-level evidence
(count_direct_web_tool_events)を primary independent evidence として
再利用し、web-researcher の AGY→native Web fallback 分岐を
非マージブロッキングな controlled live canary lane として証明可能にする。

- scripts/agent-ops/run_web_researcher_fallback_canary_smoke.py(新規):
  invocation-private な PreToolUse deny hook(tempfile scoped、
  .agents/hooks.json 等の repo-global/user-global 設定は一切変更しない)で
  AGY 失敗を注入し、11 個の evidence signal の strict conjunction
  (verification_route self-report 単独では不十分)+ 実際の causal
  ordering(co-presence だけでは不可)で PASS/FAIL/SKIP を判定する。
  count_direct_web_tool_events / classify_claude_child_spawn_agent_id /
  classify_claude_child_completion は run_worktree_agent_runtime_smoke.py
  から import して再利用し、再実装しない。exit code は 0=PASS/1=FAIL/
  77=SKIP。
- scripts/agent-ops/tests/test_web_researcher_fallback_canary_smoke.py
  (新規): AC3(11 signal 個別欠落で FAIL、parametrized)、AC4(causal
  ordering の co-presence-but-out-of-order 検出)、AC5(exit code
  契約 0/1/77、SKIP≠PASS)、AC2(invocation-private hook の hygiene・
  .agents/hooks.json 非参照)を fixture ベースで検証する。

既存 run_agent_provider_route_smoke.py / run_worktree_agent_runtime_smoke.py
は変更なし(fallback-disabled 既定挙動を維持)。本 canary は CI の
required status check に追加していない(scheduled/明示手動実行のみ)。

AC9(live trial)は本リポジトリの実行環境で live AGY 資格情報が確認できな
かったため deferred/SKIP として正直に記録する(PASS の捏造はしない)。

Co-Authored-By: Claude Sonnet 5 <[email protected]>
@github-actions

github-actions Bot commented Aug 14, 2026 •

Copy link
Copy Markdown
Contributor

Preview URL

Preview removed (PR #2169 closed).

squne121 and others added 2 commits August 14, 2026 22:12
…理する (#2166)

- AGY forced-failure injection を実行可能な substitute `agy` バイナリ
  (PATH/AGY_BIN override スコープ、tempdir + atexit で cleanup 保証) に整理し、
  agy_permission_policy.py の AGY_DIRECT_TOOL_NAMES から確認した
  search_web/read_url_content を対象にする。
- PASS predicate (11 signal conjunction) / causal ordering (co-presence
  ではなく実際の順序を要求) / exit code contract (0/1/77) / retry policy
  (#2013 methodology reuse) を純粋関数として再構成し、AC3/AC4/AC5 の
  fixture テストを拡充した (34 tests pass)。
- per-trial evidence の companion schema
  (web_researcher_fallback_canary_smoke_trial_evidence/v1) を新設し、
  既存 agent_provider_route_smoke_v1 スキーマは変更しない (AC8)。

pnpm typecheck/lint/build と gemini-cli-headless-delegation の
test_model_routing.py はいずれも PASS 済み。

Co-Authored-By: Claude Sonnet 5 <[email protected]>
@squne121
squne121 marked this pull request as ready for review August 14, 2026 13:29
@squne121
squne121 merged commit 52a536b into main Aug 14, 2026
83 of 94 checks passed
@squne121
squne121 deleted the worktree-issue-2166-web-researcher-fallback-canary branch August 14, 2026 13:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

実装: web-researcher AGY→native fallback controlled live canary を追加する

1 participant