Repository navigation
Open
Labels
agent/implementerAI implementer agentenhancementNew feature or requestphase/implementationImplementation phase
Description
Parent Issue
Machine-Readable Contract
contract_schema_version: v1
issue_kind: implementation
parent_issue: "#1833"
goal_ref: "Codex CLI Multi-Agent V2 移行における bounded nested delegation harness の確立(#1833)"
change_kind: mixedParent Goal Ref
- Goal: 導入: Codex CLI Multi-Agent V2 へ移行し、明示的な委譲グラフとbounded nested delegation harnessを導入する #1833 の bounded nested delegation harness を、Claude Code / Codex CLI で同一の policy として実装可能にする。
- Desired Destination: implementation-worker が必要な evidence domain に応じて bounded read-only investigation を選択し、検証済み結果だけを実装開始条件にする。
Current Validated Scope
- implementation-worker の Claude/Codex agent contract、implementation skill、parity checker、既存 parity/bridge test と runtime fixture を final V1 に揃える。
- 変更対象は本 Issue の exact Allowed Paths のみとし、runtime canary と親 rollup 同期は後続 Issue に分離する。
Remaining Parent Gaps
- 導入: Codex CLI Multi-Agent V2 へ移行し、明示的な委譲グラフとbounded nested delegation harnessを導入する #1833 の parent rollup/cardinality/dependency 同期は別 follow-up Issue で行う。
- 実装: Claude Code / Codex CLI の bounded read-only nested delegation canary を実行する #1842 は no-investigation / codebase-only / web-only / both-selected-sequential の native runtime canary を担う。
- investigation concurrency 2 の canary は 実装: Claude Code / Codex CLI の implementation-worker に bounded read-only delegation parity を追加する #1943 の完了条件に含めず、別の follow-up Issue で扱う。
Outcome
Claude Code と Codex CLI の implementation-worker が、normal implementation path において必要な evidence domain に応じ、codebase-investigator と web-researcher を合計 0〜2 体(各型最大 1、同時実行最大 1)まで順次選択でき、選択した全調査結果を検証してから実装へ進む。
In Scope
.codex/agents/implementation-worker.tomlと.claude/agents/implementation-worker.mdに final V1 policy を同じ意味で記述する。.claude/skills/implement-issue/SKILL.mdに、snapshot validation 後かつ最初の tracked content mutation 前に実行する Investigation Gate を定義する。- policy producer/consumer の Claude/Codex parity、fixture、bridge contract、hook/config checker を実際に必要な最小変更で同期する。
test-runnerを investigation 件数に数えない一方、active investigation と重複させない制約を consumer behavior に反映する。
Out of Scope
- repair/recovery path への investigation policy 適用、agent role の追加、permission/profile/hook の拡張。
- 導入: Codex CLI Multi-Agent V2 へ移行し、明示的な委譲グラフとbounded nested delegation harnessを導入する #1833、実装: Claude Code / Codex CLI の bounded read-only nested delegation canary を実行する #1842、実装: Claude Code / Codex CLI の implementation-worker に bounded read-only delegation parity を追加する #1943 の本文を一つの mutation で同時更新すること。
- native launch/join canary、並行 investigation concurrency 2、simulation/mock/self-report だけによる runtime PASS。
Investigation Gate
- live Issue binding、contract snapshot、canonical worktree/branch、tested base/head SHA を検証する。
- 必要な evidence domain がなければ 0 体を選択し、暗黙の investigation は起動しない。
- codebase domain と web domain が必要な場合だけ、それぞれ最大 1 体を選び、必ず順次実行する(同時 active investigation は最大 1)。
- 各 selected result が terminal、schema-valid、current issue snapshot relevant であり、相互に矛盾しないことを確認するまで
implementation_go=falseとする。 - この gate を通過後にのみ最初の Allowed Paths 内 tracked content mutation を開始する。test-runner は investigation 件数に含めないが、active investigation との重複は不可とする。
Final V1 Policy
- allowed agent types:
codebase-investigator、web-researcher - selected investigation agents: 0〜2
- max instances per agent type: 1
- max concurrent investigation agents: 1
- both domains selected: sequential execution
- selection basis: required evidence domain
- implementation start: selected 全結果の terminal / schema-valid / snapshot relevance / conflict check 成功後
- concurrency 2: 本 Issue の範囲外。native runtime canary により別 Issue でのみ検討する。
Acceptance Criteria
- AC1: 0、1、2 agent selection を machine-readable policy で表現し、各型の重複選択を拒否する。
- AC2: 同時 active investigation が 2 以上となる request を拒否し、both-selected は順次順序を記録する。
- AC3: selected result の missing / unknown field / malformed schema / non-terminal / stale snapshot / irrelevant / conflicting conclusion を implementation start 前に拒否する。
- AC4:
codebase-investigatorとweb-researcher以外の investigation agent、write-capable investigation、暗黙起動を拒否する。 - AC5: test-runner は investigation 数に含めず、active investigation 中の重複実行を拒否する。
- AC6: Claude/Codex parity、fixture、checker、agent inventory と launch/permission consumer が final V1 の同一意味を検証する。
- AC7: implementation skill consumer が Investigation Gate の位置と implementation_go 条件を保持する。
- AC8: fixed base/head SHA に束縛した Allowed Paths gate が symbolic
mainではなく snapshot の full SHA を使用する。 - AC9: static/schema/contract verification は本 Issue で実施し、native runtime canary の deferred dependency を 実装: Claude Code / Codex CLI の bounded read-only nested delegation canary を実行する #1842 に記録する。
- AC10: negative tests が same-type duplicate、concurrency >1、順序違反、stale result、missing/unknown/malformed field を扱う。
Runtime Verification Applicability
- decision: deferred
- reason: 本 Issue は policy/consumer の static・schema・contract verification を実装する。native spawn/join を含む runtime behavior は、複数選択の実行 matrix が揃う 実装: Claude Code / Codex CLI の bounded read-only nested delegation canary を実行する #1842 でのみ検証可能である。
- deferred_destination:
- destination_type: issue
- destination_ref: "実装: Claude Code / Codex CLI の bounded read-only nested delegation canary を実行する #1842"
- deferred_verification_condition: 実装: Claude Code / Codex CLI の bounded read-only nested delegation canary を実行する #1842 が no-investigation、codebase-only、web-only、both-selected-sequential を native runtime で実行し、fixed base/head SHA、attempt evidence、実際に起動した agent 名、順序、同時実行数、success/failure criteria を保存する。simulation、mocked spawn、self-reported success は PASS evidence としない。
Verification Commands
# AC1
# baseline-expect: fail
$ rg -n "max concurrent investigation agents: 1" .codex/agents/implementation-worker.toml
# AC2
# baseline-expect: fail
$ rg -n "順次" .claude/agents/implementation-worker.md
# AC3
# baseline-expect: fail
$ rg -n "schema-valid" .claude/skills/implement-issue/SKILL.md
# AC4
# baseline-expect: fail
$ rg -n "write-capable investigation" .claude/agents/implementation-worker.md
# AC5
# baseline-expect: fail
$ rg -n "active investigation" .claude/agents/implementation-worker.md
# AC6
# baseline-expect: pass
$ uv run pytest tests/test_agent_parity.py
# AC7
# baseline-expect: fail
$ rg -n "Investigation Gate" .claude/skills/implement-issue/SKILL.md
# AC8
# baseline-expect: fail
$ rg -n "fixed base/head SHA" .claude/skills/implement-issue/SKILL.md
# AC9
# baseline-expect: pass
$ test -f docs/dev/runtime-verification-policy.md
# AC10
# baseline-expect: pass
$ uv run pytest tests/test_codex_agent_bridge_contract.pyImplementation/PR review の Allowed Paths gate は、contract snapshot に保存された full base SHA と reviewed full head SHA を baseline_vc_preflight.py --mode current-head および canonical allowed_paths_review_gate.py に渡して再計算する。symbolic main を base evidence に用いない。
Allowed Paths
.codex/agents/implementation-worker.toml.claude/agents/implementation-worker.md.claude/skills/implement-issue/SKILL.mdscripts/check_claude_codex_agent_parity.pytests/test_agent_parity.pytests/test_codex_agent_bridge_contract.pytests/fixtures/codex-agent-config/expected-runtime-contract.jsonscripts/check-codex-agents.mjs
Stop Conditions
- Allowed Paths 外の変更が必要と判明した場合。
- In Scope の固定契約(キー集合・スキーマ・型定義)の変更が必要になった場合。
- 新規 Issue の起票が必要と判断した場合(スコープ分割が発生する場合)。
- 後続 Phase / 別スコープへの波及が判明した場合。
- nested SubAgent delegation が必要になった場合。
- 外部サービス利用・権限昇格・既存テスト大規模改変が必要になった場合。
- secret/credential exposure、external paid service、destructive operation、または permission boundary 拡張が必要な場合。
- trusted OWNER directives が実質的に矛盾し、機械的優先順位で解消できない場合。
- GitHub controlled mutation authorization が拒否され、許可済み代替経路がない場合。
Required Skills
issue-contract-reviewimplement-issuepr-review-judge
Required Design References
.codex/agents/implementation-worker.toml.claude/agents/implementation-worker.md.claude/skills/implement-issue/SKILL.mdscripts/check_claude_codex_agent_parity.pytests/fixtures/codex-agent-config/expected-runtime-contract.jsondocs/dev/runtime-verification-policy.mddocs/dev/schema-governance.md
Scope Delta
- base SHA at refinement:
cf765aa093d19b2b36f6aa75bb918b783260a30d - new Allowed Path delta:
.claude/skills/implement-issue/SKILL.md - 導入: Codex CLI Multi-Agent V2 へ移行し、明示的な委譲グラフとbounded nested delegation harnessを導入する #1833 parent rollup、実装: Claude Code / Codex CLI の bounded read-only nested delegation canary を実行する #1842 runtime matrix、concurrency-2 canary は separate follow-up に分離する。
Notes for Reviewer
- Semantic OWNER directive: 実装: Claude Code / Codex CLI の implementation-worker に bounded read-only delegation parity を追加する #1943 (comment)
- Correction: 実装: Claude Code / Codex CLI の implementation-worker に bounded read-only delegation parity を追加する #1943 (comment)
- この Issue の controlled rewrite は direct interactive human instruction を provenance 付きで materialize した authority に基づく。authority marker は implementation go を与えず、fresh contract review、refinement preflight、Allowed Paths gate、final reviewer を省略しない。
Metadata
Metadata
Assignees
Labels
agent/implementerAI implementer agentenhancementNew feature or requestphase/implementationImplementation phase
Activity
squne121 commentedon Aug 2, 2026
「codebase-investigator または web-researcher のどちらか一体へ」と書かれているが両方必要なら同時に2体調査させられてもよいのでは?
squne121 commentedon Aug 2, 2026
総合判定
REQUEST_CHANGES。
指定コメントの問題提起は正しいです。
codebase-investigatorとweb-researcherは担当する evidence domain が異なるため、両方が必要な Issue では二体を選択し、独立調査なら並行実行できる設計が合理的です。親 #1833 が固定しているのは「bounded read-only delegation」であり、「必ず一体だけ」という制約ではありません。#1943 の最大1件・両方禁止は、親契約から導かれない過剰制約です。ただし、単純に
max=1をmax=2に変更して終わりでは不十分です。0〜2体の bounded fan-out、同一 role の重複禁止、全選択 child の completion barrier、部分失敗時の fail-closed、test-runner との非重複、dual-runtime canaryまで契約化する必要があります。Blocking concerns
P0-1:
Runtime Verification Applicability欠落により、現行 worker は実装開始できない#1943 の本文には
## Runtime Verification Applicabilityがありません。一方、現行
implement-issueは同セクションがない場合、「推測で進めずstatus: blockedを返す」と明記しています。したがって現在の Issue は、単一委譲か二体委譲か以前に fail-closed します。#1943 には次を追加すべきです。
P0-2: 「最大一体」は根拠がなく、実際の責務分割にも反する
codebase-investigatorは repository・Git・コード依存の調査、web-researcherは外部仕様・最新ドキュメント・公開APIの検証を担当しています。両者は代替関係ではなく直交関係です。#1842 自身も両 agent の non-mutation リスクを別 AC に分離しています。それにもかかわらず #1943 が「一方だけ」に固定するのは不整合です。
Claude Code の現行公式仕様も、独立した調査では複数 subagent の並行実行を一般的なパターンとして明示しています。nested subagent も現行版では標準でサポートされています。(Claude)
妥当な上限は次です。
codebase-investigatorは最大一体web-researcherは最大一体P0-3: #1842 が dual-child 動作を一切検証しない
現在の #1842 は各 runtime について、次の三 session を別々に実行する設計です。
二体を同時に選択する session はありません。したがって #1943 だけを二体対応にすると、最も故障しやすい経路が未検証になります。
#1842 に各 runtime 一件ずつ、次の session を追加する必要があります。
静的 config が二体分の slot を持つことは runtime 成功の証明ではありません。PR #1879 も live nested capability を #1842 に明示的に defer しています。
P1-1: Codex の thread 上限をちょうど使い切り、test-runner と競合する
current main は
max_concurrent_threads_per_session = 4です。Codex Multi-Agent V2 の実装は、この値を root を含む同時 active agent 数としてモデルに提示しています。したがって、
で上限を完全に使い切ります。([GitHub]2)
#1943 の AC9 は test-runner を「調査一件枠には数えない」としていますが、論理上の調査枠に数えないことと、runtime concurrency slot を消費しないことは別です。
必須制約は次です。
二体調査中に test-runner や別 child を起動すれば五 thread となり、current config では成立しません。
P1-2: Claude の child type allowlist は実効的に強制できない
Claude Code では、main-thread agent に対する
Agent(worker, researcher)は allowlist として機能します。しかし nested subagent 定義内では括弧内 type list が無視され、単なる unrestrictedAgenttool になります。([Claude]1)したがって
.claude/agents/implementation-worker.mdにAgentを追加すると、behavioral contract 上は二 role 限定でも、runtime tool surface 上は他の agent type も起動可能です。#1943 が security boundary と主張しない方針自体は正しいですが、AC5 の「厳密に二者」という表現は enforcement と declaration を区別すべきです。次の二層に直すべきです。
後者も security proof ではなく observed behavior に限定します。
P1-3:
before first writeは現行実装手順と矛盾するimplement-issueは tracked file の編集前に worktree・branch を作成します。この bootstrap は filesystem と Git metadata を変更するため、文字どおりの「初回 write 前」は成立しません。正確な境界は次です。
また、現在の worker は
implement-issueSkill を procedure SSOT として使用する契約ですが、#1943 の Allowed Paths には同 Skill が含まれていません。agent prompt に能力だけ追加しても、いつ選択・起動するかが canonical procedure に存在しません。.claude/skills/implement-issue/SKILL.mdを Allowed Paths に加え、worktree binding 後・TDD 前に小さなInvestigation Gateを設けるべきです。P1-4: grep と自由記述では parity を証明できない
#1943 の VC は主として特定の日本語文字列を
rgするだけです。現行 parity checker も Codex の delegation prose を advisory hint として扱い、strict failure authority にはしていません。テストでもその挙動を明示的に固定しています。
日本語文章の存在確認ではなく、closed-key の正規化契約が必要です。
少なくとも unknown key、型不正、三体目、同一 role 重複、write-capable child、片方未完了、部分失敗、test-runner overlap の negative test が必要です。
P1-5: Claude Code の環境変数に関する Notes が事実誤認
#1943 は
CLAUDE_CODE_MAX_SUBAGENTS_PER_SESSIONを「存在しない変数」と記載しています。現行公式仕様では、以下の三つが別々に存在します。
CLAUDE_CODE_MAX_SUBAGENT_SPAWN_DEPTHCLAUDE_CODE_MAX_SUBAGENTS_PER_SESSIONCLAUDE_CODE_MAX_CONCURRENT_SUBAGENTS現在の既定値は、対応バージョンではそれぞれ depth 3、session total 200、concurrent 20 です。([Claude]1)
Notes は、バージョン条件付きで修正する必要があります。#1842 の evidence に実インストール版と effective override を記録する方針が妥当です。
P1-6: 二体選択時の部分失敗と結果衝突が未定義
これは本文から導かれる未定義 failure mode です。
両方を「必要」と判断して起動したにもかかわらず、一方が
failedまたはinconclusiveのとき、もう一方だけで実装を続けてはいけません。また、repository evidence と外部仕様 evidence が矛盾した場合も、worker が都合のよい方を選んではいけません。Non-blocking concerns
P2-1: 「read-only」の定義を filesystem write 不在にしてはいけない
Claude の
codebase-investigatorは/tmpに request/result を書きます。また親 worker のpermissionMode: acceptEditsは、公式仕様上 child のdontAskより優先されます。 ([Claude]1)したがって read-only の意味は次に限定すべきです。
tmp artifact の生成まで禁止すると現行 agent が動作しません。
P2-2: #1886 の AGY route と二体並行実行の相互作用
#1886 は両 researcher の required route を AGY に統一する予定です。二体並行起動では同一 provider の認証、rate limit、外部実行 capacity を同時消費します。
これは blanket な並行禁止理由にはなりませんが、#1842 の dual canary では provider failure と native spawn failure を別の failure class に分ける必要があります。
P2-3:
.codex/config.tomlの capacity コメントが staleconfig コメントはいまだ
implementation-designerを expected peak に含めていますが、同 role は not planned です。#1943 の scope 外でも構いませんが、thread budget を説明する文書として誤解を招くため、別の小さな修正対象です。
必須検証
#1943 の static tests では、構造化 policy の正規化、Claude/Codex の同値性、unknown key rejection、同一 role 重複、三体目、write-capable child、部分失敗、test-runner overlap を検証します。
#1842 の runtime tests では、各 runtime について次の四 session が最低限必要です。
四番目では、二つの spawn request の時間的重複、requested/effective role、同一 Issue・worktree・HEAD binding、両 terminal result の消費、worker の post-join continuation、tracked-content/Git/GitHub non-mutation を一次 evidence から検証します。逐次二回起動を「並行成功」と扱ってはいけません。
推奨修正
#1943 の方針は、次のように変更するのが妥当です。
つまり、指定コメントへの回答は **「賛成。ただし常時二体ではなく、必要な evidence domain に応じた 0〜2体の bounded fan-out とし、dual-child canary・all-result barrier・thread budget を同時に追加する」**です。
未確認事項
これらは static prose で解決せず、#1842 の runtime evidence で反証可能に判定すべき事項です。
squne121 commentedon Aug 2, 2026
issue-refinement-loop 終了報告(human_judgment_required)
anchor comment: #1943 (comment)
check_issue_contract.py+contract_readiness_check.py --mode executeを決定論的に実行した結果、compact_review_result.pyの正規 envelope(validator でvalidation_status: validを確認済み)がNEXT_ACTION: human_judgment_requiredを返したため、本 iteration では Issue 本文の自動書き換えを行わず、ここで停止します。1. 決定論チェックで検出されたブロッカー(body_sha256:
e17b47fa482197c81061098c792d77d00b5eba75bf8bd9cec4f396d31a6246b3)## Runtime Verification Applicabilityセクションが本文にない(OWNER anchor comment の P0-1 指摘と一致)。## Required Design Referencesが実質空(既存のAllowed Pathsと同じ bare path の再掲のみで、design doc への参照になっていない)。# baseline-expect: pass注記が必要。uv run --locked python3 scripts/check_claude_codex_agent_parity.py --strictが VC preflight allowlist(uv run pytest系のみ許可)に含まれない。uv run --locked pytest tests/test_agent_parity.py tests/test_codex_agent_bridge_contract.pyが 本 Issue と無関係に main 上で既に 6 件失敗していることを実行確認済み。NESTED_DELEGATION_001drift 検出がSTATUS: okを返しwarn/failを返さないという既存不具合であり、実装: Claude Code / Codex CLI の implementation-worker に bounded read-only delegation parity を追加する #1943 の変更内容とは無関係です。Issue 本文の書き換えでは解消できない環境状態であるため、本ループはcontract_readiness_human_judgmentとして fail-closed しました。2. anchor comment(OWNER REQUEST_CHANGES)が要求する未反映のスコープ変更
上記の contract formality blocker とは別に、OWNER の REQUEST_CHANGES 自体がまだ本文へ全く反映されていません。主な要求:
codebase-investigator最大1・web-researcher最大1、両 evidence domain 必要時のみ2体、独立調査なら並行実行許可)への変更(P0-2)。現行本文の「最大1件・両方同時起動禁止」を置き換える提案。READONLY_DELEGATION_POLICYを closed-key 正規化 YAML 契約(mode/allowed_agent_types/max_selected_agents/max_instances_per_agent_type/parallel_allowed/completion_barrier/partial_failure_policy/conflicting_results_policy/test_runner_counts_toward_investigation_limit等)へ書き換える提案(P1-4)。max_concurrent_threads_per_session = 4(.codex/config.toml:35で確認済み)に対する thread budget 制約の追記(P1-1)。implement-issueの worktree/branch bootstrap との整合)、.claude/skills/implement-issue/SKILL.mdの Allowed Paths 追加提案(P1-3)。CLAUDE_CODE_MAX_SUBAGENTS_PER_SESSION等 3環境変数についての Notes 記述の事実誤認訂正(P1-5)。これらは Issue の意味・スコープに関わる実質的な変更であり、
check_issue_contract.pyの decision surface(C1〜C13)が検出する contract formality の問題とは別に、人間による方針確認が必要と判断しました。3. 推奨される次のアクション(人間判断待ち)
NESTED_DELEGATION_001drift 検出の既存不具合(6 test failures)を独立 Issue として扱うか、実装: Claude Code / Codex CLI の implementation-worker に bounded read-only delegation parity を追加する #1943 の AC13 側で明示的にスコープ外として扱うかを決定する。上記の人間判断が得られた後、本 refinement loop を再実行して Issue 本文の書き換えへ進めます。
squne121 commentedon Aug 2, 2026
追記: AC13 regression gate 失敗の根本原因を特定し follow-up を起票
前回の終了報告で触れた AC13 の regression gate 失敗(
tests/test_agent_parity.py6件 FAIL)について、原因コミットを特定しました。af511e17(PR feat(codex): enable multi-agent v2 config #1879「feat(codex): enable multi-agent v2 config」)scripts/check_claude_codex_agent_parity.pyからrule_id="NESTED_DELEGATION_001"を発行する strict drift 判定ブロックが削除され、delegation_intent_hint(advisory-only)に置き換わったが、tests/test_agent_parity.py側の該当 6 テストが追従していない。docs/dev/workflow.mdの「Multi-Agent V2 の V1 rollback」節から、advisory-only 化は意図的な設計判断と判断できる。実装: Claude Code / Codex CLI の implementation-worker に bounded read-only delegation parity を追加する #1943 の変更内容とは無関係の既存不具合であり、本文書き換えでは解決できない。この不具合を追跡する follow-up Issue を起票しました: #1948
#1943 は #1948(テスト追従修正)の完了を待つ hard blocker 関係にあります。#1948 がマージされ AC13 の regression gate が green になった後、本 refinement loop を再実行してください。
fix(create-issue): live canary の disposable Issue body を validate_iss…
fix(create-issue): create_issue_txn.py の hard predecessor 起票時の depend…
fix(tests): PR #1959 REQUEST_CHANGES に対応し advisory-only delegation 契約を強化
fix(tests): test_agent_parity.py を NESTED_DELEGATION_001 の advisory-o…
squne121 commentedon Aug 9, 2026
総合判定
REQUEST_CHANGES。現状の Issue 契約では実装着手不可です。
主因は、最新の OWNER
REQUEST_CHANGESが本文へ materialize されていないこと、Runtime Verification Applicabilityが欠落していること、親 #1833・本 Issue #1943・後続 #1842 の dependency/cardinality 契約が一致していないことです。現行implement-issueは Runtime Verification セクション欠落時に推測で進まず、明示的にblockedで停止するため、現在の本文は consumer-ready contract ではありません。一方、過去の blocker だった parity テストの既存赤は、Issue #1948 と merged PR #1959 により解消済みです。したがって現在は「#1948 待ち」ではなく、最新 main を基準に #1943 自体を再 refinement する段階です。
Blocking findings
P0-1: 親子 dependency graph が破綻している
#1943 は
parent_issue: #1833を宣言し、自身を #1842 の hard predecessor としています。しかし親 #1833 の Child Issues と Dependency Order には #1943 が存在せず、依然として#1841 → #1842が正規 chain です。さらに親本文は canary 対象をcodebase-investigatorのみに固定したままですが、#1842 は後からweb-researcherも対象へ追加しています。現在は次の三つが同時に成立しています。
implementation-worker -> codebase-investigatorcodebase-investigatorまたはweb-researcherの最大一体これは一つの delegation contract ではありません。少なくとも親 #1833 の Child Issues、Dependency Order、Current Validated Scope、AC2 と、#1842 の dependency/session matrix を #1943 の最終設計へ同期する必要があります。
P0-2: 「何体を選ぶか」と「何体を同時実行するか」が混同されている
既存レビューは
max=1から直ちに「0~2体、必要なら並行」へ変更するよう求めていますが、これは selection cardinality と concurrency cardinality の混同です。親 #1833 が要求しているのは bounded delegation であり、最大一体も最大二体も直接は導きません。Claude Code 公式ドキュメントも、独立した調査の並行実行を有用なパターンとして示しているだけで、並行実行を correctness requirement にはしていません。 (Claude)
Codex Multi-Agent V2 は現在、既定の同時 active agent 数を4とし、その数には root 自身も含まれます。リポジトリの PR #1879 も同じ4スロット契約を導入しています。したがって二調査 agent を並行起動すると、
root + implementation-worker + codebase-investigator + web-researcher = 4となり、test-runner や障害切り分け用 child の余地がなくなります。([GitHub]2)推奨する V1 は次です。
これなら両 evidence domain を欠落させず、Codex の4スロットを飽和させず、並行 partial-failure/join barrier/結果競合の複雑性も初期導入から分離できます。現在の
max_selected_agents=1を維持する場合は、「両 domain が必要なら実装前に block する」という明示的な制約が必要です。P0-3:
READONLY_DELEGATION_POLICYは実質的な新規 schema だが、consumer inventory がない#1943 は単なる説明文追加ではなく、Claude/Codex の policy を正規化し、parity checker と JSON fixture で比較することを要求しています。producer と consumer の境界を越えて parse/validate/compare されるため、リポジトリの schema governance 上は machine-readable contract です。
特に
tests/fixtures/codex-agent-config/expected-runtime-contract.jsonは、既にimplementation-workerを含む runtime contract fixture であり、scripts/check_codex_agent_config.pyなど複数 consumer から読み取られています。agent inventory や launch-ledger 系 consumer も同じ fixture を参照しています。しかし現在の Allowed Paths には、少なくとも以下がありません。
docs/dev/schema-governance.mdscripts/check_codex_agent_config.py全 consumer の変更が必須とは限りません。additive field を安全に無視できる consumer もあります。しかし、安全に無視できることを inventory と regression test で示していないのが問題です。PR #1879 から
tests/test_agent_parity.pyが consumer inventory 漏れしたことが、Issue #1948 発生の直接原因でした。同じ事故を同じ parity surface で繰り返す設計になっています。また親 #1833 は graph policy、専用 checker、別名 schema 群を Out of Scope にしています。新 policy は次のように明示的に分類すべきです。
この分類を親本文にも反映しない限り、子 Issue が親の Out of Scope に接触します。
P0-4: agent 定義に能力を追加しても、正規手順に起動地点が存在しない
Claude/Codex の両
implementation-workerはimplement-issueSkill を procedure SSOT としています。Claude worker は通常実装 V1 と PR repair V2 の二 dispatch mode を持ち、Codex worker はIMPLEMENT_RESULT_V1の通常実装だけを公開しています。一方、現行
implement-issueの手順は次の順序です。この間に Investigation Gate は存在しません。#1943 の Allowed Paths に Skill 自体も含まれていません。
そのため現行案は、「Agent tool は持つが、canonical procedure のどこで、何を根拠に、どの agent を選択するかが未定義」という半実装になります。
必要なのは
.claude/skills/implement-issue/SKILL.mdに次の gate を追加することです。加えて policy の適用 mode は
normal_implementation_v1に限定すべきです。Claude 側のupdate_pr_body_hygiene、update_branch、apply_pr_review_fix_deltaにまで暗黙適用すると、Codex に存在しない PR repair surface を parity 対象へ巻き込みます。P0-5: 現行 parity checker に
implementation-workerをそのまま追加すると false PASS が起こり得る現行 checker の output-schema 抽出は限定的な正規表現です。
emit ... via、特定形式の fenced YAMLemit ... viaまたは_COMPACT_V*記述Claude worker は
IMPLEMENT_RESULT_V1とIMPLEMENTATION_WORKER_RESULT_V2の二 mode を持ちますが、Codex worker は V1-only です。それにもかかわらず現在の文面では、両ファイルの schema 抽出結果がともにNoneとなり、None == Noneで既知の非対称を見逃す可能性があります。したがって
implementation-workerを whole-agent parity 対象へ直接追加してはいけません。次のどちらかが必要です。readonly_delegation_policyという dimension-specific comparator を追加し、その dimension だけ strict 比較する。PR #1959 も、従来の prose heuristic は advisory-only だが、#1943 の将来の正規化 policy まで advisory にするものではない、と意図的に範囲を限定しています。新 policy は既存
delegation_intent_hintに混ぜず、別の strict contract として扱うべきです。P0-6: Verification Commands が prose の存在しか検証していない
AC5~AC11 は「両ファイルに契約が存在する」ことを要求していますが、対応 VC の大半は
.claude/agents/implementation-worker.mdだけをrgしています。Codex 側との同値性、キー集合、型、cardinality、failure policy は検証されません。AC14 も移動するorigin/mainを比較対象としており、空 diff なら無条件に PASS します。最低限、次の negative test が必要です。
max_selected_agentsまたはmax_concurrent_investigation_agents超過また changed-path gate は、PR 作成時に固定した
base_sha...head_shaに対して Allowed Paths の集合包含を検証すべきです。origin/mainの現在値を使う検証では race を閉じられません。P0-7: runtime を #1842 に defer しても、現在の #1842 は実行可能な canary contract になっていない
#1842 は Runtime Verification を
immediateとしていますが、VC は実質的にcodex --version、claude --version、git status、git diffです。これらは次を検証しません。さらに #1842 の Stop Conditions には、Issue 自体が実施しなければならない nested delegation を「必要になったら停止する」という template residue が残っています。session matrix も no-investigation/codebase-only/web-only の三つだけで、同一 worker が両 result を順次消費する経路を検証しません。
推奨 V1 に合わせ、各 runtime に次を追加すべきです。
証跡は native session JSONL または一次 runtime event を parser で抽出し、version、tested SHA、requested/effective role、start/terminal event、result digest、parent continuation marker、前後の repo/index/ref 状態を記録する必要があります。取得不能なら exit 77/environment blocker であり、fixture や agent の自己申告で代替してはいけません。
「最初の tracked write より前」を実証するには、実リポジトリを汚さない disposable fixture repository/isolated worktree で、join 後に制御された mutation を行う canary が必要です。最後まで一度も write-capable action を発生させない session では、順序制約を証明できません。
外部仕様との不整合
Claude Code の上限に関する既存レビューの P1-5 は誤り
現在の公式ドキュメントで subagent 利用を制御する上限は次の二系統です。
CLAUDE_CODE_MAX_SUBAGENT_SPAWN_DEPTHCLAUDE_CODE_MAX_CONCURRENT_SUBAGENTS現行既定は深さ3層、同時実行20体で、session 全体の総 spawn 数には上限がないと明記されています。既存レビューが記載した
CLAUDE_CODE_MAX_SUBAGENTS_PER_SESSIONと session-total 200 は現行仕様に存在しません。したがって、この点は現在の #1943 本文の Notes の方が正しく、REQUEST_CHANGES コメントをそのまま正本化してはいけません。([Claude]1)ただし既定深さは過去バージョンで変化しているため、#1842 は
claude --versionと effective depth/concurrency override を必ず記録すべきです。(Claude)Claude の agent-type 制約は宣言であり enforcement ではない
Agent(codebase-investigator, web-researcher)の括弧内 type list は、agent が main thread としてclaude --agentで動く場合にだけ allowlist になります。nested subagent 定義内では type list が無視され、Agenttool 自体が許可されるだけです。したがって AC5 の「厳密に二者」はdeclared_allowed_agent_typesに改称すべきです。([Claude]1)また Claude worker は
permissionMode: acceptEditsです。公式仕様では親のacceptEditsが child frontmatter の permission mode より優先されるため、child のdontAskや read-only prose を書込み防止の security boundary として扱えません。 ([Claude]1)read-only と result consumption の定義が不足している
codebase-investigatorは AGY request/result を/tmpに書き出します。したがって read-only を「filesystem write が一切ない」と定義すると、現行 agent contract と矛盾します。妥当な境界は次です。
web-researcherは filesystem read-only profile を持ちますが、自身の契約でも GitHub API の GET/POST を分離する remote-readonly security boundary ではないと認めています。そのため runtime evidence から主張できるのは「観測した invocation で mutation event がなかった」までです。さらに child output は同型ではありません。
codebase-investigator:CODEBASE_INVESTIGATION_RESULT_V1web-researcher:WEB_RESEARCH_RESULT_V1両者は AGY-only route を使いますが、入力不足、provider failure、grounding failure、inconclusive などの failure semantics が異なります。worker は単に「terminal result を消費する」のではなく、agent type ごとの expected schema、terminal success、evidence completeness を検証し、非成功または設計判断に影響する結果競合があれば tracked mutation 前に停止する必要があります。
また二つの evidence domain は論理的には異なりますが、どちらも AGY provider route に依存しています。二体失敗時には、native child spawn failure と AGY auth/capability/grounding/transport failure を別 failure class として記録すべきです。
推奨する V1 契約
並行二体を後続で導入する場合は、
max_concurrent_investigation_agents: 2だけを安易に変えるのではなく、#1842 に parallel dual-session、全 child completion barrier、partial-failure、result conflict、test-runner non-overlap、Codex slot exhaustion の runtime test を追加する必要があります。追加すべき Runtime Verification セクション
Approve 条件
Runtime Verification Applicability: deferredを 実装: Claude Code / Codex CLI の implementation-worker に bounded read-only delegation parity を追加する #1943 に追加し、実装: Claude Code / Codex CLI の bounded read-only nested delegation canary を実行する #1842 を実行可能な canary contract に修正する。implement-issueに Investigation Gate を追加し、Claude の V2 PR repair mode を policy 対象外に固定する。CLAUDE_CODE_MAX_SUBAGENTS_PER_SESSION/session-total 200 の誤情報は採用しない。squne121 commentedon Aug 9, 2026
issue-refinement-loop: human_escalation
warn / proceed_with_notes(planner_fail_closed: false)valid、VERDICT: needs-fix、reviewed body SHA:sha256:e17b47fa482197c81061098c792d77d00b5eba75bf8bd9cec4f396d31a6246b3Blockers
## Runtime Verification Applicabilityがなく、決定論的レビューが C9 blocker を返した。0〜2の選択数、順次実行上限、追加 consumer/test surface を要求する。これは現行 実装: Claude Code / Codex CLI の implementation-worker に bounded read-only delegation parity を追加する #1943 の In Scope / Allowed Paths を実質的に拡張する。no_anchor_scope_reframe_v1_payloadを返した。自由記述の REQUEST_CHANGES を、cross-issue mutation と Allowed Paths 拡張の確定指示として推測できない。uv run python3VC 正規化が必要と判定された。次に必要な OWNER 決定
#1943にANCHOR_SCOPE_REFRAME_V1を投稿し、最終 V1(選択数・同時実行数・順次/並行方針)、正確な Allowed Paths の差分、#1833 / #1842 の同期を本 Issue の mutation に含めるか別 Issue に分けるか、再実行対象を明示してください。受領後、fresh preflight から controlled rewrite・readback・再レビューを再開します。squne121 commentedon Aug 9, 2026
訂正: issue-refinement-loop termination report
直前の終了報告の Blocker 2 にある
#1833・#1942は誤記です。正しくは#1833・#1842・#1943の dependency/cardinality 同期です。それ以外の termination route、
human_judgment_required、およびANCHOR_SCOPE_REFRAME_V1を要する判断は変更ありません。squne121 commentedon Aug 9, 2026
結論
今回、人間に
ANCHOR_SCOPE_REFRAME_V1を手書きさせる必要はありません。#5229806061 には、少なくとも実装契約の主要な判断がすでに記載されています。
選択数は 0〜2
codebase-investigatorとweb-researcherはそれぞれ最大1体investigation agent の同時実行数は1
両方必要な場合は順次実行
選択した全調査結果を検証してから実装へ進む
並行2体は、別の runtime canary を通した後に検討する
したがって不足しているのは人間の判断ではなく、自然言語の OWNER 指示を、正確な Allowed Paths を含む型付き authority に変換する機械処理です。現行 #1943 本文は依然として「最大1体・どちらか一方」を前提としており、OWNER コメントと不整合です。
また、途中報告の「authority が router に接続されていない」という表現は断定が強すぎました。追加調査では、最終 router には
scope-signal-guard-decision-v2を受け取り、contract_update_requiredへ進む分岐が存在します。今回の記録だけでは、次のどこで途切れたかを特定できません。authority sidecar が生成されなかった
生成されたが最終 router に渡されなかった
cross-issue mutation または exact Allowed Paths 不足により classifier 自体が escalation を返した
終了報告に sidecar の
action、reason、入力ハッシュ、router への受渡し結果が出ていないためです。この観測可能性不足そのものが workflow defectです。あるべき authority workflow
現行設計にも、自由記述の OWNER directive を
SCOPE_DELTA_AUTHORITY_EVIDENCE_V1に正規化する互換経路と、対話中の人間指示を provenance 付きで materialize する経路があります。ANCHOR_SCOPE_REFRAME_V1は厳格な schema を持ちますが、人間がその内部形式を覚えて直接作ることを通常経路にすべきではありません。正常な設計は次です。
つまり、責任分界は次であるべきです。
人間の責任: 意図、目的、リスク許容度、実質的な選択
機械の責任: schema、正確な path、hash、provenance、再実行手順
人間へ戻す条件: 互いに矛盾する選択、破壊的変更、秘密情報、権限拡張など、意味論上の未決事項だけ
「schema がないから人間判断」という現在の終了理由は、この責任分界が逆転しています。
#1943 に対する推奨アクション
#1943 は、次の契約で controlled rewrite を再実行するのが妥当です。
項目 | 採用値 -- | -- 許可する調査 agent | codebase-investigator, web-researcher 選択数 | 0〜2 同型 agent 数 | 最大1 investigation 同時実行数 | 最大1 両方必要な場合 | 順次実行 選択基準 | 必要な evidence domain 実装開始条件 | 選択した全結果が terminal・valid・関連性確認済み test-runner | investigation 数には含めないが、active investigation とは重複させない 並行2体 | #1943 には含めず、別 runtime canary 後に検討現行 validator は、approve/needs-fix の9フィールド envelope を字句・順序・サイズ面で検証します。しかし
ARTIFACT:のパスを open、stat、schema validation、hash verification していません。したがって、B が正しく、C が存在しなくても validator 単体は通過し得ます。一方、B が空なら validator-first は成立せず、verdict を消費してはいけません。確定していること
別セッションの一文から確定できるのは、canonical compact stdout が親 orchestrator に渡らなかったことだけです。
確定できないこと
次は現存する証拠だけでは確定できません。
reviewer が semantic review を完了していたか
compactor が起動されたか
artifact 書込みだけが失敗したか
hook がコマンドを遮断したか
timeout、signal、process crash のどれだったか
stdout が生成されたが親側の capture で失われたか
現行 compactor は、schema 不正や artifact 書込み失敗などの処理可能な失敗時にも、5行の canonical producer-failure envelope を stdout に出す設計です。したがって完全な空出力であったなら、通常の compactor 内エラーよりも、次の可能性が強くなります。
compactor が呼び出される前に reviewer が終了した
hook または permission boundary が command を拒否した
timeout・signal・強制終了が発生した
親 orchestrator が child stdout を捕捉しなかった
reviewer が compactor stdout 以外の応答を返し、wrapper が破棄した
これは推論であり、exit code、stderr、signal、timeout、stdout length、実行 command がないため一つには絞れません。
過去の別事例では、未知の compact field を追加したことで validator が拒否したケースと、PreToolUse/local-main guard がレビュー関連 command を遮断したケースが存在します。ただし、これらは今回の直接原因を証明するものではなく、必要な failure taxonomy が不足していることを示す類例です。
成果物は必須か
反証的に分けると、次の結論になります。
compact stdout envelope は必須です。
validator-first の目的は、reviewer の自由文を直接信頼せず、制限された wire format のみを routing に使うことです。これを省くと、prompt injection、未知 field、field-order drift、oversized output、未検証 verdict を直接消費することになります。
完全な artifact JSON は、routing のためだけなら必須ではありません。
VERDICT、BLOCKERS、NEXT_ACTION、body SHA が compact envelope に収まれば、最小 routing は可能です。artifact をなくせば filesystem、permission、path traversal、stale file に由来する故障面を減らせます。しかし audit/replay のためには完全な artifact を残す価値があります。
2,048 byte の envelope だけでは、finding ごとの evidence、詳細な remediation、レビュー再現性、障害分析に不足します。したがって推奨は「artifact を廃止」ではなく、次です。
approve/needs-fix verdict では完全 artifact を必須にする
validator 後に親 orchestrator が artifact を検証する
regular file、expected root 内、symlink escape なしを確認する
JSON schema、reviewed body SHA、artifact SHA-256 を確認する
envelope に
ARTIFACT_SHA256とATTEMPT_IDを追加するproducer failure では、reviewer 自身の artifact に依存せず、親 wrapper が attempt ledger を必ず生成する
なお、producer の自己記述と field constant は8フィールドのままですが、実際の成功 envelope と validator は
REVIEWED_BODY_SHA256を含む9フィールドです。これが今回の空出力原因とは断定できませんが、契約ドリフトとして修正対象です。Claude Code / Codex CLI に渡す実行プロンプト
この応答環境からリポジトリ内の Codex multi-agent runtime を直接 spawn する手段はないため、ここで Spark を実行したとは主張しません。以下では
spark-deepを優先的に直接起動することを必須化しています。現行設定ではspark-deepはgpt-5.3-codex-spark/ high ですが、GitHub mutation、loop orchestration、最終 verdict、nested delegation は禁止されているため、調査・反証・inventory に限定します。再発防止 Issue 草案 1
Title
Problem
自然言語の信頼済み OWNER directive を正規化する機能と、
contract_update_requiredを処理する router は存在するが、live refinement route で authority sidecar の生成・受渡し・消費が十分に観測できない。その結果、実質的な判断がすでに存在しても、no_anchor_scope_reframe_v1_payloadを理由に人間へ内部 schema の手書きを要求する。Acceptance Criteria
trusted freeform OWNER directive から
SCOPE_DELTA_AUTHORITY_EVIDENCE_V1を生成する。exact path が抽出可能なら、手書き
ANCHOR_SCOPE_REFRAME_V1なしでcontract_update_requiredへ進む。exact path が repository inventory を必要とする場合、machine materializer が path delta を生成する。
generated payload に direct-interactive/freeform provenance、source comment ID、body hash、payload hash を付与する。
structured
ANCHOR_SCOPE_REFRAME_V1は最高優先度の override とする。曖昧・矛盾・破壊的・権限拡張 directive は引き続き fail-close する。
termination report に次を必須化する。
authority evidence generated
classifier action/reason
sidecar path/hash
router received/consumed
selected route
classifier 単体テストだけでなく、preflight → sidecar → final router → controlled rewrite の end-to-end test を追加する。
cross-issue directive は、single-target mutation と follow-up materialization に決定論的に分割できる。
人間へ要求するのは semantic ambiguity の解決だけとし、schema/path/hash の生成を要求しない。
再発防止 Issue 草案 2
Title
Problem
現在の validator-first は compact stdout の妥当性を検証するが、空出力・process failure・stdout capture failure・artifact failure の原因分類と自動復旧が不足している。また、
ARTIFACT:path は envelope に必須である一方、validator は file existence、schema、reviewed body SHA、content hash を検証しない。Acceptance Criteria
各 reviewer attempt について exit code、signal、timeout、stdout/stderr length/hash、command、hook denial を保存する。
failure class を最低限次に分離する。
reviewer_transport_empty_stdoutreviewer_transport_malformed_envelopereviewer_producer_failurereviewer_artifact_write_failurereviewer_artifact_integrity_failuretransport/producer/artifact failure は semantic
human_judgment_requiredに分類しない。same-instance clean retry と fresh-instance retry を bounded に実行する。
5.全 retry 失敗後は
environment_failureとし、semantic verdict を未確定のまま保持する。compact envelope V2 に
ATTEMPT_IDとARTIFACT_SHA256を追加する。親 orchestrator が artifact の実在、regular-file、root confinement、schema、issue number、body SHA、artifact SHA を検証する。
producer が起動しない場合でも、親 wrapper が attempt ledger と canonical failure record を必ず生成する。
compactor の docstring、field constant、producer、validator、tests を単一の9-field/V2 SSOTに統一する。
次の fault-injection tests を追加する。
empty stdout
process kill
timeout
hook rejection
permission denied
malformed/extra/missing field
output over wire limit
artifact missing
symlink escape
schema mismatch
body SHA mismatch
artifact hash mismatch
first-attempt failure followed by retry success
この二件を分離すれば、人間判断に残るのは本来の semantic ambiguity だけになり、authority の形式変換と reviewer transport 障害は control-plane が自律処理できます。
squne121 commentedon Aug 9, 2026
以下の authority は、#5229806061 の semantic OWNER directive、#5229822323 の対象番号訂正、およびこのセッションで受領した direct interactive human instruction を、現行 repository schema と current-main consumer inventory に従って機械 materialize したものです。人間が schema/path/hash を手書きしたものではありません。
authority は implementation go を与えません。controlled rewrite 後に、fresh contract review、refinement preflight、Allowed Paths gate、final reviewer を実行します。
squne121 commentedon Aug 9, 2026
Autonomous refinement result (environment failure)
sha256:efb6a7115099da2e0eb0af26a2dc64f032ab613037fa5e15be5f240693f20741pass/proceedunknown(reviewer transport/environment failure のため approve / needs-fix を捏造しない)environment_failuretracked repository files、implementation branch、implementation PR、main は変更していません。
squne121 commentedon Aug 9, 2026
Refinement final review result
final reviewer は current live snapshot に対して
approveを返し、compact envelope は validator-first で valid でした。reviewer の body SHA は本文末尾改行を正規化した値であり、GitHub API body SHA と同一 content を表します。ただし planner が要求した
web-researcherは、machine-verifiable grounded-research trace を取得できずcapability_unavailableで terminal failure になりました。#1943 の Investigation Gate に従い、selected evidence が検証可能になるまで tracked content mutation、implementation branch、PR は開始しません。既存 follow-up: #2053(authority telemetry)、#2054(reviewer transport/artifact)。今回の failure は web-research capability であり、両 Issue の重複対象にはしません。
squne121 commentedon Aug 9, 2026
調査結果から、#1943 をそのまま再実行するのは推奨しません。現在の
environment_failureは記録として妥当ですが、実態は一時障害より grounded_research capability probe の設計上の不整合である可能性が高いです。Google Antigravity CLI は公式 changelog 上、v1.1.8 で
agy -p --output-format stream-jsonを正式実装しており、init → step_update* → resultの NDJSON と tool payload を提供します。したがって、PR #2043 で実測された v1.1.11 系環境に対し「structured output capability 自体が存在しない」と考える根拠は弱いです。 ([Google Antigravity]1)一方、loop-protocol の現在の capability 判定は、help だけでは
supportedにせず、実agy -p ... --output-format stream-jsonsemantic probe が成功した場合だけsupportedへ昇格します。その probe は temporary/empty HOME と縮小環境変数で起動されています。しかも同じpreflight_agy.pyは、AGY の認証情報を$HOME/.gemini/antigravity-cli/antigravity-oauth-tokenから検出する実装を持っています。つまり、能力を実証するための probe が、自分で認証経路を隔離してしまっている構造が強く疑われます。これは上流仕様とも整合します。Antigravity CLI 公式は system keyring を認証に利用し、未認証時は Google Sign-In へフォールバックします。また headless 実行では D-Bus/keyring や OAuth の扱いが明示的に修正されており、完全な headless 状態で認証がなければ fail-fast する仕様です。 ([GitHub]2)
さらに 第二の blocker もあります。現在の
web-researcher.mdは critical claim の evidence が 0 件ならgrounding_failureとする一方、provider source → claim の対応付けは false grounding 防止のため #2042 完了まで意図的に実施しない契約です。 #2042 はまさに stablesource_idによる deterministic claim-source relation を実装する open Issue です。 したがって capability だけ直して #1943 を再実行しても、critical claim を要求する調査なら次にgrounding_failureへ進む可能性があります。また #1943 の Allowed Paths には
preflight_agy.pyや grounded-research runner が含まれていません。新規 Issue が必要になった場合も明示的な Stop Condition です。よって #1943 の scope を拡張して直すのではなく、grounded-research capability defect を独立 Issue で直す → #2042 → #1943 再開の直列順が妥当です。現在の #1943 final result はapproveだがimplementation_go: falseと正しく記録されています。推奨順序は、① capability failure の exact
reason_codeを read-only で採取、② empty-HOME/auth isolation が原因なら専用 Issue を起票して修正、③ #2042 を完了、④ 同じ #1943 body SHA に対して web-researcher だけを fresh rerun、⑤ terminal/schema/snapshot/evidence/conflict gate がすべて通った場合だけimplementation_go=trueにする、です。Direct WebSearch/WebFetch や Gemini への fallback で通すのは、現行web-researcher契約を破るため避けるべきです。以下をそのまま Claude Code / Codex CLI に渡せます。
#1943 implementation blocker diagnosis / recovery
対象:
repository:
squne121/loop-protocolIssue:
#1943refinement result comment:
#5230822070expected live body SHA-256:
efb6a7115099da2e0eb0af26a2dc64f032ab613037fa5e15be5f240693f20741expected review artifact SHA-256:
1fa4b936dfd6cc2e7e87813f55a7f5159487153562d375c275f1394f5165e40ccurrent state:
web-researcher grounded_research capability_unavailableenvironment_failureGoal
#1943 の実装を開始するのではなく、
web-researcherのgrounded_research capability_unavailableの root cause を一次 evidence で確定し、必要なら専用 follow-up Issue を作成して
blocker を解消可能な状態へ持っていく。
#1943 の tracked content、implementation branch、PR は、
Investigation Gate が成立するまで作成・変更しないこと。
Important upstream fact to verify
Google Antigravity CLI の公式 changelog / repository を必ず再確認すること。
現行公式仕様では v1.1.8 以降の print mode が
--output-format text|json|stream-jsonを提供し、
stream-jsonは少なくともinit -> step_update* -> terminal resultという NDJSON event stream と tool payload を提供する。
公式一次情報以外のブログ等は補助情報に限定する。
したがって、インストール済み AGY が対象機能を持つバージョンである場合、
単純な「upstream capability missing」と決めつけないこと。
Phase 1 — fresh binding / evidence collection
最初に GitHub と current checkout を fresh read し、以下を確認する。
.claude/agents/web-researcher.md.claude/skills/gemini-cli-headless-delegation/scripts/preflight_agy.py.claude/skills/gemini-cli-headless-delegation/scripts/setup_check.py.claude/skills/gemini-cli-headless-delegation/scripts/run_gemini_headless.pyこの段階では tracked file を一切変更しない。
Phase 2 — exact capability failure classification
capability_unavailableという粗い結果だけで停止せず、producer が持つ最も具体的な以下の evidence を回収する。
secret、OAuth token 本文、authorization code、
raw credential、HOME absolute path の不要な出力は禁止する。
最低限、read-only で次を確認する。
preflight_agy.pyの capability API / CLI についてはコードから canonicalinvocation を確認して実行する。古い推測コマンドを使わない。
agy --helpは stdout だけでなく stderr も evidence として確認する。Phase 3 — test the auth-isolation hypothesis
特に次の仮説を敵対的に検証すること。
確認事項:
_run_structured_output_semantic_probe()が使用する env_isolated_probe_env()が保持/除外する envcredential の中身は読まない・表示しない。
token の stdout 出力、hash 化、Git への保存も禁止する。
AGY_PREFLIGHT_CONFIRM_RUNTIME_PROBE_COST=1はmodel-backed probe の明示的 cost confirmation である。
root cause が未確定のまま retry storm を起こさないこと。
同じ deterministic failure を繰り返さない。
必要な live probe は最大1回の bounded probe とし、
既存の operator authorization で cost-bearing probe が明示的に許可されて
いない場合は、勝手に env var を立てず、
必要な exact command と理由を最終報告に含める。
Phase 4 — classification
結果を以下のいずれかに明確に分類する。
A. real environment failure
例:
この場合:
web-researcherだけを fresh rerun する手順を示すB. loop-protocol capability-probe defect
例:
supportedstate が production environment から実質 unreachableこの場合、#1943 を変更して直してはならない。
#1943 Allowed Paths 外のため、dedupe search 後、
専用 implementation Issue を作成する。
Issue の provisional goal:
AGY structured-output semantic probe の customization isolation と authentication availability を分離し、credential を露出せずに same-binary runtime capability を判定できるようにする最低限の AC:
init -> step_update* -> result観測時のみ supported実装まで許可される場合でも、
その新 Issue の refinement / contract review / Allowed Paths を確定してから
別 worktree/branch で行うこと。
#1943 scope へ sneak-in してはならない。
Phase 5 — inspect the second blocker: #2042
capability defect と独立して、current
web-researcher.mdのGrounding Quality Gate と claim-source materialization を照合する。
特に、
grounding_failuresources[]は存在するという条件が同時に成立する場合、
critical claim を要求する
WEB_RESEARCH_RESULT_V1が構造的に PASS 不能になっていないか検証する。
PASS 不能なら #2042 を #1943 再開前の serial dependency とする。
#2042 は既存 Issue なので重複 Issue を作らない。
#2038 / PR #2043 が dependency を満たしているか fresh に確認する。
capability repair と #2042 が同じファイルを変更する場合は
parallel implementation せず serial に処理する。
推奨順:
Phase 6 — #1943 resume gate
上記 blocker が解消するまで
implementation_go=falseを維持する。解消後も #5230822070 の古い web-research result を成功扱いしない。
#1943 の current live body SHA に束縛して
web-researcherを fresh に起動し、を満たすことを確認する。
全条件が成立した場合だけ
implementation_go=trueとし、そこで初めて #1943 の canonical implementation worktree/branch と
Allowed Paths 内 tracked content mutation を開始する。
Prohibited shortcuts
以下は禁止。
capability_unavailableを無視して implementation_go=true にするFinal output
最後に compact に以下を返す。
判定根拠には、repository evidence と公式 upstream evidence を分離して記載する。
不明なものを
supported/pass/approveに昇格させない。ポイントは、「AGYをもう一度叩く」ではなく、まず
supportedを証明する probe 自身が認証を消していないか証明することです。その修正後も #2042 を通さないと、#1943 の critical web evidence gate が次の地点で再び停止する可能性があります。