LifeMate — Personal, Family & Learning Companion

fix/auth-expiry-after-lock
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 1.68 KB

Private learning goal lifecycle

Scope: existing PostgreSQL learning goals, not new AI/wellbeing or sharing.

  1. Add migration0017: monotonically versioned goals, nullable archived timestamp, owner-scoped mutation UUID/request-hash ledger with durable applied version.
  2. Preserve unversioned HTTP clients; their edits also advance goal version. Modern create supplies stable goal UUID + mutation UUID + expectedVersion0; modern edit/archive requires expectedVersion and rejects stale writes409.
  3. Serialize all goal writes by active account row and goal row. Owner checks apply on every read/write; guardian membership never grants private goals. Legacy nonowner reads keep concealed404. Modern foreign-ID writes return403.
  4. Replay an accepted request with the same hash without duplicate writes. Return the current goal, including an archived tombstone, and original mutation acknowledgement. A reused UUID with another body fails409. Keep linked learning check-in history; archive never deletes it.
  5. Flutter HTTP screen: create/read/edit/complete/archive with explicit errors, pending intent and manual sync. Persist intent before sending, validate exact mutation/account/goal/version acknowledgement, namespace by API+account. Unacknowledged or conflicted writes remain recoverable. FakeAPI hub remains available only to existing explicit test clients.
  6. RED/GREEN: real local synthetic PostgreSQL HTTP restart/replay, concurrent stale writes, subject ownership, guardian/other-family denial, archived retry; widget/offline tests for lost acknowledgement, reopen, errors and isolation.

Publication/deployment, real device acceptance and foreign data are out of scope.