Skip to content

実装: agent 定義の body 変更と permission/tool surface 変更で runtime 検証 profile を分け、無関係な classifier behavior assertion の false-required を防ぐ #2917

Open

Description

@squne121

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: workflow

Parent 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 の rule agent-lifecycle-frontmatter-or-body-change は、frontmatter keys(permissionMode / disallowedTools / description / tools)と markdown body(subagent_instruction_body)のどちらの変更にも、同一の subagent-delegation-runtime-smoke profile を 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

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-change rule を、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

Acceptance Criteria

  • AC1: policy yaml で、.claude/agents/** の permission/tool surface 変更(frontmatter tools / 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.md

Allowed 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

Activity

  1. added
    phase/implementation
    agent/implementer
    enhancement
    on Oct 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent/implementerenhancementphase/implementation

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions