fix: unify adoption marker format across CLI and plugin#36
Merged
guodong-sq merged 1 commit intomainfrom Mar 21, 2026
Merged
Conversation
6cc35c7 to
9e40100
Compare
Replace the plugin's JSON wt-provisioned marker with the CLI's directory-based wt/adopted approach. The marker is now a plain text file at <gitdir>/wt/adopted containing the context name. Changes: - CLI: upgrade wt/adopted from empty sentinel to carry context name - CLI: add wt_read_adopted_context to read context from marker - CLI: add fallback reads from plugin's legacy wt-provisioned JSON - Plugin: rewrite ProvisionMarkerService to use wt/adopted plain text instead of wt-provisioned JSON - Plugin: remove ProvisionMarker/ProvisionEntry data classes and Gson dependency from marker service - Plugin: fix marker write timing — write only after successful metadata import and Bazel symlinks (matching CLI semantics) - Plugin: simplify WorktreePanel tooltip (no multi-context display) - Both sides clean up legacy wt-provisioned on write Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
9e40100 to
cde8056
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Replace the plugin's JSON
wt-provisionedmarker with the CLI's original directory-basedwt/adoptedapproach. The marker is now a plain text file at<gitdir>/wt/adoptedcontaining the context name.CLI changes:
wt/adoptedfrom empty sentinel to carry the context name (echo "$context" > wt/adopted)wt_read_adopted_contextto read context name from markerwt-provisionedformat — the CLI only knowswt/adoptedPlugin changes:
ProvisionMarkerServiceto usewt/adoptedplain text (Files.readString/writeString)ProvisionMarkerandProvisionEntrydata classes (Gson no longer needed for markers)wt-provisionedJSON during transition (plugin's own migration responsibility)WorktreePaneltooltip (no multi-context provision display)wt-provisionedon writeDesign rationale:
Investigation confirmed
provisioned_atandprovisioned_byJSON fields were write-only (never read in production code), and multi-context provision tracking added complexity without value. The CLI'swt/namespace directory with a simple text file is portable, extensible, and equally functional.Backward compatibility:
wt/adoptedfiles still recognized (existence check unchanged)wt-provisionedJSON via regex fallback during transitionTest plan
cd test && bats unit/wt-adopt.bats(22 tests)cd wt-jetbrains-plugin && ./gradlew testwt listshows as adoptedwt/adoptedfiles handled gracefully🤖 Generated with Claude Code