BREAKING CHANGE: Runtime auto-migration from v1 to v2 config format has been removed. Changes: - Remove automatic v1→v2 migration logic from MultiAppConfig::load() - Improve v1 detection using structural analysis (checks for 'apps' key absence) - Return clear error with migration instructions when v1 config is detected - Add comprehensive tests for config loading edge cases - Fix false positive detection when v1 config contains 'version' or 'mcp' fields Migration path for users: 1. Install v3.2.x to perform one-time auto-migration, OR 2. Manually edit ~/.cc-switch/config.json to v2 format Rationale: - Separates concerns: load() should be read-only, not perform side effects - Fail-fast principle: unsupported formats should error immediately - Simplifies code maintenance by removing migration logic from hot path Tests added: - load_v1_config_returns_error_and_does_not_write - load_v1_with_extra_version_still_treated_as_v1 - load_invalid_json_returns_parse_error_and_does_not_write - load_valid_v2_config_succeeds
4.2 KiB
4.2 KiB