This document is a handoff checklist for an independent agent to continue test authoring without prior conversation context.
Primary goals:
- Start from app-level coverage, then move feature-by-feature.
- Follow test pyramid targets strictly.
- Maintain deterministic, fast tests with focused runs.
- Unit tests: 70%
- Integration tests: 20%
- UI/E2E smoke tests: 10%
Working rule:
- For every new UI test added, add 4-6 unit/integration tests in same or adjacent feature.
Completed suites:
mac-copilotTests/TestingPlanFixturesSmokeTests.swiftmac-copilotTests/SidecarLifecyclePhase1Tests.swiftmac-copilotTests/CopilotModelCatalogClientPhase2Tests.swiftmac-copilotTests/ChatViewModelPhase2Tests.swiftmac-copilotTests/GitDomainPhase3Tests.swiftmac-copilotTests/PersistencePhase4IntegrationTests.swiftmac-copilotTests/PayloadContractsPhase4Tests.swiftmac-copilotUITests/mac_copilotUITests.swift(initial Phase 5 smoke)
These should be kept green while expanding coverage.
- Work in this order:
- App and bootstrap
- Feature domain/data/viewmodel
- UI smoke and regression
- Add tests in focused files named by phase or feature scope.
- After each feature batch, run focused
xcodebuild -only-testingfor changed suites. - If UI flow is non-deterministic, use
XCTSkipwith explicit reason instead of flaky assertions. - Update this file after each feature batch.
- Full unit/integration target:
xcodebuild test -project mac-copilot.xcodeproj -scheme mac-copilot -destination 'platform=macOS,arch=arm64' -only-testing:mac-copilotTests
- UI smoke target:
xcodebuild test -project mac-copilot.xcodeproj -scheme mac-copilot -destination 'platform=macOS,arch=arm64' -only-testing:mac-copilotUITests
- Single suite pattern:
xcodebuild test -project mac-copilot.xcodeproj -scheme mac-copilot -destination 'platform=macOS,arch=arm64' -only-testing:mac-copilotTests/<SuiteName>
Checklist:
- App bootstraps onboarding vs authenticated shell deterministically.
- Environment/container wiring verified for all injected dependencies.
- Persistent stores roundtrip correctly for model/tool preferences.
Progress notes:
- 2026-02-26: Added
mac-copilotTests/AppStoresPhaseAUnitTests.swiftcoveringAppBootstrapService,ModelSelectionStore,NativeToolsStore,CompanionStatusStore, andAppEnvironment/AppContainerwiring checks. Focused run passed with-only-testing:mac-copilotTests/AppStoresPhaseAUnitTests. - 2026-02-26:
mac-copilotUITests/mac_copilotUITests/testSmoke_launchShowsOnboardingOrShellrun is currently blocked by runner termination failure (Failed to terminate co.uk.appwebdev.mac-copilot), so launch-path checkbox remains open until UI runner stability is resolved.
Target files:
mac-copilot/App/Bootstrap/mac_copilotApp.swiftmac-copilot/App/Bootstrap/WindowFrameGuard.swiftmac-copilot/App/Environment/AppEnvironment.swiftmac-copilot/App/Environment/AppContainer.swiftmac-copilot/App/Environment/AppBootstrapService.swiftmac-copilot/App/Environment/AuthEnvironment.swiftmac-copilot/App/Environment/ShellEnvironment.swiftmac-copilot/App/Environment/CompanionEnvironment.swiftmac-copilot/App/Environment/ChatViewModelProvider.swiftmac-copilot/App/Environment/Stores/ModelSelectionStore.swiftmac-copilot/App/Environment/Stores/ModelSelectionPreferencesStore.swiftmac-copilot/App/Environment/Stores/NativeToolsStore.swiftmac-copilot/App/Environment/Stores/NativeToolsPreferencesStore.swiftmac-copilot/App/Environment/Stores/CompanionStatusStore.swift
Test types:
- Unit: env and store behaviors.
- Integration: bootstrap and persistence boundaries.
- UI smoke: launch path assertions.
Checklist:
- HTTP transports have contract tests (status handling, payload pass-through).
- Delay/clock seams are used in tests; no real sleeps in unit tests.
- SwiftData stack fallback behavior is covered.
Target files:
mac-copilot/Shared/Data/Networking/HTTPDataTransport.swiftmac-copilot/Shared/Data/Networking/HTTPLineStreamTransport.swiftmac-copilot/Shared/Data/Async/AsyncDelayScheduler.swiftmac-copilot/Shared/Data/Time/ClockProvider.swiftmac-copilot/Shared/Data/Persistence/SwiftDataStack.swiftmac-copilot/Shared/Data/Persistence/SwiftDataStoreProviding.swift
Checklist:
- Device flow start/poll/sign-out state transitions.
- Repository state publishing behavior.
- Sidecar auth client request/response mapping and error handling.
- Onboarding and auth viewmodel interaction state.
Target files:
mac-copilot/Features/Auth/Data/GitHubAuthRepository.swiftmac-copilot/Features/Auth/Data/GitHubAuthService.swiftmac-copilot/Features/Auth/Data/Support/SidecarAuthClient.swiftmac-copilot/Features/Auth/Data/Support/KeychainTokenStore.swiftmac-copilot/Features/Auth/Data/Support/AuthAPIModels.swiftmac-copilot/Features/Auth/Domain/Entities/AuthSessionState.swiftmac-copilot/Features/Auth/Domain/UseCases/AuthUseCases.swiftmac-copilot/Features/Auth/Presentation/AuthViewModel.swiftmac-copilot/Features/Auth/Presentation/AuthView.swiftmac-copilot/Features/Auth/Presentation/OnboardingRootView.swift
Checklist:
- Model catalog and send-flow core coverage.
- Chat session coordinator persistence behavior.
- Transcript/composer state behavior around metadata/status/tool chips.
- Prompt stream protocol edge cases and marker filtering.
- SwiftData chat repo decode/invalid-role resilience.
Target files:
mac-copilot/Features/Chat/Data/CopilotAPIService.swiftmac-copilot/Features/Chat/Data/CopilotModelCatalogClient.swiftmac-copilot/Features/Chat/Data/CopilotPromptStreamClient.swiftmac-copilot/Features/Chat/Data/CopilotPromptRepository.swiftmac-copilot/Features/Chat/Data/Local/SwiftDataChatRepository.swiftmac-copilot/Features/Chat/Data/Local/Models/ChatThreadEntity.swiftmac-copilot/Features/Chat/Data/Local/Models/ChatMessageEntity.swiftmac-copilot/Features/Chat/Domain/UseCases/SendPromptUseCase.swiftmac-copilot/Features/Chat/Domain/UseCases/FetchModelsUseCase.swiftmac-copilot/Features/Chat/Domain/UseCases/FetchModelCatalogUseCase.swiftmac-copilot/Features/Chat/Presentation/ViewModel/ChatViewModel.swiftmac-copilot/Features/Chat/Presentation/ViewModel/ChatViewModel+SendFlow.swiftmac-copilot/Features/Chat/Presentation/ViewModel/ChatViewModel+ModelCatalog.swiftmac-copilot/Features/Chat/Presentation/ViewModel/ChatViewModel+Metadata.swiftmac-copilot/Features/Chat/Presentation/Support/ChatSessionCoordinator.swiftmac-copilot/Features/Chat/Presentation/ChatView.swiftmac-copilot/Features/Chat/Presentation/Components/ChatComposerView.swiftmac-copilot/Features/Chat/Presentation/Components/ChatTranscriptView.swiftmac-copilot/Features/Chat/Support/PromptTrace.swift
Checklist:
- Lifecycle policy/state machine baseline complete.
- Preflight and node/runtime resolution negative paths.
- Health probe and HTTP client retry/escalation matrix.
- Runtime utilities process command and stale-process handling.
Target files:
mac-copilot/Features/Sidecar/Data/Lifecycle/SidecarManager.swiftmac-copilot/Features/Sidecar/Data/Lifecycle/SidecarStateMachine.swiftmac-copilot/Features/Sidecar/Data/Lifecycle/SidecarRestartPolicy.swiftmac-copilot/Features/Sidecar/Data/Runtime/SidecarPreflight.swiftmac-copilot/Features/Sidecar/Data/Runtime/SidecarHealthProbe.swiftmac-copilot/Features/Sidecar/Data/Runtime/SidecarRuntimeUtilities.swiftmac-copilot/Features/Sidecar/Data/Runtime/SidecarNodeRuntimeResolver.swiftmac-copilot/Features/Sidecar/Data/Runtime/SidecarScriptResolver.swiftmac-copilot/Features/Sidecar/Data/Runtime/SidecarReusePolicy.swiftmac-copilot/Features/Sidecar/Data/Support/SidecarHTTPClient.swiftmac-copilot/Features/Sidecar/Data/Process/SidecarProcessController.swiftmac-copilot/Features/Sidecar/Data/Process/SidecarCommandRunner.swift
Checklist:
- Git parser/manager baseline complete.
- Shell selection, chat creation/deletion, project expansion state.
- Context pane routing and refresh behavior.
- Models/MCP management viewmodel command-state logic.
Target files:
mac-copilot/Features/Shell/Presentation/ShellViewModel.swiftmac-copilot/Features/Shell/Presentation/Support/ShellWorkspaceCoordinator.swiftmac-copilot/Features/Shell/Presentation/Support/ProjectCreationService.swiftmac-copilot/Features/Shell/Presentation/ContextPaneViewModel.swiftmac-copilot/Features/Shell/Presentation/ContentView.swiftmac-copilot/Features/Shell/Presentation/Components/Layout/ShellDetailPaneView.swiftmac-copilot/Features/Shell/Presentation/Components/Layout/ShellSidebarView.swiftmac-copilot/Features/Shell/Presentation/Components/Layout/ShellSidebarBottomBarView.swiftmac-copilot/Features/Shell/Presentation/Components/Layout/ShellSidebarProjectsHeaderView.swiftmac-copilot/Features/Shell/Presentation/Components/Layout/ControlCenterView.swiftmac-copilot/Features/Shell/Presentation/Components/Layout/ControlCenterViewModel.swiftmac-copilot/Features/Shell/Data/LocalGitRepositoryManager.swiftmac-copilot/Features/Shell/Data/LocalGitRepositoryParsing.swiftmac-copilot/Features/Shell/Data/LocalGitCommandRunner.swift
Checklist:
- Project adapter resolution precedence by project shape.
- Runtime manager start/stop/refresh state transitions.
- Runtime diagnostics/logging behavior across adapters.
- Utility command/file/network/delay seams covered.
Target files:
mac-copilot/Features/ControlCenter/Domain/UseCases/ProjectControlCenterResolver.swiftmac-copilot/Features/ControlCenter/Data/RuntimeManager/ControlCenterRuntimeManager.swiftmac-copilot/Features/ControlCenter/Data/RuntimeManager/ControlCenterRuntimeManager+Startup.swiftmac-copilot/Features/ControlCenter/Data/RuntimeManager/ControlCenterRuntimeManager+Process.swiftmac-copilot/Features/ControlCenter/Data/RuntimeManager/ControlCenterRuntimeManager+Logging.swiftmac-copilot/Features/ControlCenter/Data/RuntimeManager/ControlCenterRuntimeManager+Diagnostics.swiftmac-copilot/Features/ControlCenter/Data/ControlCenterRuntimeUtilities.swiftmac-copilot/Features/ControlCenter/Data/Adapters/Project/NodeControlCenterAdapter.swiftmac-copilot/Features/ControlCenter/Data/Adapters/Project/PythonProjectControlCenterAdapter.swiftmac-copilot/Features/ControlCenter/Data/Adapters/Project/SimpleHTMLControlCenterAdapter.swiftmac-copilot/Features/ControlCenter/Data/Adapters/Runtime/NodeRuntimeAdapter.swiftmac-copilot/Features/ControlCenter/Data/Adapters/Runtime/PythonRuntimeAdapter.swiftmac-copilot/Features/ControlCenter/Data/Adapters/Runtime/SimpleHTMLRuntimeAdapter.swift
Checklist:
- Project creation/fetch ordering and mapping.
- SwiftData project persistence error handling.
Target files:
mac-copilot/Features/Project/Data/Local/SwiftDataProjectRepository.swiftmac-copilot/Features/Project/Data/Local/Models/ProjectEntity.swiftmac-copilot/Features/Project/Domain/UseCases/ProjectUseCases.swift
Checklist:
- Profile fetch happy/failure mapping.
- ViewModel loading/error state transitions.
- Endpoint and Copilot status card rendering logic.
Target files:
mac-copilot/Features/Profile/Data/GitHubProfileRepository.swiftmac-copilot/Features/Profile/Domain/UseCases/FetchProfileUseCase.swiftmac-copilot/Features/Profile/Presentation/ProfileViewModel.swiftmac-copilot/Features/Profile/Presentation/ProfileView.swiftmac-copilot/Features/Profile/Presentation/Components/CopilotStatusCardView.swiftmac-copilot/Features/Profile/Presentation/Components/EndpointCheckCardView.swiftmac-copilot/Features/Profile/Presentation/Components/UserProfileSummaryView.swift
Checklist:
- Snapshot payload contract baseline complete.
- Connection service lifecycle + polling/error paths.
- Companion client decode/error handling matrix.
- In-memory service parity tests against expected API.
Target files:
mac-copilot/Features/Companion/Data/SidecarCompanionConnectionService.swiftmac-copilot/Features/Companion/Data/Support/SidecarCompanionClient.swiftmac-copilot/Features/Companion/Data/SidecarCompanionWorkspaceSyncService.swiftmac-copilot/Features/Companion/Data/InMemoryCompanionConnectionService.swift
Checklist:
- Companion store snapshot merge and pagination.
- Companion persistence read/write fallback behavior.
- Prompt route framing and protocol markup integrity.
- Model catalog and session manager contract behavior.
Target files:
sidecar/src/companion/chatStore.tssidecar/src/companion/chatStorePersistence.tssidecar/src/companion/persistence.tssidecar/src/companion/routes.tssidecar/src/companion/store.tssidecar/src/promptRoute.tssidecar/src/promptStreaming/protocolMarkup.tssidecar/src/promptStreaming/toolExecution.tssidecar/src/copilot/copilotModelCatalog.tssidecar/src/copilot/copilotPromptStreaming.tssidecar/src/copilot/copilotSessionManager.tssidecar/src/sidecarRuntime.tssidecar/src/index.ts
Current:
- Launch path smoke (
onboardingvsshell) inmac-copilotUITests/mac_copilotUITests.swift - Guarded chat composer smoke in
mac-copilotUITests/mac_copilotUITests.swift
Remaining:
- Project create/open smoke (stable deterministic fixture project)
- Chat select + send smoke (assert streamed assistant text appears)
- Control Center start/open/logs smoke
- Regression smoke for composer growth and transcript auto-scroll anchor
UI files:
mac-copilotUITests/mac_copilotUITests.swiftmac-copilotUITests/mac_copilotUITestsLaunchTests.swift
A batch is complete only when all are true:
- New tests pass in focused local run.
- Existing related suites remain green.
- No new flaky waits/sleeps; deterministic assertions only.
- This checklist is updated with
[x]statuses and notes.
- Unit suites:
<Feature><Scope>UnitTests.swift - Integration suites:
<Feature><Scope>IntegrationTests.swift - UI suites:
<Feature><Scope>UITests.swift
Examples:
AuthViewModelUnitTests.swiftControlCenterRuntimeManagerIntegrationTests.swiftShellSmokeUITests.swift
- App + stores batch
- Add tests for
AppBootstrapService,ModelSelectionStore,NativeToolsStore,CompanionStatusStore.
- Auth + Profile batch
- Add repository/use-case/viewmodel unit tests.
- Control Center batch
- Add resolver/runtime manager integration tests with fake command runner and health transport.