Skip to content

feat(#784): warn when the installed plugin cache is stale - #787

Merged
admarble merged 2 commits into
mainfrom
feature/784-feat-hooks-warn-when-the-installed-plugin-cache-is
Jul 19, 2026
Merged

admarble merged 2 commits into
mainfrom
feature/784-feat-hooks-warn-when-the-installed-plugin-cache-is

Conversation

@admarble

@admarble admarble commented Jul 18, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • pre-tool.sh (all three mirrors) now compares the running plugin's version against the local marketplace clone's marketplace.json and prints one warn-only stderr line with the exact remedy (claude plugin update sequant@sequant + restart note). Zero network, grep/sed only, rate-limited to once per day via a stamp file, gated on the script's own path under */plugins/cache/* so repo-local dev copies never warn. The tool call is never blocked and the exit code is unchanged.
  • New __tests__/plugin-staleness-warning.integration.test.ts: 7 scenarios × 3 hook mirrors, staging each copy into a simulated Claude Code cache layout — warn-once, exact-remedy, block-preservation, stamp rate limit, and all four no-op cases.
  • Docs: README install note, /release skill checklist distinction between claude plugin update (installed plugin) and /plugin marketplace update (listing only, 3 skill mirrors), generated marketplace README note, plugin-updates.md recipe corrections, CHANGELOG entry.

AC Verification

AC Description Status Evidence
AC-1 Version compare vs marketplace clone; zero network; grep/sed ✅ MET hooks/pre-tool.sh staleness block; 21 integration tests
AC-2 Warn-only, exact remedy, exit code unchanged ✅ MET Output byte-identical to the issue's fixture; blocked commands still exit 2
AC-3 Stamp-file rate limit ≤1/day ✅ MET Tested same-day repeat is silent
AC-4 Graceful no-op (clone missing/unparsable, equal versions, non-cache path) ✅ MET All four scenarios tested; repo-local copies never warn
AC-5 README documents no-auto-update + update command ✅ MET README.md:71 + generated marketplace README
AC-6 /release checklist distinguishes the two update commands ✅ MET All 3 release SKILL.md mirrors

Test plan

  • vitest run __tests__/plugin-staleness-warning.integration.test.ts — 21/21
  • vitest run __tests__/pre-tool-hook.integration.test.ts — 183/183 (no regression from the insertion)
  • npm run build / npm run lint / npm run lint:skill-calls — clean
  • Dogfooded against a simulated stale cache (1.20.3 vs 2.8.0): exact warning fires once, exit codes preserved
  • npm run prepare:marketplace regenerated artifact carries the note

QA verdict: READY_FOR_MERGE (review on the issue)

Closes #784

🤖 Generated with Claude Code

admarble added 2 commits July 18, 2026 11:45
Claude Code pins plugin installs to a commit SHA and never auto-updates
them, so a plugin-channel install can silently run months-old skills and
hooks. The pre-tool hook now compares the running plugin's version
against the local marketplace clone's marketplace.json and prints one
warn-only stderr line with the exact remedy, rate-limited to once per
day via a stamp file. Zero network, grep/sed only, exit code unchanged,
and gated on the script's own path under */plugins/cache/* so repo-local
dev copies never warn.

Docs: README install note, /release checklist distinction between
claude plugin update and /plugin marketplace update, and
plugin-updates.md recipe corrections.

Fixes #784
@admarble
admarble merged commit 1d69a89 into main Jul 19, 2026
8 checks passed
admarble added a commit that referenced this pull request Jul 19, 2026
… compare, coverage (#789)

Closes the three non-blocking gaps flagged during #784's QA:

- Locate the marketplace clone by scanning plugins/marketplaces/*/ for the
  clone that declares the sequant plugin, instead of hardcoding a "sequant"
  directory name Claude Code may not use.
- Compare versions semver-aware (pure awk, no sort -V): warn only when the
  install is strictly behind the marketplace, so an ahead cache or a
  lexicographic mismatch (1.20.3 vs 1.9.0) no longer mis-warns.
- Add regression guards: the staleness block invokes no network command
  (all three mirrors), and the generated marketplace README keeps the
  no-auto-update note from #787.

#784 behavior preserved: warn-once/day via stamp, exit code untouched,
repo-local dev copies silent, three hook mirrors byte-identical.

Fixes #788
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.

feat(hooks): warn when the installed plugin cache is stale — plugin-channel installs never auto-update

1 participant