LifeMate — Personal, Family & Learning Companion

fix/auth-abuse-expiry-safety
chore/phase1-repository-cleanup deploy/stable-web-apk deployment-static design/mobile-accessibility-v2 design/mobile-navigation-review docs/child-education-access-decision docs/offline-data-rescue-options docs/owner-guide-and-delivery-plan docs/phase1-policy-options docs/public-review-live-2026-10-15 feat/aparat-learning-library feat/child-device-safety feat/child-identity-schema feat/flutter-mobile-navigation feat/learning-content-operations feat/local-signing-preflight feat/online-family-stage0 feat/personal-encrypted-recovery feat/private-planner-series-api feat/public-review-page feat/standalone-weekly-planner feat/weekly-planner-android final-feature-1/iran-family-school fix/auth-abuse-expiry-safety fix/auth-expiry-after-lock fix/backend-request-safety fix/lifeguide-bootstrap-naming-ci fix/lifeguide-pages-qa-base-preflight fix/lifeguide-qa-pages-env-deployment fix/local-task-persistence fix/managed-child-session-boundary fix/personal-jalali-dates fix/personal-notification-controls fix/personal-upgrade-delivery-guard fix/sms-approval-gates fix/study-duration-display infra/cloudflare-neon-migration infra/lifeguide-cloudflare-qa infra/lifeguide-github-pages-qa infra/lifeguide-supabase-qa main phase-1/foundation-completion phase-2/product-foundation-identity phase-3/planner-school-family-core phase-4/ai-learning-wellbeing phase-5/hardening-observability-release test/android-reminder-acceptance test/personal-notification-settings test/personal-recovery-acceptance test/role-entry-apk
md 52 lines 3.28 KB
Rendered Raw
1 # LifeGuide — family lifecycle
2
3 Local synthetic implementation only; no live privilege changes or migration.
4 Family administration remains a current server-side membership capability. A
5 profile category/theme is never a grant of family authority.
6
7 Administrators list raw-pending invitations with a masked recipient hint and
8 current expiry status, then revoke with an explicit UUID/version mutation. No
9 token, digest or full contact is returned by the list/revoke API. Existing one-time
10 creation/link delivery is retained. Acceptance and lifecycle writes share the
11 family row lock, and expiry/session are checked after waiting.
12
13 Role changes and atomic admin transfer require active accounts/membership and
14 current admin authority. Version triggers cover legacy role/admin/end/rejoin and
15 invitation updates. Every mutation uses an actor-scoped hash receipt; retries
16 return current state rather than repeating changes. After transfer, an active
17 former administrator can acknowledge only the exact previously accepted mutation;
18 that does not allow a new privileged operation.
19
20 Transfer promotes the chosen active adult member and demotes the caller in one
21 transaction, preserving an active administrator. Teen-role targets and people
22 with a known under-18 birth date cannot become admins. Teen-to-adult role upgrades
23 require a known adult birth date. Existing adult-role members with no birth date
24 can receive explicit administrator transfer. Self-reported birth dates are not
25 legal age verification; consent/age assurance remains a separate gate.
26
27 Incompatible guardian links are deactivated. A role change removes affected
28 selected-member plan grants, which must be explicitly chosen again; restoring a
29 role never restores those links or grants. Transfer revokes the old administrator's
30 pending invitations so transferring back cannot revive old tokens. Archive,
31 membership removal and existing last-administrator protection remain in place.
32
33 Acceptance uses the actual entrypoint and independent PostgreSQL checks for
34 unauthorized/cross-family access, bounded projection/paging, CAS/retry/restart,
35 minor/disabled/ended-member rejection, one surviving admin under races, guardian
36 and selected-grant invalidation, and invite expiry/revocation while lock-blocked.
37 Physical-device and live-server acceptance remain UNVERIFIED.
38
39 The lock order is family row, all participating accounts in UUID order, their
40 editable profile rows in UUID order, then their memberships in UUID order. This
41 also serializes reciprocal writes across different families without actor-first
42 account deadlocks. The current age context is locked separately because profile
43 editing does not acquire the account lock. At commit, the session row is held
44 with `FOR SHARE`, then a separate statement checks current session and JWT expiry
45 using fresh database time after any lock wait; a failed check rolls back writes,
46 audit and mutation receipt together. No fixed sleep substitutes for a lock in
47 the race tests; they observe the real wait graph through `pg_blocking_pids`.
48
49 Known under-18 birth dates also prevent obtaining administration through new
50 family creation. Legacy family writes and invitation acceptance retain their
51 existing APIs and receive the same final current-session gate in the root-owned
52 server integration. Self-reported age remains an unverified legal/consent gate.