Files
yaak-mountain-loop/crates-cli
Gregory Schier c2b4be421f Keep ownership records for skill files that survive removal
Three ownership-loss paths found in review, all variations on discarding
the manifest while the file it describes is still on disk.

`remove` deleted the manifest unconditionally. When it deliberately kept
a file the user had edited, the next install saw an untracked file and
overwrote those edits without --force, undoing the preservation that
removal had just performed. It now writes back a manifest covering
everything still present, and only deletes it when the directory is
actually empty.

The same applied to files it could not delete: the record vanished, the
file stayed, and removal still reported success. Those are now retained,
reported, and retried by a later run.

Upgrade cleanup had the mirror problem, dropping stale entries from the
new manifest even when deletion failed, orphaning a file we know we
wrote. It keeps tracking those so a later install can retry.

A failed manifest write during removal is now a warning rather than an
abort, since the previous manifest still lists every retained file and
other targets should still be processed.
2026-08-13 22:16:39 -07:00
..