Skip to content

feat(doctor): plugin-cache check + orphan cleanup + post-update reload hint (v3.2.16)#58

Merged
kengio merged 1 commit into
mainfrom
fix-plugin-cache-cleanup
May 29, 2026
Merged

feat(doctor): plugin-cache check + orphan cleanup + post-update reload hint (v3.2.16)#58
kengio merged 1 commit into
mainfrom
fix-plugin-cache-cleanup

Conversation

@kengio
Copy link
Copy Markdown
Contributor

@kengio kengio commented May 29, 2026

What

Fixes a dual-install split-brain: a stale marketplace plugin cache (~/.claude/plugins/cache/<mkt>/onebrain/<version>) — orphaned by a marketplace install that predated a vault-local update — could shadow the vault-local plugin and make Claude Code load old skills while INSTRUCTIONS.md was current. (Hit live: cache stuck at v2.2.4 while vault-local was v3.1.3.)

Changes

  • doctor plugin-cache check (Vault structure section) — reports stale cached plugin versions (cache vs the vault-local pin). --fix prunes them, then re-detects to report an honest result: Failed (non-zero exit), not a misleading Fixed, if a removal hits a permission error.
  • cache_clean — read-only detect_stale_plugin_cache sibling to clean_plugin_cache, sharing one enumeration pass (version_dirs_under); skips symlinks (symlink_metadata, no follow) and rejects path-traversal marketplace keys (onebrain@../...).
  • plugin update — post-update ↻ /reload-plugins next-step whenever a real version change lands; fires on partial-failure-with-version-change too (the version already landed on disk).
  • Consolidated installed_plugins.json path resolution into one shared default_installed_plugins_path.

Verification

  • cargo fmt + cargo clippy --workspace --all-targets clean (0 warnings)
  • cargo test --workspace — 1294 passed / 0 failed (+8 new tests)
  • live smoke on the real vault: doctor ok-path + warn-path (fake orphan); onebrain --version → 3.2.16
  • 3-round parallel review — R1 (correctness/convention · silent-failure/safety · type/design) found 1 High + 2 Medium (reload hint suppressed on partial failure · marketplace path traversal · false-success on permission error) → fixed; R2 (×2) verified all resolved + approved; R3 holistic sign-off → GO

Version: patch 3.2.15 → 3.2.16 (a doctor sub-check + --fix recipe + an output line — no new first-level command). CHANGELOG updated.

🤖 Generated with Claude Code

…d hint (v3.2.16)

Fixes a dual-install split-brain where a stale marketplace cache
(~/.claude/plugins/cache/<mkt>/onebrain/<version>) orphaned by a marketplace
install that predated a vault-local update could shadow the vault-local plugin
and make Claude Code load old skills while INSTRUCTIONS.md was current.

- doctor: new `plugin-cache` check (Vault structure section) reports stale
  cached plugin versions; `--fix` prunes them, then re-detects to report an
  honest result -- Failed (non-zero exit), not a misleading Fixed, if a
  removal hits a permission error.
- cache_clean: read-only `detect_stale_plugin_cache` sibling to
  `clean_plugin_cache`, sharing one enumeration pass (`version_dirs_under`);
  skips symlinks (symlink_metadata, no follow) and rejects path-traversal
  marketplace keys (`onebrain@../...`).
- plugin update: post-update reload next-step (`reload-plugins ...`) whenever a
  real version change lands, so the running session picks up the new plugin;
  fires on partial-failure-with-version-change too (the version already landed
  on disk).
- consolidate `installed_plugins.json` path resolution into one shared
  `default_installed_plugins_path`.

3-round parallel review (correctness/convention - silent-failure/safety -
type/design, then verify, then holistic sign-off). cargo fmt + clippy clean;
1294 workspace tests pass.
@kengio kengio merged commit fd8c49b into main May 29, 2026
6 checks passed
@kengio kengio deleted the fix-plugin-cache-cleanup branch May 29, 2026 08:02
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.

1 participant