LifeMate — Personal, Family & Learning Companion

test/personal-notification-settings
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 187 lines 10.9 KB
Rendered Raw
1 # Reviewed education and consented content feedback
2
3 Status: owner-authorized local implementation packet, 2026-10-09. This spec
4 extends the school-library design after the owner's stricter review requirement.
5 It does not authorize a live migration, external AI, content publication or deploy.
6
7 ## Learning and publication boundary
8
9 Public metadata and a working embed are research leads, not reviewed instruction.
10 Every current researched video remains **DRAFT**. The learner catalogue must not
11 present these as trusted published teaching; the current fully reviewed count is
12 zero. A source can later be Aparat or another legally embeddable free provider,
13 but a new provider needs its own rights, player, privacy and technical review.
14
15 Before publication a human content reviewer watches the complete lesson and
16 checks each explanation, worked step, exercise and answer against the latest
17 official Iranian textbook for the specific grade, track, book code, edition,
18 chapter and pages. The record must identify the official edition/source, video
19 identity, review date/reviewer, precise alignment, omissions, inaccuracies,
20 age-appropriate language and accessibility/clarity limits. Metadata/search checks
21 cannot replace this review. A mismatch, incomplete review, removed video or
22 unknown free-access permission blocks publication. Corrections are versioned and
23 reviewed again; old evidence must not silently certify a changed video or book.
24
25 Grade/track selects curriculum, not intelligence, gender stereotypes, family
26 authority or permanent identity. Learners can begin midyear and revisit any
27 available lesson without deleting older plans/progress. Viewing time and a
28 self-reported completion remain separate from demonstrated understanding.
29
30 ## Pedagogy and assessment specification
31
32 The [public-source evidence review](../../research/learning-evidence-2026-10-09.md)
33 includes the IES2007 instruction/study practice guide, EEF2021 feedback and EEF2025
34 metacognition guidance, plus Khan2024 mastery workflow documentation. These informed the subsequent migration0015 assessment infrastructure in this
35 branch: real server grading, private attempts and explanatory feedback. The
36 feedback router remains separate. No real reviewed question bank or full unit
37 exam is published or certified by either packet.
38
39 For each publishable lesson, record learning objectives and prerequisite concepts;
40 review a short retrieval check after instruction, worked examples and supported
41 practice followed by progressively independent practice. Feedback explains the
42 reasoning and a useful next action, rather than only a score. Offer a later spaced
43 retrieval opportunity and a way to revisit a misconception. Metacognitive prompts
44 ask the learner to plan, explain their approach and reflect, without claiming that
45 confidence or watch duration proves understanding.
46
47 Question wording, correct answers, explanations and plausible distractors require
48 the same textbook/age review. Unit exams should sample the declared objectives
49 and disclose coverage gaps. A mastery threshold, automated adaptive sequence or
50 claim of educational effectiveness needs its own assessment design and evidence;
51 it is not inferred from another product's workflow. Future lesson/quiz versions
52 must be explicit so old attempts are not silently scored against changed answers.
53
54 Adult/family topics—parenting, couples, siblings and work—are future content
55 domains with separate appropriateness and review criteria. They do not create a
56 content-admin grant, change a child's sharing policy or turn AI into a psychologist.
57 Future age-appropriate assistance must not diagnose, claim complete understanding,
58 or automatically expose a child's abuse disclosure to parents/admins. Private chat,
59 notes and health data remain outside this feedback feature.
60
61 ## Consent and feedback flow
62
63 A learner or parent may voluntarily choose a category and write a new summary for
64 the content team. This is a separate explicit action, not permission inherited
65 from a chat, parent role, video click or account settings. The form previews the
66 exact submitted summary and requires an unchecked explicit sharing choice.
67
68 Suggested Persian explanation:
69
70 > فقط همین خلاصه برای بررسی محتوای آموزشی ارسال می‌شود. گفت‌وگو، یادداشت و
71 > اطلاعات سلامت شما همراه آن ارسال نمی‌شود. نام، اطلاعات تماس یا شرح موضوعات
72 > خصوصی و آسیب را در این بازخورد ننویسید. بررسی توسط مسئول محتوا انجام می‌شود؛
73 > دریافت بازخورد به معنی تأیید مشکل یا وعدهٔ اصلاح نیست.
74
75 The API accepts exactly the user's chosen bounded summary; it does not read,
76 summarize, attach or export chat/notes/health. It does not attempt an unreliable
77 PII detector. Plain-text rendering and parameterized SQL protect the transport/
78 display boundary but do not establish that a voluntarily typed summary contains
79 no sensitive information.
80
81 ## Implemented small backend contract
82
83 `createLearningFeedbackRouter({pool, auth})` mounts under `/v1`. Authentication
84 checks the current account/session. Owner identity derives only from it.
85
86 `POST /v1/education/feedback` accepts these fields and rejects unknown fields:
87
88 ```json
89 {
90 "mutationId": "UUID",
91 "unitId": null,
92 "category": "topic_request",
93 "summary": "A new, explicitly chosen summary of up to 1000 characters",
94 "shareWithContentTeam": true
95 }
96 ```
97
98 `unitId` can be null or an existing public-catalogue unit UUID, including a DRAFT
99 unit for reviewer feedback. It does not authorize reading unpublished teaching or
100 any user's progress. Categories are `inaccurate`, `edition_mismatch`,
101 `broken_video`, `unclear`, and `topic_request`. The summary is a nonblank string,
102 at most1000 Unicode code points, with no NUL. Consent must be literal `true`.
103 Owner/child overrides, private-chat attachments and other fields are rejected.
104
105 New submissions return201; identical owner-scoped mutation retries return200 with
106 the same feedback ID. A canonical request hash detects changed-payload UUID reuse
107 and returns409. The acknowledgement names the mutation and feedback ID with
108 `accepted` or `already_applied`; receipt is not a promise that the report is correct.
109
110 Feedback response fields are `id`, `mutationId`, `unitId`, `category`, `summary`,
111 `shareWithContentTeam`, `status`, `version`, `createdAt`, `updatedAt` and
112 `withdrawnAt`. No account/contact, chat, note or health fields are returned.
113 New status is `received`. Durable per-user rolling limits are5 new submissions
114 per hour and20 per day;429 includes `Retry-After`. Identical retries do not consume
115 quota, and withdrawal/restart does not reset it. Owner-row locking makes
116 concurrent retries and limit checks atomic.
117
118 `GET /v1/me/education-feedback` returns only the caller's rows, newest first,
119 up to100 per page with an optional UUID `cursor` and `nextCursor`. No `childId`,
120 owner override or family-role read is available. A cursor must belong to the same
121 caller; missing/foreign cursor IDs use the same404 result.
122
123 `DELETE /v1/me/education-feedback/:id` withdraws only the caller's feedback and
124 returns204, including a repeated withdrawal. Missing/foreign IDs return404.
125 Withdrawal removes the stored summary and sharing consent and increments the
126 version once. Minimal ID/request-hash/time/category/unit tombstone remains for
127 idempotency and rate limits. A matching POST retry returns that redacted tombstone
128 and never republishes its old summary; changed payload still returns409. There is
129 no guarantee of retracting something a future authorized reviewer already read.
130
131 Migration0014 adds only `learning_content_feedback`, linked to `app_user` and
132 `learning_unit` from0013. Existing migrations/checksums remain unchanged. The shared
133 runtime role policy must cover this table; no new content-admin role is granted here.
134
135 ## Human review and future operations
136
137 Stored review statuses are `received`, `triaged`, `planned`, `released`, `declined`;
138 withdrawal is separate. This packet provides no status-update/admin/other-user API,
139 exporter, email/SMS sender, external AI or automation trigger. Real moderation and
140 review-team access remain a future explicit policy. Until then, any manual database
141 inspection is limited to separately approved local synthetic fixtures.
142
143 The intended future owner workflow is: consented summary → manual content triage
144 → approved, minimized R&D brief → developer work → tests/review → versioned PR.
145 Never use raw private chat as an R&D brief and never auto-publish/deploy from a
146 feedback row. A released status requires a human-reviewed actual change; receipt
147 must not be presented as an automatic improvement promise.
148
149 ## Acceptance and limits
150
151 Use actual loopback HTTP and migrated synthetic PostgreSQL to verify consent and
152 input rejection, owner/family/outsider isolation, hash conflicts and concurrent
153 duplicate suppression, real restart persistence, per-user durable hourly/daily
154 limits, withdrawal and tombstone retries. Seed unrelated private chat-like/notes/
155 health records only in synthetic fixtures and prove the feedback result/logs never
156 contain them. Inspect SQL state independently of HTTP responses. Register the
157 router in the real entrypoint through the coordinating owner, not a fake auth handler.
158
159 No media review, published teaching, pedagogical effectiveness, quiz engine,
160 real feedback administration, real delivery or live migration is certified by
161 these backend tests. Each remains a separate acceptance gate.
162
163 ## Actual backend verification, 2026-10-09
164
165 Migration0014 was applied only to the existing isolated local synthetic test
166 database after the library migration0013 and an exclusive test window were
167 confirmed. The unchanged migrator checked the prior ledger and applied the new
168 table. No live database or privilege transition ran.
169
170 Node22.23.3 input tests were first observed failing2/2, then passing2/2. The actual
171 production entrypoint/HTTP/PostgreSQL run first passed those2 and failed all8 new
172 route cases with404 before implementation. Final focused run passed10/10 with
173 zero failures/skips, including consent rejection, guardian/admin isolation,
174 independent SQL checks, concurrent retry/quota enforcement, a real API process
175 restart, redacted tombstone retry,20/day quota and100-row paging with preserved
176 microsecond cursor boundaries.
177
178 The final complete backend runner passed **145/145**, zero failures/skips, in26.13s.
179 An earlier144/145 run exposed a library test assertion that queried a stable unit
180 without its owner filter; the library owner corrected the test and the complete
181 suite was rerun. This was not a feedback product failure. Syntax and repository
182 diff checks passed. The synthetic database window was then released.
183
184 The coordinating owner registers the router and updates the shared runtime table
185 policy. Client feedback/withdrawal and malformed-ack behavior are independently
186 owned and must receive their own final acceptance; backend PASS is not a claim
187 that the frontend, administration, teaching or deployment is complete.