Product / UI / CLI / docs rebrand. Internal package, repo, and
on-disk dir names stay 'cloud_sync' / 'cloud-sync' / '.cloud-sync/'
to avoid breaking existing installs; a future commit can do the
file-system rename when the cost is worth paying.
User-facing changes:
CLI prog name: cloud-sync -> instance-sync
CLI description: cloud-svc URL -> Timemachine Network endpoint
Dialog title: CLOUD SYNC -> INSTANCE SYNC
Dialog title: CLOUD CONFLICT -> INSTANCE CONFLICT
Dialog title: CONNECT CLOUD SAVE -> CONNECT TO THE NETWORK
Card label: Cloud Save -> Remote Save
Skip button: Skip cloud sync -> Skip instance sync
Body copy: 'the cloud' -> 'the Timemachine Network'
Window titles: Cloud sync — ... -> Instance sync — ...
Log prefix: cloud-sync: -> instance-sync:
Error prose: 'cloud-sync token' -> 'instance-sync token'
Backend changes:
restic --host tag: cloud-sync -> instance-sync
State.host_tag dflt: cloud-sync -> instance-sync
(Existing snapshots with the old tag still pull fine; we use 'latest'.)
Drop tkinter fallback: ui.py now offers Qt OR Headless. tkinter is
unnecessary given we already maintain Qt + headless; one less code
path to keep styled, smaller pyz. make_progress() picks Qt first,
falls through to HeadlessProgress on ImportError with a stderr hint
to 'pip install PySide6'.
README: rebrand title + prose; note repo/dir rename deferred; call
out the PySide6 install step. Conflict/login dialogs are now Qt-only;
without Qt, conflict aborts (defensive) and login tells the user to
paste the token manually.
52 tests green; no test-file label changes needed since they only
exercise internal APIs.
state.py: per-instance sync state. <pack>/.cloud-sync/state.json
(mode 600) records last_pulled_snapshot_id + last_pulled_at +
host_tag. Versioned schema. clear() on remote-empty.
sync.pull decision tree (replaces the unconditional restore):
no token file
→ prompt_login_qt; on Skip return 0 (don't block launch)
no state + remote empty
→ no-op
no state + remote non-empty
→ restore (first-run on this machine)
state.id == remote.id
→ skip restore (up to date)
state.id != remote.id, no in-scope local edits since state.at
→ restore (fast-forward)
state.id != remote.id, in-scope local edits since state.at
→ prompt_conflict_qt
keep_local → don't restore; push will overwrite cloud
use_remote → restore + update state
cancel → exit 1
sync.push: --json output parsed for snapshot_id; state.json updated
to that id after a successful backup. Skips silently if no token.
_find_modified_in_scope: walks include roots, filters via
_matches_any (restic-style globs: dir/, **/dir/, **/*.glob).
Stops at 50 hits; we only need 'any' + a sample for the dialog.
_format_dt: hand-rolled (no GNU-vs-Windows strftime quirks) →
'Thursday, October 21, 2021 at 7:12 PM'.
Restic JSON parsing helpers: _parse_snapshots, _parse_restic_time
(handles nanosecond precision), _parse_backup_summary.
tests/test_state.py: 19 new tests covering state read/write, scope-
aware mtime walk, exclude glob matching, restic output parsers.
Total: 52 green.