Skip to content

Raise the plugin version so the guard fix of #49 reaches the cache - #53

Merged
gabe4coding merged 1 commit into
mainfrom
claude/plugin-cache-version-bump
Oct 13, 2026
Merged

gabe4coding merged 1 commit into
mainfrom
claude/plugin-cache-version-bump

Conversation

@gabe4coding

Copy link
Copy Markdown
Owner

Intent

Make the kb-guard fix of #49 reach machines that have the plugin, and stop the same mistake with a test and a rule: when bin/, hooks/, skills/ or types/ change, the plugin version must go up.

Drift

  • First design: a lock file (tests/plugin_cache.json) with the version and a hash of the files. /simplify found a gap: you could write the new hash with the old version, and the test passed. I replaced it with a compare against origin/main. The test now starts git, so it is slow and CI needs fetch-depth: 0.
  • Not here: kb-guard could hand over to the code clone, as bin/kb does. Then guard fixes reach users with no bump. That changes what the guard does, so it is a separate task.

Decisions

  • The test compares the branch (uncommitted edits included) with its merge base on origin/main. On a PR, CI checks out the merge commit, so the base is the current main. Two PRs that both raise to the same version are caught there.
  • In CI (CI set), a missing origin/main fails the test. Locally it skips.
  • hooks/*.test.tsx is left out: a test-only change needs no new version.
  • Door: two-way.

Evidence

Before (after kb update to dcb39c8):

$ cmp ~/.claude/plugins/cache/retroagent/retroagent/0.11.2/bin/kb-guard ~/.retroagent/bin/kb-guard
... differ: char 417, line 5

The guard in this session still denied a drive.py hook prompt that the #49 guard allows.

After:

  • This branch: test_a_change_to_the_cached_files_raises_the_version passes, also with CI=true.
  • With one extra line in bin/kb-guard and the version set back to 0.11.2:
    AssertionError: bin/kb-guard changed but the version is still 0.11.2: raise it in .claude-plugin/plugin.json and .codex-plugin/plugin.json
    
    (from the first form of the message, before the /code-review fix to "is not above")
  • The same edit with 0.11.3: passes.
  • scripts/test --all: 1727 passed in 77.31s.
  • Pending, after the merge: claude plugin update writes the 0.11.3 cache, and its bin/kb-guard is the same as the code clone's.

Reading map

Tests changed: tests/test_plugin.py (new test, no assertion removed)

Config: .claude-plugin/plugin.json, .codex-plugin/plugin.json (version), .github/workflows/test.yml (fetch-depth: 0)

🤖 Generated with Claude Code

Claude Code and Codex cache the plugin per version and run the hooks from that copy. #49 changed bin/kb-guard without a new version, so after kb update the cached 0.11.2 guard was still the old one. 0.11.3 makes the hosts copy the plugin again. A test now compares the branch with origin/main: when bin/, hooks/, skills/ or types/ change, the version must go up. CI fetches the full history for it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@gabe4coding
gabe4coding merged commit 83dcf57 into main Oct 13, 2026
2 checks passed
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.

2 participants