Last Updated: 2026-05-25
This inventory supports Milestone 9 in Refactoring-Plan.md.
SwiftData is legacy/prototype infrastructure only. The target app must launch
and run active Time Machine flows from SQLite archive + Core Data cache, with
local settings stored outside SwiftData where needed.
After removing unused imports from pure legacy services, 28 app files still have SwiftData imports.
These files keep SwiftData required at app launch:
HealthProbe/HealthProbeApp.swiftHealthProbe/ContentView.swiftRetirement path:
- move local settings models (DeviceProfile, MetricTimeoutProfile,
OperationLog) to non-SwiftData storage or Core Data cache/local store;
- replace prototype snapshot model dependencies in tab roots;
- remove .modelContainer(...) once no active view needs @Query or
ModelContext.
These files define SwiftData @Model classes and are the largest retirement
block:
HealthProbe/Models/AnomalyRecord.swiftHealthProbe/Models/DeviceProfile.swiftHealthProbe/Models/HealthRecord.swiftHealthProbe/Models/HealthSnapshot.swiftHealthProbe/Models/MetricTimeoutProfile.swiftHealthProbe/Models/OperationLog.swiftHealthProbe/Models/SnapshotDelta.swiftHealthProbe/Models/TypeCount.swiftHealthProbe/Models/TypeDelta.swiftHealthProbe/Models/TypeDistributionBin.swiftHealthProbe/Models/YearlyCount.swiftRetirement path:
- replace HealthSnapshot, TypeCount, SnapshotDelta, TypeDelta,
YearlyCount, TypeDistributionBin, and HealthRecord active reads with
archive/cache DTOs;
- replace AnomalyRecord flows with neutral change/diff DTOs;
- move DeviceProfile, MetricTimeoutProfile, and OperationLog to a local
non-SwiftData store before removing the launch container.
These services still write/read legacy SwiftData transition models:
HealthProbe/Services/DeltaService.swiftHealthProbe/Services/HealthKitService.swiftHealthProbe/Services/ObserverService.swiftHealthProbe/Services/SnapshotLifecycleService.swiftHealthProbe/Utilities/TypeCountArchiveRepair.swiftRetirement path: - make capture persist archive observations first and expose only bridge ids while transition UI still exists; - move timeout learning and operation logging out of SwiftData; - delete legacy record repair once old SwiftData stores are no longer opened; - remove snapshot deletion/repair logic after archive/cache navigation replaces prototype snapshots.
These active surfaces still use @Query, ModelContext, or SwiftData model
types:
HealthProbe/ViewModels/DashboardViewModel.swiftHealthProbe/ViewModels/DataTypeTemporalDistributionViewModel.swiftHealthProbe/Views/Dashboard/DashboardView.swiftHealthProbe/Views/DataTypes/DataTypeTemporalDistributionView.swiftHealthProbe/Views/DataTypes/DataTypesView.swiftHealthProbe/Views/DataTypes/RecordChangeEvolutionChart.swiftHealthProbe/Views/Settings/SettingsView.swiftHealthProbe/Views/Snapshots/DataTypeSnapshotDetailView.swiftHealthProbe/Views/Snapshots/SnapshotDetailView.swiftHealthProbe/Views/Snapshots/SnapshotsView.swiftRetirement path:
- replace tab-root @Query snapshot lists with Core Data cache observation
queries plus archive ids;
- replace detail navigation parameters from SwiftData models to observation/type
DTOs;
- move Settings device profile and timeout profile rows to local non-SwiftData
storage;
- keep paged record drill-down and export paths on archive APIs.
The following files no longer import SwiftData because they only use already declared app model types and do not need SwiftData APIs directly:
HealthProbe/Services/AnomalyDetector.swiftHealthProbe/Services/IntegrityService.swiftDeviceProfile, MetricTimeoutProfile) with a
small non-SwiftData local store so Settings no longer requires @Query.ContentView preview/container dependency after tab roots stop using
@Query.DashboardView capture review actions away from ModelContext.