Skip to content

feat(#788): harden plugin-staleness check — scan marketplaces, semver compare, coverage - #789

Merged
admarble merged 1 commit into
mainfrom
feature/788-feat-hooks-harden-plugin-staleness-check-scan-
Jul 19, 2026
Merged

admarble merged 1 commit into
mainfrom
feature/788-feat-hooks-harden-plugin-staleness-check-scan-

Conversation

@admarble

@admarble admarble commented Jul 19, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Follow-up to #784 (merged in #787) closing the four gaps flagged during that PR's QA. Hooks changed across all three byte-identical mirrors.

  • Gap 1 — hardcoded marketplace dir name. The check now scans plugins/marketplaces/*/.claude-plugin/marketplace.json and picks the clone whose JSON declares the sequant plugin, instead of assuming the directory is named sequant. If Claude Code names it after the source slug, the check still finds it. No-op when no matching clone exists.
  • Gap 2 — string compare, not semver. Version comparison is now a dotted numeric compare in pure awk (no sort -V GNU-ism). The warning fires only when the install is strictly behind the marketplace. An ahead cache stays silent, and a lexicographic trap like 1.20.3 vs 1.9.0 (20 > 9 → ahead) no longer mis-warns.
  • Gap 3 — zero-network was untested. New test asserts the staleness block invokes no network-capable command (curl/wget/gh/git/npm/…) across all three mirrors.
  • Gap 4 — marketplace README note untested. New test asserts the prepare-marketplace.ts template keeps the no-auto-update note + claude plugin update command from feat(#784): warn when the installed plugin cache is stale #787.

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

AC Verification

AC Description Status Evidence
AC-1 Scan for marketplace clone; no hardcoded dir name; zero-network ✅ MET for _stale_mkt in …/marketplaces/*/…; tests for non-sequant dir + ignore-non-sequant clone
AC-2 Warn only when strictly behind (semver, no sort -V) ✅ MET awk cmp; tests: ahead=silent, patch-behind=warn, 1.20.3 vs 1.9.0=silent, 2.8==2.8.0
AC-3 Test: no network commands in the block ✅ MET describe.each(HOOK_COPIES) network-command guard
AC-4 Test: generated marketplace README keeps the note ✅ MET asserts prepare-marketplace.ts template contains note + command
AC-5 #784 behavior preserved; mirrors byte-identical ✅ MET 44/44 staleness tests; 183/183 existing hook tests; md5 of 3 mirrors identical

Test plan

  • vitest run __tests__/plugin-staleness-warning.integration.test.ts — 44/44 (21 original + 23 new)
  • vitest run __tests__/pre-tool-hook.integration.test.ts — 183/183 (no regression)
  • npm run build / npm run lint — clean
  • Dogfooded: non-sequant marketplace dir warns; ahead/equal/trailing-zero/double-digit all silent; behind warns; repo-local silent
  • Three hook mirrors byte-identical (md5)

Closes #788

🤖 Generated with Claude Code

… compare, coverage

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
@admarble
admarble merged commit dd65873 into main Jul 19, 2026
8 checks passed
@admarble
admarble deleted the feature/788-feat-hooks-harden-plugin-staleness-check-scan- branch July 19, 2026 01:57
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): harden plugin-staleness check — scan marketplaces dir, semver-aware compare, coverage

1 participant