task_plan.md
Deliver an executable implementation plan for cloud sync of settings, using wox.core/setting/store.go as the primary integration point.
Phase 3
wox.core/setting/store.gowox.core/setting/store.goCloudSyncDisabledPlugins to WoxSetting + DTO + Flutter entity (synced config)WoxSettingStore.Set/Delete and PluginSettingStore.Set/Delete/DeleteAll/v1/sync/* endpoints (push/pull/key/reset)PostSettingUpdate, plugin setting callbacks)SettingValue.syncable flag (default true) to decide sync eligibility| Decision | Rationale |
|---|---|
| Include plugin settings in sync scope | User requirement |
| Official paid Wox cloud service as backend | Product direction |
| Auth via user login (token-based) | Aligns with account system |
| Conflict resolution: automatic LWW | User requirement |
| Auto sync triggers after save | User requirement |
| Encrypt sync payloads with AES-256-GCM (client-side) | Authenticated encryption for synced data |
| Persist per-user encryption key after first login in OS keychain | Enables automatic sync without re-auth each time |
| Recovery code loss requires explicit user confirmation before reset | User requirement |
| New devices require recovery code to unwrap DEK | No server escrow; user-controlled access |
| All SettingValue are syncable | User requirement |
| Per-plugin sync exclusion list stored as a setting | User requirement |
| Remote pull via periodic polling + startup/manual triggers | Practical without server push |
| Recovery code KDF uses Argon2id | User choice |
| Argon2id defaults: mem=64MiB, iter=3, parallelism=2, hash_len=32, salt_len=16 | Security/perf balance for desktop |
| First-time sync uses cloud as source of truth | User requirement |
| Platform-specific settings sync full PlatformValue JSON | User requirement |
| Sync eligibility uses SettingValue.syncable (default true) | User requirement |
| Error | Attempt | Resolution |
|---|---|---|
session-catchup.py failed via python (exit code 1) | 1 | Re-ran with python3 successfully |
| UpdateCloudSyncState return mismatch in CloudSyncManager | 1 | Adjusted call sites to handle returned state + error |
wox.core/cloudsync; setting-specific adapters live in wox.core/cloudsync/settingadapter (not yet wired).