Repository navigation
Open
Labels
agent/implementerAI implementer agentenhancementNew feature or requestphase/implementationImplementation phase
Description
Machine-Readable Contract
contract_schema_version: v1
issue_kind: implementation
parent_issue: "none"
goal_ref: "extension-surface runtime policy の検証要求を、変更された agent 定義の surface(report/protocol body か permission/tool surface か)に対応させる"
change_kind: workflowParent Issue
none
Parent Goal Ref
- Goal:
.claude/agents/**の変更に対し、変更対象と無関係で現行 runner では充足不能な assertion を required set に入れない。 - Desired Destination: agent 定義の変更が report/protocol 書式のみか permission/tool surface に触れるかで、要求する runtime assertion を semantic に分ける。
Current Validated Scope
docs/dev/extension-surface-runtime-policy.yamlの ruleagent-lifecycle-frontmatter-or-body-changeは、frontmatter keys(permissionMode/disallowedTools/description/tools)と markdown body(subagent_instruction_body)のどちらの変更にも、同一のsubagent-delegation-runtime-smokeprofile をdefault_decision: immediateで要求する。- この profile の assertion に
permission_mode_effective_behavior_matches_parent_classifier(実際の tool call 許可/拒否挙動の確認)が含まれる。一方docs/dev/runtime-verification-policy.md§15 のとおり runner はpermission_modeの観測値しか証明せず、allow/deny の実挙動は証明できない。 - 結果として report 書式だけを変える 実装: test-runner.md の TEST_VERDICT_MACHINE/v2 報告契約を step-2 の委譲契約と consumer 要件に整合させる #2892 でも、変更対象と無関係で現行 runner では充足不能な assertion が required set に入り、partial/unconfirmed のまま残る(起票元: 実装: test-runner.md の TEST_VERDICT_MACHINE/v2 報告契約を step-2 の委譲契約と consumer 要件に整合させる #2892 (comment) の OWNER REQUEST_CHANGES finding 3 と「再発防止」節)。
- 本 Issue の write-capable scope は policy yaml の rule/profile 分割と、それを検証する既存 schema test、および policy 説明 docs のみ。
Remaining Parent Gaps
- assertion 単位の applicability disposition 宣言は 実装: Runtime Verification の assertion 単位 applicability を表現し、無関係な assertion の AC binding が readiness 通過のための空 evidence になる false-required を防ぐ #2852 が所有する(本 Issue は policy yaml の profile 分割のみを扱い、実装: Runtime Verification の assertion 単位 applicability を表現し、無関係な assertion の AC binding が readiness 通過のための空 evidence になる false-required を防ぐ #2852 の binding 宣言には触れない)。
- skill-invocation profile の assertion applicability は 再発防止: skill-invocation-runtime-smoke の assertion applicability を明示化する #2775 が所有する(agent 定義は対象外だったため本 Issue が agent 側を扱う)。
- 実 allow/deny 挙動を証明する runner / permission harness は本 Issue で作らない(別 Issue が必要になれば起票する)。
Outcome
docs/dev/extension-surface-runtime-policy.yaml が、.claude/agents/** の変更を「report/protocol のみの body 編集」と「permission/tool surface(frontmatter の tools / disallowedTools / permissionMode 等)の変更」に semantic に分けて別々の verification profile に対応づけ、前者には delegation + causal evidence 系の assertion のみ、後者にのみ permission_mode_effective_behavior_matches_parent_classifier を要求する状態になり、schema test が PASS している。
Runtime Verification Applicability
- decision: not_applicable
- reason: policy yaml / schema test / docs の静的変更のみで、runtime 挙動(runner・hook・permission)は変更しない。runtime 検証要求の割当てを変える変更であり、runner の観測能力は変えない。
In Scope
agent-lifecycle-frontmatter-or-body-changerule を、permission/tool surface を扱う rule と report/protocol body を扱う rule へ semantic に分割する(または同等の semantic 区別を policy で表現する)。- report/protocol body のみの rule には、delegation + causal evidence 系の assertion(
delegation_target_actually_invoked/subagent_start_stop_causal_evidence_correlated等、既存 profile の assertion を再利用)のみを割り当てる。 - permission/tool surface(frontmatter の
tools/disallowedTools/permissionMode等)の rule には現行どおり classifier behavior の assertion を維持する。security を弱めない。 - 分類不能・混在変更(body と permission surface を同時に変更)は、より厳しい permission/tool surface 側の要求を適用する旨を policy に明記する。
- schema test に分割後の rule/profile 対応と、混在変更が厳しい側へ倒れることの検証を追加する。
docs/dev/runtime-verification-policy.mdの該当説明を分割後の policy に同期する。
Out of Scope
- 実装: test-runner.md の TEST_VERDICT_MACHINE/v2 報告契約を step-2 の委譲契約と consumer 要件に整合させる #2892 の実装(
test-runner.mdの報告契約変更)。 - runner(
run_worktree_agent_runtime_smoke.py等)の変更、新しい permission harness の追加。 - security 境界の緩和(permission/tool surface の変更に対する classifier behavior assertion の削除・弱体化)。
- 個別 Issue 番号ごとの例外追加。
- assertion 単位の applicability disposition 宣言(実装: Runtime Verification の assertion 単位 applicability を表現し、無関係な assertion の AC binding が readiness 通過のための空 evidence になる false-required を防ぐ #2852)、skill-invocation profile の applicability(再発防止: skill-invocation-runtime-smoke の assertion applicability を明示化する #2775)。
Acceptance Criteria
- AC1: policy yaml で、
.claude/agents/**の permission/tool surface 変更(frontmattertools/disallowedTools/permissionMode)に対応する rule がpermission_mode_effective_behavior_matches_parent_classifierを含む profile を引き続き要求する。 - AC2: policy yaml で、report/protocol のみの markdown body 変更に対応する rule が、
permission_mode_effective_behavior_matches_parent_classifierを含まない profile を要求し、delegation / causal evidence 系 assertion を含む。 - AC3: body と permission/tool surface を同時に変更する場合は permission/tool surface 側の要求が適用されることが policy 上明記され、schema test で検証される。
- AC4: 既存の schema test(rule の verification_profile 参照解決・selector 構成等)が全て PASS する。
- AC5:
docs/dev/runtime-verification-policy.mdが分割後の policy を反映し、旧来の「body 変更も一律に classifier behavior assertion を要求する」記述が残らない。
Verification Commands
# AC1
# baseline-expect: fail
$ uv run --locked python3 -m pytest docs/dev/tests/test_extension_surface_runtime_policy_schema.py -k agent_lifecycle_split_permission_surface
# AC2
# baseline-expect: fail
$ uv run --locked python3 -m pytest docs/dev/tests/test_extension_surface_runtime_policy_schema.py -k agent_lifecycle_split_report_body
# AC3
# baseline-expect: fail
$ uv run --locked python3 -m pytest docs/dev/tests/test_extension_surface_runtime_policy_schema.py -k agent_lifecycle_split_mixed_change
# AC4
# baseline-expect: pass
$ uv run --locked python3 -m pytest scripts/agent-guards/tests/test_extension_surface_policy_matcher.py
# AC5
# baseline-expect: fail
$ rg -n "report/protocol body" docs/dev/runtime-verification-policy.mdAllowed Paths
- docs/dev/extension-surface-runtime-policy.yaml
- docs/dev/extension-surface-runtime-policy.schema.json
- docs/dev/tests/test_extension_surface_runtime_policy_schema.py
- docs/dev/runtime-verification-policy.md
- scripts/agent-guards/extension_surface_policy_matcher.py
- scripts/agent-guards/tests/test_extension_surface_policy_matcher.py
Stop Conditions
- Allowed Paths 外の変更が必要と判明した場合
- In Scope の固定契約(キー集合・スキーマ・型定義)の変更が必要になった場合
- 新規 Issue の起票が必要と判断した場合(スコープ分割が発生する場合)
- 後続 Phase / 別スコープへの波及が判明した場合
- nested SubAgent delegation が必要になった場合
- 外部サービス利用・権限昇格・既存テスト大規模改変が必要になった場合
- permission/tool surface 変更に対する classifier behavior assertion の弱体化が必要になった場合
Required Skills
なし
Required Design References
- docs/dev/extension-surface-runtime-policy.yaml
- docs/dev/runtime-verification-policy.md
- docs/dev/agent-skill-boundaries.md
Scope Delta(任意)
N/A
Delivery Rule
1 Issue = 1 PR、専用 worktree で作業し、Draft PR を既定とする。
Notes for Reviewer
- 起票元 finding: 実装: test-runner.md の TEST_VERDICT_MACHINE/v2 報告契約を step-2 の委譲契約と consumer 要件に整合させる #2892 (comment)
- dedupe 確認: 実装: Runtime Verification の assertion 単位 applicability を表現し、無関係な assertion の AC binding が readiness 通過のための空 evidence になる false-required を防ぐ #2852 は policy yaml の profile 分割・再設計を Out of Scope と明記、再発防止: skill-invocation-runtime-smoke の assertion applicability を明示化する #2775 は agent 定義を対象外としており、いずれも本 scope を所有しない。OPEN/CLOSED の keyword 検索でも equivalent な Issue は見つからなかった。
- dedupe_key: follow-up:squne121/loop-protocol:実装: test-runner.md の TEST_VERDICT_MACHINE/v2 報告契約を step-2 の委譲契約と consumer 要件に整合させる #2892 (comment)
Metadata
Metadata
Assignees
Labels
agent/implementerAI implementer agentenhancementNew feature or requestphase/implementationImplementation phase
Activity