Repository navigation
docs: Claude extension surface の risk-trigger policy を追加する - #2291
Conversation
skills/SubAgent/hooks 変更時の system-test 方針を、既存 SSOT docs/dev/runtime-verification-policy.md を拡張する versioned machine-readable rule set(docs/dev/extension-surface-runtime-policy.yaml) として新設する。agent/hook/skill/claude-gpt/SubAgent lifecycle ごとの source_scopes・semantic_delta・execution_context・default_decision・ verification_profile・証明可能な predicate 形式の例外・unknown_surface_policy を定義し、enforcement 配線(review-issue / issue-contract-review への deterministic gate 配線)は follow-up Issue #2290 へ明示的に参照した。 Co-Authored-By: Claude Sonnet 5 <[email protected]>
Preview URL✅ verified live assets: https://squne121.github.io/loop-protocol/pr-2291/ The preview will be removed when this PR is closed. |
impl-review-loop 判定 (iteration 0)Mergeability: mergeable=MERGEABLE, merge_state_status=BLOCKED(branch protection / レビュー待ち。conflict ではない), isDraft=true Evidence Check
Blockersなし Warnings(非 blocker)
verdict: APPROVE
reviewed_head_sha: "209989cb2c6651b1ddb1db302842cd14f2de1ac3"
blockers: []
warnings:
- "PR本文にAC1-9個別checklistセクションがなくSafety Claim Matrixに集約(blockerではない)"
route_loop_verdict_v2:
route: fail_closed
reason_code: merge_state_status_blocked_not_conflict_defer_to_ci_evaluatormerge_state_status=BLOCKED は Git conflict ではなく、Draft PR の branch protection(レビュー承認待ち)に起因します。impl-review-loop はこれを human escalation とせず、人間のマージ判断待ちとして終了します。 |
PR #2291 敵対的レビュー判定REQUEST_CHANGES レビュー対象は head 本PRがenforcementを#2290へ分離していること自体は妥当です。問題は、#2290が実装に使う「構造化正本」として、現YAMLの契約が不足している点です。 P1-1 —
|
PR #2291 への OWNER 敵対的レビュー(REQUEST_CHANGES, #2291 (comment)) の 6 Blocker を反映する: 1. semantic_delta を自由文字列から型付き semantic_detectors[](type: yaml_frontmatter_keys / markdown_body / json_config_keys / script_body_semantics、change_types 付き)に置き換え、複数 rule 一致時の 合成方針を resolution として追加した 2. source_scopes(フラットな配列)を selectors[](source_scope ごとに project は path_globs、user/managed/plugin/session/cli は runtime_resolved_only + evidence_source を持つ構造)に置き換え、plugin agent の permissionMode 等が常に unsupported である事実を project runtime の事実と区別した 3. 全 rule 共通の単一 verification_profile 名を廃止し、top-level verification_profiles に rule 固有の assertions[] を持たせた 4. exceptions[] を evaluation_mode / default_when_unproven / required_evidence[] / evidence_freshness / approval_authority を持つ 証明契約付き構造に拡張した 5. rule 単位の min_claude_code_version を廃止し、top-level assumptions[] (claim_id 単位)に置き換え、Auto mode 関連 claim を 2.1.83 以上にした 6. docs/dev/extension-surface-runtime-policy.schema.json(JSON Schema draft 2020-12)と docs/dev/tests/test_extension_surface_runtime_policy_schema.py (pytest, jsonschema.validate())を新設した docs/dev/runtime-verification-policy.md セクション11のフィールド表・説明も 新構造に合わせて更新した。Issue #2283 の live 本文(AC10-AC15、Scope Delta 反映後)の全 Verification Commands が PASS することを確認済み。 Co-Authored-By: Claude Sonnet 5 <[email protected]>
impl-review-loop 判定 (iteration 3、最終)Mergeability: mergeable=MERGEABLE, merge_state_status=CLEAN, isDraft=true Evidence Check
Blockersなし Warnings(非 blocker)
verdict: APPROVE
reviewed_head_sha: "5bec9c838d2d78b2a90d33e19092b6c1a071954a"
blockers: []
warnings:
- "PR body Notes 備考が計5ファイルと記載しpython-test-plan.jsonが列挙から欠落(non-blocking)"
route_loop_verdict_v2:
route: approved
fail_closed: falseimpl-review-loop 終了
IMPL_REVIEW_LOOP_RESULT_V1:
status: draft_pr_ready
issue_number: 2283
pr_number: 2291
reviewed_head_sha: "5bec9c838d2d78b2a90d33e19092b6c1a071954a"
iterations: 4
termination_reason: approved3イテレーションの REQUEST_CHANGES を経て APPROVE・CI green・mergeable CLEAN に到達しました。PR は Draft のまま、マージ判断は人間に委ねます。 |
|
推奨は、現時点で PR #2291 の実装を変更せず、 現在の PR head は 指定された3ジョブは独立した3障害ではありません。root failure は さらに決定的なのは、同一 head 最初に なお副次的に、live Issue #2283 の Allowed Paths には 以下を Claude Code に渡すのを推奨します。 Claude Code 作業プロンプト — PR #2291 CI failure の原因確認と最小復旧対象:
目的PR #2291 の current live head と CI 状態を再取得し、上記3 failure の root cause を証拠ベースで切り分ける。 PR実装に起因しない一過性の外部要因であれば、コードを変更せず最小の CI rerun で green へ戻す。 推測でコード・テストを緩和しないこと。merge は実行しないこと。 既知の観測事項以下は開始時点の観測であり、必ず live GitHub data で再検証すること。
これらを事実として鵜呑みにせず、live data で一致を確認してから判断すること。 必須: SubAgent による並列調査最初に少なくとも以下4系統の genuine SubAgent を並列起動すること。 SubAgent A — CI root-cause analyst指定された3 job logを直接取得・精査する。 以下を明確にする:
SubAgent B — same-head history analystcurrent head SHA を取得し、その SHA に紐づく直近 workflow runs を比較する。 特に:
について、同じ head SHA かを確認し、
の conclusion を比較する。 同一コードで success と failure の両方が存在する場合、その事実を root-cause 判定へ反映すること。 SubAgent C — diff / scope analystPR #2291 の live diff、Issue #2283 の live body、Allowed Paths、Scope Delta を確認する。 以下を判定する:
が PR diff に含まれるか
PR本文の Allowed Paths 件数が live Issue と stale になっている場合は別途記録する。ただし、その場で PR 本文を編集しないこと。 SubAgent D — rerun/workflow analyst
以下を明確にする:
記憶や推測だけで rerun syntax を決めず、現在の SubAgent 完了待ちの必須条件4 SubAgent を起動した後、全員の作業完了を待つこと。 1つの SubAgent が結論を返した時点で先に rerun・編集・push 等へ進んではならない。 全 SubAgent の final result を取得し、相互に矛盾がないか比較すること。 まだ running の SubAgent が存在する場合は待機を継続すること。先に完了した sibling を理由に残りを cancel しないこと。 SubAgent が異常終了した場合は、必要なら1回だけ再実行するか、取得できなかった evidence を root session で補完し、証拠不足のまま mutation へ進まないこと。 統合判定全 SubAgent 完了後、root session で以下を判定する。 Case A: transient/environmental failure と確認できた場合条件例:
この場合はコードを変更しない。 まず root failing job 概念上は以下だが、実行前に current gh run rerun 32554425895 --job 96986273158specific job rerun では必要な downstream aggregate が再評価されないことが確認された場合のみ、failed-jobs rerun に広げる。 概念上: gh run rerun 32554425895 --failed不要な full workflow の新規起動は避けること。 Case B: rerun 後に green になった場合rerun attempt の完了まで待つ。 以下を live GitHub data で確認する:
ここまで確認できれば CI recovery 完了とする。 push、merge、auto-merge はしないこと。 Case C: 同じ 403 rate-limit failure が再発した場合同じ run を何度も機械的に rerun し続けない。 コード/testをその場で次のように変更して green 化してはならない:
PR #2291 の scope と切り離し、CI infrastructure / live-network-test robustness の独立問題として扱う。 既存 Issue に同問題があるか検索し、なければ「新規 Issue が必要」という結論まで出す。ただし Issue #2283 の Stop Conditions / project policy に従い、勝手なスコープ拡張や無断起票をしないこと。 Case D: PR 起因の deterministic failure が見つかった場合rerun で隠さず root cause を修正する。 ただし Issue #2283 の Allowed Paths と In/Out of Scope を厳守する。 Allowed Paths 外の変更が必要なら、その時点で停止し human escalation とする。 PR本文についてlive Issue #2283 の Allowed Paths が6ファイルなのに PR本文が「計5ファイル」のままである可能性がある。 これは CI 403 の root cause ではないので、今回の recovery のためだけに PR本文を編集しないこと。 特に 最終報告では stale metadata として記載し、修正の要否を提案するだけに留める。 禁止事項
最終報告フォーマット作業完了後、少なくとも以下を報告すること。
|
post-merge-cleanup: 完了 (2026-08-22T07:05:00Z)
Cleanup
FOLLOW_UP_MATERIALIZATION_RESULT_V1:
schema_version: 1
materialized_by: post-merge-cleanup
follow_up_issues:
- request_dedupe_key: "follow-up:squne121/loop-protocol:pr/2291:extension-surface-enforcement"
status: reused_open
issue:
number: 2290
url: "https://github.com/squne121/loop-protocol/issues/2290"
reason: "post-merge-cleanup-worker が提案した follow-up(extension-surface-runtime-policy rule set を review-issue / issue-contract-review の deterministic gate に配線する)は、同一セッション内で issue-refinement-loop の Scope Delta 対応として既に起票済みの Issue #2290(同一タイトル・同一スコープ、#2283 に blocked_by として GitHub native dependency 登録済み)と完全に重複する。dedupe_key の機械的文字列検索ではヒットしなかったが(#2290 は本 dedupe_key 導入前に起票されたため)、内容の同一性を確認し新規起票をスキップした。"
note_only_observations: [] |
Summary
docs/dev/runtime-verification-policy.mdに「Claude extension surface risk-trigger policy」セクション(セクション 11)を新設し、新設のdocs/dev/extension-surface-runtime-policy.yaml(versioned machine-readable rule set)を構造化正本として参照させた。docs/dev/extension-surface-runtime-policy.yamlに、agent / hook / skill / claude-gpt lifecycle および SubAgent の start/stop・delegation・fallback semantics のそれぞれに対応する rule id(計 5 件)を定義した。各 rule はsource_scopes(project/user/managed/plugin)・semantic_delta・execution_context・default_decision・verification_profile・証明可能な predicate 形式のexceptions(proven_not_runtime_loaded/proven_not_distributed/production_consumer_inventory_empty/executable_or_prompt_semantics_unchanged)・last_verified・min_claude_code_versionを持つ。unknown_surface_policy: human_judgmentを明記し、未知の extension surface をnot_applicableに黙って倒さない方針とした。not_applicable/immediate/deferred)を再定義しないことを明記した。review-issue/issue-contract-reviewの deterministic gate への配線)への明示的な参照を追加した。docs/dev/agent-skill-boundaries.mdの Runtime Verification 責務分担セクションに、新設 YAML への簡潔な参照を 1 行追記した。本 PR は policy definition のみを scope とする。
review-issue/issue-contract-review/ PR diff gate への実際の deterministic gate 配線は follow-up Issue #2290 の責務であり、本 PR の完了をもって「機械的に強制済み」とは扱わない。Checks
pnpm typecheckpnpm lintpnpm testpnpm builduv run pytest .claude/skills/gemini-cli-headless-delegation/tests/test_model_routing.py: 24 passed受け入れ条件の達成状況
docs/dev/extension-surface-runtime-policy.yamlが有効な YAML として存在し、schema_versionフィールド(v2)を持つ(rg -n "^schema_version:" docs/dev/extension-surface-runtime-policy.yamlPASS)rg -n "id:" docs/dev/extension-surface-runtime-policy.yamlPASS)source_scopesとexecution_contextが定義されている(rg -c "source_scopes"/rg -c "execution_context"両方 PASS)docs-onlyではなく、proven_not_runtime_loaded/proven_not_distributed/production_consumer_inventory_empty/executable_or_prompt_semantics_unchangedの証明可能な predicate で定義されている(4 件全てrg -nPASS)unknown_surface_policyがhuman_judgment相当の値に設定されている(rg -n "unknown_surface_policy"PASS)verification_profileを参照している(rg -c "verification_profile"PASS)last_verifiedが記録されている(該当 4 件のrg -nおよびlast_verifiedのrg -nPASS)docs/dev/runtime-verification-policy.md本文中に明示的に参照されている(rg -n "#2290" docs/dev/runtime-verification-policy.mdPASS)docs/dev/runtime-verification-policy.md本文に明記されている(rg -n "decision enum" docs/dev/runtime-verification-policy.mdPASS)docs/dev/extension-surface-runtime-policy.schema.jsonが有効な JSON Schema として存在し、docs/dev/extension-surface-runtime-policy.yamlが同 schema に対してjsonschemavalidation を通過する(uv run --locked pytest docs/dev/tests/test_extension_surface_runtime_policy_schema.pyPASS)semantic_detectors[].type(yaml_frontmatter_keys/markdown_body等)として型付けされている(rg -n "semantic_detectors"PASS)selectors[]があり、source_scopeごとに repository 相対 selector(project)と runtime-resolved source(user/managed/plugin/session/cli)が区別されている(rg -n "selectors:"PASS)verification_profilesが定義され、各 rule のverification_profile参照先が実在し、rule 固有のassertionsを持つ(rg -n "^verification_profiles:"PASS)exceptions[]エントリにevaluation_mode/default_when_unproven/required_evidence/approval_authorityが定義されている(rg -n "evaluation_mode"PASS)assumptions[]に claim 単位のmin_claude_code_version/last_verifiedがあり、Auto mode 関連 claim のmin_claude_code_versionが2.1.83以上である(rg -n "^assumptions:"およびrg -n "2.1.83"PASS)Schema Change Applicability
not_schema_changedocs/dev/extension-surface-runtime-policy.yamlは新設スキーマだが、現時点で consumer は存在しない(本 Issue 実装: Claude extension surface の変更時に runtime system test を要求する risk-trigger matrix を追加する #2283 は policy definition のみを scope とし、review-issue/issue-contract-review等への配線は follow-up Issue 実装: Claude extension surface risk-trigger policy を review-issue / issue-contract-review の deterministic gate に配線する #2290 で行う)。既存の producer-consumer 境界をまたぐ契約の変更ではない。Schema Consumer Inventory
N/A(
not_schema_change。新設 rule set にはまだ consumer が存在しないため)。Visual Impact Declaration(視覚影響申告)
UI(DOM/CSS)変更を含まないため該当ブロックを省略します。
Safety Claim Matrix
Runtime Verification Applicability: immediate)を要求する risk-trigger rule set を policy として定義したreview-issue/issue-contract-review/ PR diff gate への実際の deterministic gate 配線は未実装。本 rule set が実際の Issue 判定・PR diff 判定に自動適用されることは保証しないrg -n "^schema_version:" docs/dev/extension-surface-runtime-policy.yamlほか AC1〜AC15 の Verification Commands(Issue #2283 本文参照。AC10 はuv run --locked pytest docs/dev/tests/test_extension_surface_runtime_policy_schema.py)記載ルール遵守:
Not controlledが非空のため、本 PR title / summary ではsafe/read-only/sandboxed/isolated/complete(無限定)を使用していません。Notes
docs/dev/runtime-verification-policy.mdの拡張とdocs/dev/extension-surface-runtime-policy.yamlの新設(policy definition のみ)。enforcement 配線は 実装: Claude extension surface risk-trigger policy を review-issue / issue-contract-review の deterministic gate に配線する #2290。## Allowed Pathsはdocs/dev/runtime-verification-policy.md/docs/dev/extension-surface-runtime-policy.yaml(新規)/docs/dev/agent-skill-boundaries.md(実際に関係を追記する場合のみ)/docs/dev/extension-surface-runtime-policy.schema.json(新規)/docs/dev/tests/test_extension_surface_runtime_policy_schema.py(新規)の計 5 ファイルに限定されており、変更はこの範囲内。