Repository navigation
docs(#268): failure_class taxonomy と retry policy を references/ に追加 - #278
Conversation
gemini-cli-headless-delegation の preflight / run wrapper に failure_class taxonomy (v1) と retry policy を文書化。 - Non-retryable (fail-close): config_invalid / cli_missing / cli_incompatible / trusted_workspace_required / auth_missing_or_expired / gh_auth_required / mcp_config_invalid / mcp_tool_policy_invalid / github_research_command_denied - Backoff retry 可: quota_or_rate_limited / model_capacity_exhausted / transient_api_error / network_error / timeout - result JSON に retryable / retry_scope / attempts / attempts_by_model / last_stderr_summary / classification_confidence フィールド仕様を策定 - ACP transport の auth_required fail-close 設計との整合性を記録 - #101 との依存境界(section-local vs top-level classification)を明示 - 後続実装 Issue 分割方針(Issue A: run wrapper / Issue B: preflight)を記載 Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
squne121
left a comment
There was a problem hiding this comment.
Verdict: APPROVE
Mergeability
- mergeable=MERGEABLE, mergeStateStatus=CLEAN
Evidence Check
AC coverage:
- AC1: PASS —
references/failure-class-taxonomy.mdに 7 種類以上の failure_class 分類が定義されている(config_invalid, cli_missing, cli_incompatible, auth_missing_or_expired, quota_or_rate_limited, transient_api_error, network_error, output_parse_error, timeout, model_capacity_exhausted 等) - AC2: PASS —
gemini_headless_preflight_result/v1へのretryable: boolean,attempts: int,last_stderr_summary: string|nullフィールド仕様が文書化されている。retry_scope,attempts_by_model,classification_confidenceも追加(スコープ超過ではなく価値追加) - AC3: PASS — Non-retryable group(config_invalid / cli_missing / cli_incompatible は fail-close)と Retryable group(quota_or_rate_limited / transient_api_error / network_error は backoff retry 可)が明示されている
- AC4: PASS — Issue #277「実装: gemini-cli-headless-delegation failure_class taxonomy を result JSON に追加し retry policy を実装する」が起票済み。Issue #268 にリンクコメントも投稿済み
Allowed Paths: 遵守 — 変更ファイルは .claude/skills/gemini-cli-headless-delegation/references/failure-class-taxonomy.md(新規作成)のみ。Allowed Paths .claude/skills/gemini-cli-headless-delegation/ に完全に収まっている
CI Verification: 全 5 チェック pass(build, lint, python-test, test, typecheck)
検証コマンド結果: PR 本文 ## 検証コマンド結果 セクションに Standard Quality Gates(pnpm typecheck/lint/test/build + uv run pytest)と Issue VC(AC1-AC4)の結果が記録されている
Schema Change Applicability: not_schema_change — 変更は taxonomy ドキュメントの新規作成のみ。consumer 境界をまたぐ contract 変更なし(コード変更なし)
Safety Claim Matrix: Path が .claude/skills/** に該当するため形式上 safety-sensitive だが、PR diff は実装コード・permission 設定・transport 実装への変更を含まない。PR 本文に無限定の安全主張もない。taxonomy ドキュメントは分類体系の記録であり safety boundary 変更ではないと判断。Safety Claim Matrix 省略を許容
Runtime Verification: Issue #268 の decision: not_applicable(research-only Issue)のため追加証跡不要
Blockers
なし
Non-blockers(任意改善)
-
VC の loose 問題: AC1/AC2/AC3 の Verification Commands は既存コードにもマッチするため、baseline で unexpected PASS になる(PR 本文の「改善点 1」に記録済み)。Issue #277 の VC では差分確認コマンドを使用することを推奨(PR 本文に具体的な改善案あり)
-
output_parse_errorの retry 可否複雑さ: taxonomy 文書内で「最大 1 回まで retry、classification_confidence: low 時は human escalation」と記録されている。#277 実装時にclassification_confidenceフィールドで信頼度を表現する必要がある(PR 本文「改善点 3」に記録済み) -
#101 依存: preflight の per-profile 化未解決により taxonomy の top-level classification に制約がある(PR 本文「改善点 2」に記録済み)
LOOP_VERDICT
verdict: APPROVE
iteration: 0
pr_url: https://github.com/squne121/loop-protocol/pull/278
reviewed_head_sha: 201024cd600188bd6a5e862d99aa05ca0bd7a343
blockers: []
warnings:
- "AC1/AC2/AC3 の VC が緩すぎる(既存コードにもマッチ)。Issue #277 の VC では差分確認コマンドを使用すること(PR 本文「改善点 1」に記録済み)"
mergeable: MERGEABLE
mergeStateStatus: CLEAN
follow_up_issue_requests:
- title: "VC 精度改善: gemini-cli-headless-delegation failure_class 系 VC を差分確認コマンドに置き換える"
issue_kind: implementation
severity: optional_follow_up
source:
kind: pr_body
url: "https://github.com/squne121/loop-protocol/pull/278"
note_id: "1"
dedupe_key: "follow-up:squne121/loop-protocol:https://github.com/squne121/loop-protocol/pull/278:1"
desired_destination: "Issue #277 の VC で rg ではなく pytest -k オプション等の差分確認コマンドを使用し、baseline unexpected PASS が発生しないようになっている"
validated_scope_delta: "Issue #277 の Verification Commands セクションを差分確認コマンドに更新する"
origin_skill: pr-review-judge
labels:
- triage-required
結論判定: REQUEST_CHANGES 相当。 PR 自体は docs-only で、変更ファイルは マージ阻止級の指摘1.
|
ブロッカー 5 点を修正: 1. retryable=false エントリの retry_scope を none に統一し recovery_scope/recovery_action を追加 2. timeout を client_subprocess_timeout(retryable)と api_deadline_exceeded(non-retryable)に分割 3. PERMISSION_DENIED を auth_missing_or_expired / permission_denied / billing_or_region_unavailable / model_not_found_or_unsupported に分割 4. quota_or_rate_limited に quota_dimension (rpm/tpm/rpd/model_capacity/unknown) と retry_after_ms を追加。RPD 枯渇時は retry_scope: next_model 5. Issue #277 の preflight scope を #101 解決後に限定する制限を taxonomy に明記 修正推奨 A/B/C も反映: A. last_error_summary を canonical フィールドに格上げ。source フィールドで stderr/stdout/envelope.error/exception/gh_stderr を区別。last_stderr_summary は auxiliary として残す B. preflight の attempts を smoke retry 回数のみカウントと明確化。preflight_checks 構造を定義(#101 完了後に拡充) C. mcp_tool_policy_invalid は configuration hygiene check(security boundary ではない)と明記 Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
squne121
left a comment
There was a problem hiding this comment.
Verdict: REQUEST_CHANGES
Mergeability
- mergeable=MERGEABLE, mergeStateStatus=BLOCKED(branch protection によるレビュー待ち)
Evidence Check
AC coverage:
- AC1: taxonomy 全値(config_invalid, cli_missing, auth_missing_or_expired, quota_or_rate_limited, transient_api_error, network_error, output_parse_error)が
references/failure-class-taxonomy.mdに定義済み。PR 本文 VC でrgPASS 記録あり。達成。 - AC2:
retryable,attempts,last_stderr_summaryフィールド仕様が result JSON 仕様セクションに明記済み。達成。 - AC3: fail-close group(config_invalid / cli_missing / cli_incompatible)と backoff retry group(quota_or_rate_limited / transient_api_error / network_error)の方針が Retry Policy セクションに明記済み。達成。
- AC4: Issue #277 が OPEN 状態で起票済み。達成。
Allowed Paths 遵守: 変更ファイルは .claude/skills/gemini-cli-headless-delegation/references/failure-class-taxonomy.md のみ。Allowed Paths .claude/skills/gemini-cli-headless-delegation/ の範囲内。遵守。
CI Verification: typecheck/lint/test/build/python-test の全 5 チェックが SUCCESS(2026-05-23T07:16〜07:17)。
前回ブロッカー(5点)の修正確認:
- retryable=false と retry_scope 矛盾:
retry_scope: noneに統一、recovery_scope/recovery_action で外部修復を表現。解消済み。 - timeout 2 クラス分割:
client_subprocess_timeout(retryable: true)とapi_deadline_exceeded(retryable: false)に分割済み。解消済み。 - PERMISSION_DENIED 分割:
auth_missing_or_expired,permission_denied,billing_or_region_unavailable,model_not_found_or_unsupportedの 4 クラスに分割済み。解消済み。 - quota_dimension / retry_after_ms 追加:
quota_dimension: rpm|tpm|rpd|model_capacity|unknownとretry_after_msがdelegation_result/v1フィールド仕様に追加済み。解消済み。 - taxonomy の #277 scope 制限:
preflight_checks完全実装は #101 解決後に限定する注記が追加済み。解消済み。
Blockers
B1: ## Schema Change Applicability セクションが PR 本文に存在しない
.claude/skills/** 配下の変更かつ delegation_result/v1 の Detection pattern(failure_class 等)が diff に含まれるため、schema_change_applicability の判定が必要。not_schema_change を明示しその根拠を記載するか、schema_change と判定して Schema Consumer Inventory を提出すること。
SKILL.md Step 4.5:「## Schema Change Applicability セクションが存在しない → APPROVE 禁止(not_schema_change の明示がない限り)」
B2: ## Safety Claim Matrix セクションが PR 本文に存在しない
以下の理由で safety-sensitive PR と判定(fail-closed):
- changed path が
.claude/skills/**に一致 - diff に
auth,permission,mcp,trustキーワードが含まれる
Safety Claim Matrix の必須列(Claim / Implemented? / Not controlled / Evidence / Follow-up)を PR 本文に追加すること。本 PR は実装コード変更なく分類体系の文書化のみであることを明示し、claim の射程を明確にすること。
SKILL.md Step 4.6:「safety-sensitive PR なのに Safety Claim Matrix セクションが存在しない → APPROVE 禁止」
Non-blockers(任意改善)
last_error_summaryのsourceフィールド定義が YAML ネスト形式になっているが(last_error_summary.source)、フィールドの型定義形式として外部仕様と一致しているか確認を推奨。
LOOP_VERDICT
verdict: REQUEST_CHANGES
iteration: 1
pr_url: https://github.com/squne121/loop-protocol/pull/278
reviewed_head_sha: 4e5c48d3337ea9fb1486ec0ad3e05fa8eb39da8e
blockers:
- id: B1
description: "## Schema Change Applicability セクションが PR 本文に存在しない。not_schema_change の明示または Schema Consumer Inventory の提出が必要。"
- id: B2
description: "## Safety Claim Matrix セクションが PR 本文に存在しない。safety-sensitive PR(.claude/skills/** + auth/permission/mcp/trust キーワード)のため必須。"
warnings:
- id: W1
description: "last_error_summary の source フィールド定義のネスト形式が外部仕様と一致しているか確認推奨。"
mergeable: MERGEABLE
mergeStateStatus: BLOCKED
follow_up_issue_requests: []
squne121
left a comment
There was a problem hiding this comment.
Verdict: APPROVE
Mergeability
- mergeable=MERGEABLE, mergeStateStatus=BEHIND(ベースブランチ差分あり。DIRTY/CONFLICTING ではないため non-blocker)
Evidence Check
-
AC coverage: 全 PASS
- AC1:
failure_classtaxonomy がreferences/failure-class-taxonomy.mdに記録済み(根拠記載あり) - AC2:
retryable,attempts,last_error_summary,last_stderr_summaryフィールド仕様が文書化済み(根拠記載あり) - AC3:
config_invalid/cli_missingは retry 不可(fail-close)、quota_or_rate_limited/transient_api_errorは backoff retry 可 が taxonomy に明記(根拠記載あり) - AC4: 後続実装 Issue #277 が起票済み、#268 にリンクコメント投稿済み(根拠記載あり)
- AC1:
-
Allowed Paths: 遵守
- 変更ファイル:
.claude/skills/gemini-cli-headless-delegation/references/failure-class-taxonomy.mdのみ - Allowed Paths:
.claude/skills/gemini-cli-headless-delegation/→ 完全準拠
- 変更ファイル:
-
CI Verification: 全チェック pass
- build: pass, lint: pass, python-test: pass, test: pass, typecheck: pass
-
検証コマンド結果: PR 本文の
## 検証コマンド結果セクションに AC1〜AC4 の VC 結果と Standard Quality Gates 全結果が記録済み -
Runtime Verification:
decision: not_applicable(research-only Issue のため) -
Schema Change Applicability:
not_schema_changeを明示。根拠(docs-only、実装コード変更ゼロ、現行 delegation_result/v1 スキーマ不変)が diff と一致。Schema Consumer Inventory は N/A 明示済み -
Safety Claim Matrix: セクション存在。auth/MCP/trust/fail-closed/taxonomy 各 dimension を「変更なし」と Evidence 付きで記載。全 Claim が「変更なし」のため Not controlled 境界は存在しない
Blockers
なし
Non-blockers(任意改善)
- Safety Claim Matrix の列構成が SKILL.md 必須仕様(
Claim / Implemented? / Not controlled / Evidence / Follow-up)と異なる(Safety Dimension / Claim / Evidenceの3列)。docs-only かつ全 Claim が変更なしのため今回は実質問題なし。後続 PR(#277 等)で safety-sensitive 変更を行う際は必須列を揃えること
LOOP_VERDICT
LOOP_VERDICT:
verdict: APPROVE
iteration: 2
pr_url: https://github.com/squne121/loop-protocol/pull/278
reviewed_head_sha: c67ae2f66ac5fef4aa0cb89a64884bf624be0789
mergeable: MERGEABLE
mergeStateStatus: BEHIND
blockers: []
warnings:
- id: W1
message: "Safety Claim Matrix の列構成が SKILL.md 必須仕様と異なる(Implemented? / Not controlled / Follow-up 列欠落)。後続 PR で safety-sensitive 変更を行う際は必須列を揃えること"
follow_up_issue_requests:
- title: "後続 PR の Safety Claim Matrix 列構成を SKILL.md 必須仕様に合わせるガイドラインを整備する"
issue_kind: research
severity: optional_follow_up
source:
kind: pr_review
url: "https://github.com/squne121/loop-protocol/pull/278"
note_id: "1"
dedupe_key: "follow-up:squne121/loop-protocol:https://github.com/squne121/loop-protocol/pull/278:1"
desired_destination: "Safety Claim Matrix の必須列が全 safety-sensitive PR で統一される"
validated_scope_delta: "SKILL.md の Safety Claim Matrix 必須列定義と PR テンプレートの整合性確認"
origin_skill: pr-review-judge
labels:
- triage-required
Summary
gemini-cli-headless-delegationの failure_class taxonomy と retry policy をreferences/failure-class-taxonomy.mdに文書化したconfig_invalid/cli_missingなどの Non-retryable (fail-close) とquota_or_rate_limited/transient_api_errorなどの Backoff retry 可クラスを定義retryable,retry_scope,attempts,attempts_by_model,last_error_summary,last_stderr_summary,classification_confidence)を策定変更内容(PR #278 レビュー REQUEST_CHANGES 対応)
PR レビュー(コメント)で指摘された以下のブロッカー 5 点を全て修正済み。
ブロッカー修正
1. retryable=false と retry_scope の矛盾を解消
retryable=falseのエントリは全てretry_scope: noneに統一recovery_scope/recovery_actionフィールドで表現after_external_state_changeをretry_scopeから削除し、recovery_scopeの値として再定義2. timeout を 2 クラスに分割
client_subprocess_timeout: subprocess stall / ネットワーク stall によるtimeout_sec超過。retryable: true、retry_scope: same_request_after_backoffapi_deadline_exceeded: prompt / context が大きすぎて API deadline を超過。retryable: false、retry_scope: none、recovery_scope: reduce_request_size3. PERMISSION_DENIED を 4 クラスに分割
auth_missing_or_expired:not authenticated/UNAUTHENTICATED/ auth context 明確なPERMISSION_DENIEDpermission_denied: 認証は有効だが権限不足(auth-expired signal なし)billing_or_region_unavailable:FAILED_PRECONDITION/free tier unavailable/billing requiredmodel_not_found_or_unsupported:NOT_FOUND/unsupported model4. quota_or_rate_limited に quota_dimension と retry_after_ms を追加
quota_dimensionフィールド:rpm/tpm/rpd/model_capacity/unknownretry_after_msフィールド: API が返した retry-after ヒント(ミリ秒)quota_dimension: rpd)時はretry_scope: next_model(別プール)5. Issue #277 の preflight scope 制限を明記
Issue #277 の scope 制限注記を追加preflight_checks構造の完全実装は 実装: preflight_gemini_headless.py を per-profile 検証化し local_asset_research 不備で preflight 全体を fail させない #101 解決後 に限定修正推奨 A/B/C
A. last_error_summary を canonical フィールドに格上げ
last_error_summaryを caller-facing canonical フィールドとして定義sourceフィールドを追加:stderr/stdout/envelope.error/exception/gh_stderrで出力元を区別last_stderr_summaryは auxiliary フィールドとして残す(source=stderr の場合と同値)B. preflight の attempts 定義を明確化 + preflight_checks 構造を定義
attemptsを「smoke retry 回数のみカウント(初回試行 = 1)」と明確化preflight_checks構造体を定義:gemini_version/gemini_help/smoke/gh_cliそれぞれにok+failure_classC. mcp_tool_policy_invalid の性質を明記
mcp_tool_policy_invalidは security boundary ではなく configuration hygiene check である旨を note に明記Closes
Closes #268
検証コマンド結果
Standard Quality Gates
pnpm typecheck: PASS(エラーなし)pnpm lint: PASS(エラーなし)pnpm test: PASS(28 test files, 35 tests passed)pnpm build: PASS(dist/ 生成成功)uv run pytest .claude/skills/gemini-cli-headless-delegation/tests/test_model_routing.py: PASS(21 tests passed)Issue VC
rg "failure_class|config_invalid|quota_or_rate_limited|transient_api_error"): PASS(新規文書に taxonomy 全値を定義)rg "retryable|last_error_summary"): PASS(フィールド仕様を文書化)rg "retry.*config_invalid|cli_missing.*retry|fail-close|backoff retry"): PASS(retry policy 方針を明記)Allowed Paths Compliance
対象変更:
.claude/skills/gemini-cli-headless-delegation/references/failure-class-taxonomy.md(更新)Allowed Paths:
.claude/skills/gemini-cli-headless-delegation/→ compliance: true
Schema Change Applicability
判定: not_schema_change(文書化のみ)
本 PR は
.claude/skills/gemini-cli-headless-delegation/references/failure-class-taxonomy.mdの新規作成のみを含む docs-only 変更です。delegation_result/v1の実際の JSON フィールド(failure_class、retryable等)は 追加・変更・削除しておらず、run_gemini_headless.py/preflight_gemini_headless.pyのコードは一切変更していませんdelegation_result/v1を使い続け、本 PR のマージによる破壊的変更はありませんSchema Consumer Inventory: N/A(現行スキーマ変更なし)
Safety Claim Matrix
本 PR は
.claude/skills/gemini-cli-headless-delegation/への docs-only 変更です。実装コードの変更は含まれません。preflight_gemini_headless.py/run_gemini_headless.pyのコード変更ゼロ.gemini/settings.json変更なしtrusted_workspace_requiredの実装ロジック変更なしfailure-class-taxonomy.md新規作成。将来の実装の設計ガイドとして機能し、現行の動作に影響しない結論: 本 PR は現行の安全機構を変更しない。Safety-sensitive な実装変更は後続の Issue #277 で行い、その時点で Safety Claim Matrix を再評価する。
作業中に発見した改善点
1. VC の loose 問題(contract snapshot の warning に記録済み)
AC1/AC2/AC3 の VC は既存コードにも広くマッチするため、baseline で unexpected PASS になる。
具体例:
failure_classは既存のtransport-acp.md/run_gemini_headless.pyに存在するためマッチ_is_retryable_capacity_failureがretryableにマッチ、last_stderr_summaryは NOT FOUND だったが AC2 全体は PASSfail-closeはdelegation-task-classes.md等に既存。backoff retryはmodel-routing.mdに既存改善提案: 後続実装 Issue #277 の VC では以下のような差分確認を使うべき:
2. #101 未完了による top-level failure_class 設計への影響
現行
preflight_gemini_headless.pyがlocal_asset_researchの Serena 設定を全プロファイルに適用して誤 fail-close する問題(#101)が未解決。本 taxonomy では
#101 完了前は section-local classification のみ、top-level は最も重大な failure のみ反映という境界を明示した。#277(Issue B: preflight 拡張)の
preflight_checks完全実装は #101 の完了後に行う。3.
output_parse_errorの retry 可否の複雑さoutput_parse_errorは CLI version incompatibility / stdout-stderr 混線 / prompt leakage など非 retryable 原因を含む可能性があり、単純なretryable: trueにしてはいけない。本文書では「最大 1 回まで retry、
classification_confidence: low時は human escalation」とした。#277 では実装時に
classification_confidenceフィールドで retryable の信頼度を表現する必要がある。Contract Snapshot
#268 (comment)