[ALFMOB-421] Add Alfie Companion app, retire DebugMenu, wire config override chain#81
Draft
amccall-mindera wants to merge 5 commits into
Draft
[ALFMOB-421] Add Alfie Companion app, retire DebugMenu, wire config override chain#81amccall-mindera wants to merge 5 commits into
amccall-mindera wants to merge 5 commits into
Conversation
- Add AppGroupUserDefaults (App Group suite wrapper, UserDefaultsProtocol conformance) - Add DebugAppConfigurationProvider (reads group.com.mindera.alfie.shared, position-0 in chain) - Wire ServiceProvider: sharedDefaults passed only to ApiEndpointService; Bag/Wishlist keep standard defaults - Remove DebugConfigurationProvider and #if DEBUG chain insertion - Delete DebugMenu SPM module and DebugMenuTests (including style-guide/demo gallery) - Remove DebugConfigurationProviderProtocol and FeatureToggleViewModelProtocol (now dead) - Clean HomeViewModel, HomeViewModelProtocol, MockHomeViewModel, Home+Toolbar of debug menu wiring - Slim HomeDependencyContainer to sessionService-only; update AppFeatureViewModel callsite - Remove ToolbarItemProvider.debugMenuItem - Add DebugAppConfigurationProviderTests and AppGroupUserDefaultsTests Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Follows the same pattern as the main-app Firebase plists. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Collapse main app bundle ID to com.mindera.alfie for both Debug and Release (step 4) - Remove Debug GoogleService-Info.plist; main app now uses single Firebase app (step 4) - Add com.apple.security.application-groups to Alfie.entitlements (step 5) - Create Alfie Companion target (com.mindera.alfie.companion) with entitlements, GoogleService-Info.plist, and Xcode-generated test targets (step 5) - Implement companion UI: FlagsView (known + custom flags), EndpointView (picker + custom URL), InspectorView (Firebase RC + local_config.json + App Group browser), CompanionStore (ObservableObject wrapping App Group UserDefaults), Reset All (step 6) - Firebase configured on companion launch via FirebaseApp.configure() Pending: link Model and FirebaseRemoteConfig package products to Alfie Companion target in Xcode (packageProductDependencies empty — step 5.4 incomplete) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…bility - Xcode: add Core and Model packageProductDependencies to Alfie Companion target (fixes "packageProductDependencies empty" noted in prior commit) - CompanionStore: add missing `import Combine` (needed for @published / ObservableObject even if available transitively via Model) - Make endpointKey file-private (was module-internal with no reason to be) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ALFMOB-421 — iOS Debug Companion App v1
Implements all agent-doable and Xcode-UI steps. Remaining prerequisite: run
./Alfie/scripts/verify.sh(requires Xcode) and complete TestFlight distribution (step 8) + device end-to-end validation (step 9.2).What changed
New — shared storage primitives (SPM, no pbxproj)
AlfieKit/Sources/Model/Services/Persistence/AppGroupUserDefaults.swift—UserDefaultsProtocolwrapper aroundUserDefaults(suiteName:); falls back to.standardif suite unavailable.AlfieKit/Sources/Core/Services/Configuration/Providers/DebugAppConfigurationProvider.swift— reads App Group suitegroup.com.mindera.alfie.sharedat position 0 of the config chain; returnsnilwhen key absent so the chain falls through to Firebase → Local → defaults.Modified —
Alfie/Alfie/Service/ServiceProvider.swiftsharedDefaults(AppGroupUserDefaults) passed only toApiEndpointService— companion endpoint override reads from the App Group.userDefaults = .standardkept forBagService/WishlistServiceto avoid silently relocating persisted data.#if DEBUG DebugConfigurationProvider.sharedreplaced byDebugAppConfigurationProvider()at position 0 unconditionally (no-op when App Group suite is empty).Removed — DebugMenu SPM module
AlfieKit/Sources/DebugMenu/+DebugConfigurationProvider.swift/DebugConfigurationProviderProtocol.swift.Package.swift: removedDebugMenuproduct, target,Homedep on it,DebugMenuTeststarget; addedMocksas directHomedep (was transitive viaDebugMenu → Mocks; needed forHomeView #Preview).HomeViewModel: removedimport DebugMenu,didTapDebugMenu(),fullScreenCover, deadconfigurationService/apiEndpointServiceproperties.HomeDependencyContainerslimmed tosessionServiceonly;AppFeatureViewModel,HomeViewModelProtocol,MockHomeViewModel,Home+Toolbar,ToolbarItemProviderupdated accordingly.New — unit tests
AlfieKit/Tests/CoreTests/ServiceTests/DebugAppConfigurationProviderTests.swift— override-wins and fall-through paths.AlfieKit/Tests/CoreTests/ServiceTests/AppGroupUserDefaultsTests.swift— read/write/remove round-trips.New — Alfie Companion target + UI (Xcode steps)
Alfie/Alfie Companion/— new iOS app target, bundle idcom.mindera.alfie.companion, same signing team.Alfie/Alfie/Alfie.entitlements—com.apple.security.application-groupsadded forgroup.com.mindera.alfie.shared.Alfie/Alfie Companion/Alfie Companion.entitlements— same App Group capability on companion side.com.mindera.alfie(same as Release);Configuration/Debug/GoogleService-Info.plistremoved (main app uses single Firebase app).CompanionStore.swift(ObservableObject over App Group suite),FlagsView.swift(known + custom flag overrides),EndpointView.swift(endpoint picker + custom URL),InspectorView.swift(Firebase RC + local_config.json + App Group browser + Reset All).Alfie_CompanionApp.swiftcallsFirebaseApp.configure()on launch;ContentView.swifttabs into the three views.local_config.jsonadded to companion target via pbxproj build file exception.CoreandModelSPM package products linked to companion target.Docs + gitignore
DebugMenureferences fromDocs/Testing.md,Docs/Architecture.md,Docs/QuickReference.md,README.md.Alfie/Alfie Companion/GoogleService-Info.plistadded to.gitignore(same pattern as main-app Firebase plists managed by git-secret).Key invariants for reviewer
ServiceProvider.swift:sharedDefaultsflows only toApiEndpointService—BagService/WishlistServiceat ~lines 98–109 still useself.userDefaults(.standard).ConfigurationKey.allCasesused inCompanionStoreandFlagsView— this works becauseConfigurationKeyhas an explicitallCasesthat enumerates only the named cases (excluding.custom(_)), which is exactly the right scope for Reset All and the flags list.endpointKeyisprivateinCompanionStore.swift— not accidentally exported.Items requiring human verification
verify.sh— mandatory gate perCLAUDE.md. Must pass before flipping to ready.import FirebaseinAlfie_CompanionApp.swift— companion linksCore(which depends onFirebaseAnalytics,FirebaseCrashlytics,FirebaseRemoteConfig). Verify that theFirebaseumbrella module is available at compile time; if not, addFirebaseCoreas an explicit package dep in Xcode.GoogleService-Info.plist(gitignored) — rungit secret revealor copy the companion plist intoAlfie/Alfie Companion/before building.com.mindera.alfie.companion, internal eng/QA group; archive and upload.🤖 Generated with Claude Code