spec(adapter): split settings.json ownership and ship mcp_tool entry by default (patch)#1169
Merged
liplus-lin-lay merged 1 commit intoApr 25, 2026
Conversation
…by default Replace the previous "do not modify if exists" rule for `.claude/settings.json` with a clear ownership split: - `.claude/settings.json` = Li+ owned. Bootstrap renders it from `adapter/claude/hooks-settings.md` and uses compare-and-overwrite (skip when byte-identical, overwrite otherwise). The sensitive-file permission prompt fires only on actual content drift, not on every tag bump. - `.claude/settings.local.json` = user owned. Li+ never touches it. Workspace customizations (`permissions`, `env`, `theme`, additional hooks, additional `mcp_tool` entries for other MCP servers) belong here. Claude Code merges both files at runtime. Default `settings.json` template now ships the `type: "mcp_tool"` UserPromptSubmit hook entry for `github-webhook-mcp.get_pending_status`. Manual opt-in editing is retired (#1163 / PR #1164 の opt-in 設計を default に格上げ)。前提条件は据え置き (github-webhook-mcp 接続 + v0.11.3 の bridge wrap)。MCP サーバー未接続環境では Claude Code resolver が毎ターン `not connected` plain text を context に出すが 挙動上の害はない。 既存 workspace の移行注意: 既に `.claude/settings.json` に user-added キー (permissions / env / theme / 独自 hook / 追加 mcp_tool entry) を入れている環境は、 本仕様適用前に `settings.local.json` へ移す必要がある。compare-and-overwrite が差分を検出すると Li+ template で上書きされるため。 Touched files: - Li+bootstrap.md (Phase 4c.4: compare-and-overwrite logic) - adapter/claude/hooks-settings.md (default template includes mcp_tool entry, ownership boundary section, migration note, mcp_tool entry behavior section) - adapter/claude/CLAUDE.md (Optional Webhook Notification Flow section update) - docs/B.-Configuration.md (LI_PLUS_WEBHOOK_DELIVERY notes update + ownership boundary section) - skills/operations-foreground-webhook-intake/SKILL.md (mcp_hook delivery mode description update) Closes #1165
liplus-lin-lay
commented
Apr 25, 2026
liplus-lin-lay
left a comment
Member
Author
There was a problem hiding this comment.
AI 自己レビュー (semi_auto, minor)
仕様適合
- #1165 の改定後の前提 3 項目すべて反映: (a) settings.local.json に env/secret 等を分離する所有境界、(b) settings.json は Li+ 管轄、(c) bootstrap が Li+ 部分のみ更新(compare-and-overwrite で実現、user 部分は settings.local.json 経由で保護)
- 検討課題 4 つの扱い:
- JSON マージ実装の信頼性 → 「マージしない、ファイル単位で所有分割」で回避(最小意外性)
.claude/settings.local.jsonの役割明文化 → docs/B に節を追加 + hooks-settings.md File ownership boundary 節- backward compat → 移行注意を docs/B + hooks-settings.md + commit body の 3 箇所に記載
- マージ衝突時の挙動 → 「マージしない」設計で発生しない
内容整合
- compare-and-overwrite 規則は Li+bootstrap.md Phase 4c.4 と adapter/claude/hooks-settings.md の Bootstrap behavior 節で同じ literal を使用
- mcp_tool entry の前提条件 (github-webhook-mcp >= v0.11.3) は hooks-settings.md / docs/B / SKILL.md / adapter/claude/CLAUDE.md の 4 箇所すべてで一致
LI_PLUS_WEBHOOK_DELIVERYの semantics は据え置き (bash hook reminder の挙動制御)。mcp_toolentry 自体は config に依存せず常に発火する旨を hooks-settings.md mcp_tool entry behavior 節で明示
自己リスク申告
- 既存 workspace の data loss リスク: user-added キーが settings.json に直接置かれていた環境では上書きで失われる。docs/B / commit body / PR body / hooks-settings.md の 4 重で移行注意を書いたが、release 前に Master へ周知タイミングを調整した方が安全
- MCP 未接続環境の noise: 未接続環境では
not connectedplain text が毎ターン context に出る。挙動上は害ないが視覚的ノイズ。本 PR では「設計判断として受容」と明示。長期的には #1160 (plugin distribution path) でバンドル戦略の中で再検討 - Desktop / CLI 非対称: 本 PR は registration 源の違いには立ち入らず、user が手動で各 host に MCP を登録する前提を維持。バンドル化は #1160 で別軸検討
バージョン判定
minor (large + user-observable structural change per rules/operations/release-version.md)。#1165 body の「minor bump 候補」と一致。
判定
self-review 承認。semi_auto minor のため、Master の review 後 merge。
Note
本セッション workspace の .claude/settings.json に user-added キーが無い (top-level keys = ["hooks"] のみ) ことを実機確認済み。本 PR を本ワークスペースで適用しても data loss は発生しない。
This was referenced Apr 25, 2026
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.
概要
adapter/claude/hooks-settings.mdの旧ルール「.claude/settings.jsonが存在する場合は Li+ が一切触らない」を見直し、ファイル単位で所有権を分割。.claude/settings.json= Li+ 所有 (compare-and-overwrite で内容差分時のみ上書き、no-diff なら sensitive-file プロンプトも出ない).claude/settings.local.json= ユーザー所有 (Li+ 不可侵。permissions / env / theme / 独自 hook / 追加 mcp_tool entry はここ)これに合わせて、PR #1164 で opt-in 経路として導入した
type: \"mcp_tool\"UserPromptSubmit hook entry を default テンプレートに昇格。手動settings.json編集が不要になる。設計判断の経緯
`mcp_tool` entry の render 戦略について以下 3 案を検討:
LI_PLUS_WEBHOOK_DELIVERYconfig に紐付け採用根拠 = bootstrap を MCP enumeration から decoupled に保つ + mid-session MCP 追加で即動く + noise は一行 plain text で実害なし。
変更ファイル
既存 workspace への影響 (移行注意)
既に `.claude/settings.json` に user-added キー (permissions / env / theme / 独自 hook / 追加 `mcp_tool` entry) を入れている環境は、本仕様適用前に `settings.local.json` へ移してください。compare-and-overwrite が差分を検出すると Li+ template で上書きされ、user-added キーが失われます。
本セッション workspace (`C:/Users/smile/Code`) では既に分離済みであることを実機確認済み (settings.json top-level keys = ["hooks"] のみ)。
バージョン
minor (large + user-observable structural change per `rules/operations/release-version.md`)
関連