Last Updated: 2026-05-26
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 moving the Snapshots and Data Types tab roots to archive/cache observations, 17 app files still have SwiftData imports because capture, Dashboard review actions, legacy detail transition paths, model definitions, and PDF/export transition paths still use prototype snapshot handles.
This file keeps SwiftData required at app launch:
HealthProbe/HealthProbeApp.swiftRetirement path:
- 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/HealthRecord.swiftHealthProbe/Models/HealthSnapshot.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;
- retire active reads/writes 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 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/Views/Dashboard/DashboardView.swiftHealthProbe/Views/Snapshots/DataTypeSnapshotDetailView.swiftHealthProbe/Views/Snapshots/SnapshotDetailView.swiftRetirement path: - replace detail navigation parameters from SwiftData models to observation/type DTOs; - remove remaining snapshot/cache SwiftData rows from active flows; - keep paged record drill-down and export paths on archive APIs.
The following SwiftData dependencies were removed from active flows:
HealthProbe/Services/AnomalyDetector.swiftHealthProbe/Services/IntegrityService.swiftHealthProbe/Models/MetricTimeoutProfile.swift was deleted.HealthProbe/Utilities/LocalMetricTimeoutProfile.swift, a Codable local
store outside ModelContainer.SettingsView, DashboardView, and HealthKitService read/write timeout
calibration through the local store.HealthProbe/Models/DeviceProfile.swift was deleted.HealthProbe/Utilities/LocalDeviceProfile.swift, a Codable local store used
by Settings, Dashboard, Snapshots, and legacy PDF export.HealthProbe/Models/OperationLog.swift was deleted.HealthProbe/Utilities/LocalOperationLog.swift, a bounded Codable local log
outside ModelContainer.HealthProbe/ContentView.swift no longer imports SwiftData; its preview no
longer creates a legacy model container.HealthProbe/Views/Settings/SettingsView.swift no longer imports SwiftData.
Its Data section now reports/rebuilds/deletes the rebuildable Core Data UI
cache and leaves the SQLite archive untouched.HealthProbe/Views/Dashboard/DashboardView.swift no longer queries
HealthSnapshot for status rows; Dashboard status now uses archive/cache rows
only. SwiftData remains there for capture/review actions.HealthProbe/Views/DataTypes/RecordChangeEvolutionChart.swift now accepts a
small RecordChangeEvolutionSnapshot DTO and loads archive/cache counts
without importing SwiftData or querying SnapshotDelta.HealthProbe/ViewModels/DataTypeTemporalDistributionViewModel.swift and
HealthProbe/Views/DataTypes/DataTypeTemporalDistributionView.swift now read
a TemporalDistributionInput DTO backed by TypeCountDetailCache; they no
longer import SwiftData, query timeline snapshots, or require ModelContext.HealthProbe/Views/Snapshots/SnapshotsView.swift no longer queries
SnapshotDelta or runs DeltaService list-summary repair. Timeline change
summaries come from archive/cache rows when available; SwiftData remains there
only for temporary snapshot navigation/deletion handles.HealthProbe/ViewModels/DataTypesViewModel.swift now resolves baselines from
small observation contexts and builds rows from Core Data cache + SQLite
archive diff APIs. It no longer falls back to legacy direct SwiftData
TypeCount relationship traversal.HealthProbe/Views/DataTypes/DataTypesView.swift no longer imports
SwiftData or queries HealthSnapshot; it loads Core Data cached observation
rows and opens DataTypeArchiveDetailView, an archive/cache-only detail view
with paged SQLite new/missing record drill-down.HealthProbe/Views/Snapshots/SnapshotsView.swift no longer imports
SwiftData or queries HealthSnapshot; it loads Core Data cached observation
rows and opens SnapshotArchiveDetailView, an archive/cache-only detail view
that feeds Data Type drill-down through observation ids and cached summaries.HealthProbe/Views/Snapshots/SnapshotDetailView.swift no longer queries
SnapshotDelta/TypeDelta or carries the old SwiftData type-delta/chart
fallback. Snapshot detail type rows now require archive/cache summaries; the
temporary SwiftData dependency is limited to snapshot navigation, metadata,
and PDF export handles.HealthProbe/Views/Snapshots/DataTypeSnapshotDetailView.swift no longer
queries SnapshotDelta/TypeDelta and no longer rebuilds legacy
TypeCount.detailCache rows from the UI. It reads Core Data/SQLite diff
summaries first and only displays an already-existing legacy detail cache as a
transition fallback.HealthProbe/Views/DataTypes/TypeEvolutionTimeline.swift legacy
chart was deleted, and the remaining TypeDiff/DiffFilter DTOs now live in
HealthProbe/Models/TypeDiff.swift instead of the removed
SnapshotDiffService helper.HealthProbe/Models/AnomalyRecord.swift,
HealthProbe/Models/AnomalyType.swift, and
HealthProbe/Services/AnomalyDetector.swift were deleted. The app no longer
writes count-drop anomaly rows or shows the old Dashboard anomaly review
section.DashboardView capture review actions away from ModelContext.