devbox/internal/syncer
shoemoney abab3b5ff9 feat(M8): restore preserves uncommitted edits (never lose a byte) 🛟
Closes the audit's deferred #18 — the right way this time. An explicit
'devbox restore' no longer silently clobbers UNCOMMITTED local edits:

- captureUncommitted reads the bytes of any local file that differs from
  BOTH the snapshot being restored AND the current hub head (== an edit
  that was never pushed) BEFORE the restore overwrites/deletes it.
- After applySnapshot runs, those bytes are written back as .conflict-
  <host>-<ts> copies (discoverable via 'devbox conflicts', and they
  propagate like any conflict copy).

The head comparison is the key: a CLEAN restore (no uncommitted edits)
captures nothing and reproduces the snapshot exactly — TestRestoreWholeTree
still passes. Capture-before / write-after ordering means applySnapshot's
delete pass never eats the copy. Refactored the conflict-name probe into a
shared freeConflictName. Deploy stays as-is (read-only/pinned mounts have
no uncommitted edits to lose). New test: an uncommitted v3 survives a
revert to v1 as a conflict copy. 18 pkgs -race green; windows builds.
2026-06-23 11:44:45 -05:00
..
deploy_test.go feat(M6.5): devbox deploy — pin a mount to a snapshot (no push) 🚀 2026-06-23 01:17:20 -05:00
fsync_test.go harden(durability): fsync atomic writes before publishing the rename 💽 2026-06-23 02:59:26 -05:00
hooks_integration_test.go feat(M5): lifecycle hooks 🪝 2026-06-23 00:48:16 -05:00
preserve_ignored_test.go fix(dataloss): don't clobber a .devignore'd/guarded local file on pull 🩸🛟 2026-06-23 02:28:51 -05:00
pull.go feat(M8): restore preserves uncommitted edits (never lose a byte) 🛟 2026-06-23 11:44:45 -05:00
pull_test.go feat(M5): lifecycle hooks 🪝 2026-06-23 00:48:16 -05:00
restore_test.go feat(M8): restore preserves uncommitted edits (never lose a byte) 🛟 2026-06-23 11:44:45 -05:00
safejoin_test.go fix(sec): contain manifest paths + verify blob integrity on download 🛡️🧊 2026-06-23 02:24:32 -05:00
syncer.go feat(M5): lifecycle hooks 🪝 2026-06-23 00:48:16 -05:00
syncer_test.go harden(auth): require proof-of-possession on join 🪪🔐 2026-06-23 03:08:23 -05:00