The clarified rule excludes this family’s own children from Context teacher/role holders. Existing accidental entries remain available for review and explicit removal.
Ready to push and update draft
The clarified role scope is implemented, independently reviewed and locally verified. Three review findings are fixed. No task implementation blocker remains. Live release acceptance retains its documented limits; PR #1 remains a draft and no merge is authorized.
Pass rate: 100% (126 of 126)
New tests: 5
Diff coverage: 91% (177 of 195 added lines)
cec2976 [bug]: Exclude own children from Context roles working-tree Verification evidence and review receipt Your children no longer appear as choices when you add a teacher or other Context role holder. If an old entry already puts your child in that list, it is kept under Entries to review until you explicitly remove it. Removing the mistaken role keeps the child, friendships and other knowledge. Other children you know and adults remain available.
A Context role belongs to ContextPerson; normal child participation uses separate ConnectionContext records. A shared repository eligibility helper checks the Person’s current ChildProfile, while the picker applies a childProfile == nil fetch predicate. All interactive creation/retry/edit routes use the guard. The three read projections mark retained family-child roles, and native readers use that mark to separate recovery entries and withhold invalid editing.
Person.childProfile is the authoritative model inverse. Write validation occurs after canonical endpoint/family checks and before duplicate lookup or insertion, including repeated draft IDs. updateRole validates the current Person in the write context after the frozen association snapshot passes; a merge that gives that Person a ChildProfile therefore rejects an open stale form. Eligibility is deliberately not imposed on shared legacy lookup/end/removal, raw Core Data storage, portable backup retention or merge history: those routes must preserve recovery data. No schema migration or automatic cleanup occurs, and all existing permission/store/stale guards remain.
Halo Family/Halo Family/Persistence/ContextRoleEligibility.swift
Why it matters. The clarified restriction applies to this family’s ChildProfiles, not names, peers or inferred Context ownership.
What to look at. contextRoleCandidates / requireContextRolePerson
Halo Family/Halo Family/Persistence/ContextParticipationRepository.swift
Why it matters. Alternate callers, repeated request IDs and stale forms must not bypass picker filtering.
What to look at. associatePerson / contextPerson; RelationshipMutations.updateRole
Halo Family/Halo Family/ContextOverviewView.swift
Why it matters. The rule must not silently erase existing data or trap the user in an editor that can never save.
What to look at. Entries to review / roleEntry; ChildPeopleView review link; PersonOverviewView editor guard
Tests/HaloPersistenceTests/ContextRoleEligibilityTests.swift
Why it matters. Identity must remain safe through retries, archive, merge, backup restore and explicit removal.
What to look at. five new domain functions / two targeted WorkspaceUITests
Archived profiles remain own children. Separate people with the same name, adults and ordinary peer Persons remain eligible; new-person mode creates a distinct identity. Ordinary child connections, memberships, family facts and event participation remain available.
Creation/retry/edit are guarded; existing legacy associations remain readable and exportable/restorable. Ending and confirmed removal retain the previous permission/stale snapshot checks. No automatic data deletion, migration or reset is introduced.
The legacy-child-role fixture injects an old invalid association only in an explicitly selected Debug synthetic host store with no account scope or CloudKit mirroring. Empty-store seeding and relaunch without reseeding preserve the existing safety boundary.
| Severity | Area | Finding | Resolution |
|---|---|---|---|
| major | Child People legacy presentation | An alternate reader still presented retained child roles under normal teachers/coaches. | Partition by isFamilyChild and add an Entries to review Context-reader link; the native legacy case enters through this recovery route. |
| minor | Person legacy role editing | The Person reader still advertised an editor whose save would always reject the retained child role. | Withhold that editor and explain the existing Context review/removal route. |
| minor | Canonical product contract | Only the decision log stated the newly clarified role eligibility and retention rule. | Update design §3.6b and data model §9b alongside implementation evidence. |
Source: local run at 2026-10-09T05:08:32.626272+00:00 · snapshot cec2976ff2e75a131b305eb8c1e4383c209b1feb (dirty working tree)
Baseline: none
Execution: passed · JUnit: 1 file · Coverage: 1 file · Baseline: absent
Coverage scope: as the project configures it
Totals: 126 passed · 0 failed · 0 skipped · 0 errored · 0 flaky
Derived by declaration name, from the diff (no baseline run).
Aggregate diff coverage: 91% (177 of 195 measurable added lines).
Head 69.3% (6878 of 9923 lines)
9 of 20 changed files matched coverage data.
CHANGELOG.md — no candidateHalo Family/Halo Family/ChildPeopleView.swift — no candidateHalo Family/Halo Family/ContextOverviewView.swift — no candidateHalo Family/Halo Family/ContextParticipationSheets.swift — no candidateHalo Family/Halo Family/ContextsView.swift — no candidateHalo Family/Halo Family/PersonOverviewView.swift — no candidateTests/HaloUITests/WorkspaceUITests.swift — no candidatedocs/halo_family_design_pack/00-design-document.md — no candidatedocs/halo_family_design_pack/01-data-model.md — no candidatedocs/halo_family_design_pack/10-initial-implementation-results.md — no candidatedocs/halo_family_design_pack/decision_log.md — no candidateFiles 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 acf562c19149258bbc650dee736b6b8d0d2d7edf.
20 files: 15 code · 5 docs. Click to expand.
diff --git a/Halo Family/Halo Family/ChildPeopleView.swift b/Halo Family/Halo Family/ChildPeopleView.swiftindex deae310..6fc89db 100644--- a/Halo Family/Halo Family/ChildPeopleView.swift +++ b/Halo Family/Halo Family/ChildPeopleView.swift @@ -8,6 +8,7 @@ struct ChildPeopleView: View { let childID: NSManagedObjectID @State private var peers: [PeerCard] = [] @State private var roles: [ContextPersonRow] = []+ @State private var contexts: [ContextRow] = [] @State private var search = "" @State private var matchingPersonIDs: Set<NSManagedObjectID>? @State private var includeHistorical = false@@ -23,6 +24,10 @@ struct ChildPeopleView: View { } } + private var visibleRoles: [ContextPersonRow] {+ roles.filter { matchingPersonIDs?.contains($0.personID) ?? true }+ }+ var body: some View { List { Section("People they know") {@@ -38,9 +43,9 @@ struct ChildPeopleView: View { .foregroundStyle(.secondary) } }- if !roles.isEmpty {+ if visibleRoles.contains(where: { !$0.isFamilyChild }) { Section("Teachers, coaches and other roles") {- ForEach(roles.filter { matchingPersonIDs?.contains($0.personID) ?? true }) { role in+ ForEach(visibleRoles.filter { !$0.isFamilyChild }) { role in NavigationLink { PersonDetailView(repository: repository, familyID: familyID, personID: role.personID, perspectiveChildID: childID)@@ -56,6 +61,24 @@ struct ChildPeopleView: View { } } }+ if visibleRoles.contains(where: \.isFamilyChild) {+ Section("Entries to review") {+ ForEach(visibleRoles.filter(\.isFamilyChild)) { role in+ if let context = contexts.first(where: { $0.id == role.contextID }) {+ NavigationLink {+ ContextDetailView(repository: repository, familyID: familyID, context: context)+ } label: {+ VStack(alignment: .leading, spacing: 4) {+ Text(role.name).font(.headline)+ Text("Your child is recorded as a role holder in \(context.path). Review the accidental entry.")+ .font(.caption).foregroundStyle(.secondary)+ }+ }+ .accessibilityIdentifier("child.reviewRole.\(role.name)")+ }+ }+ }+ } } .navigationTitle("People") .workspaceNavigation()@@ -92,11 +115,15 @@ struct ChildPeopleView: View { let current = try repository.peerCards(for: [childID], includeHistorical: includeHistorical, includeArchived: includeArchived) let contextIDs = Set(current.flatMap { $0.currentMemberships.map(\.contextID) }) let roles = try repository.roleHolders(in: contextIDs, includeDeceased: includeHistorical)+ contexts = try repository.contexts(in: familyID) peers = current self.roles = roles captureAvailable = repository.canCapture(childID) reloadSearch()- } catch { peers = []; roles = []; matchingPersonIDs = []; captureAvailable = false; failure = error.localizedDescription }+ } catch {+ peers = []; roles = []; contexts = []; matchingPersonIDs = []; captureAvailable = false+ failure = error.localizedDescription+ } } private func reloadSearch() {
diff --git a/Halo Family/Halo Family/ContextOverviewView.swift b/Halo Family/Halo Family/ContextOverviewView.swiftindex 19a898a..5bcc857 100644--- a/Halo Family/Halo Family/ContextOverviewView.swift +++ b/Halo Family/Halo Family/ContextOverviewView.swift @@ -77,28 +77,14 @@ struct ContextDetailView: View { } } }- if !visibleRoles.isEmpty {+ if visibleRoles.contains(where: { !$0.isFamilyChild }) { HaloSection("Teachers, coaches and other roles") {- ForEach(visibleRoles) { role in- HStack {- NavigationLink {- PersonDetailView(repository: repository, familyID: familyID, personID: role.personID)- } label: {- VStack(alignment: .leading, spacing: 4) {- Text(role.name).font(.headline)- Text(role.role.isEmpty ? "Role not recorded" : role.role).foregroundStyle(.secondary)- if let start = role.startedAt { Text("From \(start.formatted(date: .abbreviated, time: .omitted))").font(.caption) }- if let end = role.endedAt { Text("Until \(end.formatted(date: .abbreviated, time: .omitted))").font(.caption) }- }- }- .accessibilityIdentifier("role.\(role.name)")- .buttonStyle(.plain)- Spacer()- Button("Edit") { editingRole = role }- participationActions(.role(role),- identifier: "context.participation.role.\(role.name).\(role.role)")- }- }+ ForEach(visibleRoles.filter { !$0.isFamilyChild }) { roleEntry($0) }+ }+ }+ if visibleRoles.contains(where: \.isFamilyChild) {+ HaloSection("Entries to review") {+ ForEach(visibleRoles.filter(\.isFamilyChild)) { roleEntry($0) } } } if visibleConnections.isEmpty && visibleRoles.isEmpty {@@ -144,6 +130,33 @@ struct ContextDetailView: View { .graphFailure($failure) } + private func roleEntry(_ role: ContextPersonRow) -> some View {+ HStack {+ NavigationLink {+ PersonDetailView(repository: repository, familyID: familyID, personID: role.personID)+ } label: {+ VStack(alignment: .leading, spacing: 4) {+ Text(role.name).font(.headline)+ Text(role.role.isEmpty ? "Role not recorded" : role.role).foregroundStyle(.secondary)+ if role.isFamilyChild {+ Text("Your child is recorded as a role holder. Remove this accidental entry.")+ .font(.caption).foregroundStyle(.secondary)+ }+ if let start = role.startedAt { Text("From \(start.formatted(date: .abbreviated, time: .omitted))").font(.caption) }+ if let end = role.endedAt { Text("Until \(end.formatted(date: .abbreviated, time: .omitted))").font(.caption) }+ }+ }+ .accessibilityIdentifier("role.\(role.name)")+ .buttonStyle(.plain)+ Spacer()+ if !role.isFamilyChild {+ Button("Edit") { editingRole = role }+ }+ participationActions(.role(role),+ identifier: "context.participation.role.\(role.name).\(role.role)")+ }+ }+ private func participationActions(_ participation: ContextParticipation, identifier: String) -> some View { Menu { if period != .past {
diff --git a/Halo Family/Halo Family/ContextParticipationSheets.swift b/Halo Family/Halo Family/ContextParticipationSheets.swiftindex 8cfec7d..24acb2c 100644--- a/Halo Family/Halo Family/ContextParticipationSheets.swift +++ b/Halo Family/Halo Family/ContextParticipationSheets.swift @@ -57,7 +57,7 @@ struct ContextPersonCreationSheet: View { .task { nameFocused = true } .task(id: useExisting) { guard useExisting else { return }- do { people = try repository.people(in: familyID, includeDeceased: false) } catch {+ do { people = try repository.contextRoleCandidates(in: familyID) } catch { failure = error.localizedDescription } }
diff --git a/Halo Family/Halo Family/ContextsView.swift b/Halo Family/Halo Family/ContextsView.swiftindex 78085f6..a34ca6c 100644--- a/Halo Family/Halo Family/ContextsView.swift +++ b/Halo Family/Halo Family/ContextsView.swift @@ -229,7 +229,12 @@ struct ContextDetailEditor: View { if let end = association.endedAt { Text("Until \(end.formatted(date: .abbreviated, time: .omitted))") } } }- Button("Edit role or dates") { editingAssociation = association }+ if association.isFamilyChild {+ Text("Your child is recorded as a role holder. Remove the accidental entry from the Context reader.")+ .font(.caption).foregroundStyle(.secondary)+ } else {+ Button("Edit role or dates") { editingAssociation = association }+ } } Button("Add teacher or other person") { addingPerson = true } }
diff --git a/Halo Family/Halo Family/Persistence/ContextParticipationRepository.swift b/Halo Family/Halo Family/Persistence/ContextParticipationRepository.swiftindex 8a5c782..48d2cbf 100644--- a/Halo Family/Halo Family/Persistence/ContextParticipationRepository.swift +++ b/Halo Family/Halo Family/Persistence/ContextParticipationRepository.swift @@ -33,6 +33,7 @@ extension FamilyRepository { ((person.value(forKey: "displayName") as? String ?? "") == name) else { throw GraphError.roleChanged } _ = try record(person.objectID, entity: "Person", in: context) try requireSameFamily(person, family: family)+ try requireContextRolePerson(person, family: family) return existing } let person: NSManagedObject@@ -53,6 +54,7 @@ extension FamilyRepository { func contextPerson(person: NSManagedObject, source: NSManagedObject, role: String, startedAt: Date?, endedAt: Date?, in context: NSManagedObjectContext) throws -> NSManagedObject { let family = try family(of: source)+ try requireContextRolePerson(person, family: family) let request = NSFetchRequest<NSManagedObject>(entityName: "ContextPerson") request.affectedStores = [try owningStore(of: family)] request.predicate = NSPredicate(format: "person == %@ AND context == %@", person, source)
diff --git a/Halo Family/Halo Family/Persistence/ContextRoleEligibility.swift b/Halo Family/Halo Family/Persistence/ContextRoleEligibility.swiftnew file mode 100644index 0000000..54962ec--- /dev/null+++ b/Halo Family/Halo Family/Persistence/ContextRoleEligibility.swift @@ -0,0 +1,16 @@+import CoreData++@MainActor+extension FamilyRepository {+ func contextRoleCandidates(in familyID: NSManagedObjectID) throws -> [GraphRow] {+ try people(in: familyID, includeDeceased: false, includeChildren: false)+ }++ func requireContextRolePerson(_ person: NSManagedObject, family: NSManagedObject) throws {+ try requireSameFamily(person, family: family)+ if let profile = person.value(forKey: "childProfile") as? NSManagedObject {+ try requireSameFamily(profile, family: family)+ throw GraphError.childContextRole+ }+ }+}
diff --git a/Halo Family/Halo Family/Persistence/FamilyRepository.swift b/Halo Family/Halo Family/Persistence/FamilyRepository.swiftindex 08b77ba..f2cd6d3 100644--- a/Halo Family/Halo Family/Persistence/FamilyRepository.swift +++ b/Halo Family/Halo Family/Persistence/FamilyRepository.swift @@ -25,6 +25,7 @@ enum GraphError: LocalizedError { case stateChanged case stateConflict case invalidState+ case childContextRole case roleChanged var errorDescription: String? {@@ -46,6 +47,7 @@ enum GraphError: LocalizedError { case .stateChanged: "The relationship changed. Reopen it before saving." case .stateConflict: "There are overlapping relationship changes. Their history has been retained for review." case .invalidState: "A relationship history record could not be read. Its stored value has been preserved."+ case .childContextRole: "Your children cannot be added as Context role holders. Remove an accidental role entry instead." case .roleChanged: "This role association changed. Reopen it before saving." } }
diff --git a/Halo Family/Halo Family/Persistence/PeopleSearch.swift b/Halo Family/Halo Family/Persistence/PeopleSearch.swiftindex 9e96069..23dd665 100644--- a/Halo Family/Halo Family/Persistence/PeopleSearch.swift +++ b/Halo Family/Halo Family/Persistence/PeopleSearch.swift @@ -74,7 +74,8 @@ extension FamilyRepository { let association = ContextPersonRow(id: row.objectID, contextID: context.objectID, personID: personID, name: row.value(forKeyPath: "person.displayName") as? String ?? "Unnamed", role: row.value(forKey: "role") as? String ?? "", startedAt: row.value(forKey: "startedAt") as? Date, endedAt: row.value(forKey: "endedAt") as? Date,- notes: row.value(forKey: "notes") as? String, stableID: row.value(forKey: "id") as? UUID)+ notes: row.value(forKey: "notes") as? String, stableID: row.value(forKey: "id") as? UUID,+ isFamilyChild: person.value(forKey: "childProfile") != nil) return PersonContextRoleRow(association: association, contextPath: contextPath(context), isArchived: context.value(forKey: "archivedAt") != nil, contextEndDate: context.value(forKey: "endDate") as? Date)
diff --git a/Halo Family/Halo Family/Persistence/RelationshipMutations.swift b/Halo Family/Halo Family/Persistence/RelationshipMutations.swiftindex 8d8f6ae..0494b10 100644--- a/Halo Family/Halo Family/Persistence/RelationshipMutations.swift +++ b/Halo Family/Halo Family/Persistence/RelationshipMutations.swift @@ -158,6 +158,8 @@ extension FamilyRepository { _ = try write { context in guard id == expected.id else { throw GraphError.roleChanged } let link = try contextRole(expected, in: context)+ let person = try record(expected.personID, entity: "Person", in: context)+ try requireContextRolePerson(person, family: family(of: link)) let role = role.trimmingCharacters(in: .whitespacesAndNewlines) link.setValue(role.isEmpty ? nil : role, forKey: "role") link.setValue(startedAt, forKey: "startedAt")
diff --git a/Halo Family/Halo Family/Persistence/RelationshipQueries.swift b/Halo Family/Halo Family/Persistence/RelationshipQueries.swiftindex 426df31..a063746 100644--- a/Halo Family/Halo Family/Persistence/RelationshipQueries.swift +++ b/Halo Family/Halo Family/Persistence/RelationshipQueries.swift @@ -80,6 +80,7 @@ struct ContextPersonRow: Identifiable, Equatable { let endedAt: Date? var notes: String? var stableID: UUID?+ var isFamilyChild = false } struct ContextConnectionRow: Identifiable, Equatable {@@ -99,11 +100,13 @@ struct ContextConnectionRow: Identifiable, Equatable { @MainActor extension FamilyRepository { func people(in familyID: NSManagedObjectID, search: String = "", needsReview: Bool = false,- includeDeceased: Bool = true, includeArchived: Bool = false) throws -> [GraphRow] {+ includeDeceased: Bool = true, includeArchived: Bool = false,+ includeChildren: Bool = true) throws -> [GraphRow] { var predicates = [NSPredicate(format: "familySpace == %@", familyID)] let conflicted = try mergeConflicts(in: familyID).flatMap { $0.people.map(\.id) } let current = includeArchived ? "mergedInto == nil" : "archivedAt == nil AND mergedInto == nil" predicates.append(NSPredicate(format: "(\(current)) OR SELF IN %@", conflicted))+ if !includeChildren { predicates.append(NSPredicate(format: "childProfile == nil")) } if needsReview || !includeDeceased { predicates.append(NSPredicate(format: "isDeceased == NO OR isDeceased == nil")) } let search = search.trimmingCharacters(in: .whitespacesAndNewlines) if !search.isEmpty { predicates.append(try peopleSearch(search, familyID: familyID)) }@@ -233,7 +236,8 @@ extension FamilyRepository { role: object.value(forKey: "role") as? String ?? "", startedAt: object.value(forKey: "startedAt") as? Date, endedAt: object.value(forKey: "endedAt") as? Date,- notes: object.value(forKey: "notes") as? String, stableID: object.value(forKey: "id") as? UUID)+ notes: object.value(forKey: "notes") as? String, stableID: object.value(forKey: "id") as? UUID,+ isFamilyChild: person.value(forKey: "childProfile") != nil) } }
diff --git a/Halo Family/Halo Family/Persistence/SyntheticWorkspace.swift b/Halo Family/Halo Family/Persistence/SyntheticWorkspace.swiftindex 99d0a27..888389c 100644--- a/Halo Family/Halo Family/Persistence/SyntheticWorkspace.swift +++ b/Halo Family/Halo Family/Persistence/SyntheticWorkspace.swift @@ -8,14 +8,14 @@ enum SyntheticWorkspace { arguments: [String] = ProcessInfo.processInfo.arguments) throws { guard let index = arguments.firstIndex(of: "--synthetic-fixture") else { return } guard try SyntheticLaunch.directory(arguments: arguments) != nil, arguments.indices.contains(index + 1),- ["rich", "dense"].contains(arguments[index + 1]), repository.stack.accountScope == nil,+ ["rich", "dense", "legacy-child-role"].contains(arguments[index + 1]), repository.stack.accountScope == nil, !(repository.stack.container is NSPersistentCloudKitContainer) else { throw GraphError.invalidReference } // Relaunch preserves the same fixture and any changes made by a UI journey; never reset or reseed it. guard try repository.families().isEmpty else { return }- try seed(repository, dense: arguments[index + 1] == "dense")+ try seed(repository, dense: arguments[index + 1] == "dense", legacyChildRole: arguments[index + 1] == "legacy-child-role") } - @MainActor private static func seed(_ graph: FamilyRepository, dense: Bool) throws {+ @MainActor private static func seed(_ graph: FamilyRepository, dense: Bool, legacyChildRole: Bool) throws { let family = try graph.createFamily(name: "Demo family") let avery = try graph.addChild(name: "Avery", familyID: family) let jamie = try graph.addChild(name: "Jamie", familyID: family)@@ -46,6 +46,19 @@ enum SyntheticWorkspace { try graph.setArchived(graph.archiveSnapshot(graph.personID(for: archived)), archived: true) let teacher = try graph.addPerson(name: "River", familyID: family) _ = try graph.associatePerson(teacher, contextID: classID, role: "Teacher")+ if legacyChildRole {+ // Reproduce an old invalid role only in the bounded, opted-in Debug fixture above.+ _ = try graph.write { context in+ let child = try graph.record(avery, entity: "ChildProfile", in: context)+ let store = try graph.owningStore(of: graph.family(of: child))+ let link = graph.insert("ContextPerson", in: context, store: store)+ link.setValue(try graph.record(family, entity: "FamilySpace", in: context), forKey: "familySpace")+ link.setValue(try graph.record(classID, entity: "Context", in: context), forKey: "context")+ link.setValue(child.value(forKey: "person"), forKey: "person")+ link.setValue("Accidental child role", forKey: "role")+ return link+ }+ } let parent = try graph.addPerson(name: "Robin", familyID: family) let childPerson = try graph.childCard(avery, peers: graph.peerCards(for: [avery])).person.id try graph.addFamilyFact(sourceID: parent, targetID: childPerson, kind: .parentOf)
diff --git a/Halo Family/Halo Family/Persistence/WorkspaceQueries.swift b/Halo Family/Halo Family/Persistence/WorkspaceQueries.swiftindex 3b8cdc6..6480acf 100644--- a/Halo Family/Halo Family/Persistence/WorkspaceQueries.swift +++ b/Halo Family/Halo Family/Persistence/WorkspaceQueries.swift @@ -192,7 +192,8 @@ extension FamilyRepository { name: person.value(forKey: "displayName") as? String ?? "Unnamed", role: association.value(forKey: "role") as? String ?? "", startedAt: start, endedAt: end, notes: association.value(forKey: "notes") as? String,- stableID: association.value(forKey: "id") as? UUID)+ stableID: association.value(forKey: "id") as? UUID,+ isFamilyChild: person.value(forKey: "childProfile") != nil) } }
diff --git a/Halo Family/Halo Family/PersonOverviewView.swift b/Halo Family/Halo Family/PersonOverviewView.swiftindex cb383dc..dd8e8da 100644--- a/Halo Family/Halo Family/PersonOverviewView.swift +++ b/Halo Family/Halo Family/PersonOverviewView.swift @@ -285,7 +285,12 @@ 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))") } if let end = role.contextEndDate { Text("Context through " + ContextEndDate.formatted(end)).font(.caption) }- Button("Edit role or dates") { editingRole = role.association }.disabled(!canEdit)+ if role.association.isFamilyChild {+ Text("Your child is recorded as a role holder. Open the Context to review and remove the accidental entry.")+ .font(.caption).foregroundStyle(.secondary)+ } else {+ Button("Edit role or dates") { editingRole = role.association }.disabled(!canEdit)+ } } } if let connection {
diff --git a/Tests/HaloPersistenceTests/ContextRoleEligibilityTests.swift b/Tests/HaloPersistenceTests/ContextRoleEligibilityTests.swiftnew file mode 100644index 0000000..0948bd5--- /dev/null+++ b/Tests/HaloPersistenceTests/ContextRoleEligibilityTests.swift@@ -0,0 +1,169 @@+import CoreData+import Testing+@testable import HaloPersistence++@MainActor+struct ContextRoleEligibilityTests {+ private func withGraph(shared: Bool = false, _ test: (GraphFixture, URL) throws -> Void) throws {+ let directory = FileManager.default.temporaryDirectory.appendingPathComponent(UUID().uuidString)+ defer { try? FileManager.default.removeItem(at: directory) }+ try test(GraphFixture(directory: directory, shared: shared), directory)+ }++ private func legacyRole(_ fixture: GraphFixture, personID: NSManagedObjectID,+ sourceID: NSManagedObjectID, requestID: UUID = UUID()) throws -> NSManagedObjectID {+ let graph = fixture.graph+ return try graph.write { context in+ let family = try graph.record(fixture.family, entity: "FamilySpace", in: context)+ let link = graph.insert("ContextPerson", in: context, store: try graph.owningStore(of: family))+ link.setValue(requestID, forKey: "id")+ link.setValue(family, forKey: "familySpace")+ link.setValue(try graph.record(personID, entity: "Person", in: context), forKey: "person")+ link.setValue(try graph.record(sourceID, entity: "Context", in: context), forKey: "context")+ link.setValue("Teacher", forKey: "role")+ link.setValue("Retained legacy entry", forKey: "notes")+ return link+ }+ }++ @Test(arguments: [false, true]) func candidatesAndBothCreationRoutesExcludeAllOwnChildren(shared: Bool) throws {+ try withGraph(shared: shared) { fixture, _ in+ let graph = fixture.graph+ let source = try graph.createContext(name: "Class", familyID: fixture.family)+ let sibling = try graph.addChild(name: "Sibling", familyID: fixture.family)+ let ownPerson = try graph.childCard(fixture.child, peers: []).person.id+ let siblingPerson = try graph.childCard(sibling, peers: []).person.id+ let adult = try graph.addPerson(name: "Teacher", familyID: fixture.family)+ let namesake = try graph.addPerson(name: "Child", familyID: fixture.family)+ let peerPerson = try graph.personID(for: fixture.connection)+ let before = Set(try graph.people(in: fixture.family).map(\.id))+ #expect(Set(try graph.contextRoleCandidates(in: fixture.family).map(\.id)) == [adult, namesake, peerPerson])+ for childPerson in [ownPerson, siblingPerson] {+ for role in ["", "Teacher", "Other"] {+ #expect(throws: GraphError.childContextRole) {+ try graph.addContextPerson(ContextPersonDraft(personID: childPerson, role: role), contextID: source)+ }+ #expect(throws: GraphError.childContextRole) {+ try graph.associatePerson(childPerson, contextID: source, role: role)+ }+ }+ }+ #expect(try graph.contextPeople(source).isEmpty)+ #expect(Set(try graph.people(in: fixture.family).map(\.id)) == before)+ for person in [adult, namesake, peerPerson] { _ = try graph.associatePerson(person, contextID: source, role: "Other") }+ #expect(Set(try graph.contextPeople(source).map(\.personID)) == [adult, namesake, peerPerson])+ let newRole = try graph.addContextPerson(ContextPersonDraft(name: "Child", role: "Teacher"), contextID: source)+ let newPerson = try #require(try graph.contextPeople(source).first { $0.id == newRole })+ #expect(newPerson.personID != ownPerson && newPerson.name == "Child" && !newPerson.isFamilyChild)+ #expect(try graph.children(in: fixture.family).count == 2)+ }+ }++ @Test func archivedOwnChildrenRemainIneligibleAndNormalParticipationRemainsValid() throws {+ try withGraph { fixture, _ in+ let graph = fixture.graph+ let source = try graph.createContext(name: "Class", familyID: fixture.family)+ let sibling = try graph.addChild(name: "Sibling", familyID: fixture.family)+ let siblingPerson = try graph.childCard(sibling, peers: []).person.id+ let siblingConnection = try graph.connect(personID: siblingPerson, childID: fixture.child)+ _ = try graph.addMembership(connectionID: fixture.connection, contextID: source)+ _ = try graph.addMembership(connectionID: siblingConnection, contextID: source)+ let ownPerson = try graph.childCard(fixture.child, peers: []).person.id+ try graph.addFamilyFact(sourceID: ownPerson, targetID: siblingPerson, kind: .siblingOf)+ let event = try graph.createEvent(title: "Party", date: Date(timeIntervalSince1970: 100), familyID: fixture.family)+ try graph.saveParticipant(eventID: event, personID: ownPerson, roles: ["Guest"], invitation: .invited,+ attendance: .attended, note: "", expected: nil)+ try graph.setArchived(graph.archiveSnapshot(sibling), archived: true)+ #expect(try graph.contextConnections(source).count == 2)+ #expect(try graph.contextRoleCandidates(in: fixture.family).allSatisfy { $0.id != siblingPerson && $0.id != ownPerson })+ #expect(throws: GraphError.childContextRole) { try graph.associatePerson(siblingPerson, contextID: source, role: "Other") }+ #expect(try graph.person(siblingPerson).name == "Sibling")+ }+ }++ @Test(arguments: [false, true]) func legacyChildRoleIsRetainedButCannotBeEditedOrRetriedAndCanBeRemoved(shared: Bool) throws {+ try withGraph(shared: shared) { fixture, directory in+ let graph = fixture.graph+ let source = try graph.createContext(name: "Class", familyID: fixture.family)+ let elsewhere = try graph.createContext(name: "Club", familyID: fixture.family)+ let ownPerson = try graph.childCard(fixture.child, peers: []).person.id+ let requestID = UUID()+ let selected = try legacyRole(fixture, personID: ownPerson, sourceID: source, requestID: requestID)+ let other = try legacyRole(fixture, personID: ownPerson, sourceID: elsewhere)+ let membership = try graph.addMembership(connectionID: fixture.connection, contextID: source)+ let adult = try graph.addPerson(name: "Teacher", familyID: fixture.family)+ let adultRole = try graph.associatePerson(adult, contextID: source, role: "Teacher")+ let row = try #require(try graph.contextPeople(source).first { $0.id == selected })+ #expect(row.isFamilyChild && row.notes == "Retained legacy entry")+ #expect(try graph.personContextRoles(ownPerson).allSatisfy { $0.association.isFamilyChild })+ #expect(throws: GraphError.childContextRole) {+ try graph.updateRole(selected, role: "Coach", startedAt: nil, endedAt: nil, expected: row)+ }+ #expect(throws: GraphError.childContextRole) {+ try graph.addContextPerson(ContextPersonDraft(requestID: requestID, personID: ownPerson, role: "Teacher"),+ contextID: source)+ }+ #expect(throws: GraphError.childContextRole) { try graph.associatePerson(ownPerson, contextID: source, role: "Teacher") }+ #expect(try graph.contextPeople(source).first { $0.id == selected } == row)+ try graph.endContextRole(row, at: Date(timeIntervalSince1970: 100))+ let ended = try #require(try graph.contextPeople(source).first { $0.id == selected })+ try graph.removeContextRole(ended)+ #expect(try graph.contextPeople(source).map(\.id) == [adultRole])+ #expect(try graph.contextPeople(elsewhere).map(\.id) == [other])+ #expect(try graph.contextConnections(source).map(\.id) == [membership])+ #expect(try graph.childCard(fixture.child, peers: []).person.id == ownPerson)+ let reopened = FamilyRepository(stack: try PersistenceStack(directory: directory))+ let sourceID = try #require(reopened.stack.container.persistentStoreCoordinator.managedObjectID(+ forURIRepresentation: source.uriRepresentation()))+ #expect(try reopened.contextPeople(sourceID).map { $0.id.uriRepresentation() } == [adultRole.uriRepresentation()])+ }+ }++ @Test func personBecomingChildAfterPickerOrEditorOpenedRejectsWrite() throws {+ try withGraph { fixture, _ in+ let graph = fixture.graph+ let source = try graph.createContext(name: "Class", familyID: fixture.family)+ let person = try graph.addPerson(name: "Possible educator", familyID: fixture.family)+ let draft = ContextPersonDraft(personID: person, role: "Teacher")+ let role = try graph.addContextPerson(draft, contextID: source)+ let expected = try #require(try graph.contextPeople(source).first)+ #expect(try graph.contextRoleCandidates(in: fixture.family).contains { $0.id == person })+ let childPerson = try graph.childCard(fixture.child, peers: []).person.id+ _ = try graph.mergePeople(graph.mergePreview(sourceID: childPerson, survivorID: person), choices: PersonMergeChoices())+ #expect(try graph.contextRoleCandidates(in: fixture.family).allSatisfy { $0.id != person })+ #expect(throws: GraphError.childContextRole) { try graph.addContextPerson(draft, contextID: source) }+ #expect(throws: GraphError.childContextRole) {+ try graph.updateRole(role, role: "Coach", startedAt: nil, endedAt: nil, expected: expected)+ }+ #expect(try graph.contextPeople(source).first?.isFamilyChild == true)+ #expect(try graph.contextPeople(source).first?.role == "Teacher")+ try graph.removeContextRole(#require(try graph.contextPeople(source).first))+ #expect(try graph.children(in: fixture.family).first?.id == fixture.child)+ }+ }++ @Test func backupRestoreRetainsLegacyEntryForExplicitRemovalWithoutMutatingOriginal() async throws {+ let directory = FileManager.default.temporaryDirectory.appendingPathComponent(UUID().uuidString)+ defer { try? FileManager.default.removeItem(at: directory) }+ let fixture = try GraphFixture(directory: directory)+ let graph = fixture.graph+ let source = try graph.createContext(name: "Class", familyID: fixture.family)+ let childPerson = try graph.childCard(fixture.child, peers: []).person.id+ let original = try legacyRole(fixture, personID: childPerson, sourceID: source)+ let service = BackupRepository(stack: fixture.stack)+ let archive = try await service.export(familyID: fixture.family)+ defer { try? FileManager.default.removeItem(at: archive.deletingLastPathComponent()) }+ let preview = try await service.preview(archive)+ let target = try PersistenceStack(directory: directory.appendingPathComponent("Restore"))+ let family = try await BackupRepository(stack: target).restore(preview, asNewCopy: false)+ let restored = FamilyRepository(stack: target)+ let restoredSource = try #require(try restored.contexts(in: family).first?.id)+ let row = try #require(try restored.contextPeople(restoredSource).first)+ #expect(row.isFamilyChild && row.id != original && row.notes == "Retained legacy entry")+ #expect(try restored.contextRoleCandidates(in: family).allSatisfy { $0.id != row.personID })+ try restored.removeContextRole(row)+ #expect(try restored.contextPeople(restoredSource).isEmpty)+ #expect(try restored.children(in: family).count == 1)+ #expect(try graph.contextPeople(source).map(\.id) == [original])+ }+}
diff --git a/Tests/HaloUITests/WorkspaceUITests.swift b/Tests/HaloUITests/WorkspaceUITests.swiftindex 14a27e3..fc26c03 100644--- a/Tests/HaloUITests/WorkspaceUITests.swift+++ b/Tests/HaloUITests/WorkspaceUITests.swift@@ -362,6 +362,66 @@ final class WorkspaceUITests: XCTestCase { app.terminate() } + @MainActor func testContextRolePickerExcludesOwnChildrenAndAllowsExistingAdult() {+ let app = launch()+ openClass(app)+ tap(app.buttons["context.addPerson"])+ tap(app.segmentedControls["context.add.mode"].buttons["Existing person"])+ tap(app.buttons["context.add.existing"])+ XCTAssertTrue(app.buttons["River"].waitForExistence(timeout: 10))+ XCTAssertFalse(app.buttons["Avery"].exists)+ XCTAssertFalse(app.buttons["Jamie"].exists)+ XCTAssertTrue(app.buttons["Mia"].exists)+ screenshot(app, name: "Context role picker excludes own children")+ tap(app.buttons["River"])+ let role = app.textFields["context.add.role"]+ role.tap(); role.typeText("Coordinator")+ tap(app.buttons["context.add.save"])+ XCTAssertTrue(app.staticTexts["Coordinator"].waitForExistence(timeout: 10))+ XCTAssertTrue(app.buttons["context.peer.Mia.Avery"].exists)+ XCTAssertTrue(app.buttons["context.peer.Alex.Avery"].exists)+ app.terminate()+ }++ @MainActor func testLegacyChildRoleStaysReviewableUntilExplicitRemovalAndChildSurvives() {+ executionTimeAllowance = 120+ let app = launch(fixture: "legacy-child-role")+ tap(app.buttons["home.child.Avery"])+ tap(app.buttons["child.seeAll"])+ let review = app.buttons["child.reviewRole.Avery"]+ scrollTo(review, in: app)+ XCTAssertTrue(app.staticTexts["Entries to review"].exists)+ screenshot(app, name: "Child People separates accidental roles for review")+ tap(review)+ let actions = app.buttons["context.participation.role.Avery.Accidental child role"]+ scrollTo(actions, in: app)+ XCTAssertTrue(app.staticTexts["Entries to review"].exists)+ XCTAssertTrue(app.buttons["role.Avery"].exists)+ screenshot(app, name: "Existing child role is retained for review")+ tap(actions)+ tap(app.buttons["Remove accidental entry…"])+ tap(app.alerts.buttons["Cancel"])+ XCTAssertTrue(app.buttons["role.Avery"].exists)+ tap(actions)+ tap(app.buttons["Remove accidental entry…"])+ screenshot(app, name: "Explicit removal of legacy child role")+ tap(app.alerts.buttons["Remove entry"])+ XCTAssertFalse(app.buttons["role.Avery"].exists)+ let page = app.scrollViews.firstMatch+ XCTAssertTrue(page.exists)+ page.swipeDown()+ tap(app.segmentedControls["context.peoplePeriod"].buttons["Past"])+ XCTAssertFalse(app.buttons["role.Avery"].exists)+ app.terminate(); app.launch()+ XCTAssertTrue(app.buttons["home.child.Avery"].waitForExistence(timeout: 10))+ openClass(app)+ XCTAssertFalse(app.buttons["role.Avery"].exists)+ XCTAssertTrue(app.buttons["role.River"].exists)+ XCTAssertTrue(app.buttons["context.peer.Mia.Avery"].exists)+ XCTAssertTrue(app.buttons["context.peer.Alex.Avery"].exists)+ app.terminate()+ }+ @MainActor func testHouseholdOpensReadableMembersAndFocusedEditor() { let app = launch() tap(app.buttons["home.child.Avery"])
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 2474b91..6d15d6e 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -2,10 +2,15 @@ ## [Unreleased] +Own-child Context role source `cec2976` passes focused domain, native, strict lint+and fresh platform gates. The clarified rule uses same-family ChildProfile identity;+legacy entries remain available for explicit review/removal. Exact counts and+historical attempts belong to the implementation evidence document.+ Context removal/identity source `129e7e6` passes affected domain, finalized native, strict lint and fresh platform gates. Complete accidental-entry removal is distinct-from ending participation. Child self identity is rejected; broader child-owned-Context roles await an ownership definition. Exact counts and retained assertion/+from ending participation. Child self identity is rejected; the later clarification excludes all of+the family's own children from Context role holders. Exact counts and retained assertion/ post-case timeout evidence belong to the evidence document. Home/Settings source `20c731a` passes focused domain, native, strict lint and fresh@@ -23,6 +28,11 @@ acceptance. Historical gate entries below describe their own snapshots. ### Fixed +- Exclude this family's own children from the Context teacher/role picker and+ reject their role creation, repeated submissions and edits using ChildProfile+ identity. Keep legacy entries visible for review and explicit removal without+ changing ordinary child connections, memberships, family facts or event roles.+ - Separate ending Context participation from removing an accidental entry entirely; confirm removal of one peer membership or role, including past entries, with stale snapshot and permission checks while retaining the Person and other graph data.
diff --git a/docs/halo_family_design_pack/00-design-document.md b/docs/halo_family_design_pack/00-design-document.mdindex 887e969..220a29a 100644--- a/docs/halo_family_design_pack/00-design-document.md+++ b/docs/halo_family_design_pack/00-design-document.md@@ -201,6 +201,8 @@ Pacifica can first meet Mia at Sophie's birthday, then later share school class Associates a Person with a Context as teacher, coach, educator or another relevant role. These associations do not require peer Connections or separate Adult/Child entity types. Multiple custom roles with optional dates per association are approved; further lifecycle behavior remains open. +The family's own children cannot be Context role holders: a Person with a ChildProfile in the same FamilySpace is excluded, including archived profiles. Other people remain eligible by identity, including peers and separate people with the same name. This restriction applies to ContextPerson creation and role edits, not ordinary child connections, memberships, family facts or event participation. Existing accidental child roles are retained as entries to review and can be explicitly ended or removed from the Context reader; backup, restore and Person merge retain those records for recovery rather than deleting them automatically.+ ### 3.7 PersonRelationship Stores known structural family facts such as:
diff --git a/docs/halo_family_design_pack/01-data-model.md b/docs/halo_family_design_pack/01-data-model.mdindex 7845f4e..249a45f 100644--- a/docs/halo_family_design_pack/01-data-model.md+++ b/docs/halo_family_design_pack/01-data-model.md@@ -355,6 +355,8 @@ ContextPerson Core association for teachers, coaches, educators, coordinators and other Context-associated people. Do not create separate Adult/Child entities or a peer Connection solely to represent these roles. Multiple custom role associations, each with optional start/end dates, are approved. Archiving a Context preserves every role link; dates are entered explicitly. Successor-copy behavior remains a v2 class-rollover decision. +Creation, repeated submissions and role edits reject a Person whose ChildProfile belongs to the same FamilySpace, including archived child profiles. The picker applies the same identity rule; it does not infer eligibility from names, age or peer membership. Existing child-role links remain readable as entries to review, retain backup/restore and merge history, and permit explicit ending or confirmed removal from the Context reader. No automatic cleanup or schema change is required. Ordinary ConnectionContext, family facts and EventPerson participation remain valid for children.+ --- ## 10. PersonRelationship
diff --git a/docs/halo_family_design_pack/10-initial-implementation-results.md b/docs/halo_family_design_pack/10-initial-implementation-results.mdindex bcaec87..9898fbf 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,82 @@ # Implementation evidence +## Own children excluded from Context roles — 2026-10-09 UTC++The user clarified that their own children must be excluded from the teacher/adult-style+Context People list. Source **`cec2976`** applies the identity rule to a Person with a+ChildProfile in the same FamilySpace, including archived profiles. The existing-person+picker filters those identities in its fetch. Both ContextPerson creation routes,+repeated request IDs and role edits validate the current model in the repository write+context, including when a Person gains a ChildProfile during a merge after a form opens.+Different people with the same name, adults and ordinary peer Persons remain eligible.+Ordinary child connections, memberships, family facts and event participation remain valid.+The canonical design/model and [decision log](decision_log.md) record this resolved rule.++Existing accidental child roles are retained under Entries to review. Context and+Child People readers provide the explicit removal route; Context/Person editors withhold+invalid role editing and explain recovery. Ending a legacy role still retains Past;+confirmed removal deletes only that role through the existing permission/stale snapshot+guards. Backup/restore and merges preserve legacy records for review. There is no automatic+cleanup, schema change or store reset. The Debug `legacy-child-role` fixture is explicitly+bounded to an opted-in empty synthetic host store; relaunch does not reseed removed entries.++| Local follow-up key | Requested behavior | Current state |+| --- | --- | --- |+| `halo-child-own-context` | Exclude this family's own children from Context role holders | Clarified, implemented and locally verified at `cec2976`. This local key is not a Transit ID. |+| `halo-context-accidental-entry` | Remove a mistaken association completely while retaining people and other graph data | Previous implementation remains; legacy own-child role removal is now also verified at `cec2976`. |++Final affected evidence:++- **126/126 domain test functions in 10 suites**, 7.721 seconds;+ runner exit 0 in 18.305 seconds. Swift Testing JUnit reports zero failures,+ errors and skips; focused LCOV covers package code, not native host UI. Five new+ regression functions cover both stores and creation routes, archived children,+ identity/name distinctions, duplicate submission, role edits after merge, legacy+ end/removal/reopen and backup retention. Participation, accidental-entry removal,+ connection identity, merge, backup, graph, workspace, account and approved-default+ regressions also pass.+- Strict lint **0 violations/121 files**. Fresh sequential iOS Simulator/macOS Debug+ builds pass, runner exit 0 in 61.582 seconds. No AppIntents extractor diagnostics+ appear. The unchanged HistoryProcessor.swift:55 optional-interpolation warning+ recurs; no new compiler warning is introduced.+- Only the two affected native journeys run: **2/2 pass**, 88.227 seconds;+ runner exit 0 in 102.512 seconds with a finalized result bundle. The role picker+ excludes Avery/Jamie while retaining Mia and adult reuse. The legacy journey enters+ through Child People's separate review section, verifies retained data and cancellation,+ explicitly removes the role, confirms absence from Current/Past and after relaunch,+ and preserves the child, adult role and peer memberships. Actual picker, Child People+ review, Context review and destructive-alert screenshots are inspected. No full UI+ suite or unrelated end/removal journey is rerun; prior evidence below keeps its SHA.+- Four required independent review passes complete. Quality/spec review find the+ alternate Child People teacher presentation, Person role-editor action and missing+ canonical design/model wording; all three are fixed and the two reviewers confirm.+ Reuse and efficiency reviews report no material findings.+- All **162 recorded inputs** remain identical through final domain, app and native+ gates. Pre-run dirty-file backups and hashes show no runner source changes. The two+ pre-existing user project/plist edits are compiled unchanged and excluded from+ commits. The committed icon is unchanged. The evidence follow-up changes docs only.++Development evidence is retained under `/tmp/halo-context-role-child-20261009-m02hoory`.+Two initial new-test compilations stop before any test executes because createEvent+requires a concrete Date; the test is corrected. The development eligibility selection+then passes 5/5 functions (0.383 seconds; runner exit 0 in 7.095 seconds). One lint line+length violation is corrected. Final verification above follows the review fixes and+replaces none of the historical gate evidence.++Artifacts: final Swift Testing JUnit/LCOV and `verification-receipt.json`, 162 input+hashes, pre-run dirty backups, raw domain/platform/native logs, finalized+`ui-final.xcresult`, its summary, attachment manifest and screenshots. The required+personal pre-push review is rendered and archived with Pulsar at+`/Users/arjen/CodeReviews/2026-10/2026-10-09-github-halo-family-branch-feature-relationship-graph.html`;+the preceding review is copied into this run before archive replacement.++No implementation blocker remains for the clarified role scope. The owned synthetic+simulator is shut down and heavy runners have drained. Feature-branch publication+updates draft PR #1; no merge or physical installation occurs. Actual family data,+live CloudKit, account/signing/Contacts and production extension actions are untouched.+Existing sharing/extension/account and broader accessibility/macOS release acceptance+limits remain. Local follow-up keys await actual Transit backfill.+ ## Accidental Context entries and child identity — 2026-10-09 UTC Source **`129e7e6`** separates ending participation from removing an accidental@@ -20,17 +97,17 @@ remain valid history. Four independent review passes found one stale-identity ga a Person merge can repoint ChildProfile.person without changing the profile ID. The frozen row now includes childPersonID and its regression passes. -**The broader "child's own Context" role exclusion remains undefined.** Context+**At this earlier checkpoint, the broader "child's own Context" role exclusion was undefined.** Context belongs to FamilySpace; Context.children means nested Contexts, not child owners. Child Groups projects peer memberships and ContextPerson roles are family-wide. The concrete ambiguity was reported before inferring ownership or excluding legitimate sibling associations. The [accidental-entry decision](decision_log.md)-records this limit; the broad role rule is not claimed complete.+records that checkpoint. The later clarification and implementation above resolve the role rule. | Local pending ticket | Requested behavior | Current state | | --- | --- | --- | | `halo-context-accidental-entry` | Completely remove a mistaken Context association while retaining people and other graph data | Implemented and locally verified at `129e7e6`. This local key is not a Transit ID. |-| `halo-child-own-context` | Prevent a child from being added to their own Context | Self-Connection identity prevention is implemented and verified; family-wide role exclusion awaits a child-ownership definition. This local key is not a Transit ID. |+| `halo-child-own-context` | Prevent a child from being added to their own Context | At `129e7e6`, self-Connection prevention was verified while the role rule awaited clarification; the later section above resolves it. This local key is not a Transit ID. | Final affected evidence: @@ -94,8 +171,8 @@ The owned synthetic simulator is shut down and heavy runners have drained. PR #1 remains a draft on the feature branch. No actual family read/export, live CloudKit write/reset, signing/account change, physical installation, main push or merge is performed. Live sharing/extension/account/Contacts and broader accessibility/macOS-release acceptance retain their existing limits; child-owned roles still require-clarification. The local follow-up keys await actual Transit backfill.+release acceptance retain their existing limits. The later clarification above resolves+the former child-role ambiguity. The local follow-up keys await actual Transit backfill. ## Home administration correction — 2026-10-08 UTC
diff --git a/docs/halo_family_design_pack/decision_log.md b/docs/halo_family_design_pack/decision_log.mdindex 8f6cb0d..e6e4a3b 100644--- a/docs/halo_family_design_pack/decision_log.md+++ b/docs/halo_family_design_pack/decision_log.md@@ -259,3 +259,28 @@ to a malformed self Connection and reject current self Connections in portable i Other children/adults and same-name different people remain valid. Archived self Connections created by a Person merge remain retained history. The broader role rule remains pending clarification; no child ownership schema is inferred from peer links.+++## 2026-10-09: Exclude own children from Context role holders++The user clarified that their own children must be excluded from the teacher/adult-+style Context People list. This resolves the prior ownership ambiguity without+adding a Context owner: reject a Person with a ChildProfile in this FamilySpace,+including archived profiles. Other children represented as ordinary People, adults+and same-name different People remain valid role candidates. Ordinary Connection,+ConnectionContext, family facts and EventPerson participation are unaffected.++Filter the existing-person role picker and enforce the same identity rule in both+role creation APIs, idempotent draft retry and role editing. A Person can become a+child through merging after a picker/editor opens; recheck the model at write time.+Keep stale, family/store, canonical UUID and permission checks in force.++Do not delete or silently rewrite existing invalid roles. They remain readable in+an Entries to review section, with role editing withheld and explicit ending or+confirmed accidental-entry removal available. Backups/restores and merge history+retain existing graph data for review and explicit removal; they do not infer new+interactive role eligibility or automatically clean up associations. The bounded+Debug-only legacy-child-role synthetic fixture exercises this recovery path and+cannot seed a production/account/CloudKit store or reset an existing fixture.++No model migration, live-data mutation, physical installation or merge is authorized.
All clarified Context role requirements are implemented: picker filtering, both creation APIs, duplicate requests, role edits, archived profiles and identity changes; legacy recovery retains data and ordinary child participation remains valid. No task implementation blocker remains. Production sharing/extensions/accounts/Contacts and broader accessibility/macOS release acceptance are outside this synthetic task.
126/126 domain functions in ten suites pass (7.721s; runner 18.305s, exit 0), with zero JUnit failures/errors/skips and focused LCOV. Strict lint is 0/121; fresh sequential iOS Simulator/macOS builds pass (61.582s). Two affected native journeys pass 2/2 (88.227s; runner 102.512s, exit 0) with a finalized result bundle: own-child picker exclusion/adult reuse, and retained legacy-role review/cancel/remove/Past/relaunch with child/adult/peer preservation. The legacy journey enters through Child People recovery. All 162 inputs match through the final app/domain/native gates. User project/plist edits are compiled unchanged and excluded from commits; the icon is unchanged. The known HistoryProcessor compiler warning remains. No full UI rerun or live acceptance is claimed.
Synthetic stores only. User project/plist changes and icon preserved. No actual family data, live CloudKit writes/resets, signing/account changes, physical install, full UI suite, main push or merge. Local follow-up keys await actual Transit backfill.