You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(plugin): auto-refresh adopted decision table on version drift (v0.11.0)
v0.10.0 shipped the 7-core/5-hidden tool surface in the Rust binary but
left the adopted plugin_code_graph_mcp.md + MEMORY.md sentinel block
stuck at the v0.8.x/v0.9.x 12-tool content for already-adopted projects.
maybeAutoAdopt short-circuited on isAdopted() and never refreshed the
template. Also shipped the stale source template itself, and the
INDEX_LINE constant in adopt.js that drives the MEMORY.md sentinel.
Fixes:
- Source template `claude-plugin/templates/plugin_code_graph_mcp.md`
synced to 7-core/5-hidden surface so fresh /plugin install + first
adopt produces correct content.
- INDEX_LINE constant in adopt.js synced to v0.10.0 wording so the
sentinel block in MEMORY.md matches the target file.
- New `needsRefresh()` helper: compares shipped template SHA vs target
and checks MEMORY.md sentinel block content vs current INDEX_LINE.
- `maybeAutoAdopt()` now refreshes target + sentinel on drift unless
CODE_GRAPH_NO_TEMPLATE_REFRESH=1 is set. Reason is 'refreshed'.
- `session-init.js` emits a one-line stderr notice on refresh.
Tests: 8 new cases in adopt.test.js cover drift detection, refresh path,
opt-out env var, and no-gratuitous-refresh when in sync. 37/37 adopt +
13/13 session-init + 335/335 cargo test green.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: CHANGELOG.md
+26Lines changed: 26 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,31 @@
1
1
# Changelog
2
2
3
+
## v0.11.0 — auto-refresh stale decision table on plugin upgrade
4
+
5
+
### Migration note
6
+
7
+
v0.10.0 shipped the 7-core/5-hidden tool surface in the Rust binary **but left the adopted `plugin_code_graph_mcp.md` decision table file — and the `MEMORY.md` sentinel block — stuck at the v0.8.x/v0.9.x 12-tool content** for any project that had already auto-adopted. The plugin's `maybeAutoAdopt()` short-circuited on `isAdopted() == true` and never refreshed the template. Two related holes were also fixed:
8
+
9
+
1. The shipped source template (`claude-plugin/templates/plugin_code_graph_mcp.md`) was not updated in v0.10.0 — **new**`/plugin install` + first-adopt users were also getting the stale 12-tool table.
10
+
2. The `INDEX_LINE` constant in `adopt.js` (which drives the `MEMORY.md` sentinel block) was likewise still the v0.8.x 12-tool line.
11
+
12
+
### What changes on upgrade
13
+
14
+
-**Source template synced** to match the 7-core / 5-hidden surface. Fresh `/plugin install` gets the correct decision table on first adopt.
15
+
-**`INDEX_LINE` synced** to the v0.10.0 wording.
16
+
-**Auto-refresh on drift**: when a project is already adopted but the shipped template hash ≠ the project's copy (or the `MEMORY.md` sentinel block's content ≠ current `INDEX_LINE`), the next plugin SessionStart refreshes both silently. One-time stderr notice: `[code-graph] Refreshed decision table to latest shipped version.`
17
+
- Hand-edited decision tables are overwritten by default. To lock: `CODE_GRAPH_NO_TEMPLATE_REFRESH=1` in `~/.claude/settings.json` env.
18
+
19
+
### Opt-out
20
+
21
+
-`CODE_GRAPH_NO_TEMPLATE_REFRESH=1` — preserves your local edits of `plugin_code_graph_mcp.md`; also pins `MEMORY.md` sentinel to whatever it was. Does not affect first-adopt (only the refresh path).
22
+
-`CODE_GRAPH_NO_AUTO_ADOPT=1` — still gates the first-adopt path as in v0.9.0.
Without this fix, an already-adopted v0.8.x/v0.9.x user who upgrades to v0.10.x gets mixed state: the Rust binary serves 7 tools in `tools/list` but the MEMORY.md index + decision-table file still instruct the LLM to route through the full 12-tool surface as if they were peers. Functionally nothing breaks (hidden tools remain callable by name), but the decision guidance is misaligned. v0.11.0 closes the loop so the three surfaces — binary, index pointer, decision table — all move together on upgrade.
28
+
3
29
## v0.10.0 — tools/list surface trimmed to 7 core tools
0 commit comments