feat!: newcomer safety — block unmanaged overwrites, snapshot/restore, safe default names, YAML upload - #14
Merged
Merged
Conversation
…, safe default names, YAML upload Protects a first-time user who imports a shared bundle and syncs from silently destroying their own agent config, and stops generated names from clashing with agent built-ins. - Sync (spec 004): a whole-file target that exists on disk but loadout never installed is a conflict — skipped by default; --force (CLI) / a checkbox (web) overwrites on purpose. Before any overwrite or delete, originals are snapshotted to a machine-local backup; `loadout restore` recovers them. - Naming (spec 005): optional wizard namespace prefix (/plan -> /af-plan); advisory reserved-name warnings in wizard, `new`, `bundle import`, `doctor`; the web import file picker accepts .yaml/.yml (backend already sniffed). BREAKING CHANGE: `loadout sync` no longer overwrites files it did not install; pass --force to opt in (a snapshot is taken first). Specs: docs/specs/004-sync-safety.md, docs/specs/005-naming-safety.md Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
StructLint — All checks passed276 rules validated against
|
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.
Why
A first-time user who imports someone else's bundle (
.tar.gzor.loadout.yaml) and runsloadout synccould have their own pre-existing agent config silently overwritten — skills/commands/hook-scripts are whole-file writes, andengine.Applynever consulted install state. There was no backup and no undo. Separately, generated command names likeplancollide with Claude Code's built-in/plan.This PR closes both gaps. Bundle import was already safe (store-only, gated); the danger was at sync time.
What changed
Sync safety (spec 004)
MergeReplacetarget that exists on disk but loadout never installed (or can't prove it owns) is aconflict— skipped.--force(CLI) / a checkbox (web) overwrites on purpose. Skipped conflicts are not recorded in state, so they can't be clobbered on a later sync (regression-tested).loadout restore. Before any overwrite/delete, originals are copied to a timestamped machine-local backup (fail-closed).loadout restorelists/restores them; restores are themselves snapshotted and never touch install state. Retention viabackups.keep(default 10).Naming safety (spec 005)
/plan→/af-plan, applied to defaulted names only (explicit renames win).loadout new,bundle import,doctor..yaml/.ymlfiles (backend already content-sniffed).Breaking change
loadout syncno longer overwrites files it did not install. Pass--forceto opt in (a snapshot is taken first).Verification
go test -race ./...— 222 pass ·golangci-lint0 issues ·gofmtcleantscclean ·make build-webcommittedplancommand → naming warning fires → sync blocks the clobber of the user's ownplan.md→--force+restorebrings the original back byte-for-byte.Specs:
docs/specs/004-sync-safety.md,docs/specs/005-naming-safety.md🤖 Generated with Claude Code