mirror of
https://github.com/basicmachines-co/basic-memory
synced 2026-06-21 13:47:35 +00:00
e23363606a
Adds `bm cloud push` and `bm cloud pull` as git-style, fail-safe transfer primitives that are usable on Team workspaces (issue #858), and restricts the destructive `bm cloud sync` mirror to Personal workspaces. Why - `bm cloud sync` is a destructive local->cloud mirror; on a shared Team bucket it can delete a teammate's files. The only pull path was two-way `bisync`, which is already Personal-only (#849). - Teams need a safe way to fetch teammates' notes and add their own without one stale local tree becoming authoritative for shared cloud state. What - push = `rclone copy` local->cloud, pull = `rclone copy` cloud->local. Both are additive (never delete on the destination), so neither can damage shared state. - Conflicts (a file that differs on both sides) abort by default and list the paths, like git refusing to clobber local changes / rejecting a stale push. `--on-conflict {fail|keep-local|keep-cloud|keep-both}` lets the user decide; no vague --force, no silent winner. - `sync` now requires a Personal workspace; its guard and the bisync guard point Team users at push/pull. Limitations (surfaced in --help and command output, tracked by #862): - No sync baseline yet, so deletions are not propagated and every divergence is treated as a conflict rather than auto-resolved. Real three-way merge needs the per-client manifest + Tigris snapshot baseline designed in #862. Implementation - rclone_commands.py: shared `_build_transfer_cmd`/`_transfer_endpoints`; refactor `project_sync` onto them (no behavior change); add `project_diff` (conflict detection via `rclone check --combined`), `project_copy`, `project_copy_file`, and `project_transfer` (strategy dispatch). - project_sync.py: new `push`/`pull` commands (ungated, Team-safe) with `--on-conflict`/`--dry-run`; gate `sync` to Personal via a per-command guard message. - Tests at the rclone-argv and CLI-command levels; existing sync/bisync tests updated for the new gating and messages. Signed-off-by: phernandez <paul@basicmachines.co>