Halo Family base ea0bf12 source cases 146 / 17 suites lint 0 / 89 files files 29 touched

Pre-push source review: Halo Family person enrichment and archival

Approved source closure and consolidated release checklist. Shared Mac runtime gate pending.

At a glance

  • Optional given/family names stay independent of the display name or description and use one guarded save. Merge choices and undo retain each name.

  • Person, ChildProfile and PersonGroup archive/restore retain identities, links/history and assets. Include archived provides restoration; merge aliases use the guarded merge workflow.

  • Plan reconciliation distinguishes implemented source, current local/native/account evidence, deferred graph/v2 scope and conditional permanent-delete implementation.

Verdict

Source reviewed; runtime pending

Four final independent source rechecks are clear after fixes. Initial checks found two association archive-boundary holes; linked-record transaction checks and focused regressions fix them. Lint and whitespace checks pass. Current test compilation, all 146 declarations, extension metadata/embedding and both Debug builds await the parent-granted shared slot. Last executed passing gate remains 3286293: 79 cases/10 suites and both Debug builds. No remote publication or actual account/private-data operation.

Review findings

5 raised · 5 fixed · 0 skipped

Jump to findings →

Tests

Pass rate: n/a

New tests: 14

Diff coverage: n/a

Jump to tests →

Commits

Three-level explanation

A person can keep a descriptive display name and optional given/family names. Search finds those names. When merging two records, a parent chooses each name field; undo restores the earlier values while affected records remain unchanged.

Archive removes a person, child profile or group from current views and retains its history. Include archived lets a parent find and restore it. Archiving changes shared family views, and the confirmation says so.

PersonInput extends the existing repository write path. Missing structured fields preserve older lightweight callers; explicit empty fields clear values. Legacy models reject unavailable structured fields before changing other data.

ArchiveSnapshot captures ID, entity, name and observed revision dates. Archive confirmation freezes the reviewed snapshot; repository writes re-resolve access and reject stale state. Current list predicates hide ordinary archives while retained queries show history.

Merge previews capture given/family values, choices independently select source/survivor, and existing before/after metadata snapshots preserve guarded undo. Record validation rejects archived Person/ChildProfile/PersonGroup and retained aliases by default; only explicit archive writes permit ordinary archived objects, never aliases. Role editing revalidates its linked Person; membership ending revalidates its group in the same save transaction.

Photo preparation remains off the main actor, and final background resolution rejects an archived Person before insertion. iOS store protection explicitly requests the existing after-first-authentication platform default. Dynamic errors use private OSLog interpolation, and explicit local-only stacks avoid CKContainer initialization.

Completeness assessment: Phases1–7 and9 exist as source; current unit/build gates and native/account/schema hardening remain. Phase8 has its real-data prerequisite, Phase10 is v2, persistent history retention is approved pending safe pruning, and permanent-delete implementation is conditional release scope. No source review proves actual framework cache-content preservation or live CloudKit delivery.

Important changes — detailed

PersonInput saves structured names atomically

Halo Family/Halo Family/Persistence/RelationshipMutations.swift

Why it matters. Names stay independently editable/searchable without stale field overwrites or invented names.

What to look at. updatePerson(_:input:expected:)

Takeaway. Distinguish omitted values from explicit clearing while sharing the existing write path.
Rationale. Approved sparse Person model and stale-editor behavior.

Merge choices retain independent names

Halo Family/Halo Family/Persistence/PersonMergeRepository.swift

Why it matters. A survivor choice cannot silently discard structured name values; undo restores both records.

What to look at. applyPersonFields

Takeaway. Extend explicit conflict choices alongside the original snapshot/audit machinery.
Rationale. Specification review found the name fields needed independent explicit choices.

ArchiveRepository preserves records with guarded restore

Halo Family/Halo Family/Persistence/ArchiveRepository.swift

Why it matters. Ordinary removal is reversible, preserves shared history and cannot bypass merge undo or current permissions.

What to look at. archiveSnapshot, setArchived, canArchive

Takeaway. Use one observed snapshot and the same domain transaction for removal and restoration.
Rationale. Decision2 ordinary removal archives; parent requested approved-pack source reconciliation.

Association writes revalidate their archived owner

Halo Family/Halo Family/Persistence/FamilyMemoryRepository.swift

Why it matters. A queued membership action cannot mutate a group after archive; role editing has the parallel Person check.

What to look at. endGroupMembership; RelationshipMutations.updateRole

Takeaway. Disabling UI is not a write-boundary guarantee; validate linked state inside the transaction.
Rationale. Quality review identified two stale-open archive bypasses.

Asset import rejects archived owners

Halo Family/Halo Family/Persistence/AssetRepository.swift

Why it matters. Background preparation cannot attach a new photo to an archived Person.

What to look at. importAsset

Takeaway. Re-resolve lifecycle eligibility at final mutation, after asynchronous work.
Rationale. Archive/current-write policy and retained existing assets.

Evidence records plan completion and release dependencies

docs/halo_family_design_pack/10-initial-implementation-results.md

Why it matters. Declared source tests and historical passing gates are not confused with current runtime readiness.

What to look at. Person enrichment and archival source closure; remaining release checklist

Takeaway. Keep source, executed evidence and explicit release actions separate.
Rationale. Parent requested a concise approved-pack reconciliation before the shared gate.

Key decisions

Sparse independent names

The approved model stores given/family names separately. The existing name/description remains required and is never inferred from them.

Ordinary archive preserves identity

Decision2 approves archival for ordinary removal. Merged aliases remain governed by merge undo/recovery; archive restoration cannot clear an alias.

Conditional permanent-delete implementation

Phase11 requires export/delete policy and implementation if required for the agreed release. The behavior is approved but is not an unconditional source blocker. Actual permanent live deletion requires separate authority.

Review findings

SeverityAreaFindingResolution
majorLegacy synthetic fixture teardownLegacy structured-name fixture retained automatic background merge notifications during temporary-store teardown.Disabled automatic parent merging in synthetic fixtures before writes, preserving explicit refresh assertions.
majorStructured-name merge choicesGiven/family fields had no independent survivor selection.Added preview values, explicit choices/apply and search/undo regression.
majorArchived Person role editorAn opened ContextPerson editor could save after its Person was archived.Revalidate linked Person and family inside the existing transaction; regression preserves archived Context history editing.
majorArchived group membershipA queued membership end could write after its group was archived.Revalidate the linked group and family inside the transaction; regression checks failure atomicity and restore.
minorDocumentation whitespaceUpdated Markdown status line introduced trailing spaces.Removed them and reran diff check successfully.

Tests

Source: local run at 2026-10-07T04:53:42.383460+00:00 · snapshot ea0bf1201588c5b04ae60aff15dbaccdf5adcbbc (dirty working tree)

Baseline: none

Execution: not run · JUnit: none · Coverage: none · Baseline: absent

Coverage scope: as the project configures it

No test results

scheduled build/test slot pending

New and removed tests

Derived by declaration name, from the diff (no baseline run).

Blast radius

Files that import a changed file on the left, changed files in the centre, files a changed file imports on the right. Snapshot working-tree against base ea0bf12.

Dependents none found Changed Dependencies none found Halo Family/Halo Family … Family/Halo Family.xcodeproj …amily/Halo Family/Persistence Tests/HaloPersistenceTests Halo Family/Halo Family/ArchiveControls.swift… Family/ArchiveControls.swift Halo Family/Halo Family/ChildOverviewView.swift…amily/ChildOverviewView.swift Halo Family/Halo Family/FamilyKnowledgeViews.swift…ly/FamilyKnowledgeViews.swift Halo Family/Halo Family/PeopleView.swift…/Halo Family/PeopleView.swift Halo Family/Halo Family/PersonMergeView.swift… Family/PersonMergeView.swift Halo Family/Halo Family.xcodeproj/project.pbxproj…ily.xcodeproj/project.pbxproj Halo Family/Halo Family/Persistence/ArchiveRepository.swift…tence/ArchiveRepository.swift Halo Family/Halo Family/Persistence/AssetRepository.swift…istence/AssetRepository.swift Halo Family/Halo Family/Persistence/FamilyMemoryRepository.swift…/FamilyMemoryRepository.swift Halo Family/Halo Family/Persistence/FamilyRepository.swift…stence/FamilyRepository.swift Halo Family/Halo Family/Persistence/PersistenceStack.swift…stence/PersistenceStack.swift Halo Family/Halo Family/Persistence/PersonMergePreview.swift…ence/PersonMergePreview.swift Halo Family/Halo Family/Persistence/PersonMergeRepository.swift…e/PersonMergeRepository.swift Halo Family/Halo Family/Persistence/PersonMergeTypes.swift…stence/PersonMergeTypes.swift Halo Family/Halo Family/Persistence/RelationshipMutations.swift…e/RelationshipMutations.swift Halo Family/Halo Family/Persistence/RelationshipQueries.swift…nce/RelationshipQueries.swift Halo Family/Halo Family/Persistence/StoreConfiguration.swift…ence/StoreConfiguration.swift Tests/HaloPersistenceTests/ArchiveTests.swift…tenceTests/ArchiveTests.swift Tests/HaloPersistenceTests/CaptureTests.swift…tenceTests/CaptureTests.swift Tests/HaloPersistenceTests/FamilyMemoryTests.swift…Tests/FamilyMemoryTests.swift Tests/HaloPersistenceTests/PeopleSearchTests.swift…Tests/PeopleSearchTests.swift Tests/HaloPersistenceTests/PersonMergeTests.swift…eTests/PersonMergeTests.swift
addedmodifieddeletedrenamedunchangedcollapsed package group or +N more⚑N test files with an edge to the node

Per-file diffs

29 files: 22 code · 7 docs. Click to expand.

Code (22)

Halo Family/Halo Family.xcodeproj/project.pbxproj Modified +174 / -96
diff --git a/Halo Family/Halo Family.xcodeproj/project.pbxproj b/Halo Family/Halo Family.xcodeproj/project.pbxprojindex 9c236f2..6ad462e 100644--- a/Halo Family/Halo Family.xcodeproj/project.pbxproj	+++ b/Halo Family/Halo Family.xcodeproj/project.pbxproj	@@ -7,20 +7,35 @@ 	objects = {  /* Begin PBXBuildFile section */-        A90000000000000000000001 /* HaloFamilyWidgets.appex in Embed App Extensions */ = {isa = PBXBuildFile; fileRef = A90000000000000000000002; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };+		A90000000000000000000001 /* HaloFamilyWidgets.appex in Embed App Extensions */ = {isa = PBXBuildFile; fileRef = A90000000000000000000002 /* HaloFamilyWidgets.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; }; /* End PBXBuildFile section */  /* Begin PBXContainerItemProxy section */-        A90000000000000000000003 = {isa = PBXContainerItemProxy; containerPortal = 000000000000000000000000; proxyType = 1; remoteGlobalIDString = A90000000000000000000010; remoteInfo = HaloFamilyWidgets; };+		A90000000000000000000003 /* PBXContainerItemProxy */ = {+			isa = PBXContainerItemProxy;+			containerPortal = 000000000000000000000000 /* Project object */;+			proxyType = 1;+			remoteGlobalIDString = A90000000000000000000010;+			remoteInfo = HaloFamilyWidgets;+		}; /* End PBXContainerItemProxy section */  /* Begin PBXCopyFilesBuildPhase section */-        A90000000000000000000004 /* Embed App Extensions */ = {isa = PBXCopyFilesBuildPhase; dstPath = ""; dstSubfolderSpec = 13; files = (A90000000000000000000001, ); name = "Embed App Extensions"; };+		A90000000000000000000004 /* Embed App Extensions */ = {+			isa = PBXCopyFilesBuildPhase;+			dstPath = "";+			dstSubfolder = PlugIns;+			files = (+				A90000000000000000000001 /* HaloFamilyWidgets.appex in Embed App Extensions */,+			);+			name = "Embed App Extensions";+		}; /* End PBXCopyFilesBuildPhase section */+ /* Begin PBXFileReference section */ 		000000000000000000000120 /* Halo Family.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Halo Family.app"; sourceTree = BUILT_PRODUCTS_DIR; };+		A90000000000000000000002 /* HaloFamilyWidgets.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = HaloFamilyWidgets.appex; sourceTree = BUILT_PRODUCTS_DIR; }; 		D4E68C5730752C710095AE3C /* Halo-Family-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist; path = "Halo-Family-Info.plist"; sourceTree = "<group>"; };-        A90000000000000000000002 /* HaloFamilyWidgets.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = HaloFamilyWidgets.appex; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXFileReference section */  /* Begin PBXFileSystemSynchronizedRootGroup section */@@ -29,9 +44,22 @@ 			path = "Halo Family"; 			sourceTree = "<group>"; 		};-        A90000000000000000000005 /* SharedIntents */ = {isa = PBXFileSystemSynchronizedRootGroup; path = SharedIntents; sourceTree = "<group>"; };-        A90000000000000000000006 /* HaloWidgets */ = {isa = PBXFileSystemSynchronizedRootGroup; path = HaloWidgets; sourceTree = "<group>"; };-        A90000000000000000000007 /* Extension Persistence */ = {isa = PBXFileSystemSynchronizedRootGroup; name = "Extension Persistence"; path = "Halo Family/Persistence"; sourceTree = "<group>"; };+		A90000000000000000000005 /* SharedIntents */ = {+			isa = PBXFileSystemSynchronizedRootGroup;+			path = SharedIntents;+			sourceTree = "<group>";+		};+		A90000000000000000000006 /* HaloWidgets */ = {+			isa = PBXFileSystemSynchronizedRootGroup;+			path = HaloWidgets;+			sourceTree = "<group>";+		};+		A90000000000000000000007 /* Extension Persistence */ = {+			isa = PBXFileSystemSynchronizedRootGroup;+			name = "Extension Persistence";+			path = "Halo Family/Persistence";+			sourceTree = "<group>";+		}; /* End PBXFileSystemSynchronizedRootGroup section */  /* Begin PBXFrameworksBuildPhase section */@@ -40,7 +68,11 @@ 			files = ( 			); 		};-        A90000000000000000000011 /* Frameworks */ = {isa = PBXFrameworksBuildPhase; files = (); };+		A90000000000000000000011 /* Frameworks */ = {+			isa = PBXFrameworksBuildPhase;+			files = (+			);+		}; /* End PBXFrameworksBuildPhase section */  /* Begin PBXGroup section */@@ -49,9 +81,9 @@ 			children = ( 				D4E68C5730752C710095AE3C /* Halo-Family-Info.plist */, 				000000000000000000000010 /* Halo Family */,-                A90000000000000000000005 /* SharedIntents */,-                A90000000000000000000006 /* HaloWidgets */,-                A90000000000000000000007 /* Extension Persistence */,+				A90000000000000000000005 /* SharedIntents */,+				A90000000000000000000006 /* HaloWidgets */,+				A90000000000000000000007 /* Extension Persistence */, 				000000000000000000000020 /* Products */, 			); 			sourceTree = "<group>";@@ -60,7 +92,7 @@ 			isa = PBXGroup; 			children = ( 				000000000000000000000120 /* Halo Family.app */,-                A90000000000000000000002 /* HaloFamilyWidgets.appex */,+				A90000000000000000000002 /* HaloFamilyWidgets.appex */, 			); 			name = Products; 			sourceTree = "<group>";@@ -75,32 +107,42 @@ 				000000000000000120000000 /* Sources */, 				000000000000000130000000 /* Frameworks */, 				000000000000000140000000 /* Resources */,-                A90000000000000000000004 /* Embed App Extensions */,+				A90000000000000000000004 /* Embed App Extensions */, 			); 			buildRules = ( 			);-			dependencies = (A90000000000000000000008, );+			dependencies = (+				A90000000000000000000008 /* PBXTargetDependency */,+			); 			fileSystemSynchronizedGroups = ( 				000000000000000000000010 /* Halo Family */,-                A90000000000000000000005 /* SharedIntents */,+				A90000000000000000000005 /* SharedIntents */, 			); 			name = "Halo Family"; 			productName = MyApp; 			productReference = 000000000000000000000120 /* Halo Family.app */; 			productType = "com.apple.product-type.application"; 		};-        A90000000000000000000010 /* HaloFamilyWidgets */ = {-            isa = PBXNativeTarget;-            buildConfigurationList = A90000000000000000000014;-            buildPhases = (A90000000000000000000012, A90000000000000000000011, A90000000000000000000013, );-            buildRules = ();-            dependencies = ();-            fileSystemSynchronizedGroups = (A90000000000000000000005, A90000000000000000000006, A90000000000000000000007, );-            name = HaloFamilyWidgets;-            productName = HaloFamilyWidgets;-            productReference = A90000000000000000000002;-            productType = "com.apple.product-type.app-extension";-        };+		A90000000000000000000010 /* HaloFamilyWidgets */ = {+			isa = PBXNativeTarget;+			buildConfigurationList = A90000000000000000000014 /* Build configuration list for PBXNativeTarget "HaloFamilyWidgets" */;+			buildPhases = (+				A90000000000000000000012 /* Sources */,+				A90000000000000000000011 /* Frameworks */,+				A90000000000000000000013 /* Resources */,+			);+			buildRules = (+			);+			fileSystemSynchronizedGroups = (+				A90000000000000000000005 /* SharedIntents */,+				A90000000000000000000006 /* HaloWidgets */,+				A90000000000000000000007 /* Extension Persistence */,+			);+			name = HaloFamilyWidgets;+			productName = HaloFamilyWidgets;+			productReference = A90000000000000000000002 /* HaloFamilyWidgets.appex */;+			productType = "com.apple.product-type.app-extension";+		}; /* End PBXNativeTarget section */  /* Begin PBXProject section */@@ -131,7 +173,7 @@ 			projectRoot = ""; 			targets = ( 				000000000000000100000000 /* Halo Family */,-                A90000000000000000000010 /* HaloFamilyWidgets */,+				A90000000000000000000010 /* HaloFamilyWidgets */, 			); 		}; /* End PBXProject section */@@ -142,7 +184,11 @@ 			files = ( 			); 		};-        A90000000000000000000013 /* Resources */ = {isa = PBXResourcesBuildPhase; files = (); };+		A90000000000000000000013 /* Resources */ = {+			isa = PBXResourcesBuildPhase;+			files = (+			);+		}; /* End PBXResourcesBuildPhase section */  /* Begin PBXSourcesBuildPhase section */@@ -151,12 +197,21 @@ 			files = ( 			); 		};-        A90000000000000000000012 /* Sources */ = {isa = PBXSourcesBuildPhase; files = (); };+		A90000000000000000000012 /* Sources */ = {+			isa = PBXSourcesBuildPhase;+			files = (+			);+		}; /* End PBXSourcesBuildPhase section */  /* Begin PBXTargetDependency section */-        A90000000000000000000008 = {isa = PBXTargetDependency; target = A90000000000000000000010; targetProxy = A90000000000000000000003; };+		A90000000000000000000008 /* PBXTargetDependency */ = {+			isa = PBXTargetDependency;+			target = A90000000000000000000010 /* HaloFamilyWidgets */;+			targetProxy = A90000000000000000000003 /* PBXContainerItemProxy */;+		}; /* End PBXTargetDependency section */+ /* Begin XCBuildConfiguration section */ 		000000000000000011000000 /* Debug configuration for PBXProject "Halo Family" */ = { 			isa = XCBuildConfiguration;@@ -374,70 +429,86 @@ 			}; 			name = Release; 		};-        A90000000000000000000015 = {-            isa = XCBuildConfiguration;-            buildSettings = {-                APPLICATION_EXTENSION_API_ONLY = YES;-                CODE_SIGN_ENTITLEMENTS = HaloFamilyWidgets.entitlements;-                CODE_SIGN_STYLE = Automatic;-                CURRENT_PROJECT_VERSION = 1;-                DEVELOPMENT_TEAM = V24684SCZN;-                ENABLE_APP_SANDBOX = YES;-                GENERATE_INFOPLIST_FILE = YES;-                INFOPLIST_FILE = HaloFamilyWidgets-Info.plist;-                INFOPLIST_KEY_CFBundleDisplayName = "Halo Family";-                LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks";-                "LD_RUNPATH_SEARCH_PATHS[sdk=macosx*]" = "$(inherited) @executable_path/../Frameworks @executable_path/../../../../Frameworks";-                MARKETING_VERSION = 1.0;-                PRODUCT_BUNDLE_IDENTIFIER = "me.nore.ig.halo-family.widgets";-                PRODUCT_NAME = "$(TARGET_NAME)";-                REGISTER_APP_GROUPS = YES;-                SDKROOT = auto;-                SKIP_INSTALL = YES;-                STRING_CATALOG_GENERATE_SYMBOLS = YES;-                SUPPORTED_PLATFORMS = "iphoneos iphonesimulator macosx";-                SUPPORTS_MACCATALYST = NO;-                SWIFT_APPROACHABLE_CONCURRENCY = YES;-                SWIFT_DEFAULT_ACTOR_ISOLATION = MainActor;-                SWIFT_EMIT_LOC_STRINGS = YES;-                SWIFT_UPCOMING_FEATURE_MEMBER_IMPORT_VISIBILITY = YES;-                SWIFT_VERSION = 5.0;-                TARGETED_DEVICE_FAMILY = "1,2";-            };-            name = Debug;-        };-        A90000000000000000000016 = {-            isa = XCBuildConfiguration;-            buildSettings = {-                APPLICATION_EXTENSION_API_ONLY = YES;-                CODE_SIGN_ENTITLEMENTS = HaloFamilyWidgets.entitlements;-                CODE_SIGN_STYLE = Automatic;-                CURRENT_PROJECT_VERSION = 1;-                DEVELOPMENT_TEAM = V24684SCZN;-                ENABLE_APP_SANDBOX = YES;-                GENERATE_INFOPLIST_FILE = YES;-                INFOPLIST_FILE = HaloFamilyWidgets-Info.plist;-                INFOPLIST_KEY_CFBundleDisplayName = "Halo Family";-                LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks";-                "LD_RUNPATH_SEARCH_PATHS[sdk=macosx*]" = "$(inherited) @executable_path/../Frameworks @executable_path/../../../../Frameworks";-                MARKETING_VERSION = 1.0;-                PRODUCT_BUNDLE_IDENTIFIER = "me.nore.ig.halo-family.widgets";-                PRODUCT_NAME = "$(TARGET_NAME)";-                REGISTER_APP_GROUPS = YES;-                SDKROOT = auto;-                SKIP_INSTALL = YES;-                STRING_CATALOG_GENERATE_SYMBOLS = YES;-                SUPPORTED_PLATFORMS = "iphoneos iphonesimulator macosx";-                SUPPORTS_MACCATALYST = NO;-                SWIFT_APPROACHABLE_CONCURRENCY = YES;-                SWIFT_DEFAULT_ACTOR_ISOLATION = MainActor;-                SWIFT_EMIT_LOC_STRINGS = YES;-                SWIFT_UPCOMING_FEATURE_MEMBER_IMPORT_VISIBILITY = YES;-                SWIFT_VERSION = 5.0;-                TARGETED_DEVICE_FAMILY = "1,2";-            };-            name = Release;-        };+		A90000000000000000000015 /* Debug configuration for PBXNativeTarget "HaloFamilyWidgets" */ = {+			isa = XCBuildConfiguration;+			buildSettings = {+				APPLICATION_EXTENSION_API_ONLY = YES;+				CODE_SIGN_ENTITLEMENTS = HaloFamilyWidgets.entitlements;+				CODE_SIGN_STYLE = Automatic;+				CURRENT_PROJECT_VERSION = 1;+				DEVELOPMENT_TEAM = V24684SCZN;+				ENABLE_APP_SANDBOX = YES;+				GENERATE_INFOPLIST_FILE = YES;+				INFOPLIST_FILE = "HaloFamilyWidgets-Info.plist";+				INFOPLIST_KEY_CFBundleDisplayName = "Halo Family";+				LD_RUNPATH_SEARCH_PATHS = (+					"$(inherited)",+					"@executable_path/Frameworks",+					"@executable_path/../../Frameworks",+				);+				"LD_RUNPATH_SEARCH_PATHS[sdk=macosx*]" = (+					"$(inherited)",+					"@executable_path/../Frameworks",+					"@executable_path/../../../../Frameworks",+				);+				MARKETING_VERSION = 1.0;+				PRODUCT_BUNDLE_IDENTIFIER = "me.nore.ig.halo-family.widgets";+				PRODUCT_NAME = "$(TARGET_NAME)";+				REGISTER_APP_GROUPS = YES;+				SDKROOT = auto;+				SKIP_INSTALL = YES;+				STRING_CATALOG_GENERATE_SYMBOLS = YES;+				SUPPORTED_PLATFORMS = "iphoneos iphonesimulator macosx";+				SUPPORTS_MACCATALYST = NO;+				SWIFT_APPROACHABLE_CONCURRENCY = YES;+				SWIFT_DEFAULT_ACTOR_ISOLATION = MainActor;+				SWIFT_EMIT_LOC_STRINGS = YES;+				SWIFT_UPCOMING_FEATURE_MEMBER_IMPORT_VISIBILITY = YES;+				SWIFT_VERSION = 5.0;+				TARGETED_DEVICE_FAMILY = "1,2";+			};+			name = Debug;+		};+		A90000000000000000000016 /* Release configuration for PBXNativeTarget "HaloFamilyWidgets" */ = {+			isa = XCBuildConfiguration;+			buildSettings = {+				APPLICATION_EXTENSION_API_ONLY = YES;+				CODE_SIGN_ENTITLEMENTS = HaloFamilyWidgets.entitlements;+				CODE_SIGN_STYLE = Automatic;+				CURRENT_PROJECT_VERSION = 1;+				DEVELOPMENT_TEAM = V24684SCZN;+				ENABLE_APP_SANDBOX = YES;+				GENERATE_INFOPLIST_FILE = YES;+				INFOPLIST_FILE = "HaloFamilyWidgets-Info.plist";+				INFOPLIST_KEY_CFBundleDisplayName = "Halo Family";+				LD_RUNPATH_SEARCH_PATHS = (+					"$(inherited)",+					"@executable_path/Frameworks",+					"@executable_path/../../Frameworks",+				);+				"LD_RUNPATH_SEARCH_PATHS[sdk=macosx*]" = (+					"$(inherited)",+					"@executable_path/../Frameworks",+					"@executable_path/../../../../Frameworks",+				);+				MARKETING_VERSION = 1.0;+				PRODUCT_BUNDLE_IDENTIFIER = "me.nore.ig.halo-family.widgets";+				PRODUCT_NAME = "$(TARGET_NAME)";+				REGISTER_APP_GROUPS = YES;+				SDKROOT = auto;+				SKIP_INSTALL = YES;+				STRING_CATALOG_GENERATE_SYMBOLS = YES;+				SUPPORTED_PLATFORMS = "iphoneos iphonesimulator macosx";+				SUPPORTS_MACCATALYST = NO;+				SWIFT_APPROACHABLE_CONCURRENCY = YES;+				SWIFT_DEFAULT_ACTOR_ISOLATION = MainActor;+				SWIFT_EMIT_LOC_STRINGS = YES;+				SWIFT_UPCOMING_FEATURE_MEMBER_IMPORT_VISIBILITY = YES;+				SWIFT_VERSION = 5.0;+				TARGETED_DEVICE_FAMILY = "1,2";+			};+			name = Release;+		}; /* End XCBuildConfiguration section */  /* Begin XCConfigurationList section */@@ -457,7 +528,14 @@ 			); 			defaultConfigurationName = Release; 		};-        A90000000000000000000014 = {isa = XCConfigurationList; buildConfigurations = (A90000000000000000000015, A90000000000000000000016, ); defaultConfigurationName = Release; };+		A90000000000000000000014 /* Build configuration list for PBXNativeTarget "HaloFamilyWidgets" */ = {+			isa = XCConfigurationList;+			buildConfigurations = (+				A90000000000000000000015 /* Debug configuration for PBXNativeTarget "HaloFamilyWidgets" */,+				A90000000000000000000016 /* Release configuration for PBXNativeTarget "HaloFamilyWidgets" */,+			);+			defaultConfigurationName = Release;+		}; /* End XCConfigurationList section */ 	}; 	rootObject = 000000000000000000000000 /* Project object */;
Halo Family/Halo Family/ArchiveControls.swift Added +57 / -0
diff --git a/Halo Family/Halo Family/ArchiveControls.swift b/Halo Family/Halo Family/ArchiveControls.swiftnew file mode 100644index 0000000..a577bf0--- /dev/null+++ b/Halo Family/Halo Family/ArchiveControls.swift	@@ -0,0 +1,57 @@+import Combine+import CoreData+import SwiftUI++struct ArchiveControls: View {+    let repository: FamilyRepository+    let recordID: NSManagedObjectID+    let subject: String+    @State private var snapshot: ArchiveSnapshot?+    @State private var writable = false+    @State private var confirming = false+    @State private var confirmationSnapshot: ArchiveSnapshot?+    @State private var failure: String?++    var body: some View {+        Group {+            if let snapshot {+                if snapshot.isArchived {+                    Text("Archived. Its records and history are retained.").foregroundStyle(.secondary)+                    Button("Restore \(subject)") { change(snapshot, archived: false) }.disabled(!writable)+                } else {+                    Button("Archive \(subject)", role: .destructive) {+                        confirmationSnapshot = snapshot+                        confirming = true+                    }.disabled(!writable)+                    Text("Archiving removes it from current views and preserves its records, links and history.")+                        .font(.caption).foregroundStyle(.secondary)+                }+            }+        }+        .task(id: recordID) { confirming = false; confirmationSnapshot = nil; reload() }+        .onReceive(NotificationCenter.default.publisher(for: .haloPersistenceDidRefresh, object: repository.stack.container)+            .receive(on: DispatchQueue.main)) { _ in reload() }+        .confirmationDialog("Archive \(confirmationSnapshot?.name ?? subject)?", isPresented: $confirming, titleVisibility: .visible) {+            Button("Archive \(subject)", role: .destructive) {+                guard let confirmationSnapshot else { return }+                self.confirmationSnapshot = nil+                change(confirmationSnapshot, archived: true)+            }+        } message: {+            Text("This changes current views for everyone with access to this family. " ++                 "No records or history are deleted. Use Include archived to find and restore it later.")+        }+        .graphFailure($failure)+    }++    private func reload() {+        do {+            snapshot = try repository.archiveSnapshot(recordID)+            writable = snapshot.map(repository.canArchive) ?? false+        } catch { snapshot = nil; writable = false; failure = error.localizedDescription }+    }++    private func change(_ snapshot: ArchiveSnapshot, archived: Bool) {+        do { try repository.setArchived(snapshot, archived: archived); reload() } catch { failure = error.localizedDescription }+    }+}
Halo Family/Halo Family/ChildOverviewView.swift Modified +15 / -2
diff --git a/Halo Family/Halo Family/ChildOverviewView.swift b/Halo Family/Halo Family/ChildOverviewView.swiftindex 39f509d..1b3ef12 100644--- a/Halo Family/Halo Family/ChildOverviewView.swift	+++ b/Halo Family/Halo Family/ChildOverviewView.swift	@@ -10,6 +10,8 @@ struct ChildOverviewView: View {     @State private var connections: [GraphRow] = []     @State private var states: [NSManagedObjectID: ConnectionStateSnapshot] = [:]     @State private var showLostContact = false+    @State private var includeArchivedChildren = false+    @State private var captureAvailable = false     @State private var addingChild = false     @State private var capturing = false     @State private var failure: String?@@ -26,9 +28,10 @@ struct ChildOverviewView: View {     var body: some View {         List {             Section {+                Toggle("Include archived children", isOn: $includeArchivedChildren)                 Picker("Child", selection: $childID) {                     Text("Choose a child").tag(nil as NSManagedObjectID?)-                    ForEach(children) { Text($0.name).tag(Optional($0.id)) }+                    ForEach(children) { Text($0.name + ($0.isArchived ? " (archived)" : "")).tag(Optional($0.id)) }                 }                 .accessibilityIdentifier("children.selection")                 Button("Add a child", systemImage: "plus") { addingChild = true }@@ -36,9 +39,17 @@ struct ChildOverviewView: View {             if childID != nil {                 Section {                     Button("Remember someone", systemImage: "person.badge.plus") { capturing = true }+                        .disabled(!captureAvailable)                         .accessibilityIdentifier("children.capture")                     Toggle("Include lost contact and historical people", isOn: $showLostContact)                 }+                if let childID {+                    Section("Archive and restore") {+                        ArchiveControls(repository: repository, recordID: childID, subject: "child profile")+                        Text("A child profile archive keeps its Person and relationships. An archived Person is restored from People.")+                            .font(.caption).foregroundStyle(.secondary)+                    }+                }                 Section("People they know") {                     ForEach(visibleConnections) { connection in                         NavigationLink {@@ -68,6 +79,7 @@ struct ChildOverviewView: View {         .task { reload() }         .onChange(of: childID) { reload() }         .onChange(of: showLostContact) { reload() }+        .onChange(of: includeArchivedChildren) { reload() }         .onReceive(NotificationCenter.default.publisher(for: .haloPersistenceDidRefresh, object: repository.stack.container)             .receive(on: DispatchQueue.main)) { _ in reload() }         .sheet(isPresented: $addingChild, onDismiss: reload) {@@ -87,10 +99,11 @@ struct ChildOverviewView: View {      private func reload() {         do {-            children = try repository.children(in: familyID)+            children = try repository.children(in: familyID, includeArchived: includeArchivedChildren)             if !children.contains(where: { $0.id == childID }) { childID = children.first?.id }             connections = try childID.map { try repository.connections(for: $0, includeDeceased: showLostContact) } ?? []             states = try repository.connectionStates(connections.map(\.id))+            captureAvailable = childID.map(repository.canCapture) ?? false         } catch { failure = error.localizedDescription }     } }
Halo Family/Halo Family/FamilyKnowledgeViews.swift Modified +16 / -2
diff --git a/Halo Family/Halo Family/FamilyKnowledgeViews.swift b/Halo Family/Halo Family/FamilyKnowledgeViews.swiftindex cb9cd77..3456809 100644--- a/Halo Family/Halo Family/FamilyKnowledgeViews.swift	+++ b/Halo Family/Halo Family/FamilyKnowledgeViews.swift	@@ -280,11 +280,15 @@ struct GroupsView: View {     @State private var groups: [GraphRow] = []     @State private var name = ""     @State private var failure: String?+    @State private var includeArchived = false     var body: some View {         MemoryForm {             MemorySection("Groups and households") {+                Toggle("Include archived groups", isOn: $includeArchived)                 ForEach(groups) { group in-                    NavigationLink(group.name) { GroupDetailView(repository: repository, familyID: familyID, group: group) }+                    NavigationLink(group.name + (group.isArchived ? " (archived)" : "")) {+                        GroupDetailView(repository: repository, familyID: familyID, group: group)+                    }                 }                 MemoryField("Name") { TextField("Group name", text: $name) }                 Button("Add group") {@@ -294,12 +298,15 @@ struct GroupsView: View {         }         .navigationTitle("Groups")         .task { perform {} }+        .onChange(of: includeArchived) { perform {} }         .onReceive(NotificationCenter.default.publisher(for: .haloPersistenceDidRefresh, object: repository.stack.container)             .receive(on: DispatchQueue.main)) { _ in perform {} }         .graphFailure($failure)     }     private func perform(_ action: () throws -> Void) {-        do { try action(); groups = try repository.groups(in: familyID) } catch { failure = error.localizedDescription }+        do { try action(); groups = try repository.groups(in: familyID, includeArchived: includeArchived) } catch {+            failure = error.localizedDescription+        }     } } @@ -316,6 +323,7 @@ private struct GroupDetailView: View {     @State private var start = Date()     @State private var end = Date()     @State private var failure: String?+    @State private var isArchived = false     var body: some View {         MemoryForm {             MemorySection("Members") {@@ -333,9 +341,13 @@ private struct GroupDetailView: View {                         Button("End \(member.name)'s membership today") {                             perform { try repository.endGroupMembership(member.id, at: Date()) }                         }+                        .disabled(isArchived)                     }                 }             }+            MemorySection("Archive and restore") {+                ArchiveControls(repository: repository, recordID: group.id, subject: "group")+            }             MemorySection("Add member") {                 MemoryField("Person") {                     Picker("Person", selection: $personID) {@@ -354,6 +366,7 @@ private struct GroupDetailView: View {                     }                 }.disabled(personID == nil)             }+            .disabled(isArchived)         }         .navigationTitle(group.name)         .task { perform {} }@@ -366,6 +379,7 @@ private struct GroupDetailView: View {             try action()             members = try repository.groupMembers(group.id)             people = try repository.people(in: familyID)+            isArchived = try repository.archiveSnapshot(group.id).isArchived         } catch { failure = error.localizedDescription }     } }
Halo Family/Halo Family/PeopleView.swift Modified +39 / -8
diff --git a/Halo Family/Halo Family/PeopleView.swift b/Halo Family/Halo Family/PeopleView.swiftindex 66c4927..a79fa8c 100644--- a/Halo Family/Halo Family/PeopleView.swift	+++ b/Halo Family/Halo Family/PeopleView.swift	@@ -8,6 +8,7 @@ struct PeopleView: View {     @State private var people: [GraphRow] = []     @State private var search = ""     @State private var reviewOnly = false+    @State private var includeArchived = false     @State private var name = ""     @State private var failure: String? @@ -15,9 +16,15 @@ struct PeopleView: View {         Form {             Section {                 Toggle("Needs review only", isOn: $reviewOnly)+                Toggle("Include archived people", isOn: $includeArchived)                 ForEach(people) { person in-                    NavigationLink(person.name) {+                    NavigationLink {                         PersonDetailView(repository: repository, familyID: familyID, personID: person.id)+                    } label: {+                        VStack(alignment: .leading) {+                            Text(person.name)+                            if person.isArchived { Text("Archived").font(.caption).foregroundStyle(.secondary) }+                        }                     }                 }                 if people.isEmpty { Text("No people match this view.").foregroundStyle(.secondary) }@@ -41,6 +48,7 @@ struct PeopleView: View {         .task { perform {} }         .onChange(of: search) { perform {} }         .onChange(of: reviewOnly) { perform {} }+        .onChange(of: includeArchived) { perform {} }         .onReceive(NotificationCenter.default.publisher(for: .haloPersistenceDidRefresh, object: repository.stack.container)             .receive(on: DispatchQueue.main)) { _ in             perform {}@@ -51,7 +59,7 @@ struct PeopleView: View {     private func perform(_ action: () throws -> Void) {         do {             try action()-            people = try repository.people(in: familyID, search: search, needsReview: reviewOnly)+            people = try repository.people(in: familyID, search: search, needsReview: reviewOnly, includeArchived: includeArchived)         } catch { failure = error.localizedDescription }     } }@@ -62,6 +70,8 @@ struct PersonDetailView: View {     let personID: NSManagedObjectID     @State private var name = ""     @State private var notes = ""+    @State private var givenName = ""+    @State private var familyName = ""     @State private var needsReview = false     @State private var children: [GraphRow] = []     @State private var connections: [GraphRow] = []@@ -75,6 +85,7 @@ struct PersonDetailView: View {     @State private var events: [EventRow] = []     @State private var merging = false     @State private var mergedIntoID: NSManagedObjectID?+    @State private var isArchived = false     @State private var mergeConflict = false     @State private var contextRoles: [PersonContextRoleRow] = []     @State private var editingRole: ContextPersonRow?@@ -98,16 +109,27 @@ struct PersonDetailView: View {             MemorySection("Person") {                 if let photoID { AssetThumbnail(assets: AssetRepository(stack: repository.stack), assetID: photoID).id(photoID) }                 TextField("Name or description", text: $name)+                DisclosureGroup("Structured name (optional)") {+                    MemoryField("Given name") { TextField("Given name", text: $givenName) }+                    MemoryField("Family name") { TextField("Family name", text: $familyName) }+                    Text("These names help search. Your display name or description remains independent.")+                        .font(.caption).foregroundStyle(.secondary)+                }                 TextField("Notes", text: $notes, axis: .vertical)                 Toggle("Needs review", isOn: $needsReview)                 Button("Save details") {                     guard let baseline else { return }                     perform {-                        try repository.updatePerson(personID, name: name, notes: notes, needsReview: needsReview, expected: baseline)+                        try repository.updatePerson(personID,+                            input: PersonInput(name: name, notes: notes, needsReview: needsReview,+                                               givenName: givenName, familyName: familyName),+                            expected: baseline)                         let saved = try repository.person(personID)                         self.baseline = saved                         name = saved.name                         notes = saved.notes+                        givenName = saved.givenName+                        familyName = saved.familyName                         needsReview = saved.needsReview                     }                 }@@ -119,7 +141,12 @@ struct PersonDetailView: View {                     }                 }             }-            .disabled(mergedIntoID != nil || mergeConflict)+            .disabled(isArchived || mergedIntoID != nil || mergeConflict)+            if mergedIntoID == nil && !mergeConflict {+                MemorySection("Archive and restore") {+                    ArchiveControls(repository: repository, recordID: personID, subject: "person")+                }+            }             MemorySection("Relationships") {                 NavigationLink("Apple Contacts") { AppleContactsView(repository: repository, personID: personID) }                 NavigationLink("Family knowledge and address labels") {@@ -139,7 +166,7 @@ struct PersonDetailView: View {                     guard let childID else { return }                     perform { _ = try repository.connect(personID: personID, childID: childID) }                 }-                .disabled(childID == nil)+                .disabled(isArchived || childID == nil)             }             .disabled(mergedIntoID != nil || mergeConflict)             if !contextRoles.isEmpty {@@ -152,7 +179,7 @@ struct PersonDetailView: View {                             if let start = role.association.startedAt { Text("From \(start.formatted(date: .abbreviated, time: .omitted))") }                             if let end = role.association.endedAt { Text("Until \(end.formatted(date: .abbreviated, time: .omitted))") }                             Button("Edit role or dates") { editingRole = role.association }-                                .disabled(mergedIntoID != nil || mergeConflict)+                                .disabled(isArchived || mergedIntoID != nil || mergeConflict)                         }                     }                 }@@ -168,7 +195,7 @@ struct PersonDetailView: View {         .navigationTitle(name.isEmpty ? "Person" : name)         .toolbar {             Menu {-                if mergedIntoID == nil && !mergeConflict {+                if !isArchived && mergedIntoID == nil && !mergeConflict {                     Button("Sensitive details") {                         perform { sensitive = try repository.sensitiveDetails(personID); editingSensitive = true }                     }@@ -197,9 +224,13 @@ struct PersonDetailView: View {         do {             try action()             let current = try repository.person(personID)-            if baseline == nil || (name == baseline?.name && notes == baseline?.notes && needsReview == baseline?.needsReview) {+            isArchived = current.isArchived+            if baseline == nil || (name == baseline?.name && notes == baseline?.notes && needsReview == baseline?.needsReview &&+                                   givenName == baseline?.givenName && familyName == baseline?.familyName) {                 name = current.name                 notes = current.notes+                givenName = current.givenName+                familyName = current.familyName                 needsReview = current.needsReview                 baseline = current             }
Halo Family/Halo Family/Persistence/ArchiveRepository.swift Added +56 / -0
diff --git a/Halo Family/Halo Family/Persistence/ArchiveRepository.swift b/Halo Family/Halo Family/Persistence/ArchiveRepository.swiftnew file mode 100644index 0000000..3a71a6c--- /dev/null+++ b/Halo Family/Halo Family/Persistence/ArchiveRepository.swift	@@ -0,0 +1,56 @@+import CoreData+import Foundation++struct ArchiveSnapshot: Equatable {+    let id: NSManagedObjectID+    let entity: String+    let name: String+    let archivedAt: Date?+    let modifiedAt: Date?+    var isArchived: Bool { archivedAt != nil }+}++@MainActor+extension FamilyRepository {+    func archiveSnapshot(_ id: NSManagedObjectID) throws -> ArchiveSnapshot {+        guard let entity = id.entity.name, ["Person", "ChildProfile", "PersonGroup"].contains(entity) else {+            throw GraphError.invalidReference+        }+        return try archiveSnapshot(readable(id, entity: entity))+    }++    func setArchived(_ expected: ArchiveSnapshot, archived: Bool) throws {+        guard ["Person", "ChildProfile", "PersonGroup"].contains(expected.entity) else { throw GraphError.invalidReference }+        _ = try write { context in+            let object = try record(expected.id, entity: expected.entity, in: context, allowArchived: true)+            guard try archiveSnapshot(object) == expected else { throw MemoryError.changed }+            object.setValue(archived ? expected.archivedAt ?? Date() : nil, forKey: "archivedAt")+            if object.entity.attributesByName["modifiedAt"] != nil { object.setValue(Date(), forKey: "modifiedAt") }+            return object+        }+    }++    func canCapture(_ childID: NSManagedObjectID) -> Bool {+        do { try validateCaptureChild(readable(childID, entity: "ChildProfile")); return true } catch { return false }+    }++    func canArchive(_ snapshot: ArchiveSnapshot) -> Bool {+        guard stack.role != .widget else { return false }+        do {+            let object = try readable(snapshot.id, entity: snapshot.entity)+            try stack.access.check(object, writing: true)+            if object.entity.relationshipsByName["mergedInto"] != nil, object.value(forKey: "mergedInto") != nil { return false }+            return true+        } catch { return false }+    }++    private func archiveSnapshot(_ object: NSManagedObject) throws -> ArchiveSnapshot {+        guard let entity = object.entity.name, object.entity.attributesByName["archivedAt"] != nil else {+            throw GraphError.modelUnavailable+        }+        let nameKey = entity == "Person" ? "displayName" : (entity == "ChildProfile" ? "person.displayName" : "name")+        return ArchiveSnapshot(id: object.objectID, entity: entity, name: object.value(forKeyPath: nameKey) as? String ?? "Unnamed",+            archivedAt: object.value(forKey: "archivedAt") as? Date,+            modifiedAt: object.entity.attributesByName["modifiedAt"] != nil ? object.value(forKey: "modifiedAt") as? Date : nil)+    }+}
Halo Family/Halo Family/Persistence/AssetRepository.swift Modified +1 / -1
diff --git a/Halo Family/Halo Family/Persistence/AssetRepository.swift b/Halo Family/Halo Family/Persistence/AssetRepository.swiftindex cabe427..6ad13f5 100644--- a/Halo Family/Halo Family/Persistence/AssetRepository.swift	+++ b/Halo Family/Halo Family/Persistence/AssetRepository.swift	@@ -78,7 +78,7 @@ final class AssetRepository {             let owner = try context.existingObject(with: ownerID)             try access.check(owner, writing: true)             try Self.requireEditable(owner, cloud: cloud)-            if photo, owner.value(forKey: "mergedInto") != nil { throw MergeError.changed }+            if photo, owner.value(forKey: "mergedInto") != nil || owner.value(forKey: "archivedAt") != nil { throw MergeError.changed }             guard let family = owner.value(forKey: "familySpace") as? NSManagedObject,                   let store = family.objectID.persistentStore, store == ownerID.persistentStore else { throw GraphError.differentFamily }             try Self.requireEditable(family, cloud: cloud)
Halo Family/Halo Family/Persistence/FamilyMemoryRepository.swift Modified +7 / -3
diff --git a/Halo Family/Halo Family/Persistence/FamilyMemoryRepository.swift b/Halo Family/Halo Family/Persistence/FamilyMemoryRepository.swiftindex 5c6f701..3bcb397 100644--- a/Halo Family/Halo Family/Persistence/FamilyMemoryRepository.swift	+++ b/Halo Family/Halo Family/Persistence/FamilyMemoryRepository.swift	@@ -185,9 +185,10 @@ extension FamilyRepository {         }     } -    func groups(in familyID: NSManagedObjectID) throws -> [GraphRow] {-        try rows(entity: "PersonGroup", nameKey: "name", predicate: NSPredicate(format: "familySpace == %@ AND archivedAt == nil",-            familyID))+    func groups(in familyID: NSManagedObjectID, includeArchived: Bool = false) throws -> [GraphRow] {+        let predicate = includeArchived ? NSPredicate(format: "familySpace == %@", familyID) :+            NSPredicate(format: "familySpace == %@ AND archivedAt == nil", familyID)+        return try rows(entity: "PersonGroup", nameKey: "name", predicate: predicate)     }      func createGroup(name: String, familyID: NSManagedObjectID) throws -> NSManagedObjectID {@@ -236,6 +237,9 @@ extension FamilyRepository {     func endGroupMembership(_ id: NSManagedObjectID, at date: Date) throws {         _ = try write { context in             let membership = try record(id, entity: "GroupMembership", in: context)+            guard let linkedGroup = membership.value(forKey: "group") as? NSManagedObject else { throw GraphError.invalidReference }+            let group = try record(linkedGroup.objectID, entity: "PersonGroup", in: context)+            try requireSameFamily(group, family: family(of: membership))             guard membership.value(forKey: "endedAt") == nil else { throw MemoryError.changed }             try validateDates(membership.value(forKey: "startedAt") as? Date, date)             membership.setValue(date, forKey: "endedAt")
Halo Family/Halo Family/Persistence/FamilyRepository.swift Modified +22 / -7
diff --git a/Halo Family/Halo Family/Persistence/FamilyRepository.swift b/Halo Family/Halo Family/Persistence/FamilyRepository.swiftindex a0f9e7a..77d5d0c 100644--- a/Halo Family/Halo Family/Persistence/FamilyRepository.swift	+++ b/Halo Family/Halo Family/Persistence/FamilyRepository.swift	@@ -4,6 +4,7 @@ import Foundation struct GraphRow: Identifiable, Equatable {     let id: NSManagedObjectID     let name: String+    var isArchived = false }  enum GraphError: LocalizedError {@@ -61,11 +62,19 @@ final class FamilyRepository {         try rows(entity: "FamilySpace", nameKey: "name")     } -    func children(in family: NSManagedObjectID) throws -> [GraphRow] {+    func children(in family: NSManagedObjectID, includeArchived: Bool = false) throws -> [GraphRow] {         let modern = stack.container.managedObjectModel.entitiesByName["ChildProfile"]?.attributesByName["archivedAt"] != nil-        return try rows(entity: "ChildProfile", nameKey: "person.displayName", predicate: modern ?-            NSPredicate(format: "familySpace == %@ AND archivedAt == nil AND mergedInto == nil", family) :-            NSPredicate(format: "familySpace == %@", family))+        var predicates = [NSPredicate(format: "familySpace == %@", family)]+        if modern {+            predicates.append(NSPredicate(format: "mergedInto == nil"))+            if !includeArchived { predicates.append(NSPredicate(format: "archivedAt == nil")) }+        }+        if stack.container.managedObjectModel.entitiesByName["Person"]?.attributesByName["archivedAt"] != nil {+            predicates.append(NSPredicate(format: "person.mergedInto == nil"))+            if !includeArchived { predicates.append(NSPredicate(format: "person.archivedAt == nil")) }+        }+        return try rows(entity: "ChildProfile", nameKey: "person.displayName",+                        predicate: NSCompoundPredicate(andPredicateWithSubpredicates: predicates))     }      /// Fetch Connections directly rather than depending on inverse relationship invalidation.@@ -202,11 +211,16 @@ final class FamilyRepository {         request.predicate = predicate         request.sortDescriptors = [NSSortDescriptor(key: nameKey, ascending: true)]         return try stack.fetch(request).map {-            GraphRow(id: $0.objectID, name: $0.value(forKeyPath: nameKey) as? String ?? "Unnamed")+            let ownArchive = $0.entity.attributesByName["archivedAt"] != nil && $0.value(forKey: "archivedAt") != nil+            let person = $0.entity.name == "ChildProfile" ? $0.value(forKey: "person") as? NSManagedObject : nil+            let personArchive = person?.entity.attributesByName["archivedAt"] != nil && person?.value(forKey: "archivedAt") != nil+            return GraphRow(id: $0.objectID, name: $0.value(forKeyPath: nameKey) as? String ?? "Unnamed",+                            isArchived: ownArchive || personArchive)         }     } -    func record(_ id: NSManagedObjectID, entity: String, in context: NSManagedObjectContext) throws -> NSManagedObject {+    func record(_ id: NSManagedObjectID, entity: String, in context: NSManagedObjectContext,+                allowArchived: Bool = false) throws -> NSManagedObject {         try stack.access.check()         guard !id.isTemporaryID, id.entity.name == entity,               let store = id.persistentStore,@@ -217,7 +231,8 @@ final class FamilyRepository {         if ["Person", "Connection", "ChildProfile"].contains(entity),            object.entity.relationshipsByName["mergedInto"] != nil,            object.value(forKey: "mergedInto") != nil { throw MergeError.changed }-        if ["Connection", "ChildProfile"].contains(entity), object.entity.attributesByName["archivedAt"] != nil,+        if !allowArchived, ["Person", "Connection", "ChildProfile", "PersonGroup"].contains(entity),+           object.entity.attributesByName["archivedAt"] != nil,            object.value(forKey: "archivedAt") != nil { throw MergeError.changed }         if let cloud = stack.container as? NSPersistentCloudKitContainer,            !cloud.canUpdateRecord(forManagedObjectWith: id) { throw GraphError.readOnly }
Halo Family/Halo Family/Persistence/PersistenceStack.swift Modified +4 / -3
diff --git a/Halo Family/Halo Family/Persistence/PersistenceStack.swift b/Halo Family/Halo Family/Persistence/PersistenceStack.swiftindex a0d6b02..510f0c2 100644--- a/Halo Family/Halo Family/Persistence/PersistenceStack.swift	+++ b/Halo Family/Halo Family/Persistence/PersistenceStack.swift	@@ -71,7 +71,8 @@ final class PersistenceStack {         sharedStore = shared         role = configuration.role         accountScope = configuration.accountScope-        accountContainer = configuration.accountScope == nil ? nil : CKContainer(identifier: StoreConfiguration.cloudContainer)+        accountContainer = configuration.accountScope?.mirrorsCloud == true ?+            CKContainer(identifier: StoreConfiguration.cloudContainer) : nil         nativeContactsEnabled = configuration.role == .host         configureViewContext()     }@@ -237,7 +238,7 @@ final class PersistenceStack {                     do { try self?.refreshAccess() } catch { self?.lockSession() }                 } else {                     self?.syncIssue = "iCloud sync is delayed: \(message ?? "Please try again later.")"-                    self?.logger.error("CloudKit operation failed: \(message ?? "Unknown error", privacy: .public)")+                    self?.logger.error("CloudKit operation failed: \(message ?? "Unknown error", privacy: .private)")                 }                 if event.storeIdentifier == self?.sharedStore.identifier,                    CloudAccessFailure.removesAccess(event.error) { await self?.revalidateSharedAccess() }@@ -257,7 +258,7 @@ final class PersistenceStack {             issue = nil         } catch {             issue = "Couldn’t refresh saved changes: \(error.localizedDescription)"-            logger.error("History processing failed: \(error.localizedDescription, privacy: .public)")+            logger.error("History processing failed: \(error.localizedDescription, privacy: .private)")         }     } 
Halo Family/Halo Family/Persistence/PersonMergePreview.swift Modified +5 / -2
diff --git a/Halo Family/Halo Family/Persistence/PersonMergePreview.swift b/Halo Family/Halo Family/Persistence/PersonMergePreview.swiftindex 9755814..a3dfea1 100644--- a/Halo Family/Halo Family/Persistence/PersonMergePreview.swift	+++ b/Halo Family/Halo Family/Persistence/PersonMergePreview.swift	@@ -119,10 +119,13 @@ extension FamilyRepository {     }      private func mergePerson(_ object: NSManagedObject) throws -> MergePersonValues {-        try MergePersonValues(id: object.objectID, stableID: stable(object),+        let structured = object.entity.attributesByName["givenName"] != nil+        return try MergePersonValues(id: object.objectID, stableID: stable(object),                           name: object.value(forKey: "displayName") as? String ?? "Unnamed",                           notes: object.value(forKey: "notes") as? String ?? "", sensitive: try sensitiveDetails(object.objectID),-                          photoID: (object.value(forKey: "primaryPhoto") as? NSManagedObject)?.objectID)+                          photoID: (object.value(forKey: "primaryPhoto") as? NSManagedObject)?.objectID,+                          givenName: structured ? object.value(forKey: "givenName") as? String ?? "" : "",+                          familyName: structured ? object.value(forKey: "familyName") as? String ?? "" : "")     }      func mergeOrigins(_ connection: NSManagedObject) throws -> [MergeOriginChoice] {
Halo Family/Halo Family/Persistence/PersonMergeRepository.swift Modified +5 / -0
diff --git a/Halo Family/Halo Family/Persistence/PersonMergeRepository.swift b/Halo Family/Halo Family/Persistence/PersonMergeRepository.swiftindex 89168f8..65ec7f7 100644--- a/Halo Family/Halo Family/Persistence/PersonMergeRepository.swift	+++ b/Halo Family/Halo Family/Persistence/PersonMergeRepository.swift	@@ -82,6 +82,11 @@ extension FamilyRepository {     private func applyPersonFields(source: NSManagedObject, survivor: NSManagedObject, choices: PersonMergeChoices) throws {         let selectedName = choices.name == .source ? source : survivor         survivor.setValue(try validated(selectedName.value(forKey: "displayName") as? String ?? ""), forKey: "displayName")+        for (key, side) in [("givenName", choices.givenName), ("familyName", choices.familyName)]+            where survivor.entity.attributesByName[key] != nil && source.entity.attributesByName[key] != nil {+            let selected = side == .source ? source : survivor+            survivor.setValue(selected.value(forKey: key), forKey: key)+        }         let sourceNotes = source.value(forKey: "notes") as? String ?? ""         let survivorNotes = survivor.value(forKey: "notes") as? String ?? ""         let notes: String
Halo Family/Halo Family/Persistence/PersonMergeTypes.swift Modified +4 / -0
diff --git a/Halo Family/Halo Family/Persistence/PersonMergeTypes.swift b/Halo Family/Halo Family/Persistence/PersonMergeTypes.swiftindex 4ffcf37..2162632 100644--- a/Halo Family/Halo Family/Persistence/PersonMergeTypes.swift	+++ b/Halo Family/Halo Family/Persistence/PersonMergeTypes.swift	@@ -26,6 +26,8 @@ struct MergePersonValues {     let notes: String     let sensitive: SensitiveSnapshot     let photoID: NSManagedObjectID?+    var givenName = ""+    var familyName = "" }  struct MergeOriginChoice: Identifiable {@@ -80,6 +82,8 @@ struct MergeConnectionChoices: Equatable {  struct PersonMergeChoices: Equatable {     var name: MergeSide = .survivor+    var givenName: MergeSide = .survivor+    var familyName: MergeSide = .survivor     var notes: MergeNotesChoice = .both     var photo: MergeSide = .survivor     var sensitive: MergeSide = .survivor
Halo Family/Halo Family/Persistence/RelationshipMutations.swift Modified +21 / -4
diff --git a/Halo Family/Halo Family/Persistence/RelationshipMutations.swift b/Halo Family/Halo Family/Persistence/RelationshipMutations.swiftindex 58dd837..fba946b 100644--- a/Halo Family/Halo Family/Persistence/RelationshipMutations.swift	+++ b/Halo Family/Halo Family/Persistence/RelationshipMutations.swift	@@ -19,18 +19,33 @@ extension FamilyRepository {      func updatePerson(_ personID: NSManagedObjectID, name: String, notes: String,                       needsReview: Bool, expected: PersonDetail) throws {-        let name = try validated(name)+        try updatePerson(personID, input: PersonInput(name: name, notes: notes, needsReview: needsReview), expected: expected)+    }++    func updatePerson(_ personID: NSManagedObjectID, input: PersonInput, expected: PersonDetail) throws {+        let name = try validated(input.name)         _ = try write { context in             let person = try record(personID, entity: "Person", in: context)+            let structured = person.entity.attributesByName["givenName"] != nil+            let given = structured ? person.value(forKey: "givenName") as? String ?? "" : ""+            let family = structured ? person.value(forKey: "familyName") as? String ?? "" : ""             guard expected.id == personID,                   (person.value(forKey: "displayName") as? String ?? "Unnamed") == expected.name,                   (person.value(forKey: "notes") as? String ?? "") == expected.notes,-                  (person.value(forKey: "needsReview") as? Bool ?? false) == expected.needsReview else {+                  (person.value(forKey: "needsReview") as? Bool ?? false) == expected.needsReview,+                  given == expected.givenName, family == expected.familyName else {                 throw GraphError.personChanged             }+            guard structured || (input.givenName == nil && input.familyName == nil) else { throw GraphError.modelUnavailable }             person.setValue(name, forKey: "displayName")-            person.setValue(notes.trimmingCharacters(in: .whitespacesAndNewlines), forKey: "notes")-            person.setValue(needsReview, forKey: "needsReview")+            person.setValue(input.notes.trimmingCharacters(in: .whitespacesAndNewlines), forKey: "notes")+            person.setValue(input.needsReview, forKey: "needsReview")+            for (key, value) in [("givenName", input.givenName), ("familyName", input.familyName)] {+                if let value {+                    let trimmed = value.trimmingCharacters(in: .whitespacesAndNewlines)+                    person.setValue(trimmed.isEmpty ? nil : trimmed, forKey: key)+                }+            }             person.setValue(Date(), forKey: "modifiedAt")             return person         }@@ -158,6 +173,8 @@ extension FamilyRepository {                   (link.value(forKey: "role") as? String ?? "") == expected.role,                   link.value(forKey: "startedAt") as? Date == expected.startedAt,                   link.value(forKey: "endedAt") as? Date == expected.endedAt else { throw GraphError.roleChanged }+            let person = try record(expected.personID, entity: "Person", in: context)+            try requireSameFamily(person, family: family(of: link))             let role = role.trimmingCharacters(in: .whitespacesAndNewlines)             link.setValue(role.isEmpty ? nil : role, forKey: "role")             link.setValue(startedAt, forKey: "startedAt")
Halo Family/Halo Family/Persistence/RelationshipQueries.swift Modified +20 / -3
diff --git a/Halo Family/Halo Family/Persistence/RelationshipQueries.swift b/Halo Family/Halo Family/Persistence/RelationshipQueries.swiftindex 6534f5a..1d53623 100644--- a/Halo Family/Halo Family/Persistence/RelationshipQueries.swift	+++ b/Halo Family/Halo Family/Persistence/RelationshipQueries.swift	@@ -31,6 +31,18 @@ struct PersonDetail: Equatable {     let name: String     let notes: String     let needsReview: Bool+    var givenName = ""+    var familyName = ""+    var isArchived = false+}++struct PersonInput {+    var name: String+    var notes = ""+    var needsReview = true+    // Omitted values preserve existing names for lightweight callers; empty values explicitly clear them.+    var givenName: String?+    var familyName: String? }  struct EventRow: Identifiable, Equatable {@@ -70,11 +82,12 @@ struct ContextConnectionRow: Identifiable, Equatable { @MainActor extension FamilyRepository {     func people(in familyID: NSManagedObjectID, search: String = "", needsReview: Bool = false,-                includeDeceased: Bool = true) throws -> [GraphRow] {+                includeDeceased: Bool = true, includeArchived: Bool = false) throws -> [GraphRow] {         var predicates = [NSPredicate(format: "familySpace == %@", familyID)]         if stack.container.managedObjectModel.entitiesByName["Person"]?.attributesByName["archivedAt"] != nil {             let conflicted = try mergeConflicts(in: familyID).flatMap { $0.people.map(\.id) }-            predicates.append(NSPredicate(format: "(archivedAt == nil AND mergedInto == nil) OR SELF IN %@", conflicted))+            let current = includeArchived ? "mergedInto == nil" : "archivedAt == nil AND mergedInto == nil"+            predicates.append(NSPredicate(format: "(\(current)) OR SELF IN %@", conflicted))             if needsReview || !includeDeceased { predicates.append(NSPredicate(format: "isDeceased == NO OR isDeceased == nil")) }         }         let search = search.trimmingCharacters(in: .whitespacesAndNewlines)@@ -85,9 +98,13 @@ extension FamilyRepository {      func person(_ id: NSManagedObjectID) throws -> PersonDetail {         let person = try readable(id, entity: "Person")+        let structured = person.entity.attributesByName["givenName"] != nil         return PersonDetail(id: id, name: person.value(forKey: "displayName") as? String ?? "Unnamed",                             notes: person.value(forKey: "notes") as? String ?? "",-                            needsReview: person.value(forKey: "needsReview") as? Bool ?? false)+                            needsReview: person.value(forKey: "needsReview") as? Bool ?? false,+                            givenName: structured ? person.value(forKey: "givenName") as? String ?? "" : "",+                            familyName: structured ? person.value(forKey: "familyName") as? String ?? "" : "",+                            isArchived: person.entity.attributesByName["archivedAt"] != nil && person.value(forKey: "archivedAt") != nil)     }      func personID(for connectionID: NSManagedObjectID) throws -> NSManagedObjectID {
Halo Family/Halo Family/Persistence/StoreConfiguration.swift Modified +4 / -0
diff --git a/Halo Family/Halo Family/Persistence/StoreConfiguration.swift b/Halo Family/Halo Family/Persistence/StoreConfiguration.swiftindex 95b14f5..479924f 100644--- a/Halo Family/Halo Family/Persistence/StoreConfiguration.swift	+++ b/Halo Family/Halo Family/Persistence/StoreConfiguration.swift	@@ -33,6 +33,10 @@ nonisolated struct StoreConfiguration: Sendable {             description.shouldMigrateStoreAutomatically = role == .host             description.shouldInferMappingModelAutomatically = role == .host             description.isReadOnly = role == .widget+            #if os(iOS)+            description.setOption(FileProtectionType.completeUntilFirstUserAuthentication.rawValue as NSString,+                                  forKey: NSPersistentStoreFileProtectionKey)+            #endif             description.setOption(true as NSNumber, forKey: NSPersistentHistoryTrackingKey)             description.setOption(true as NSNumber, forKey: NSPersistentStoreRemoteChangeNotificationPostOptionKey)             if mirrorsCloud && role == .host {
Halo Family/Halo Family/PersonMergeView.swift Modified +18 / -2
diff --git a/Halo Family/Halo Family/PersonMergeView.swift b/Halo Family/Halo Family/PersonMergeView.swiftindex 9bdc90f..3e508a8 100644--- a/Halo Family/Halo Family/PersonMergeView.swift	+++ b/Halo Family/Halo Family/PersonMergeView.swift	@@ -86,12 +86,19 @@ struct PersonMergeView: View {      @ViewBuilder private func personChoices(_ preview: PersonMergePreview) -> some View {         MemorySection("\(preview.source.name) → \(preview.survivor.name)") {-            MemoryField("Name") {-                Picker("Name", selection: $choices.name) {+            MemoryField("Display name") {+                Picker("Display name", selection: $choices.name) {                     Text(preview.survivor.name).tag(MergeSide.survivor)                     Text(preview.source.name).tag(MergeSide.source)                 }             }+            if !preview.survivor.givenName.isEmpty || !preview.source.givenName.isEmpty {+                nameChoice("Given name", kept: preview.survivor.givenName, other: preview.source.givenName, selection: $choices.givenName)+            }+            if !preview.survivor.familyName.isEmpty || !preview.source.familyName.isEmpty {+                nameChoice("Family name", kept: preview.survivor.familyName, other: preview.source.familyName,+                           selection: $choices.familyName)+            }             if !preview.source.notes.isEmpty || !preview.survivor.notes.isEmpty {                 MemoryField("Notes") {                     Picker("Notes", selection: $choices.notes) {@@ -120,6 +127,15 @@ struct PersonMergeView: View {         }     } +    private func nameChoice(_ title: String, kept: String, other: String, selection: Binding<MergeSide>) -> some View {+        MemoryField(title) {+            Picker(title, selection: selection) {+                Text("Kept person: \(kept.isEmpty ? "Not recorded" : kept)").tag(MergeSide.survivor)+                Text("Other person: \(other.isEmpty ? "Not recorded" : other)").tag(MergeSide.source)+            }+        }+    }+     @ViewBuilder private func overlapChoices(_ overlap: MergeConnectionOverlap) -> some View {         MemorySection("\(overlap.childName) knows \(overlap.personName)") {             Text("These records contain overlapping child relationships. One connection remains current; " +
Tests/HaloPersistenceTests/ArchiveTests.swift Added +161 / -0
diff --git a/Tests/HaloPersistenceTests/ArchiveTests.swift b/Tests/HaloPersistenceTests/ArchiveTests.swiftnew file mode 100644index 0000000..4117af6--- /dev/null+++ b/Tests/HaloPersistenceTests/ArchiveTests.swift@@ -0,0 +1,161 @@+import CoreData+import Testing+@testable import HaloPersistence++@MainActor+struct ArchiveTests {+    private func withStore(_ operation: (FamilyRepository) throws -> Void) throws {+        let directory = FileManager.default.temporaryDirectory.appendingPathComponent(UUID().uuidString)+        defer { try? FileManager.default.removeItem(at: directory) }+        let stack = try PersistenceStack(directory: directory)+        stack.container.viewContext.automaticallyMergesChangesFromParent = false+        try operation(FamilyRepository(stack: stack))+    }++    @Test func personArchiveRetainsRelationshipsOriginsAndIdentityForRestore() throws {+        try withStore { graph in+            let family = try graph.createFamily(name: "Synthetic"), child = try graph.addChild(name: "Child", familyID: family)+            let connection = try graph.quickCapture(name: "Peer", childID: child)+            let person = try graph.personID(for: connection)+            let context = try graph.createContext(name: "Swimming", familyID: family)+            _ = try graph.addMembership(connectionID: connection, contextID: context)+            try graph.saveOrigin(connectionID: connection, input: OriginInput(contextID: context, narrative: "First lesson"),+                                 expectedOrigin: nil)+            let uuid = try graph.stable(graph.readable(person, entity: "Person"))+            let original = try graph.person(person)+            try graph.setArchived(graph.archiveSnapshot(person), archived: true)+            #expect(try graph.person(person).isArchived)+            #expect(try graph.people(in: family).contains { $0.id == person } == false)+            #expect(try graph.people(in: family, includeArchived: true).first { $0.id == person }?.isArchived == true)+            #expect(try graph.connections(for: child).isEmpty)+            #expect(try graph.memberships(for: connection).count == 1 && graph.origin(for: connection)?.narrative == "First lesson")+            #expect(throws: MergeError.self) {+                try graph.updatePerson(person, name: "Stale", notes: "", needsReview: false, expected: original)+            }+            try graph.setArchived(graph.archiveSnapshot(person), archived: false)+            #expect(try graph.stable(graph.readable(person, entity: "Person")) == uuid)+            #expect(try graph.person(person).name == "Peer" && graph.connections(for: child).count == 1)+        }+    }++    @Test func childProfileArchiveRetainsPersonAndHistoryAndStopsCapture() throws {+        try withStore { graph in+            let family = try graph.createFamily(name: "Synthetic"), child = try graph.addChild(name: "Child", familyID: family)+            let connection = try graph.quickCapture(name: "Peer", childID: child)+            let object = try graph.readable(child, entity: "ChildProfile")+            let person = try #require(object.value(forKey: "person") as? NSManagedObject)+            let uuid = try graph.stable(object)+            try graph.setArchived(graph.archiveSnapshot(child), archived: true)+            #expect(try graph.children(in: family).isEmpty)+            #expect(try graph.children(in: family, includeArchived: true).map(\.id) == [child])+            #expect(!graph.canCapture(child))+            #expect(try CaptureRepository(graph: graph).children().isEmpty)+            #expect(throws: MergeError.self) { try graph.quickCapture(name: "Denied", childID: child) }+            #expect(try graph.connections(for: child).map(\.id) == [connection])+            #expect(try graph.person(person.objectID).isArchived == false)+            try graph.setArchived(graph.archiveSnapshot(child), archived: false)+            #expect(graph.canCapture(child))+            #expect(try graph.stable(graph.readable(child, entity: "ChildProfile")) == uuid)+            #expect(try graph.children(in: family).map(\.id) == [child])+        }+    }++    @Test func groupArchiveRetainsMembersGiftPartiesAndAddressLabels() throws {+        try withStore { graph in+            let family = try graph.createFamily(name: "Synthetic"), person = try graph.addPerson(name: "Peer", familyID: family)+            let group = try graph.createGroup(name: "Our household", familyID: family)+            try graph.addGroupMember(person, groupID: group, role: "Member")+            try graph.addAddressLabel(targetID: person, label: "Auntie", usedByGroup: group)+            let event = try graph.createEvent(title: "Birthday", date: Date(), notes: "", familyID: family)+            try graph.saveGift(eventID: event, input: GiftInput(description: "Book", groups: [group], recipients: [person]), expected: nil)+            try graph.setArchived(graph.archiveSnapshot(group), archived: true)+            #expect(try graph.groups(in: family).isEmpty)+            #expect(try graph.groups(in: family, includeArchived: true).first?.isArchived == true)+            #expect(try graph.groupMembers(group).map(\.personID) == [person])+            #expect(try graph.addressLabels(for: person).first?.usedBy == "Our household")+            #expect(try graph.gifts(event).first?.groupIDs == [group])+            #expect(throws: MergeError.self) { try graph.addGroupMember(person, groupID: group) }+            try graph.setArchived(graph.archiveSnapshot(group), archived: false)+            #expect(try graph.groups(in: family).map(\.id) == [group])+        }+    }++    @Test func openedRoleEditorRejectsArchivedPersonButAllowsArchivedContextHistory() throws {+        try withStore { graph in+            let family = try graph.createFamily(name: "Synthetic"), person = try graph.addPerson(name: "Coach", familyID: family)+            let context = try graph.createContext(name: "Swimming", familyID: family)+            _ = try graph.associatePerson(person, contextID: context, role: "Coach")+            let original = try #require(try graph.contextPeople(context).first)+            try graph.setArchived(graph.archiveSnapshot(person), archived: true)+            #expect(throws: MergeError.self) {+                try graph.updateRole(original.id, role: "Stale", startedAt: nil, endedAt: nil, expected: original)+            }+            #expect(try graph.contextPeople(context).first?.role == "Coach")+            try graph.setArchived(graph.archiveSnapshot(person), archived: false)+            try graph.archiveContext(context, archived: true)+            try graph.updateRole(original.id, role: "Former coach", startedAt: nil,+                                 endedAt: Date(timeIntervalSince1970: 1000), expected: original)+            #expect(try graph.contextPeople(context).first?.role == "Former coach")+        }+    }++    @Test func queuedMembershipEndRejectsArchivedGroupAndPreservesHistory() throws {+        try withStore { graph in+            let family = try graph.createFamily(name: "Synthetic"), person = try graph.addPerson(name: "Peer", familyID: family)+            let group = try graph.createGroup(name: "Household", familyID: family)+            try graph.addGroupMember(person, groupID: group)+            let original = try #require(try graph.groupMembers(group).first)+            try graph.setArchived(graph.archiveSnapshot(group), archived: true)+            #expect(throws: MergeError.self) { try graph.endGroupMembership(original.id, at: Date()) }+            #expect(try graph.groupMembers(group).first?.endedAt == nil)+            try graph.setArchived(graph.archiveSnapshot(group), archived: false)+            let endedAt = Date(timeIntervalSince1970: 1000)+            try graph.endGroupMembership(original.id, at: endedAt)+            #expect(try graph.groupMembers(group).first?.id == original.id)+            #expect(try graph.groupMembers(group).first?.endedAt == endedAt)+        }+    }++    @Test func staleAndRepeatedArchiveSnapshotsCannotOverrideLaterChanges() throws {+        try withStore { graph in+            let family = try graph.createFamily(name: "Synthetic"), person = try graph.addPerson(name: "Peer", familyID: family)+            let original = try graph.archiveSnapshot(person)+            try graph.updatePerson(person, name: "Current", notes: "", needsReview: false, expected: graph.person(person))+            #expect(throws: MemoryError.self) { try graph.setArchived(original, archived: true) }+            let current = try graph.archiveSnapshot(person)+            try graph.setArchived(current, archived: true)+            #expect(throws: MemoryError.self) { try graph.setArchived(current, archived: true) }+            #expect(try graph.person(person).name == "Current" && graph.person(person).isArchived)+        }+    }++    @Test func readOnlyAndInvalidatedFamiliesRejectArchiveAndRestore() throws {+        try withStore { graph in+            let family = try graph.createFamily(name: "Synthetic"), person = try graph.addPerson(name: "Peer", familyID: family)+            let snapshot = try graph.archiveSnapshot(person)+            let identity = try StoreAccess.identity(graph.readable(person, entity: "Person"))+            graph.stack.access.update(readable: [identity], writable: [])+            #expect(!graph.canArchive(snapshot))+            #expect(throws: AccessError.self) { try graph.setArchived(snapshot, archived: true) }+            graph.stack.access.update(readable: [identity], writable: [identity])+            try graph.setArchived(snapshot, archived: true)+            let archived = try graph.archiveSnapshot(person)+            graph.stack.access.update(readable: [identity], writable: [])+            #expect(throws: AccessError.self) { try graph.setArchived(archived, archived: false) }+            graph.stack.access.invalidate()+            #expect(throws: AccessError.self) { try graph.archiveSnapshot(person) }+        }+    }++    @Test func ordinaryRestoreCannotUndoAMergeAlias() throws {+        try withStore { graph in+            let family = try graph.createFamily(name: "Synthetic")+            let source = try graph.addPerson(name: "Peer", familyID: family), kept = try graph.addPerson(name: "Peer", familyID: family)+            _ = try graph.mergePeople(graph.mergePreview(sourceID: source, survivorID: kept), choices: PersonMergeChoices())+            let archived = try graph.archiveSnapshot(source)+            #expect(!graph.canArchive(archived))+            #expect(throws: MergeError.self) { try graph.setArchived(archived, archived: false) }+            #expect(try graph.mergedPersonTarget(source) == kept)+        }+    }+}
Tests/HaloPersistenceTests/CaptureTests.swift Modified +3 / -0
diff --git a/Tests/HaloPersistenceTests/CaptureTests.swift b/Tests/HaloPersistenceTests/CaptureTests.swiftindex c0dbc19..0184ed7 100644--- a/Tests/HaloPersistenceTests/CaptureTests.swift+++ b/Tests/HaloPersistenceTests/CaptureTests.swift@@ -8,6 +8,7 @@ struct CaptureTests {         let directory = FileManager.default.temporaryDirectory.appendingPathComponent(UUID().uuidString)         defer { try? FileManager.default.removeItem(at: directory) }         let stack = try PersistenceStack(directory: directory)+        stack.container.viewContext.automaticallyMergesChangesFromParent = false         try test(stack, FamilyRepository(stack: stack), directory)     } @@ -50,12 +51,14 @@ struct CaptureTests {         let directory = FileManager.default.temporaryDirectory.appendingPathComponent(UUID().uuidString)         defer { try? FileManager.default.removeItem(at: directory) }         let host = try PersistenceStack(directory: directory)+        host.container.viewContext.automaticallyMergesChangesFromParent = false         let graph = FamilyRepository(stack: host)         let family = try graph.createFamily(name: "Synthetic family")         let child = try graph.addChild(name: "Synthetic child", familyID: family)         let context = try graph.createContext(name: "Swimming", familyID: family)         let childRef = try reference(child, stack: host), contextRef = try reference(context, stack: host)         let intent = try PersistenceStack(directory: directory, role: .appIntent)+        intent.container.viewContext.automaticallyMergesChangesFromParent = false         #expect(!(intent.container is NSPersistentCloudKitContainer))         let capture = CaptureRepository(graph: FamilyRepository(stack: intent))         #expect(capture.namespace == childRef.namespace)
Tests/HaloPersistenceTests/FamilyMemoryTests.swift Modified +20 / -0
diff --git a/Tests/HaloPersistenceTests/FamilyMemoryTests.swift b/Tests/HaloPersistenceTests/FamilyMemoryTests.swiftindex 8aca147..e1a0216 100644--- a/Tests/HaloPersistenceTests/FamilyMemoryTests.swift+++ b/Tests/HaloPersistenceTests/FamilyMemoryTests.swift@@ -216,6 +216,26 @@ struct FamilyMemoryTests {         }     } +    @Test func archivedPersonRetainsPhotoAndRejectsNewImportUntilRestored() async throws {+        try await withFixture { fixture, _ in+            let assets = AssetRepository(stack: fixture.stack)+            let photo = try await assets.importPhoto(Self.imageData(), filename: "Original.jpg", personID: fixture.person)+            let payload = try await assets.data(for: photo)+            try fixture.graph.setArchived(fixture.graph.archiveSnapshot(fixture.person), archived: true)+            await #expect(throws: MergeError.self) {+                try await assets.importPhoto(Self.imageData(width: 64), filename: "New.jpg", personID: fixture.person)+            }+            #expect(try fixture.graph.primaryPhoto(fixture.person) == photo)+            #expect(try await assets.data(for: photo) == payload)+            #expect(try fixture.stack.container.viewContext.count(for: NSFetchRequest<NSManagedObject>(entityName: "Asset")) == 1)+            try fixture.graph.setArchived(fixture.graph.archiveSnapshot(fixture.person), archived: false)+            let replacement = try await assets.importPhoto(Self.imageData(width: 64), filename: "New.jpg", personID: fixture.person)+            #expect(replacement != photo)+            #expect(try fixture.graph.primaryPhoto(fixture.person) == replacement)+            #expect(try await assets.data(for: photo) == payload)+        }+    }+     @Test func unsupportedOversizedAndInvalidImportsNeverCreateAssets() async throws {         try await withFixture { fixture, _ in             let assets = AssetRepository(stack: fixture.stack)
Tests/HaloPersistenceTests/PeopleSearchTests.swift Modified +69 / -0
diff --git a/Tests/HaloPersistenceTests/PeopleSearchTests.swift b/Tests/HaloPersistenceTests/PeopleSearchTests.swiftindex e1fd62a..5330f20 100644--- a/Tests/HaloPersistenceTests/PeopleSearchTests.swift+++ b/Tests/HaloPersistenceTests/PeopleSearchTests.swift@@ -12,6 +12,75 @@ struct PeopleSearchTests {         try operation(FamilyRepository(stack: stack))     } +    @Test func structuredNamesEnrichTheSamePersonAndRoundTripSearch() throws {+        try withStore { graph in+            let family = try graph.createFamily(name: "Synthetic"), person = try graph.addPerson(name: "Mia T", familyID: family)+            let before = try graph.person(person)+            try graph.updatePerson(person, input: PersonInput(name: before.name, notes: " Known at swimming ",+                needsReview: false, givenName: " Mia ", familyName: " Tran "), expected: before)+            let enriched = try graph.person(person)+            #expect(enriched.id == person && enriched.name == "Mia T")+            #expect(enriched.givenName == "Mia" && enriched.familyName == "Tran" && enriched.notes == "Known at swimming")+            #expect(!enriched.needsReview)+            let directory = try #require(graph.stack.privateStore.url?.deletingLastPathComponent())+            let reopened = FamilyRepository(stack: try PersistenceStack(directory: directory))+            let root = try #require(reopened.families().first)+            let found = try #require(reopened.people(in: root.id, search: "tra").first)+            let restored = try reopened.person(found.id)+            #expect(restored.givenName == "Mia" && restored.familyName == "Tran" && restored.name == "Mia T")+        }+    }++    @Test func staleStructuredNameEditorCannotOverwriteAnyPersonFields() throws {+        try withStore { graph in+            let family = try graph.createFamily(name: "Synthetic"), person = try graph.addPerson(name: "Mia", familyID: family)+            let original = try graph.person(person)+            try graph.updatePerson(person, input: PersonInput(name: original.name, familyName: "Chen"), expected: original)+            #expect(throws: GraphError.self) {+                try graph.updatePerson(person, input: PersonInput(name: "Stale display", notes: "Stale note",+                    needsReview: false, givenName: "Stale given", familyName: "Stale family"), expected: original)+            }+            let current = try graph.person(person)+            #expect(current.name == "Mia" && current.familyName == "Chen" && current.notes.isEmpty && current.needsReview)+        }+    }++    @Test func lightweightEditsPreserveNamesAndExplicitBlankClearsWithoutChangingDisplay() throws {+        try withStore { graph in+            let family = try graph.createFamily(name: "Synthetic")+            let person = try graph.addPerson(name: "Girl from swimming", familyID: family)+            try graph.updatePerson(person, input: PersonInput(name: "Girl from swimming", givenName: "Mia", familyName: "Chen"),+                                   expected: graph.person(person))+            try graph.updatePerson(person, name: "Girl from swimming", notes: "Blue swim cap", needsReview: false,+                                   expected: graph.person(person))+            #expect(try graph.person(person).givenName == "Mia" && graph.person(person).familyName == "Chen")+            try graph.updatePerson(person, input: PersonInput(name: "Girl from swimming", givenName: " \n ", familyName: ""),+                                   expected: graph.person(person))+            let current = try graph.person(person)+            #expect(current.givenName.isEmpty && current.familyName.isEmpty && current.name == "Girl from swimming")+            #expect(try graph.people(in: family, search: "Chen").isEmpty)+        }+    }++    @Test func legacyNameOnlyModelsPreserveTheirExistingEditContract() throws {+        for version in ["HaloModelV1", "HaloModelV2"] {+            let directory = FileManager.default.temporaryDirectory.appendingPathComponent(UUID().uuidString)+            defer { try? FileManager.default.removeItem(at: directory) }+            let model = try PersistenceStack.loadModel(version: version)+            let stack = try PersistenceStack(directory: directory, model: model)+            stack.container.viewContext.automaticallyMergesChangesFromParent = false+            let graph = FamilyRepository(stack: stack)+            let family = try graph.createFamily(name: "Synthetic"), person = try graph.addPerson(name: "Sparse", familyID: family)+            try graph.updatePerson(person, name: "Enriched", notes: "Note", needsReview: false, expected: graph.person(person))+            let current = try graph.person(person)+            #expect(current.name == "Enriched" && current.givenName.isEmpty && current.familyName.isEmpty)+            #expect(throws: GraphError.self) {+                try graph.updatePerson(person, input: PersonInput(name: "Must not change", givenName: "New"), expected: current)+            }+            #expect(try graph.person(person) == current)+        }+    }+     @Test func namesEnteredTitlesAndHouseholdsMatchWithoutCrossFamilyResults() throws {         try withStore { graph in             let family = try graph.createFamily(name: "Synthetic family"), other = try graph.createFamily(name: "Other")
Tests/HaloPersistenceTests/PersonMergeTests.swift Modified +22 / -0
diff --git a/Tests/HaloPersistenceTests/PersonMergeTests.swift b/Tests/HaloPersistenceTests/PersonMergeTests.swiftindex 369ac0d..5e07228 100644--- a/Tests/HaloPersistenceTests/PersonMergeTests.swift+++ b/Tests/HaloPersistenceTests/PersonMergeTests.swift@@ -44,6 +44,28 @@ struct PersonMergeTests {         return choices     } +    @Test func structuredNameChoicesRemainSearchableAndUndoRestoresBothPeople() async throws {+        try await withFixture { fixture, _ in+            let graph = fixture.graph+            try graph.updatePerson(fixture.source,+                input: PersonInput(name: "Sophie C", givenName: "Sophia", familyName: "Chen"), expected: graph.person(fixture.source))+            try graph.updatePerson(fixture.survivor,+                input: PersonInput(name: "Sophie T", givenName: "Sophie", familyName: "Tran"), expected: graph.person(fixture.survivor))+            let beforeSource = try graph.person(fixture.source), beforeSurvivor = try graph.person(fixture.survivor)+            let preview = try graph.mergePreview(sourceID: fixture.source, survivorID: fixture.survivor)+            #expect(preview.source.givenName == "Sophia" && preview.survivor.familyName == "Tran")+            var selected = choices(preview)+            selected.name = .source; selected.givenName = .survivor; selected.familyName = .source+            let audit = try graph.mergePeople(preview, choices: selected)+            let kept = try graph.person(fixture.survivor)+            #expect(kept.name == "Sophie C" && kept.givenName == "Sophie" && kept.familyName == "Chen")+            #expect(try graph.people(in: fixture.family, search: "Chen").map(\.id) == [fixture.survivor])+            try graph.undoPersonMerge(audit)+            #expect(try graph.person(fixture.source) == beforeSource)+            #expect(try graph.person(fixture.survivor) == beforeSurvivor)+        }+    }+     @Test func suggestionsNeverMergeOrSuppressValidSameNamePeople() async throws {         try await withFixture { fixture, _ in             let graph = fixture.graph

Docs (7)

CHANGELOG.md Modified +11 / -0
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 436e4fc..fbfd236 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -4,6 +4,14 @@  ### Added +- Optional structured-name editing with atomic stale-edit checks, explicit merge+  choices and retained name undo/search behavior, including legacy-model support.+- Ordinary Person/ChildProfile/PersonGroup archive/restore with retained identities,+  links/history/assets, Include archived controls and stale/permission safeguards.+- Fourteen further synthetic name/archive/photo cases: current source declares+  146 tests/17 suites; strict lint 0/89 files, current test/build gate pending.+- Consolidated approved-plan source status and remaining runtime/release checklist.+ - Native per-child WidgetKit extension, scoped typed child/Context entities, compact   host capture form and authenticated local Shortcuts action on iOS and macOS. - Atomic optional Context membership during capture, current-reference validation,@@ -88,6 +96,9 @@  ### Changed +- Keep dynamic persistence errors private in logs, explicitly request iOS store+  protection after first unlock, and avoid CloudKit containers for device-only stacks.+ - Select model V6 while retaining V1–V5. Keep merge/recovery audits metadata-only   and preserve existing encoded photo/attachment assets. 
README.md Modified +28 / -13
diff --git a/README.md b/README.mdindex fed323d..0cddcf5 100644--- a/README.md+++ b/README.md@@ -89,12 +89,13 @@ retain original identities and accounts; guarded undo restores affected referenc only while unchanged. Review surfaces late accounts and competing merges. Recovery shows separate identities while preserving current references and earlier audits. -The workspace is a reversible navigation implementation that can accommodate the-remaining family/social-memory features. The app opens-`Persistence/Private.sqlite` and `Persistence/Shared.sqlite` inside the App Group,-with host-owned CloudKit mirroring. All windows reuse one host coordinator.-The old `HaloFamily-LocalDevelopment` database is left untouched and is not-copied into the App Group automatically.+The workspace uses the approved native navigation and shared persistence sources.+Account libraries open Private/Shared SQLite stores in an account/environment namespace+inside the App Group, with host-owned CloudKit mirroring. An explicit device-only library+uses a separate local namespace and does not mirror. All windows reuse the selected+host coordinator. Switching libraries does not upload device-only memories; moving them+requires explicit backup/import. Old unscoped stores and `HaloFamily-LocalDevelopment`+remain untouched and unattached until owner provenance is established.  Saving completes locally. CloudKit delivery is asynchronous; local saves do not promise that another device has received the changes. Startup failures offer@@ -105,7 +106,8 @@ Persistent history is retained until safe checkpoint-based pruning is verified.  The storage factories support local-only intent/widget roles: intents can write, widgets are read-only, and both require stores prepared by the host. There are-no shipped extension targets yet. Asset payloads are saved on a background context with external storage enabled.+a native WidgetKit extension and typed Shortcuts action in source, pending build and+runtime verification. Asset payloads are saved on a background context with external storage enabled. Person detail supports Photos/Files imports; primary photos are encoded as JPEG, up to 2048 pixels and 4 MB. Event JPEG/PNG/PDF imports allow up to 20 MB; image location metadata is stripped. Each import owns its Asset; replacing/removing a@@ -126,11 +128,10 @@ For an isolated Debug UI check, launch the built app with temporary directory or `/tmp` is accepted. This opens plain local SQLite stores without the App Group or CloudKit. Release builds ignore this Debug launch path. -The V5 gate passes 61 synthetic tests in 9 suites, strict lint in 44 files and-sequential iOS Simulator/macOS Debug builds. Runtime UI and actual two-account-CloudKit delivery remain unverified. Later application phases remain in progress.-V6 passes 79 synthetic cases in 10 suites, strict lint 0/55 files and both Debug-platform builds. The separate Contacts source checkout is outside this gate.+Historical V5 and V6 gates passed 61/9 and 79/10 cases/suites respectively, strict+lint and sequential iOS Simulator/macOS Debug builds. Current source additions remain+outside those executed gates. Runtime UI and actual two-account CloudKit delivery+remain unverified.  See the [acceptance report](docs/halo_family_design_pack/10-initial-implementation-results.md) for current evidence and verification limits.@@ -206,9 +207,23 @@ separate. Widget previews are generic, and actual content is marked privacy-sens Timeline reload is a request to the system, so cached names after access changes and locked-device redaction still need native validation. -Current source declares **132 synthetic tests/16 suites**, with strict lint **0/86+Current source declares **146 synthetic tests/17 suites**, with strict lint **0/89 files** and valid project/plists. New compilation, both Debug builds and native extension/UI runtime await the shared Mac slot. The last executed passing gate is still **3286293: 79 tests/10 suites and both Debug builds**. Account/share lifecycle, cache retention, legacy cache recovery, real CloudKit delivery, production schema and large-data/runtime evidence remain release gates. Persistent history is retained.++## Person names and archive/restore++Person details can add optional given/family names while retaining an independent+name or description. Search includes those names. Merge previews choose each name+field explicitly; undo retains the earlier names while affected records are unchanged.++Use **Archive and restore** in Person, child overview or group details. Archiving+changes current family views while retaining records, history and assets. Enable+**Include archived** in the corresponding list to find and restore them. Archiving a+child profile retains its Person; archiving that Person suppresses its current capture+suggestions too. A merged alias requires the guarded merge workflow rather than ordinary+restore. See the [release checklist](docs/halo_family_design_pack/10-initial-implementation-results.md)+for source completion and remaining native/account/schema gates.
docs/halo_family_design_pack/00-design-document.md Modified +3 / -3
diff --git a/docs/halo_family_design_pack/00-design-document.md b/docs/halo_family_design_pack/00-design-document.mdindex 99c3821..0ee8350 100644--- a/docs/halo_family_design_pack/00-design-document.md+++ b/docs/halo_family_design_pack/00-design-document.md@@ -3,7 +3,7 @@ **Working app name:** Halo Family   **Broader product family:** Halo   **Platform:** iOS  -**Status:** Ready for staged implementation; unresolved decisions gated in the handoff  +**Status:** Approved application scope implemented as source; current local/runtime release gates pending **Distribution:** Personal/family use first   **Storage principle:** On-device and iCloud/CloudKit only   **Backend:** None operated by the app developer@@ -685,7 +685,7 @@ Explicitly not goals:  See `03-open-questions.md` for the authoritative unresolved decision queue and `09-implementation-handoff.md` for phase gates. Do not interpret examples, candidate schema or likely UI directions as final decisions. -Outstanding areas include concurrent temporal histories, origin linked-source renames/deletion/merge, family primitives, Event states, attachment associations, navigation, privacy and production lifecycle policies. First-meeting provenance, competing origin preservation/review, five closeness labels/mapping and multiple custom dated roles are settled; persistence architecture is selected. See `decision_log.md` for the approved defaults.+Decision 2 in `decision_log.md` settles the remaining application defaults, including temporal history review, family/Event/assets, ordinary archival and privacy. Current source implements those defaults, with release verification tracked in `10-initial-implementation-results.md`. Graph visualisation retains its real-data prerequisite, class rollover remains v2, and optional appearance/future suggestion design remains deferred. Production account/cache retention, native extensions/UI, large-data and schema gates require current evidence. Permanent-delete implementation is conditional on the agreed release scope in Phase 11; actual live deletion always requires specific authority.  --- @@ -711,7 +711,7 @@ The following are stable enough to begin building around: - explicit duplicate merging; - iCloud/CloudKit sharing as a core architectural requirement. -The unresolved items above should remain visible during implementation rather than being silently decided in code.+The remaining validation and deferred-design items above stay explicit; source presence does not establish runtime or CloudKit delivery.   ---
docs/halo_family_design_pack/04-build-plan.md Modified +17 / -0
diff --git a/docs/halo_family_design_pack/04-build-plan.md b/docs/halo_family_design_pack/04-build-plan.mdindex 91558db..0930ab4 100644--- a/docs/halo_family_design_pack/04-build-plan.md+++ b/docs/halo_family_design_pack/04-build-plan.md@@ -2,6 +2,23 @@  **Status:** Full application implementation in progress; release gates remain separate +### Current source closure and release checklist — 2026-10-07 UTC++Optional structured names now have native editing, explicit merge field choices and+retained undo. Ordinary Person/ChildProfile/PersonGroup archive and restore preserves+identity, links and assets, with current-view suppression and stale/permission guards.+Fourteen further synthetic cases bring current source to **146 declarations/17 suites**;+strict lint passes **0/89 files**. Current compilation/tests and both Debug builds+await the parent-scheduled shared slot. Last executed passing gate is still **3286293:+79 cases/10 suites and both Debug builds**.++Phases 1–7 and 9 are implemented as source. Phase 8 requires enough real data;+Phase 10 remains v2. Phase 11 separates implemented local guards and approved+history retention from runtime, cache-retention, two-account, large-data and schema+release evidence. Permanent-delete implementation remains conditional on the agreed+release scope, as stated in Phase 11; ordinary removal archives. See the consolidated+[remaining checklist and evidence](10-initial-implementation-results.md).+ ### Widget and AppIntent implementation — 2026-10-07 UTC  Phase 9 source includes the native extension target, scoped typed child/Context
docs/halo_family_design_pack/10-initial-implementation-results.md Modified +64 / -0
diff --git a/docs/halo_family_design_pack/10-initial-implementation-results.md b/docs/halo_family_design_pack/10-initial-implementation-results.mdindex 454406a..b013806 100644--- a/docs/halo_family_design_pack/10-initial-implementation-results.md+++ b/docs/halo_family_design_pack/10-initial-implementation-results.md@@ -1,5 +1,69 @@ # Implementation evidence +## Person enrichment and archival source closure — 2026-10-07 UTC++Person details now edit optional given/family names independently from the required+name or description. One guarded save includes all fields; omitted structured names+preserve lightweight callers' existing values. Merge previews choose display, given+and family names separately, and guarded undo restores them with the original metadata.+Legacy V1/V2 edits remain supported without writing unavailable attributes.++Ordinary Person, ChildProfile and PersonGroup removal now archives, retaining UUIDs,+relationships, memberships, origins, gift parties, address labels and encoded assets.+Include archived exposes explicit restore. Archived people/children stop current+capture suggestions; stale writes and background photo imports reject archived owners.+Merge aliases cannot be restored through ordinary archive controls. Archive confirmation+freezes the reviewed record revision and states the effect on shared family views.+The iOS store explicitly requests the platform's existing after-first-unlock protection;+actual SQLite sidecars/external payload protection remains a runtime check. Dynamic+persistence errors use private OSLog interpolation. Explicit device-only stacks do not+construct a CloudKit container.++Fourteen further synthetic cases bring the current inventory to **146 declared tests+in 17 suites**. Strict lint passes **0 violations/89 files** and whitespace checks pass.+These declarations have not been compiled or executed. The last executed passing gate+remains **3286293: 79 cases/10 suites and both Debug builds**. Four independent final+source reviews identified two association archive-boundary gaps. Role saves now+revalidate the linked Person and membership-ending actions revalidate the linked+group inside their transaction; focused regressions preserve archived Context role+history editing. All four final source rechecks are clear; no current build or runtime pass is claimed.++### Approved plan reconciliation and remaining release checklist++| Plan section | Source status | Remaining evidence or dependency |+| --- | --- | --- |+| Phase 0 | Historical spike complete within its recorded scope | Does not establish the current application's release gates. |+| Phases 1–2 | Production stores/sharing, relationship workspace, capture, membership, origin/temporal history and Review implemented | Current combined test/build gate; native forms and actual sharing/transport validation. |+| Phases 3–5 | Approved photos, family knowledge, Sensitive Details, groups, social Events/gifts/attachments and archive/restore implemented | Native UI, image/document memory behavior and real shared delivery. |+| Phase 6 | Explicit field/overlap merge, retained identities, guarded undo and competing-account recovery implemented | Current regressions; actual two-account/offline histories and existing CKShare migration. |+| Phase 7 | Optional native Contacts and isolated device-local links implemented | Permission/picker/create/unlink behavior on an explicitly authorized test address book. |+| Phase 8 | Deferred by the approved real-data prerequisite | Enough representative data and authority to use it; no live family inspection performed. |+| Phase 9 | Native widget, scoped typed capture and compact host form implemented | Metadata extraction/embedding, configuration, authentication, cold/warm URLs, locked-device redaction and cached timeline behavior. |+| Phase 10 | v2 | Separate class-rollover design and implementation when requested. |+| Phase 11 | Account/access guards, bounded backup/import, private logs and explicit store protection implemented | Runtime/account/schema/storage gates below. History retention is approved until safe pruning is verified. |++- **Next local gate:** one scheduled `make test` with JUnit/coverage, then sequential+  `make check` for strict lint and iOS Simulator/macOS Debug builds. No parallel heavy+  runner starts before the parent grants the shared Mac slot.+- **Synthetic runtime hardening:** native forms and backup preview/restore/copy,+  quota/storage failures, image memory limits, large generated datasets, and actual+  SQLite/WAL/external-payload file protection. Domain tests cover local invariants;+  they do not substitute for these runtime observations.+- **Authorized account/device validation:** no-account and later restoration,+  account change, exact-share removal/read-only/reinvitation/offline behavior,+  two-account delivery and migrations of existing shares. Framework-managed cache+  content preservation needs evidence beyond retaining filenames. Legacy unscoped+  caches remain unattached until owner provenance is established.+- **Explicit release actions:** production CloudKit schema promotion, live invitations+  or private-data operations, physical-device installation, signing/account changes,+  permanent live deletion and merge/main publication need specific authority.+  Feature-branch/draft PR publication follows the user's review policy after the+  required local gate; it never implies an automatic merge.+- **Conditional source scope:** the approved permanent-delete behavior is a separate+  explicit action showing sharing impact. Phase 11 makes its implementation conditional+  on the agreed release scope; it is not an unresolved security/product decision or+  an unconditional source blocker. Ordinary removal is implemented as archive/restore.+ ## Widget and typed capture source increment — 2026-10-07 UTC  A native WidgetKit extension now shares the versioned persistence sources and
docs/halo_family_design_pack/CHANGELOG.md Modified +5 / -0
diff --git a/docs/halo_family_design_pack/CHANGELOG.md b/docs/halo_family_design_pack/CHANGELOG.mdindex 20cacf7..833ab79 100644--- a/docs/halo_family_design_pack/CHANGELOG.md+++ b/docs/halo_family_design_pack/CHANGELOG.md@@ -2,6 +2,11 @@  ## 7 October 2026 UTC +- Close native structured-name and ordinary Person/ChildProfile/PersonGroup archive/+  restore source gaps; include explicit name merge choices and retained undo/assets.+  Current inventory is 146 declarations/17 suites, strict lint 0/89; combined gates+  remain pending. Reconcile each plan section and conditional permanent-delete scope.+ - Add native per-child widget, scoped typed entities, authenticated local capture   intent and host capture form with optional Context membership. Twelve new source   cases bring inventory to 132/16 suites; strict lint 0/86 and valid project/plists.
docs/halo_family_design_pack/README.md Modified +3 / -2
diff --git a/docs/halo_family_design_pack/README.md b/docs/halo_family_design_pack/README.mdindex 3825e21..00ce72a 100644--- a/docs/halo_family_design_pack/README.md+++ b/docs/halo_family_design_pack/README.md@@ -42,9 +42,10 @@ The persistence spike concluded successfully enough to make a production decisio  Account/access lifecycle is now implemented as source, including a separate device-only library. Actual no-account/restoration, account-change, share-removal/reinvite and framework cache-retention validation remain release gates; see [current implementation evidence](10-initial-implementation-results.md). -Per-child WidgetKit and typed AppIntent capture UX are now implemented as source,+Person structured names, ordinary Person/ChildProfile/PersonGroup archive/restore,+per-child WidgetKit and typed AppIntent capture UX are now implemented as source, with optional Context membership and a compact host form. This checkout declares-132 synthetic cases in 16 suites; new compilation, extension/native runtime and+146 synthetic cases in 17 suites; new compilation, extension/native runtime and the combined gate are pending. The last executed passing gate remains 79 cases and both Debug builds at `3286293`; source lint does not replace those checks. 

Things to double-check

Combined gate pending

Run make test with JUnit/coverage then make check sequentially after parent grants the shared Mac slot. No current execution or platform build success is claimed.

Preserved external project normalization

Xcode rewrote project formatting, empty dependencies, runpath scalar/arrays and the extension destination from numeric13 to PlugIns under objectVersion90. Semantic comparison was read-only. This file is preserved and excluded from the source closure commit; the later build must validate actual embedding.

Native/account and release evidence

Native forms/Contacts/backup/widgets/authentication/cache redaction; actual account/share/offline lifecycle and framework content retention; existing shares/migrations/quota/large-data and production schema remain. Legacy recovery needs owner provenance. No real family data, live fixtures, signing/settings, physical installation, push or merge occurred.