Repository navigation
fix: Claude Code が無視する Write(path) の deny ルールを削除し、起動時の警告を解消(v0.79.2) - #180
Merged
Merged
Conversation
config/permissions.json の permissions.deny に Write(path) 形式のルールが 7 件含まれていた。Claude Code はファイルの権限チェックに Edit(path) ルール だけを使い(Edit ルールはファイルを編集するすべての組み込みツールに適用 される)、2.1.210 以降は Write(path) ルールごとに起動時の警告を表示する。 - config/permissions.json: Write(path) の deny ルール 7 件を削除した。同じ パスの Edit(path) ルールは以前から併記されているため保護範囲は変わらない - lib/update.sh: 更新の設定フェーズで settings.json の permissions.deny から この 7 文字列(完全一致)だけを取り除く _strip_ineffective_permission_rules を追加した。permissions.deny を手で編集した環境では、非対話の 3-way merge が「キットが削除した項目」を残すため。利用者が追加したルールと並び順は 変えず、該当がなければ書き換えない - MDM: 配備される settings.json から 7 件がなくなる。policy.json の SHA-256 は 変わらない(Minimal / Standard / Full × 日本語で確認) - テスト: permission ルールの静的検査 1 件、掃除関数の単体テスト 6 件、 実ビルドを通す設定フェーズのテスト 5 件を追加した(修正前は 10 件が失敗)
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
🟢 Approval recommended
The targeted migration is correctly scoped and comprehensively covered across configuration, merge, and update paths.
0 open findings
What changed in this PR
Removes ineffective Write(path) deny rules that trigger Claude Code startup warnings while preserving equivalent Edit(path) protection.
Changes:
- Removes seven obsolete permission rules.
- Sweeps legacy rules during updates.
- Adds static, unit, and update-path regression coverage.
| File | Description |
|---|---|
config/permissions.json |
Removes ineffective deny rules. |
lib/update.sh |
Cleans legacy rules during updates. |
tests/unit/test-hook-fixtures.sh |
Prevents unsupported permission forms. |
tests/unit/test-retired-hooks.sh |
Tests precise cleanup behavior. |
tests/unit/test-update-refactor.sh |
Tests update and merge paths. |
CHANGELOG.md |
Documents v0.79.2 behavior. |
🧠 Review effort: Balanced
Give feedback about Copilot approvals in this survey to enter a drawing for a $150 gift card.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概要
キット導入後、Claude Code の起動時に次の警告が 7 行表示される問題を修正します(v0.79.2、patch)。
原因
config/permissions.jsonのpermissions.denyにWrite(path)形式のルールが 7 件あった(Write(./.env)、Write(./.env.*)、Write(./**/.env)、Write(./**/.env.*)、Write(/secrets/**)、Write(~/.zshrc)、Write(~/.bashrc))Write(path)/NotebookEdit(path)/Glob(path)形式のルールを無視し、起動時に警告する。公式ドキュメント(permissions、2026-10-08 取得): "Editrules apply to all built-in tools that edit files."Edit(path)ルールが併記されているため、保護は変わらない(削除したルールはもともと一致していなかった)ユーザーに見える変更
setup.sh --update(/update-kit、自動アップデート、install.shの再実行)でsettings.jsonのpermissions.denyから 7 件が取り除かれる。permissions.denyを手で編集していた環境(非対話の 3-way merge はキットが削除した値を保持する)も、新しい sweep が完全一致の 7 文字列だけを取り除くので対象になるsettings.jsonだけがある状態への新規インストール(bootstrap merge のみ)。CHANGELOG に手動の対処を記載settings.jsonから 7 件がなくなる。KIT_MDM_EXPECTED_POLICY_SHA256は不変(minimal / standard / full で確認)。renderer / installer は変更していないので install bundle の再配布は不要変更内容
config/permissions.jsonWrite(path)の deny ルール 7 件を削除(deny は 57 → 50 件。allow と他のルールは不変)lib/update.sh_strip_ineffective_permission_rules: 更新時にpermissions.denyから上の 7 文字列(完全一致)だけを取り除く。他のルール・順序・他のキーは変えず、該当がなければ書き換えない。_update_phase_settingsの既存 sweep の最後で毎回実行tests/unit/test-hook-fixtures.shconfig/*.jsonとfeatures/*/hooks*.jsonのpermissionsにWrite(path)/NotebookEdit(path)/Glob(path)形式がないことの静的検査(修正前は 7 件を検出)tests/unit/test-retired-hooks.sh/test-update-refactor.shpermissions.denyを編集した環境・bootstrap merge・未編集・該当なしの各ケースで実ビルドを通す更新テストCHANGELOG.md[0.79.2] - 2026-10-08の Fixedリスク
/update-kitで確認するWrite(path)ルールは触らない(警告は利用者側で直す必要がある)実行した検査
test-hook-fixtures/test-context-budget/test-biome-hooks/test-pr-creation-log/test-retired-hooks/test-update-refactor/test-merge/test-json-builderを最小ランナーで実行し 149/149 PASS。test-mdm-expected.sh単体 30/30 PASSmdm/render-expected.pyの出力を main と比較: policy.json の SHA-256 は 3 プロファイルで同一、変わるのは settings.json のハッシュのみshellcheck -S warning(変更 .sh)、jq . config/permissions.json、git diff --check