Skip to content

chore: remove legacy keychain and brand migration code - #39

Merged
victorhqc merged 1 commit into
mainfrom
feat/remove-migrated-code
Jul 25, 2026
Merged

chore: remove legacy keychain and brand migration code#39
victorhqc merged 1 commit into
mainfrom
feat/remove-migrated-code

Conversation

@victorhqc

@victorhqc victorhqc commented Jul 25, 2026

Copy link
Copy Markdown
Owner

Summary

Retires the one-time Keychain consolidation migration (core 04) and the Core preferences branding migration now that every user who was going to run them has done so.

Why

The migration code inflates Keychain.swift, KeychainStorage.swift, and AppMain.swift with dead paths that are never exercised after the first launch post-migration. Removing it simplifies the core layer and eliminates the [String: String] fallback and legacy-service reads from the Keychain read path.

What changed

  • Keychain — removed migrateStore, mergeMigrationItems, legacyConsolidatedStore, migrationItems, previousService, legacyAccountPrefix, the isLegacy flag in ConsolidatedStore, and KeychainError.migrationFailed. decodeStore now only handles [String: [String: String]].
  • Keychain storage protocol — removed readLegacyItems and StoredKeychainItem from the protocol and its SecurityKeychainStorage / InMemoryKeychainStorage implementations.
  • Branding migration — deleted Sources/Core/LegacyBrandMigration.swift and the do/catch block in AppMain.init() that called it.
  • Tests — deleted LegacyBrandKeychainMigrationTests.swift and LegacyBrandMigrationTests.swift. Moved the non-migration assertions (field-map round trip, failed-update preservation) into KeychainTests.swift. Updated the error-case enumeration test.

Notes for review

  • Straightforward deletion. The ClaudeCode provider's own brand migration (Sources/Providers/ClaudeCode/LegacyBrandMigration.swift) is deliberately left in place — it's provider-scoped and still reachable through setup paths.
  • After this change, a user who hasn't launched Filbert since before (core 04) will see a load error instead of a silent migration and must re-enter keys or re-import Cursor credentials. This is the explicit tradeoff called out in the spec (core 06 AC2).

The one-time migrations from the previous brand and from
pre-consolidated
keychain items have served their purpose. Removing them simplifies the
Keychain layer, the app startup path, and the test suite.

The ClaudeCode provider's own brand migration is deliberately untouched
to preserve provider orthogonality.
@victorhqc
victorhqc merged commit 5e2a88b into main Jul 25, 2026
1 check passed
@victorhqc
victorhqc deleted the feat/remove-migrated-code branch July 25, 2026 11:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant