Repository navigation
feat!: keep local edits on sync by default and add loadout adopt - #24
Draft
machado144 wants to merge 1 commit into
Draft
machado144 wants to merge 1 commit into
machado144 wants to merge 1 commit into
Conversation
* sync/install/switch hold back hand-edited skills, commands and managed blocks (! keep), --force overwrites them after a snapshot (! overwrite-local) * skipped local edits keep their install record; shared files re-merge at write time so a sibling block never reverts a held-back edit * diff (CLI + web) shows held-back items; web dock and TUI label them distinctly * new loadout adopt <artifact> --agent <agent> copies local edits into the store, verified by a byte-exact re-render, store snapshotted first Refs #23 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
✅ PR title follows the required formatCurrent title: |
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.
Refs #23 — spec 010 is pending review; this is a draft until it is approved.
What
loadout syncused to overwrite hand-edited files it had installed (drifted-local) and show them as a plainupdate. Now those edits are kept unless you say otherwise.Before (v0.1.0, with a hand-edited
conventionsblock in~/.claude/CLAUDE.md):After:
With
--force, the line reads! overwrite-local …and the file is snapshotted before the write.Changes
Item.LocalEditcovers skill/command/hook-script files and managed blocks that aredrifted-local, or where both the store and the disk changed. Local edits are left out ofChanges()by default and come back in withOverwriteConflicts(--force). A skipped edit keeps its previous install record.loadout adopt <artifact> --agent <agent>: rebuilds the store content from the installed copy, shows the store diff and asks before writing (--dry-run,--yes). It snapshots the store first, soloadout restorecan undo it, and refreshes the install record. It refuses when the agent rewrites the format, e.g. gemini-cli installs commands as generated skills. Correctness is checked by re-rendering the result and requiring an exact byte match with disk.diff(CLI and web) now also shows held-back items. The web sync dock labels them! keep/! discard, and the TUI logs them separately.Behaviour change
Anyone who relied on
syncto undo hand edits now has to pass--force. Spec 004 R5 is annotated as superseded. Hencefeat!.Tests
internal/engine/localedit_test.gofirst reproduced the silent overwrite (failing), then the fix made it pass. It also covers both-moved, store-only (still a plain update), forced+snapshot, and the shared-file sibling case, including a mutation check of the plan-time threading.internal/engine/adopt_test.go: block and skill adopt, disk-only files ignored, the confirmation gate, refusal for an unknown or uninstalled artifact, and gemini-cli refused as not reversible.integration/drift_test.go(real binary, temp HOME): dry-run marking, a second sync still protects the edit,diffshows it,--forcefollowed byrestorebrings the edit back, adopt dry-run/decline/yes leavesstatusin-sync and the next sync a no-op, and bad invocations fail.go test -race ./...,-tags integration, golangci-lint (0 issues), vitest (69 passed). The web dist was rebuilt.🤖 Generated with Claude Code