Skip to content

#303: Fix PluginCheck to support project-scoped plugins#305

Merged
bguidolim merged 2 commits intomainfrom
bruno/303-plugincheck-project-scope
Mar 27, 2026
Merged

#303: Fix PluginCheck to support project-scoped plugins#305
bguidolim merged 2 commits intomainfrom
bruno/303-plugincheck-project-scope

Conversation

@bguidolim
Copy link
Copy Markdown
Collaborator

Summary

PluginCheck only read ~/.claude/settings.json, causing false negatives when plugins were enabled in project-scoped settings.local.json. This adds two-tier scope lookup matching the existing MCPServerCheck pattern.

Closes #303

Changes

  • Add projectRoot: URL? to PluginCheck with two-tier lookup: project settings.local.json first, global settings.json fallback
  • Forward projectRoot from deriveDoctorCheck() to PluginCheck (was already available but not passed)
  • Surface corrupt project settings in diagnostic fail messages instead of silently swallowing
  • Extract Constants.FileNames.settingsLocal to replace string literals across CoreDoctorChecks, DoctorRunner, SyncScope, ConfigurationDiscovery, and ProjectSyncStrategy
  • Add 7 unit tests (project-scoped pass, global fallback, both-scope fail, corrupt fallback, absent fallback), 2 derived-check forwarding tests, and 1 integration test

Test plan

  • swift test passes locally (910/910)
  • swiftformat --lint . and swiftlint pass without violations
  • Affected commands verified with a real pack (e.g. mcs sync, mcs doctor)
Checklist for engine changes
  • Integration tests updated for new features (DoctorRunnerIntegrationTests)

- Add two-tier lookup (project settings.local.json → global settings.json) matching MCPServerCheck pattern
- Extract Constants.FileNames.settingsLocal to replace 5 string literals across 4 files
- Add 7 unit tests, 2 derived-check tests, and 1 integration test (910 total)
- Change projectSettingsCorrupt Bool to projectSettingsError String? to include error details
- Return .warn when plugin enabled globally but project settings.local.json is corrupt
- Add tests for explicit false values, corrupt-with-no-global, and corrupt-with-absent-plugin
@bguidolim bguidolim merged commit 72c66a1 into main Mar 27, 2026
4 checks passed
@bguidolim bguidolim deleted the bruno/303-plugincheck-project-scope branch March 27, 2026 13:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PluginCheck doctor check only reads global settings.json, misses project-scoped enabledPlugins

1 participant