Skip to content

実装: Python invocation-policy checker が .claude/skills/.system を governed surface として誤走査する #2674

Closed

Description

@squne121

Machine-Readable Contract

contract_schema_version: v1
issue_kind: implementation
parent_issue: "none"
goal_ref: "Python invocation-policy checker (#1193) の regression follow-up: gitignore済みのruntime-local surface `.claude/skills/.system/**` を governed surface として誤走査する false positive を解消する"
change_kind: code

Parent Issue

none

Parent Goal Ref

  • Goal: なし(単独改善)
  • Desired Destination: なし(単独改善)

Current Validated Scope

  • scripts/ci/check_python_invocation_policy.py の should_exclude() (または surface discovery ロジック)に、gitignore済みの .claude/skills/.system/ を repository-governed surface のスキャン対象から除外する変更を追加する
  • scripts/ci/tests/test_python_invocation_policy.py に、deterministic な temp fixture を用いた negative control(.claude/skills/.system/** の bare python invocation は violation に入らない)と positive control(通常の .claude/skills/**/SKILL.md は従来どおり検出される)のテストを追加する

Remaining Parent Gaps

なし

Outcome

scripts/ci/check_python_invocation_policy.py が gitignore済みの .claude/skills/.system/** をスキャン対象から除外するよう修正され、uv run --locked pytest scripts/ci/tests/test_python_invocation_policy.py -q が全件 PASS し、かつ uv run --locked pytest scripts/ci/tests/test_python_invocation_policy.py::test_repo_scan_clean_zero_violations -q が PASS している状態。通常の repository-owned .claude/skills/**/SKILL.md の invocation-policy enforcement は従来どおり維持される。

Runtime Verification Applicability

  • decision: not_applicable
  • reason: 本 Issue の AC は静的な unit test(deterministic fixture を用いた checker の走査対象の検証)で完結し、live CI run への疎通確認を要求しない

In Scope

  • scripts/ci/check_python_invocation_policy.py の surface discovery / should_exclude() に .claude/skills/.system/ の bounded exclusion を追加する
  • scripts/ci/tests/test_python_invocation_policy.py に negative control(.system 配下は除外される)と positive control(通常の project skill は従来どおり検出される)の regression test を追加する

Out of Scope

Acceptance Criteria

  • AC1: .claude/skills/.system/** は invocation-policy checker の repository-governed surface として走査されない
  • AC2: 通常の repository-owned .claude/skills/**/SKILL.md(.system を除く)は従来どおり走査される
  • AC3: .system 内に bare python / python3 command 例が存在しても repo全体の clean check(test_repo_scan_clean_zero_violations)を汚染しない
  • AC4: 通常の project skill の SKILL.md に同じ bare invocation を置けば従来どおり direct_python_script として検出される(positive control)
  • AC5: exclusion は .claude/skills/.system/ に bounded であり、.claude/skills/** 全体へは拡張しない
  • AC6: 既存の exception registry(python_invocation_policy_exceptions.json)のセマンティクスは変更しない
  • AC7: local に .system ディレクトリが存在する環境・存在しない環境の両方で repository-owned surface の scan 結果が同一である
  • AC8: 追加した focused checker test(negative control / positive control)が PASS する
  • AC9: test_repo_scan_clean_zero_violations が PASS する
  • AC10: scripts/ci/tests/ の regression が、この defect に関して clean になる(無関係な pre-existing failure が別途存在する場合はこの AC の対象外として扱う)

Verification Commands

# AC1
# AC5
$ rg -n "\.claude/skills/\.system/" scripts/ci/check_python_invocation_policy.py
# AC2
# AC4
# AC7
# AC8
# baseline-expect: deferred
$ uv run --locked pytest scripts/ci/tests/test_python_invocation_policy.py -q
# AC3
# AC9
# AC10
# baseline-expect: deferred
$ uv run --locked pytest scripts/ci/tests/test_python_invocation_policy.py::test_repo_scan_clean_zero_violations -q
# AC6
$ uv run --locked pytest scripts/ci/tests/test_python_invocation_policy.py::test_exception_registry_real_file_loads_and_is_valid -q

Allowed Paths

  • scripts/ci/check_python_invocation_policy.py
  • scripts/ci/tests/test_python_invocation_policy.py

Stop Conditions

  • Allowed Paths 外の変更が必要と判明した場合
  • In Scope の固定契約(キー集合・スキーマ・型定義)の変更が必要になった場合
  • 新規 Issue の起票が必要と判断した場合(スコープ分割が発生する場合)
  • 後続 Phase / 別スコープへの波及が判明した場合
  • nested SubAgent delegation が必要になった場合
  • 外部サービス利用・権限昇格・既存テスト大規模改変が必要になった場合

Required Skills

なし

Required Design References

  • docs/dev/workflow.md

Scope Delta(任意)

N/A

Delivery Rule

1 Issue = 1 PR で完結させる。worktree を切って作業し、Draft PR をデフォルトとする。

Notes for Reviewer

Activity

  1. added
    enhancement
    phase/implementation
    triage-required
    agent/implementer
    on Sep 19, 2026
  2. squne121 commented on Sep 19, 2026

    @squne121
    OwnerAuthor

    root-owned entry router audit

    route: invoke_impl_review_loop
    reason: fresh_review_go_live_equality

  3. squne121 commented on Sep 19, 2026

    @squne121
    OwnerAuthor

    implement-issue: 実装完了 (2026-09-19T15:37:38Z)

    • PR: fix: invocation-policy checker が .claude/skills/.system を誤走査する regression を修正 #2675
    • Worktree: .claude/worktrees/issue-2674-invocation-policy-system-exclude
    • Branch: worktree-issue-2674-invocation-policy-system-exclude
    • Verification:
      • rg -n "\.claude/skills/\.system/" scripts/ci/check_python_invocation_policy.py(AC1/AC5): PASS
      • uv run --locked pytest scripts/ci/tests/test_python_invocation_policy.py -q(AC2/AC4/AC7/AC8): 79 passed
      • uv run --locked pytest scripts/ci/tests/test_python_invocation_policy.py::test_repo_scan_clean_zero_violations -q(AC3/AC9/AC10): 1 passed
      • uv run --locked pytest scripts/ci/tests/test_python_invocation_policy.py::test_exception_registry_real_file_loads_and_is_valid -q(AC6): 1 passed
      • uv run --locked pytest scripts/ci/tests/ -q(AC10 regression確認): 617 passed, 2 skipped, 0 failed
    • 後続: PR レビュー(pr-review-judge)→ マージ → post-merge-cleanup
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/implementationtriage-required

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions