Skip to content

Doctor: detect settings.local.json drift #119

@bguidolim

Description

@bguidolim

Context

With #45 resolved, mcs doctor now detects content drift in CLAUDE.local.md sections via SHA-256 hash comparison. The same approach should be extended to settings.local.json, which is composed from multiple packs.

Complexity

Unlike single-file artifacts, settings.local.json is a composed file where multiple packs contribute entries (hook groups, settings keys). Drift detection requires either:

  • Option A: Hash the entire composed file and re-compose at doctor time for comparison
  • Option B: Track per-pack contribution hashes and verify each pack's contributions independently

Option A is simpler but may false-positive on key ordering differences. Option B is more precise but requires decomposing the file.

Acceptance criteria

  • Doctor check detects when settings.local.json has been manually edited
  • Changes to user-owned keys (outside pack-managed keys) are not flagged
  • --fix restores pack-managed portions while preserving user additions
  • Tests cover: matching state, drifted pack keys, user-added keys preserved

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Medium priorityenhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions