WebDAV sync now separates portable provider strategy from device-local
proxy state in the smallest upstream-shaped way we could keep coherent.
The backup layer scrubs and restores only the local proxy fields in
proxy_config, while backend restore now rejects when takeover artifacts
or running proxy state are still active.
The command layer was kept thin by routing proxy-setting writes back
through ProxyService, so the same-process restore/mutation boundary has
one owner instead of scattered command-side patches.
Constraint: Must stay upstream-friendly for a large open source codebase without introducing repo-specific multi-process machinery
Constraint: WebDAV restore must not clobber device-local proxy bindings or takeover state
Rejected: Exclude proxy_config from sync entirely | would also stop syncing portable proxy strategy fields
Rejected: Port local cross-process lock and managed-child bootstrap bypass | too local-repo-specific for upstream
Confidence: high
Scope-risk: moderate
Directive: Future writes to device-local proxy fields should continue to flow through ProxyService so the restore boundary remains coherent
Tested: cargo fmt --manifest-path src-tauri/Cargo.toml --check
Tested: cargo check --manifest-path src-tauri/Cargo.toml
Tested: cargo test --manifest-path src-tauri/Cargo.toml sync_import_preserves_local_proxy_config_local_fields -- --nocapture
Tested: cargo test --manifest-path src-tauri/Cargo.toml sync_export_scrubs_proxy_config_local_fields_but_keeps_strategy_fields -- --nocapture
Tested: cargo test --manifest-path src-tauri/Cargo.toml has_restore_blocking_proxy_state_is_true_when_live_backup_exists_without_enabled_flag -- --nocapture
Tested: cargo test --manifest-path src-tauri/Cargo.toml has_restore_blocking_proxy_state_is_true_when_live_config_residue_exists_without_enabled_flag -- --nocapture
Tested: cargo test --manifest-path src-tauri/Cargo.toml ensure_restore_allowed_rejects_takeover_artifacts_even_when_enabled_flag_is_false -- --nocapture
Tested: cargo test --manifest-path src-tauri/Cargo.toml proxy_config_update_waits_for_restore_mutation_guard -- --nocapture
Tested: cargo test --manifest-path src-tauri/Cargo.toml start_with_takeover_waits_for_restore_mutation_guard -- --nocapture
Not-tested: Full upstream cargo test suite
Related: SaladDay/cc-switch-cli#111