LifeMate — Personal, Family & Learning Companion

feat/standalone-weekly-planner
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 23 lines 3.38 KB
Rendered Raw
1 # LifeGuide school lifecycle editor
2
3 Status: authorized local implementation; live migration and hardware acceptance are UNVERIFIED.
4
5 School remains an owner-private life context, independent of family permission and profile category. Existing subject/class APIs and linked homework/history are preserved. An explicit Persian RTL editor replaces quick setup that assumed September–June and created mathematics automatically.
6
7 ## API and persistence
8
9 GET `/v1/school/lifecycle` returns `{contexts, years, terms, fetchedAt}` including inactive history, bounded to 500 rows per entity. Parent and guardian grants never permit lifecycle writes or private lifecycle reads. Dates are ISO Gregorian calendar dates; the interface identifies the calendar explicitly, accepts Persian digits and offers a date picker. The user chooses titles, context and date boundaries.
10
11 POST `/v1/school/lifecycle/{contexts|years|terms}/mutations` accepts `{mutationId, entityId, operation, expectedVersion, data}`. Create uses a client UUID and expected version zero; update/archive use the actual server version. The account-scoped hash ledger prevents duplicate inserts after a lost acknowledgement or restart. Changed reuse of a mutation UUID fails; stale expected versions fail with 409. Exact retries return current entity state and the original applied version/acceptance time, rather than resurrecting an old snapshot. Archived entities cannot be restored by this API.
12
13 The owner row serializes mutations. PostgreSQL triggers enforce ownership, active ancestors, student context for academic years, nested dates, class recurrence boundaries and parent-date edits on existing history even through legacy insert/update paths. Parent archival preserves every child row and linked task; descendant writes stop while its ancestor is inactive. No delete cascade is used by lifecycle operations.
14
15 ## Client operation
16
17 Lifecycle mutation intent is persisted before network transmission using the existing account+endpoint store and stable UUID. Pending mutations are retried manually with exactly the same body. A pending create must be acknowledged before a child is attached; setup is deliberately explicit rather than an opaque sequence of non-idempotent writes. Pending/conflict state, last server receipt and archive effects are visible. Conflicts remain stored until the user explicitly selects current server state; server selection journals the local intent before removal.
18
19 Subject/class creation and existing editing use the real existing API. These endpoints are not idempotent, so an uncertain delivery is never automatically retried. The editor refetches current data and asks the user to inspect it before making a new request. No fabricated server acknowledgement is shown. No private school data is shared merely because the viewer is a parent.
20
21 ## Acceptance
22
23 Real synthetic PostgreSQL plus the real HTTP entrypoint must prove create/read/update/archive, process restart, same-body lost-ACK replay, payload reuse rejection, version conflicts, cross-owner denial, invalid and out-of-parent dates, ancestor archive across both new and legacy paths, and retained linked homework. Flutter substitutes must prove explicit date selection/no hard-coded default subject, durable pending mutation/reopen/exact-body retry, malformed ACK rejection, account isolation and subject/class unknown-commit handling. Device/Safari and live migration remain UNVERIFIED until run separately.